Task scheduling method, electronic equipment and storage medium

By combining and allocating multiple directed acyclic graph tasks, iteratively compute the benefit value, and determining the target scheduling scheme that minimizes task waiting and processing time, the problem of computing node selection in cloud computing is solved, and resource utilization efficiency and task execution time are improved.

CN120540807APending Publication Date: 2025-08-26JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510636328.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

In a cloud computing environment, how to accurately select the computing nodes for processing tasks to minimize the waiting and processing time of tasks, especially when resources are limited, the prior art is difficult to effectively solve.

Method used

By combining multiple directed acyclic graph tasks into one target directed acyclic graph task and multiple allocations are performed on multiple computing nodes, the benefit value of the scheduling scheme is iteratively calculated, and the target scheduling scheme with the smallest benefit value is finally determined.

Benefits of technology

It realizes accurate selection of computing nodes on the cloud computing platform, reduces the waiting and processing time of tasks, improves resource utilization efficiency, and avoids resource allocation imbalances caused by ignoring communication overhead or node heterogeneity in traditional scheduling algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120540807A_ABST
    Figure CN120540807A_ABST
Patent Text Reader

Abstract

The invention discloses a task scheduling method, electronic equipment and a storage medium, and relates to the technical field of cloud computing, on the premise that a plurality of directed acyclic graph tasks submitted at the same moment are received, the plurality of directed acyclic graph tasks are synthesized into one directed acyclic graph task to serve as a whole to determine a scheduling scheme, and meanwhile, the scheduling efficiency is improved. In the scheduling scheme determination process, a plurality of to-be-processed tasks are continuously distributed on a plurality of computing nodes, the benefit value of the scheduling process is continuously iteratively calculated, the scheduling scheme corresponding to the minimum benefit value obtained in the distribution process is determined as a target scheduling scheme, and at the moment, the scheduling time representing the target scheduling scheme is minimum. Therefore, the technical problem of how to accurately select the computing node for processing the task to minimize the waiting and processing time of the task can be solved, and the technical effect of minimizing the waiting and processing time of the task by accurately selecting the computing node for processing the task is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a task scheduling method, electronic device, and storage medium. Background Art

[0002] With the development of cloud computing, it has penetrated widely across all industries. The core concept of cloud computing is to flexibly provide computing resources to users as services over the Internet, ensuring on-demand access to resources and services anytime, anywhere. Consequently, a large number of computationally intensive and highly complex tasks have been migrated to cloud computing platforms.

[0003] Due to the huge computing requirements of the task and the strict timeliness requirements, how to accurately select the computing nodes to process the task in order to minimize the waiting and processing time of the task under limited resources is an urgent problem that needs to be solved. Summary of the Invention

[0004] The present application provides a task scheduling method, electronic device and storage medium to at least solve the problem in the related art of how to accurately select computing nodes for processing tasks to minimize the waiting and processing time of tasks.

[0005] This application provides a task scheduling method, including:

[0006] Merge multiple obtained directed acyclic graph tasks to obtain the target directed acyclic graph task;

[0007] Randomly assigning multiple pending tasks in the target directed acyclic graph task to multiple computing nodes to obtain a first scheduling scheme, and performing benefit value calculation based on the first scheduling scheme to obtain a first benefit value corresponding to the first scheduling scheme, wherein each computing node is assigned one pending task;

[0008] Based on the first scheduling scheme, the plurality of pending tasks are secondary distributed on the plurality of computing nodes to obtain a second scheduling scheme, and the benefit value is calculated based on the second scheduling scheme to obtain a second benefit value corresponding to the second scheduling scheme;

[0009] When the second benefit value is less than the first benefit value, determining the second scheduling plan as the optimized scheduling plan;

[0010] Based on the optimized scheduling scheme, multiple pending tasks are allocated three times on multiple computing nodes until the number of allocations reaches a preset threshold, and a target scheduling scheme is obtained, wherein the target scheduling scheme is the scheme with the smallest benefit value among multiple scheduling schemes obtained by allocating multiple pending tasks after the preset threshold.

[0011] The present application also provides a task scheduling device, comprising:

[0012] A merging unit, configured to merge the acquired multiple directed acyclic graph tasks to obtain a target directed acyclic graph task;

[0013] A first allocation unit is configured to randomly allocate multiple pending tasks in the target directed acyclic graph task to multiple computing nodes to obtain a first scheduling solution;

[0014] a computing unit, configured to perform benefit value calculation based on the first scheduling scheme to obtain a first benefit value corresponding to the first scheduling scheme, wherein each computing node is assigned a task to be processed;

[0015] A second allocating unit is configured to redistribute the plurality of pending tasks onto the plurality of computing nodes based on the first scheduling scheme to obtain a second scheduling scheme;

[0016] The calculation unit is further configured to perform benefit value calculation based on the second scheduling scheme to obtain a second benefit value corresponding to the second scheduling scheme;

[0017] a determining unit, configured to determine, when the second benefit value is less than the first benefit value, that the second scheduling scheme is an optimized scheduling scheme;

[0018] The processing unit is used to distribute multiple tasks to be processed three times on multiple computing nodes based on the optimized scheduling plan until the number of distributions reaches a preset number threshold, thereby obtaining a target scheduling plan, wherein the target scheduling plan is a plan with the smallest benefit value among multiple scheduling plans obtained by distributing multiple tasks to be processed after the preset number threshold.

[0019] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned task scheduling methods when executing the computer program.

[0020] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned task scheduling methods are implemented.

[0021] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned task scheduling methods when executed by a processor.

[0022] Through the task scheduling method, electronic device and storage medium of the present application, on the premise of receiving multiple directed acyclic graph tasks submitted at the same time, the multiple directed acyclic graph tasks are synthesized into a directed acyclic graph task, and the scheduling scheme is determined as a whole. At the same time, in the process of determining the scheduling scheme, multiple tasks to be processed are continuously distributed on multiple computing nodes, and the benefit value of the scheduling process is continuously iterated and calculated, and the scheduling scheme corresponding to the minimum benefit value obtained in the distribution process is determined as the target scheduling scheme. At this time, the scheduling time representing the target scheduling scheme is also the smallest. Therefore, it is possible to solve the technical problem of how to accurately select the computing nodes for processing tasks to minimize the waiting and processing time of tasks, and achieve the technical effect of minimizing the waiting and processing time of tasks by accurately selecting the computing nodes for processing tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0024] Figure 1 A flowchart of a task scheduling method provided in an embodiment of the present application;

[0025] Figure 2 A schematic diagram of a directed acyclic graph task provided in an embodiment of the present application;

[0026] Figure 3 A schematic diagram of a target directed acyclic graph task provided in an embodiment of the present application;

[0027] Figure 4 A schematic diagram of a scheduling matrix provided in an embodiment of the present application;

[0028] Figure 5 A schematic diagram of a target solution matrix provided in an embodiment of the present application;

[0029] Figure 6 A schematic diagram of a communication matrix provided in an embodiment of the present application;

[0030] Figure 7 A schematic diagram of a task hierarchy provided in an embodiment of the present application;

[0031] Figure 8 A flowchart of another task scheduling method provided in an embodiment of the present application;

[0032] Figure 9 A schematic diagram of defining role conversion provided in an embodiment of the present application;

[0033] Figure 10 A schematic diagram of escaping a local optimal solution provided in an embodiment of the present application;

[0034] Figure 11 A task scheduling device provided in an embodiment of the present application;

[0035] Figure 12 Another task scheduling device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0037] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0038] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0039] Figure 1 A flowchart of a task scheduling method provided in an embodiment of the present application is provided, and the method is described in detail in conjunction with the execution flow of the task scheduling method.

[0040] like Figure 1 As shown, the task scheduling method includes:

[0041] Step 101: merge the acquired multiple directed acyclic graph tasks to obtain a target directed acyclic graph task.

[0042] In embodiments of the present application, a single user or multiple users may submit multiple Directed Acyclic Graph (DAG) tasks simultaneously. Therefore, it is necessary to merge multiple DAG tasks into a single DAG task (i.e., the target DAG task) to more accurately determine the minimum execution time of multiple DAG tasks, thereby transforming the computational approach originally based on multiple DAG tasks into a single DAG task.

[0043] At the same time, in order to facilitate the understanding of the target directed acyclic graph task in this application, this application provides the following Figure 2 A schematic diagram of a directed acyclic graph task as shown, and Figure 3 A schematic diagram of a target directed acyclic graph task is shown, wherein the method for merging multiple directed acyclic graph tasks is: multiple independent DAG tasks are merged into a unified target DAG task (target directed acyclic graph task) through virtual task nodes and virtual communication paths.

[0044] It is further necessary to explain that Figure 3 Each small circle outside the virtual exit task and the virtual entrance task can represent a task to be processed. Furthermore, it should be noted that Figure 2 as well as Figure 3 This is only used as an example, and this application does not limit the specific number of directed acyclic graph tasks and the number of tasks to be processed.

[0045] In step 102, a plurality of pending tasks in the target directed acyclic graph task are randomly distributed on a plurality of computing nodes to obtain a first scheduling scheme, and benefit value calculation is performed based on the first scheduling scheme to obtain a first benefit value corresponding to the first scheduling scheme, wherein each computing node is assigned one pending task.

[0046] In the embodiments of the present application, a pending task refers to a specific task unit that needs to be scheduled in the target directed acyclic graph task, and each pending task needs to be assigned to a computing node. A computing node is a virtualized resource unit (such as a virtual machine or container) in the cloud computing platform that is responsible for executing tasks.

[0047] The process of generating the first scheduling solution includes but is not limited to: randomly selecting a computing node for executing each task to be processed, and recording each task to be processed and its corresponding computing node.

[0048] It should be noted that the first scheduling solution may be expressed in the form of, but not limited to, a scheduling matrix. Specifically, an embodiment of the present application provides a schematic diagram of a scheduling matrix, such as Figure 4As shown in Figure 1, the rows of the scheduling matrix represent compute nodes, and the columns represent pending tasks. The intersection of the matrix indicates whether the pending task is executed on the corresponding compute node. If the intersection value is set to 1, it means that the pending task is executed on the corresponding compute node. Different scheduling schemes correspond to different scheduling matrices.

[0049] The number of rows in the scheduling matrix is ​​the number of virtual machines n, and the number of columns is the number of tasks m. The value of each element of the matrix can be expressed by, but not limited to, formula (1):

[0050]

[0051] The benefit value is used to quantify the pros and cons of the scheduling solution. Its calculation methods include but are not limited to:

[0052] Benefit value = total task execution time + total cross-node communication time.

[0053] Among them, the total task execution time is obtained by summing the execution time of the tasks to be processed in the first scheduling scheme on their corresponding computing nodes; the total cross-node communication time is calculated based on the data transmission time between tasks in the first scheduling scheme (only included when dependent tasks are assigned to different computing nodes).

[0054] Step 103 : Based on the first scheduling scheme, the plurality of pending tasks are redistributed on the plurality of computing nodes to obtain a second scheduling scheme, and benefit value calculation is performed based on the second scheduling scheme to obtain a second benefit value corresponding to the second scheduling scheme.

[0055] In an embodiment of the present application, a second scheduling scheme may be generated through a local search strategy on the basis of the first scheduling scheme, that is, a secondary allocation may be performed based on the first scheduling scheme.

[0056] The secondary allocation process includes but is not limited to: reselecting computing nodes for some tasks to be processed near the first computing node corresponding to the first scheduling solution, and generating a new scheduling matrix, namely the second scheduling solution.

[0057] Furthermore, the vicinity of the first computing node can be determined by address information of each first computing node and preset range data (for example, other virtual machines in the same physical server or computing nodes with low resource utilization).

[0058] The benefit calculation method of the second scheduling scheme is the same as that of the first scheduling scheme. It should be noted that all scheduling schemes satisfy the dependency relationship between tasks (that is, the child tasks can only be executed after the parent task in the DAG is completed).

[0059] Step 104 : When the second benefit value is less than the first benefit value, determine the second scheduling scheme as the optimized scheduling scheme, wherein the benefit value of the scheduling scheme is proportional to the scheduling time of the scheduling scheme.

[0060] In an embodiment of the present application, a more optimal scheduling solution is determined by comparing the first benefit value and the second benefit value.

[0061] The benefit value is proportional to the scheduling time, which means that the calculation of the benefit value is directly related to the task execution time and communication time. An increase in its value means that the total execution time is extended. Therefore, a scheduling plan with a smaller benefit value should be selected as a better scheduling plan.

[0062] If the second benefit value is less than the first benefit value, it indicates that the second scheduling scheme after secondary allocation is better. In this case, the second scheduling scheme is marked as the optimized scheduling scheme.

[0063] Step 105, based on the optimized scheduling scheme, the multiple tasks to be processed are distributed three times on the multiple computing nodes until the number of distributions reaches a preset number threshold, and a target scheduling scheme is obtained, wherein the target scheduling scheme is the scheme with the smallest benefit value among the multiple scheduling schemes obtained by distributing the multiple tasks to be processed after the preset number threshold.

[0064] In the embodiment of the present application, the three allocations and subsequent iterations include but are not limited to: repeating the allocation and comparison process of steps 103 - 104 based on the optimized scheduling solution.

[0065] The preset threshold is used to avoid infinite iterations by presetting a fixed number of allocation attempts (e.g., 100). When the number of iterations reaches the threshold, the scheduling solution with the lowest efficiency is selected as the target scheduling solution. The threshold needs to be adjusted dynamically based on the task size. For example, increasing the threshold for a large number of tasks can increase the search depth.

[0066] Through the task scheduling method of the present application, on the premise of receiving multiple directed acyclic graph tasks submitted at the same time, the multiple directed acyclic graph tasks are synthesized into a directed acyclic graph task, and the scheduling scheme is determined as a whole. At the same time, in the process of determining the scheduling scheme, multiple tasks to be processed are continuously distributed on multiple computing nodes, and the benefit value of the scheduling process is continuously iterated and calculated, and the scheduling scheme corresponding to the minimum benefit value obtained in the allocation process is determined as the target scheduling scheme. At this time, the scheduling time representing the target scheduling scheme is also the smallest. Therefore, the technical problem of how to accurately select the computing nodes for processing tasks to minimize the waiting and processing time of tasks can be solved, and the technical effect of minimizing the waiting and processing time of tasks by accurately selecting the computing nodes for processing tasks can be achieved.

[0067] In one implementable method of the embodiment of the present application, when performing time calculation processing based on the first scheduling scheme, it can also be implemented by but not limited to the following methods: obtaining multiple task processing times of multiple pending tasks on multiple computing nodes and multiple communication times corresponding to multiple pending tasks, wherein each pending task corresponds to multiple task processing times, and the communication time is the time for multiple pending tasks to transmit data to their corresponding subsequent tasks; determining multiple first computing nodes corresponding to each of the multiple pending tasks in the first scheduling scheme, and obtaining multiple first task processing times corresponding to the first scheduling scheme from the multiple task processing times based on the multiple first computing nodes; obtaining multiple first communication times corresponding to the first scheduling scheme from the multiple communication times based on the multiple first computing nodes; performing benefit value calculation processing based on the multiple first task processing times and the multiple first communication times to obtain a first benefit value.

[0068] In an embodiment of the present application, there are significant differences in the task processing time of each pending task on different computing nodes. At the same time, when obtaining the processing time of multiple tasks, it is necessary to pre-test the execution time of each pending task in each computing node, and then store the multiple task processing times. Further, the expression of the multiple task processing times can be expressed in the form of but not limited to a target solution matrix. Specifically, an embodiment of the present application provides a schematic diagram of a target solution matrix, such as Figure 5 As shown, the rows of the target solution matrix represent computing nodes, the columns represent tasks to be processed, and the values ​​of the intersections in the matrix represent the execution time of the tasks to be processed in the corresponding computing nodes, that is, the processing time of multiple tasks.

[0069] Therefore, the estimated processing time of each pending task on all computing nodes can be recorded through, but not limited to, a predefined target solution matrix (rows represent computing nodes, columns represent pending tasks). For example: pending task T j On the computing node V i The processing time on is recorded as the value of the intersection of the i-th row and j-th column in the target solution matrix.

[0070] Communication time refers to the time it takes to transmit data between a pending task and its subsequent tasks. The calculation of communication time includes but is not limited to the following conditions: Task dependency: Communication time is calculated only between pending tasks with data dependencies; Inter-node network bandwidth: For two pending tasks assigned to different computing nodes, the communication time is calculated based on the physical link bandwidth and data volume between the computing nodes.

[0071] When obtaining multiple communication times, it is necessary to pre-test the communication time between multiple tasks to be processed when multiple tasks are assigned to different computing nodes, and then store the multiple communication times. Further, the expression form of the multiple communication times can be expressed in the form of but not limited to a communication matrix. Specifically, the embodiment of the present application provides a schematic diagram of a communication matrix, such as Figure 6 As shown, the rows of the communication matrix represent tasks to be processed, the columns also represent tasks to be processed, and the values ​​of the intersections in the matrix represent the time for the task to be processed to transmit data to the subsequent task, that is, multiple communication times.

[0072] The benefit value is an indicator to measure the quality of the scheduling scheme. It is obtained by adding the total task execution time and the total cross-node communication time. For example, suppose the first scheduling scheme contains three pending tasks T1, T2, and T3, whose task processing times are 10ms, 15ms, and 8ms respectively, and there is a dependency relationship between T1 and T2, and between T2 and T3, and the communication times are 5ms and 3ms respectively. Then the benefit value is 10+15+8+5+3=41ms.

[0073] Total task execution time: obtained by summing up the task processing time (multiple first task processing times) of all pending tasks on their respective computing nodes in the first scheduling scheme; Total cross-node communication time: obtained by extracting all communication times (multiple first communication times) from the communication matrix and summing them up based on the computing node allocation results of the dependent task pairs, i.e., the first scheduling scheme.

[0074] Specifically, regarding the calculation of the benefit value, the benefit value calculation method of the entire scheduling scheme can be implemented by, but not limited to, formula (2):

[0075] benefit=N*X+C Formula (2)

[0076] Among them, benefit is the benefit value, N is the target solution matrix, X is the scheduling matrix, and C is the communication matrix.

[0077] The benefit value accurately quantifies task processing and communication costs. Furthermore, the benefit value calculation objectively reflects the actual execution efficiency of the scheduling scheme. Smaller benefit values ​​directly correspond to shorter overall task execution times, thus avoiding the resource allocation imbalances that arise from traditional scheduling algorithms due to neglecting communication overhead or node heterogeneity. Furthermore, by dynamically extracting task processing and communication times, the algorithm can adapt to node performance fluctuations and network status changes in cloud computing environments, providing a reliable data foundation for subsequent iterative optimization.

[0078] In one implementable method of an embodiment of the present application, when performing secondary distribution of multiple pending tasks on multiple computing nodes, it can also be implemented by, but not limited to, the following methods: obtaining multiple address information corresponding to each of the multiple computing nodes, and determining multiple first address information corresponding to each of the multiple first computing nodes from the multiple address information based on the multiple first computing nodes; determining the node allocation range corresponding to each of the multiple first computing nodes based on the multiple first address information and preset range data; randomly distributing the multiple pending tasks corresponding to each of the multiple first computing nodes on the computing nodes in the node allocation range corresponding to each of the first computing nodes to obtain a second scheduling scheme.

[0079] In an embodiment of the present application, when generating the second scheduling scheme, the search range for task reallocation is limited by combining the physical or logical location information of the first computing node with the preset proximity strategy, thereby optimizing resource allocation within the local area and reducing cross-regional communication overhead. When performing secondary allocation based on the first scheduling scheme, first obtain the first address information of all first computing nodes (the first computing node identifies the computing node assigned to the task to be processed in the first scheduling scheme). The first address information is used to identify the network topology or physical deployment location of the first computing node, such as the Internet Protocol (IP) address segment of the first computing node, the rack number to which it belongs, the geographic location identifier of the data center, or the grouping label of the virtualization cluster. The first address information can reflect the network distance or physical proximity between the first computing nodes, for example, the first computing nodes in the same rack generally have higher internal bandwidth or lower communication latency.

[0080] For the first compute nodes assigned in the first scheduling scheme (i.e., the compute nodes assigned to each pending task in the first scheduling scheme), the corresponding first address information is extracted. For example, if task T1 is assigned to compute node V3, and V3's address information is rack A-server 5, then the first address information is the location identifier of the rack and server. Based on the first address information, the node allocation range allowed for each first compute node is delineated according to predefined preset range data.

[0081] Preset scope data is custom scope data used to define the boundaries of a neighborhood. For example, if the first address information is based on a rack ID, the preset scope data can be set to all compute nodes within the same rack; if the first address information is an IP address, the preset scope data can be set to the set of compute nodes on the same subnet; if the first address information is a geographic coordinate, the preset scope data can be set to a group of compute nodes within the same data center. By combining the first address information with the preset scope data, the node allocation scope of each first compute node is limited to the set of its neighboring compute nodes. For example, the node allocation scope of node V3 (Rack A - Server 5) may include all compute nodes (V1, V2, V3, V4) within Rack A.

[0082] After determining the node allocation range for each pending task, each pending task is randomly assigned to any compute node within the node allocation range corresponding to the first compute node. For example, if task T1 was originally assigned to node V3 (Rack A), and its node allocation range covers all compute nodes in Rack A, it may be randomly assigned to compute nodes V2 or V4 in the same rack.

[0083] By limiting the secondary allocation area using address information and preset ranges, the communication overhead associated with cross-regional task scheduling can be effectively reduced. Local random adjustments are also used to balance search efficiency and scheduling solution quality. Compared to global random allocation, local range restriction significantly reduces computational complexity and maintains physical or logical proximity between task executions, thereby improving resource utilization efficiency. Furthermore, the configurability of preset range data enables flexible adaptation to cloud computing environments of varying scales, balancing optimization speed with scheduling solution stability.

[0084] In one possible implementation of the present application, when determining the target scheduling scheme, the following methods may also be used but are not limited to: performing benefit value calculation based on the third scheduling scheme to obtain a third benefit value corresponding to the third scheduling scheme, wherein the third scheduling scheme is any one of the multiple scheduling schemes obtained by allocation after a preset number of times threshold; allocating multiple tasks to be processed on multiple computing nodes based on the third scheduling scheme to obtain a fourth scheduling scheme, and performing benefit value calculation based on the fourth scheduling scheme to obtain a fourth benefit value corresponding to the third scheduling scheme; when the fourth benefit value is greater than the third benefit value, the third scheduling scheme is used as Optimize the scheduling scheme, and continue to distribute and process the multiple tasks to be processed on multiple computing nodes based on the optimized scheduling scheme; until the number of times the third scheduling scheme is used as the optimized scheduling scheme reaches the preset number of schemes, randomly distribute and process the multiple tasks to be processed on multiple unallocated computing nodes to obtain a fifth scheduling scheme, wherein the unallocated computing nodes are computing nodes that have not been allocated tasks to be processed during the allocation process of the preset number of schemes; based on the fifth scheduling scheme, distribute and process the multiple tasks to be processed on multiple computing nodes until the allocation number reaches the preset number threshold, and obtain a target scheduling scheme, wherein the preset number threshold is greater than the preset number of schemes.

[0085] In the embodiment of the present application, by setting a dual threshold (preset number threshold and preset number of schemes) to control the search depth and the strategy of jumping out of the local optimum, a global approximate optimal target scheduling scheme is finally generated. When the optimized scheduling scheme (e.g., the second scheduling scheme) is continued to be allocated to the preset number threshold, the process includes but is not limited to the following mechanisms:

[0086] In each iteration, a new third scheduling solution (i.e., the candidate scheduling solution generated in the current iteration) is generated, and its corresponding third benefit value (i.e., the sum of the total execution time and communication overhead of the third scheduling solution) is calculated through benefit value calculation. Subsequently, based on the third scheduling solution, the pending tasks are redistributed to generate a fourth scheduling solution, and the fourth benefit value is calculated. If the fourth benefit value is greater than the third benefit value (i.e., the new solution has lower execution efficiency), the third scheduling solution is retained as the current optimal solution (i.e., the optimized scheduling solution), and subsequent allocations are continued based on this solution.

[0087] When the optimized scheduling scheme (i.e., the third scheduling scheme) is selected consecutively for a preset number of times (e.g., 5 times), it is determined that the current situation may be trapped in a local optimum. At this time, the tasks are reallocated to unassigned computing nodes (i.e., computing nodes that have never been selected in the preset number of iterations) to generate the fifth scheduling scheme. The introduction of unassigned computing nodes forces the search to jump out of the current area, for example, migrating pending tasks from high-load racks to idle racks, or switching from local data centers to edge nodes to explore the possibility of new resource combinations.

[0088] After the fifth scheduling solution is generated, the iterative process of comparing allocations and benefits continues until the total number of iterations reaches a preset threshold (for example, 100 total iterations, with the first 20 being local searches). Because the preset threshold is greater than the number of solutions, there are still sufficient iterations to verify the potential optimization space in new areas after breaking through the local optimum. Ultimately, the solution with the lowest benefit is selected as the target solution, ensuring that the global optimal solution is approached within limited computing resources.

[0089] Through dual threshold control and forced exploration of unassigned nodes, this algorithm effectively avoids the pitfalls of traditional iterative algorithms, which are prone to falling into local optima, while maintaining local search efficiency. The preset number of schemes enables timely identification of stagnant states and activates global exploration through a breakthrough mechanism, significantly improving spatial coverage. The introduction of unassigned compute nodes not only increases resource utilization diversity but also alleviates the load pressure on hot nodes, thereby reducing task execution time and improving resource balance within the cloud computing platform. The resulting target scheduling solution combines local optimization accuracy with global search breadth, making it suitable for highly dynamic, multi-constrained, and complex task scheduling scenarios.

[0090] In one implementable method of an embodiment of the present application, when merging the obtained multiple directed acyclic graph tasks, it can also be implemented in but not limited to the following method: performing virtual node setting processing on the multiple directed acyclic graph tasks to obtain a virtual starting task node and a virtual ending task node, wherein the virtual starting task node is the common starting task node of the multiple directed acyclic graph tasks, and the virtual ending task node is the common ending task node of the multiple directed acyclic graph tasks; based on the virtual starting task node, multiple first virtual communication paths are constructed to the starting task nodes of the multiple directed acyclic graph tasks respectively, and based on the virtual ending task node, multiple second virtual communication paths are constructed to the ending task nodes of the multiple directed acyclic graph tasks respectively; multiple directed acyclic graph tasks are merged through the virtual starting task node, the virtual ending task node, the multiple first virtual communication paths and the multiple second virtual communication paths to obtain the target directed acyclic graph task.

[0091] In the embodiments of the present application, when merging multiple directed acyclic graph (DAG) tasks, by introducing logical virtual nodes and zero-cost communication paths, the originally independent multiple DAG tasks are integrated into a single-target directed acyclic graph task, thereby providing a unified logical framework for global scheduling optimization. The specific merging process includes but is not limited to:

[0092] Create virtual start task nodes and virtual end task nodes for all DAG tasks to be merged (multiple directed acyclic graph tasks). The virtual start task node is a logical root node, serving as the common starting point for all original DAG tasks. It does not perform any actual calculations (execution time is zero) and is only used to represent the unified entry point for the task set. The virtual end task node is the common end point for all DAG tasks. It also has no actual computing load and is used to mark the overall completion of the task set. For example: If a user submits three independent DAG tasks (starting with tasks A1, B1, and C1, and ending with tasks A5, B4, and C3), the virtual start node will connect A1, B1, and C1 at the same time, and the virtual end node will converge A5, B4, and C3.

[0093] Subsequently, two types of virtual communication paths are constructed to connect virtual nodes and DAG tasks.

[0094] First virtual communication path: From the virtual start task node to the start task node of each DAG task. For example, the virtual start node is connected to A1, B1, and C1 through three paths.

[0095] Second virtual communication path: From the end task node of each DAG task to the virtual end task node. For example, tasks A5, B4, and C3 are connected to the virtual end node through three paths.

[0096] Virtual communication paths have zero communication cost, meaning zero data transmission time, and are used only to represent logical dependencies. The entry and exit points of all DAG tasks are uniformly bound to virtual nodes, forming a single target directed acyclic graph (DAG) task containing all tasks and their dependencies. In the merged target DAG, the virtual start node becomes the sole starting point for global scheduling, and the virtual end node serves as the final completion marker. The internal structure of each original DAG (task dependencies and communication paths) remains unchanged.

[0097] By introducing virtual nodes and zero-cost paths, multiple DAG tasks are merged into a single logical entity, solving the problem of resource allocation fragmentation caused by decentralized optimization in traditional multi-task scheduling. Since virtual communication paths have no actual overhead, the redundant communication costs across DAGs can be ignored during scheduling, allowing the focus to be on global resource allocation optimization. The merged target DAG can coordinate computing node resources from a holistic perspective, avoiding node load imbalances or cross-task communication conflicts that may occur during independent scheduling, ultimately minimizing multi-task execution time. In addition, the logical encapsulation characteristics of virtual nodes can be flexibly extended to merge any number of DAG tasks, adapting to the complex scenarios of multi-tenant high concurrency.

[0098] In one possible implementation of the embodiment of the present application, after obtaining the target scheduling scheme, the following method may be used but is not limited to: performing task scheduling processing on the target directed acyclic graph task according to the target scheduling scheme.

[0099] In one implementable method of an embodiment of the present application, when performing task scheduling processing, the following methods can also be used but are not limited to: obtaining scheduling information for task scheduling processing, and determining whether there is resource competition during the task scheduling processing based on the scheduling information; when it is determined according to the scheduling information that there is no resource competition during the task scheduling processing, continuing to perform task scheduling processing on the target directed acyclic graph task according to the target scheduling scheme; when it is determined according to the scheduling information that there is resource competition during the task scheduling processing, performing scheme mutation processing on the target scheduling scheme to obtain a mutated target scheduling scheme, and performing task scheduling processing on the target directed acyclic graph task according to the mutated target scheduling scheme.

[0100] In the embodiments of the present application, tasks are scheduled according to the target scheduling scheme. When pending tasks are executed on a computing node, they may be delayed due to real-time issues such as task preemption or insufficient idle resources, leading to subsequent task execution delays. This in turn prolongs the execution time of all DAG tasks, resulting in a mismatch between the total task execution time and the time calculated by the target scheduling scheme. This may result in the originally formulated target scheduling scheme being suboptimal. Therefore, during the scheduling process, when resource contention arises, the target scheduling scheme needs to be mutated to dynamically adjust the execution order of tasks.

[0101] Through real-time resource contention detection and dynamic scheme variation, it can effectively cope with resource dynamics in cloud computing environments (such as node failures, load fluctuations or network congestion) and avoid extended execution time caused by static scheduling schemes.

[0102] In one possible implementation method of the embodiment of the present application, when the target scheduling scheme is mutated, it can also be implemented in but not limited to the following methods: determine the target task level of the pending tasks that compete for resources in the target directed acyclic graph task, wherein the target directed acyclic graph task includes multiple task levels; determine all pending tasks in the target task level as multiple entry tasks, and determine the multiple entry tasks and the multiple subsequent tasks corresponding to the multiple entry tasks as multiple tasks to be mutated; distribute and process the multiple tasks to be mutated on multiple computing nodes until the number of distributions reaches a preset number threshold, and obtain a mutated target scheduling scheme, wherein the mutated target scheduling scheme is the scheme with the smallest benefit value among the multiple scheduling schemes obtained by distributing the multiple tasks to be mutated after the preset number threshold.

[0103] In an embodiment of the present application, after resource competition is detected, the target scheduling scheme is dynamically adjusted through a hierarchical local variation mechanism to minimize task execution delays and resolve resource conflicts. When the target scheduling scheme causes the benefit value (i.e., total execution time) to increase due to resource competition, the target task level where the competition occurs is first located. In the target directed acyclic graph task, the task level is defined by the execution depth of the task, for example: all initial tasks without pre-dependencies belong to the first level, their direct successor tasks belong to the second level, and so on. The target task level is the specific level where resource competition occurs, for example: multiple tasks in a certain layer are assigned to the same computing node, resulting in resource overload.

[0104] After determining the target task level, all pending tasks within the target task level are marked as entry tasks. Entry tasks are direct participants in resource competition or affected adjacent tasks. For example: if tasks T2, T3, and T4 are at the same level and T2 competes with T3 for node resources, all three are marked as entry tasks. Subsequently, each entry task and its subsequent tasks (that is, all downstream tasks that depend on the entry task) are included in the set of tasks to be mutated. For example: if the successor tasks of entry task T2 are T5 and T6, then T2, T5, and T6 together constitute the task group to be mutated. Ensure that the mutation process not only resolves conflicts at the current level, but also avoids new resource competition for subsequent tasks due to prior adjustments.

[0105] For the mutated task set, the iterative allocation process is re-executed: new allocation schemes are generated for these tasks on multiple compute nodes, and their advantages and disadvantages are evaluated by calculating the benefit value (the sum of total execution time and communication time). For example, task T2 may be migrated from the original compute node V5 to the adjacent compute node V7, and its subsequent tasks T5 and T6 are adjusted to nodes with lower communication costs with V7 based on the new dependencies. This process is repeated until a preset number threshold is reached (for example, 10 times), and finally the one with the lowest benefit value is selected from all the attempted schemes as the mutated target scheduling scheme. The preset number threshold controls the computational overhead of the mutation process and prevents over-optimization from affecting the overall scheduling efficiency.

[0106] Specifically, regarding multiple task levels, the embodiment of the present application provides a schematic diagram of a task level, such as Figure 7 As shown, there are 4 levels in total, t1 is a level, t2, t3, t4 is a level, t5, t6, t7 is a level, and t8 is a level. When scheduling tasks, if resource competition occurs, it means that the execution time of the entire task will inevitably change. At this time, mutation is performed. The mutation operation is as follows:

[0107] In the same layer where the tasks with resource competition occur, the tasks in the search list are arranged continuously to form a variation list, such as Figure 7 As shown in the figure, assuming that there is competition at t2, t2, t3, and t4 constitute the mutation list; in the mutation list, a task is randomly selected (all tasks must be used as an entry task) as the entry task, and the benefit value is recalculated together with the subsequent tasks. The above iterative allocation process is repeated until the preset number threshold is reached, and a new scheduling plan and a mutated target scheduling plan are obtained; task scheduling is performed according to the mutated target scheduling plan until all tasks are scheduled.

[0108] Through hierarchical positioning and dynamic adjustment of the set of tasks to be mutated, local optimization can be accurately performed in areas of resource competition, avoiding the computational burden brought by global solution reconstruction. The linkage adjustment mechanism between entry tasks and subsequent tasks ensures the consistency of dependencies and prevents new resource conflicts caused by local modifications. The introduction of preset number thresholds balances optimization quality and computational efficiency, enabling rapid response to resource changes in real-time scheduling scenarios. In addition, the mutated target scheduling scheme effectively reduces task execution latency by minimizing local benefit values. It is especially suitable for complex DAG task scenarios with high concurrency and multiple dependencies, significantly improving the resource elasticity and task execution reliability of the cloud computing platform.

[0109] In order to facilitate understanding of the process of the embodiment of the present application, the embodiment of the present application provides a flowchart of another task scheduling method, such as Figure 8 shown.

[0110] refer to Figure 8 To facilitate understanding of the process of the embodiment of the present application, the embodiment of the present application provides an example: To better understand the task scheduling process, four roles can be defined:

[0111] 1. Target solution: represents the feasible solution to the problem, that is, all feasible scheduling solutions (multiple scheduling solutions obtained by allocating multiple pending tasks after a preset number of times). The quality of the target solution can be determined by the fitness (generally obtained through the fitness function).

[0112] 2. Leader: The discoverer of the target solution allocates the tasks to be processed and obtains the scheduling plan. After finding the target solution, it recruits followers to calculate the optimal solution together.

[0113] 3. Follower: When the leader is recruiting, one of the leaders is selected and selected from the solutions around it (that is, the process of redistributing multiple pending tasks on multiple computing nodes based on the first scheduling plan). If a better solution than this leader is found, it will become the leader (that is, if the second benefit value is less than the first benefit value, the second scheduling plan is determined to be the optimized scheduling plan, indicating that the benefit value of the new scheduling plan is less than the benefit value of the old scheduling plan, the new scheduling plan is used as the optimized scheduling plan, and then the pending tasks are distributed based on the new scheduling plan).

[0114] 4. Breakthrough: This role does not follow any other roles and seeks the optimal solution on its own. (This is the process of randomly assigning multiple pending tasks to multiple unassigned computing nodes after the third scheduling solution is used as the optimal scheduling solution and the number of times reaches the preset number of solutions.) If the solution is stuck in a local optimal solution, it can become a leader.

[0115] Among them, the leader, follower, and breakthrough can be converted into each other in a specific scenario. For the specific conversion process, the embodiment of the present application provides a schematic diagram for defining the role conversion, such as Figure 9 As shown, further, the embodiment of the present application also provides a schematic diagram of jumping out of the local optimal solution, such as Figure 10 As shown in the figure, when a leader finds a relatively good solution in a region, they recruit followers to search for the best solution in that region together. If the optimal solution remains unchanged after the number of iterations reaches the trial threshold, it is considered that the solution may be stuck in a local optimal solution. The breakthrough person begins to work outside the current region and search for the optimal solution in other unexamined regions.

[0116] The process of task scheduling includes but is not limited to:

[0117] 1. The leader first searches for the target solution

[0118] In each column of the target solution matrix, for each task T j Randomly select a computing node V that can meet the resource requirements i , and set the value of the corresponding position in the scheduling matrix to 1. The set of computing nodes where the number 1 in the scheduling matrix is ​​located constitutes the initial scheduling plan, and the benefit value of the current plan is calculated through the benefit value formula;

[0119] 2. Followers choose leaders

[0120] After each user task selects a computing node, other computing nodes are randomly selected near the corresponding computing node in the scheduling scheme in step 1 to form a new scheduling scheme.

[0121] 3. Leader and follower role swap

[0122] After obtaining a new scheduling plan, the new benefit value is calculated according to the benefit value formula and compared with the old one. Since the goal of this plan is to minimize execution time, the one with the smaller benefit value is the optimal plan. If the new benefit value is smaller than the old one, it means that the follower has found a better target solution than the leader. The roles are swapped, and the follower continues to iterate to find a better target solution.

[0123] 4. Repeat steps 1-3 multiple times

[0124] Set different numbers of iterations according to different usage scenarios. If the current optimal solution remains unchanged after the number of cycles of steps 1-3 reaches the set number of iterations, it can be considered that it has fallen into a local optimal solution. At this time, the breakthrough developer needs to look for the optimal solution in the set of computing nodes that have not yet executed the task.

[0125] 5. Select the scheduling plan with the minimum benefit value

[0126] After multiple iterations, the scheduling matrix with the minimum benefit value is recorded. The computing node corresponding to the number 1 is the current optimal scheduling solution, and the scheduling process is carried out according to this solution.

[0127] 6. Mutation during the scheduling process

[0128] When scheduling tasks according to the optimal solution, tasks executing on virtual machines may be delayed due to real-time issues such as task preemption or insufficient idle resources, leading to subsequent task execution delays. This in turn prolongs the execution time of all DAG tasks, causing a mismatch between the time calculated based on the minimum execution time and the scheduling solution. This can potentially make the original scheduling solution suboptimal. Therefore, during the scheduling process, it is necessary to dynamically adjust the execution order of tasks based on real-time conditions by making changes. Since subsequent tasks in a DAG task require the completion of their predecessors before they can execute, this change only needs to be performed on tasks at the same level.

[0129] In summary, the embodiments of the present application can achieve the following technical effects:

[0130] 1. This application, under the premise of receiving multiple directed acyclic graph tasks submitted at the same time, synthesizes the multiple directed acyclic graph tasks into one directed acyclic graph task, and determines the scheduling scheme as a whole. At the same time, in the process of determining the scheduling scheme, multiple tasks to be processed are continuously distributed on multiple computing nodes, and the benefit value of the scheduling process is continuously iterated and calculated, and the scheduling scheme corresponding to the minimum benefit value obtained in the allocation process is determined as the target scheduling scheme. At this time, the scheduling time representing the target scheduling scheme is also the smallest. Therefore, it is possible to solve the technical problem of how to accurately select the computing nodes for processing tasks to minimize the waiting and processing time of tasks, and achieve the technical effect of minimizing the waiting and processing time of tasks by accurately selecting the computing nodes for processing tasks.

[0131] 2. After receiving multiple new tasks, this application merges multiple DAG tasks submitted by one or multiple tenants at the same time into one DAG task. This can be used as a whole to achieve the goal of the fastest execution of the current batch of tasks. At the same time, it can find the computing node in the system that can run multiple tasks the fastest and with the shortest waiting time.

[0132] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0133] The embodiment of the present application also provides a task scheduling device, Figure 11 A structural diagram of a task scheduling device provided for the application, such as Figure 11 As shown, including:

[0134] A merging unit 111 is configured to merge the acquired multiple directed acyclic graph tasks to obtain a target directed acyclic graph task;

[0135] A first allocating unit 112 is configured to randomly allocate multiple pending tasks in the target directed acyclic graph task to multiple computing nodes to obtain a first scheduling solution;

[0136] The calculation unit 113 is configured to perform benefit value calculation based on the first scheduling scheme to obtain a first benefit value corresponding to the first scheduling scheme, wherein each computing node is assigned a task to be processed;

[0137] A second allocating unit 114 is configured to redistribute the plurality of pending tasks onto the plurality of computing nodes based on the first scheduling scheme to obtain a second scheduling scheme;

[0138] The calculation unit 113 is further configured to perform benefit value calculation based on the second scheduling scheme to obtain a second benefit value corresponding to the second scheduling scheme;

[0139] A determining unit 115 is configured to determine that the second scheduling scheme is an optimized scheduling scheme when the second benefit value is less than the first benefit value;

[0140] The processing unit 116 is used to distribute the multiple tasks to be processed three times on the multiple computing nodes based on the optimized scheduling plan until the number of distributions reaches a preset number threshold, and obtain a target scheduling plan, wherein the target scheduling plan is the plan with the smallest benefit value among the multiple scheduling plans obtained by distributing the multiple tasks to be processed after the preset number threshold.

[0141] In one embodiment of the present application, the calculation unit 113 is further configured to:

[0142] Obtaining multiple task processing times of each of the multiple pending tasks on the multiple computing nodes and multiple communication times corresponding to the multiple pending tasks, wherein each pending task corresponds to multiple task processing times, and the communication time is the time for the multiple pending tasks to transmit data to their corresponding subsequent tasks;

[0143] Determine a plurality of first computing nodes corresponding to the plurality of tasks to be processed in the first scheduling scheme, and obtain a plurality of first task processing times corresponding to the first scheduling scheme from the plurality of task processing times according to the plurality of first computing nodes;

[0144] Acquire multiple first communication times corresponding to the first scheduling scheme from the multiple communication times according to the multiple first computing nodes;

[0145] A benefit value calculation process is performed based on the plurality of first task processing times and the plurality of first communication times to obtain a first benefit value.

[0146] In one embodiment of the present application, the second allocation unit 114 is further configured to:

[0147] Acquire multiple address information corresponding to each of the multiple computing nodes, and determine multiple first address information corresponding to each of the multiple first computing nodes from the multiple address information according to the multiple first computing nodes;

[0148] Determine a node allocation range corresponding to each of the plurality of first computing nodes according to the plurality of first address information and the preset range data;

[0149] The plurality of to-be-processed tasks corresponding to the plurality of first computing nodes are randomly allocated to computing nodes in the node allocation range corresponding to the first computing nodes to obtain a second scheduling solution.

[0150] In one embodiment of the present application, the processing unit 116 is further configured to:

[0151] Performing a benefit value calculation based on a third scheduling scheme to obtain a third benefit value corresponding to the third scheduling scheme, wherein the third scheduling scheme is any one of the plurality of scheduling schemes obtained through allocations of a preset number of times;

[0152] Allocating the plurality of pending tasks on the plurality of computing nodes based on the third scheduling scheme to obtain a fourth scheduling scheme, and performing benefit value calculation based on the fourth scheduling scheme to obtain a fourth benefit value corresponding to the third scheduling scheme;

[0153] When the fourth benefit value is greater than the third benefit value, the third scheduling scheme is used as the optimized scheduling scheme, and the plurality of pending tasks are continuously distributed and processed on the plurality of computing nodes based on the optimized scheduling scheme;

[0154] Until the third scheduling scheme is used as the optimized scheduling scheme a number of times reaches a preset number of times, the plurality of pending tasks are randomly assigned to a plurality of unassigned computing nodes to obtain a fifth scheduling scheme, wherein the unassigned computing nodes are computing nodes that have not been assigned a pending task during the allocation process of the preset number of times;

[0155] Based on the fifth scheduling scheme, multiple tasks to be processed are distributed and processed on multiple computing nodes until the number of distribution times reaches a preset number threshold, thereby obtaining a target scheduling scheme, wherein the preset number threshold is greater than the preset scheme number.

[0156] In one embodiment of the present application, the merging unit 111 is further configured to:

[0157] Performing virtual node setting processing on multiple directed acyclic graph tasks to obtain a virtual start task node and a virtual end task node, wherein the virtual start task node is a common start task node of the multiple directed acyclic graph tasks, and the virtual end task node is a common end task node of the multiple directed acyclic graph tasks;

[0158] Constructing a plurality of first virtual communication paths to the starting task nodes of a plurality of directed acyclic graph tasks based on the virtual starting task node, and constructing a plurality of second virtual communication paths to the ending task nodes of the plurality of directed acyclic graph tasks based on the virtual ending task node;

[0159] Multiple directed acyclic graph tasks are merged and processed through a virtual start task node, a virtual end task node, multiple first virtual communication paths, and multiple second virtual communication paths to obtain a target directed acyclic graph task.

[0160] In one embodiment of the present application, Figure 12 As shown, the task scheduling device also includes:

[0161] The scheduling unit 117 is configured to perform task scheduling processing on the target directed acyclic graph task according to the target scheduling scheme.

[0162] In one embodiment of the present application, the scheduling unit 117 is further configured to:

[0163] Obtaining the scheduling information of the task scheduling process, and determining whether there is resource competition during the task scheduling process based on the scheduling information;

[0164] When it is determined according to the scheduling information that there is no resource competition in the task scheduling process, the target directed acyclic graph task is continued to be scheduled according to the target scheduling plan;

[0165] In the case that there is resource competition in the process of determining task scheduling processing according to scheduling information, a target scheduling scheme is mutated to obtain a mutated target scheduling scheme, and task scheduling processing is performed on the target directed acyclic graph task according to the mutated target scheduling scheme.

[0166] In one embodiment of the present application, the scheduling unit 117 is further configured to:

[0167] Determining a target task level of a pending task that is competing for resources in a target directed acyclic graph task, wherein the target directed acyclic graph task includes multiple task levels;

[0168] Determine all pending tasks in the target task hierarchy as a plurality of entry tasks, and determine the plurality of entry tasks and a plurality of subsequent tasks corresponding to the plurality of entry tasks as a plurality of tasks to be mutated;

[0169] Multiple tasks to be mutated are distributed and processed on multiple computing nodes until the number of distributions reaches a preset threshold, and a target scheduling plan after mutation is obtained, wherein the target scheduling plan after mutation is the plan with the smallest benefit value among multiple scheduling plans obtained by distributing multiple tasks to be mutated after the preset threshold number of distributions.

[0170] For the description of the features in the embodiment corresponding to the task scheduling device, reference can be made to the relevant description of the embodiment corresponding to the task scheduling method, which will not be repeated here.

[0171] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned task scheduling method embodiments.

[0172] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned task scheduling method embodiments when running.

[0173] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0174] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned task scheduling method embodiments are implemented.

[0175] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of any of the above-mentioned task scheduling method embodiments.

[0176] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0177] The above is a detailed introduction to a task scheduling method, electronic device and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A task scheduling method, characterized in that: include: Merge multiple obtained directed acyclic graph tasks to obtain the target directed acyclic graph task; Randomly assigning a plurality of pending tasks in the target directed acyclic graph task to a plurality of computing nodes to obtain a first scheduling scheme, and performing benefit value calculation based on the first scheduling scheme to obtain a first benefit value corresponding to the first scheduling scheme, wherein each computing node is assigned one pending task; Based on the first scheduling scheme, the plurality of pending tasks are redistributed on the plurality of computing nodes to obtain a second scheduling scheme, and benefit value calculation is performed based on the second scheduling scheme to obtain a second benefit value corresponding to the second scheduling scheme; When the second benefit value is less than the first benefit value, determining the second scheduling plan as an optimized scheduling plan, wherein the benefit value of the scheduling plan is proportional to the scheduling time of the scheduling plan; Based on the optimized scheduling scheme, the multiple tasks to be processed are distributed three times on the multiple computing nodes until the number of distributions reaches a preset number threshold, and a target scheduling scheme is obtained, wherein the target scheduling scheme is the scheme with the smallest benefit value among the multiple scheduling schemes obtained by distributing the multiple tasks to be processed after the preset number threshold.

2. The task scheduling method according to claim 1, characterized in that: The performing time calculation based on the first scheduling scheme to obtain a first benefit value corresponding to the first scheduling scheme includes: Obtaining multiple task processing times of each of the multiple pending tasks on the multiple computing nodes and multiple communication times corresponding to each of the multiple pending tasks, wherein each pending task corresponds to multiple task processing times, and the communication time is the time for the multiple pending tasks to transmit data to their corresponding subsequent tasks; Determine a plurality of first computing nodes corresponding to the plurality of tasks to be processed in the first scheduling scheme, and obtain a plurality of first task processing times corresponding to the first scheduling scheme from the plurality of task processing times according to the plurality of first computing nodes; acquiring, from the plurality of communication times, a plurality of first communication times corresponding to the first scheduling scheme according to the plurality of first computing nodes; A benefit value calculation process is performed based on the multiple first task processing times and the multiple first communication times to obtain the first benefit value.

3. The task scheduling method according to claim 2, characterized in that: The second scheduling scheme is obtained by performing secondary distribution of the plurality of tasks to be processed on the plurality of computing nodes based on the first scheduling scheme, comprising: Acquire a plurality of address information corresponding to each of the plurality of computing nodes, and determine a plurality of first address information corresponding to each of the plurality of first computing nodes from the plurality of address information according to the plurality of first computing nodes; Determine a node allocation range corresponding to each of the plurality of first computing nodes according to the plurality of first address information and preset range data; The plurality of to-be-processed tasks corresponding to the plurality of first computing nodes are randomly allocated to computing nodes in a node allocation range corresponding to the first computing nodes to obtain the second scheduling solution.

4. The task scheduling method according to claim 1, wherein: The step of obtaining a target scheduling solution until the number of allocations reaches a preset number threshold comprises: Performing a benefit value calculation based on a third scheduling scheme to obtain a third benefit value corresponding to the third scheduling scheme, wherein the third scheduling scheme is any one of the plurality of scheduling schemes obtained through allocation of the preset number of times threshold; Allocating the plurality of pending tasks on the plurality of computing nodes based on the third scheduling scheme to obtain a fourth scheduling scheme, and performing benefit value calculation based on the fourth scheduling scheme to obtain a fourth benefit value corresponding to the third scheduling scheme; When the fourth benefit value is greater than the third benefit value, the third scheduling scheme is used as the optimized scheduling scheme, and the plurality of to-be-processed tasks are continuously allocated and processed on the plurality of computing nodes based on the optimized scheduling scheme; until the third scheduling scheme is used as the optimized scheduling scheme a number of times reaching a preset number of times, randomly allocating the plurality of pending tasks to a plurality of unassigned computing nodes to obtain a fifth scheduling scheme, wherein the unassigned computing nodes are computing nodes that have not been allocated any pending tasks during the allocation process of the preset number of times; Based on the fifth scheduling scheme, the multiple tasks to be processed are distributed and processed on the multiple computing nodes until the number of distributions reaches the preset number threshold, thereby obtaining the target scheduling scheme, wherein the preset number threshold is greater than the preset scheme number.

5. The task scheduling method according to claim 1, characterized in that: The step of merging the obtained multiple directed acyclic graph tasks to obtain a target directed acyclic graph task includes: Performing virtual node setting processing on the multiple directed acyclic graph tasks to obtain a virtual start task node and a virtual end task node, wherein the virtual start task node is a common start task node of the multiple directed acyclic graph tasks, and the virtual end task node is a common end task node of the multiple directed acyclic graph tasks; Constructing a plurality of first virtual communication paths to the start task nodes of the plurality of directed acyclic graph tasks based on the virtual start task node, and constructing a plurality of second virtual communication paths to the end task nodes of the plurality of directed acyclic graph tasks based on the virtual end task node; The multiple directed acyclic graph tasks are merged and processed through the virtual start task node, the virtual end task node, the multiple first virtual communication paths, and the multiple second virtual communication paths to obtain the target directed acyclic graph task.

6. The task scheduling method according to claim 1, characterized in that: After the number of allocations reaches a preset number threshold and a target scheduling solution is obtained, the method further includes: The target directed acyclic graph task is scheduled according to the target scheduling scheme.

7. The task scheduling method according to claim 6, characterized in that: The performing task scheduling processing on the target directed acyclic graph task according to the target scheduling scheme includes: Obtaining scheduling information for task scheduling processing, and determining whether there is resource competition during the task scheduling processing according to the scheduling information; When it is determined according to the scheduling information that there is no resource competition in the process of task scheduling, continuing to perform task scheduling on the target directed acyclic graph task according to the target scheduling scheme; In the case that there is resource competition in the process of determining task scheduling processing according to the scheduling information, the target scheduling scheme is mutated to obtain a mutated target scheduling scheme, and task scheduling processing is performed on the target directed acyclic graph task according to the mutated target scheduling scheme.

8. The task scheduling method according to claim 7, characterized in that: The target scheduling scheme is subjected to scheme variation processing to obtain a mutated target scheduling scheme, comprising: Determining a target task level of the pending task that is competing for resources in the target directed acyclic graph task, wherein the target directed acyclic graph task includes multiple task levels; Determine all pending tasks in the target task hierarchy as a plurality of entry tasks, and determine the plurality of entry tasks and a plurality of subsequent tasks corresponding to each of the plurality of entry tasks as a plurality of tasks to be mutated; The multiple tasks to be mutated are distributed and processed on the multiple computing nodes until the number of distributions reaches the preset number threshold, and the mutated target scheduling scheme is obtained, wherein the mutated target scheduling scheme is the scheme with the smallest benefit value among the multiple scheduling schemes obtained by distributing the multiple tasks to be mutated after the preset number threshold.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the task scheduling method according to any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the task scheduling method according to any one of claims 1 to 8.