Task management method, system, device and medium based on graph structure

By adopting a graph-based task management method in the AI ​​task processing framework, the problem of inaccurate description of data dependencies between tasks in the traditional framework is solved, and reasonable planning and parallel processing of task execution order is realized, which improves the efficiency and flexibility of task processing.

CN119781961APending Publication Date: 2025-04-08深圳开鸿数字产业发展有限公司
View PDF 0 Cites 13 Cited by

Patent Information

Application Number
CN202411760096.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

Traditional AI task processing frameworks are difficult to accurately describe the data dependencies between tasks, resulting in subtasks being executed when the data prerequisites are not met, causing data inconsistency or task failure. The lack of effective data dependency management makes it difficult for the task scheduling system to efficiently plan the task execution order, affecting data integrity and processing effectiveness.

Method used

The task management method based on graph structure is adopted. By decomposing the target task into subtasks and creating task nodes, mapping them to directed acyclic graph, the edge set of the task graph is updated according to the dependencies between task nodes, the task dependency graph is obtained, and the execution order of the task nodes is determined through topological sorting, parallel processing and dependency management are realized.

Benefits of technology

This method can accurately describe the data dependencies between tasks, ensure the rationality of the task execution order, optimize task disassembly and dependency management, improve task processing efficiency and flexibility, and ensure the consistency and accuracy of task execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781961A_ABST
    Figure CN119781961A_ABST
Patent Text Reader

Abstract

The present application discloses a task management method, system, device, and medium based on a graph structure, and relates to the field of computer technology. The method includes: decomposing a preset target task into at least two subtasks, creating a task node for each of the subtasks, and mapping the task node to a node set of a preset directed acyclic graph to obtain a task graph; updating the edge set of the task graph according to the dependency relationship between each of the task nodes to obtain a task dependency graph; topologically sorting all the task nodes in the task dependency graph, and determining the execution order corresponding to the independent task nodes and the dependent task nodes according to the topological sorting result; if there are multiple independent task nodes, executing the subtasks corresponding to the multiple independent task nodes in parallel, and executing all the dependent subtasks in sequence according to the execution order. The present application improves the processing efficiency of the task processing framework for complex tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a task management method, system, device, and medium based on a graph structure. Background Art

[0002] In the field of computer technology, especially in the application of the Internet of Things, task processing frameworks often face the challenge of managing data dependencies between tasks, especially AI task processing frameworks. Traditional AI task processing frameworks often decompose complex tasks into independent parts based on static rules. This method cannot accurately describe the data dependencies between tasks, resulting in subtasks being executed when data prerequisites are not met, causing data inconsistency or task failure. In addition, due to the lack of clear data dependency management, it is difficult for the task scheduling system to efficiently plan the execution order of each subtask, and it is difficult to ensure data integrity and processing effectiveness. At the same time, the traditional task decomposition method fails to fully consider the dependencies between tasks and cannot effectively implement parallel processing, resulting in some tasks being executed serially during processing. Although there may be parallel parts inside, due to the lack of effective decomposition and dependency management, the opportunity for parallel processing is wasted, reducing the processing efficiency of the overall system. These problems limit the flexibility and efficiency of AI task processing. Summary of the invention

[0003] The main purpose of this application is to provide a task management method, system, device, and medium based on a graph structure, aiming to improve the processing efficiency of the task processing framework for complex tasks.

[0004] To achieve the above objectives, this application proposes a task management method based on a graph structure, including:

[0005] Decomposing a preset target task into at least two subtasks, creating a task node for each subtask, and mapping the task node to a node set of a preset directed acyclic graph to obtain a task graph, wherein the directed acyclic graph includes a node set for representing each node in the directed acyclic graph and an edge set for representing each edge in the directed acyclic graph;

[0006] Update the edge set of the task graph according to the dependency relationship between each task node to obtain the task dependency graph;

[0007] Perform topological sorting on all task nodes in the task dependency graph, and determine the execution order of task nodes without dependencies and task nodes with dependencies based on the topological sorting results;

[0008] If there are multiple independent task nodes, the subtasks corresponding to the multiple independent task nodes are executed in parallel, and all dependent subtasks are executed in sequence according to the execution order.

[0009] In one embodiment, the dependency relationship between each task node includes the data transmission relationship between the task node and the subtask. The step of updating the edge set of the task graph according to the dependency relationship between each task node to obtain the task dependency graph includes:

[0010] Determine that any two different task nodes among the task nodes are respectively the first task node and the second task node;

[0011] If there is a data transmission relationship between the subtask corresponding to the first task node and the subtask corresponding to the second task node, and the data transmission relationship is that the output data of the subtask corresponding to the first task node is the input data of the subtask corresponding to the second task node, then a first edge from the first task node to the second task node is generated in the task graph, and the first edge is updated to the edge set of the task graph, and the task graph including the first edge is used as the task dependency graph.

[0012] In one embodiment, the topological sorting result includes the node arrangement order of each task node, and the step of determining the execution order of the independent task nodes and the dependent task nodes according to the topological sorting result includes:

[0013] According to the node arrangement order, determine the task nodes without predecessor task nodes among the task nodes as independent task nodes;

[0014] According to the node arrangement order, the task nodes having predecessor task nodes among the task nodes are determined as dependent task nodes, and the node arrangement order is used as the execution order corresponding to the dependent task nodes.

[0015] In one embodiment, the steps of executing all dependent subtasks in order include:

[0016] For each dependent subtask, check the execution status of the dependent subtask;

[0017] When the execution status is completed, determine whether the next subtask of the dependent subtask can be executed normally according to the execution order;

[0018] If the next subtask can be executed normally, the output data of the dependent subtask will be passed to the next subtask;

[0019] If the next subtask cannot be executed normally, the transmission path of the output data of the dependent subtask is adjusted through the task dependency graph.

[0020] In one embodiment, the steps of executing subtasks corresponding to multiple independent task nodes in parallel and executing all dependent subtasks in sequence according to the execution order include:

[0021] Determine a first terminal device whose operating state is greater than a preset state threshold among the preset multiple terminal devices, and distribute all independent subtasks to different first terminal devices for execution in parallel, and update the operating state of the first terminal device when the first terminal device executes the independent subtask;

[0022] If there are dependent subtasks, the node weights, edge weights and running status of the task dependency graph are input into the preset cost calculation function for calculation to obtain the total cost. The task allocation plan is constructed with the goal of minimizing the total cost. In accordance with the execution order, the terminal devices assigned by the task allocation plan are called in sequence to execute the dependent subtasks.

[0023] In one embodiment, the step of obtaining the task dependency graph includes:

[0024] Determine the node weight of each task node in the task dependency graph according to the task requirements of each task node, wherein the task requirements include the computing requirements, task priority and resource requirements of the task node, and the node weight is positively correlated with the task requirements;

[0025] The edge weight of each edge in the edge set of the task dependency graph is determined according to the data transmission complexity between task nodes, wherein the edge weight is positively correlated with the data transmission complexity.

[0026] In one embodiment, the graph-based task management method further includes:

[0027] For each terminal device, detecting the operating status of the terminal device;

[0028] When an update of the running status is detected, the task dependency graph is updated according to the updated running status and the execution status of the subtasks using a dynamic graph algorithm based on the shortest path and topological sorting, and the step of determining the execution order of each subtask according to the task dependency graph is executed according to the updated task dependency graph.

[0029] In addition, to achieve the above purpose, the present application also proposes a task management system based on a graph structure, and the task management system based on a graph structure includes:

[0030] A task decomposition module based on a graph structure is used to decompose a preset target task into at least two subtasks, create a task node for each subtask, and map the task node to a node set of a preset directed acyclic graph to obtain a task graph, wherein the directed acyclic graph includes a node set for representing each node in the directed acyclic graph and an edge set for representing each edge in the directed acyclic graph;

[0031] A task dependency graph generation module is used to update the edge set of the task graph according to the dependency relationship between each task node to obtain the task dependency graph;

[0032] The task scheduling module is used to topologically sort all task nodes in the task dependency graph and determine the execution order of independent task nodes and dependent task nodes according to the topological sorting results;

[0033] The task allocation module is used to execute the subtasks corresponding to the multiple independent task nodes in parallel if there are multiple independent task nodes, and to execute all dependent subtasks in sequence according to the execution order.

[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a task management device based on a graph structure, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the task management method based on a graph structure as described above.

[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the graph-based task management method as described above are implemented.

[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a product, which is a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps of the graph-based task management method as described above.

[0037] One or more technical solutions proposed in this application have at least the following technical effects:

[0038] The present application is applied to a task processing system under a task processing framework, decomposing a preset target task into at least two subtasks, creating a task node for each subtask, and mapping the task node to a node set of a preset directed acyclic graph to obtain a task graph, wherein the directed acyclic graph includes a node set for representing each node in the directed acyclic graph and an edge set for representing each edge in the directed acyclic graph, which helps to intuitively display the task decomposition and facilitates project management and progress tracking; the edge set of the task graph is updated according to the dependency relationship between each task node to obtain a task dependency graph, which not only accurately describes the data dependency relationship between tasks, but also ensures the execution of tasks. Reasonableness of the order; perform topological sorting on all task nodes in the task dependency graph, and determine the execution order of independent task nodes and dependent task nodes based on the topological sorting results. This achieves clear data dependency management, effectively plans the execution order of each subtask, and optimizes task decomposition and dependency management, thereby improving work efficiency. If there are multiple independent task nodes, execute the subtasks corresponding to multiple independent task nodes in parallel, and execute all dependent subtasks in sequence according to the execution order. This not only effectively achieves parallel processing and improves resource utilization, but also ensures the consistency and accuracy of task execution. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0041] Figure 1 This is a flowchart of the first embodiment of the task management method based on the graph structure of the present application;

[0042] Figure 2 This is a flowchart of the second embodiment of the task management method based on the graph structure of the present application;

[0043] Figure 3 This is a flowchart of Embodiment 3 of the task management method based on a graph structure of the present application;

[0044] Figure 4 This is a module diagram of a task management system based on a graph structure according to an embodiment of the present application;

[0045] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the graph-based task management method in the embodiment of the present application.

[0046] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0047] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0048] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0049] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a terminal system, etc. The following takes the task processing system under the task processing framework capable of realizing the above functions as an example to illustrate this embodiment and the following embodiments.

[0050] Based on this, this embodiment provides a task management method based on a graph structure. Figure 1 , Figure 1 Schematic diagram of the process of the task management method based on the graph structure of the present application. The task management method based on the graph structure includes steps S10 to S40:

[0051] Step S10, decomposing the preset target task into at least two subtasks, creating a task node for each subtask, and mapping the task node to a node set of a preset directed acyclic graph to obtain a task graph, wherein the directed acyclic graph includes a node set for representing each node in the directed acyclic graph and an edge set for representing each edge in the directed acyclic graph;

[0052] It should be noted that the target task refers to the main task or goal that needs to be completed. Subtasks are smaller and more specific task units obtained by splitting the target task. Task nodes represent subtasks in the graph structure and are node elements of the graph. A directed acyclic graph is a graph structure in which the edges have directions and no loops. It is used to represent the dependencies between tasks. The node set is the set of all nodes in a directed acyclic graph. The edge set is the set of all edges in a directed acyclic graph, representing the dependencies between nodes. The task graph is a graph obtained by mapping task nodes to the node set of a directed acyclic graph, which is used to represent tasks and their dependencies.

[0053] Decompose the preset target task into at least two subtasks, and create a task node for each subtask. Then, map these task nodes to the node set of the preset directed acyclic graph to obtain the task graph. The task graph consists of a node set (representing subtasks) and an edge set (initially empty, to be added later). Decomposing the target task is for better management and execution. Decomposing a complex task into multiple simple tasks can improve execution efficiency and manageability. The directed acyclic graph is used to represent the dependency relationship between tasks and is the basis for task scheduling and parallel execution.

[0054] Step S20, updating the edge set of the task graph according to the dependency relationship between each task node to obtain a task dependency graph;

[0055] It should be noted that the task dependency graph is a graph obtained by updating the edge set of the task graph according to the dependency relationship between task nodes, which more accurately represents the execution order between tasks.

[0056] According to the dependency relationship between each task node, directed edges are added to the edge set of the task graph to indicate the order between tasks. The resulting task dependency graph more accurately reflects the execution order and dependency relationship between tasks. The dependency relationship between tasks determines the execution order of tasks. The edge set is updated to accurately represent this dependency relationship in the graph, providing a basis for subsequent task scheduling.

[0057] Step S30, topologically sorting all task nodes in the task dependency graph, and determining the execution order of task nodes without dependencies and task nodes with dependencies according to the topological sorting result;

[0058] It should be noted that topological sorting is to sort the nodes in the directed acyclic graph so that for each directed edge (u, v), node u appears before node v in the sort. A task node without dependencies is a task node that has no predecessor task (i.e., no edge pointing to it) in the task dependency graph. A task node with dependencies is a task node that has a predecessor task (i.e., an edge pointing to it) in the task dependency graph.

[0059] Perform topological sorting on all task nodes in the task dependency graph to obtain a sorting result. This sorting result determines the execution order of independent task nodes and dependent task nodes. Topological sorting is a linear sorting of directed acyclic graphs, which makes node u appear before node v in the sorting for each directed edge (u, v). This ensures that when executing a task, the predecessor task of each task has been executed.

[0060] Step S40: If there are multiple independent task nodes, the subtasks corresponding to the multiple independent task nodes are executed in parallel, and all dependent subtasks are executed in sequence according to the execution order.

[0061] First, check the task nodes in the topological sorting results to find all non-dependent task nodes (i.e., task nodes without predecessor tasks). Then, execute the subtasks corresponding to these non-dependent task nodes in parallel. For dependent task nodes, execute their corresponding subtasks in sequence according to the order in the topological sorting results. Parallel execution of non-dependent task nodes can improve execution efficiency because they are independent and can be executed at the same time. For dependent task nodes, they must be executed in the order of their dependencies to ensure that the predecessor tasks of each task have been completed.

[0062] This embodiment is applied to a task processing system under a task processing framework, decomposes a preset target task into at least two subtasks, creates a task node for each subtask, maps the task node to a node set of a preset directed acyclic graph, and obtains a task graph, wherein the directed acyclic graph includes a node set for representing each node in the directed acyclic graph and an edge set for representing each edge in the directed acyclic graph, which helps to intuitively display the task decomposition and facilitates project management and progress tracking; the edge set of the task graph is updated according to the dependency relationship between each task node to obtain a task dependency graph, which not only accurately describes the data dependency relationship between tasks, but also ensures the execution of tasks. Reasonableness of the order; perform topological sorting on all task nodes in the task dependency graph, and determine the execution order of independent task nodes and dependent task nodes based on the topological sorting results. This achieves clear data dependency management, effectively plans the execution order of each subtask, and optimizes task decomposition and dependency management, thereby improving work efficiency. If there are multiple independent task nodes, execute the subtasks corresponding to multiple independent task nodes in parallel, and execute all dependent subtasks in sequence according to the execution order. This not only effectively achieves parallel processing and improves resource utilization, but also ensures the consistency and accuracy of task execution.

[0063] In a feasible implementation manner, the steps before step S30 may include steps T10 to T20:

[0064] Step T10, topologically sort the task dependency graph to detect whether there is a circular dependency;

[0065] It should be noted that topological sorting is the process of linearly sorting the nodes in a directed acyclic graph (DAG) so that for each directed edge (u, v), node u appears before node v in the sort. This sorting reflects the execution order between tasks. In a task dependency graph, if there is a loop consisting of one or more nodes, such that each node in the loop depends on another node in the loop, then there is a circular dependency between these tasks. Circular dependencies will make it impossible to determine the execution order of tasks, so they are not allowed.

[0066] First, apply a topological sorting algorithm (such as a variant of the Kahn algorithm, depth-first search DFS, or breadth-first search BFS) to sort the task nodes in the graph and check whether the task dependency graph is a directed acyclic graph (DAG). The premise of topological sorting is that the graph is a DAG, that is, there is no circular dependency. During the topological sorting process, if it is found that the sorting cannot be continued (that is, there are nodes whose order cannot be determined), it means that there is a circular dependency in the graph. Circular dependency destroys the premise of topological sorting and makes it impossible to obtain a valid linear execution sequence. If there is a circular dependency in the graph, the topological sorting algorithm will fail or output an error message. The system will output the error message generated by the topological sorting algorithm to the user.

[0067] Step T20: If there is a circular dependency, decompose the subtask in the circular dependency into multiple small tasks, determine the dependency relationship between the small tasks, and regenerate the task dependency graph.

[0068] For detected circular dependencies, analyze the subtasks and try to decompose them into smaller, more independent tasks. The decomposition process can be manual or automatic according to the system's preset algorithm. There should no longer be circular dependencies between these smaller tasks. Based on the decomposed small tasks, redefine the dependencies between them. Then, use these new tasks and dependencies to regenerate the task dependency graph and obtain a new task dependency graph that reflects the dependencies and execution order between the decomposed small tasks.

[0069] This embodiment solves the problem of circular dependencies in the task dependency graph. The circular dependencies are detected by topological sorting, and the circular dependencies are broken by decomposing the tasks, and finally a valid task dependency graph is regenerated. This helps to ensure that the tasks can be executed in the correct order, thereby improving the efficiency and reliability of task execution.

[0070] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction, and will not be repeated in the following. Figure 2 The step S20 further includes steps A10 to A20:

[0071] Step A10, determining that any two different task nodes among the task nodes are respectively the first task node and the second task node;

[0072] It should be noted that the task node is a representation of a specific task or subtask in the graph structure and is a basic element of the task graph. The first task node is selected in the task node set to analyze the data transmission relationship between it and other task nodes. It is relative, that is, it is used as the starting point of analysis in this step. The second task node corresponds to the first task node and is another task node selected to analyze the data transmission relationship between it and the first task node.

[0073] In the task node set, any two different task nodes are selected as the first task node and the second task node. This is a relative selection process because the subsequent analysis will be based on the relationship between the two nodes.

[0074] Step A20, if there is a data transmission relationship between the subtask corresponding to the first task node and the subtask corresponding to the second task node, and the data transmission relationship is that the output data of the subtask corresponding to the first task node is the input data of the subtask corresponding to the second task node, then a first edge from the first task node to the second task node is generated in the task graph, and the first edge is updated to the edge set of the task graph, and the task graph including the first edge is used as the task dependency graph.

[0075] It should be noted that the data transmission relationship is the association of data flow between task nodes, that is, the output data of one task node becomes the input data of another task node. Output data is the data result generated after a task node completes its task. Input data is the data required before a task node starts to execute a task. The first edge is an edge in the task graph that represents the data transmission relationship between the first task node and the second task node. It is directional and points from the first task node to the second task node. The task dependency graph is a graph obtained by adding edges representing the data transmission relationship between task nodes to the task graph, which is used to more accurately represent the dependencies and execution order between tasks.

[0076] Check whether there is a data transfer relationship between the subtask corresponding to the first task node and the subtask corresponding to the second task node. Specifically, it is to determine whether the output data of the first task node is the input data of the second task node. The data transfer relationship is an important manifestation of the dependency between tasks. If the output data of one task is the input data of another task, then there is a sequential relationship between the two tasks, that is, the task executed first (the task that provides output data) must be completed before the task executed later (the task that uses input data). If it is determined that there is a data transfer relationship, then an edge (first edge) from the first task node to the second task node is generated in the task graph, and this edge is updated to the edge set of the task graph. In the task graph, edges are used to represent the dependency relationship between task nodes. By adding edges representing the data transfer relationship, the task graph is converted into a task dependency graph, which more accurately reflects the execution order and dependency relationship between tasks. The task graph including the newly generated first edge is used as the task dependency graph. The task dependency graph is obtained by adding edges representing the data transfer relationship between task nodes in the task graph. It provides an intuitive representation of the dependency relationship between tasks and is the basis for subsequent task scheduling and execution.

[0077] For example, suppose there are two task nodes A and B, representing the two subtasks of "data preparation" and "data analysis" respectively. If the output data of the "data preparation" task is the input data of the "data analysis" task, then according to the steps of this embodiment, we will generate an edge from A to B in the task graph and update this edge to the edge set of the task graph. In this way, we get a task dependency graph that represents the dependency relationship between "data preparation" and "data analysis". In this graph, node A must be executed before node B because node B needs the output data of node A as input.

[0078] This embodiment selects any two task nodes as the analysis starting point, checks whether there is a data transmission relationship between them, and generates corresponding edges in the task graph to update the task dependency graph. This process ensures that the task dependency graph can accurately reflect the data transmission relationship and dependency order between the task nodes. Through the task dependency graph, the execution order and mutual dependence between tasks can be clearly seen, which provides strong support for task scheduling and execution. This method improves the efficiency and accuracy of task management, helps to optimize resource allocation and reduce conflicts and waiting time in task execution.

[0079] In a feasible implementation manner, step S30 includes steps B10 to B20:

[0080] Step B10, according to the node arrangement order, determining the task nodes without predecessor task nodes among the task nodes as independent task nodes;

[0081] It should be noted that the node arrangement order is the order in which all task nodes are sorted in the task graph according to the dependencies between the task nodes. This order reflects the execution order between the task nodes. A task node without a predecessor is a task node in the task graph that has no other task node pointing to it. In other words, it does not rely on the output of other task nodes as input and can be executed independently. Task nodes without dependencies, that is, task nodes without predecessor task nodes, can be regarded as "starting point" tasks in the task graph because they do not rely on the completion of other tasks.

[0082] According to the order of node arrangement, check whether each task node has a predecessor task node. If not, mark it as an independent task node. Independent task nodes are the "starting points" in the task graph, and their execution does not depend on the completion of other tasks. Therefore, when scheduling tasks, these tasks can be scheduled for execution first.

[0083] Step B20, according to the node arrangement order, determine the task nodes with predecessor task nodes among the task nodes as dependent task nodes, and use the node arrangement order as the execution order corresponding to the dependent task nodes.

[0084] It should be noted that a predecessor task node is a task node that has at least one other task node pointing to it in the task graph. This means that it relies on the output of other task nodes as input. A dependent task node is a task node that has a predecessor task node, and their execution needs to wait for the completion of its predecessor task node. The execution order is the order in which the dependent task nodes should be executed according to the completion status of their predecessor task nodes.

[0085] Similarly, according to the node arrangement order, check whether each task node has a predecessor task node. If so, it is marked as a dependent task node, and its position in the node arrangement order is used as its execution order. The execution order of dependent task nodes is determined by the completion status of their predecessor task nodes. When scheduling tasks, it is necessary to ensure that the predecessor tasks of each task have been completed before the task can be scheduled for execution. The node arrangement order provides an intuitive way to determine the execution order of these tasks. This embodiment determines the non-dependent and dependent task nodes through the node arrangement order, and arranges the execution order accordingly. The non-dependent task node, as the "starting point" of the task graph, can be executed first, which improves the flexibility of task scheduling. At the same time, the execution order of dependent task nodes is determined based on the completion status of their predecessor task nodes, ensuring the correctness and efficiency of task execution. This method reduces the waiting time between tasks, optimizes resource allocation, and improves the efficiency and accuracy of overall task management.

[0086] In one possible implementation, refer to Figure 3The steps of step S40 include steps C10 to C40:

[0087] Step C10, for each dependent subtask, detecting the execution status of the dependent subtask;

[0088] Step C20, when the execution status is completed, judging whether the next subtask of the dependent subtask can be executed normally according to the execution order;

[0089] It should be noted that dependent subtasks are subtasks that need to wait for other subtasks to complete and obtain their output data as input data in the task execution process. There is a dependency relationship between such subtasks. The execution status describes whether the subtask is currently being executed, has been executed, or has not yet started.

[0090] For each dependent subtask in the task flow, the system or program will periodically check its execution status. When a dependent subtask is completed, the system will determine whether its next subtask (i.e., the subtask that depends on the output of this subtask) can be executed normally based on the execution order. The dependencies between tasks determine their execution order. The completion of a subtask may trigger the start of the next subtask. However, if the next subtask cannot be executed for some reason (such as insufficient resources, preconditions not met, etc.), corresponding measures need to be taken.

[0091] Step C30, if the next subtask can be executed normally, the output data of the dependent subtask is passed to the next subtask;

[0092] Step C40: If the next subtask cannot be executed normally, the transmission path of the output data of the dependent subtask is adjusted through the task dependency graph.

[0093] It should be noted that the transmission path is the route for data to be transmitted between tasks, that is, the data flow path from the output of one task (or subtask) to the input of another task (or subtask).

[0094] If the next subtask can be executed normally, the system will pass the output data of the completed subtask to the subtask as input data. If the next subtask cannot be executed normally, the system will adjust the transmission path of the output data of the completed subtask through the task dependency graph. For example, the data can be passed to other subtasks that can be executed immediately, or the data can be temporarily stored and passed on after the conditions are met.

[0095] Through this embodiment, the system can flexibly handle the dependencies and abnormal situations between tasks, ensuring the smooth progress of the task process and the correct transmission of data.

[0096] Based on the first or second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first or second embodiment can be referred to the above description, and will not be described in detail later. Step S50 also includes steps D10 to D20:

[0097] Step D10, determining a first terminal device whose operating status is greater than a preset status threshold among the preset multiple terminal devices, and allocating all independent subtasks to different first terminal devices for execution in parallel, and updating the operating status of the first terminal device when the first terminal device executes the independent subtask;

[0098] It should be noted that terminal devices refer to devices that participate in task execution, such as computers, servers, etc., which can receive and execute assigned tasks. The operating status is one or more indicators that describe the current workload, processing power or resource usage of the terminal device. The preset status threshold is the critical value of one or more states used to determine whether the terminal device is suitable for executing a new task.

[0099] First, the system checks all preset terminal devices, compares their operating status with the preset status threshold, and selects the terminal devices whose operating status is greater than the threshold as the first terminal devices. Then, the system distributes all independent subtasks to these first terminal devices in parallel for execution. During the execution process, the system updates the operating status of these terminal devices in real time. By screening terminal devices with good operating status, it can ensure that independent subtasks can be executed efficiently in parallel. At the same time, real-time updating of the operating status helps the system dynamically adjust task allocation to adapt to changes in terminal devices.

[0100] Step D20, if there are dependent subtasks, the node weights, edge weights and running status of the task dependency graph are determined and input into the preset cost calculation function for calculation to obtain the total cost, and a task allocation plan is constructed with the goal of minimizing the total cost. In accordance with the execution order, the terminal devices assigned by the task allocation plan are called in sequence to execute the dependent subtasks.

[0101] It should be noted that the node weight is a numerical value that represents the importance of a subtask or the amount of computation in the task dependency graph. The edge weight is a numerical value that represents the strength of the dependency relationship between subtasks or the amount of data transmission in the task dependency graph. The cost calculation function is a function used to calculate the total cost required to execute a task, which is determined based on the node weight, edge weight, and terminal device operating status. The task allocation plan is a plan that determines how to allocate subtasks to different terminal devices based on the result of the cost calculation function.

[0102] When there are dependent subtasks, the system will input this information into the preset cost calculation function based on the node weights, edge weights, and current terminal device operating status of the task dependency graph. The cost calculation function will comprehensively consider these factors and calculate the total cost required to execute all subtasks. Then, the system builds a task allocation plan with the goal of minimizing the total cost. Finally, the system calls the terminal devices assigned by the task allocation plan in turn according to the execution order to execute the dependent subtasks. Through the cost calculation function, the system can comprehensively consider the importance of the task, the strength of the dependency, and the operating status of the terminal device to formulate the optimal task allocation plan. With the goal of minimizing the total cost, it can ensure that the task is completed in the shortest possible time at the lowest cost. At the same time, executing tasks in sequence according to the execution order can ensure that the dependencies between tasks are properly maintained.

[0103] This embodiment improves the efficiency of task execution by selecting terminal devices with good operating status to execute non-dependent subtasks in parallel. For dependent subtasks, the system comprehensively considers the node weights, edge weights and terminal device operating status of the task dependency graph, formulates the optimal task allocation plan through the cost calculation function, and schedules the terminal devices to execute in the execution order, ensuring the efficient and low-cost completion of the task, while maintaining the correct dependency relationship between tasks.

[0104] In a feasible implementation manner, step S20 includes steps E10 to E20:

[0105] Step E10, determining the node weight of each task node in the task dependency graph according to the task requirements of each task node, wherein the task requirements include the computing requirements, task priority and resource requirements of the task node, and wherein the node weight is positively correlated with the task requirements;

[0106] It should be noted that the larger the node weight, the higher the task demand of the task node. Task demand refers to the conditions or requirements that the task node needs to meet during execution, including computing demand, task priority and resource demand. Computing demand refers to the computing power or processing time required to perform the task. Task priority refers to the importance or urgency of the task in the overall task process. Resource demand refers to the memory, storage space, network bandwidth and other resources required to perform the task.

[0107] For each task node in the task dependency graph, its node weight is determined according to its task requirements (including computing requirements, task priority and resource requirements). Its node weight can be calculated by weighted average. First, determine the indicators of task requirements: computing requirements (such as CPU usage, memory usage, etc.) can be evaluated by simulation operation or historical data. Task priority can be set according to the importance or urgency of the task, usually expressed in numbers or levels. Resource requirements (such as storage space, network bandwidth, etc.) can also be evaluated by simulation operation or historical data. Then, each indicator of task requirements is standardized so that its value is between 0 and 1 (or other appropriate ranges). This helps to eliminate the dimensional differences between different indicators. Finally, according to the indicators of task requirements, the comprehensive score of each task node is calculated. This can be achieved by weighted summation, weighted average or other appropriate comprehensive evaluation methods. Further, a reasonable weight can be assigned to each indicator according to the actual application scenario and specific requirements. The weight allocation should reflect the importance of each indicator in the task requirements. The comprehensive score is used as the node weight of the task node. The larger the node weight, the higher the task requirement of the task node.

[0108] Step E20, determining the edge weight of each edge in the edge set of the task dependency graph according to the data transmission complexity between the task nodes, wherein the edge weight is positively correlated with the data transmission complexity.

[0109] It should be noted that the larger the edge weight, the more complex the data transmission. Data transmission complexity refers to a comprehensive indicator that measures factors such as the amount of processing required, transmission speed, or potential delay when data is transmitted between task nodes.

[0110] Similarly, the weighted average method can be used to calculate the edge weight. First, determine the various indicators of data transmission complexity: obtain the indicator value based on the amount of data transmitted, the data transmission rate, and the amount of processing required for data during transmission (such as encryption, decompression, etc.). For each indicator, standardization is also performed so that its value is between 0 and 1 (or other appropriate ranges). According to the various indicators of data transmission complexity, calculate the comprehensive score of each edge. This can also be achieved through weighted summation, weighted average or other appropriate comprehensive evaluation methods. Assign reasonable weights to each indicator to reflect their importance in data transmission complexity. Use the comprehensive score as the edge weight of the edge in the task dependency graph. The larger the edge weight, the more complex the data transmission.

[0111] For example, suppose we have a simple task dependency graph, including two task nodes A and B, and an edge AB. Task node A: computing demand: 0.6 (normalized value), task priority: 0.8 (high priority), resource demand: 0.5 (normalized value), assuming the weight distribution is: computing demand 0.4, task priority 0.3, resource demand 0.3, comprehensive score = 0.6*0.4+0.8*0.3+0.5*0.3=0.69 (as node weight), task node B (calculated similarly) obtains a comprehensive score = 0.79 (as node weight), edge AB: data volume: 0.7 (normalized value), transmission speed: 0.4 (slower rate), processing complexity: 0.6 (medium processing volume), assuming the weight distribution is: data volume 0.5, transmission speed 0.3, processing complexity 0.2, comprehensive score = 0.70.5+0.40.3+0.6*0.2=0.59 (as edge weight).

[0112] This embodiment comprehensively considers the task requirements (including computing requirements, task priority and resource requirements) of the task nodes to determine the node weights, and sets the edge weights according to the complexity of data transmission between the task nodes, ensuring that the task dependency graph can accurately reflect the actual situation of the task. By reasonably setting the weights of nodes and edges, this method can more accurately evaluate the importance and execution difficulty of tasks, provide strong support for subsequent task scheduling and resource allocation, and help improve the efficiency and effectiveness of overall task execution.

[0113] In a feasible implementation, the task management method based on the graph structure further includes steps F10 to F20:

[0114] Step F10, for each terminal device, detecting the operating status of the terminal device;

[0115] Step F20, when an update of the running status is detected, the task dependency graph is updated according to the updated running status and the execution status of the subtasks using a dynamic graph algorithm based on the shortest path and topological sorting, and according to the updated task dependency graph, the step of determining the execution order of each subtask according to the task dependency graph is executed.

[0116] It should be noted that in the graph structure, the path with the smallest weight among all the paths from the starting point to the end point is called the shortest path. In the task dependency graph, the shortest path may represent the optimal order of data transmission or task execution. The dynamic graph algorithm is an algorithm that can update and process the graph structure in real time when the graph structure is constantly changing. In this embodiment, it is used to process the dynamic changes of the task dependency graph.

[0117] For each terminal device, its operating status information is collected regularly or in real time, including CPU usage, memory usage, network status, etc. When changes are detected in these status indicators (such as a sudden increase in CPU usage, an increase in memory usage, etc.), or when the execution status of a subtask changes (such as task completion, task failure, etc.), the system will trigger the process of recalculating the task dependency graph. After triggering the recalculation process, the system will obtain the execution status of all current subtasks, including which subtasks have been started, which are being executed, and which have been completed. According to the current system operation status and the execution status of the subtasks, the system will use a dynamic graph algorithm based on the shortest path and topological sorting to recalculate the task dependency graph. In this process, the system will consider the dependencies between tasks, the current resource status of the system (such as CPU, memory, etc.), and the execution status of the subtasks to find an optimal task execution order and data transmission path. The shortest path algorithm is used to find the optimal path for data transmission or task execution, while the topological sorting ensures that tasks are executed in the correct order. After recalculating the new task dependency graph, the system will reallocate the subtasks according to this new graph structure. This may include migrating certain subtasks from one processor or device to another, or adjusting the execution order of subtasks, etc. The purpose of reallocation is to optimize the overall efficiency of task execution, reduce resource competition, and improve system throughput and response time.

[0118] Through this embodiment, the system can adjust the task dependency graph according to the running status and the execution status of the subtasks in real time, thereby optimizing the overall efficiency of task execution.

[0119] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the graph-based task management method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0120] This application also provides a task management system based on a graph structure, please refer to Figure 4 ,The task management system based on graph structure includes:

[0121] A task decomposition module 10 based on a graph structure is used to decompose a preset target task into at least two subtasks, create a task node for each subtask, and map the task node to a node set of a preset directed acyclic graph to obtain a task graph, wherein the directed acyclic graph includes a node set for representing each node in the directed acyclic graph and an edge set for representing each edge in the directed acyclic graph;

[0122] A task dependency graph generation module 20 is used to update the edge set of the task graph according to the dependency relationship between each task node to obtain the task dependency graph;

[0123] The task scheduling module 30 is used to topologically sort all task nodes in the task dependency graph, and determine the execution order of independent task nodes and dependent task nodes according to the topological sorting result;

[0124] The task allocation module 40 is used to execute subtasks corresponding to multiple independent task nodes in parallel if there are multiple independent task nodes, and to execute all dependent subtasks in sequence according to the execution order.

[0125] The graph-based task management system provided by the present application, in addition to the above-mentioned graph-based task disassembly module, task dependency graph generation module, task scheduling module and task allocation module, also includes a task graph structure definition module for defining a directed acyclic graph, a data flow management module for managing data transmission between subtasks and a graph structure dynamic update module for dynamically updating the task dependency graph during task execution. The use of the graph-based task management method in the above-mentioned embodiment can improve the processing efficiency of the task processing framework for complex tasks. Compared with the prior art, the beneficial effects of the graph-based task management system provided by the present application are the same as the beneficial effects of the graph-based task management method provided in the above-mentioned embodiment, and other technical features in the graph-based task management system are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0126] The present application provides a task management device based on a graph structure, and the task management device based on a graph structure includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the task management method based on the graph structure in the above-mentioned embodiment one.

[0127] Reference below Figure 5 , which shows a schematic diagram of a graph-based task management device suitable for implementing an embodiment of the present application. The graph-based task management device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The graph-structure-based task management device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0128] like Figure 5 As shown, the task management device based on the graph structure may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the task management device based on the graph structure are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 may allow the graph-based task management device to communicate with other devices wirelessly or by wire to exchange data. Although the graph-based task management device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.

[0129] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0130] The graph-based task management device provided by the present application adopts the graph-based task management method in the above embodiment, which can improve the processing efficiency of the task processing framework for complex tasks. Compared with the prior art, the beneficial effects of the graph-based task management device provided by the present application are the same as the beneficial effects of the graph-based task management method provided in the above embodiment, and the other technical features of the graph-based task management device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0131] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0132] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0133] The present application provides a medium, which is a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the graph-structure-based task management method in the above-mentioned embodiment.

[0134] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0135] The computer-readable storage medium may be included in the task management device based on the graph structure; or may exist independently without being assembled into the task management device based on the graph structure.

[0136] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the task management device based on the graph structure, the task management device based on the graph structure:

[0137] Decomposing a preset target task into at least two subtasks, creating a task node for each subtask, and mapping the task node to a node set of a preset directed acyclic graph to obtain a task graph, wherein the directed acyclic graph includes a node set for representing each node in the directed acyclic graph and an edge set for representing each edge in the directed acyclic graph;

[0138] Update the edge set of the task graph according to the dependency relationship between each task node to obtain the task dependency graph;

[0139] Perform topological sorting on all task nodes in the task dependency graph, and determine the execution order of task nodes without dependencies and task nodes with dependencies based on the topological sorting results;

[0140] If there are multiple independent task nodes, the subtasks corresponding to the multiple independent task nodes are executed in parallel, and all dependent subtasks are executed in sequence according to the execution order.

[0141] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0142] The flow chart and block diagram in the accompanying drawings illustrate the possible implementation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0143] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0144] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned graph-based task management method, and can improve the processing efficiency of the task processing framework for complex tasks. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the graph-based task management method provided by the above-mentioned embodiment, and will not be repeated here.

[0145] The present application also provides a product, which is a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned graph-based task management method are implemented.

[0146] The computer program product provided by the present application can improve the processing efficiency of the task processing framework for complex tasks. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the task management method based on the graph structure provided by the above embodiment, which will not be repeated here.

[0147] The above are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A task management method based on a graph structure, characterized in that: The task management method based on graph structure includes: Decomposing a preset target task into at least two subtasks, creating a task node for each of the subtasks, and mapping the task node to a node set of a preset directed acyclic graph to obtain a task graph, wherein the directed acyclic graph includes a node set for representing each node in the directed acyclic graph and an edge set for representing each edge in the directed acyclic graph; Update the edge set of the task graph according to the dependency relationship between each of the task nodes to obtain a task dependency graph; Topologically sorting all task nodes in the task dependency graph, and determining the execution order of independent task nodes and dependent task nodes according to the topological sorting result; If there are multiple independent task nodes, the subtasks corresponding to the multiple independent task nodes are executed in parallel, and all the dependent subtasks are executed in sequence according to the execution order.

2. The graph-based task management method according to claim 1, characterized in that: The dependency relationship between each of the task nodes includes the data transmission relationship between the task nodes and the subtasks. The step of updating the edge set of the task graph according to the dependency relationship between each of the task nodes to obtain the task dependency graph includes: Determine that any two different task nodes among the task nodes are respectively a first task node and a second task node; If there is a data transmission relationship between the subtask corresponding to the first task node and the subtask corresponding to the second task node, and the data transmission relationship is that the output data of the subtask corresponding to the first task node is the input data of the subtask corresponding to the second task node, then a first edge from the first task node to the second task node is generated in the task graph, and the first edge is updated to the edge set of the task graph, and the task graph including the first edge is used as the task dependency graph.

3. The graph-based task management method according to claim 1, characterized in that: The topological sorting result includes the node arrangement order of each of the task nodes, and the step of determining the execution order of the independent task nodes and the dependent task nodes according to the topological sorting result includes: According to the node arrangement order, determining a task node without a predecessor task node among the task nodes as a task node without dependency; According to the node arrangement order, task nodes having predecessor task nodes among the task nodes are determined as dependent task nodes, and the node arrangement order is used as the execution order corresponding to the dependent task nodes.

4. The task management method based on graph structure according to claim 1, characterized in that: The step of sequentially executing all the dependent subtasks in the execution order includes: For each of the dependent subtasks, detecting the execution status of the dependent subtask; When the execution status is execution completed, judging whether the next subtask of the dependent subtask can be executed normally according to the execution order; If the next subtask can be executed normally, the output data of the dependent subtask is passed to the next subtask; If the next subtask cannot be executed normally, the transmission path of the output data of the dependent subtask is adjusted through the task dependency graph.

5. The graph-based task management method according to claim 1, characterized in that: The step of executing the subtasks corresponding to the plurality of independent task nodes in parallel and executing all the dependent subtasks in sequence according to the execution order includes: Determine a first terminal device whose operating state is greater than a preset state threshold among the preset multiple terminal devices, and distribute all the independent subtasks to different first terminal devices for execution in parallel, and update the operating state of the first terminal device when the first terminal device executes the independent subtask; If there are dependent subtasks, the node weights, edge weights and running status of the task dependency graph are input into a preset cost calculation function for calculation to obtain the total cost, and a task allocation plan is constructed with the goal of minimizing the total cost. In accordance with the execution order, the terminal devices assigned by the task allocation plan are called in sequence to execute the dependent subtasks.

6. The graph-based task management method according to claim 5, characterized in that: The step of obtaining the task dependency graph includes: Determining a node weight of each task node in the task dependency graph according to a task requirement of each task node, wherein the task requirement includes a computing requirement, a task priority, and a resource requirement of the task node, and wherein the node weight is positively correlated with the task requirement; The edge weight of each edge in the edge set of the task dependency graph is determined according to the data transmission complexity between the task nodes, wherein the edge weight is positively correlated with the data transmission complexity.

7. The task management method based on graph structure according to claim 5, characterized in that: The task management method based on the graph structure also includes: For each of the terminal devices, detecting the operating status of the terminal device; When the running status update is detected, the task dependency graph is updated according to the updated running status and the execution status of the subtasks using a dynamic graph algorithm based on the shortest path and topological sorting, and the step of determining the execution order of each subtask according to the task dependency graph is performed according to the updated task dependency graph.

8. A task management system based on a graph structure, characterized in that: The task management system based on graph structure includes: A task decomposition module based on a graph structure, used to decompose a preset target task into at least two subtasks, create a task node for each of the subtasks, and map the task node to a node set of a preset directed acyclic graph to obtain a task graph, wherein the directed acyclic graph includes a node set for representing each node in the directed acyclic graph and an edge set for representing each edge in the directed acyclic graph; A task dependency graph generation module is used to update the edge set of the task graph according to the dependency relationship between each of the task nodes to obtain a task dependency graph; A task scheduling module, used to topologically sort all task nodes in the task dependency graph, and determine the execution order of independent task nodes and dependent task nodes according to the topological sorting result; The task allocation module is used to execute the subtasks corresponding to the multiple independent task nodes in parallel if there are multiple independent task nodes, and to execute all the dependent subtasks in sequence according to the execution order.

9. A task management device based on a graph structure, characterized in that: The graph-structure-based task management device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the graph-structure-based task management method as described in any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the graph-structure-based task management method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Operator arrangement method and device for spatio-temporal data analysis and calculation and storage medium

    CN119938283A

  • Medical data analysis system and method based on homomorphic encryption technology

    CN120197198A

  • Medical Data Analysis System and Method Based on Homomorphic Encryption Technology

    CN120197198B

  • Service-based calculation task dynamic abstraction method and system

    CN120386602A

  • Intelligent agent arrangement and task scheduling method and device based on DCG

    CN120492111A