Task execution method and device and vehicle

By constructing a task computation graph and dynamically allocating resources, the task execution order and resource allocation are optimized, solving the problem of low execution efficiency of in-vehicle deep learning tasks, achieving efficient scheduling and resource utilization, and improving the system's flexibility and compatibility.

CN120892148APending Publication Date: 2025-11-04IFLYTEK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510944279.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

Existing in-vehicle deep learning task execution solutions are inefficient in resource-limited environments, lacking deep perception and intelligent analysis of task characteristics and system status, resulting in low execution efficiency, poor data reusability, and poor compatibility and scalability.

Method used

By constructing a task computation graph, resources are dynamically allocated and the task computation graph is updated in real time based on the data and control dependencies between tasks, thereby optimizing the task execution order and resource allocation. Graph optimization techniques are used for task scheduling and resource management.

Benefits of technology

It achieves efficient scheduling and resource allocation for in-vehicle deep learning tasks, avoids resource waste, and improves task execution efficiency, system flexibility, and compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892148A_ABST
    Figure CN120892148A_ABST
Patent Text Reader

Abstract

The invention provides a task execution method and device and a vehicle, and the method comprises the steps: determining a data dependency relationship and a control dependency relationship between tasks based on task parameters of the tasks; based on the data dependency relationship and the control dependency relationship between the tasks, a task calculation graph is constructed, the task calculation graph comprises a plurality of nodes, each node represents one task, and a connecting line between every two adjacent nodes represents the data dependency relationship and the control dependency relationship between every two corresponding tasks; and allocating corresponding resources to each task based on the task calculation graph, and executing each task on the corresponding resources. According to the invention, efficient scheduling and resource allocation of the vehicle-mounted deep learning task are realized, and the problems of resource waste and low task execution efficiency caused by a traditional static resource allocation mode are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a task execution method, device and vehicle. BACKGROUND

[0002] With the development of intelligentization of vehicles, deep learning tasks are increasingly widely applied in vehicle systems. However, the resources of vehicle environment are limited and real-time requirements are high, and how to efficiently execute these tasks is a key problem to be solved.

[0003] At present, more attention is paid to optimizing task execution in a single dimension, such as using a dedicated accelerator to improve computing performance or model lightening, but this scheme is inefficient in scheduling, cache management, memory allocation and other aspects in actual vehicle deployment, ultimately affecting the overall response time and stability of the task. SUMMARY

[0004] The present application provides a task execution method, device and vehicle to solve the defects in the prior art.

[0005] The present application provides a task execution method, comprising the following steps: Based on the task parameters of each task, determine the data dependency relationship and control dependency relationship between each task; Based on the data dependency relationship and control dependency relationship between each task, construct a task computation graph, the task computation graph comprising a plurality of nodes, each node representing a task, and the connection between adjacent nodes representing the data dependency relationship and control dependency relationship between the corresponding two tasks; Based on the task computation graph, allocate corresponding resources to each task, and execute each task on the corresponding resources.

[0006] According to the task execution method provided by the present application, based on the task computation graph, corresponding resources are allocated to each task, and each task is executed on the corresponding resources, and then the method further comprises: In the execution process of each task, the execution data of each task is obtained in real time; Update the task computation graph based on the execution data of each task, and update the resources of each task based on the updated task computation graph.

[0007] According to the task execution method provided by the present application, updating the task computation graph based on the execution data of each task comprises: In the case where the execution data of any task indicates that the resource size occupied by the any task is higher than a threshold value, the any task is split into a plurality of sub-tasks or the priority of the any task is adjusted; Based on the plurality of sub-tasks obtained after splitting or the any task after adjusting the priority, update the data dependency relationship and control dependency relationship between each task. update the task computation graph based on the data dependency relationship and the control dependency relationship between the tasks after the update.

[0008] According to the task execution method provided by the application, the execution data of each task is acquired in real time, and then the method further comprises: verify the security, performance index and resource utilization of each task based on the execution data of each task; locate potential problems of each task based on the verification result.

[0009] According to the task execution method provided by the application, the task computation graph is constructed based on the data dependency relationship and the control dependency relationship between the tasks, and the method comprises: split each task based on the task parameters of each task to obtain subtasks corresponding to each task; determine the data dependency relationship and the control dependency relationship between the subtasks based on the task parameters of each subtask and the data dependency relationship and the control dependency relationship between the tasks; construct the task computation graph based on the data dependency relationship and the control dependency relationship between the subtasks.

[0010] According to the task execution method provided by the application, the corresponding resources are allocated to each task based on the task computation graph, and the method comprises: allocate the corresponding resources to each task based on the task computation graph, the current idle resources and the task requirements of each task.

[0011] The application further provides a task execution method, which comprises the following modules: a determination unit configured to determine the data dependency relationship and the control dependency relationship between the tasks based on the task parameters of each task; a construction unit configured to construct a task computation graph based on the data dependency relationship and the control dependency relationship between the tasks, wherein the task computation graph comprises a plurality of nodes, each node represents a task, and the connection between adjacent nodes represents the data dependency relationship and the control dependency relationship between the corresponding two tasks; an execution unit configured to allocate the corresponding resources to each task based on the task computation graph, and execute each task on the corresponding resources.

[0012] The application further provides a vehicle, which comprises the task execution device as described above, and the task execution device is integrated into a vehicle-mounted hardware platform.

[0013] The application further provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the task execution method as described above when executing the program.

[0014] The application further provides a non-transitory computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement any one of the task execution methods.

[0015] The application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement any one of the task execution methods.

[0016] The task execution method, device and vehicle provided by the application can realize efficient scheduling and resource allocation of the vehicle-mounted deep learning task by constructing a task computation graph and allocating resources based on the task computation graph, since the task computation graph can clearly show the dependency relationship between tasks and resource requirements, and the task execution order can be optimized by using graph optimization technology, thereby avoiding the problems of resource waste and low task execution efficiency caused by the traditional static resource allocation mode. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0018] Figure 1 is a flowchart of the task execution method provided by the application.

[0019] Figure 2 is a flowchart of the task computation graph updating method provided by the application.

[0020] Figure 3 is a flowchart of an embodiment of step 120 in the task execution method provided by the application.

[0021] Figure 4 is a structural diagram of the task execution device provided by the application.

[0022] Figure 5 is a structural diagram of the electronic device provided by the application. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of the application clearer, the technical solutions in the application will be described clearly and completely in combination with the drawings in the application. Obviously, the described embodiments are some embodiments of the application, not all embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the application.

[0024] At present, the vehicle-mounted deep learning task execution scheme mainly focuses on hardware acceleration, deep learning framework optimization, edge computing, and task scheduling and resource management. The hardware acceleration scheme relies on the high parallel computing capability of special hardware, but there is optimization space in hardware utilization, energy efficiency and system compatibility. The deep learning framework optimization scheme reduces the model calculation amount through software optimization, but it is difficult to balance model accuracy and execution efficiency in the environment of limited vehicle-mounted resources. The edge computing scheme has the problem of how to reasonably allocate vehicle-mounted and cloud tasks in the case of limited computing resources and network bandwidth. The automation scheme of task scheduling and resource management fails to deeply integrate task reconstruction and graph computing framework, and still needs to optimize automation migration and execution efficiency. The special vehicle-mounted AI processing platform lacks sufficient universality and flexibility, and is not easy to integrate with other platforms or technologies.

[0025] Overall, these schemes focus on single-dimensional optimization and lack end-to-end optimization of the task execution link from the overall system perspective. The task migration mechanism is mostly static or rule-driven, lacking deep perception and intelligent analysis of task characteristics and system state, making it difficult to make real-time and dynamic optimal migration decisions according to resource fluctuations. In addition, the above-mentioned schemes mostly rely on specific hardware or closed platforms, with poor compatibility and scalability, making it difficult to flexibly adapt to vehicle terminals of different brands and architectures. Even some solutions use graph computing framework for task representation, but lack the ability to automatically reconstruct the computation graph, making the migrated tasks unable to fully adapt to the new hardware architecture and computing resource distribution, resulting in low execution efficiency and poor data reuse.

[0026] To this end, the present application provides a task execution method, which can be applied to vehicle-mounted deep learning task execution, cloud computing task execution, and other scenarios such as edge computing and Internet of Things devices. The embodiments of the present application do not make specific limitations on this. In order to facilitate understanding of the technical solutions of the present application, the following embodiments are described by taking application to vehicle-mounted deep learning task execution as an example, i.e., the tasks in the following embodiments are vehicle-mounted deep learning tasks such as target detection tasks, lane line recognition tasks, and traffic sign recognition tasks.

[0027] Among them, Figure 1 is a flowchart of the task execution method provided by the present application, as shown in Figure 1 The method comprises steps 110, 120 and 130.

[0028] Step 110, based on the task parameters of each task, determines the data dependency relationship and control dependency relationship between each task.

[0029] Here, each task refers to a deep learning task performed in the vehicle-mounted system, and each task can be a same type of task, such as multiple object detection tasks for detecting different types of objects, or different types of tasks, such as an object detection task, a lane line recognition task, and a traffic sign recognition task, which are not specifically limited by the embodiments of the present application. Optionally, the above task can be an instruction task sent by a programmer in imperative program programming, which is used to describe how to obtain an output result from input data through processing. These instructions involve a large number of mathematical operations, matrix operations, and loop controls, etc. When performing imperative program analysis, the computing logic and data flow in the program are first identified. The imperative program often contains multiple stages, such as data preprocessing, model training, and inference calculation. Each stage can involve different computing tasks, such as matrix multiplication, convolution operation, and activation function, etc.

[0030] The task parameters of each task refer to various information describing the characteristics of the vehicle-mounted deep learning task, which are used to represent the computing complexity, data input / output scale, real-time requirement, precision requirement, and dependency relationship with other tasks of the task. Among them, the task parameters can include the size of the input image, the number of object detection categories, the algorithm type of lane line recognition, the sign type of traffic sign recognition, the priority of the task, the deadline, etc.

[0031] As an optional embodiment, the task parameters of each task can be obtained by analyzing the task configuration file and the task scheduling strategy of the vehicle-mounted system. In addition, considering that the running environment of the vehicle-mounted task can dynamically change (for example, the light condition changes, the vehicle speed changes), after obtaining the task parameters of each task, the task parameters can be updated in real time in combination with the information of the vehicle-mounted sensor, to more accurately reflect the requirements of the task. For example, the exposure parameter of the object detection task is adjusted according to the light intensity.

[0032] The data dependency relationship between each task refers to the data input / output relationship between tasks, which is used to represent the output data of one task as the input data of another task. For example, the detection result (for example, vehicle position) of the object detection task can be used as the input of the path planning task. The control dependency relationship between each task refers to the execution order constraint relationship between tasks, which is used to represent that the execution of one task depends on the execution result or state of another task. For example, only when the object detection task detects a vehicle in front, the automatic emergency braking task is started.

[0033] As an optional embodiment, the data dependency relationship and the control dependency relationship between each task can be determined by analyzing the task flow and the data flow diagram of the vehicle-mounted system. For example, the data and control flow between each module of the autonomous driving system are determined by analyzing the software architecture of the autonomous driving system.

[0034] In step 120, a task computing graph is constructed based on the data dependency relationship and the control dependency relationship between tasks, the task computing graph including a plurality of nodes, each node representing a task, and a connection between adjacent nodes representing a data dependency relationship and a control dependency relationship between corresponding two tasks.

[0035] Specifically, the task computing graph can be understood as a directed acyclic graph (DAG) for representing the dependency relationship and the execution order between tasks. The task computing graph includes a plurality of nodes, each node representing a task to be executed, and a directed edge between nodes representing the dependency relationship between tasks.

[0036] After determining the data dependency relationship and the control dependency relationship between tasks, it can be determined which tasks can be executed in parallel and which tasks need to be executed in series, and the order between tasks is clear. On this basis, the tasks and their dependency relationship are represented as nodes and edges in the graph, and a complete task computing graph is constructed.

[0037] For example, task A is target detection, task B is lane line identification, and task C is path planning, and the path planning task depends on the results of target detection and lane line identification. The task computing graph can be a graph including three nodes, node A and node B pointing to node C, i.e., node C depends on node A and node B.

[0038] As an optional embodiment, a graph theory algorithm (such as topological sorting) can be used to construct the task computing graph. For example, first, the dependency relationship between tasks is determined according to the task parameters of the tasks, and then the topological sorting algorithm is used to sort the tasks to ensure that each task is executed after all its dependent tasks are completed, and finally the task computing graph is generated.

[0039] It should be noted that the task computing graph constructed by the embodiment of the application can clearly show the dependency relationship between tasks, and the execution order of tasks can be optimized using graph optimization technology, thereby reducing the waiting time between tasks, improving the overall execution efficiency, and avoiding resource waste caused by traditional linear execution mode.

[0040] In step 130, based on the task computing graph, corresponding resources are allocated to each task, and each task is executed on the corresponding resources.

[0041] Specifically, after determining the task computing graph, the dependency relationship and resource requirements between tasks can be clearly described based on the task computing graph, so that the resources can be allocated more intelligently based on the task computing graph, and the limited resources can be allocated to the most needed tasks. Each task is allocated corresponding resources, and each task is executed on the corresponding resources. The resources here can be understood as computing resources for executing tasks, which can be hardware resources or software resources, such as GPU, CPU, etc. in a vehicle-mounted system.

[0042] As an optional embodiment, the resources corresponding to each task can be determined according to the computational complexity, data dependency and priority of the task. In the case of resource limitation, the priority of resource allocation of each task can be determined according to the execution order of each task in the task computation graph, and in the case that the high-priority task is executed, the corresponding resource is released by the high-priority task, which can be allocated to the low-priority task that needs to be executed subsequently.

[0043] For example, assuming that the priority of the target detection task is higher than that of the lane line recognition task, and the target detection task needs to occupy a large amount of GPU resources, after the target detection task is executed, the GPU resources occupied by the target detection task are released, and the resources are allocated to the subsequent lane line recognition task, thereby improving the utilization rate of the GPU resources.

[0044] In the task execution process, the integrity of each execution environment can be checked to avoid any tampering or exception in the execution process. Optionally, the hash value of the code segment loaded into the memory by the program can be calculated and compared with the pre-stored known safe code hash value to perform security check.

[0045] In addition, in the task execution process, security vulnerabilities (such as information leakage and data tampering) can be identified and repaired. If the task is interrupted due to hardware failure or system exception, the task can be rolled back to a safe state and re-executed after recovery, ensuring the reliability and continuity of the task. In the task execution process, commonly used data can also be retained in the cache of the GPU to avoid frequent memory access and data transmission, further improving the computing efficiency.

[0046] Some computationally intensive deep learning tasks (such as matrix multiplication and convolution) can become performance bottlenecks. In order to improve the efficiency of task execution, hardware acceleration algorithms (such as CUDA, cuDNN, etc.) can be used to optimize the computing process and reduce the consumption of computing resources as much as possible. At the same time, the computing task can be optimized in real time according to the situation of the hardware resources to ensure that each computing task can be executed on the most suitable hardware.

[0047] The task execution method provided by the embodiment of the application can realize efficient scheduling and resource allocation of the vehicle-mounted deep learning task by constructing a task computation graph and allocating resources based on the task computation graph, because the task computation graph can clearly show the dependency relationship and resource requirement between tasks, and the execution order of the tasks can be optimized by using graph optimization technology, thereby avoiding the problems of resource waste and low task execution efficiency caused by the traditional static resource allocation mode.

[0048] Based on any of the above embodiments, Figure 2is a flowchart of the task computing graph updating method provided by the present application, as shown in Figure 2 The method comprises the following steps: In step 210, based on the task computing graph, resources are allocated to each task, and after the execution of each task on the corresponding resource, the execution data of each task is obtained in real time during the execution of each task. In step 220, the task computing graph is updated based on the execution data of each task, and the resources of each task are updated based on the updated task computing graph.

[0049] Specifically, the execution data of each task refers to various information generated during the execution of the task, which is used to represent the running state and resource consumption of the task. The execution data can include execution time, CPU utilization, GPU utilization, memory occupancy, data transmission volume, energy consumption, etc. of the task. Among them, the execution data of each task can be obtained through the performance monitoring tool and API of the vehicle-mounted system.

[0050] Since the execution data of each task can reflect the actual performance and resource requirements of the task, the dependency relationship and weight between tasks can be dynamically adjusted based on the execution data of each task, the execution order and resource allocation of the task can be optimized, and the task computing graph can be updated. For example, if it is found that the execution time of the target detection task is too long, it can be split into multiple sub-tasks, or its priority can be increased to allocate more resources in priority.

[0051] As an optional embodiment, a reinforcement learning algorithm can be used to learn the optimal task scheduling strategy according to the execution data of each task, so as to update the task computing graph. For example, the task scheduling process can be modeled as a Markov decision process (MDP), the state space represents the state of the current task computing graph, the action space represents the task scheduling strategy, and the reward function can be set as the weighted sum of the task execution efficiency and resource utilization. Through reinforcement learning algorithms such as Q-learning, SARSA, etc., the optimal Q value function or strategy function is learned, so as to realize the dynamic updating of the task computing graph.

[0052] After updating the task computing graph, the dependency relationship and resource requirements between tasks change, so the resources of each task need to be updated. For example, if the computational complexity of a task increases, more GPU resources need to be allocated to it to ensure that it can be completed on time.

[0053] Based on any of the above embodiments, the task computing graph is updated based on the execution data of each task, which comprises: In the case where the execution data of any task indicates that the resource size occupied by any task is higher than a threshold value, any task is split into multiple sub-tasks or the priority of any task is adjusted; update the data dependency relationship and the control dependency relationship among the tasks based on the plurality of sub-tasks obtained after the splitting or any task after the priority adjustment; update the task computation graph based on the data dependency relationship and the control dependency relationship among the tasks after the update.

[0054] Specifically, the resource size occupied by any task refers to the total amount of computing resources required for the execution of the task. If the resource size occupied by any task is too high, it may cause system resource shortage, affect the execution of other tasks, and even cause system crash. Therefore, measures need to be taken to reduce the resource occupation. The execution data of any task can include CPU utilization, GPU utilization, memory occupation, energy consumption, etc. According to the execution data, it can be determined whether the resource size occupied by any task is higher than a threshold. If so, it indicates that the task is a resource bottleneck and needs to be optimized. At this time, the computational complexity needs to be reduced or the task needs to be split into a plurality of sub-tasks.

[0055] In addition, considering that the computing process of some tasks can be decomposed into a plurality of independent sub-tasks for parallel execution, in the case where the computational complexity of a task is high and can be decomposed, any task is split into a plurality of sub-tasks, and the plurality of sub-tasks can be executed in parallel, thereby reducing the resource occupation of a single task and improving the overall execution efficiency. Further, since the plurality of sub-tasks obtained after the splitting may change the data dependency relationship among the tasks, for example, task A originally directly depends on task B, and now task B is split into B1 and B2, task A may need to depend on B1 and B2 at the same time or only depend on one of them. At this time, based on the new task dependency relationship, the data dependency relationship and the control dependency relationship among the tasks need to be updated. For example, if a convolution layer is split into a plurality of small convolution layers, the data input mode of the subsequent layer needs to be modified. After updating the data dependency relationship and the control dependency relationship among the tasks, the structure of the task computation graph changes at this time. Therefore, based on the data dependency relationship and the control dependency relationship among the tasks after the update, the task computation graph needs to be updated.

[0056] As an optional embodiment, a graph theory algorithm can be used to recalculate the dependency relationship among the tasks and generate a new task computation graph to update the data dependency relationship and the control dependency relationship among the tasks.

[0057] In view of the fact that some tasks have no real-time requirements, the priority of the tasks can be appropriately lowered to allocate resources to more important tasks. In the case where system resources are tight and there are tasks with low priority, the priority of any task can be adjusted, i.e., the resource allocation of the task with low priority is lowered to give up part of the resources to other tasks, thereby relieving the pressure on system resources and ensuring the execution of critical tasks. Further, since adjusting the priority of any task may change the execution order of the tasks, for example, a task with low priority originally needs to wait for the execution of a task with high priority before it can be executed, and now its priority is lowered, it may need to wait for a longer time before it can be executed. At this time, the data dependency and control dependency between tasks need to be updated based on the new task priority. For example, if the priority of the lane line recognition task is lowered, the path planning task may need to wait for a longer time to obtain lane line information. After updating the data dependency and control dependency between tasks, the execution order of the tasks in the task computation graph changes, and therefore the task computation graph needs to be updated based on the updated data dependency and control dependency between tasks.

[0058] As an optional embodiment, the execution order of the tasks can be recalculated based on the priority and deadline of the tasks, and the task computation graph is updated, and the data dependency and control dependency between tasks are updated.

[0059] Based on any of the above embodiments, the execution data of each task is obtained in real time, and then the method further comprises: Based on the execution data of each task, the safety, performance index, and resource utilization of each task are verified. Based on the verification result, potential problems of each task are located.

[0060] Specifically, the safety of each task refers to whether there is a security risk in the execution process of the task, such as data leakage, privilege boundary crossing, malicious code injection, etc., which can be verified by using data access logs, privilege control records, and abnormal behavior detection results in the execution data of each task. For example, whether there is unauthorized data access can be checked to verify the safety of each task.

[0061] The performance index of each task refers to the efficiency and quality level exhibited in the execution process of the task, which can be verified by using execution time, CPU / GPU utilization, memory occupancy, throughput, etc. in the execution data of each task. For example, the average execution time of the task can be counted to verify the performance index of each task.

[0062] The resource utilization of each task refers to the utilization degree of various computing resources (such as CPU, GPU, and memory) during the execution of the task, which can be verified by CPU / GPU occupancy, memory occupancy, I / O throughput, etc. in the execution data of each task. For example, the CPU utilization of the computing task can be used to verify the resource utilization of each task.

[0063] Optionally, a real vehicle environment can be simulated, such as accurately simulating the hardware resources, sensor data input, network environment, etc. of the vehicle system, and the performance and security of the program can be comprehensively evaluated by continuously adjusting different test scenarios. At the same time, during the verification process, various data (such as CPU / GPU load, memory occupancy, network delay, etc.) during the running of the vehicle system, as well as error logs and alarm information during the execution of the program, can be collected to effectively monitor the real-time running status of the program and provide detailed diagnostic information when problems occur. In addition, different test tasks can be automatically executed during the verification process, and the execution results of each test step can be recorded, so that potential problems can be quickly found, and efficiency and consistency can be maintained in large-scale testing.

[0064] In addition, the verification result refers to the conclusion obtained after evaluating the security, performance indicators, and resource utilization of the task, which is used to represent whether the running state of the task meets the expectations. For example, unauthorized access behavior appears in the data access log, indicating that the security of the corresponding task is at risk. The average execution time of the task exceeds the preset threshold, indicating that the performance of the corresponding task has a bottleneck. The CPU utilization of the task is less than 10% for a long time, indicating that the resource utilization of the corresponding task is low, and there is resource waste.

[0065] If the verification result shows that the task has security risks, performance bottlenecks, or resource waste, it indicates that the corresponding task has potential problems. For example, a task frequently accesses sensitive data but lacks necessary permission control, which has potential problems of data leakage. Based on this, the embodiments of the present application locate the potential problems of each task according to the verification result. The potential problem refers to various unexpected situations that may occur during the execution of the task, which may affect the security, performance, and stability of the system.

[0066] As an optional embodiment, a problem library can be established to store various known security risks, performance bottlenecks, and resource waste problems, and the most likely problem can be matched from the problem library according to the verification result to locate the potential problems of each task. For example, if the verification result shows that a task has a memory leak, a solution related to the memory leak can be matched from the problem library.

[0067] After locating the potential problems of each task, corresponding processing measures can be taken according to the types and severity of the problems, such as optimizing task code, adjusting resource allocation, and performing security reinforcement, to solve these problems and improve the overall performance and security of the system.

[0068] Based on any of the above embodiments, Figure 3 is a flowchart of an embodiment of step 120 in the task execution method provided by the present application, as shown in Figure 3 Step 120 constructs a task computation graph based on the data dependency relationship and the control dependency relationship between tasks, including: Step 121, based on the task parameters of each task, splitting each task to obtain subtasks corresponding to each task; Step 122, based on the task parameters of each subtask and the data dependency relationship and the control dependency relationship between tasks, determining the data dependency relationship and the control dependency relationship between subtasks; Step 123, based on the data dependency relationship and the control dependency relationship between subtasks, constructing a task computation graph.

[0069] Specifically, considering that the computation of some tasks is too large to be efficiently executed under limited resources, or the parallelism of some tasks is low and cannot fully utilize the performance of multi-core processors, therefore, before constructing the task computation graph, the embodiments of the present application split each task based on the task parameters of each task to obtain subtasks corresponding to each task. Since the original task is split into multiple smaller subtasks after splitting, each subtask can be executed independently or in parallel, and the dependency relationship between subtasks is different from the dependency relationship between corresponding tasks. For example, task A depends on the output of task B, and now task B is split into two subtasks B1 and B2, so task A may need to depend on the output of B1 and B2 at the same time, or only need to depend on the output of one of them.

[0070] Based on this, the embodiments of the present application determine the dependency relationship (including the data dependency relationship and the control dependency relationship) between subtasks based on the task parameters of each subtask and the dependency relationship between tasks. Specifically, the input and output data of each subtask and the control flow between subtasks can be analyzed to determine the data dependency relationship and the control dependency relationship between them, and the data dependency relationship and the control dependency relationship between subtasks are determined.

[0071] After determining the data dependency relationship and the control dependency relationship between subtasks, each subtask can be regarded as a node and their dependency relationship can be regarded as an edge to construct a task computation graph according to the rules of graph construction.

[0072] Therefore, the embodiment of the present application can realize more fine-grained task scheduling and resource allocation by splitting the task into multiple sub-tasks and constructing a task computing graph based on the sub-tasks, thereby improving the parallelism and resource utilization of the system.

[0073] Based on any of the above embodiments, based on the task computing graph, the corresponding resources are allocated to each task, including: Based on the task computing graph, the current idle resources and the task requirements of each task, the corresponding resources are allocated to each task.

[0074] Specifically, the current idle resources refer to the available computing resources that are not used in the system, that is, the current idle resources can be allocated to new tasks for use. In the vehicle scene, the current idle resources can be idle CPU cores, idle GPU memory, available network bandwidth, etc. Among them, the current idle resources can be determined by the resource manager or monitoring tool of the vehicle system.

[0075] The task requirements of each task refer to various resources required for task execution, performance index requirements of the task, time limit requirements of the task, safety and stability requirements of the task, etc., which are used to represent the demand amount of the task for CPU, GPU, memory, network bandwidth, etc. and the requirements of the task for execution time, precision, etc.

[0076] Considering that if the resource is allocated only based on the task computing graph, the actual resource availability may be ignored, resulting in unreasonable resource allocation, and even resource competition, for example, if a task needs a large amount of GPU memory, but the GPU memory is insufficient at this time, the task cannot be executed normally. Further, considering that the current idle resources can reflect the actual available resource amount in the system, thereby avoiding resource over-allocation, the task requirements of each task can reflect the demand of the task for various resources, thereby avoiding resource allocation shortage or resource waste, and therefore, when the resource is allocated in combination with the task computing graph, the current idle resources and the task requirements of each task, the limited resources can be allocated to the most needed task according to the dependency relationship between the tasks and the demand amount and priority of the task for the resources, and the utilization rate of the resources can be improved as much as possible.

[0077] For example, assuming that task A and task B can be executed in parallel, but task A needs to occupy a large amount of GPU resources, and task B only needs to occupy a small amount of CPU resources, and the current GPU resources are relatively tight and the CPU resources are relatively sufficient, then task B can be allocated to the CPU for execution, and the GPU resources are allocated to task A, thereby ensuring that task A can be completed on time, and avoiding waste of CPU resources.

[0078] The task execution apparatus provided by the present application is described below, and the task execution apparatus described below can be referred to in correspondence with the task execution method described above.

[0079] Based on any of the above embodiments, Figure 4 is a structural schematic diagram of the task execution apparatus provided by the present application, as Figure 4 indicated, the apparatus comprises: A determination unit 410 is configured to determine data dependency relationships and control dependency relationships between tasks based on task parameters of the tasks. A construction unit 420 is configured to construct a task computation graph based on the data dependency relationships and the control dependency relationships between the tasks, the task computation graph comprising a plurality of nodes, each node representing a task, and a connection between adjacent nodes representing data dependency relationships and control dependency relationships between the two corresponding tasks. An execution unit 430 is configured to assign corresponding resources to the tasks based on the task computation graph, and execute the tasks on the corresponding resources.

[0080] Based on any of the above embodiments, based on the task computation graph, corresponding resources are assigned to the tasks, and the tasks are executed on the corresponding resources, and then further comprising: In the execution process of the tasks, execution data of the tasks is acquired in real time. The task computation graph is updated based on the execution data of the tasks, and the resources of the tasks are updated based on the updated task computation graph.

[0081] Based on any of the above embodiments, the task computation graph is updated based on the execution data of the tasks, comprising: In a case where the execution data of any task indicates that the resource size occupied by the task is higher than a threshold value, the task is split into a plurality of sub-tasks or the priority of the task is adjusted. Based on the plurality of sub-tasks obtained after the splitting or the task with the adjusted priority, the data dependency relationships and the control dependency relationships between the tasks are updated. The task computation graph is updated based on the updated data dependency relationships and the control dependency relationships between the tasks.

[0082] Based on any of the above embodiments, the execution data of the tasks is acquired in real time, and then further comprising: Based on the execution data of the tasks, the safety, performance indicators and resource utilization of the tasks are verified. Based on the verification result, potential problems of the tasks are located.

[0083] Based on any of the above embodiments, the task computation graph is constructed based on the data dependency relationships and the control dependency relationships between the tasks, comprising: Split each task based on the task parameters of each task to obtain subtasks corresponding to each task; Determine the data dependency relationship and the control dependency relationship between each subtask based on the task parameters of each subtask and the data dependency relationship and the control dependency relationship between each task; Construct a task computation graph based on the data dependency relationship and the control dependency relationship between each subtask.

[0084] Based on any of the above embodiments, based on the task computation graph, allocate corresponding resources to each task, including: Based on the task computation graph, the current idle resources, and the task requirements of each task, allocate corresponding resources to each task.

[0085] Based on any of the above embodiments, the present application also provides a vehicle, including: the task execution device as described in any of the above embodiments, and the task execution device is integrated into a vehicle hardware platform.

[0086] Specifically, the task execution device is integrated into the vehicle hardware platform, adopts a standardized interface and protocol, and supports multiple different hardware architectures and operating systems, thereby ensuring wide portability and being able to flexibly adapt to vehicle terminals of different brands and architectures, and avoiding the problem that the task execution method cannot be applied due to the limitation of the hardware platform.

[0087] Figure 5 is a structural schematic diagram of an electronic device provided by the present application, as Figure 5 shown, the electronic device can include: a processor (processor) 510, a communication interface (communications interface) 520, a memory (memory) 530 and a communication bus 540, wherein the processor 510, the communication interface 520, the memory 530 complete mutual communication through the communication bus 540. The processor 510 can call the logical instructions in the memory 530 to execute the task execution method, which includes: determining the data dependency relationship and the control dependency relationship between each task based on the task parameters of each task; based on the data dependency relationship and the control dependency relationship between each task, constructing a task computation graph, the task computation graph includes multiple nodes, each node represents a task, and the connection between adjacent nodes represents the data dependency relationship and the control dependency relationship between the corresponding two tasks; based on the task computation graph, allocate corresponding resources to each task, and execute each task on the corresponding resources.

[0088] In addition, the logic instructions in the memory 530 described above can be implemented in the form of software functional units and sold or used as independent products, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0089] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program can be executed by a processor to enable a computer to execute the task execution method provided by the above-mentioned methods. The method comprises: determining the data dependency relationship and the control dependency relationship between tasks based on the task parameters of the tasks; constructing a task computation graph based on the data dependency relationship and the control dependency relationship between the tasks, the task computation graph comprising a plurality of nodes, each node representing a task, and the connection between adjacent nodes representing the data dependency relationship and the control dependency relationship between the corresponding two tasks; and allocating corresponding resources to the tasks based on the task computation graph, and executing the tasks on the corresponding resources.

[0090] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program can be executed by a processor to enable a computer to execute the task execution method provided by the above-mentioned methods. The method comprises: determining the data dependency relationship and the control dependency relationship between tasks based on the task parameters of the tasks; constructing a task computation graph based on the data dependency relationship and the control dependency relationship between the tasks, the task computation graph comprising a plurality of nodes, each node representing a task, and the connection between adjacent nodes representing the data dependency relationship and the control dependency relationship between the corresponding two tasks; and allocating corresponding resources to the tasks based on the task computation graph, and executing the tasks on the corresponding resources.

[0091] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0092] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A task execution method, characterized in that, include: Based on the task parameters of each task, determine the data dependencies and control dependencies between tasks; Based on the data dependencies and control dependencies between tasks, a task computation graph is constructed. The task computation graph includes multiple nodes, each node represents a task, and the lines between adjacent nodes represent the data dependencies and control dependencies between the corresponding two tasks. Based on the task computation graph, corresponding resources are allocated to each task, and each task is executed on the corresponding resources.

2. The task execution method according to claim 1, characterized in that, The process of allocating corresponding resources to each task based on the task computation graph, and executing each task on the corresponding resources, further includes: During the execution of each task, the execution data of each task is acquired in real time; The task computation graph is updated based on the execution data of each task, and the resources of each task are updated based on the updated task computation graph.

3. The task execution method according to claim 2, characterized in that, The updating of the task computation graph based on the execution data of each task includes: If the execution data of any task indicates that the resource size occupied by any task is higher than a threshold, the task will be split into multiple sub-tasks or the priority of any task will be adjusted. Based on the multiple subtasks obtained after splitting or any task after adjusting priority, update the data dependencies and control dependencies between the tasks. The task computation graph is updated based on the updated data and control dependencies between tasks.

4. The task execution method according to claim 2, characterized in that, The process of acquiring execution data for each task in real time also includes: Based on the execution data of each task, the security, performance indicators and resource utilization of each task are verified. Based on the verification results, potential problems in each task are identified.

5. The task execution method according to any one of claims 1 to 4, characterized in that, The construction of a task computation graph based on the data and control dependencies between tasks includes: Based on the task parameters of each task, each task is broken down to obtain the subtasks corresponding to each task; Based on the task parameters of each subtask, as well as the data dependencies and control dependencies between each task, determine the data dependencies and control dependencies between each subtask; The task computation graph is constructed based on the data and control dependencies between the subtasks.

6. The task execution method according to any one of claims 1 to 4, characterized in that, The allocation of corresponding resources to each task based on the task computation graph includes: Based on the task computation graph, the current available resources, and the task requirements of each task, the corresponding resources are allocated to each task.

7. A task execution device, characterized in that, include: The determination unit is used to determine the data dependencies and control dependencies between tasks based on the task parameters of each task; A construction unit is used to construct a task computation graph based on the data dependencies and control dependencies between tasks. The task computation graph includes multiple nodes, each node represents a task, and the lines between adjacent nodes represent the data dependencies and control dependencies between the corresponding two tasks. An execution unit is used to allocate corresponding resources to each task based on the task computation graph, and to execute each task on the corresponding resources.

8. A vehicle, characterized in that, include: The task execution device as described in claim 7 is integrated into an on-board hardware platform.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the task execution method as described in any one of claims 1 to 6.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the task execution method as described in any one of claims 1 to 6.