CN111831406A - Multi-task scheduling method and device based on vehicle-mounted embedded system - Google Patents
Multi-task scheduling method and device based on vehicle-mounted embedded system Download PDFInfo
- Publication number
- CN111831406A CN111831406A CN202010464254.4A CN202010464254A CN111831406A CN 111831406 A CN111831406 A CN 111831406A CN 202010464254 A CN202010464254 A CN 202010464254A CN 111831406 A CN111831406 A CN 111831406A
- Authority
- CN
- China
- Prior art keywords
- task
- event
- tasks
- priority
- vehicle
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000012544 monitoring process Methods 0.000 claims abstract description 13
- 230000006870 function Effects 0.000 claims description 25
- 230000000737 periodic effect Effects 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 10
- 238000013461 design Methods 0.000 abstract description 6
- 230000008569 process Effects 0.000 abstract description 6
- 238000007726 management method Methods 0.000 description 29
- 238000010586 diagram Methods 0.000 description 3
- 230000007547 defect Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000003745 diagnosis Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a multi-task scheduling method and a device based on a vehicle-mounted embedded system, wherein the method comprises the steps of classifying tasks in advance, distributing corresponding RAM (random access memory) resources according to the types of the tasks, setting priorities for the classified tasks and assigning all the tasks to be the same interface function; monitoring an event signal, and acquiring a task type of an event according to the event signal; and executing corresponding scheduling operation according to the priority corresponding to the task type of the event. The multitask scheduling method and the multitask scheduling device provided by the embodiment of the invention reduce the loss of the RAM resource of the system in the multitask operation process, and greatly reduce the limitation of the RAM resource on the system design; and the real-time performance of task operation is improved.
Description
Technical Field
The invention relates to the technical field of automobile control systems, in particular to a multitask scheduling method and device based on a vehicle-mounted embedded system.
Background
At present, most of the Electronic Control Units (ECUs) in automotive Electronic products are implemented based on a Micro Controller Unit (MCU) platform, such as a car body gateway, an air conditioner Control Unit, and multimedia navigation. Because of the many functional modules, a real-Time System may be embedded to perform multitask management, such as a Free RTOS (Free Time multi-tasking Operation System), a uCOS (uControl Operation System, micro embedded real-Time System), and the like. In the prior art, for multitask management, a task is usually wakened and suspended by using a mode that one functional module correspondingly creates one task according to the needs of a system for the functional module. The purpose of correspondingly creating a task for each functional module is to facilitate module management and meet the requirements of low coupling and high cohesion among modules, thereby realizing the modular management of a software system.
As shown in fig. 1, when creating tasks, a multitask management system in the prior art allocates a task stack space for each task separately; each task can assign a task interface function to the task when being created, and configures priority for the corresponding task in the interface function to form a priority vector table comprising all tasks; the system carries out scheduling management on all tasks based on the priority vector table. After the task is established, the multi-task management system starts task scheduling. The multitask management system judges whether idle RAM resources exist in the MCU and judges whether the idle RAM resources meet task execution requirements. After the MCU is ensured to have the idle RAM resource which can meet the task execution requirement, the multi-task management system compares and judges the priority of each task and schedules and executes the task with the highest priority in all the tasks.
In the practical application process, the existing multi-task management system usually has the defects that part of tasks excessively occupy RAM resources of the MCU, so that the RAM resources are unreasonably allocated, and the system operation efficiency is low. When the number of functional modules in the system increases and the number of corresponding tasks increases, a large amount of RAM resources are required to be allocated to each task. Because the RAM resource of the MCU is limited, and a part of the more complex functional modules require more RAM resources, there is not enough RAM resource allocated to other tasks, so that the other tasks stop operating, and the operating efficiency of the system is affected.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
In view of the defects of the prior art, the present invention aims to provide a multitask scheduling method and device based on a vehicle-mounted embedded system, and aims to solve the problem that the RAM resource allocation in the system is unreasonable and affects the system operation efficiency in the prior art.
The technical scheme of the invention is as follows:
a multitask scheduling method based on a vehicle-mounted embedded system comprises the following steps:
classifying the tasks in advance, distributing corresponding RAM resources according to the types of the tasks, setting priorities for the classified tasks, and designating all the tasks as the same interface function;
monitoring an event signal, and acquiring a task type of an event according to the event signal;
and executing corresponding scheduling operation according to the priority corresponding to the task type of the event.
Further, the classifying the task in advance includes:
the tasks are divided into a starting class task, a request class task, a periodic class task and an idle class task in advance.
Further, the setting of the priority according to the type of the task includes:
the priority level of the request task and the periodic task is set as the highest priority in advance, the priority level of the start task is set as the second highest priority, and the priority level of the idle task is set as the lowest priority.
Further, the monitoring the event signal and obtaining the task type of the event according to the event signal includes:
monitoring the event signal through an interface function, and judging whether an effective event signal exists or not;
and if the effective event signal exists, acquiring the task type of the event according to the event signal.
Further, the executing the corresponding scheduling operation according to the priority corresponding to the task type of the event includes:
if the task type of the event is the task with the highest priority, the task with the highest priority is operated;
and after the task with the highest priority is detected to be operated, releasing the signal and waiting for the next event signal.
Further, the executing the corresponding scheduling operation according to the priority corresponding to the task type of the event includes:
if the task type of the event is the task with the second highest priority, the task with the second highest priority is operated;
and releasing the signal after the task with the next highest priority is detected to be operated.
Further, the executing the corresponding scheduling operation according to the task type of the event further includes:
if the task type of the event is the task with the lowest priority, the task with the lowest priority is operated, and subtasks in the task with the lowest priority are obtained;
monitoring the state of the subtasks;
and if detecting that all the subtasks are executed completely, the control system enters a low power consumption mode.
Another embodiment of the present invention provides a multitask scheduling device based on a vehicle-mounted embedded system, which comprises at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-mentioned vehicle-mounted embedded system-based multitask scheduling method.
Another embodiment of the present invention also provides a non-transitory computer-readable storage medium storing computer-executable instructions, which, when executed by one or more processors, may cause the one or more processors to perform the above-mentioned vehicle-mounted embedded system-based multitask scheduling method.
Another embodiment of the present invention provides a computer program product comprising a computer program stored on a non-volatile computer-readable storage medium, the computer program comprising program instructions that, when executed by a processor, cause the processor to perform the above-mentioned vehicle embedded system based multitask scheduling method.
Has the advantages that: compared with the prior art, the multi-task scheduling method and device provided by the invention reduce the loss of system RAM resources during multi-task operation, reasonably distribute the system RAM resources and greatly reduce the limit RAM of the RAM resources to the system design; and the real-time performance of task operation is improved.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a schematic diagram of a prior art multitask management system;
FIG. 2 is a flowchart illustrating a multitask scheduling method based on a vehicle-mounted embedded system according to an embodiment of the present invention;
FIG. 3 is a flow diagram illustrating a multitasking creation process according to an embodiment of the present invention;
FIG. 4 is a flow chart illustrating multi-type task scheduling according to an embodiment of the present invention;
FIG. 5 is a flow chart illustrating the operation of the subtask management system according to the embodiment of the present invention;
fig. 6 is a schematic structural diagram of a multitask scheduling device based on a vehicle-mounted embedded system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and clearer, the present invention is described in further detail below. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The following describes embodiments of the present invention in detail with reference to the accompanying drawings.
The embodiment of the invention provides a multi-task scheduling method based on a vehicle-mounted embedded system. Referring to fig. 2, fig. 2 is a flowchart illustrating a multitask scheduling method based on a vehicle-mounted embedded system according to a preferred embodiment of the present invention. As shown in fig. 2, the method includes:
step S100, classifying the tasks in advance, distributing corresponding RAM resources according to the types of the tasks, setting priorities for the classified tasks, and designating all the tasks as the same interface function;
s200, monitoring an event signal, and acquiring a task type of an event according to the event signal;
and step S300, executing corresponding scheduling operation according to the priority corresponding to the task type of the event.
In specific implementation, the system in the embodiment of the invention is a vehicle-mounted embedded real-time system, and the vehicle-mounted embedded real-time system is generally a system constructed based on an MCU. The system classifies the tasks created by the system, and divides an independent RAM resource for each task category, the RAM resource corresponding to the task is also called a task stack space, and each task is executed in the task stack space of the corresponding category; and different classes of task definitions differ in priority. The system assigns the same interface function for all tasks, namely, the system can monitor the event signals corresponding to all tasks through the interface function.
And the interface function monitors the event signals, acquires task priorities corresponding to all the effective event signals after receiving the effective event signals, and executes operation according to the task priorities corresponding to the effective event signals. Generally, when a plurality of tasks are simultaneously present, a task having a high priority level is preferentially executed.
The scheduling method of the embodiment of the invention reduces the loss of the system RAM resources during the multi-task operation, the system RAM resources are reasonably distributed, and the limitation of the RAM resources on the system design is greatly reduced; and each category of task is independently executed without mutual interference, so that the utilization rate of RAM resources in the system and the operation efficiency of the system are improved.
Further, the classifying the task in advance includes: the tasks are divided into a starting class task, a request class task, a periodic class task and an idle class task in advance.
Specifically, the multi-task scheduling system in the prior art performs scheduling based on priority, and cannot schedule a specific task at a certain time. In the specification of automotive electronics design, many designs (such as car body network management tasks) are required based on millisecond timing errors. Therefore, the time difference existing between task scheduling of the existing multi-task management system cannot meet the requirement of the accurate timing scheduling. In order to overcome the above-mentioned drawbacks, the embodiments of the present invention classify a plurality of tasks into a start class, a request class, a period class, and an idle class, and may execute corresponding tasks according to different classes.
The start-up type task includes, but is not limited to, an initialization task, for which the system is executed only once after being started up. The request type tasks include but are not limited to active request tasks and passive request tasks, and the system responds to the requests of the type tasks in real time. For example, an interface (such as a CAN physical layer) task for interactive communication with a vehicle-mounted device has high real-time requirement and has two states of interrupt receiving and active sending. The periodic tasks include but are not limited to tasks with high requirements on period and errors, such as vehicle body network management and implementation of various levels of functions of vehicle body diagnosis services, and can be defined as periodic tasks to be executed. The idle tasks include but are not limited to tasks with low requirements on task real-time performance and errors, the tasks are classified according to the execution requirements of the tasks, corresponding priorities are defined, the task with the highest priority is ensured to be executed in time, and the accuracy and the real-time performance of the system are improved.
Further, the setting of the priority according to the type of the task includes:
the priority level of the request task and the periodic task is set as the highest priority in advance, the priority level of the start task is set as the second highest priority, and the priority level of the idle task is set as the lowest priority.
In specific implementation, after the division of each task stack space is completed, task priorities are defined for each task type. For example, the task priority of the idle task is defined as the lowest priority, and the idle task is switched to when the system is idle; the request tasks and the periodic tasks are defined as the highest priority, so that the system can respond to the request tasks or execute the periodic tasks most quickly; the starting task is defined as the next highest priority because the task scheduling firstly calls the task, and the starting task is released after the execution is finished, so that the scheduling of other tasks is not influenced. By setting the tasks needing to be executed in real time by the tasks such as the periodic tasks and the like as the highest priority, the real-time performance of task scheduling is improved on the basis of ensuring the normal operation of the system, and the specification aiming at the real-time design of a software system in the development of automotive electronic products is met.
Further, the monitoring the event signal and obtaining the task type of the event according to the event signal includes:
monitoring the event signal through an interface function, and judging whether an effective event signal exists or not;
and if the effective event signal exists, acquiring the task type of the event according to the event signal.
In specific implementation, after the creation of multiple tasks is completed, system scheduling is started, and because the interface functions of all the tasks are the same interface function, the event signals of all the tasks are monitored in the unified interface function, and then the tasks are managed again. The method comprises the steps that a start-up task corresponds to a start event signal, a request task corresponds to a request event signal, a periodic task corresponds to a periodic event signal, and an idle task corresponds to an idle event signal.
Further, the executing the corresponding scheduling operation according to the priority corresponding to the task type of the event includes:
if the task type of the event is the task with the highest priority, the task with the highest priority is operated; and after the task with the highest priority is detected to be operated, releasing the signal and waiting for the next event signal.
Specifically, if the task type of the event is a request-type task and a periodic-type task, based on the corresponding event signal state, the event signal of each task is triggered only once, and when the event signal is valid, the task is run; after the current task is finished, the event signal is released, and the next effective event signal is waited to occur. For example, the interface function monitors event signals requesting a task of the class; when the acquired request event signal is valid, a request task corresponding to the request event signal is operated; when the task operation is finished, releasing the request event signal; the interface function waits for the next request event signal to be acquired.
Further, the executing the corresponding scheduling operation according to the priority corresponding to the task type of the event includes:
if the task type of the event is the task with the second highest priority, the task with the second highest priority is operated; and releasing the signal after the task with the next highest priority is detected to be operated.
Specifically, if the task type of the event is a start-up task and both the idle task and the start-up task are given valid event signals when the system is scheduled and started, that is, when the start-up event signal obtained by the interface function is valid, the start-up task is run.
Further, the executing the corresponding scheduling operation according to the priority corresponding to the task type of the event further includes:
if the task type of the event is the task with the lowest priority, the task with the lowest priority is operated, and subtasks in the task with the lowest priority are obtained;
monitoring the state of the subtasks;
and if detecting that all the subtasks are executed completely, the control system enters a low power consumption mode.
In specific implementation, when the operation of the starting task is finished, the starting event signal is released. During the process of executing the task by the system, the starting task is executed firstly. And the subtask management system is started and initialized in the idle task and enters a circular running state. After all the subtasks are required to be executed, the system is required to be stopped (low power consumption mode). Because the idle tasks are in the idle task stack space and are set to be in a circulating running state, the idle tasks meeting the resource condition can be executed as long as idle RAM resources exist in the idle task stack space. The task execution efficiency and the resource utilization rate are improved.
An embodiment of the present invention further provides a specific embodiment of multitask creation based on a multitask scheduling method of a vehicle-mounted embedded system, and as shown in fig. 3, for example, the multitask creation method includes:
step S10, multitask creation is started, after which step S20, step S30, step S40 and step S50 are executed;
step S20, defining a starting task, and then executing step S21;
step S21, creating a task stack space 1, and then executing step S22;
step S22, defining the starting task as the second highest priority, and then executing step S60;
step S30, defining a request task, and then executing step S31;
step S31, creating a task stack space 2, and then executing step S32;
step S32, defining the request task as the highest priority, and then executing step S60;
step S40, defining a periodic task, and then executing step S41;
step S41, creating a task stack space 3, and then executing step S42;
step S42, defining the periodic tasks as the highest priority, and then executing step S60;
step S50, defining an idle task, and then executing step S51;
step S51, creating a task stack space 4, and then executing step S52;
step S52, defining the idle task as the lowest priority, and then executing step S60;
step S60, appointing a same interface function for all tasks, and then executing step S60;
and step S70, completing creation of multiple tasks and starting system scheduling.
After the multitask creation based on fig. 3 is completed, system scheduling is started, an embodiment of the present invention further provides a specific embodiment of multitask scheduling, and as shown in fig. 4 for example, a multitask scheduling method includes:
step S70, completing the creation of multiple tasks, starting system scheduling, and then executing step S80;
step S80, the interface function monitors event signals corresponding to all tasks and judges whether effective event signals are obtained; if the valid event signal is acquired, executing step S81 and/or step S82 and/or step S83 and/or step S84; if no valid event signal is acquired, repeatedly executing step S80;
step S81, the event signal obtained by the interface function is an effective start event signal, and then step S811 is executed;
step S811, running a start-up task corresponding to the effective start-up event signal, and then executing step S812;
step S812, when the task is finished, releasing the event signal corresponding to the task;
step S82, the event signal acquired by the interface function is an effective request event signal, and then step S821 is executed;
step S821, executing a request task corresponding to the valid request event signal, and then executing step S822;
step S822, the task is finished, the event signal corresponding to the task is released, and then step S823 is executed;
step S823, waiting for the next request event signal to be acquired, and then returning to execute step S80;
step S83, the event signal obtained by the interface function is an effective period event signal, and then step S831 is executed;
step S831, running the periodic task corresponding to the effective period event signal, and then executing step S832;
step S832, the operation is finished, the signal is released, and then the process returns to step S833;
step S833, waiting for acquisition of the next cycle event signal, and then returning to perform step S80;
step S84, the event signal obtained by the interface function is an effective idle event signal, and then step S841 is executed;
step S841, running an idle task corresponding to the valid idle event signal, and then executing step S842;
step 842, the task is finished running, the event signal corresponding to the task is released, and then step 843 is executed;
step S843, starting the multitask management system, and then circularly executing step S843.
The embodiment of the invention provides a specific embodiment of a subtask management system operation flow of a multitask scheduling method based on a vehicle-mounted embedded system, and exemplarily, as shown in fig. 5, a subtask management system creates n subtasks according to the requirements of functional modules; if the system does not obtain the effective event signal, the subtask management system executes the n subtasks circularly. Wherein n is a positive integer greater than or equal to 1. The execution steps of each subtask are the same, and the example of the subtask 1 is given as an example. The execution steps of the subtask 1 include:
step S8431, create subtask 1, and then execute step S8432;
step S8431, performing initialization processing on the subtask 1, and then executing step S8433;
step S8433, start the task 1, and then execute step S8434;
step S8434, the subtask 1 is run, and then step S8435 is executed;
step S8435, the subtask 1 enters a preparation stop state, and then step S8436 is executed;
in step S8436, the subtask 1 stops operating, and then the process returns to step S8433.
Specifically, the subtask management system is used for managing low-priority idle tasks. In the idle task, the tasks corresponding to the functional modules are defined as subtasks, and are managed by the subtask management system in a unified way and are scheduled in a circulating way. Each subtask contains five states, initialization, start, run, prepare stop, and is managed by the state machine of the respective subtask. The subtasks are independent of each other, but are coordinated with each other. When the subtask management system is started and initialized, all subtasks are initialized uniformly; after the initialization is completed, each subtask enters a starting state according to the requirement. It should be noted that, after all the subtasks are initialized at the same time, the subtask management system performs the start operation only on the subtask with the start operation requirement, and does not perform the start operation if there is no subtask with the start operation requirement.
The subtasks in the starting state enter into each subtask to manage the state machine; before the operation of the subtask management system is stopped, all subtasks can simultaneously enter a stop state after all subtasks need to be confirmed to enter a preparation stop state, and the condition is taken as a precondition for the operation stop of the subtask management system. By setting the preparation stop state, each subtask is ensured to be in the stop state before the subtask management system stops running. The task management system avoids the problem that the power consumption of the system operation is reduced because the task management system needs to be started and operated repeatedly when part of subtasks are completed and part of subtasks are completed.
It should be noted that, in the foregoing embodiments, a certain order does not necessarily exist among the steps, and it can be understood by those skilled in the art according to the description of the embodiments of the present invention that, in different embodiments, the steps may have different execution orders, that is, may be executed in parallel, may also be executed in an exchange manner, and the like.
Another embodiment of the present invention provides a multitask scheduling device based on a vehicle-mounted embedded system, as shown in fig. 6, the device 10 includes:
one or more processors 110 and a memory 120, where a processor 110 is illustrated as an example, the processor 110 and the memory 120 may be connected by a bus or other means, and the illustrated example is a bus connection.
The memory 120 is a non-volatile computer-readable storage medium, and can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions corresponding to the multitask scheduling method based on the in-vehicle embedded system in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the apparatus 10 by running the nonvolatile software programs, instructions and units stored in the memory 120, that is, implements the vehicle-mounted embedded system-based multitask scheduling method in the above-described method embodiment.
The memory 120 may include a storage program area and a storage data area, wherein the storage program area may store an application program required for operating the device, at least one function; the storage data area may store data created according to the use of the device 10, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 120 optionally includes memory located remotely from processor 110, which may be connected to device 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more units are stored in the memory 120, and when executed by the one or more processors 110, perform the vehicle-mounted embedded system-based multitask scheduling method in any of the above-described method embodiments, for example, perform steps S100 to S300.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer-executable instructions for execution by one or more processors, e.g., performing steps S100-S300.
By way of example, non-volatile storage media can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Synchronous RAM (SRAM), dynamic RAM, (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The disclosed memory components or memory of the operating environment described herein are intended to comprise one or more of these and/or any other suitable types of memory.
Another embodiment of the present invention provides a computer program product comprising a computer program stored on a non-volatile computer-readable storage medium, the computer program comprising program instructions that, when executed by a processor, cause the processor to perform the method for vehicle-mounted embedded system based multitask scheduling according to the above method embodiment. For example, steps S100 to S300 in fig. 2 described above are performed.
The above-described embodiments are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that the embodiments may be implemented by software plus a general hardware platform, and may also be implemented by hardware. Based on such understanding, the above technical solutions essentially or contributing to the related art can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
Conditional language such as "can," "might," or "may" is generally intended to convey that a particular embodiment can include (yet other embodiments do not include) particular features, elements, and/or operations, among others, unless specifically stated otherwise or otherwise understood within the context as used. Thus, such conditional language is also generally intended to imply that features, elements, and/or operations are in any way required for one or more embodiments or that one or more embodiments must include logic for deciding, with or without input or prompting, whether such features, elements, and/or operations are included or are to be performed in any particular embodiment.
What has been described herein in the specification and drawings includes examples that can provide an in-vehicle embedded system based multitasking scheduling method and apparatus. It will, of course, not be possible to describe every conceivable combination of components and/or methodologies for purposes of describing the various features of the disclosure, but it can be appreciated that many further combinations and permutations of the disclosed features are possible. It is therefore evident that various modifications can be made to the disclosure without departing from the scope or spirit thereof. In addition, or in the alternative, other embodiments of the disclosure may be apparent from consideration of the specification and drawings and from practice of the disclosure as presented herein. It is intended that the examples set forth in this specification and the drawings be considered in all respects as illustrative and not restrictive. Although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.
Claims (10)
1. A multitask scheduling method based on a vehicle-mounted embedded system is characterized by comprising the following steps:
classifying the tasks in advance, distributing corresponding RAM resources according to the types of the tasks, setting priorities for the classified tasks, and designating all the tasks as the same interface function;
monitoring an event signal, and acquiring a task type of an event according to the event signal;
and executing corresponding scheduling operation according to the priority corresponding to the task type of the event.
2. The multitask scheduling method based on the vehicle-mounted embedded system according to claim 1, wherein the pre-classifying the tasks comprises:
the tasks are divided into a starting class task, a request class task, a periodic class task and an idle class task in advance.
3. The multitask scheduling method based on the vehicle-mounted embedded system according to claim 2, wherein the setting of the priority according to the type of the task comprises:
the priority level of the request task and the periodic task is set as the highest priority in advance, the priority level of the start task is set as the second highest priority, and the priority level of the idle task is set as the lowest priority.
4. The multitask scheduling method based on the vehicle-mounted embedded system according to claim 3, wherein the monitoring the event signal and obtaining the task type of the event according to the event signal comprises:
monitoring the event signal through an interface function, and judging whether an effective event signal exists or not;
and if the effective event signal exists, acquiring the task type of the event according to the event signal.
5. The multitask scheduling method based on the vehicle-mounted embedded system according to claim 4, wherein the executing of the corresponding scheduling operation according to the priority corresponding to the task type of the event comprises:
if the task type of the event is the task with the highest priority, the task with the highest priority is operated;
and after the task with the highest priority is detected to be operated, releasing the signal and waiting for the next event signal.
6. The multitask scheduling method based on the vehicle-mounted embedded system according to claim 4, wherein the executing of the corresponding scheduling operation according to the priority corresponding to the task type of the event comprises:
if the task type of the event is the task with the second highest priority, the task with the second highest priority is operated;
and releasing the signal after the task with the next highest priority is detected to be operated.
7. The multitask scheduling method based on the vehicle-mounted embedded system according to claim 4, wherein the corresponding scheduling operation is executed according to the priority corresponding to the task type of the event, and further comprising:
if the task type of the event is the task with the lowest priority, the task with the lowest priority is operated, and subtasks in the task with the lowest priority are obtained;
monitoring the state of the subtasks;
and if detecting that all the subtasks are executed completely, the control system enters a low power consumption mode.
8. The multitask scheduling device based on the vehicle-mounted embedded system is characterized by comprising at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the in-vehicle embedded system based multitasking scheduling method according to any one of claims 1-7.
9. A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the in-vehicle embedded system based multitasking scheduling method according to any one of claims 1-7.
10. A computer program product, characterized in that the computer program product comprises a computer program stored on a non-volatile computer-readable storage medium, the computer program comprising program instructions which, when executed by a processor, cause the processor to carry out the method of vehicle embedded system based multitask scheduling according to any of the claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010464254.4A CN111831406A (en) | 2020-05-27 | 2020-05-27 | Multi-task scheduling method and device based on vehicle-mounted embedded system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010464254.4A CN111831406A (en) | 2020-05-27 | 2020-05-27 | Multi-task scheduling method and device based on vehicle-mounted embedded system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111831406A true CN111831406A (en) | 2020-10-27 |
Family
ID=72913994
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010464254.4A Pending CN111831406A (en) | 2020-05-27 | 2020-05-27 | Multi-task scheduling method and device based on vehicle-mounted embedded system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111831406A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112579215A (en) * | 2020-12-23 | 2021-03-30 | 潍柴动力股份有限公司 | Method and device for generating scheduling function |
CN116467059A (en) * | 2023-04-21 | 2023-07-21 | 哈尔滨有初科技有限公司 | Data processing system and method based on distributed computing |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5636124A (en) * | 1995-03-08 | 1997-06-03 | Allen-Bradley Company, Inc. | Multitasking industrial controller |
CN109710399A (en) * | 2018-12-14 | 2019-05-03 | 湖北航天技术研究院总体设计所 | A kind of DSP communication task scheduling system and method |
-
2020
- 2020-05-27 CN CN202010464254.4A patent/CN111831406A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5636124A (en) * | 1995-03-08 | 1997-06-03 | Allen-Bradley Company, Inc. | Multitasking industrial controller |
CN109710399A (en) * | 2018-12-14 | 2019-05-03 | 湖北航天技术研究院总体设计所 | A kind of DSP communication task scheduling system and method |
Non-Patent Citations (1)
Title |
---|
马建辉;孙常青;侯冬冬;郭坤;: "嵌入式系统裸机的任务调度应用设计", 单片机与嵌入式系统应用, no. 06, 1 June 2018 (2018-06-01) * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112579215A (en) * | 2020-12-23 | 2021-03-30 | 潍柴动力股份有限公司 | Method and device for generating scheduling function |
CN112579215B (en) * | 2020-12-23 | 2023-12-15 | 潍柴动力股份有限公司 | Scheduling function generation method and device |
CN116467059A (en) * | 2023-04-21 | 2023-07-21 | 哈尔滨有初科技有限公司 | Data processing system and method based on distributed computing |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6163805A (en) | Distributed automated testing system | |
CN107515786B (en) | Resource allocation method, master device, slave device and distributed computing system | |
CN107239330B (en) | Task allocation method and device for operating system of automobile open system architecture | |
CN109564528B (en) | System and method for computing resource allocation in distributed computing | |
US20200326980A1 (en) | Control Unit, Method for Operating A Control Unit, Method for Configuring A Virtualization System of A Control Unit | |
CN113434284B (en) | Privacy computation server side equipment, system and task scheduling method | |
JP2011028559A (en) | Relay program and electronic control device | |
CN111831406A (en) | Multi-task scheduling method and device based on vehicle-mounted embedded system | |
CN111104208A (en) | Process scheduling management method and device, computer equipment and storage medium | |
JP4985662B2 (en) | Program and control device | |
KR102485288B1 (en) | Controller for vehicle and operating system scheduling method thereof | |
CN112948050A (en) | Method and device for deploying pod | |
CN110659131A (en) | Task processing method, electronic device, computer device, and storage medium | |
CN115495262A (en) | Microkernel operating system and method for processing interprocess message | |
CN113886058A (en) | Cross-cluster resource scheduling method and device | |
CN111240824B (en) | CPU resource scheduling method and electronic equipment | |
KR20080013993A (en) | Use of a data engine within a data processing apparatus | |
CN113419839A (en) | Resource scheduling method and device for multi-type jobs, electronic equipment and storage medium | |
US8689217B2 (en) | System and method for thread processing robot software components responsive to periodic, dedicated, and passive modes | |
WO2021002961A1 (en) | Harvest virtual machine for utilizing cloud-computing resources | |
CN114237818B (en) | Method, system, computing device and storage medium for sharing resources among virtual machines | |
Böhm et al. | Multi-core processors in the automotive domain: An AUTOSAR case study | |
CN115248724A (en) | Real-time scheduling for heterogeneous multi-core systems | |
US8667492B2 (en) | Control of the runtime behavior of processes | |
CN102681881B (en) | Across machine dispatching method and system thereof |
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 |