[go: up one dir, main page]

CN117851012B - Multi-task COS operating system, operation method, computer equipment and storage medium - Google Patents

Multi-task COS operating system, operation method, computer equipment and storage medium Download PDF

Info

Publication number
CN117851012B
CN117851012B CN202410023527.XA CN202410023527A CN117851012B CN 117851012 B CN117851012 B CN 117851012B CN 202410023527 A CN202410023527 A CN 202410023527A CN 117851012 B CN117851012 B CN 117851012B
Authority
CN
China
Prior art keywords
operating system
receiving
module
current
messenger
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410023527.XA
Other languages
Chinese (zh)
Other versions
CN117851012A (en
Inventor
李果
廖楚京
叶佩珊
袁小凯
黄世平
曲骏宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Nanwang Scientific Research Technology Co ltd
Original Assignee
Guangzhou Nanwang Scientific Research Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Nanwang Scientific Research Technology Co ltd filed Critical Guangzhou Nanwang Scientific Research Technology Co ltd
Priority to CN202410023527.XA priority Critical patent/CN117851012B/en
Publication of CN117851012A publication Critical patent/CN117851012A/en
Application granted granted Critical
Publication of CN117851012B publication Critical patent/CN117851012B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • G06F9/4887Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues involving deadlines, e.g. rate based, periodic
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention discloses a multi-task COS operating system, an operating method, computer equipment and a storage medium, wherein the operating method comprises the following steps: when the operating system is in an initialized state, acquiring the priority and time slices of each process in the operating system, checking the timer according to the time slices of the current process, and triggering timer interruption after the timer is finished, judging whether the time slices of the current process are expired or not at the moment, if so, entering a process scheduling step: and context stacking is carried out on the current process in the field in the operating system, the highest priority process in the context stacking is further obtained in the operating system, the highest priority process is in a ready state, and the highest priority process is popped or executed. If not, continuing to execute the current process until the current process is completed; by adopting the arrangement, the parallel operation capability of the chip can be fully exerted, the throughput efficiency of the system is improved, the response time of the emergency instruction is optimized, and meanwhile, the system has certain system expansibility.

Description

Multi-task COS operating system, operation method, computer equipment and storage medium
Technical Field
The invention belongs to the technical field of embedded operating systems, and particularly relates to a multi-task COS operating system, an operating method, computer equipment and a storage medium.
Background
COS (Chip Operating System) operating systems are widely used in the embedded technology field, and in the prior art, the system executes main logic codes in a polling mode and cooperates with various interrupt events caused by an interrupt source of an executing device in an interrupt mode. As shown in fig. 1, when the COS system in the prior art operates, the device is first initialized, then a judging step is performed, and then an instruction list service logic step is entered, after the instruction list service logic step, the step may be subjected to interrupt/interrupt processing, and then the judging step is re-entered, or the operation is directly ended.
In an actual service scenario, the COS system executes corresponding service codes according to different service instructions. As shown in fig. 2, in the prior art, an instruction list is provided in the COS system, the specific instruction content is determined by the service module, the system sequentially executes service logic according to the sequence of receiving the instructions, and the execution result is returned from the system communication interface.
It can be seen that, in the existing COS system, the service instructions are sequentially executed in a serial manner according to the instruction receiving order, only after the previous instruction is executed and a response is given, the second service instruction can be continuously executed and a response result is given, and the running method generally occurs:
1) If the previous instruction processing time is longer, the communication is dead, and the processing efficiency is reduced;
2) If an instruction is abnormal, the system logic is caused to enter an abnormal state;
3) If each hardware submodule in the chip supports parallel processing, the parallel processing capacity of the chip cannot be effectively utilized;
4) The external real-time critical emergency instructions cannot be responded in time.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention aims to provide a multi-task COS operating system, an operating method, computer equipment and a storage medium, which can fully exert the parallel operation capability of chips, improve the throughput efficiency of the system, optimize the response time of emergency instructions and have certain system expansibility.
The aim of the invention is achieved by the following technical scheme:
A method of operating a multitasking COS operating system, comprising the steps of:
Step one: when the operating system is in an initialized state, acquiring the priority and time slices of each process in the operating system, checking the timer of the operating system at regular time according to the time slices of the current process, and after the timing is finished, triggering the timer interrupt of the operating system, judging whether the time slices of the current process are expired at the moment, if so, entering a process scheduling step; if not, continuing to execute the current process until the current process is completed.
Step two: in the process scheduling step, the current process is context-pushed in the operating system, the highest priority process in the current process is further acquired in the operating system, the highest priority process is in a ready state, and the highest priority process is popped or executed.
Further, the process scheduling step includes scheduling of a receiving and transmitting process, scheduling of a messenger process, scheduling of a service process and scheduling of a security process, and the receiving and transmitting process, the scheduling of the messenger process, the scheduling of the service process and the scheduling of the security process are sequentially ordered according to the priority from high to low.
Further, the scheduling step of the transceiving process includes: judging whether communication IO interruption is triggered when an operating system runs a current process, if yes, resetting the remaining time slices of the current process by using the operating system, then entering a process scheduling step, performing context stacking on the current process in the operating system, then acquiring a receiving and transmitting process, performing stack ejection or execution on the receiving and transmitting process in the operating system by using a receiving and transmitting process module, so that the receiving and transmitting process module receives data, and storing the received data into a storage address RAM appointed by a messenger process when the receiving and transmitting process performs data receiving operation; if not, continuing to execute the current process until the current process is completed.
Further, the step of scheduling the messenger process includes: when the operation system runs the receiving and transmitting process or the business process is finished, the timer of the operation system is triggered by interruption, a process scheduling step is entered, the current process is subjected to context stacking in the operation system on site, the messenger process in the current process is further obtained in the operation system, the messenger process is in a ready state, and the messenger process is popped or executed;
further, when the messenger process is immediately after the receiving and transmitting process is finished, the messenger process module independently stores the data stored in the storage RAM address by the receiving and transmitting process module into the corresponding fixed block, and the messenger process module further transmits the data stored by the receiving and transmitting process module into the corresponding business process module in a fixed block mode;
When the messenger process is immediately after the business process is finished, the messenger process module independently stores the data transmitted by the business process module in the corresponding fixed block, the messenger process module further transmits the data stored by the received business process module to the receiving and transmitting process module in a fixed block mode, and finally the response data of the business process module is returned to the outside through the receiving and transmitting process module.
Further, the scheduling step of the business process includes: when the operating system runs the current process, the communication IO is interrupted and triggered, whether the communication IO interruption is triggered or not is judged, if yes, the operating system is utilized to clear the remaining time slices of the current process, then a process scheduling step is entered, context stacking is carried out on the current process in the operating system, then service processes are acquired, the service processes are sequenced from high to low according to the priority by utilizing the service process module to form a queue, then the service processes are popped or executed in sequence, and response data generated when the service process module pops or executes the service processes are stored in a storage RAM of the messenger process module; if not, continuing to execute the current process until the current process is completed.
Further, in the service process, for the service process queues ready with the same priority, the service process queues are sequenced in sequence according to data transmission to form corresponding queues, and then the service process modules are utilized to pop or execute a plurality of service processes.
Further, the step of scheduling the security process includes: when other processes are in a dormant state, the operating system directly schedules the security process, and the security process module adopts an active security policy and can perform security check operations such as integrity self-check, random number self-check, algorithm self-check and the like on the firmware of the operating system according to actual scene requirements.
Furthermore, after the security process is finished, the security process module is positioned at the corresponding self-checking zone bit in the operating system, and when the outside needs to acquire the information, the state of the zone bit can be quickly returned.
A multitasking COS operating system, for use in a method of operating system operation, comprising:
the timer is used for timing the time slices of each process in the operating system, checking whether the current process time slice is expired, and triggering the timer interrupt when the process is expired;
communication IO used for triggering IO interruption in the operation process of the operating system;
the receiving and transmitting process module is used for receiving external instruction data and returning system response data to the outside;
The messenger process module is used for data transmission and maintenance of data stored in the data area RAM;
the data area RAM is divided into fixed blocks with different sizes, the fixed blocks are operated in a linked list mode, and the fixed blocks are used for storing independent data;
the business process module is used for business logic processing and adding corresponding business processes according to different business quantity;
The security process module is resident in the memory of the operating system, and is used for performing security check operations such as fixed integrity self-check, random number self-check, algorithm self-check and the like on the operating system under the control of the scheduler when other processes are in a dormant state.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method described above when the computer program is executed.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the above method.
The invention has the following beneficial effects:
The running method of the multi-task COS operating system can schedule the process with higher priority after the running of the current process of the operating system is finished, so that the ready process with higher priority can timely pop up or execute the process, the operating system can timely process the emergency or key process, the situations that the operating system is dead or the like or the system logic enters an abnormal state in the running process can be reduced, the operating system can effectively utilize the chip parallel capacity, and timely respond to external real-time key emergency instructions.
The invention relates to a multi-task COS operating system, which mainly comprises a timer, a communication IO, a receiving and transmitting process module, a messenger process module, a data area RAM, a business process module, a security process module and a system extensible module, wherein the timer can be interrupted after timing according to a time slice of a corresponding process, the communication IO can interrupt the running process of the current operating system according to the priority order according to the current process needing to be operated so as to enter a process scheduling step in advance, so that a process with the front priority is scheduled to be formed, and the process with the front priority is enabled to execute operation preferentially; when forming the schedule, the corresponding process is scheduled according to the priority order and the actual situation, wherein the process of the transceiver process module is scheduled preferentially, the process of the messenger process module is processed secondarily, the process of the business process module is processed finally, and the process of the security process module is processed finally, by adopting the order, the information sent by the outside can be processed and stored in time and preferentially, thereby being convenient for processing related business perfectly in real time, and finally, the security process module can be utilized for carrying out security check on an operating system when the rest processes are in a dormant state so as to improve the security of the operating system; meanwhile, by setting the system extensible module, the transceiver process module can receive and process signals of different communication interface protocols. Compared with the COS system in the prior art, the COS operation system can execute the main logic code only in a polling mode, and can utilize the current process of the communication IO terminal according to the priority status of the newly added process in the process of executing the main logic code, so that the process with high priority is preferentially processed, the processing efficiency is improved, dead states and the like caused by the communication process are reduced, the system throughput efficiency is improved, the response time of an emergency instruction is optimized, and the system expansibility is provided.
The method comprises the steps of a method for operating a multi-task COS operation system, so that the operating system in the computer device reduces the situations that the operating system is dead or the system logic enters an abnormal state in the operation process, the operating system can effectively utilize the chip parallel capacity, and external real-time critical emergency instructions can be responded timely.
A computer readable storage medium, on which a computer program is stored, the computer program when executed by a processor being capable of running steps of an operation method of a multi-task COS operating system, so that the operating system in a computer device reduces situations that the operating system is dead or the system logic enters an abnormal state during the running process, so that the operating system can effectively utilize the chip parallelism and timely respond to external real-time critical emergency instructions.
Drawings
FIG. 1 is a prior art COS system frame diagram.
FIG. 2 is a prior art COS system business flow diagram.
FIG. 3 is a flow chart of the multi-tasking COS system of the present invention.
Fig. 4 is a flow chart of the transceiving process according to the present invention.
Fig. 5 is a schematic diagram of the messenger process of the present invention.
Fig. 6 is a flow chart of a business process of the present invention.
Detailed Description
The application will now be described in further detail with reference to the drawings and to specific examples. The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
Example 1
A multitasking COS operating system as shown in fig. 3-6 employing a time slice rotation preemptible priority scheduling policy while defining priorities as 0-7,8, where 0 is the highest priority and 7 is the lowest priority, the operating system comprising:
The timer is used for timing and/or timing the time slices of each process in the operating system, checking whether the time slices of the current process are expired, and when the current process is expired, triggering the timer interrupt;
The priority of the communication IO interrupt hardware is higher than that of the system timer hardware interrupt, and the communication IO interrupt hardware is used for triggering IO interrupt in the operation process of the operating system so as to enable the CPU to prioritize corresponding IO interrupt;
the receiving and transmitting process module is used for receiving external instruction data and returning system response data to the outside, and has 0 priority;
The messenger process module is used for data transmission and maintenance of the data stored in the data area RAM, and has a priority of 1; according to different chip hardware modules, the messenger process can use a public storage RAM or a DMA mode to carry out data movement;
A data area RAM, which is divided into a plurality of fixed blocks with different sizes (for example, 256 bytes, 512 bytes and 1024 bytes), wherein each fixed block is operated in a linked list mode and is used for storing data (as shown in figure 5);
The business process module is used for business logic processing, corresponding business processes are added according to different business quantity, and the selectable priority of each business process is 2-6; the emergency instruction can be set as a service process independently, the priority of the process is set in front, and the common service process can also be selected to use the same priority (when the process is scheduled, the process ready with the same priority is executed in sequence according to the FIFO arrangement mode);
The security process module is resident in the memory of the operating system, and when other processes are in a dormant state, the security process adopts an active security policy under the control of a scheduler and is used for performing security check operations such as fixed integrity self-check, random number self-check, algorithm self-check and the like on the operating system according to actual scene requirements.
And the system expandability module performs expansion adaptation (such as USB, SPI and the like) on the transceiving process module according to different communication interface protocols. The transceiver process module provides HookDriverHandle interfaces, standardizes the driving interfaces and can be expanded into specific examples according to different protocol types. When a different communication interface protocol is instantiated, if the protocol has no corresponding operation, the operation function can be set aside for processing.
In summary, the multi-task COS operating system of the present invention mainly comprises a timer, a communication IO, a transceiver process module, a messenger process module, a data area RAM, a service process module, a security process module and a system extensible module, wherein the timer can be interrupted after timing according to a time slice of a corresponding process, and the communication IO can interrupt a process running in the current operating system according to a priority order according to a process currently required to operate, so as to enter a process scheduling step in advance, so as to schedule a process with a front priority to perform operation preferentially; when forming the schedule, the corresponding process is scheduled according to the priority order and the actual situation, wherein the process of the transceiver process module is scheduled preferentially, the process of the messenger process module is processed secondarily, the process of the business process module is processed finally, and the process of the security process module is processed finally, by adopting the order, the information sent by the outside can be processed and stored in time and preferentially, thereby being convenient for processing related business perfectly in real time, and finally, the security process module can be utilized for carrying out security check on an operating system when the rest processes are in a dormant state so as to improve the security of the operating system; meanwhile, by setting the system extensible module, the transceiver process module can receive and process signals of different communication interface protocols.
Compared with the COS system in the prior art, the COS operation system can execute the main logic code only in a polling mode, and can utilize the current process of the communication IO terminal according to the priority status of the newly added process in the process of executing the main logic code, so that the process with high priority is preferentially processed, the processing efficiency is improved, dead states and the like caused by the communication process are reduced, the system throughput efficiency is improved, the response time of an emergency instruction is optimized, and the system expansibility is provided.
Example 2
The invention further discloses an operation method of the multi-task COS operation system based on the multi-task COS operation system of the embodiment 1, as shown in FIG. 3, the operation method comprises the following steps:
Step one: when the operating system is in an initialized state, acquiring the priority and time slices of each process in the operating system, checking the timer of the operating system at regular time according to the time slices of the current process, and after the timing is finished, triggering the timer interrupt of the operating system, judging whether the time slices of the current process are expired at the moment, if so, entering a process scheduling step; if not, continuing to execute the current process until the current process is completed.
Step two: in the process scheduling step in the step one, context stacking is carried out on site on the current process in the operating system, the highest priority process in the context stacking is further obtained in the operating system, the highest priority process is in a ready state, and the highest priority process is popped or executed.
In the process scheduling step of the second step, the process scheduling step comprises the steps of scheduling a receiving process, scheduling a messenger process, scheduling a service process and scheduling a security process, and the steps of scheduling the receiving process, the messenger process, the service process and the security process are sequentially ordered according to the priority from high to low.
In the scheduling step of the transceiving process, as shown in fig. 4, a transceiving process module is mainly adopted, when an operating system runs a current process, a communication IO receives a process signal (such as a critical emergency instruction) with higher priority than the current process, or when an external signal is received, the communication IO is interrupted and triggered, so before other processes are scheduled, whether the communication IO is interrupted or not needs to be judged, if yes, the operating system is utilized to clear the remaining time slice of the current process, then the process scheduling step is entered, the current process is subjected to context stacking in the operating system, then the transceiving process is acquired, the transceiving process is subjected to spring stack or execution in the operating system by the transceiving process module, so that the transceiving process module receives data, and when the transceiving process module receives data, the transceiving process module stores the received data into a storage address RAM (the storage address RAM is a corresponding storage address in a data area RAM of embodiment 1) designated by the messenger process; if not, continuing to execute the current process until the current process is completed.
Therefore, the COS operating system is enabled to preferentially process the high-priority process, and further process other flat-level processes or low-priority processes, so that the situations that the operating system is dead or the system logic enters an abnormal state in the running process are reduced, the chip parallelism capacity can be effectively utilized by the operating system, and the external real-time critical emergency instructions can be responded timely.
As for the scheduling step of the messenger process, as shown in fig. 5, a messenger process module is mainly used, and the scheduling step of the messenger process generally processes the data received by the receiving and sending process or the response data processed by the business process immediately after the receiving and sending process or the business process is completed.
The method specifically comprises the following steps: when the operating system runs the receiving and transmitting process or the service process, the timer of the operating system is triggered in an interruption way, whether the time slice of the current receiving and transmitting process or the service process is expired is judged, if yes, a process scheduling step is entered, the current process is subjected to context stacking on site in the operating system, the messenger process in the current process is further obtained in the operating system, the messenger process is in a ready state, and the messenger process is popped or executed; if not, continuing to execute the current process until the current process is completed.
In the messenger process, the messenger process module independently stores the data stored in the storage RAM address by the transceiver process module in a corresponding fixed block (the fixed block is a memory block as in fig. 5), and the messenger process module further transmits the data stored by the transceiver process module to a corresponding business process module in a fixed block mode; after receiving the messenger process module, the business process module makes a corresponding response, the business process module stores the response data into a storage address RAM of the messenger module, the messenger process module further independently stores the data transmitted by the business process module into a corresponding fixed block, the messenger process module further transmits the data stored by the received business process module into a receiving and transmitting process module in a fixed block mode, and finally the response data of the business process module is returned to the outside through the receiving and transmitting process module.
Therefore, when the messenger process maintains the data area RAM, the data stored in the storage address RAM is independently stored into independent fixed blocks to be independently transmitted, so that the management is convenient, and meanwhile, the data can be divided into a plurality of blocks with different fixed block sizes (for example, 256 bytes/512 bytes/1024 bytes) according to the actual requirements of a service scene, so that each fixed block is operated in a linked list mode. The message process module is utilized to completely and well transmit the received data of the receiving and transmitting process module to the corresponding business process module, the response data given by the business process module, especially the emergency command, cannot be completely and well fed back to the receiving and transmitting process module, and finally, the response data are transmitted to the outside, so that the operating system can timely respond according to the received data and/or the response data, the situations that the operating system dies or the system logic enters an abnormal state in the running process are reduced, the chip parallelism capacity can be effectively utilized by the operating system, and timely response can be carried out on external real-time critical emergency commands in time.
In the step of scheduling the business process, as shown in fig. 6, a business process module is mainly used, and the scheduling of the business process generally corresponds to the data received by the receiving and transmitting process in time, so that the data received by the receiving and transmitting process is generally corresponding to the data received by the receiving and transmitting process in time immediately after the receiving and transmitting process or the messenger process is completed.
Specifically, when an operating system runs a current process, a communication IO is interrupted and triggered, whether the communication IO interruption is triggered or not is judged, if yes, the operating system is utilized to clear the remaining time slices of the current process, then a process scheduling step is entered, context stacking is carried out on the current process in the operating system, then service processes are obtained, a plurality of ready service processes are ordered from high to low according to priority by utilizing a service process module to form a queue, then a plurality of service processes are popped or executed in sequence, and response data generated when the service process module pops or executes the plurality of service processes are stored in a storage RAM of a messenger process module; if not, continuing to execute the current process until the current process is completed.
In the service process, aiming at the service process queues ready with the same priority, the data transmission sequence is used for forming corresponding queues (FIFO mode), and then the service process modules are utilized to pop or execute a plurality of service processes.
Therefore, the business process module can sequentially pop up or execute according to different priorities of the business processes according to the queues, so that the situations that an operating system dies or the system logic enters an abnormal state in the running process are reduced, the operating system can effectively utilize the chip parallelism capability, and the external real-time critical emergency instructions can be responded timely.
In the step of scheduling the security process, a security process module is mainly adopted, and is resident in the memory of the operating system, and the operating system schedules the security process when other processes are in a dormant state. Specifically, when other processes are in a dormant state, the operating system directly schedules the security process, and the security process module adopts an active security policy and can perform security check operations such as integrity self-check, random number self-check, algorithm self-check and the like on the firmware of the operating system according to actual scene requirements (for example, a part of the system or the module can fail or invade).
After the security process is operated, the security process module is positioned at the corresponding self-checking zone bit in the operating system, and when the outside needs to acquire the information, the state of the zone bit can be quickly returned.
Therefore, the security process module can perform security check operations such as integrity self-check, random number self-check, algorithm self-check and the like on the firmware of the operating system in an active mode under the condition that other processes of the operating system are in a dormant state, so that the security in the running process of the operating system is improved, and meanwhile, the security process module can be placed in corresponding self-check mark bits so as to acquire and return in time, so that the searching is convenient.
In summary, the operation method of the multi-task COS operating system of the present invention can schedule the process with higher priority after the operation of the current process of the operating system is finished, so that the ready process with higher priority can be popped up or executed in time, so that the operating system can process more urgent or critical processes in time, and the situations that the operating system dies and the like or the system logic enters an abnormal state in the operation process can be reduced, so that the operating system can effectively utilize the chip parallel capability, and can respond to the external real-time critical emergency instructions in time.
Example 3
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor when executing the computer program implementing the steps of the method of operation as in embodiment 2 with respect to a multi-tasking COS operating system:
Step one: when the operating system is in an initialized state, acquiring the priority and time slices of each process in the operating system, checking the timer of the operating system at regular time according to the time slices of the current process, and after the timing is finished, triggering the timer interrupt of the operating system, judging whether the time slices of the current process are expired at the moment, if so, entering a process scheduling step; if not, continuing to execute the current process until the current process is completed.
Step two: in the process scheduling step in the step one, context stacking is carried out on site on the current process in the operating system, the highest priority process in the context stacking is further obtained in the operating system, the highest priority process is in a ready state, and the highest priority process is popped or executed.
In the process scheduling step of the second step, the process scheduling step comprises the steps of scheduling a receiving process, scheduling a messenger process, scheduling a service process and scheduling a security process, and the steps of scheduling the receiving process, the messenger process, the service process and the security process are sequentially ordered according to the priority from high to low.
Example 4
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of operating the multitasking COS operating system of embodiment 2:
Step one: when the operating system is in an initialized state, acquiring the priority and time slices of each process in the operating system, checking the timer of the operating system at regular time according to the time slices of the current process, and after the timing is finished, triggering the timer interrupt of the operating system, judging whether the time slices of the current process are expired at the moment, if so, entering a process scheduling step; if not, continuing to execute the current process until the current process is completed.
Step two: in the process scheduling step in the step one, context stacking is carried out on site on the current process in the operating system, the highest priority process in the context stacking is further obtained in the operating system, the highest priority process is in a ready state, and the highest priority process is popped or executed.
In the process scheduling step of the second step, the process scheduling step comprises the steps of scheduling a receiving process, scheduling a messenger process, scheduling a service process and scheduling a security process, and the steps of scheduling the receiving process, the messenger process, the service process and the security process are sequentially ordered according to the priority from high to low.
The embodiments of the present invention are not limited thereto, and the present invention may be modified, substituted or combined in various other forms without departing from the basic technical spirit of the present invention, which falls within the scope of the claims, according to the above-described aspects of the present invention, using the general knowledge and conventional means of the art.

Claims (7)

1. A method of operating a multitasking COS operating system wherein COS is Chip Operating System comprising the steps of:
When the operating system is in an initialized state, acquiring the priority and time slices of each process in the operating system, checking the timer of the operating system at regular time according to the time slices of the current process, and after the timing is finished, triggering the timer interrupt of the operating system, judging whether the time slices of the current process are expired at the moment, if so, entering a process scheduling step; if not, continuing to execute the current process until the current process is completed;
In the process scheduling step, context stacking is carried out on site on the current process in an operating system, the highest priority process in the context stacking is further obtained in the operating system, the highest priority process is in a ready state, and the highest priority process is popped or executed;
the process scheduling step comprises the steps of scheduling a receiving and transmitting process, scheduling a messenger process, scheduling a service process and scheduling a security process, wherein the receiving and transmitting process, the messenger process, the service process and the security process are orderly sequenced from high to low according to priority;
the scheduling step of the receiving and transmitting process comprises the following steps: judging whether communication IO interruption is triggered when an operating system runs a current process, if yes, resetting the remaining time slices of the current process by using the operating system, then entering a process scheduling step, performing context stacking on the current process in the operating system, then acquiring a receiving and transmitting process, performing stack ejection or execution on the receiving and transmitting process in the operating system by using a receiving and transmitting process module, so that the receiving and transmitting process module receives data, and storing the received data into a storage address RAM appointed by a messenger process when the receiving and transmitting process performs data receiving operation; if not, continuing to execute the current process until the current process is completed;
The scheduling step of the messenger process comprises the following steps: when the operation system runs the receiving and transmitting process or the business process is finished, the timer of the operation system is triggered by interruption, a process scheduling step is entered, the current process is subjected to context stacking in the operation system on site, the messenger process in the current process is further obtained in the operation system, the messenger process is in a ready state, and the messenger process is popped or executed;
when the message process is immediately after the receiving and transmitting process is finished, the message process module independently stores the data stored in the storage RAM address by the receiving and transmitting process module into the corresponding fixed block, and the message process module further transmits the data stored by the receiving and transmitting process module into the corresponding business process module in a fixed block mode;
When the messenger process is immediately after the business process is finished, the messenger process module independently stores the data transmitted by the business process module in the corresponding fixed block, the messenger process module further transmits the data stored by the received business process module to the receiving and transmitting process module in a fixed block mode, and finally the response data of the business process module is returned to the outside through the receiving and transmitting process module.
2. The method of operating a multitasking COS operating system as recited in claim 1, wherein: the scheduling step of the business process comprises the following steps: when the operating system runs the current process, the communication IO is interrupted and triggered, whether the communication IO interruption is triggered or not is judged, if yes, the operating system is utilized to clear the remaining time slices of the current process, then a process scheduling step is entered, context stacking is carried out on the current process in the operating system, then service processes are acquired, the service processes are sequenced from high to low according to the priority by utilizing the service process module to form a queue, then the service processes are popped or executed in sequence, and response data generated when the service process module pops or executes the service processes are stored in a storage RAM of the messenger process module; if not, continuing to execute the current process until the current process is completed.
3. A method of operating a multitasking COS operating system as claimed in claim 1 or 2, wherein: the scheduling step of the security process comprises the following steps: when other processes are in a dormant state, the operating system directly schedules the security process, and the security process module adopts an active security policy and can perform security check operations of integrity self-check, random number self-check and algorithm self-check on the firmware of the operating system according to actual scene requirements.
4. A method of operating a multitasking COS operating system as recited in claim 3, wherein: after the security process is operated, the security process module is positioned at the corresponding self-checking zone bit in the operating system, and when the outside needs to acquire the information, the state of the zone bit can be quickly returned.
5. A multitasking COS operating system for a method of operation as recited in any of claims 1-4 wherein COS is Chip Operating System comprising:
the timer is used for timing the time slices of each process in the operating system, checking whether the current process time slice is expired, and triggering the timer interrupt when the process is expired;
communication IO used for triggering IO interruption in the operation process of the operating system;
the receiving and transmitting process module is used for receiving external instruction data and returning system response data to the outside;
The messenger process module is used for data transmission and maintenance of data stored in the data area RAM;
the data area RAM is divided into fixed blocks with different sizes, the fixed blocks are operated in a linked list mode, and the fixed blocks are used for storing independent data;
the business process module is used for business logic processing and adding corresponding business processes according to different business quantity;
the security process module is resident in the memory of the operating system, and is used for performing security check operations on the fixed integrity self-check, the random number self-check and the algorithm self-check of the operating system under the control of the scheduler when other processes are in a dormant state.
6. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 4 when the computer program is executed.
7. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any of claims 1-4.
CN202410023527.XA 2024-01-08 2024-01-08 Multi-task COS operating system, operation method, computer equipment and storage medium Active CN117851012B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410023527.XA CN117851012B (en) 2024-01-08 2024-01-08 Multi-task COS operating system, operation method, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410023527.XA CN117851012B (en) 2024-01-08 2024-01-08 Multi-task COS operating system, operation method, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117851012A CN117851012A (en) 2024-04-09
CN117851012B true CN117851012B (en) 2024-09-27

Family

ID=90532005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410023527.XA Active CN117851012B (en) 2024-01-08 2024-01-08 Multi-task COS operating system, operation method, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117851012B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043667A (en) * 2010-11-25 2011-05-04 深圳市科陆电子科技股份有限公司 Task scheduling method for embedded operating system
CN111367652A (en) * 2020-01-07 2020-07-03 苏州大学 Task scheduling processing system and method of embedded real-time operating system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100485605C (en) * 2001-09-24 2009-05-06 中兴通讯股份有限公司 Realizing method for multiple task real-time operation system
CN108958157B (en) * 2018-07-09 2020-09-18 北京东土科技股份有限公司 Control program control scheduling method, control program control scheduling device, computer equipment and storage medium
CN112416546A (en) * 2020-11-10 2021-02-26 光华临港工程应用技术研发(上海)有限公司 Multitask scheduling method, electronic device and computer storage medium
CN117149369A (en) * 2022-05-24 2023-12-01 华为云计算技术有限公司 Thread scheduling method and processor
CN114880102B (en) * 2022-07-04 2022-10-25 北京智芯半导体科技有限公司 Security chip, multitask scheduling method and device thereof, and storage medium
CN116302402A (en) * 2023-02-16 2023-06-23 中天集团上海超导技术有限公司 Method and device for processing embedded system task

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043667A (en) * 2010-11-25 2011-05-04 深圳市科陆电子科技股份有限公司 Task scheduling method for embedded operating system
CN111367652A (en) * 2020-01-07 2020-07-03 苏州大学 Task scheduling processing system and method of embedded real-time operating system

Also Published As

Publication number Publication date
CN117851012A (en) 2024-04-09

Similar Documents

Publication Publication Date Title
CN111782360B (en) Distributed task scheduling method and device
US10884786B2 (en) Switch device, switching method, and computer program product
US7752370B2 (en) Splitting one hardware interrupt to multiple handlers
US5727149A (en) Network interface apparatus and data transmission control method thereof
CN101582786B (en) Instant handling method and device of instant messages
US6968411B2 (en) Interrupt processing apparatus, system, and method
CN114205183A (en) Communication method and system of AT command protocol stack based on real-time operating system
CN111475312B (en) Message driving method and device based on real-time operating system
CN115525935A (en) Concurrent data operation method, device and equipment of multiple security chips and storage medium
CN114756356A (en) Task processing method, work node device, main node device and storage medium
CN114661449A (en) Task scheduling method, embedded system, and computer-readable storage medium
CN117851012B (en) Multi-task COS operating system, operation method, computer equipment and storage medium
CN113965432B (en) Control system for two-channel CAN bus communication
CN102831007B (en) Accessing method for real-time processing shared resource in system and real-time processing system
CN114268670B (en) Ethernet asynchronous message processing system and method based on time triggering
CN116197919B (en) Robot control system and control method
CN108255515B (en) Method and device for realizing timer service
CN114356600B (en) Multiplexed communication method, device, first chip and second chip
CN115428405B (en) Communication device, communication system, communication method, and recording medium
CN113067880A (en) Distributed control system chain type time-sharing communication method and storage medium
CN117170889B (en) Heterogeneous non-blocking data packet synchronous processing system
US20240362061A1 (en) Mechanism for sharing a common resource in a multi-threaded environment
CN112559404A (en) Data scheduling device and method and accelerated processing chip
JP2010049314A (en) Task scheduling device and task scheduling method
CN113518082B (en) Message processing method, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant