Task scheduling method and device, automobile chip and medium
By configuring the priority, scheduling policies and security levels of tasks in the automotive chip, ensuring that tasks run on the appropriate CPU, it solves the problem that security tasks cannot run on the appropriate CPU in the traditional method, and improves the security of the system.
Patent Information
- Application Number
- CN202411127866.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-13
AI Technical Summary
Traditional automotive chip task scheduling methods cannot ensure that security requires tasks run on CPUs that meet security level requirements, resulting in security vulnerabilities and unpredictable security risks.
By obtaining task information and preset configuration information, configure the priority, scheduling policy and security level of the task, determine the appropriate CPU group and CPU for running the task, and ensure that the task runs on the CPU that meets the security level requirements.
Improve the overall security of the system, ensure that security tasks run on CPUs that meet the security level requirements, and reduce security risks.
Smart Images

Figure CN119127471A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip design technology, and in particular to a task scheduling method, a task scheduling device, an automobile chip and a computer-readable storage medium. Background Art
[0002] In automotive intelligent driving, ASIL (Automotive Safety Integrity Level) represents the automotive safety level. This is a risk classification system defined by the ISO26262 standard for the functional safety of road vehicles.
[0003] The standard defines functional safety as "the absence of unreasonable risk due to hazards associated with the malfunctioning behavior of electrical and electronic systems." ASIL establishes safety requirements in accordance with ISO 26262 based on the probability and tolerance of hazards to automotive components.
[0004] ISO 26262 defines four ASIL levels: ASIL-A, B, C, and D. ASIL-A represents the lowest level of automotive hazard, while ASIL-D represents the highest level of automotive hazard. Specifically, the calculation of the ASIL level is determined by three hardware indicators: the probability of random hardware failures (PMHF, Probabilistic Model for Hardware Failures), the single point fault metric (SPFM, Single Point Fault Metric), and the latent fault metric (LFM, Latent Fault Metric).
[0005] For example, airbags, anti-lock brakes, and power steering systems must meet ASIL-D, the most stringent level for safety, because their failure poses the highest risk. At the bottom of the safety spectrum, components such as rear lights only need to meet ASIL-A. Headlights and brake lights are usually ASIL-B, while cruise control is usually ASIL-C.
[0006] At present, in order to meet the requirements of automobile safety levels in different scenarios, automotive chip design manufacturers will design the central processing unit (CPU) into an architecture that meets different safety levels. For example, to meet the requirements of automotive safety level ASIL (Automotive Safety Integrity Level)-D, the CPU will be designed into a dual-core lock-step or multi-core lock-step mode. The final CPU subsystem will contain several sub-CPUs with different safety levels, such as: 1 ASIL-D level CPU + 1 ASIL-C level CPU + 1 ASIL-B level CPU + 1 ASIL-A level CPU.
[0007] Among them, for the hardware composition of the CPU subsystem, the CPU subsystem can be composed of any two or more CPUs of the ASIL-A safety level, ASIL-B safety level, ASIL-C safety level, and ASIL-D safety level, and the number of CPUs of each safety level is greater than or equal to 1, at least one, and there is no limit on the upper limit. The hardware composition table of the CPU subsystem is shown in Table 1: (N / M / J / K is an integer greater than or equal to 1).
[0008]
[0009] Table 1
[0010] In the traditional automobile driving task scheduling method, when the operating system runs on the above-mentioned CPU subsystem, it will still schedule tasks according to its own scheduling strategy: Completely Fair Scheduler (CFS) / real-time scheduling strategy, etc., which cannot guarantee that tasks with security requirements can run on a CPU that meets the security level requirements, resulting in security vulnerabilities when the security task is running, leading to unpredictable security risks.
[0011] Therefore, it is necessary to provide a task scheduling method, a task scheduling device, an automotive chip and a computer-readable storage medium to effectively solve the above problems. Summary of the invention
[0012] The present invention provides a task scheduling method, a task scheduling device, an automobile chip and a computer-readable storage medium.
[0013] An embodiment of the present invention provides a task scheduling method, including:
[0014] Acquire task information, and configure the priority, scheduling strategy and security level of the task based on the task information and preset configuration information;
[0015] Based on the security level, obtaining information of a first CPU group that can execute the task;
[0016] Obtaining the load information of each CPU group in the current system and the load information of the CPU in each CPU group;
[0017] Determining a first CPU that runs the task based on the load information of the CPU group, the load information of the CPU, and the information of the first CPU group;
[0018] Based on the priority, scheduling policy and security level of the task, determine the time for the first CPU to run the task.
[0019] Preferably, obtaining information of a first CPU group capable of executing the task based on the security level includes:
[0020] The CPU group whose security level is greater than or equal to the security level of the task is obtained and determined as the first CPU group.
[0021] Preferably, determining the first CPU that runs the task based on the load information of the CPU group, the load information of the CPU, and the information of the first CPU group includes:
[0022] Obtain the CPU group with the smallest load in the first CPU groups, and determine it as the second CPU group for running the task;
[0023] The CPU with the smallest load in the second CPU group is obtained and determined as the first CPU.
[0024] Preferably, the task information includes the load of the task; and further includes:
[0025] Based on the load of the task and the load of the second CPU group, updating the load of the second CPU group;
[0026] Based on the load of the task and the load of the first CPU, the load of the first CPU is updated.
[0027] Preferably, determining the time for the first CPU to run the task based on the priority, scheduling policy and security level of the task includes:
[0028] Among the tasks executed by the first CPU, for the tasks with the same security level, determining corresponding time slices based on the priority and scheduling strategy of each task;
[0029] Based on the time slices of the tasks, the time for the first CPU to run each of the tasks is obtained.
[0030] Preferably, it also includes:
[0031] When the time slice of the new task is obtained, the site information of the last running task is saved, and the site of the new task is replaced to execute the new task.
[0032] Preferably, the preset configuration information includes a static configuration file and a dynamic configuration file; and configuring the security level of the task based on the information of the task and the preset configuration information includes:
[0033] Based on the information of the task and the static configuration file, configuring the security level of the task; and
[0034] The security level of the task is configured based on the information of the task, the dynamic configuration file and the dynamic scenario of the current system.
[0035] Furthermore, a task scheduling device is provided, comprising:
[0036] A task collection module, used to obtain task information and store it in a task information collection unit;
[0037] A task clustering module, used to configure the priority, scheduling strategy and security level of the task based on the task information and preset configuration information;
[0038] A task scheduling module is used to obtain information about the first CPU group that can run the task based on the security level; obtain load information of each CPU group in the current system and load information of the CPU in each CPU group; determine the first CPU that runs the task based on the load information of the CPU group, the load information of the CPU and the information of the first CPU group; and determine the time when the first CPU runs the task based on the priority, scheduling strategy and security level of the task.
[0039] Furthermore, an automotive chip is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above-described methods when executing the computer program.
[0040] Furthermore, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods are implemented.
[0041] Compared with the prior art, the technical solution of the embodiment of the present invention has the following beneficial effects:
[0042] The task scheduling method provided by the embodiment of the present invention labels each task with a security level, so that the task scheduler can select a matching CPU according to the security level label when scheduling tasks, thereby improving the overall security of the system. Furthermore, the concept of security level is introduced to both tasks and CPUs, so that security tasks can be run on CPUs that meet the security level requirements, thereby ensuring the reliability of task operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present invention, not all embodiments. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.
[0044] Figure 1 It is a flowchart of the traditional task scheduling method;
[0045] Figure 2 A flowchart of a task scheduling method provided by an embodiment of the present invention;
[0046] Figure 3 A module diagram of a task scheduling device provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0049] View now Figure 1 ,The traditional task scheduling method includes the following steps:
[0050] Step 101, create a task and configure the priority and scheduling strategy of the task.
[0051] Step 102: Submit the task to the global task scheduler.
[0052] Step 103: The global task scheduler selects a CPU for execution according to the scheduling policy and priority.
[0053] Step 104: The task is added to the task queue of the specified CPU.
[0054] Step 105, determine whether scheduling can be obtained currently.
[0055] Step 106, executing the task on the selected CPU.
[0056] Specifically, in the traditional scheduling scheme, the operating system creates a new task, allocates resources such as stacks / heaps to the task, configures the corresponding priority for the task, and allocates the corresponding time slice. When the task scheduler detects that a new task has been created, it starts to select the corresponding CPU to run the task. Among them, the task scheduler will periodically calculate the load of each CPU in the current system and the load of each CPU group, and the task scheduler will also use the load calculation algorithm to calculate the load of the running task.
[0057] Then, the task scheduler will first select the CPU group where the task runs, select the group with the smallest load among all current CPU groups to run, and add the task to the group with the smallest load. As the new task is added to the group, the load of the group changes, and then the load value of the group is updated.
[0058] After the task scheduler selects the corresponding group for the task, it will determine which CPU in the group has the smallest load and put the task into the task queue of the CPU. As the new task is added to the task queue of the CPU, the load of the CPU changes, and then the load value of the CPU is updated.
[0059] After the task scheduler selects the corresponding CPU for the task, it will periodically check whether the current task has obtained a time slice and whether it can be executed. This is based on the CPU's own scheduling method. Usually, a certain percentage of time slices is allocated to each task in the CPU task queue based on priority, and then cyclic execution is performed according to the time slice.
[0060] When the task obtains the time slice, the CPU switches the task, saves the scene of the current task, replaces it with the scene of the task to be executed, and then starts executing the new task.
[0061] In the above traditional task scheduling methods, when the operating system runs on the above CPU subsystem, it will still schedule tasks according to its own scheduling strategy: completely fair scheduling / real-time scheduling strategy, etc., and cannot guarantee that tasks with security requirements can run on CPUs that meet security level requirements, resulting in security vulnerabilities when the security task is running, leading to unpredictable security risks.
[0062] Based on the problems existing in the prior art, the embodiments of the present invention provide a new task scheduling method, a task scheduling device, an automobile chip and a computer-readable storage medium.
[0063] In the application scenarios of the task scheduling method, task scheduling device, automotive chip and computer-readable storage medium provided in the present application, as shown in Table 1, the CPU is a collection of different security levels and security levels, as long as there are more than two combinations, it can be divided into multiple groups, but the number of CPUs in each group can be greater than or equal to 1.
[0064] Figure 2 A flowchart of a task scheduling method provided by an embodiment of the present invention; Figure 3 A structural diagram of a task scheduling device provided for an embodiment of the present invention.
[0065] like Figure 2 As shown, an embodiment of the present invention provides a task scheduling method, including:
[0066] Step S201, obtaining task information, and configuring the task priority, scheduling strategy and security level based on the task information and preset configuration information.
[0067] In a specific implementation, the task scheduling method can be applied to a car chip, and when a user uses certain applications of a car computer, the information of the tasks corresponding to these applications, such as navigation, playing music, etc. The task information may include the type of task.
[0068] The priority of a task provides a reference for the order in which multiple tasks are run. Tasks with higher priorities are run before tasks with lower priorities. There may be two or more tasks in a CPU's task queue. The task scheduling policy may be to assign a time slice to the task when it can be run, so that when the time slice corresponding to the task is detected, the CPU can run the task.
[0069] The preset configuration information may include the task priority and scheduling policy corresponding to the task type, so that the operating system can configure the priority of the task based on the task type and the task priority corresponding to the various task types in the preset configuration information, and configure the scheduling policy of the task based on the task type and the scheduling policy of the task corresponding to the various task types in the preset configuration information. The specific configuration process can be implemented in any way that can be implemented in the prior art, such as by looking up a table.
[0070] In some implementations, the preset configuration information further includes a static configuration file and a dynamic configuration file. In step S201, configuring the security level of the task based on the task information and the preset configuration information includes: configuring the security level of the task based on the task information and the static configuration file; and configuring the security level of the task based on the task information, the dynamic configuration file and the dynamic scenario of the current system.
[0071] In the specific implementation, the operating system clusters all tasks of the current system according to the current system's operating scenario and static configuration files, and marks each task with a different safety level. The specific safety level tags are divided into four categories, namely ASIL-A, ASIL-B, ASIL-C, and ASIL-D. There are two methods for selecting safety level tags. One is to configure according to the static configuration file of the system. For example, if the safety level of game-related tasks is configured as ASIL-A in the configuration file, the operating system will set the safety level of the game task to ASIL-A; for example, if the safety level of the autonomous driving task is set to ASIL-D in the configuration file, the operating system will set the safety level of the autonomous driving task to ASIL-D. Another method is to configure dynamically according to the current operating scenario. For example, for the same task, there will be different safety level requirements in different operating scenarios. Therefore, it is necessary to dynamically switch the safety level of such tasks to ensure that the task meets safety requirements in different scenarios. For example, when a vehicle is performing navigation tasks, the vehicle's sensors determine that the vehicle is currently in a safe environment (e.g., stopped / low-speed state). In this case, such tasks will be configured with a lower safety level tag (ASIL-A / ASIL-B). However, when the vehicle is in high-speed operation, the safety level tag of the navigation task will be dynamically switched to a higher one (ASIL-C / ASIL-D).
[0072] In some implementations, the operating system also allocates resources such as a stack / heap to the task.
[0073] Step S202: Based on the security level, obtain information of the first CPU group that can execute the task.
[0074] Step S203, obtaining the load information of each CPU group in the current system and the load information of the CPU in each CPU group.
[0075] Step S204: determining a first CPU that runs the task based on the load information of the CPU group, the load information of the CPU, and the information of the first CPU group.
[0076] In a specific implementation, when the task scheduler detects that a new task is created, it starts to select a corresponding CPU to run for the task.
[0077] In some implementation methods, step S202, based on the security level, obtains information of a first CPU group that can execute the task, including: obtaining a CPU group whose security level is greater than or equal to the security level of the task, and determining it as the first CPU group.
[0078] In some implementation methods, step S204, based on the load information of the CPU group, the load information of the CPU and the information of the first CPU group, determines the first CPU that runs the task, including: obtaining the CPU group with the smallest load in the first CPU group, and determining it as the second CPU group that runs the task; obtaining the CPU with the smallest load in the second CPU group, and determining it as the first CPU.
[0079] In specific implementation, the task scheduler will periodically calculate the load of each CPU in the current system and the load of each CPU group. The task scheduler will also use the load calculation algorithm to calculate the load of the running task.
[0080] The task scheduler will first select an executable CPU group based on the safety level. The principle is to select a CPU group with a safety level greater than or equal to the current task to run. For example, an ASIL-A CPU group can execute ASIL-A tasks; an ASIL-B CPU group can execute ASIL-A tasks and ASIL-B tasks; an ASIL-C CPU group can execute ASIL-A tasks, ASIL-B tasks, and ASIL-C tasks; an ASIL-D CPU group can execute ASIL-A tasks, ASIL-B tasks, ASIL-C tasks, and ASIL-D tasks. That is, the first CPU group for the ASIL-A task is the CPU group of ASIL-A, the CPU group of ASIL-B, the CPU group of ASIL-C, and the CPU group of ASIL-D; the first CPU group for the ASIL-B task is the CPU group of ASIL-B, the CPU group of ASIL-C, and the CPU group of ASIL-D; the first CPU group for the ASIL-C task is the CPU group of ASIL-C and the CPU group of ASIL-D; and the first CPU group for the ASIL-D task is the CPU group of ASIL-D.
[0081] If there are multiple CPU groups that meet the requirements, that is, the first CPU group includes more than or equal to two CPU groups, then the group with the smallest load among the CPU groups that meet the requirements is selected to run, and the task is added to the group with the smallest load, that is, the second CPU group. In some embodiments, due to the addition of a new task to the group, the load of the second CPU group changes, and it is necessary to update the load value of the second CPU group based on the load of the task and the original load of the second CPU group.
[0082] After the task scheduler selects the corresponding second CPU group for the task, it will determine which CPU in the second CPU group has the smallest load, and put the task into the task queue of the CPU, i.e., the first CPU. In some embodiments, since the new task is added to the task queue of the CPU, the load of the first CPU changes, and the load value of the first CPU needs to be updated based on the load of the task and the original load of the first CPU.
[0083] Step S205, determining the time for the first CPU to run the task based on the priority, scheduling strategy and security level of the task.
[0084] In some embodiments, step S205 includes determining corresponding time slices for tasks with the same security level in the tasks run by the first CPU based on the priority and scheduling strategy of each task; and obtaining the time for the first CPU to run each task based on the time slice of the task.
[0085] In the specific implementation, after the task scheduler selects the corresponding first CPU for the task, it will periodically check whether the current task has obtained a time slice and can be executed. This is based on the CPU's own scheduling method. For example, a certain percentage of time slices is allocated to each task in the CPU task queue based on priority, and then cyclic execution is performed according to the time slice. When the task obtains a time slice, the first CPU switches the task, saves the scene of the current task, replaces it with the scene of the task to be executed, and then starts executing the new task.
[0086] In summary, the task scheduling method provided by the embodiment of the present invention labels each task with a security level, so that the task scheduler can select a matching CPU according to the security level label when scheduling tasks, thereby improving the overall security of the system. The concept of security level is introduced to both tasks and CPUs, so that security tasks can be run on CPUs that meet the security level requirements, thereby ensuring the reliability of task operation.
[0087] Furthermore, the present application also provides a task scheduling device, such as Figure 3 As shown, the task scheduling device includes: a task collection module 11, a task clustering module 12 and a task scheduling module 13.
[0088] Among them, the task collection module 11 is used to obtain the information of the task and store it in the task information collection unit. The task clustering module 12 is used to configure the priority, scheduling strategy and security level of the task based on the task information and preset configuration information. The task scheduling module 13 is used to obtain the information of the first CPU group that can run the task based on the security level; obtain the load information of each CPU group in the current system and the load information of the CPU in each CPU group; determine the first CPU that runs the task based on the load information of the CPU group, the load information of the CPU and the information of the first CPU group; and determine the time for the first CPU to run the task based on the priority, scheduling strategy and security level of the task.
[0089] In a specific implementation, the task set module 11 is used to continuously obtain the currently running task set information, for example, when a user uses certain applications in the vehicle computer, the task information corresponding to these applications.
[0090] The task scheduling module 13 is used to cluster all tasks of the current system according to the operating scenario and static configuration file of the current system, and mark each task with a different safety level. The specific safety level tags are divided into four categories, namely ASIL-A, ASIL-B, ASIL-C, and ASIL-D. There are two methods for selecting the safety level tag. One is to configure it according to the static configuration file of the system. For example, if the safety level of the game-related task is configured as ASIL-A in the configuration file, the operating system will set the safety level of the game task to ASIL-A; for example, if the safety level of the autonomous driving task is set to ASIL-D in the configuration file, the operating system will set the safety level of the autonomous driving task to ASIL-D. Another method is to configure dynamically according to the current operating scenario. For example, for the same task, there will be different safety level requirements in different operating scenarios. Therefore, it is necessary to dynamically switch the safety level of such tasks to ensure that the task meets the safety requirements in different scenarios. For example, when a vehicle is performing navigation tasks, the vehicle's sensors determine that the vehicle is currently in a safe environment (e.g., stopped / low-speed state). In this case, such tasks will be configured with a lower safety level tag (ASIL-A / ASIL-B). However, when the vehicle is in high-speed operation, the safety level tag of the navigation task will be dynamically switched to a higher one (ASIL-C / ASIL-D).
[0091] After all tasks with configured safety levels, enter the task scheduling module 13. The task scheduling module 13 will first read the hardware capability information of the CPU through the register, and group the CPU according to the safety level into four groups: ASIL-A, ASIL-B, ASIL-C, and ASIL-D. The safety level capability of each group is consistent. There may be multiple CPU sub-units in the same group, which depends on the actual hardware design. That is, the safety level of the CPU in the group with a safety level of ASIL-A is ASIL-A, the safety level of the CPU in the group with a safety level of ASIL-B is ASIL-B, the safety level of the CPU in the group with a safety level of ASIL-C is ASIL-C, and the safety level of the CPU in the group with a safety level of ASIL-D is ASIL-D.
[0092] In this embodiment, the CPU can only run tasks that are less than or equal to its safety level. Specifically, an ASIL-A CPU can execute ASIL-A tasks; an ASIL-B CPU can execute ASIL-A tasks and ASIL-B tasks; an ASIL-C CPU can execute ASIL-A tasks, ASIL-B tasks, and ASIL-C tasks; an ASIL-D CPU can execute ASIL-A tasks, ASIL-B tasks, ASIL-C tasks, and ASIL-D tasks. Since CPU groups are classified according to safety levels, the CPUs in a CPU group that can run new tasks are also determined based on the safety level corresponding to the CPU group.
[0093] After the current CPU is grouped according to the safety level, the task scheduling begins. First, determine the safety level information of the task to be executed, and select the matching CPU group. For example, an ASIL-D task will be assigned to the ASIL-D level CPU group, that is, the first CPU group. Then, load balancing is performed in the first CPU group according to the CPU load situation in the group, and the corresponding CPU, that is, the first CPU, is selected, and then the task with the specified safety level is run.
[0094] There are several basic concepts in load balancing. One is the CPU load, which is used to describe the total load size of the tasks being executed on this CPU and the tasks waiting to be executed in the queue. The other is the CPU group load, which refers to the sum of the loads of all CPUs in this group. There is also the task load, which refers to the load when a specific task is running. After the task is created, a group will be selected to join based on the load of each CPU group within the range of the first CPU group selected based on the security level. The specific strategy is: select the group with the smallest load in the currently executable CPU group, that is, the second CPU group, to join. After selecting the second CPU group, select the CPU with the smallest load in the second CPU group, that is, the first CPU, to run, and add the task to the task queue of the first CPU to run.
[0095] In this embodiment, CPUs with the same safety level form a CPU group (Group), and there are up to four Groups, namely Group-a / b / c / d. There are several CPUs with the same safety level under each Group. In the process of scheduling, the corresponding task is first selected to the corresponding CPU group according to the safety level and the load of each CPU group. For example, at this moment, an ASIL-B task needs to be scheduled. The scheduler first checks whether the safety level of the task is ASIL-B, so the task can only be sent to a Group greater than or equal to ASIL-B for execution. That is, Group-b / c / d, which Group to send to b / c / d, also needs to consider the load situation of Group-b / c / d, and balance it. For example, if the load of Group-b / c is very large, there are many tasks running on it, but there is almost no load on Group-d, then Group-d will be selected to run the task (see Table 1 for examples of hardware structures of multiple Groups).
[0096] In other embodiments, the task scheduling device provided in the present application can implement any embodiment of the task scheduling method described above.
[0097] Furthermore, the present application also provides an automotive chip, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the task scheduling method in any of the above embodiments when executing the computer program.
[0098] Furthermore, the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the task scheduling method in any of the above embodiments are implemented.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A task scheduling method, characterized in that: include: Acquire task information, and configure the priority, scheduling strategy and security level of the task based on the task information and preset configuration information; Based on the security level, obtaining information of a first CPU group that can execute the task; Obtaining the load information of each CPU group in the current system and the load information of the CPU in each CPU group; Determining a first CPU that runs the task based on the load information of the CPU group, the load information of the CPU, and the information of the first CPU group; Based on the priority, scheduling policy and security level of the task, determine the time for the first CPU to run the task.
2. The task scheduling method according to claim 1, characterized in that: The obtaining, based on the security level, information of a first CPU group capable of executing the task includes: The CPU group whose security level is greater than or equal to the security level of the task is obtained and determined as the first CPU group.
3. The task scheduling method according to claim 1, characterized in that: The determining, based on the load information of the CPU group, the load information of the CPU, and the information of the first CPU group, a first CPU that runs the task includes: Obtain the CPU group with the smallest load in the first CPU groups, and determine it as the second CPU group for running the task; The CPU with the smallest load in the second CPU group is obtained and determined as the first CPU.
4. The task scheduling method according to claim 3, characterized in that: The task information includes the load of the task; and also includes: Based on the load of the task and the load of the second CPU group, updating the load of the second CPU group; Based on the load of the task and the load of the first CPU, the load of the first CPU is updated.
5. The task scheduling method according to claim 1, characterized in that: The determining, based on the priority, scheduling policy and security level of the task, a time for the first CPU to execute the task includes: Among the tasks executed by the first CPU, for the tasks with the same security level, determining corresponding time slices based on the priority and scheduling strategy of each task; Based on the time slices of the tasks, the time for the first CPU to run each of the tasks is obtained.
6. The task scheduling method according to claim 1, characterized in that: Also includes: When the time slice of the new task is obtained, the site information of the last running task is saved, and the site of the new task is replaced to execute the new task.
7. The task scheduling method according to claim 1, characterized in that: The preset configuration information includes a static configuration file and a dynamic configuration file; the configuring the security level of the task based on the information of the task and the preset configuration information includes: Based on the information of the task and the static configuration file, configure the security level of the task; and The security level of the task is configured based on the information of the task, the dynamic configuration file and the dynamic scenario of the current system.
8. A task scheduling device, characterized in that: include: A task collection module, used to obtain task information and store it in a task information collection unit; A task clustering module, used to configure the priority, scheduling strategy and security level of the task based on the task information and preset configuration information; A task scheduling module is used to obtain information about the first CPU group that can run the task based on the security level; obtain load information of each CPU group in the current system and load information of the CPU in each CPU group; determine the first CPU that runs the task based on the load information of the CPU group, the load information of the CPU and the information of the first CPU group; and determine the time when the first CPU runs the task based on the priority, scheduling strategy and security level of the task.
9. An automotive chip, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
