Task allocation method and device for multi-core processor and vehicle

By constructing a directed acyclic graph model on a multi-core processor and introducing a multi-objective optimization algorithm with uncertain sets, the problem of insufficient robustness in task allocation of multi-core processors is solved, load balancing and reduction of inter-core communication consumption are achieved, thereby improving the robustness and real-time performance of the system.

CN121579164APending Publication Date: 2026-02-27DEEPAL AUTOMOBILE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511771363.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing multi-core processor task allocation methods are not robust enough when faced with uncertainties and dynamic changes in system task execution time. This leads to performance degradation of optimized allocation schemes in extreme cases, and static allocation methods are inflexible and cannot effectively achieve load balancing and reduce inter-core communication overhead.

Method used

A multi-objective optimization model is constructed using a directed acyclic graph model. An uncertainty set is introduced to represent cost uncertainty. The model is solved using a two-layer multi-objective optimization algorithm. Combined with multi-objective particle swarm optimization and genetic algorithm, the task allocation scheme is optimized to improve robustness and load balancing and reduce inter-core communication consumption.

Benefits of technology

It improves the robustness of task allocation in multi-core processors, reduces inter-core communication overhead, achieves load balancing, and ensures that the system maintains good performance and real-time performance in uncertain environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579164A_ABST
    Figure CN121579164A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of task scheduling of multi-core processors, and discloses a task allocation method and device for a multi-core processor and a vehicle. The task allocation method comprises the steps that S1, a system task is divided into n subtasks, and a directed acyclic graph model is constructed with the subtasks as nodes, establishing a multi-objective optimization model according to the execution cost of the sub-tasks, the communication cost between the sub-tasks, the constraint conditions and the optimization objective; s2, on the basis of the multi-objective optimization model, introducing an uncertainty set to represent the uncertainty of the cost, and establishing a multi-objective robust optimization model considering the uncertainty of the cost; and S3, solving the multi-target robust optimization model by adopting a double-layer multi-target optimization algorithm to obtain Pareto front edges, and selecting an optimal allocation scheme from the Pareto front edges as a task allocation scheme of the multi-core processor. By applying the technical scheme of the invention, the robustness can be improved, the inter-core communication consumption is reduced, and the load balancing is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of multi-core processor task scheduling technology, specifically relating to a task allocation method, device, and vehicle for multi-core processors. Background Technology

[0002] With the increasing size and complexity of system programs today, multi-core processors are widely used for system task processing. To fully utilize the computing resources of multi-core processors, the rational allocation of system tasks across multiple cores, improving multi-core utilization, load balancing, and shortening scheduling lengths to ensure the real-time performance of system programs have received widespread attention. Task allocation methods include dynamic and static approaches. Dynamic allocation assesses the load and task execution status in real time during system task execution and then reallocates tasks. This requires additional computing resources for monitoring system execution and dynamically planning allocation schemes. Furthermore, frequent task migrations can lead to the clearing of cached data and reloading on new cores, thus increasing task execution time. Static allocation estimates the system task execution status in advance, and tasks are allocated to designated cores at program startup and remain unchanged throughout the execution process. This reduces the overhead of real-time allocation scheme development and task migration; however, it lacks flexibility and is suitable for systems with fixed task sizes.

[0003] Currently, most multi-core task allocation methods are based on static analysis (such as Worst-Case Execution Time, WCET) to generate fixed allocation schemes. However, system programs generally do not have all tasks running under worst-case execution conditions; typically, some tasks run at higher costs while others run at lower costs, and these processes are dynamic, leading to inaccurate estimations and uncertain task execution times. Consequently, the robustness of the optimized allocation scheme obtained through this method degrades. Therefore, a more robust static task allocation method for multi-core processors is urgently needed. Summary of the Invention

[0004] In view of the shortcomings of the prior art, the purpose of this application is to provide a task allocation method, apparatus and vehicle for multi-core processors to improve robustness, reduce inter-core communication consumption and achieve load balancing.

[0005] In a first aspect, this application provides a task allocation method for a multi-core processor, which includes the following steps: S1. Divide system tasks into n Each subtask is used as a node to construct a directed acyclic graph model. Based on the execution cost of the subtasks, the communication cost between the subtasks, the constraints, and the optimization objectives, a multi-objective optimization model is established.

[0006] S2. Based on the multi-objective optimization model, an uncertainty set is introduced to represent the uncertainty of cost, and a multi-objective robust optimization model considering cost uncertainty is established.

[0007] S3. A two-layer multi-objective optimization algorithm is used to solve the multi-objective robust optimization model, obtain the Pareto front, and select the optimal allocation scheme from the Pareto front as the task allocation scheme for the multi-core processor.

[0008] The aforementioned task allocation method is a static task allocation method. It uses a directed acyclic graph model to intuitively present the dependencies between subtasks, avoiding conflicts in task execution logic. The multi-objective optimization model integrates key factors such as execution cost and communication cost, simultaneously responding to constraints and optimization objectives, covering the core requirements of task allocation. The introduction of an uncertainty set quantifies cost uncertainty, solving the problem of allocation schemes failing to reach optimal performance due to cost fluctuations in practical applications. The multi-objective robust optimization model ensures that the allocation scheme maintains good performance even when costs deviate from expectations, reducing the impact of extreme cases on the system. The two-layer multi-objective optimization algorithm specifically solves the multi-objective robust optimization model, quickly obtaining the Pareto front, and selecting the optimal solution from the Pareto front, ensuring both optimality and providing flexible selection space for different priority requirements. Therefore, the aforementioned task allocation method improves robustness, reduces inter-core communication consumption, and facilitates load balancing.

[0009] Optionally, the multi-objective optimization model is: ; , , , , , , .

[0010] in, m This indicates the total number of cores in a multi-core processor. Indicates the first i The execution cost of each sub-task Indicates the first i The sub-tasks were assigned to the first k The core decision variables Indicates the first i Sub-tasks and the first j Communication costs between subtasks Indicates the first j The sub-tasks were assigned to the first k The core decision variables X This represents the decision variable matrix consisting of all decision variables.N Represents natural numbers.

[0011] To ensure the real-time execution of system tasks, it is necessary to fully utilize multi-core resources and consider load balancing when the system executes on multi-core processors. Therefore, the variance of the execution cost of each core is considered. This is used to characterize the degree of load balancing; on the other hand, the overall scheduling length of the system needs to be considered. Minimizing inter-core communication costs can prevent excessive inter-core communication costs from causing excessively long scheduling lengths and affecting real-time performance. Therefore, the system's inter-core communication cost is used. This is used to characterize the system scheduling length.

[0012] There is an inherent conflict between the two objectives of load balancing and minimizing the communication cost between system cores. In an extreme case, all subtasks are assigned to a single core, in which case the communication cost between system cores is minimized to 0, but the load balancing is the worst. As some subtasks are assigned to other cores, the load balancing is alleviated, but the communication cost between system cores gradually increases. Furthermore, considering that the execution cost of subtasks and the communication cost between subtasks obtained by the estimation method have different dimensions, and in order to consider the optimization and balance between the two, a multi-objective optimization method is adopted to establish the above multi-objective optimization model.

[0013] Optionally, S2 above specifically includes the following steps: S21. Introduce a matrix consisting of uncertain parameters representing the execution costs of all subtasks. and a matrix consisting of uncertain parameters of communication costs between all subtasks. .

[0014] S22, Using an execution cost uncertainty set The range of values ​​for the uncertain parameters of the execution cost of each subtask is limited, and the uncertainty set of communication cost is adopted. The range of values ​​for the uncertain parameter representing the communication cost between subtasks is limited. , , Indicates the first i Uncertain parameters regarding the execution cost of each subtask. Indicates the first i Sub-tasks and the first j Uncertain parameters regarding the communication cost between subtasks. This represents the preset first robustness factor. This represents the preset second robustness factor.

[0015] S23. Use formula: Determine the first iUncertain execution costs of individual sub-tasks Using the formula: Determine the first i Sub-tasks and the first j Indeterminate communication costs between subtasks .in, Indicates the first i The observed values ​​of the execution cost of each subtask. Indicates the first i The maximum deviation in the execution cost of each sub-task Indicates the first i Sub-tasks and the first j Observations on the communication cost between subtasks Indicates the first i Sub-tasks and the first j The maximum deviation in communication cost between subtasks.

[0016] S24, will , as well as , , , Substituting into the multi-objective optimization model, we obtain a multi-objective robust optimization model that considers cost uncertainty: ; , , , , , , , , , .

[0017] To account for uncertainties during subtask execution and inter-subtask communication, the following is introduced: and Due to the multi-objective optimization model Parameters excluding communication cost-related parameters Since the model lacks parameters related to execution costs, and the relationship between the two costs is complex, it is difficult to directly consider and quantify their impact on the two objectives. To simplify the model, the intrinsic relationship between execution costs and communication costs is ignored. It is assumed that the uncertainty of the execution cost of a subtask only affects the variance of the execution cost of each core, and the uncertainty of the communication cost between subtasks only affects the communication cost between system cores. The uncertainties of the two are independent of each other, and the above-mentioned multi-objective robust optimization model that considers cost uncertainty can be obtained.

[0018] Optionally, the above-mentioned two-layer multi-objective optimization algorithm is divided into inner and outer layers; the inner optimization algorithm receives the allocation scheme from the outer optimization algorithm, finds the worst-case scenario that maximizes each optimization objective, and obtains the uncertain parameters under the worst-case scenario; the outer optimization algorithm calculates the objective function value of each allocation scheme (i.e., ...) based on the uncertain parameters obtained by the inner optimization algorithm. , (value), find a non-dominated allocation scheme that optimizes the objective function value, and iterate the inner and outer optimizations alternately to obtain the Pareto front.

[0019] The inner-layer optimization algorithm focuses on worst-case analysis. For a given allocation scheme from the outer-layer optimization, it actively searches for the uncertain parameter combination (i.e., the worst-case scenario) that minimizes all optimization objectives (such as execution cost and communication cost). It directly transforms uncertainty into quantifiable boundary conditions, avoiding the vulnerability of the scheme caused by the averaging of uncertainty in traditional optimization (i.e., the scheme fails in extreme cases). Furthermore, it ensures that the finally selected scheme maintains acceptable performance even in the worst-case scenario, fundamentally supporting the core objective of the multi-objective robust optimization model. The outer-layer optimization, based on the worst-case scenario parameters returned by the inner-layer optimization, calculates the actual objective function value of each allocation scheme in that scenario, and then selects the non-dominated allocation scheme (i.e., the Pareto optimal solution). This step integrates robustness constraints into the evaluation system of multi-objective optimization, ensuring that the final Pareto front is not only the optimal solution in the ideal case but also the equilibrium solution in the worst-case case. This solves the problems of traditional multi-objective optimization ignoring uncertainty and having poor practical applicability of solutions. The iterative processes of inner and outer optimization form a closed loop. This mechanism avoids the limitations of one-time modeling and solving, and continuously approximates the optimal solution set that maintains multi-objective balance even in the worst-case scenario through dynamic feedback. The Pareto front obtained in the final iteration covers the choice space of different objective priorities and ensures that each choice has the ability to resist uncertainty. In summary, this two-layer multi-objective optimization algorithm makes the solution process both efficient and accurate, with low computational complexity, and the final Pareto front output has both theoretical optimality and engineering practicality.

[0020] Optionally, the outer optimization algorithm described above employs a multi-objective particle swarm optimization algorithm, and performs an optimal particle variable neighborhood search after updating the particle's velocity and position. In the multi-objective particle swarm optimization algorithm, the particle represents the allocation scheme, and the population represents a set of allocation schemes composed of multiple allocation schemes.

[0021] The optimal particle variable neighborhood search has four neighborhood structures. The first structure involves randomly selecting a task and randomly changing its assigned core position. The second structure involves randomly selecting a task, finding its predecessor task, and changing the core position of one of the predecessor tasks to match that task. The third structure involves randomly selecting a task, finding its successor task, and changing the core position of one of the successor tasks to match that task. The fourth structure involves randomly selecting a task, and if the execution cost of the core containing that task is greater than the average execution cost of all cores, then randomly assigning the task to a core with an execution cost less than the average cost of all cores.

[0022] The first neighborhood structure allows particles to randomly search in the neighborhood of the optimal solution. The second and third neighborhood structures guide particles to find positions in the neighborhood that reduce the cost of inter-core communication. The fourth neighborhood structure guides particles to search in the neighborhood for positions with better load balancing performance.

[0023] The outer optimization algorithm is a multi-objective particle swarm optimization algorithm, considering the predecessor-successor coupling relationship between subtasks. After updating the particle's velocity and position, it performs an optimal particle variable neighborhood search. This search guides particles out of local optima, improving global search capability. The four neighborhood structures mentioned above consider the characteristics of multi-core task allocation problems, the predecessor-successor coupling relationship between subtasks, and the load balancing direction, guiding particles out of local optima and towards the optimal direction.

[0024] Optionally, in the above inner optimization algorithm, for the objective function... A genetic algorithm is used to solve the problem, encoding the uncertain parameter values ​​of each task into chromosomes, and then calculating the fitness function. To evaluate the fitness value of this chromosome, a random selection method using roulette wheel is employed. The two chromosomes with the higher fitness values ​​are used as parents. Offspring are generated through a two-point crossover operator, and finally updated using a single-point mutation operator. Among them, in this inner layer optimization algorithm X Confirmed.

[0025] For the objective function Due to its nonlinear properties and the mixed integer constraint nature of uncertain parameters, a genetic algorithm is used here to solve for the uncertain parameters in the worst case, which has better global search capabilities.

[0026] Optionally, in the inner optimization algorithm, for the objective function... A heuristic sorting algorithm is used to solve the problem; when X When it has been determined, To determine the value, solve It can be transformed into a solution Specifically, the matrix is ​​arranged in descending order. The elements in the sequence are denoted as the sequence. ; where the matrix Depend on n The maximum deviation in communication costs between subtasks constitutes the composition; when When the maximum value is obtained, the solution sequence is obtained. forward The corresponding elements , No. The corresponding elements The remaining elements corresponding to ;in, express The value rounded down.

[0027] For the objective function A heuristic sorting algorithm is used to solve the problem, which efficiently and accurately solves the uncertain parameters when the objective function reaches its maximum value in the worst-case scenario, significantly improving computational efficiency and ultimately providing a reliable robustness evaluation basis for multi-core processor task allocation schemes.

[0028] Optionally, the task allocation scheme of the aforementioned multi-core processor is the allocation scheme closest to the origin of the coordinate axis in the Pareto front. Its fast locking of the task allocation scheme, which combines multi-objective optimality with balanced overall performance, avoids extreme design, is easier to run stably in real hardware environments, and improves the engineering feasibility of the technical solution.

[0029] Secondly, this application provides a task allocation device for a multi-core processor, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the task allocation method for the multi-core processor described above.

[0030] Thirdly, this application provides a vehicle that includes the aforementioned task allocation device for a multi-core processor. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application will be described below.

[0032] Figure 1 This is a schematic diagram of the vehicle in an embodiment of this application; Figure 2 This is a schematic diagram of the task allocation device for a multi-core processor in an embodiment of this application; Figure 3 This is a flowchart of the task allocation method for a multi-core processor disclosed in an embodiment of this application; Figure 4The flowchart for establishing a multi-objective robust optimization model that takes into account cost uncertainty is disclosed in the embodiments of this application; Figure 5 This is a directed acyclic graph model of a task in an autonomous driving system. Figure 6 This is a flowchart of the two-layer multi-objective optimization algorithm disclosed in an embodiment of this application. Detailed Implementation

[0033] The embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The detailed description of the following embodiments and the accompanying drawings are used to illustrate the principles of this application by way of example, but should not be used to limit the scope of this application, that is, this application is not limited to the described embodiments.

[0034] like Figure 1 As shown, the vehicle in this embodiment includes a task allocation device for a multi-core processor. The vehicle can be, but is not limited to, a pure electric vehicle (PEV / BEV), a hybrid electric vehicle (HEV), a range-extended electric vehicle (REEV), a plug-in hybrid electric vehicle (PHEV), or a new energy vehicle.

[0035] like Figure 2 As shown, the task allocation device for a multi-core processor in this embodiment includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the task allocation method for a multi-core processor in this embodiment.

[0036] like Figure 3 As shown in the embodiments of this application, the task allocation method for a multi-core processor includes the following steps: S1. Divide system tasks into n Each subtask is used as a node to construct a directed acyclic graph model. Based on the execution cost of the subtasks, the communication cost between the subtasks, the constraints, and the optimization objectives, a multi-objective optimization model is established.

[0037] In one embodiment, the specific process of establishing a multi-objective optimization model is as follows: The tasks of an autonomous driving system can be divided into, for example: Figure 5 The diagram shows a directed acyclic graph (DAG) model where nodes represent subtasks and directed edges represent communication relationships between subtasks. This model uses quadruples. To represent. Among them... This represents the set of all subtasks in the system. Represents the first in the task set i Sub-tasks; Represents a set of directed edges. Indicates the first i Sub-tasks and the first j Data transmission exists between the subtasks; This represents the set of execution costs for each subtask. For the first i The execution cost of each sub-task; This represents the set consisting of communication costs between subtasks, with elements... Indicates the first i Sub-tasks and the first j Communication costs between subtasks.

[0038] Divide system tasks into n This is a sub-task, to... n The number of subtasks assigned to the core is: m On homogeneous processors (m≥2), the execution costs of each subtask can form a task execution cost matrix. : The communication costs between each subtask can be formed into an inter-task communication cost matrix. : Introducing decision variables , indicating the first i The sub-tasks were assigned to the first k The core decision variables (i.e., the first) i Are the subtasks deployed to the first...? k (At the core). All sub-tasks are assigned, and all decision variables are combined into a decision variable matrix. This refers to the allocation scheme that needs to be optimized.

[0039] The relevant constraints (1) and (2) of the allocation scheme for homogeneous multi-core processors are as follows: (1) 0-1 value constraints for task allocation schemes, The value is 1 (i.e.) ) indicates the first i The sub-tasks were assigned to the first k On the core, The value is 0 (i.e.) ) indicates the first i The sub-task was not assigned to the first kOn the core. The first constraint is: , N Represents natural numbers; that is , , .

[0040] (2) Each subtask must be assigned, and each subtask is assigned only once, i.e. .

[0041] The optimization objectives of the system allocation problem specifically include the following two parts: To ensure the real-time execution of system tasks, it is necessary to make full use of multi-core resources and consider load balancing when the system executes on multi-core processors. Here, the variance of the execution cost of each core is used. To characterize the degree of load balancing; Variance of execution cost per core: In the formula, Indicates processor core k The total cost of task execution can be derived from the task execution cost matrix. With core k The allocation scheme Multiply to obtain, , This represents the average task execution cost across all cores of a multi-core processor. .

[0042] In summary, the specific formula for calculating the variance of execution cost for each core can be obtained as follows: .

[0043] On the other hand, the overall scheduling length of the system needs to be considered. Minimizing inter-core communication costs can prevent excessively high inter-core communication costs from causing excessively long scheduling execution times and impacting real-time performance. Here, we use the system's inter-core communication cost. To characterize the system scheduling length. Inter-core communication cost. The sum of communication costs between all subtasks under the current allocation scheme is calculated using the following formula: In the formula, The first i Sub-tasks and the first j The allocation relationship of sub-tasks, if the first... i Sub-tasks and the first j Each subtask is on the same core. Then the communication cost is 0, that is, the intra-kernel communication cost between subtasks is ignored. If the first... i Sub-tasks and the first j If the subtasks are not on the same core, then This means that the communication cost between subtasks allocated on different cores needs to be considered (i.e., the inter-core communication cost of subtasks).

[0044] There is an inherent conflict between the two objectives of load balancing and minimizing inter-core communication costs. In an extreme case, all subtasks are assigned to a single core, resulting in a minimum inter-core communication cost of 0, but also the worst load balancing. As some subtasks are assigned to other cores, the load balancing is alleviated, but the inter-core communication cost gradually increases. Furthermore, considering that the execution cost of subtasks and the communication cost between subtasks obtained by the estimation method have different dimensions, and in order to consider the optimization and balance of these two factors, a multi-objective optimization method is adopted, and the objective function is determined as follows: .

[0045] Therefore, the multi-objective optimization model established in this application embodiment is as follows: ; , , , , , , ; in, Indicates the first j The sub-tasks were assigned to the first k The core decision variables Indicates the first j The sub-tasks were assigned to the first k On the core, Indicates the first j The sub-task was not assigned to the first k On the core, Different values ​​result in different allocation schemes.

[0046] S2. Based on the multi-objective optimization model, an uncertainty set is introduced to represent the uncertainty of cost, and a multi-objective robust optimization model considering cost uncertainty is established.

[0047] In one possible implementation, such as Figure 4 As shown, methods for establishing a multi-objective robust optimization model that considers cost uncertainty include: S21. Introduce a matrix consisting of uncertain parameters representing the execution costs of all subtasks. and a matrix consisting of uncertain parameters of communication costs between all subtasks. .

[0048] S22, Using an execution cost uncertainty set The range of values ​​for the uncertain parameters of the execution cost of each subtask is limited, and the uncertainty set of communication cost is adopted. The range of values ​​for the uncertain parameter representing the communication cost between subtasks is limited. , , Indicates the first i Uncertain parameters regarding the execution cost of each subtask. Indicates the first i Sub-tasks and the first j Uncertain parameters regarding the communication cost between subtasks. This represents the preset first robustness factor. This represents the preset second robustness factor. Decision-makers can adjust the number of uncertain parameters and modify the parameter list according to the level of risk to be considered. , This allows for adjustment of the model's conservatism. , The value can be an integer or a real number, denoted as Round down to , Round down to Then, regarding the execution cost, there are at most If one uncertain parameter changes, the communication cost will have at most [number missing]. One uncertain parameter changes, and another parameter changes by a certain amount. and , This is half the length of the range of variation of the uncertain parameter.

[0049] S23. Use formula: Determine the first i Uncertain execution costs of individual sub-tasks Using the formula: Determine the first i Sub-tasks and the first j Indeterminate communication costs between subtasks .in, Indicates the first i The observed values ​​of the execution cost of each subtask. Indicates the first i The maximum deviation in the execution cost of each sub-task Indicates the first i Sub-tasks and the first j Observations on the communication cost between subtasks Indicates the first i Sub-tasks and the first j The maximum deviation in communication cost between subtasks.

[0050] S24, will , as well as , , , Substituting into the multi-objective optimization model, we obtain a multi-objective robust optimization model that considers cost uncertainty: ; , , , , , , , , , .

[0051] In the formula, Indicates to Take the maximum value. Indicates to Take the maximum value.

[0052] Due to the multi-objective optimization model Parameters excluding communication cost-related parameters Since the model lacks parameters related to execution costs, and the relationship between the two costs is complex, it is difficult to directly consider and quantify their impact on the two objectives. To simplify the model, the intrinsic relationship between execution costs and communication costs is ignored. It is assumed that the uncertainty of the execution cost of a subtask only affects the variance of the execution cost of each core, and the uncertainty of the communication cost between subtasks only affects the communication cost between system cores. The uncertainties of the two are independent of each other, and the above-mentioned multi-objective robust optimization model that considers cost uncertainty can be obtained.

[0053] S3. Use a two-level multi-objective optimization algorithm to solve the multi-objective robust optimization model (considering cost uncertainty), obtain the Pareto front, and select the optimal allocation scheme from the Pareto front as the task allocation scheme for the multi-core processor.

[0054] In one possible embodiment, the two-layer multi-objective optimization algorithm consists of two layers: an inner layer and an outer layer. The inner layer receives the allocation scheme from the outer layer and searches for the worst-case scenario that maximizes each optimization objective, obtaining the uncertain parameters under the worst-case condition. The outer layer calculates the objective function value (i.e., ...) of each allocation scheme based on the uncertain parameters obtained from the inner layer. , The value of is also the fitness value of the particle. We search for a non-dominated allocation scheme that optimizes the objective function value. We iterate between inner-layer optimization and outer-layer optimization to obtain the Pareto front.

[0055] In one possible embodiment, the outer optimization algorithm employs a multi-objective particle swarm optimization algorithm, and performs an optimal particle variable neighborhood search after updating the particle's velocity and position. Here, in the multi-objective particle swarm optimization algorithm, the particle represents an allocation scheme, and the population represents a set of allocation schemes composed of multiple allocation schemes. The optimal particle variable neighborhood search guides particles to escape local optima and search towards the optimal direction.

[0056] The optimal particle variable neighborhood search algorithm has four neighborhood structures. The first structure randomly selects a task and randomly changes its assigned core position. The second structure randomly selects a task, finds its predecessor task, and changes the core position of one of the predecessor tasks to match that task. The third structure randomly selects a task, finds its successor task, and changes the core position of one of the successor tasks to match that task. The fourth structure randomly selects a task, and if the execution cost of the core containing that task is greater than the average execution cost of all cores, then randomly assigns the task to a core with an execution cost less than the average cost of all cores. The first structure allows the particle to randomly search within the neighborhood of the optimal solution. The second and third structures guide the particle to find positions within the neighborhood that result in lower inter-core communication costs. The fourth structure guides the particle to search within the neighborhood for positions with better load balancing performance.

[0057] The optimal particle variable neighborhood search algorithm combines the relationship between tasks and performs neighborhood changes towards two optimization objectives. It has lower inter-core communication costs and better load balancing performance, which can speed up the search for the panoramic optimal solution. At the same time, random search also makes it easier to escape local optima.

[0058] In one possible implementation, the inner optimization algorithm uses two different methods to solve the problem based on the characteristics of the two objective functions.

[0059] For the objective function Due to its nonlinear nature and the mixed-integer constraint of its uncertain parameters, a genetic algorithm is used to solve for the uncertain parameters under the worst-case scenario. The uncertain parameter values ​​for each task are encoded as chromosomes, and the fitness function is calculated. To evaluate the fitness value of this chromosome, a random selection method using roulette wheel is employed. The two chromosomes with the higher fitness values ​​are used as parents. Offspring are generated through a two-point crossover operator, and finally updated using a single-point mutation operator. Among them, in this inner layer optimization algorithm X Confirmed.

[0060] For the objective function A heuristic sorting algorithm is used to solve this problem. When X When it has been determined, To determine the value, solve It can be transformed into a solution Specifically: Arrange the matrix in descending order. The elements in the sequence are denoted as the sequence. ; where the matrix Depend on n The maximum deviation in communication cost between each subtask constitutes the total cost.

[0061] when When the maximum value is obtained, the solution sequence is obtained. forward The corresponding elements , No. The corresponding elements The remaining elements corresponding to ;in, express The value rounded down.

[0062] for , The value of is [-1, 1], which relates to communication costs. , equivalent to It is the mean. It represents the maximum deviation. If the sum of these deviations is the maximum, then the largest possible deviation is the one that is increasing. For example, there are... R 1. R 2. R 3. R 4. R 5. Five communication tasks, each with a communication cost of approximately [missing information]. , , , , , Approximately how many tasks deviated from the target? ,but Even if ( The largest, that is , (i.e. sequence forward The corresponding elements ), (i.e., the first) Each element corresponds to =2.5-2=0.5), remaining elements , (i.e., the 4th and 5th elements) ).

[0063] In one possible embodiment, a two-layer multi-objective optimization algorithm (see...) Figure 6 ), including the following steps: S31. Initialize the position and velocity of all particles in the swarm. , Initialize the external archive, and then execute S32.

[0064] S32, based on , In addition to the particle's position and velocity, calculate the particle's fitness value, and then execute S33.

[0065] S33. Determine the optimal position of each particle, update the external archive, and then execute S34.

[0066] S34. Determine the global optimal position of the particle, and then execute S35.

[0067] S35. Determine whether the iteration termination condition is met (e.g., whether the preset number of iterations has been reached). If yes, execute S39; otherwise, execute S36.

[0068] S36, Update the particle's velocity and position, then execute S37.

[0069] S37. Perform the optimal particle variable neighborhood search, and then perform S38.

[0070] S38. Solve using a genetic algorithm. A heuristic sorting algorithm is used to solve the problem. Then return to execute S32.

[0071] S39. Output the particles (i.e., the allocation scheme) in the external archive, and then end.

[0072] In the exemplary embodiment, when using the above-described two-layer multi-objective optimization algorithm to solve the multi-objective robust optimization model (considering cost uncertainty) to obtain the allocation scheme, it is necessary to set information such as the size of the allocation scheme set, the maximum number of iterations, and the number of allocation schemes in the non-dominated solution set before starting the iterative solution. Parameter settings (presets) include outer-layer optimization-related parameters: allocation scheme set size, number of iterations, inertia weight coefficient, individual learning factor, allocation scheme set learning factor, and variable neighborhood search iterations; inner-layer optimization-related parameters: Size 100, number of iterations 50, crossover probability 0.9, mutation rate 0.1. Simultaneously, considering the robustness of the solution, a first robustness factor is set. Second robustness factor After the iteration, the non-dominated schemes form the Pareto front, and the allocation scheme closest to the origin of the coordinate axis is selected as the task allocation scheme for the multi-core processor (i.e., the final allocation scheme).

[0073] The above embodiments address the uncertainty in the execution cost of subtasks and the communication cost between subtasks by introducing an uncertainty set to represent the range of cost variation (uncertainty), thereby improving the system's robustness in maintaining load balance and low communication overhead under uncertain environments.

[0074] To solve a multi-objective robust optimization model considering cost uncertainty, a two-layer multi-objective optimization algorithm is proposed. The outer layer employs a multi-objective particle swarm optimization algorithm and performs optimal particle variable neighborhood search based on the coupling relationship between system tasks. The inner layer uses a genetic algorithm and a heuristic sorting algorithm to solve for the uncertain parameters under the worst-case scenario. The two objective functions are solved iteratively in the inner and outer layers, reducing computational complexity. The embodiments of this application are particularly suitable for scenarios with high requirements for real-time performance and robustness in task scheduling, such as autonomous driving systems, industrial real-time control systems, and embedded multi-core platforms.

[0075] Finally, it should be noted that the application of this application is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims. Those skilled in the art can understand that implementing all or part of the processes of the above embodiments and making equivalent changes according to the claims of this application still fall within the scope of this application.

Claims

1. A task allocation method for a multi-core processor, characterized in that, include: S1. Divide system tasks into n Each subtask is used as a node to construct a directed acyclic graph model. Based on the execution cost of the subtasks, the communication cost between the subtasks, the constraints, and the optimization objectives, a multi-objective optimization model is established. S2. Based on the multi-objective optimization model, an uncertainty set is introduced to represent the uncertainty of cost, and a multi-objective robust optimization model considering cost uncertainty is established. S3. A two-layer multi-objective optimization algorithm is used to solve the multi-objective robust optimization model, obtain the Pareto front, and select the optimal allocation scheme from the Pareto front as the task allocation scheme for the multi-core processor.

2. The task allocation method for a multi-core processor according to claim 1, characterized in that, The multi-objective optimization model is as follows: ; , , , , , , ; in, m This indicates the total number of cores in a multi-core processor. Indicates the first i The execution cost of each sub-task Indicates the first i The sub-tasks were assigned to the first k The core decision variables Indicates the first i Sub-tasks and the first j Communication costs between subtasks Indicates the first j The sub-tasks were assigned to the first k The core decision variables X This represents the decision variable matrix consisting of all decision variables. N Represents natural numbers.

3. The task allocation method for a multi-core processor according to claim 2, characterized in that, S2 specifically includes: S21. Introduce a matrix consisting of uncertain parameters representing the execution costs of all subtasks. and a matrix consisting of uncertain parameters of communication costs between all subtasks. ; S22, Using an execution cost uncertainty set The range of values ​​for the uncertain parameters of the execution cost of each subtask is limited, and the uncertainty set of communication cost is adopted. The range of values ​​for the uncertain parameter of communication cost between subtasks is limited; where, , , Indicates the first i Uncertain parameters regarding the execution cost of each subtask. Indicates the first i Sub-tasks and the first j Uncertain parameters regarding the communication cost between subtasks. This represents the preset first robustness factor. This represents the preset second robustness factor; S23. Use formula: Determine the first i Uncertain execution costs of individual sub-tasks Using the formula: Determine the first i Sub-tasks and the first j Indeterminate communication costs between subtasks ;in, Indicates the first i The observed values ​​of the execution cost of each subtask. Indicates the first i The maximum deviation in the execution cost of each sub-task Indicates the first i Sub-tasks and the first j Observations on the communication cost between subtasks Indicates the first i Sub-tasks and the first j The maximum deviation in communication cost between sub-tasks; S24, will , as well as , , , Substituting into the multi-objective optimization model, we obtain a multi-objective robust optimization model that considers cost uncertainty: ; , , , , , , , , , 。 4. The task allocation method for a multi-core processor according to claim 3, characterized in that: The two-layer multi-objective optimization algorithm consists of two layers: an inner layer and an outer layer. The inner layer optimization algorithm receives the allocation scheme from the outer layer optimization algorithm, finds the worst-case scenario that maximizes each optimization objective, and obtains the uncertain parameters under the worst-case scenario. The outer layer optimization algorithm calculates the objective function value of each allocation scheme based on the uncertain parameters obtained by the inner layer optimization algorithm, and finds the non-dominated allocation scheme that optimizes the objective function value. The inner layer optimization and the outer layer optimization alternate and iterate to obtain the Pareto front.

5. The task allocation method for a multi-core processor according to claim 4, characterized in that: The outer optimization algorithm employs a multi-objective particle swarm optimization algorithm and performs an optimal particle variable neighborhood search after updating the particle's velocity and position; wherein, in the multi-objective particle swarm optimization algorithm, the particle represents the allocation scheme, and the population represents the allocation scheme set composed of multiple allocation schemes; The optimal particle variable neighborhood search has four neighborhood structures; The first neighborhood structure is: randomly select a task and randomly change the core location it is assigned to; The second neighborhood structure is: randomly select a task, find the predecessor task of the task, and change the core position of a predecessor task to be consistent with the task. The third neighborhood structure is: randomly select a task, find the successor task of the task, and change the core position of a successor task to be consistent with the task. The fourth neighborhood structure is: randomly select a task, and if the execution cost of the core where the task is located is greater than the average execution cost of all cores, then randomly assign the task to a core where the execution cost is less than the average cost of all cores. The first neighborhood structure allows particles to randomly search in the neighborhood of the optimal solution. The second and third neighborhood structures guide particles to find positions in the neighborhood that reduce the cost of inter-core communication. The fourth neighborhood structure guides particles to search in the neighborhood for positions with better load balancing performance.

6. The task allocation method for a multi-core processor according to claim 4, characterized in that, In the inner optimization algorithm, for the objective function A genetic algorithm is used to solve the problem, encoding the uncertain parameter values ​​of each task into chromosomes, and then calculating the fitness function. To evaluate the fitness value of this chromosome, a random selection method using roulette wheel is employed. The two chromosomes with the higher fitness values ​​are used as parents. Offspring are generated through a two-point crossover operator, and finally updated using a single-point mutation operator. Among them, in this inner layer optimization algorithm X Confirmed.

7. The task allocation method for a multi-core processor according to claim 4, characterized in that, In the inner optimization algorithm, for the objective function A heuristic sorting algorithm is used to solve the problem; when X When it has been determined, To determine the value, solve It can be transformed into a solution Specifically: Arrange the matrix in descending order. The elements in the sequence are denoted as the sequence. ; where the matrix Depend on n The maximum deviation in communication costs between individual subtasks constitutes the composition of the total cost of communication between them. when When the maximum value is obtained, the solution sequence is obtained. forward The corresponding elements , No. The corresponding elements The remaining elements corresponding to ;in, express The value rounded down.

8. The task allocation method for a multi-core processor according to any one of claims 1 to 7, characterized in that: The task allocation scheme of the multi-core processor is the allocation scheme that is closest to the origin of the coordinate axis in the Pareto front.

9. A task allocation device for a multi-core processor, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the task allocation method for a multi-core processor as described in any one of claims 1 to 8.

10. A vehicle, characterized in that: Includes the task allocation device for a multi-core processor as described in claim 9.