Task scheduling method and system for distributed computing

By using an asynchronous, decentralized task scheduling framework and a Directed Acyclic Graph (DAG) for task dependency management, the allocation of subtasks is dynamically adjusted, solving the single-point bottleneck and task dependency problems of traditional scheduling systems, and achieving efficient and reliable task scheduling in distributed computing systems.

CN121957797APending Publication Date: 2026-05-01HEFEI SUMICROELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HEFEI SUMICROELECTRONICS TECH CO LTD
Filing Date
2025-11-26
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Traditional task scheduling systems suffer from single-point bottlenecks, difficulty in managing inter-task dependencies, and poor adaptability to distributed environments, resulting in low system scheduling efficiency and poor reliability.

Method used

An asynchronous, decentralized task scheduling framework is adopted. Through the task dependency graph DAG management mechanism, the subtask allocation strategy is dynamically adjusted. Combined with the load balancing of GPU, NPU and CPU servers, the data flow between tasks is optimized and parallel task scheduling is achieved.

Benefits of technology

It improves the efficiency and reliability of parallel task scheduling in distributed computing systems, solves single-point bottleneck and task dependency management problems, and enhances the overall performance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121957797A_ABST
    Figure CN121957797A_ABST
Patent Text Reader

Abstract

The invention relates to a task scheduling method and system for distributed computing, and the method comprises the steps: obtaining a task request, decomposing the task request into a plurality of subtasks, generating a task dependency graph DAG according to the dependency relationship between different subtasks, and determining the execution sequence and parallelism of each subtask according to the task dependency graph DAG; according to the execution sequence of each sub-task, distributing the sub-tasks to each computing node; real-time loads of the computing nodes are obtained, whether the computing nodes are balanced or not is judged according to the loads, if the computing nodes are balanced, the computing nodes are not processed, and if the computing nodes are unbalanced, the subtask allocation strategy is dynamically adjusted. The parallel task scheduling efficiency and reliability can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

A task scheduling method and system for distributed computing Technical Field

[0001] This invention relates to the field of distributed computing technology, and in particular to a task scheduling method and system for distributed computing. Background Technology

[0002] The Central Processing Unit (CPU) is capable of handling complex computational tasks, while the Graphics Processing Unit (GPU), due to its powerful parallel computing capabilities, has become the mainstay for artificial intelligence training and inference, as well as scientific computing. With the continuous development of neural networks, the Neural Processing Unit (NPU) has emerged. It is a chip specifically designed for neural network operations, and it is faster and more efficient than the GPU when performing AI tasks. Both GPUs and NPUs can effectively improve the scheduling efficiency and reliability of distributed computing systems in distributed computing environments.

[0003] In distributed computing and high-performance computing scenarios, task scheduling for the Central Processing Unit (CPU), Graphics Processing Unit (GPU), and Neural Processing Unit (NPU) is crucial to system throughput and computational efficiency. However, traditional task scheduling systems suffer from the following problems: 1. Single point of failure: Traditional centralized task scheduling systems have a single point of failure problem. When the number of tasks surges or the central node fails, it can lead to scheduling delays or system crashes.

[0004] 2. Difficulty in managing inter-task dependencies: For task chains with data dependencies, existing scheduling systems lack optimization when decomposing and executing tasks, which can easily lead to resource waste.

[0005] 3. Poor adaptability to distributed environments: Existing scheduling systems have difficulty efficiently coordinating task allocation and execution among multiple nodes, affecting the overall performance of distributed computing.

[0006] Therefore, an asynchronous, decentralized task scheduling framework is needed to improve the efficiency and reliability of parallel task scheduling in the system. Summary of the Invention

[0007] Therefore, the technical problem to be solved by the present invention is to overcome the problems of low task scheduling efficiency and poor reliability of existing technologies that use central processing units (CPU), graphics processing units (GPU) or neural processing units (NPU).

[0008] To address the aforementioned technical problems, this invention provides a task scheduling method for distributed computing, comprising: Step S1: acquiring a task request, decomposing the task request into multiple subtasks, generating a task dependency graph (DAG) based on the dependencies between different subtasks, and determining the execution order and parallelism of each subtask based on the task dependency graph (DAG); Step S2: allocating the subtasks to various computing nodes according to the execution order of each subtask, wherein the computing nodes are servers equipped with a graphics processing unit (GPU), a neural processing unit (NPU), or a central processing unit (CPU); Step S3: acquiring the real-time load of the computing nodes, determining whether the computing nodes are balanced based on the load, and if the computing nodes are balanced, not processing the computing nodes; if the computing nodes are unbalanced, dynamically adjusting the subtask allocation strategy.

[0009] In one embodiment of the present invention, the method for obtaining a task request and decomposing the task request into multiple sub-tasks in step S1 includes: decomposing the task request into multiple sub-tasks, as follows: ;in, For a set of subtasks, Subtasks are defined as subtasks; each subtask is described as a 5-tuple, represented as: ;in, This refers to the computational operation type for the subtask. For the input data set, To output the data set, To determine whether the resource type required to execute this subtask is GPU or NPU, Additional information such as priority and time prediction required for scheduling.

[0010] In one embodiment of the present invention, the method of generating a task dependency graph (DAG) based on the dependency relationship between different subtasks in step S1 includes: for any two subtasks If the following conditions are met: ;in, For subtasks The output, For subtasks Input, An empty set, i.e., a subtask Subtasks are required The output data indicates the subtask and A dependency relationship exists, represented as: ; and subtasks and Establish directed edges between them Based on subtask set The task dependency graph (DAG) is constructed using directed edges between different subtasks, and is represented as follows: ;in, For a set of subtasks, The directed edges formed by the above dependencies gather, It is an acyclic task dependency graph.

[0011] In one embodiment of the present invention, the method for determining the execution order and parallelism of each subtask based on the task dependency graph DAG in step S1 includes: determining the execution order of each subtask in the task dependency graph DAG using the Kahn algorithm to obtain a topological sequence: ;in, A topological sequence that determines the execution order of subtasks in a dependent graph DAG. For the first Each executed subtask The sorting number is the original execution order set; during the topological sorting process of Kahn's algorithm, if the... The in-degree of each subtask in the layer is 0, indicating that the first... The subtasks within a layer are independent of each other and can be executed in parallel, as shown below: ;in, Indicates the first A set of layered subtasks, including subtasks Subtask Simultaneous scheduling is possible.

[0012] In one embodiment of the present invention, each subtask further includes a data readiness check before execution, specifically: each subtask A subtask can only proceed when the output data of all its predecessor nodes in the task dependency graph (DAG) is in place. Only when the executable state is reached can the following conditions be met: ;in, This is the set of subtasks corresponding to the predecessor node. For computing nodes state, To complete the execution of the subtask.

[0013] In one embodiment of the present invention, step S3, obtaining the real-time load of the computing nodes and determining whether the computing nodes are balanced based on the load, includes: constructing a comprehensive load index for each computing node. : ;in, To calculate node utilization, For video memory / memory usage, The length of the task queue. The first, second, and third weighting factors are used; the comprehensive load index of all computing nodes is collected at fixed intervals. If the computed nodes satisfy: This indicates that the computing node is overloaded. The overload threshold for computing nodes; if the computing node satisfies: This indicates that the computing node is idle, where, To calculate the node idle threshold.

[0014] In one embodiment of the present invention, the method for dynamically adjusting the subtask allocation strategy in step S3 if the computing nodes are unbalanced includes: when an imbalance of computing nodes is detected, including computing node overload and computing node overload idle, then: selecting several nodes from the overloaded computing nodes according to preset conditions to pause tasks, and simultaneously selecting several target nodes from the idle computing nodes to execute the subtasks corresponding to the computing nodes whose tasks have been paused, wherein selecting several nodes from the overloaded computing nodes according to preset conditions to pause tasks includes: avoiding migrating high data dependency tasks from the overloaded computing nodes, and defining the high data dependency tasks as: ;in, For subtasks The predecessor node corresponds to the set of subtasks. The size of the output data for the subtask corresponding to the predecessor node; if satisfied It is not recommended to migrate this subtask. Otherwise, it is recommended to migrate the subtask. ; The threshold for data dependency strength; the step of simultaneously selecting several target nodes from idle computing nodes to execute the subtasks corresponding to the computing nodes whose tasks are paused includes: comprehensive load indicators. The lowest-cost computing node; the communication cost between the computing node where the task to be migrated resides and the target computing node is minimized, wherein the communication cost is represented by network distance and is defined as: ;in, Two computing nodes and Network distance between them Two computing nodes and Communication delay between them For available bandwidth, The bandwidth influence weighting factor; matching the CPU, GPU, or NPU resources of the subtasks corresponding to idle compute nodes and compute nodes executing paused tasks.

[0015] To address the aforementioned technical problems, this invention provides a task scheduling system for distributed computing, comprising: a generation module for acquiring task requests, decomposing the task requests into multiple subtasks, generating a task dependency graph (DAG) based on the dependencies between different subtasks, and determining the execution order and parallelism of each subtask based on the task dependency graph (DAG); an allocation module for allocating subtasks to various computing nodes according to the execution order of each subtask, wherein the computing nodes are servers equipped with a graphics processing unit (GPU), a neural processing unit (NPU), or a central processing unit (CPU); and a scheduling module for acquiring the real-time load of the computing nodes, determining whether the computing nodes are balanced based on the load, and if the computing nodes are balanced, not processing the computing nodes; if the computing nodes are unbalanced, dynamically adjusting the subtask allocation strategy.

[0016] To address the aforementioned technical problems, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the task scheduling method for distributed computing described above.

[0017] To address the aforementioned technical problems, the present invention provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the steps of the task scheduling method for distributed computing described above.

[0018] Compared with the prior art, the above-mentioned technical solution of the present invention has the following advantages: The task scheduling method for distributed computing described in the present invention combines the task dependency graph (DAG) management mechanism to achieve decentralized task allocation and execution management, effectively optimize the data flow between tasks, and improve the parallel task scheduling efficiency and reliability of the system. Attached Figure Description

[0019] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings.

[0020] Figure 1 is a flowchart of the method of the present invention. Detailed Implementation

[0021] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention. Embodiment 1

[0022] Referring to Figure 1, the present invention relates to a task scheduling method for distributed computing, comprising: Step S1: obtaining a task request, decomposing the task request into multiple subtasks, generating a task dependency graph (DAG) based on the dependencies between different subtasks, and determining the execution order and parallelism of each subtask based on the task dependency graph (DAG); Step S2: allocating the subtasks to each computing node according to the execution order of each subtask, wherein the computing node is a server with a graphics processing unit (GPU), a neural processing unit (NPU), or a central processing unit (CPU); Step S3: obtaining the real-time load of the computing nodes, determining whether the computing nodes are balanced based on the load, and if the computing nodes are balanced, not processing the computing nodes; if the computing nodes are unbalanced, dynamically adjusting the subtask allocation strategy.

[0023] The following is a detailed description of this embodiment: (I) Task decomposition and dependency graph generation 1. Task decomposition process After receiving the computation task, the following steps are performed to decompose it into multiple executable sub-tasks: Step S101: Task parsing The input task is parsed to identify the computation logic, data input, output target and internal stage division of the task.

[0024] For example, deep learning tasks include stages such as forward computation, backpropagation, and gradient reduction.

[0025] Step S102: Task Partitioning. Based on factors such as task structure, operator boundaries, dependent data blocks, and module granularity, the task is broken down into multiple subtasks, represented as follows: ;in, For a set of subtasks, These are subtasks; each subtask is described in the form of a 5-tuple, represented as:

[0026] in, This refers to the computational operation type for the subtask. For the input data set, To output the data set, To determine whether the resource type required to execute this subtask is GPU or NPU, Additional information such as priority and time prediction required for scheduling.

[0027] Step S103: Dependency Identification for Any Two Subtasks If the following conditions are met:

[0028] in, For subtasks The output, For subtasks Input, An empty set, i.e., a subtask Subtasks are required The output data indicates the subtask and A dependency relationship exists, represented as:

[0029] and subtasks and Establish directed edges between them .

[0030] Step S104: Based on the set of subtasks A task dependency graph (DAG) is constructed using directed edges between different subtasks.

[0031] in, For a set of subtasks, The directed edges formed by the above dependencies gather, It is an acyclic task dependency graph.

[0032] DAGs require direct acyclicity, necessitating detection and further splitting or reordering to resolve potential circular dependencies.

[0033] 2. Determining the Execution Order and Parallelism of Subtasks Based on DAG: This embodiment is based on the structure of DAG and determines the execution order and parallelism of tasks through topological sorting, data readiness detection, and other methods.

[0034] Step S201: Topological Sort uses the Kahn algorithm or the DFS algorithm to determine the execution sequence of subtasks that satisfy dependencies. For example, the Kahn algorithm combined with a task dependency graph (DAG) can be used to determine the execution order of each subtask, resulting in the final topological sequence, represented as:

[0035] in, A topological sequence that determines the execution order of subtasks in a dependent graph DAG. For the first Each executed subtask The sort number of the original execution order set.

[0036] Step S202: Parallel subtask grouping. In the topological sorting process of the Kahn algorithm, if the first... The in-degree of each subtask in the layer is 0, indicating that the first... The subtasks within a layer are independent of each other and can be executed in parallel, as shown below:

[0037] in, Indicates the first A set of layered subtasks, including subtasks Subtask Simultaneous scheduling is possible.

[0038] Step S203: Each subtask also includes a data readiness check before execution. It can only enter the "executable state" when the output data of all its predecessor nodes is in place, and the conditions are:

[0039] If the conditions are met, an event is triggered (the event acts as a flag, notifying the system via asynchronous communication so that the subtask can be scheduled in a timely manner):

[0040] If the above formula is satisfied, the item is added to the scheduling queue. It's important to note that this is a runtime scheduling queue, which differs from a DAG queue.

[0041] in, This is the set of subtasks corresponding to the predecessor node. For computing nodes state, To complete the execution of the sub-task, A Boolean function to represent the data readiness flag for a subtask. If it is a Boolean value, it indicates that the data readiness conditions for this subtask have been met.

[0042] (II) Asynchronous Task Allocation and Execution 1. In this invention, "Node" refers to an entity with task execution capability in a distributed runtime system, including but not limited to: GPU node: with one or more GPUs, suitable for matrix calculation, convolution, image tasks; NPU node: used for AI inference, sparse tensor acceleration, etc.; CPU node: executes lightweight logic or scheduled tasks; Edge device node: lightweight AI acceleration device; Virtual computing power node: a dynamically scalable computing power instance provided by the cloud.

[0043] Unified representation as a set of nodes:

[0044] Each node has attributes:

[0045] in, For node computing power, The current load of the node. Type (GPU / NPU / CPU) The node's network topology location (used for data locality scheduling).

[0046] 2. Asynchronous Communication for Subtask State Changes In this embodiment, all subtask state changes are achieved through asynchronous communication. Asynchronous communication is based on the Event Stream Model, and the process is as follows: Step S301: Event Generation The node generates events at the following times, including four types: (a) Task Assigned: Event TaskAssigned(t_i, N_k) is generated; (b) Task Completed: TaskCompleted(t_i); (c) Task Failed: TaskFailed(t_i); (d) Data Ready: DataReady(out_i). The event in step S203 above refers to Data Ready; Step S302: Event Encoding Each event is encoded as:

[0047] in, For event type, For related subtasks, As the source node of the event, For data summary or status information, This is the event timestamp.

[0048] Step S303: Event Publish The event is broadcast on the message bus to all nodes that are interested in the task.

[0049] Step S304: Event Consumption. After receiving the event, other nodes: (a) update the local task state cache; (b) determine whether the dependency conditions are met; (c) if the data is ready, put the corresponding subtask into the schedulable queue. Step S305: Cross-node result synchronization. If the task generates output data: small data, it is sent directly with the event; large data, it sends a data reference, and the actual data is transmitted through a high-throughput path (such as GPUDirect or RDMA).

[0050] (III) Fault Tolerance and Dynamic Load Balancing Process (equivalent to unreasonable subtask allocation, with some computing nodes having many tasks and others having few tasks, requiring balancing) The task allocation strategy is dynamically adjusted based on the real-time load of the nodes. The process is as follows: 1. Calculate the comprehensive load index for each node. :

[0051] in, To calculate node utilization, For video memory / memory usage, The length of the task queue. These are the first, second, and third weighting factors (adjustable).

[0052] 2. Dynamic load balancing method process step S401: Periodic sampling, collecting load metrics of all nodes at fixed intervals (e.g., 100ms). .

[0053] Step S402: Load determination If the computing node satisfies:

[0054] in, A threshold for determining node overload is set, for example, 0.7 or 0.8, at which point a computing node is considered overloaded; if a computing node satisfies:

[0055] in, A threshold for determining whether a node is idle is set, such as 0.2 or 0.3, to indicate that the computing node is idle.

[0056] Step S403: Task Migration Decision When an imbalance in task execution among computing nodes is detected, the following process is executed: 1. Select a set of migrateable tasks from the overloaded computing nodes according to preset conditions, and suspend the tasks on several nodes corresponding to the migrateable tasks. The preset conditions include (the following conditions are related by AND): (a) Avoid migrating tasks with high data dependency. In this embodiment, tasks with high data dependency are defined as:

[0057] in, For subtasks The predecessor node corresponds to the set of subtasks. Output the data size (in bytes) for the subtask corresponding to the predecessor node.

[0058] If the following conditions are met: Then the subtask This task is deemed to have high data dependency; migrating this subtask is not recommended. (To avoid high latency caused by massive data movement); otherwise, it is recommended to migrate this subtask. ,in, Set as the data dependency strength threshold (which can be set based on network bandwidth and inter-node transmission overhead).

[0059] (b) Prioritize migrating lightweight tasks or tasks that have not yet started execution. 2. Select the target node from idle nodes.

[0060] The conditions for adding a compute node to the execution queue to execute the subtask corresponding to the paused task and becoming a target node include (the following conditions are ANDed): (a) Comprehensive load index (a) The lowest computing node; (b) The network distance between two computing nodes is minimized, specifically defined as follows: In this embodiment, network distance is defined as the communication cost between the computing node where the task to be migrated is located and the target computing node, which can be defined as:

[0061] in, Two computing nodes and Network distance between them Two computing nodes and Communication delay between them For available bandwidth, Bandwidth influence weighting factor; target node Must meet: This ensures that data migration and synchronization overhead is minimized. As the source node, For the traversal of the first Each node.

[0062] (c) Resource matching (matching CPU, GPU, or NPU resources of the subtasks corresponding to idle computing nodes and computing nodes executing paused tasks); Step S404: Migration Execution (a) Notify the overloaded node to pause the task via asynchronous communication; (b) Send the task context (meta) to the target node via asynchronous communication; (c) If data needs to be transferred, perform data migration (RDMA) via asynchronous communication; (d) The target node adds the task to its own execution queue; Step S405: Update the global state and synchronize the following information: (a) New task binding relationship (subtask → node); (b) Node load status; (c) Remaining task dependencies in the DAG. Example 2

[0063] This embodiment provides a task scheduling system for distributed computing, including: a generation module: used to acquire task requests, decompose the task requests into multiple subtasks, generate a task dependency graph (DAG) based on the dependencies between different subtasks, and determine the execution order and parallelism of each subtask based on the task dependency graph (DAG); an allocation module: used to allocate subtasks to various computing nodes according to the execution order of each subtask, wherein the computing nodes are servers with graphics processing units (GPUs), neural processing units (NPUs), or central processing units (CPUs); and a scheduling module: used to acquire the real-time load of the computing nodes, determine whether the computing nodes are balanced based on the load, and if the computing nodes are balanced, no processing is performed on the computing nodes; if the computing nodes are unbalanced, the subtask allocation strategy is dynamically adjusted. Embodiment Three

[0064] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the task scheduling method for distributed computing described in Embodiment 1. Embodiment 4

[0065] This embodiment provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the steps of the task scheduling method for distributed computing described in Embodiment 1.

[0066] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0067] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.

[0068] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.

[0069] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.

[0070] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0071] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.

Claims

1. A task scheduling method for distributed computing, characterized in that: include: Step S1: Obtain the task request, decompose the task request into multiple sub-tasks, generate a task dependency graph DAG based on the dependency relationship between different sub-tasks, and determine the execution order and parallelism of each sub-task based on the task dependency graph DAG. Step S2: Allocate subtasks to each computing node according to the execution order of each subtask, wherein the computing node is a server with a graphics processing unit (GPU), a neural processing unit (NPU), or a central processing unit (CPU); Step S3: Obtain the real-time load of the computing nodes, and determine whether the computing nodes are balanced based on the load. If the computing nodes are balanced, no processing is performed on the computing nodes. If the computing nodes are unbalanced, the subtask allocation strategy is dynamically adjusted.

2. The task scheduling method for distributed computing according to claim 1, characterized in that: The method for obtaining the task request and decomposing the task request into multiple sub-tasks in step S1 includes: decomposing the task request into multiple sub-tasks, as follows: ;in, For a set of subtasks, Subtasks are defined as subtasks; each subtask is described as a 5-tuple, represented as: ;in, This refers to the computational operation type for the subtask. For the input data set, To output the data set, To determine whether the resource type required to execute this subtask is GPU or NPU, Additional information such as priority and time prediction required for scheduling.

3. The task scheduling method for distributed computing according to claim 1, characterized in that: The method for generating a task dependency graph (DAG) based on the dependency relationships between different subtasks in step S1 includes: for any two subtasks 、 If the following conditions are met: ;in, For subtasks The output, For subtasks Input, An empty set, i.e., a subtask Subtasks are required The output data indicates the subtask and A dependency relationship exists, represented as: ; and subtasks and Establish directed edges between them Based on subtask set The task dependency graph (DAG) is constructed using directed edges between different subtasks, and is represented as follows: ;in, For a set of subtasks, The directed edges formed by the above dependencies gather, It is an acyclic task dependency graph.

4. The task scheduling method for distributed computing according to claim 1, characterized in that: The method for determining the execution order and parallelism of each subtask in step S1 based on the task dependency graph DAG includes: using the Kahn algorithm to determine the execution order of each subtask in the task dependency graph DAG, resulting in a topological sequence. ;in, A topological sequence that determines the execution order of subtasks in a dependent graph DAG. For the first Each executed subtask The sorting number is the original execution order set; during the topological sorting process of Kahn's algorithm, if the... The in-degree of each subtask in the layer is 0, indicating that the first... The subtasks within a layer are independent of each other and can be executed in parallel, as shown below: ;in, Indicates the first A set of layered subtasks, including subtasks Subtask Simultaneous scheduling is possible.

5. The task scheduling method for distributed computing according to claim 1, characterized in that: Each subtask also includes a data readiness check before execution, specifically: each subtask A subtask can only proceed when the output data of all its predecessor nodes in the task dependency graph (DAG) is in place. Only when the executable state is reached can the following conditions be met: ;in, This is the set of subtasks corresponding to the predecessor node. For computing nodes state, To complete the execution of the subtask.

6. The task scheduling method for distributed computing according to claim 1, characterized in that: Step S3, obtaining the real-time load of the computing nodes and determining whether the computing nodes are balanced based on the load, includes: constructing a comprehensive load index for each computing node. : ;in, To calculate node utilization, For video memory / memory usage, The length of the task queue. 、 、 The first, second, and third weighting factors are used; the comprehensive load index of all computing nodes is collected at fixed intervals. If the compute nodes satisfy: This indicates that the computing node is overloaded. The overload threshold for computing nodes; if the computing node satisfies: This indicates that the computing node is idle, where, To calculate the node idle threshold.

7. The task scheduling method for distributed computing according to claim 6, characterized in that: The method for dynamically adjusting the subtask allocation strategy in step S3 if computing nodes are unbalanced includes: when computing node imbalance is detected, including computing node overload and computing node overload idle, then: select several nodes from the overloaded computing nodes according to preset conditions to pause tasks, and simultaneously select several target nodes from the idle computing nodes to execute the subtasks corresponding to the computing nodes whose tasks have been paused. The step of selecting several nodes from the overloaded computing nodes according to preset conditions to pause tasks includes: avoiding migrating high data dependency tasks from overloaded computing nodes, whereby the high data dependency tasks are defined as: ;in, For subtasks The predecessor node corresponds to the set of subtasks. The size of the output data for the subtask corresponding to the predecessor node; if satisfied It is not recommended to migrate this subtask. Otherwise, it is recommended to migrate the subtask. ; The threshold for data dependency strength; the step of simultaneously selecting several target nodes from idle computing nodes to execute the subtasks corresponding to the computing nodes whose tasks are paused includes: comprehensive load indicators. The lowest-cost computing node; the communication cost between the computing node where the task to be migrated resides and the target computing node is minimized, wherein the communication cost is represented by network distance and is defined as: ;in, Two computing nodes and Network distance between them Two computing nodes and Communication delay between them For available bandwidth, The bandwidth influence weighting factor; matching the CPU, GPU, or NPU resources of the subtasks corresponding to idle compute nodes and compute nodes executing paused tasks.

8. A task scheduling system for distributed computing, characterized in that: include: Generation module: used to obtain task requests, decompose the task requests into multiple sub-tasks, generate a task dependency graph DAG based on the dependency relationships between different sub-tasks, and determine the execution order and parallelism of each sub-task based on the task dependency graph DAG; Allocation module: used to allocate subtasks to each computing node according to the execution order of each subtask, wherein the computing node is a server with a graphics processing unit (GPU), a neural processing unit (NPU), or a central processing unit (CPU). Scheduling module: Used to obtain the real-time load of computing nodes, determine whether the computing nodes are balanced based on the load, and if the computing nodes are balanced, no processing is performed on the computing nodes; if the computing nodes are unbalanced, the subtask allocation strategy is dynamically adjusted.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the steps of the task scheduling method for distributed computing as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the task scheduling method for distributed computing as described in any one of claims 1 to 7.