Multi-task processing method, system and equipment
By dynamically adjusting task priority and resource allocation in computer-assisted driving systems, and optimizing resource allocation strategies based on task dependencies and predictive execution time, the problem of insufficient frame rate and stability in the existing technology is solved, and higher performance and stability are achieved.
Patent Information
- Application Number
- CN202411911526.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-03-28
AI Technical Summary
Existing computer-assisted driving software has limitations in optimizing operating frame rates and stability, and it is difficult to meet the requirements of complex autonomous driving systems for high performance and high stability.
By incorporating the dependencies, priority and execution time of the task into the dynamic resource allocation and scheduling strategy design, the topological order of task execution is generated, the task execution time is predicted, priority and resource allocation is dynamically adjusted, and binding strategies for tasks and threads, threads and CPUs are optimized.
It improves the software running frame rate, reduces the waiting time between tasks, adapts to changes in different tasks loads, and improves overall performance and stability.
Smart Images

Figure CN119718585A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a multi-task processing method, system and equipment, and belongs to the technical field of computer-assisted driving. Background Art
[0002] In computer-assisted driving systems, the frame rate and latency of software operation are key factors affecting system performance, stability and user experience. Current advanced autonomous driving software generally uses event or message-driven methods with a small number of periodic scheduling threads to drive hundreds or even thousands of modules for calculations, which are usually used to process different algorithms. Due to the use of a free and fair scheduling strategy, some time-consuming threads will be interrupted repeatedly, resulting in large fluctuations in frame rate and latency. In addition, in a multi-core processor environment, the existing scheduling strategy cannot effectively balance the load of the CPU core, resulting in some cores being overloaded, while other core resources are not fully utilized, thus affecting the improvement of system response speed.
[0003] In the prior art, there are priority-based scheduling algorithms and static resource allocation strategies. Priority-based scheduling algorithms reduce latency by increasing the priority of critical tasks, but priority scheduling does not take into account the dependencies between tasks, which may cause high-priority tasks to switch frequently during execution, increasing system overhead. Static resource allocation strategies pre-allocate resources during the system design phase and determine the CPU core used by each thread to reduce thread switching and scheduling overhead, but due to the lack of dynamic adjustment capabilities, it is difficult to cope with the changing task requirements and load conditions in complex autonomous driving task scenarios.
[0004] Therefore, existing solutions have many limitations in optimizing the operating frame rate of computer-assisted driving software, and it is difficult to meet the requirements of complex computer-assisted driving systems for high performance and high stability. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention provides a multi-tasking processing method, system and device, which incorporate task dependencies, priorities and task execution times into the dynamic resource allocation and scheduling strategy design, which can not only improve the software running frame rate and reduce the waiting time between tasks, but also adapt to changes in different task loads and improve overall performance and stability.
[0006] According to a first aspect of the present invention, there is provided a multi-task processing method, comprising:
[0007] Generate the topological order of task execution based on task dependencies;
[0008] Obtaining a predicted execution time of each task based on historical execution data, wherein the historical execution data includes task execution time, task-related input, and system load;
[0009] According to the task dependency, task type and the predicted execution time, assign a priority to each task and determine the task execution order;
[0010] Based on the task dependency, the priority and the predicted execution time, a resource allocation and scheduling strategy is generated, wherein the resource allocation and scheduling strategy includes a binding strategy between tasks and threads, and between threads and CPUs.
[0011] According to one embodiment, the multi-tasking method further includes:
[0012] According to the task execution time, task-related input and system load collected in real time, the priority and resource allocation of the task are adjusted, and the resource allocation and scheduling strategy is updated.
[0013] According to one embodiment, generating a topological order of task execution according to task dependencies includes:
[0014] Creating a node for each task according to a task description file, adding directed edges according to a relationship description file, and generating a directed acyclic graph, wherein the task description file includes messages transmitted between tasks and their types, and the relationship description file includes the relationship between messages sent and received by the tasks;
[0015] A graph traversal algorithm is used to detect whether there is a loop in the directed acyclic graph. If so, an exception is thrown and error information is recorded; otherwise, the topological order is generated.
[0016] According to one embodiment, obtaining the predicted execution time of each task based on the historical execution data includes:
[0017] Get historical execution time, task-related input, and system load at the time of task execution;
[0018] Call a statistical method to calculate the average execution time, standard deviation and fluctuation of the execution time to obtain the predicted execution time; for tasks whose execution time fluctuation exceeds a preset threshold, call a machine learning prediction model to obtain the predicted execution time.
[0019] According to one embodiment, the calling of the machine learning prediction model to obtain the predicted execution time includes:
[0020] Collect relevant data that affects task execution time, including CPU load, memory usage, and task-related input;
[0021] Selecting features related to task execution time from the relevant data;
[0022] Using decision tree modeling to obtain the predicted execution time;
[0023] The influence of the features on the prediction results is analyzed to determine one or more features that have the greatest influence on the task execution time fluctuation.
[0024] According to one embodiment, assigning a priority to each task according to the task dependency, the task type, and the predicted execution time includes:
[0025] Based on the topological order of task execution, the initial priority is determined according to task dependencies;
[0026] On the premise of satisfying the dependency relationship, the initial priority is adjusted according to the task type and the predicted execution time to generate the priority.
[0027] According to one embodiment, generating a resource allocation and scheduling strategy based on the task dependency, the priority, and the predicted execution time includes:
[0028] Obtain the number of CPU cores and the status of each CPU core, wherein the status includes the current load of the CPU;
[0029] Binding a specific task to an independent CPU core, wherein the specific task is a task with a high priority, a long execution time, and a great impact on the execution time of other tasks;
[0030] According to the task dependency and the predicted execution time, tasks that can be executed in parallel are assigned to different CPU cores, and tasks that must be executed sequentially are scheduled to be executed on the same CPU core;
[0031] Assign each of the remaining independent tasks to a CPU core with the lowest load and generate a resource allocation and scheduling strategy.
[0032] According to a second aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the multi-task processing method according to the first aspect of the present invention is executed.
[0033] According to a third aspect of the present invention, there is provided a multitasking processing device, comprising a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to execute the multitasking processing method as described in any one of the first aspects of the present invention.
[0034] According to a fourth aspect of the present invention, a multi-task processing system is provided, comprising: an access layer unit, an analysis layer unit and an infrastructure layer unit; the access layer unit comprises an input module and an output module; the analysis layer unit comprises a task association parsing module, a task analysis module, a resource allocation module and a scheduling optimization module; the infrastructure layer unit comprises a data storage module and a hardware device module;
[0035] The input module is used to input files describing dependencies between tasks and collected measured data;
[0036] The output module is used to output resource allocation and scheduling strategy description files;
[0037] The task association parsing module is used to generate a topological order of task execution according to task dependencies;
[0038] The task analysis module is used to obtain the predicted execution time of each task based on historical execution data, wherein the historical execution data includes task execution time, task-related input, and system load;
[0039] The resource allocation module is used to assign a priority to each task according to the task dependency, the task type and the predicted execution time, determine the task execution order, and then generate a resource allocation and scheduling strategy based on the task dependency, the priority and the predicted execution time, wherein the resource allocation and scheduling strategy includes a binding strategy between tasks and threads, and between threads and CPUs;
[0040] The scheduling optimization module is used to adjust the priority and resource allocation of tasks and update the resource allocation and scheduling strategy according to the task execution time, task related input and system load collected in real time;
[0041] The data storage module is used to store input data, output data and operation data;
[0042] The hardware device module is used to provide a physical basis for system operation.
[0043] The present invention determines the priority level and execution order of tasks based on task dependencies, task types and predicted execution time of tasks, and then incorporates the task dependencies, priorities and execution time of tasks into dynamic resource allocation and scheduling strategy schemes, which can not only improve the software running frame rate and reduce the waiting time between tasks, but also adapt to changes in different task loads and improve overall performance and stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a step flow chart of a multi-task processing method provided by an embodiment of the present invention.
[0045] Figure 2 is a step flow chart of another multi-tasking method provided by an embodiment of the present invention.
[0046] Figure 3 is a step flow chart of another multi-tasking method provided by an embodiment of the present invention.
[0047] Figure 4 It is a schematic diagram of the architecture of a multi-task processing system provided by an embodiment of the present invention.
[0048] Figure 5 A schematic diagram of the structure of a multi-task processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with specific implementation methods.
[0050] Technologies, methods and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the above-mentioned technologies, methods and equipment should be considered as part of the specification.
[0051] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0052] like Figure 1 As shown, a multi-tasking method includes the following steps S100 to S400.
[0053] Step S100: Generate a topological order of task execution according to task dependencies.
[0054] Among them, task dependency refers to the interdependence and constraints between tasks, including sequential dependency, conditional dependency, etc. Sequential dependency means that one task can only be executed after another task is completed, and conditional dependency means that the execution of one task depends on the execution result or status of another task.
[0055] Among them, the topological sorting of task execution is a sorting method for directed acyclic graphs (DAGs), which is used to determine the execution order of a series of tasks. Topological sorting is an important algorithm in graph theory, which is mainly used to process the dependencies between nodes (tasks in this case) in a directed graph. It generates a linear sequence of nodes in the graph, namely the topological order, in which each node (task) appears after all its dependencies (predecessor tasks).
[0056] In some examples, step S100 may include the following steps S110 - S120 .
[0057] Step S110, creating a node for each task according to the task description file, adding directed edges according to the relationship description file, and generating a directed acyclic graph. The task description file includes the messages transmitted between tasks and their types, and the relationship description file includes the relationship between messages sent and received by the tasks.
[0058] The task description file is a file that describes the messages and their types transmitted between tasks. In one implementation, the JSON format is used to define the name, data type, sender, and receiver of each message. The relationship description file is a file that describes the relationship between the messages sent and received by the task. In one implementation, it is also determined whether the task is triggered by a message or a fixed period. If it is a fixed period trigger, the trigger frequency is obtained.
[0059] Step S120, using a graph traversal algorithm to detect whether there is a loop in the directed acyclic graph, if so, an exception is thrown and error information is recorded, otherwise a topological order is generated.
[0060] The graph traversal algorithm can be implemented as a DFS (depth-first search) algorithm or a BFS (breadth-first search) algorithm. If the graph contains a loop, that is, there is a circular dependency, the graph cannot be topologically sorted, because the loop cannot determine a linear order to determine the execution order. Therefore, in the process of topological sorting, it is necessary to check the circular dependency.
[0061] In one implementation, using a graph traversal algorithm to detect loops and generate a topological order may include the following steps:
[0062] Calculate the in-degree of each task and add all tasks with in-degree 0 to the queue;
[0063] Remove the head task from the queue and add it to the topological sequence. Check whether all downstream tasks pointed to by the head task are checked nodes. If not, reduce the in-degree of the downstream task by 1. If the in-degree of a downstream task becomes 0, add the task to the queue.
[0064] Repeat the previous step until the queue is empty and output the topology sequence.
[0065] It is worth mentioning that through step S100, dependency analysis between tasks is implemented, and the order of task execution is ensured through topological sorting and circular dependency detection.
[0066] Step S200, obtaining the predicted execution time of each task based on the historical execution data, the historical execution data including the task execution time, task-related input and system load.
[0067] In some examples, step S200 may include the following steps S210 - S220 .
[0068] Step S210, obtaining historical execution time, task-related input, and system load at the time of task execution.
[0069] Among them, the associated input of the task refers to the initial conditions required for each task or the data output by the previous task. For example, the environmental perception task in autonomous driving may rely on the input data of sensors such as cameras and radars. The amount of data and processing requirements change with the environment. The system load at the time of task execution refers to the system resource usage of the task at the time of execution, such as CPU usage, memory load, etc. The associated input of the task and the system load at the time of task execution will directly affect the execution time of the task. Combining these two factors to predict the task execution time can improve the accuracy of the prediction and ensure that the dynamic changes of the associated input and load of the task are properly responded to.
[0070] Step S220, call the statistical method to calculate the average execution time, standard deviation and fluctuation of the execution time, and obtain the predicted execution time; for tasks whose execution time fluctuation exceeds a preset threshold, call the machine learning prediction model to obtain the predicted execution time.
[0071] In some examples, calling a machine learning prediction model to predict task execution time may include the following steps:
[0072] Collect relevant data that affects task execution time, including CPU load, memory usage, task-related input, average execution time, execution time fluctuation, etc.
[0073] Perform feature selection to select features related to task execution time from relevant data;
[0074] Use decision tree modeling to obtain predicted execution time;
[0075] Perform feature importance analysis to analyze the impact of the above features related to task execution time on the prediction results, and determine one or more features that have the greatest impact on the fluctuation of task execution time.
[0076] In one implementation, SHAP (SHapley Additive exPlanations) is used to perform feature importance analysis, analyze the impact of each feature on the prediction results, and explain how the features cause fluctuations in execution time. SHAP is a method for explaining prediction results. It is based on Shapley value theory and provides global and local interpretability for the model by decomposing the prediction results into the impact of each feature. SHAP can be used for machine learning models, including classification and regression models, and can generate graphical and quantitative explanation results to help users better understand the prediction results of machine learning models, identify model weaknesses, and improve the model to improve the model's predictive ability.
[0077] It is worth mentioning that through step S200, not only can the task execution time be predicted more accurately, but also the fluctuation of the task execution time can be analyzed more comprehensively, and the key factors causing the fluctuation can be identified, which is helpful for the subsequent optimization of resource allocation and task scheduling strategies.
[0078] Step S300, assigning a priority to each task and determining the task execution order according to the task dependency, task type and predicted execution time.
[0079] In some examples, step S300 may include the following steps S310 - S320 .
[0080] Step S310 , based on the topological order of task execution, determine the initial priority according to the task dependency relationship.
[0081] In one implementation, tasks with high out-degree in a directed acyclic graph (DAG) of tasks are given higher priorities. The out-degree indicates how many direct subsequent tasks a task has. The higher the out-degree, the more subsequent tasks depend on the result of the task, and its importance is relatively higher. Therefore, tasks with high out-degree are given higher priorities to ensure that these key nodes can be completed as soon as possible and reduce the waiting time of subsequent tasks.
[0082] Step S320, under the premise of satisfying the dependency relationship, the initial priority is adjusted according to the task type and the predicted execution time to generate a priority.
[0083] In one implementation, on the premise that dependencies are met, tasks that directly affect system safety, such as collision detection tasks and sensor fault detection tasks, are given the highest priority.
[0084] In one implementation, real-time tasks that must be completed within a strict time limit, provided that dependencies are met, or else will have a serious impact on the system, such as emergency braking tasks and obstacle avoidance tasks, are given a higher priority to ensure timeliness.
[0085] In one implementation, on the premise that the dependency relationship is satisfied, for tasks that take a long time to execute but are of average importance, their priorities are appropriately lowered to avoid blocking high-priority tasks.
[0086] It is worth mentioning that step S300 incorporates the task dependency, task type and predicted execution time of the task into the determination of priority. Priority setting and adjustment under the premise of satisfying the dependency can effectively avoid the problem of frequent switching of high-priority tasks during execution, ensuring that important and urgent tasks are processed in a timely manner.
[0087] Step S400, generating a resource allocation and scheduling strategy based on task dependencies, priorities, and predicted execution time of tasks, wherein the resource allocation and scheduling strategy includes a binding strategy between tasks and threads, and between threads and CPUs.
[0088] In some examples, step S400 may include the following steps S410 - S440 .
[0089] Step S410, obtaining the number of CPU cores and the status of each CPU core, where the status of the CPU core includes the current load of the CPU, the availability of the CPU, etc.
[0090] Step S420, binding a specific task to an independent CPU core, wherein the specific task is a task with a high priority, a long execution time, and a great impact on the execution time of other tasks.
[0091] Among them, tasks that need to be bound to independent cores are selected from the task queue, and only tasks that meet high priority, long execution time and have a great impact on the execution time of other tasks are bound to independent CPU cores. The purpose of this strategy is to ensure the real-time and stability of key task execution, avoid interference due to resource competition, and reduce their blocking of other tasks. Exemplarily, the path planning task can be bound to an independent CPU core. The path planning task plans the best driving route for the vehicle according to the current road conditions, traffic rules and target location. The output of the path planning task will directly affect the vehicle's control tasks, such as steering, acceleration or deceleration. If the path planning task is delayed, the control task will be seriously affected, which may cause the vehicle to be unable to respond to complex road conditions in real time. Therefore, the path planning task is a task with high priority, long execution time and a great impact on the execution time of other tasks. It is necessary to ensure its real-time and stability by binding independent CPU resources to reduce its potential impact on other tasks.
[0092] Step S430, according to the task dependency and the predicted execution time, the tasks that can be executed in parallel are allocated to different CPU cores, and the tasks that must be executed in sequence are arranged to be executed on the same CPU core.
[0093] Step S440, allocating each remaining independent task to a CPU core with the lowest load, and generating a resource allocation and scheduling strategy.
[0094] It is worth mentioning that through step S400, a reasonable CPU resource allocation scheme can be designed according to task dependencies, priorities and execution times, which can balance the load, achieve efficient multi-core resource utilization, reduce mutual interference between tasks, and improve overall performance and stability.
[0095] like Figure 2 As shown, based on the above embodiments, an embodiment of the present invention further provides a multi-tasking method, which specifically includes steps S100-S500, wherein steps S100-S400 are consistent with the steps in the above embodiments and are not repeated here. Step S500 is specifically as follows.
[0096] Step S500, adjusting the priority and resource allocation of the task, and updating the resource allocation and scheduling strategy according to the task execution time, task-related input and system load collected in real time.
[0097] For example, under high load conditions, the priority of non-critical tasks can be dynamically reduced; when a core is overloaded, threads can be migrated from one CPU core to another.
[0098] It is worth mentioning that, through step S500, resource allocation and scheduling strategies can be dynamically optimized to adapt to real-time changes in load, thereby enhancing adaptability in complex environments and improving frame rate stability.
[0099] like Figure 3 As shown, based on the above embodiments, an embodiment of the present invention further provides a multi-tasking method, which specifically includes steps S100-S600, wherein steps S100-S500 are consistent with the steps in the above embodiments and are not repeated here. Step S600 is specifically as follows.
[0100] Step S600: Conduct real vehicle testing based on resource allocation and scheduling strategies, and continuously iterate and optimize the strategies.
[0101] In some examples, step S600 may include the following steps:
[0102] Based on the resource allocation and scheduling strategy, it is deployed in a real vehicle environment, and real vehicle tests are carried out in various scenarios such as different road conditions, weather conditions, traffic density, etc. The system performance indicators such as CPU utilization, thread execution time, system response time, etc. are recorded through monitoring tools to evaluate the actual effect of the strategy, and the task execution time prediction model is optimized using the collected measured data. Then, the resource allocation and scheduling strategy is optimized based on the prediction results after model optimization, and the real vehicle test is carried out again using the updated strategy. Through the continuous iterative optimization process, the running frame rate and stability of the software are continuously improved.
[0103] It is worth mentioning that by continuously iterating and optimizing the resource allocation and scheduling strategy in step S600, it is possible to ensure that the system maintains stable performance under different loads and operating environments.
[0104] like Figure 4 As shown, the embodiment of the present invention further provides a multi-task processing system, which includes: an access layer unit 401, an analysis layer unit 402 and an infrastructure layer unit 403; the access layer unit 401 includes an input module 4011 and an output module 4012; the analysis layer unit 402 includes a task association parsing module 4021, a task analysis module 4022, a resource allocation module 4023 and a scheduling optimization module 4024; the infrastructure layer unit 403 includes a data storage module 4031 and a hardware device module 4032;
[0105] Input module 4011, used to input files describing dependencies between tasks and collected measured data;
[0106] Output module 4012, used to output resource allocation and scheduling strategy description files;
[0107] The task association analysis module 4021 is used to generate a topological order of task execution according to task dependencies;
[0108] A task analysis module 4022, for obtaining the predicted execution time of each task based on historical execution data, the historical execution data including task execution time, task associated input and system load;
[0109] Resource allocation module 4023, used to assign a priority to each task according to task dependency, task type and predicted execution time, determine the task execution order, and then generate resource allocation and scheduling strategies based on task dependency, priority and predicted execution time. The resource allocation and scheduling strategies include binding strategies for tasks and threads, and threads and CPUs;
[0110] The scheduling optimization module 4024 is used to adjust the priority and resource allocation of tasks and update the resource allocation and scheduling strategies according to the task execution time, task related input and system load collected in real time;
[0111] Data storage module 4031, used to store input data, output data and operation data;
[0112] The hardware device module 4032 is used to provide the physical basis for the system operation.
[0113] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and the computer program implements any of the methods in the aforementioned embodiments of the present invention when executed by a processor. Optionally, the computer-readable storage medium may be a non-transitory storage medium, but is not limited to this, and it may also be a temporary storage medium. A computer-readable storage medium is a tangible device that can hold and store instructions used by an instruction execution device. Computer-readable storage media may include, but are not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the above.
[0114] The embodiment of the present invention also provides a multi-task processing device, such as Figure 5 As shown, the device 500 may include a memory 501 and a processor 502. The memory 501 may be used to store computer instructions, and the processor 502 may be used to call computer instructions from the memory 501 to execute all or part of the steps of any method in the aforementioned embodiments of the present invention. The processor may be one or more, and the one or more processors may execute instructions individually or together, and the memory may be one or more, and the one or more memories may store the above-mentioned computer instructions individually or together.
[0115] The flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the methods, systems, devices and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of an instruction, and the module, a program segment or a part of an instruction contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions. It should be noted that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.
[0116] It should be understood that the above is only an exemplary embodiment of the present invention, and the protection scope of the present invention is not limited thereto. Those skilled in the art can easily conceive of modifications, replacements or adaptive changes without departing from the principle and essence of the present invention, which should all be covered within the protection scope of the present invention.
Claims
1. A multitasking method, characterized in that: include: Generate the topological order of task execution based on task dependencies; Obtaining a predicted execution time of each task based on historical execution data, wherein the historical execution data includes task execution time, task-related input, and system load; According to the task dependency, task type and the predicted execution time, assign a priority to each task and determine the task execution order; Based on the task dependency, the priority and the predicted execution time, a resource allocation and scheduling strategy is generated, wherein the resource allocation and scheduling strategy includes a binding strategy between tasks and threads, and between threads and CPUs.
2. The multitasking method according to claim 1, wherein: The method further comprises: According to the task execution time, task-related input and system load collected in real time, the priority and resource allocation of the task are adjusted, and the resource allocation and scheduling strategy is updated.
3. The multitasking method according to claim 1, wherein: Generating a topological order of task execution according to task dependencies includes: Creating a node for each task according to a task description file, adding directed edges according to a relationship description file, and generating a directed acyclic graph, wherein the task description file includes messages transmitted between tasks and their types, and the relationship description file includes the relationship between messages sent and received by the tasks; A graph traversal algorithm is used to detect whether there is a loop in the directed acyclic graph. If so, an exception is thrown and error information is recorded; otherwise, the topological order is generated.
4. The multitasking method according to claim 1, wherein: The method of obtaining the predicted execution time of each task based on the historical execution data includes: Get historical execution time, task-related input, and system load at the time of task execution; Call a statistical method to calculate the average execution time, standard deviation and fluctuation of the execution time to obtain the predicted execution time; for tasks whose execution time fluctuation exceeds a preset threshold, call a machine learning prediction model to obtain the predicted execution time.
5. The multitasking method according to claim 4, wherein: The calling of the machine learning prediction model to obtain the predicted execution time includes: Collect relevant data that affects task execution time, including CPU load, memory usage, and task-related input; Selecting features related to task execution time from the relevant data; Using decision tree modeling to obtain the predicted execution time; The influence of the features on the prediction results is analyzed to determine one or more features that have the greatest influence on the task execution time fluctuation.
6. The multitasking method according to claim 1, wherein: The assigning a priority to each task according to the task dependency, the task type and the predicted execution time includes: Based on the topological order of task execution, the initial priority is determined according to task dependencies; On the premise of satisfying the dependency relationship, the initial priority is adjusted according to the task type and the predicted execution time to generate the priority.
7. The multitasking method according to claim 1, wherein: The generating of resource allocation and scheduling strategies based on the task dependency, the priority and the predicted execution time includes: Obtain the number of CPU cores and the status of each CPU core, wherein the status includes the current load of the CPU; Binding a specific task to an independent CPU core, wherein the specific task is a task with a high priority, a long execution time, and a great impact on the execution time of other tasks; According to the task dependency and the predicted execution time, tasks that can be executed in parallel are assigned to different CPU cores, and tasks that must be executed sequentially are scheduled to be executed on the same CPU core; Each of the remaining independent tasks is assigned to a CPU core with the lowest load, and the resource allocation and scheduling strategy is generated.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is performed.
9. A multitasking device, characterized in that: The system comprises a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to execute the method according to any one of claims 1 to 7.
10. A multi-tasking system, characterized in that: include: An access layer unit, an analysis layer unit and an infrastructure layer unit; the access layer unit includes an input module and an output module; the analysis layer unit includes a task association parsing module, a task analysis module, a resource allocation module and a scheduling optimization module; the infrastructure layer unit includes a data storage module and a hardware device module; The input module is used to input files describing dependencies between tasks and collected measured data; The output module is used to output resource allocation and scheduling strategy description files; The task association parsing module is used to generate a topological order of task execution according to task dependencies; The task analysis module is used to obtain the predicted execution time of each task based on historical execution data, wherein the historical execution data includes task execution time, task-related input, and system load; The resource allocation module is used to assign a priority to each task according to the task dependency, the task type and the predicted execution time, determine the task execution order, and then generate a resource allocation and scheduling strategy based on the task dependency, the priority and the predicted execution time, wherein the resource allocation and scheduling strategy includes a binding strategy between tasks and threads, and between threads and CPUs; The scheduling optimization module is used to adjust the priority and resource allocation of tasks and update the resource allocation and scheduling strategy according to the task execution time, task related input and system load collected in real time; The data storage module is used to store input data, output data and operation data; The hardware device module is used to provide a physical basis for system operation.
Citation Information
Cited By
Multi-line cooperative scheduling method and device based on artificial intelligence
CN120179366A
Multi-task cooperative processing method and system of industrial vehicle-mounted computer
CN120448145A
A method and system for multi-task collaborative processing of an industrial vehicle-mounted computer
CN120448145B
Method and device for adjusting data storage operation, storage medium and electronic equipment
CN120780251A
Dynamic task allocation method of CPU module and medium
CN121070576A