Multi-task scheduling method, device and equipment and readable storage medium
By setting tasks with different waiting times for the vehicle embedded operating system and dynamically updating the waiting time of the tasks in the main program, the load peak problem caused by task scheduling is solved and the stability and reliability of the system are improved.
Patent Information
- Application Number
- CN202511133127.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-13
- Publication Date
- 2025-10-17
AI Technical Summary
The task scheduling method of the in-vehicle embedded operating system can easily cause load peaks on the chip at specific times, affecting the stability of system operation and product reliability.
By setting the waiting time and execution cycle of multiple tasks, the waiting time of tasks can be made different. When the main program periodically reads the tasks, it decides whether to schedule the tasks based on the waiting time and execution cycle of the tasks, and dynamically updates the waiting time of the tasks to avoid multiple tasks being centrally scheduled at the same time.
It effectively reduces the load peak of the vehicle embedded operating system, ensures that tasks are scheduled according to the execution cycle, improves the stability and reliability of the system, and does not increase hardware costs.
Smart Images

Figure CN120803666A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of vehicle embedded operating system, and particularly relates to a scheduling method, device and equipment of multiple tasks and a readable storage medium. BACKGROUND
[0002] As the core software platform of automotive electronic system, vehicle embedded operating system undertakes the key functions of hardware resource management and software task coordination. In view of the stringent requirements of the automotive industry on real-time response, functional safety, system reliability and flexible scalability, vehicle embedded operating system is widely used in core scenarios such as vehicle ECU (Electronic Control Unit), intelligent cockpit, automatic driving domain controller and vehicle infotainment system.
[0003] However, the task scheduling method of the current vehicle embedded operating system is prone to cause load peaks of the chip at a certain moment, thereby reducing the stability of system running and affecting the reliability of the product. SUMMARY
[0004] The present application provides a scheduling method, device and equipment of multiple tasks and a readable storage medium, aiming at solving the technical problem that the task scheduling method of the current vehicle embedded operating system is prone to cause load peaks of the chip at a certain moment, thereby reducing the stability of system running and affecting the reliability of the product.
[0005] In a first aspect, the present application provides a scheduling method of multiple tasks, each task including a waiting duration and an execution period, the scheduling method of multiple tasks comprising: a main program reads multiple tasks with a preset duration as a period, wherein the waiting durations of multiple tasks are different; for each task read by the main program, if the waiting duration of the task is greater than the execution period of the task, the task is scheduled, and the waiting duration of the task is updated to the difference obtained by subtracting the execution period of the task from the waiting duration before the update; if the waiting duration of the task is not greater than the execution period, the waiting duration of the task is updated to the sum of the waiting duration before the update and the preset duration.
[0006] Optionally, before the main program reads multiple tasks with a preset duration as a period, the method comprises: setting the waiting duration and the execution period of multiple tasks.
[0007] Optionally, the waiting duration is the sum of a delay duration and an interval duration, and the setting of the waiting duration of multiple tasks comprises: for each task, setting the delay duration of the task as a preset integer multiple of the execution period of the task; The multiple tasks of the same execution period are divided into a group, and multiple groups are obtained; Two groups are selected in turn according to the order of execution periods of the multiple groups from short to long, and for each task in the selected two groups, the interval duration of the task is set to be less than the greatest common divisor of the execution periods of the two groups and different from the interval duration of the tasks in all groups.
[0008] Optionally, the preset integer multiple of each task is different.
[0009] Optionally, each task further includes an execution function, and the scheduling task includes: Executing the execution function of the task.
[0010] In a second aspect, an embodiment of the present application provides a scheduling device for multiple tasks, each task including a waiting duration and an execution period, and the scheduling device for multiple tasks includes: A reading module, configured to read multiple tasks by a main program at a preset duration as a period, wherein the waiting durations of the multiple tasks are different; A scheduling module, configured to, for each task read by the main program, if the waiting duration of the task is greater than the execution period of the task, schedule the task, and update the waiting duration of the task to a difference obtained by subtracting the execution period of the task from the waiting duration before the update; A waiting module, configured to, if the waiting duration of the task is not greater than the execution period, update the waiting duration of the task to a sum of the waiting duration before the update and the preset duration.
[0011] Optionally, the scheduling device for multiple tasks further includes a setting module, configured to: Set the waiting durations and the execution periods of the multiple tasks.
[0012] Optionally, the waiting duration is a sum of a delay duration and an interval duration, and the setting of the waiting durations of the multiple tasks is configured to: For each task, set the delay duration of the task to be a preset integer multiple of the execution period of the task; The multiple tasks of the same execution period are divided into a group, and multiple groups are obtained; Two groups are selected in turn according to the order of execution periods of the multiple groups from short to long, and for each task in the selected two groups, the interval duration of the task is set to be less than the greatest common divisor of the execution periods of the two groups and different from the interval duration of the tasks in all groups.
[0013] In a third aspect, an embodiment of the present application provides a plurality of task scheduling device, the plurality of task scheduling device comprises a processor, a memory, and a plurality of task scheduling program stored in the memory and executable by the processor, wherein the plurality of task scheduling program is executed by the processor to implement the steps of the plurality of task scheduling method described above.
[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, the readable storage medium stores a plurality of task scheduling program, wherein the plurality of task scheduling program is executed by the processor to implement the steps of the plurality of task scheduling method described above.
[0015] The technical scheme provided by the embodiments of the present application has the following beneficial effects: In the embodiments of the present application, the main program reads a plurality of tasks with a preset time length as a period, wherein the waiting time lengths of the plurality of tasks are different. For each task read by the main program, if the waiting time length of the task is greater than the execution period of the task, the task is scheduled, and the waiting time length of the task is updated to the difference obtained by subtracting the execution period of the task from the waiting time length before the update. If the waiting time length of the task is not greater than the execution period, the waiting time length of the task is updated to the sum of the waiting time length before the update and the preset time length. Through the embodiments of the present application, the execution period design of the tasks of the current vehicle embedded operating system generally follows the standard of 10 millisecond multiples, that is, the execution periods of the plurality of tasks are set to different multiples of 10 milliseconds. Such a task execution period setting is easy to cause the plurality of tasks to be concentratedly scheduled at the same time. The embodiments add the waiting time length feature to the tasks, so that the waiting time lengths of the plurality of tasks to be scheduled are initially set to be different, so as to disperse the execution time of the plurality of tasks. When the main program reads the plurality of tasks periodically each time, the main program determines whether to perform task scheduling according to the waiting time length and the execution period of each task read, and dynamically updates the waiting time length of the task, so that the task can be scheduled by the main program according to the set execution period. Therefore, the task can be ensured to be scheduled according to the execution period, and the plurality of tasks can be avoided to be concentratedly scheduled at the same time, so as to reduce the load peak of the vehicle embedded operating system. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 Flowchart of an embodiment of the plurality of task scheduling method of the present application; Figure 2 Schematic diagram of the plurality of tasks to be scheduled in an embodiment of the plurality of task scheduling method of the present application; Figure 3 Another flowchart of an embodiment of the plurality of task scheduling method of the present application; Figure 4 Another flowchart of an embodiment of the plurality of task scheduling method of the present application; Figure 3A detailed flowchart of the step S00; Figure 5 A task execution frequency diagram of an embodiment of the task scheduling method of the present application for multiple tasks; Figure 6 A task execution frequency diagram of the general method of the present application; Figure 7 A functional module diagram of an embodiment of the task scheduling device of the present application for multiple tasks; Figure 8 A hardware structure diagram of the task scheduling device for multiple tasks involved in the embodiment of the present application. DETAILED DESCRIPTION
[0017] In order for those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0018] In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be described in further detail below with reference to the drawings.
[0019] In a first aspect, the embodiments of the present application provide a task scheduling method for multiple tasks.
[0020] In an embodiment, with reference to Figure 1 , Figure 1 A flowchart of an embodiment of the task scheduling method of the present application for multiple tasks is shown in FIG. 1, each task includes a waiting time and an execution period, and the task scheduling method for multiple tasks includes: Figure 1 Step S10, the main program reads multiple tasks with a preset time length as a period, wherein the waiting time of the multiple tasks is different.
[0021] In the present embodiment, in a vehicle embedded operating system, the main program is used to perform scheduling on multiple tasks, and the main program is one of the core components of the vehicle embedded operating system, responsible for managing and coordinating the execution of all tasks. The main program of the vehicle embedded operating system reads all the multiple tasks to be scheduled with a preset time length such as 1 millisecond as a period, and the waiting time of the multiple tasks to be scheduled can be initially set to be different from each other, so as to disperse the execution time of the multiple tasks and reduce the load peak of the vehicle embedded operating system.
[0022] In step S20 , the main program schedules each task read if the waiting time of the task is longer than the execution period of the task, and updates the waiting time of the task to the difference between the waiting time before the update and the execution period of the task.
[0023] In this embodiment, refer to Figure 2 , Figure 2 This is a schematic diagram of multiple tasks to be scheduled according to an embodiment of the scheduling method for multiple tasks of the present application, such as Figure 2 As shown, there are 24 tasks to be scheduled. The main program of the vehicle embedded operating system runs periodically and reads all 24 tasks to be scheduled each time. For each task read, if the waiting time of a task, such as Task1, is 15 milliseconds, which is longer than the execution period of Task1, such as Period, the main program will execute the task again. Figure 2 If it is 10 milliseconds, task Task1 is scheduled for execution, and the waiting time ActiveTime of task Task1 is updated to the difference between the waiting time before the update (15 milliseconds) and the task execution period Period (10 milliseconds), that is, the waiting time of task Task1 is updated to 15 milliseconds - 10 milliseconds = 5 milliseconds.
[0024] Step S30: If the waiting time of the task is not greater than the execution period, the waiting time of the task is updated to the sum of the waiting time before the update and the preset time.
[0025] In this embodiment, the main program reads each task, if a task such as Task1 has a waiting time ActiveTime of 5 milliseconds, which is not greater than the task execution period Period. Figure 2 In the next operation cycle of the main program, the waiting time ActiveTime of task Task1 will be updated to 6 milliseconds + 1 millisecond = 7 milliseconds, until the main program reads that the waiting time ActiveTime of task Task1 is 11 milliseconds, which satisfies the condition of step S20. Then, task Task1 will be scheduled for execution, and the waiting time ActiveTime of task Task1 will be updated to 11 milliseconds - 10 milliseconds = 1 millisecond, so that task Task1 will be periodically scheduled for execution by the main program with an execution cycle of 10 milliseconds.
[0026] In the embodiment, the main program of the vehicle-mounted embedded operating system reads all the multiple tasks to be scheduled in a preset time length, such as 1 millisecond, as a period, and the initial waiting time length of the multiple tasks to be scheduled can be set to be different from each other, so as to disperse the execution time of the multiple tasks and reduce the load peak of the vehicle-mounted embedded operating system. The main program of the vehicle-mounted embedded operating system is periodically run to read all the tasks to be scheduled each time, the main program determines whether to perform task scheduling according to the waiting time length and the execution period of each task read, and dynamically updates the waiting time length of the task, so that the task can be scheduled by the main program according to the set execution period, thereby ensuring that the task is scheduled according to the execution period and avoiding that multiple tasks are concentratedly scheduled at the same time, and the load peak of the vehicle-mounted embedded operating system can be reduced. The embodiment has high compatibility, can be adapted to multiple mainstream embedded operating systems on the market, has simple and efficient transplantation process, and has low maintenance cost in later period. In addition, the resource occupation of the embodiment is extremely small, and scientific and reasonable allocation of resources is realized without increasing hardware cost, so that the overall performance and quality of the product can be greatly improved.
[0027] Further, in an embodiment, with reference to Figure 3 , Figure 3 is another flowchart of an embodiment of the task scheduling method of the present application, as shown in Figure 3 , before step S10, comprising: Step S00, setting the waiting time length and the execution period of the multiple tasks.
[0028] In the embodiment, with reference to Figure 2 , for the 24 tasks to be scheduled in Figure 2 , the waiting time length and the execution period of each task can be set in advance before the main program performs scheduling, wherein the execution periods of the 24 tasks can be the same or different, and the waiting time lengths of the 24 tasks are different, so as to disperse the execution time of the 24 tasks and reduce the load peak of the vehicle-mounted embedded operating system.
[0029] Further, in an embodiment, with reference to Figure 4 , Figure 4 is a detailed flowchart of step S00 in Figure 3 , as shown in Figure 4 , the waiting time length is the sum of the delay time length and the interval time length, and step S00 comprises: Step S001, for each task, setting the delay time length of the task as a preset integer multiple of the execution period of the task; Step S002, dividing multiple tasks with the same execution period into a group to obtain multiple groups; S003, two groups are selected in turn according to the order from short to long of the execution periods of the groups, and for each task in the selected two groups, the interval time length of the task is set to be less than the greatest common divisor of the execution periods of the two groups and different from the interval time length of the tasks in all groups.
[0030] In this embodiment, the waiting time length is composed of two parts, which are the sum of the delay time length and the interval time length, wherein the delay time length of the task is set to be a preset integer multiple of the execution period of the task, and the process continues with Figure 2 Taking the task Task1 as an example, the waiting time length ActiveTime of the task Task1 is 21 milliseconds, and 21 milliseconds is 2 times of the execution period Period of 10 milliseconds of the task Task1 + the interval time length of 1 millisecond of the task Task1. Figure 2 In this embodiment, the waiting time length ActiveTime of the task Task1 is 21 milliseconds, and 21 milliseconds is 2 times of the execution period Period of 10 milliseconds of the task Task1 + the interval time length of 1 millisecond of the task Task1. Figure 2 The specific setting method of the interval time length is as follows: tasks with execution periods of 10 milliseconds, 50 milliseconds, 100 milliseconds and 500 milliseconds are divided into four groups respectively, two groups with execution periods of 10 milliseconds and 50 milliseconds are selected according to the order from short to long of the execution periods, the tasks in the group with the execution period of 10 milliseconds are Task0-Task3, and the tasks in the group with the execution period of 50 milliseconds are Task4-Task9, for each task in the 10 tasks Task0-Task9, the interval time length of the task is set to be less than the greatest common divisor of the execution periods of the two groups and different from the interval time length of the tasks in all groups, wherein the greatest common divisor of the execution periods of 10 milliseconds and 50 milliseconds of the two groups with the execution periods of 10 milliseconds and 50 milliseconds is 10, that is, the interval time length of each task in the 10 tasks is set to be less than 10 and different from each other, and then the interval time length of each task in the group with the execution periods of 50 milliseconds and 100 milliseconds is set according to the same method, until the interval time length of all tasks in all groups is set.
[0031] Further, in an embodiment, the preset integer multiple of each task is different.
[0032] In this embodiment, different preset integer multiples can be set for different tasks, for example, the waiting time length ActiveTime of the task Task1 is 21 milliseconds, 21 milliseconds is 2 times of the execution period Period of 10 milliseconds of the task Task1 + the interval time length of 1 millisecond of the task Task1. Figure 2 In this embodiment, the waiting time length ActiveTime of the task Task1 is 21 milliseconds, and 21 milliseconds is 2 times of the execution period Period of 10 milliseconds of the task Task1 + the interval time length of 1 millisecond of the task Task1. Figure 2 In this embodiment, the waiting time length ActiveTime of the task Task1 is 21 milliseconds, and 21 milliseconds is 2 times of the execution period Period of 10 milliseconds of the task Task1 + the interval time length of 1 millisecond of the task Task1.
[0033] Further, in an embodiment, each task further comprises an execution function, and the scheduling task comprises: executing the execution function of the task.
[0034] In the embodiment, the main program schedules the execution function of the task, and the execution function is the code actually executed when the main program schedules the task. Specifically, when scheduling the execution of a task, the main program first calls the initialization function of the task to complete the preparation work such as resource application, and then executes the execution function of the task, for example, scheduling the execution of the task Task1 first applies for memory / peripheral resources, and then executes data processing and other functions.
[0035] In the embodiment, the execution period of the 24 tasks in Figure 2 , Figure 2 is from 10 to 500 milliseconds, and the execution period and the different waiting time of the 24 tasks are set according to the above method. Referring to Figure 5 , Figure 5 is a task execution frequency diagram of the task scheduling method of the embodiment of the application, as shown in Figure 5 , in a running period of the main program, at most only 4 tasks are executed simultaneously. For comparison, referring to Figure 6 , Figure 6 is a task execution frequency diagram of the conventional method, as shown in Figure 6 , the execution period of the 24 tasks of the conventional method is set to different integer multiples of 10 milliseconds, and in a running period of the main program, at most 24 tasks are executed simultaneously, which leads to too many tasks being concentrated and executed at the same time, thereby reducing the stability of system running and affecting the reliability of the product.
[0036] In a second aspect, the embodiment of the application further provides a plurality of task scheduling devices.
[0037] In an embodiment, referring to Figure 7 , Figure 7 is a functional module diagram of the plurality of task scheduling device of the embodiment of the application, as shown in Figure 7 , each task comprises a waiting time and an execution period, and the plurality of task scheduling device comprises: a reading module 10, configured to read a plurality of tasks by the main program with a preset time as a period, wherein the waiting time of the plurality of tasks is different; a scheduling module 20, configured to, for each task read by the main program, if the waiting time of the task is greater than the execution period of the task, schedule the task, and update the waiting time of the task to a difference value obtained by subtracting the execution period of the task from the waiting time before the update. The waiting module 30 is configured to update the waiting time length of the task as a sum of the waiting time length before the update and a preset time length if the waiting time length of the task is not greater than the execution cycle.
[0038] Further, in an embodiment, the scheduling apparatus of the plurality of tasks further comprises a setting module configured to: set the waiting time length and the execution cycle of the plurality of tasks.
[0039] Further, in an embodiment, the waiting time length is a sum of a delay time length and an interval time length, and the setting of the waiting time length of the plurality of tasks is configured to: for each task, set the delay time length of the task as a preset integer multiple of the execution cycle of the task; divide the plurality of tasks with the same execution cycle into a group to obtain a plurality of groups; select two groups in turn according to the order from short to long of the execution cycle of the plurality of groups, and for each task in the selected two groups, set the interval time length of the task to be less than the greatest common divisor of the execution cycle of the two groups and different from the interval time length of the tasks in all groups.
[0040] Further, in an embodiment, the preset integer multiple of each task is different.
[0041] Further, in an embodiment, each task further comprises an execution function, and the scheduling task is configured to: execute the execution function of the task.
[0042] The functions of each module in the above scheduling apparatus of the plurality of tasks correspond to the steps in the above scheduling method of the plurality of tasks, and the functions and implementation processes are not repeated here.
[0043] In a third aspect, an embodiment of the present application provides a scheduling device of a plurality of tasks.
[0044] Reference is made to Figure 8 , Figure 8 Fig. 1 is a schematic diagram of a hardware structure of a scheduling device of a plurality of tasks involved in an embodiment of the present application. In the embodiment of the present application, the scheduling device of the plurality of tasks can include a processor, a memory, a communication interface, and a communication bus.
[0045] The communication bus can be of any type, used to interconnect the processor, the memory, and the communication interface.
[0046] Communication interfaces include input / output (I / O) interfaces, physical interfaces, and logical interfaces. These interfaces interconnect components within the multi-task scheduling device, as well as interfaces that connect the multi-task scheduling device to other devices (such as other computing devices or user devices). Physical interfaces can include Ethernet, fiber, and ATM interfaces; user devices can include displays and keyboards.
[0047] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0048] The processor may be a general-purpose processor that can invoke a scheduling program for multiple tasks stored in a memory and execute the multiple-task scheduling method provided in the embodiments of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the scheduling program for multiple tasks is invoked can be referred to in the various embodiments of the multiple-task scheduling method of the present application and will not be further described here.
[0049] Those skilled in the art will understand that Figure 8 The hardware structure shown in the figure does not constitute a limitation to the present application and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0050] In a fourth aspect, an embodiment of the present application also provides a readable storage medium.
[0051] The readable storage medium of the present application stores a scheduling program for multiple tasks, wherein when the scheduling program for multiple tasks is executed by a processor, the steps of the scheduling method for multiple tasks as described above are implemented.
[0052] Among them, the method implemented when the scheduling program of multiple tasks is executed can refer to the various embodiments of the scheduling method of multiple tasks in this application, and will not be repeated here.
[0053] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0054] The terms "comprise", "comprising", "include", "including", "have" and "having" and any variations thereof in the Specification and in the Claims herein are intended to cover both the singular and the plural unless the context dictates otherwise. For example, a process, method, object, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but can include other steps or elements not expressly listed or inherent to such process, method, object, or apparatus. The terms "first", "second", and "third" and the like in the description and in the claims, if any, are used for distinguishing between similar elements and not necessarily for describing a sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the descriptive terms used herein are to be interpreted in the context as exercised by those of ordinary skill in the art.
[0055] In the description of the embodiments of the present application, "exemplary", "for example", "e.g." or "for instance" are used on the basis that a proper meaning of the words is taken into account to avoid any semantic overinterpretation due to an improper meaning of these terms. Any embodiment or design scheme described as "exemplary", "for example", or "for instance" in the embodiments of the present application should not be interpreted as preferable or advantageous over other embodiments or design schemes. Rather, the words "exemplary", "for example", or "for instance" are used to present concepts in a concrete manner.
[0056] In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text only means a description of a relationship between associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0057] In some of the processes described in the embodiments of the present application, a plurality of operations or steps are presented in a specific order. However, it should be understood that the operations or steps can be performed in an order different than presented, or in parallel, and the order of the operations should not be construed as a requirement or limitation. Additionally, the processes can include more or fewer operations, and the operations or steps can be combined or separated further. Furthermore, the operations or steps can be performed in an order different than presented, or in parallel.
[0058] Those skilled in the art can clearly understand the above-mentioned embodiment method can be realized by means of software and the necessary general hardware platform, of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a plurality of instructions for making a terminal device execute the method described in each embodiment of the present application.
[0059] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation using the content of the specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for scheduling multiple tasks, characterized in that: Each task includes a waiting time and an execution period, and the scheduling method of the multiple tasks includes: The main program reads multiple tasks at a preset time period, wherein the waiting time of multiple tasks is different; For each task read by the main program, if the waiting time of the task is longer than the execution period of the task, the task is scheduled and the waiting time of the task is updated to the difference between the waiting time before the update and the execution period of the task; If the waiting time of the task is not greater than the execution period, the waiting time of the task is updated to the sum of the waiting time before the update and the preset time.
2. The method for scheduling multiple tasks according to claim 1, wherein: Before the main program reads multiple tasks at a preset time period, it includes: Set the waiting time and execution cycle of multiple tasks.
3. The method for scheduling multiple tasks according to claim 2, wherein: The waiting time is the sum of the delay time and the interval time. The waiting time for setting multiple tasks includes: For each task, set the task delay duration to a preset integer multiple of the task execution period; Divide multiple tasks with the same execution cycle into one group to obtain multiple groups; Two groups are selected in order of the execution cycles of the multiple groups from short to long. For each task in the two selected groups, the interval duration of the task is set to be less than the greatest common divisor of the execution cycles of the two groups and different from the interval duration of the tasks in all groups.
4. The method for scheduling multiple tasks according to claim 3, wherein: The preset integer multiples are different for each task.
5. The method for scheduling multiple tasks according to claim 1, wherein: Each task also includes an execution function, and the scheduling task includes: The execution function that executes the task.
6. A scheduling device for multiple tasks, characterized in that: Each task includes a waiting time and an execution period, and the scheduling device of the multiple tasks includes: The reading module is used by the main program to read multiple tasks with a preset time period, wherein the waiting time of multiple tasks is different; The scheduling module is used by the main program to schedule each task read if the waiting time of the task is longer than the task execution cycle, and update the waiting time of the task to the difference between the waiting time before the update and the task execution cycle; The waiting module is used to update the waiting time of the task to the sum of the waiting time before the update and the preset time if the waiting time of the task is not greater than the execution cycle.
7. The scheduling device for multiple tasks according to claim 6, wherein: The scheduling device for multiple tasks further includes a setting module, which is used to: Set the waiting time and execution cycle of multiple tasks.
8. The scheduling device for multiple tasks according to claim 7, characterized in that: The waiting time is the sum of the delay time and the interval time. The waiting time for setting multiple tasks is used to: For each task, set the task delay duration to a preset integer multiple of the task execution period; Divide multiple tasks with the same execution cycle into one group to obtain multiple groups; Two groups are selected in order of the execution cycles of the multiple groups from short to long. For each task in the two selected groups, the interval duration of the task is set to be less than the greatest common divisor of the execution cycles of the two groups and different from the interval duration of the tasks in all groups.
9. A scheduling device for multiple tasks, characterized in that: The scheduling device for multiple tasks includes a processor, a memory, and a scheduling program for multiple tasks stored on the memory and executable by the processor, wherein when the scheduling program for multiple tasks is executed by the processor, the steps of the scheduling method for multiple tasks as described in any one of claims 1 to 5 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a scheduling program for multiple tasks, wherein when the scheduling program for multiple tasks is executed by a processor, the steps of the method for scheduling multiple tasks according to any one of claims 1 to 5 are implemented.