Multi-core platform-oriented efficient real-time scheduling method and system for tasks of automobile operating system and application of multi-core platform-oriented efficient real-time scheduling method and system
Through the parallel pruning scheduling method, the task scheduling is optimized on a multi-core platform, which solves the real-time performance challenges of the autonomous driving system under the AUTOSAR architecture, and realizes efficient task scheduling, reduces running time and search time, and improves the overall performance and scalability of the system.
Patent Information
- Application Number
- CN202510381307.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-07-18
AI Technical Summary
Under the AUTOSAR architecture, the task scheduling scheme of multi-core platforms is difficult to meet the high requirements of the automatic driving system for real-time performance. The existing scheduling schemes have problems such as low resource utilization, high energy consumption, large delay jitter and nonlinear growth in design complexity, especially in the L3+-level system of autonomous driving, which is difficult to meet the strict time certainty requirements.
The parallel pruning scheduling method is adopted to recursively search all possible scheduling schemes, use parallel strategies and pruning strategies to greatly reduce search time and computational complexity, define the real-time system model and task optimal scheduling problems in multi-core platforms, and provide an efficient real-time task scheduling method, including DAG generation module and task scheduling module, and optimize the scheduling scheme using parallel threads and pruning strategies.
The overall running time of the task chain is significantly reduced by about 25%, and the search time is reduced by 95.9%, which improves the efficiency and quality of task scheduling, has good scalability and robustness, and can quickly generate the optimal scheduling solution in complex design environments.
Smart Images

Figure BDA0005334654950000074 
Figure BDA0005334654950000081 
Figure BDA0005334654950000093
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of embedded systems, and relates to an efficient real-time scheduling method, system and application for automotive operating system tasks for a multi-core platform. Background Art
[0002] With the accelerating advancement of automotive intelligence and electrification, the limitations of traditional distributed electronic and electrical architectures have become increasingly prominent. In the early days, basic function control of vehicles could be achieved through a small number of independent ECUs (Electronic Control Units). However, with the exponential growth of the complexity of in-vehicle functions, modern vehicles need to deploy hundreds of heterogeneous ECUs. These ECUs developed by different suppliers adopt a decentralized hardware architecture and a closed software system, resulting in three core defects in the system: the redundancy rate of computing power resources is as high as 30%-40%, the length of the vehicle wiring harness exceeds 5 kilometers, and the development and maintenance costs over the entire life cycle increase by more than 45%, seriously restricting the scalability and iteration efficiency of in-vehicle electronic systems. To address the above problems, the combination of virtualization technology and the AUTOSAR (AUTomotive Open System Architecture) standardization framework has become an important technical path in the industry. On the one hand, virtualization technology abstracts physical hardware resources into a virtualization layer to achieve centralized integration of multiple logical ECU functions, significantly reducing the number of hardware and the complexity of the wiring harness; on the other hand, the AUTOSAR architecture provides software infrastructure support for complex function collaboration by defining standardized software component interfaces and task scheduling mechanisms.
[0003] The AUTOSAR architecture includes a general software infrastructure, which provides a set of detailed and rigorous specifications for defining software components and their interfaces. Under this architecture, the functional architecture of the system consists of a series of software components that cooperate closely through interfaces, and these components work together to achieve complex functions. The behavior of each software component is reflected by a set of runnable entities, and these runnable entities are executed by being mapped to corresponding tasks. The optimized design of these task scheduling mechanisms directly affects the real-time performance of the system. However, in a multi-core hardware architecture, how to efficiently implement task scheduling remains the core challenge faced by the AUTOSAR system.
[0004] The current mainstream scheduling schemes show polarized characteristics: partition scheduling adopts a static core binding strategy, tasks are pre-statically assigned to specific processors, and each processor independently schedules and manages its assigned tasks. Although this scheduling method can ensure timing determinism, the utilization rate of multi-core processors is generally less than 65%; although global scheduling can achieve the theoretical utilization upper limit, the context switching overhead generated by its dynamic load balancing mechanism significantly increases the system energy consumption and delay jitter. In particular, for L3+ level autonomous driving systems, the end-to-end delay requirements of its task chain have been compressed to 100ms, and the existing scheduling schemes are difficult to meet the strict time determinism requirements. The more severe challenge comes from the nonlinear growth of system design complexity. The number of runnable entities in a typical autonomous driving system has exceeded 5,000, and the dependencies between tasks form a constraint matrix of more than 10^4. However, the current industry lacks effective design automation tools, resulting in a large number of manufacturers still using manual heuristic scheduling strategies, and the optimization efficiency of their schemes is exponentially negatively correlated with the system scale. These manual design schemes often fail to meet the extremely high requirements for real-time performance in the field of autonomous driving. In the field of autonomous driving, which is extremely sensitive to safety and efficiency, even a slight excess of running time may significantly affect the efficiency of the overall system and may cause major accidents and immeasurable losses. Therefore, how to efficiently optimize the task scheduling solution under the AUTOSAR architecture has become a key technical problem that needs to be solved urgently, which is of great significance for promoting the implementation of embedded virtualization systems in the field of smart cars. Summary of the invention
[0005] In order to solve the deficiencies of the prior art, the purpose of the present invention is to provide an efficient real-time scheduling method for automotive operating system tasks on multi-core platforms, which can find the optimal task scheduling solution in a short time through parallel pruning scheduling. The present invention formally defines the real-time system model in multi-core platforms and the optimal scheduling problem of tasks with resource constraints, providing a clear mathematical basis for algorithm design; an efficient real-time scheduling method for automotive operating system tasks on multi-core platforms is proposed, which recursively searches all possible scheduling solutions by simulating the execution process of the task chain, and uses parallel strategies and pruning strategies to significantly reduce the search time and computational complexity;
[0006] The specific technical solution for achieving the purpose of the present invention is:
[0007] Step 1: Setting the termination condition
[0008] For each recursive branch, at its initial stage, test whether the current scheduling scheme meets the termination condition, which is that all tasks already exist in the currently searched mapping function. If satisfied, and If it is better than the global mapping function Map, then use the currently searched mapping function on the premise of thread safety Update the global mapping function Map and stop the current recursive branch; if not satisfied, it means that there are tasks that have not been scheduled, and continue with the subsequent steps.
[0009] Step 2: Pruning of intermediate results
[0010] If the recursive search does not meet the termination condition, then perform pruning judgment according to the scheduling scheme of the partially completed tasks: calculate the ideal running time. If according to the current scheduling method, even if the tasks that have not been scheduled do not consider any resource constraints, its ideal running time is still not better than the global optimal scheduling result, then perform pruning; and / or, if the current scheduling scheme violates the maximum execution duration constraint of the task chain, then perform pruning; and / or, if the current scheduling scheme violates the task start and end time constraints, then perform pruning. If pruning is performed, immediately stop the current recursive branch; if pruning is not performed, then continue with the subsequent steps.
[0011] Step 3: Generation of task list
[0012] According to the current time node T, the mapping function The theoretical running time of each task, count the tasks that have completed running at the current time node T, and add the successor tasks of the task chains to which these tasks belong to the list L of tasks to be scheduled, and continue with the subsequent steps.
[0013] Step 4: Division of search space
[0014] For each task ρ in the list L of tasks to be scheduled, generate all possible scheduling schemes and store them in the list Search_List.
[0015] For each task ρ in the list L of tasks to be scheduled, according to the different kernel ids assigned and different priorities of the tasks, generate all possible scheduling schemes and store them in the list Search_List. Divide the recursive search space according to different scheduling schemes, and each scheduling scheme will be used as the starting point of its corresponding recursive search space to continue the subsequent search.
[0016] Step 5: Search for scheduling schemes
[0017] For each scheduling scheme in the search list Search_List, allocate a thread to each of them, and the threads execute in parallel. For each thread, update the Mapping relationship in. According to the priority relationship assigned to the tasks in the scheduling scheme, execute the task with the highest priority, and record the start execution time of each task.
[0018] Meanwhile, based on the current time point and the theoretical running times of all running tasks, calculate the next time node T such that at least one task will finish execution at T.
[0019] In the specific implementation process of the present invention, The update of and T can be carried out in parallel.
[0020] Based on the respective T and of different scheduling schemes Each thread creates new recursive branches in parallel and starts recursive search.
[0021] The present invention also provides an efficient real-time scheduling system, which can implement the above real-time scheduling method, including: a DAG generation module and a task scheduling module.
[0022] The DAG generation module, its main function is to parse the standard XML input file provided by the user and construct a directed acyclic graph (DAG) instance based on the information therein for subsequent use by the task scheduling module. The XML input file details the set of tasks to be scheduled and their interdependencies. The key information of each task includes task name, period, execution delay, priority, and successor tasks. In addition, the input file also contains the maximum execution time limit of the task chain and the task start and end time constraints to support more precise scheduling control. After reading the XML file, the DAG generation module extracts and parses this key information, constructs task nodes and their dependencies, and finally generates a complete DAG class instance. This DAG instance provides a clear task topology structure for the task scheduling module, facilitating subsequent scheduling analysis and optimization.
[0023] The DAG module consists of four core components: the DAG unit, the DAGSignal unit, the DAGTask unit, and the TaskPath unit, which together constitute the infrastructure of the DAG module and the task scheduling system.
[0024] 1) The DAGTask (task class) unit: This class is used to represent tasks in the system. Each task has a unique identifier and has key information such as name, type, period, execution delay, and priority. In addition, the task may be constrained by a maximum execution time (optional) and start and end time limits (optional). After the task execution is completed, a corresponding signal (DAGSignal) will be generated, which can be used to trigger the execution of other tasks.
[0025] 2) DAGSignal (Signal class) unit: This class is used to represent the dependency relationships between tasks. After a task is executed, it generates a DAGSignal signal, which can be used as a trigger condition to start the execution of one or more successor tasks. This mechanism ensures the correct order of task execution and supports complex task dependency management.
[0026] 3) TaskPath (Task chain class) unit: TaskPath represents the task execution chain, which is composed of multiple DAGTasks organized in the order of dependency relationships to ensure that tasks are executed in the correct order.
[0027] 4) DAG (Directed Acyclic Graph class) unit: The DAG class is the core of the entire scheduling system, responsible for managing all DAGTask, DAGSignal, and TaskPath instances to form a complete task topology structure.
[0028] The core function of the task scheduling module is to generate an optimal task scheduling plan using a heuristic search method based on the tasks, task chain information, and related preprocessing data stored in the DAG class instance. During the scheduling process, the module comprehensively considers factors such as task priorities, dependency relationships, and time constraints, and dynamically adjusts the scheduling strategy to meet the real-time requirements of the system. Finally, the output of the scheduling module is an array that details the scheduling time of each task and the corresponding CPU core allocation. This scheduling plan ensures that, under the premise of meeting all constraint conditions (such as low-priority tasks are completed within their periods, do not exceed the maximum execution time limit, meet start and end time constraints, etc.), it gives priority to ensuring the optimal execution of high-priority task chains, that is, to minimize the overall execution time of critical task chains and improve the overall scheduling efficiency of the system.
[0029] The task scheduling module consists of three parts: the TimeNode unit, the ResultNode unit, and the SimpleBacktrack unit.
[0030] 1) TimeNode (Task execution time class) unit: TimeNode corresponds one-to-one with DAGTask and is mainly used to record the start execution time (m_startTime) and remaining execution time (m_restTime) of a task. During the task scheduling process, when a task is preempted (i.e., a higher-priority task interrupts the execution of the current task), TimeNode will record the remaining execution time of the preempted task so that it can accurately continue to complete the remaining workload when the execution resumes later.
[0031] 2) ResultNode (Task Scheduling Result Class) Unit: ResultNode corresponds one-to-one with DAGTask, and is used to record the scheduling status of tasks in the current heuristic search space. It includes the start execution time (m_startTime) and execution priority (m_priority) of the tasks.
[0032] 3) SimpleBacktrack (Heuristic Search Class) Unit: The SimpleBacktrack class is used to search for the optimal scheduling plan through heuristic search. It depends on the DAGTask class and TaskPath class in the DAG class instance to search for the optimal scheduling plan. During the search process, the execution status of tasks is maintained by updating the corresponding TimeNode class of the tasks, and the current scheduling status of tasks is maintained by the ResultNode class.
[0033] The present invention also provides a hardware system for implementing the above method. The hardware system includes: a memory and a processor; a computer program is stored on the memory, and when the computer program is executed by the processor, the above method is implemented.
[0034] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above method is implemented.
[0035] The present invention also provides an application of the above method, the above system, the above hardware system, or the above computer-readable storage medium in the task scheduling from image acquisition, preprocessing, feature extraction to target recognition in an automotive operating system based on the automotive open system architecture in an autonomous driving scenario.
[0036] The beneficial effects of the present invention include: The scheduling method of the present invention formally defines the real-time system model in a multi-core platform and the optimal scheduling problem of tasks with resource constraints, providing a clear mathematical basis for the design of related scheduling methods; the efficient real-time task scheduling method proposed by the present invention reduces the overall running time of the task chain by about 25%; the use of parallel strategies and pruning strategies significantly reduces the search time, reducing it by about 95.9%. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0038] Figure 1It is the structure diagram of the DAG generation module of the scheduling system of the present invention.
[0039] Figure 2 It is the structure diagram of the task scheduling module of the scheduling system of the present invention.
[0040] Figure 3 It is the flowchart of the scheduling method of the present invention.
[0041] Figure 4 It is the task chain diagram of the embodiment of the present invention.
[0042] Figure 5 It is the diagram of task parameters and constraint descriptions of the embodiment of the present invention.
[0043] Figure 6 It is the diagram of task chain constraint descriptions of the embodiment of the present invention.
[0044] Figure 7 It is the diagram showing the experimental results of the scheduling effectiveness of the embodiment of the present invention.
[0045] Figure 8 It is the diagram showing the experimental results of the effectiveness of the parallel pruning strategy of the embodiment of the present invention. Detailed implementation manners
[0046] Combined with the following specific embodiments and drawings, the present invention will be further described in detail. The processes, conditions, experimental methods, etc. for implementing the present invention, except for the specifically mentioned content below, are all common knowledge and well-known common sense in the art, and the present invention has no particularly restricted content.
[0047] The present invention formally defines the real-time system model in a multi-core platform and the optimal scheduling problem of tasks with resource constraints, providing a clear mathematical basis for algorithm design; and proposes an efficient real-time scheduling method for automotive operating system tasks oriented to multi-core platforms, which recursively searches all possible scheduling schemes by simulating the execution process of task chains, and significantly reduces the search time and computational complexity by using parallel strategies and pruning strategies;
[0048] The real-time scheduling system in the present invention includes a DAG generation module and a task scheduling module;
[0049] Figure 1 It is the structure diagram of the DAG generation module of the real-time scheduling system of the present invention. The DAG generation module constructs a DAG instance based on the input file information and provides task scheduling information;
[0050] The DAG generation module further includes: a DAG unit that is the core of the scheduling system, a DAGTask unit representing tasks in the scheduling system, a DAGSignal unit representing the dependency relationship between tasks, and a TaskPath unit representing the task execution chain;
[0051] Figure 2 It is the task scheduling module of the real-time scheduling system of the present invention. Based on the tasks, task chain information, and relevant preprocessing data stored in the DAG class instance, the task scheduling module generates an optimal task scheduling scheme by using a heuristic search method;
[0052] The task scheduling module further includes: a TimeNode unit for recording the task execution time, a ResultNode unit for recording the scheduling status of the task in the current heuristic search space, and a SimpleBacktrack unit for heuristically searching for the best scheduling scheme.
[0053] As Figure 3 shown, the real-time scheduling method of the present invention includes the following steps:
[0054] Step 1. Termination condition setting
[0055] For each recursive branch, at the start stage, test whether the current scheduling scheme meets the termination condition, which is that all tasks already exist in the mapping function searched currently (i.e., Figure 3 in ). If it meets the condition and is better than the global mapping function Map (i.e., M in Figure 3 ), then update the global mapping function Map with the mapping function searched currently under the premise of thread safety, and stop the current recursive branch; if it does not meet the condition, it means there are tasks that have not been scheduled, and continue with the subsequent steps.
[0056] Step 2. Pruning of intermediate results
[0057] If the recursive search does not meet the termination condition, then perform pruning judgment based on the scheduling scheme of the partially completed tasks currently: calculate the ideal running time. If according to the current scheduling method, even if the tasks that have not been scheduled do not consider any resource constraints, their ideal running time is still not better than the global optimal scheduling result, then perform pruning; and / or, if the current scheduling scheme violates the maximum execution duration constraint of the task chain, then perform pruning; and / or, if the current scheduling scheme violates the start and end time constraints of the task, then perform pruning. If pruning is performed, immediately stop the current recursive branch; if pruning is not performed, then continue with the subsequent steps.
[0058] Step 3. Task list generation
[0059] According to the current time node T, the theoretical running time of each task in the mapping function , count the tasks that have completed running at the current time node T, and add the successor tasks of the task chains to which these tasks belong to the task list L to be scheduled, and continue with the subsequent steps.
[0060] Step 4. Search Space Partitioning
[0061] For each task ρ in the task list L to be scheduled, generate all possible scheduling schemes and store them in the list Search_List.
[0062] For each task ρ in the task list L to be scheduled, according to the different kernel ids assigned, the priorities of the tasks are different. Generate all possible scheduling schemes and store them in the list Search_List. The recursive search space is partitioned according to different scheduling schemes, and each scheduling scheme will be used as the starting point of its corresponding recursive search space for subsequent searches.
[0063] Step 5. Scheduling Scheme Search
[0064] For each scheduling scheme in the search list Search_List, allocate a thread to each of them, and the threads execute in parallel. For each thread, update the mapping relationship in it. According to the priority relationship assigned to the tasks in the scheduling scheme, execute the task with the highest priority, and record the start execution time of each task. At the same time, based on the current time point and the theoretical running time of each running task, calculate the next time node T, such that at least one task will complete execution at T. Based on their respective T and each thread creates new recursive branches in parallel and starts recursive search.
[0065] Based on the respective T of different scheduling schemes and each thread creates new recursive branches in parallel and starts recursive search.
[0066] The specific algorithm of the scheduling method of the present invention is as follows:
[0067]
[0068]
[0069] Among them, the real-time scheduling method in the present invention involves three private global variables, including the global mapping function Map for storing the best scheduling result, T representing the current time point of the task, and the task list L for storing the tasks waiting to be scheduled to the core.
[0070] The core list Core represents all available cores in the multi-core platform, and each of its elements c i represents the id of the core. The size |Core| of the core list is the number of available cores assigned to the task queue to be executed by each core.
[0071] The task chain is defined as τ = (S, t, l, E), where S is the task sequence of the task chain; t is the cycle period time of the task chain, indicating that the task chain will be triggered every time t, and the tasks will start to be executed in sequence; l is the priority scheduling level of the task chain. When all other constraints are satisfied, the scheduling requires that the overall running time of the task chain with a high scheduling level be minimized first; E is the maximum execution time limit of the task chain, and it is required that the overall running time of the task chain be less than time E. For the task sequence S = <ρ0, ρ1, …, ρ n >, where the order of the tasks represents the data dependency between them. For two adjacent tasks ρ i and ρ j , where ρ i is ranked before ρ j , when ρ i finishes running, the calculated data result will be sent as an input parameter into ρ j , and the execution of task ρ j starts. For each task ρ i , it contains 3 attributes: the theoretical running time d i , the task start time a i and the task end time b i , which requires that ρ i needs to satisfy starting to run after time a i and finishing running before time b i in each cycle period.
[0072] For the mapping function Map that stores the best scheduling result, if task ρ is scheduled to core c, has priority p, and starts running from time s, then the value of Map(ρ, c, s, p) is 1, otherwise it is 0. The priority p determines the execution order of two different tasks that are scheduled at the exact same position on the same core. The quadruple (ρ, c, s, p) can represent all possible scheduling results of any task.
[0073] For the optimal scheduling problem of resource-constrained tasks in the present invention: Given a list of cores Core, a set Chain_List = {τ0, τ1, …, τ n} representing all task chains, and a set P = {ρ0, ρ1, …, ρ m} representing all tasks in the task chains, then there is the retrieval mapping relationship of the optimal scheduling problem of tasks with resource constraints Map(ρ i , c i , s i , p i ).
[0074] Map(ρ i , c i , si , p i ) It simultaneously satisfies data dependency constraints, resource constraints, maximum execution duration constraints, start and end time constraints, and target optimization constraints.
[0075] (1) Data dependency constraints: For any two tasks ρ k in the same task chain τ i and ρ j , ρ i is located before ρ j in the task chain. When both tasks are scheduled, it is necessary to satisfy that the start time s i of task ρ i plus its theoretical running time d i is less than or equal to the start time s j of task ρ j , that is, to ensure that ρ j must start running after ρ i has finished running.
[0076] Formal representation: ρ i < ρ j , if
[0077] Map(ρ i , c i , s i , p i ) = Map(ρ j , c j , s j , p j ) = 1
[0078] then
[0079] s i + d i ≤ s j
[0080] (2) Resource constraints: For each core c, at most one task is allowed to run at any moment δ. If there are multiple tasks, their scheduling priorities are all different.
[0081] Formal representation: There is
[0082]
[0083] then there is priority = 1, otherwise there are priority different priorities;
[0084] (3) Maximum execution duration constraint: Given any moment δ, if there are tasks in the task chain τ that have not been scheduled, that is, the task chain τ has not finished running, then δ minus s0 is less than or equal to E, where s0 is the scheduling start time of the first task in the task chain τ, and E is the maximum execution duration constraint of this task chain.
[0085] Formal representation: For
[0086] if there is
[0087]
[0088] then there is
[0089] δ - s i < E
[0090] (4) Start and end time constraint: For any task ρ i , its start and end time constraint is a i and b i . If this task has completed scheduling, then the sum of the theoretical running times of the previous tasks in its task chain needs to be less than or equal to a i , and considering the preemption of high-priority tasks in the same core, the completion time of this task is less than or equal to b i .
[0091] Formal representation: For ρ i ∈ S,
[0092] if
[0093] Map(ρ i , c, s i , p i ) = 1
[0094] then
[0095]
[0096] and
[0097]
[0098] (5) Objective optimization constraint:
[0099] Assume that the scheduling priorities of the task chains are {l1, l2, …, l m} (arranged from largest to smallest), then the optimization objective is to successively minimize the execution durations of the task chains τ = (S, t, l, E), S = <ρ0, ρ1, …, ρ m > with scheduling priorities of l1, l2, …, l n , that is, to minimize
[0100]
[0101] value
[0102] The present invention can face the autonomous driving system on a multi-core platform and, through an automated approach, quickly and accurately generate an optimal scheduling scheme for its complex task chain, so as to overcome the many limitations faced by traditional manual design methods when dealing with the increasing design complexity. It can effectively improve the efficiency and quality of task scheduling in a complex design environment, reduce the overall task scheduling time, and at the same time have good scalability and robustness.
[0103] Embodiment
[0104] The method of the present invention focuses on the efficient real-time scheduling of tasks in the automotive operating system on a multi-core platform. As a specific embodiment, the process is as follows:
[0105] 1. The present invention uses the core task chain of a real autonomous driving system based on the automotive development system architecture as an experimental case. The core task of this autonomous driving system is to perform a series of complex processes on the images captured by on-vehicle cameras to achieve accurate perception and understanding of the surrounding environment, thereby providing reliable data support for autonomous driving decisions.
[0106] 2. Figure 4 Details of the task chain diagram of the system are shown, which consists of 13 tasks and 7 task chains. Figure 5 The relevant attributes of these tasks are shown, including the theoretical running time, running period of the tasks, and the start and end time constraints of the tasks. Figure 6 The maximum execution duration constraint and the priority scheduling level of these task chains are shown. The experimental case covers multiple key links of the autonomous driving system from image acquisition, preprocessing, feature extraction to target recognition. The mutual cooperation and efficient scheduling among these task chains are crucial for the real-time performance of the entire system.
[0107] 3. The automatic scheduling code of this embodiment is deployed on a high-performance workstation equipped with the Ubuntu operating system (version 20.04), 8GB of memory, and an Intel i9-10900K CPU, which contains 10 cores and 20 threads.
[0108] 4. In order to accurately evaluate the running time performance of the generated task scheduling scheme, the generated task scheduling configuration is imported into the TDA4 target platform based on the automotive development system architecture. This platform has the ability to replay the scheduling and measure the actual running time overhead of the system in the automotive development system architecture environment, and record the actual running time of each task chain.
[0109] 5. By importing the optimal task scheduling setting scheme generated by the present invention and the traditional manual scheduling setting scheme into the target platform respectively, testing and recording the actual running time of each task chain, and conducting in-depth comparative analysis to evaluate the advantages of the proposed method in practical applications. The traditional manual scheduling setting scheme adopts a heuristic scheduling scheme, that is, according to the running sequence of tasks, the tasks are scheduled into the kernel in turn to ensure that there is no idle kernel as much as possible. It can be concluded from the experimental results that the present invention is significantly superior to the manual scheduling scheme in all task chains, and the experimental results are as Figure 7 shown. Specifically, the task scheduling scheme obtained by the present invention can achieve shorter task running time, and the overall running time is reduced by about 25%, indicating the effectiveness of the present invention.
[0110] 6. In order to verify the role of the parallel strategy in reducing the search time of the optimal scheduling scheme, modify the number of available threads of the workstation equipped with the scheduler, use different numbers of threads to execute the parallel strategy, and record in detail the time overhead required to search for the optimal scheduling scheme under different available threads, and compare it with the basic scheduling method at the same time. The basic scheduling method is single-threaded, and the time overhead is 2920 milliseconds. The experimental results are as Figure 8 shown. It can be concluded from the experimental results that compared with the basic scheduling method without the parallel strategy, the speedup ratio of the parallel algorithm shows an obvious correlation with the number of threads used. When the number of available threads is 1, the time overhead of the scheduling method with the parallel strategy is the same as that of the basic method; when the number of available threads is 16, the time overhead of the scheduling method with the parallel strategy is 202 / 2920 = 6.92% of the overhead of the basic scheduling method (single-threaded method). This provides strong empirical support for the effectiveness of the proposed parallel strategy and proves its great potential in improving computing efficiency.
[0111] 7. In order to verify the role of the pruning strategy in reducing the search time of the optimal scheduling scheme, deploy the scheduling methods with and without the pruning strategy respectively, and compare the time overhead required to search for the optimal scheduling scheme. The experimental results are as Figure 8 shown. It can be concluded from the experimental results that the pruning strategy effectively improves the search speed of the optimal scheduling scheme. At the same time, the pruning efficiency of the pruning strategy also increases with the increase of the number of available threads. When the number of available threads is 1, applying the pruning strategy can reduce the search overhead by 12.6%; when the number of available threads is 16, applying the pruning strategy can reduce the search overhead by 40.7%. This provides strong empirical support for the effectiveness of the proposed pruning strategy and proves its great potential in improving computing efficiency.
[0112] With the strong assistance of the proposed parallel strategy and pruning strategy, and by leveraging the efficient synergy among search threads, the overall search time has been significantly reduced by approximately 95.9%. The experimental results on a real autonomous driving system fully confirm the remarkable superiority of the proposed method over the manually derived solutions in terms of scheduling time and the quality of the obtained solutions. This achievement not only provides a new idea and method for task scheduling optimization based on the automotive development system architecture in autonomous driving systems, but also lays a solid foundation for future research and development in related fields, with important theoretical and practical value.
[0113] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript, etc.
[0114] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices produce means for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0115] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including instruction means that implement the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0116] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are executed on the computer or other programmable apparatus to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one process or a plurality of processes and / or blocks Figure 1 one process or a plurality of processes and / or blocks Figure 1 steps for implementing the functions specified in one block or a plurality of blocks.
[0117] Although the preferred embodiments of the present application have been described, additional changes and modifications can be made by those skilled in the art once they learn the basic creative concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present application.
[0118] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
[0119] The protection scope of the present invention is not limited to the above embodiments. Without departing from the spirit and scope of the inventive concept of the present invention, all changes and advantages conceivable by those skilled in the art are included in the present invention, and the appended claims are taken as the protection scope.
Claims
1. An efficient real-time scheduling method for automotive operating system tasks oriented to multi-core platforms, characterized in that, The described scheduling method finds the optimal task scheduling solution through parallel pruning scheduling, including the following steps: Step 1: At the starting stage of each recursive branch, test and determine whether the current scheduling solution meets the termination condition; Step 2: Perform pruning judgment on the scheduling solutions of the recursive branches that do not meet the termination condition; Step 3: Add the successor tasks of the task chain to which the tasks that have completed running at the current time node belong to the list of tasks to be scheduled; Step 4: Generate all possible scheduling solutions for each task in the list of tasks to be scheduled, store them in the search list, and divide the recursive search space for subsequent search; Step 5: Create parallel threads to execute each scheduling solution in the search list, update the mapping in the mapping function, and calculate the next time node; based on the updated mapping function and the next time node, each thread creates a new recursive branch in parallel and starts recursive search.
2. The scheduling method according to claim 1, wherein In step one, the termination condition means that all tasks already exist in the currently searched mapping function ; If the current scheduling scheme of the recursive branch meets the termination condition and is better than the global mapping function Map, then on the premise of thread safety, update the global mapping function Map with the currently searched mapping function and stop the current recursive branch; Or, If the current scheduling solution of the recursive branch does not meet the termination condition and there are tasks that have not been scheduled, execute the subsequent steps.
3. The scheduling method according to claim 1, wherein In Step 2, perform pruning judgment according to the scheduling solutions with unfinished tasks, including: The ideal running time of the scheduling solution is greater than the global optimal scheduling result; And / or, The scheduling solution violates the maximum execution duration constraint of the task chain; And / or, The scheduling solution violates the start and end time constraints of the task; When one or more of the above situations occur, prune the recursive solution.
4. The scheduling method according to claim 1, wherein In step 3, according to the current time node T and the mapping function the theoretical running time of each task, count the tasks that have completed running at the current time node T; add the subsequent tasks of the task chain to which the tasks that have completed running belong to the list of tasks to be scheduled.
5. The scheduling method according to claim 1, wherein In Step 4, for each task in the list of tasks to be scheduled, according to the different kernel ids assigned to the tasks and different priorities of the tasks, generate all possible scheduling solutions and store them in the search list; divide the recursive search space according to different scheduling solutions, and each scheduling solution will serve as the starting point of its corresponding recursive search space for subsequent search.
6. The scheduling method according to claim 1, wherein In Step 5, for each scheduling solution in the search list, assign a thread to each of them, and the threads execute in parallel; For each thread, update the mapping relationship in the mapping function according to the scheduling solution in the thread; According to the priority relationship assigned to the tasks in the scheduling solution, execute the task with the highest priority, and record the start execution time of each task; According to the current time point and the theoretical running time of each running task, calculate the next time node T, ensuring that at least one task will complete execution at T.
7. A scheduling system for implementing the scheduling method according to any one of claims 1-6, characterized in that, The described scheduling system includes: a DAG generation module and a task scheduling module; The DAG generation module constructs a DAG instance based on the input file information and provides task scheduling information, including: a DAG unit that is the core of the scheduling system, a DAGTask unit representing the tasks in the scheduling system, a DAGSignal unit representing the dependency relationship between tasks, and a TaskPath unit representing the task execution chain; The task scheduling module generates an optimal task scheduling scheme by using a heuristic search method based on the tasks, task chain information, and related preprocessing data stored in the DAG class instance, including: a TimeNode unit for recording the task execution time, a ResultNode unit for recording the scheduling status of the task in the current heuristic search space, and a SimpleBacktrack unit for heuristically searching for the best scheduling scheme.
8. A hardware system for implementing the method according to any one of claims 1-6, characterized in that, The hardware system includes: a memory and a processor; a computer program is stored on the memory, and when the computer program is executed by the processor, the method according to any one of claims 1-6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the method according to any one of claims 1-6 is implemented.
10. Application of the scheduling method according to any one of claims 1-6, the scheduling system according to claim 7, the hardware system according to claim 8, or the computer-readable storage medium according to claim 9 in task scheduling from image acquisition, preprocessing, feature extraction to target recognition in an automotive operating system based on the automotive open system architecture in an autonomous driving scenario.