Task scheduling method and apparatus, device, and computer readable storage medium

By constructing a directed acyclic graph of tasks and dividing them, and adjusting the scheduling scheme with greedy scheduling and simulated annealing methods, the problem of slow data transmission speed of dependent tasks on different computing units is solved, and efficient task scheduling and processing is achieved efficiency.

WO2025025645A1PCT designated stage expired Publication Date: 2025-02-06HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/084713
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-03
Filing Date
2024-03-29
Publication Date
2025-02-06

AI Technical Summary

Technical Problem

In the prior art, there are problems in the task scheduling that dependencies are assigned to different computing units, resulting in slow data transmission speed and affecting task processing efficiency.

Method used

By constructing directed acyclic graphs between tasks, the graphs are sliced ​​to meet the tangent rate constraints, and the scheduling scheme is adjusted using greedy scheduling and simulated annealing methods to ensure that the scheduling scheme meets the dependency and total time constraints.

Benefits of technology

The data transmission volume between different computing units is reduced, the efficiency of task scheduling is improved, bandwidth cost is reduced, and processing efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024084713_06022025_PF_FP_ABST
    Figure CN2024084713_06022025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of computers, and discloses a task scheduling method and apparatus, a device, and a computer readable storage medium. The method comprises: determining a plurality of tasks needing to be scheduled; determining a target scheduling scheme on the basis of the dependency relationship among said plurality of tasks, wherein the target scheduling scheme meets the dependency relationship constraint and the total scheduling duration constraint among said plurality of tasks; and allocating said plurality of tasks to the corresponding computing units on the basis of the target scheduling scheme, and processing the allocated tasks by means of the computing units. According to the task scheduling method provided by the present application, the determined target scheduling scheme meets both the dependency relationship constraint and the total scheduling duration constraint, so that the dependency between computing tasks of different computing units can be reduced, and the amount of data transmission between different computing units is reduced, thereby improving the scheduling efficiency during task scheduling among a plurality of computing units, reducing the bandwidth cost, and improving the processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Task scheduling method, device, equipment and computer-readable storage medium

[0001] This application claims priority to Chinese patent application No. 202310979934.3 filed on August 3, 2023, entitled “Task Scheduling Method, Apparatus, Device and Computer-Readable Storage Medium,” the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a task scheduling method, apparatus, device, and computer-readable storage medium. Background Art

[0003] With the development of computer technology, the types of tasks that need to be processed are increasing, and the number of task scheduling scenarios is also increasing. For multiple tasks that need to be processed, how to schedule these tasks so that they are processed and executed in an orderly manner has become an urgent problem that needs to be solved.

[0004] In related technologies, a priority scheduling strategy is used to determine the scheduling priority of tasks, and the execution order of tasks is determined according to the scheduling priority of tasks. Tasks are scheduled according to the execution order of tasks to achieve the scheduling of multiple tasks among multiple different computing units.

[0005] However, when using a priority scheduling strategy for task scheduling, different tasks are assigned to multiple computing units. If dependent tasks are assigned to multiple computing units, data transmission between these different computing units will be slow when the bandwidth between computing units is limited, which in turn affects task processing efficiency.

[0006] Summary of the Invention

[0007] This application provides a task scheduling method, apparatus, device, and computer-readable storage medium to solve problems in related technologies. The technical solutions are as follows:

[0008] In a first aspect, a task scheduling method is provided, which includes: determining multiple tasks that need to be scheduled; determining a target scheduling scheme based on the dependency relationship between the multiple tasks, and the target scheduling scheme satisfies the dependency constraint between the multiple tasks and the total scheduling duration constraint; allocating the multiple tasks to corresponding computing units according to the target scheduling scheme, and processing the allocated tasks through the computing units.

[0009] The task scheduling method provided in this application determines a target scheduling scheme that not only satisfies dependency constraints but also satisfies total scheduling duration constraints, thereby reducing the dependency of computing tasks between different computing units and reducing the amount of data transmitted between different computing units, thereby improving the scheduling efficiency when scheduling tasks between multiple computing units, reducing bandwidth costs, and improving processing efficiency.

[0010] In one possible implementation, determining a target scheduling scheme based on the dependency relationship between the multiple tasks includes: constructing a directed acyclic graph corresponding to the multiple tasks based on the dependency relationship between the multiple tasks, the directed acyclic graph including multiple nodes and directed edges, one node corresponding to one task, and the nodes corresponding to the tasks with dependency relationships are connected by the directed edges, and the direction of the directed edges is used to indicate the dependency relationship between the tasks corresponding to the nodes connected by the directed edges; segmenting the directed acyclic graph to obtain a segmentation result, the segmentation rate corresponding to the segmentation result being less than a threshold; and determining a target scheduling scheme based on the segmentation result.

[0011] In one possible implementation, determining the target scheduling scheme based on the segmentation results includes: using a greedy scheduling method to determine the scheduling time of each task corresponding to each segmentation result, and determining the total scheduling duration based on the scheduling time of each task; determining an initial scheduling result based on the total scheduling duration; adjusting the initial scheduling result to obtain an adjusted scheduling scheme; and if the adjusted scheduling scheme satisfies the total scheduling duration constraint, using the adjusted scheduling scheme as the target scheduling scheme.

[0012] In one possible implementation, the initial scheduling result is adjusted to obtain an adjusted scheduling scheme, including: performing a first move operation on the first task in the initial scheduling result, and obtaining the adjusted scheduling scheme based on the result after the first move operation, wherein the first task is any one of the tasks in the initial scheduling result.

[0013] In one possible implementation, the first move operation on the first task in the initial scheduling result includes: moving the first task from a first computing unit to a second computing unit, where the first computing unit is the computing unit assigned to the first task in the initial scheduling result, and the second computing unit is different from the first computing unit.

[0014] In one possible implementation, the first moving operation on the first task in the initial scheduling result includes: moving the first task from a first position to a second position, the first position being the position of the first task in the computing unit assigned in the initial scheduling result, and the second position being other positions in the computing unit assigned to the first task in the initial scheduling result, and the first position is different from the second position.

[0015] In one possible implementation, the first moving operation performed on the first task in the initial scheduling result includes: moving the first task from the first position to a third position, the third position being the nearest idle time position before the position of the first task in the computing unit assigned in the initial scheduling result, and the third position is different from the first position.

[0016] In one possible implementation, after adjusting the initial scheduling result to obtain the adjusted scheduling scheme, it also includes: determining the difference between the total scheduling duration corresponding to the adjusted scheduling scheme and the total scheduling duration corresponding to the scheduling scheme before adjustment; when the difference is less than the duration threshold and the number of adjustments reaches the number of iterations, determining that the adjusted scheduling scheme meets the total scheduling duration constraint.

[0017] In one possible implementation, after adjusting the initial scheduling result to obtain the adjusted scheduling scheme, it also includes: when the adjusted scheduling scheme does not meet the total scheduling duration constraint, determining the difference between the total scheduling duration corresponding to the adjusted scheduling scheme and the total scheduling duration corresponding to the scheduling scheme before adjustment; according to the relationship between the difference and the duration threshold, based on the scheduling scheme before adjustment or the adjusted scheduling scheme, obtaining a scheduling scheme that meets the total scheduling duration constraint, and using the scheduling scheme that meets the total scheduling duration constraint as the target scheduling scheme.

[0018] In one possible implementation, according to the relationship between the difference and the duration threshold, a scheduling scheme that meets the total scheduling duration constraint is obtained based on the scheduling scheme before adjustment or the adjusted scheduling scheme, including: based on the difference being less than the duration threshold and the number of adjustments not reaching the number of iterations, performing a second move operation on the second task in the adjusted scheduling scheme until a scheduling scheme that meets the total scheduling duration constraint is obtained, the second task being any one of the tasks in the adjusted scheduling scheme.

[0019] In one possible implementation, the method of obtaining a scheduling scheme that meets the total scheduling duration constraint based on the scheduling scheme before adjustment or the adjusted scheduling scheme according to the relationship between the difference and the duration threshold includes: determining the acceptance probability of the adjusted scheduling scheme based on the difference being greater than the duration threshold and the number of adjustments not reaching the number of iterations; performing a second move operation on the second task in the adjusted scheduling scheme based on the acceptance probability reaching the threshold, until a scheduling scheme that meets the total scheduling duration constraint is obtained, the second task being any one of the tasks in the adjusted scheduling scheme; or, performing a second move operation on the third task in the scheduling scheme before adjustment based on the acceptance probability not reaching the threshold, until a scheduling scheme that meets the total scheduling duration constraint is obtained, the third task being any one of the tasks in the scheduling scheme before adjustment.

[0020] In one possible implementation, the method of obtaining a scheduling scheme that satisfies the total scheduling duration constraint based on the scheduling scheme before adjustment or the adjusted scheduling scheme according to the relationship between the difference and the duration threshold includes: determining the acceptance probability of the adjusted scheduling scheme based on the difference being greater than the duration threshold and the number of adjustments reaching the number of iterations; using the adjusted scheduling scheme as the scheduling scheme that satisfies the total scheduling duration constraint based on the acceptance probability reaching the threshold; or using the scheduling scheme before adjustment as the scheduling scheme that satisfies the total scheduling duration constraint based on the acceptance probability not reaching the threshold.

[0021] In a second aspect, a task scheduling device is provided, the device comprising:

[0022] A determination module is used to determine multiple tasks that need to be scheduled;

[0023] The determining module is further configured to determine a target scheduling solution based on the dependency relationships between the multiple tasks, wherein the target scheduling solution satisfies the dependency constraints between the multiple tasks and the total scheduling duration constraints;

[0024] The scheduling module is used to allocate the multiple tasks to corresponding computing units according to the target scheduling scheme, and process the allocated tasks through the computing units.

[0025] In one possible implementation, the determination module is used to construct a directed acyclic graph corresponding to the multiple tasks based on the dependency relationship between the multiple tasks, the directed acyclic graph including multiple nodes and directed edges, one node corresponding to one task, the nodes corresponding to the tasks with dependency relationships are connected by the directed edges, and the direction of the directed edges is used to indicate the dependency relationship between the tasks corresponding to the nodes connected by the directed edges; the directed acyclic graph is segmented to obtain a segmentation result, the segmentation rate corresponding to the segmentation result is less than a threshold; and a target scheduling plan is determined based on the segmentation result.

[0026] In one possible implementation, the determination module is used to determine the scheduling time of each task corresponding to each segmentation result by using a greedy scheduling method, and determine the total scheduling duration based on the scheduling time of each task; determine the initial scheduling result based on the total scheduling duration; adjust the initial scheduling result to obtain an adjusted scheduling plan; if the adjusted scheduling plan satisfies the total scheduling duration constraint, use the adjusted scheduling plan as the target scheduling plan.

[0027] In a possible implementation, the determination module is used to perform a first move operation on the first task in the initial scheduling result, and obtain the adjusted scheduling plan according to the result after the first move operation, where the first task is any task in the initial scheduling result.

[0028] In one possible implementation, the determination module is used to move the first task from a first computing unit to a second computing unit, where the first computing unit is the computing unit to which the first task is assigned in the initial scheduling result, and the second computing unit is different from the first computing unit.

[0029] In one possible implementation, the determination module is used to move the first task from a first position to a second position, where the first position is the position of the first task in the computing unit assigned in the initial scheduling result, and the second position is other positions in the computing unit assigned to the first task in the initial scheduling result, and the first position is different from the second position.

[0030] In one possible implementation, the determination module is used to move the first task from the first position to a third position, where the third position is the nearest idle time position before the position of the first task in the computing unit assigned in the initial scheduling result, and the third position is different from the first position.

[0031] In one possible implementation, the determination module is also used to determine the difference between the total scheduling duration corresponding to the adjusted scheduling scheme and the total scheduling duration corresponding to the scheduling scheme before adjustment; when the difference is less than the duration threshold and the number of adjustments reaches the number of iterations, it is determined that the adjusted scheduling scheme meets the total scheduling duration constraint.

[0032] In one possible implementation, the determination module is also used to determine the difference between the total scheduling duration corresponding to the adjusted scheduling scheme and the total scheduling duration corresponding to the scheduling scheme before adjustment when the adjusted scheduling scheme does not meet the total scheduling duration constraint; according to the relationship between the difference and the duration threshold, based on the scheduling scheme before adjustment or the adjusted scheduling scheme, obtain a scheduling scheme that meets the total scheduling duration constraint, and use the scheduling scheme that meets the total scheduling duration constraint as the target scheduling scheme.

[0033] In one possible implementation, the determination module is used to perform a second move operation on the second task in the adjusted scheduling scheme based on the difference being less than the duration threshold and the number of adjustments not reaching the number of iterations, until a scheduling scheme that meets the total scheduling duration constraint is obtained, and the second task is any one of the tasks in the adjusted scheduling scheme.

[0034] In one possible implementation, the determination module is used to determine the acceptance probability of the adjusted scheduling scheme based on the difference being greater than a duration threshold and the number of adjustments not reaching the number of iterations; based on the acceptance probability reaching the threshold, perform a second move operation on the second task in the adjusted scheduling scheme until a scheduling scheme that meets the total scheduling duration constraint is obtained, and the second task is any one of the tasks in the adjusted scheduling scheme; or, based on the acceptance probability not reaching the threshold, perform a second move operation on the third task in the scheduling scheme before adjustment until a scheduling scheme that meets the total scheduling duration constraint is obtained, and the third task is any one of the tasks in the scheduling scheme before adjustment.

[0035] In one possible implementation, the determination module is used to determine the acceptance probability of the adjusted scheduling scheme based on the difference being greater than a duration threshold and the number of adjustments reaching an iteration number; based on the acceptance probability reaching the threshold, use the adjusted scheduling scheme as a scheduling scheme that meets the total scheduling duration constraint; or, based on the acceptance probability not reaching the threshold, use the scheduling scheme before adjustment as a scheduling scheme that meets the total scheduling duration constraint.

[0036] In a third aspect, a task scheduling device is provided, the device including a processor; the processor is used to load and execute at least one instruction so that the computing device implements any task scheduling method described in the first aspect.

[0037] In a possible implementation, the task scheduling device further includes a memory, where the memory is used to store at least one instruction.

[0038] In a fourth aspect, a computer-readable storage medium is provided, in which at least one instruction is stored. The instruction is loaded and executed by a processor to implement any task scheduling method described in the first aspect.

[0039] In a fifth aspect, a computer program (product) is provided, which includes: computer program code or instructions, which, when executed by a computer, enables the computer to execute the method in the above-mentioned first aspect or any possible implementation of the first aspect.

[0040] In a sixth aspect, a task scheduling device is provided, comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other via an internal connection path; the memory is configured to store instructions; and the processor is configured to execute the instructions stored in the memory to control the transceiver to receive signals and to control the transceiver to transmit signals. When the processor executes the instructions stored in the memory, the processor executes the method according to the first aspect or any possible implementation of the first aspect.

[0041] Optionally, there are one or more processors and one or more memories.

[0042] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

[0043] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated on the same chip as the processor or be set on different chips. This application does not limit the type of memory and the setting method of the memory and the processor.

[0044] In the seventh aspect, a chip is provided, comprising a processor for calling and executing program instructions or codes stored in a memory from the memory, so that a communication device equipped with the chip executes any of the methods described in the first aspect above.

[0045] In the eighth aspect, another chip is provided, comprising: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute any one of the methods described in the first aspect above.

[0046] It should be understood that the beneficial effects achieved by the technical solutions of the second to eighth aspects and the corresponding possible implementation methods can be referred to the technical effects of the first aspect and its corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] FIG1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0048] FIG2 is a flow chart of a task scheduling method provided in an embodiment of the present application;

[0049] FIG3 is a schematic diagram of a directed acyclic graph and a scheduling result provided in an embodiment of the present application;

[0050] FIG4 is a schematic diagram of an initial scheduling process provided in an embodiment of the present application;

[0051] FIG5 is a schematic diagram of a mobile operation process provided by an embodiment of the present application;

[0052] FIG6 is a schematic diagram of a task scheduling process provided in an embodiment of the present application;

[0053] FIG7 is a schematic diagram of another task scheduling process provided in an embodiment of the present application;

[0054] FIG8 is a schematic diagram of the structure of a task scheduling device provided in an embodiment of the present application;

[0055] FIG9 is a schematic structural diagram of a computer device provided in an embodiment of the present application;

[0056] FIG10 is a schematic structural diagram of another computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0058] In the computing field, the types of tasks that need to be processed are increasing, and so are the scenarios for task scheduling. For example, the entire computing process can be divided into different computing tasks and then scheduled. Through task scheduling methods, different computing tasks are divided into different computing units, allowing the computing units to calculate different tasks in an orderly manner, thereby efficiently completing the computing requirements of the entire computing process.

[0059] Multiple tasks that require scheduling often have dependencies. For example, for tasks A and B, Task A must complete first, and Task B can only be executed based on the results of Task A. When two dependent tasks are processed on different computing units, data transmission and communication costs occur. For example, in an autonomous vehicle scenario, the vehicle is equipped with data from multiple cameras, including but not limited to LiDAR, millimeter-wave radar, fisheye lens, front camera, rear camera, and various body sensors. Overall autonomous driving decisions require this data to be fed into a neural network model, which then analyzes and calculates the data to produce accurate and effective driving decisions. In this scenario, the entire computing process must be efficient and low-latency. Furthermore, when processing multiple tasks corresponding to this computational process on multiple computing units, it is necessary to control data transmission to improve overall computing efficiency.

[0060] However, since the computing tasks on the autonomous driving chip in the autonomous driving scenario are interdependent, if a fixed scheduling priority is used to schedule the tasks, the computing time requirements and the dependencies between tasks are not fully considered, resulting in the inability to fully utilize hardware resources and reduced computing efficiency.

[0061] In this regard, an embodiment of the present application provides a task scheduling method. This method is aimed at big data traffic processing scenarios such as vehicle autonomous driving with multiple information sources input, or other scenarios with limited bandwidth or data transmission. After dividing the computing process into different tasks, each task is assigned to the corresponding computing unit, and the time when each task starts execution is determined. Under the condition of satisfying dependency constraints, the overall scheduling time is minimized, thereby also satisfying the total scheduling duration constraint. For example, the method provided in an embodiment of the present application can abstract multiple tasks into a directed acyclic graph (DAG), and by segmenting and scheduling the directed acyclic graph, multiple tasks are allocated to computing units such as chips or computing cores, thereby reducing the overall running time and improving operating efficiency.

[0062] Referring to Figure 1, a schematic diagram of an implementation environment of the task scheduling method provided in an embodiment of the present application is shown, and the implementation environment includes but is not limited to a task scheduling device 101 and a computing unit 102. As shown in Figure 1, each computing unit 102 is communicatively connected to the task scheduling device 101 in a wired or wireless manner. There are multiple computing units 102, and Figure 1 only illustrates three computing units 102 as an example. Among them, the embodiment of the present application does not limit the product form of the task scheduling device 101 and the computing unit 102. For example, the task scheduling device 101 can be a scheduler, a controller, a server, a server cluster, a separate communication device, or any other device that can implement task scheduling. The computing unit 102 can be a processor, a chip including a processor, or a processor core (core) of a processor, etc.

[0063] Taking the implementation environment shown in FIG1 as an example, referring to FIG2 , the task scheduling method provided in the embodiment of the present application includes the following steps 201 to 203 .

[0064] In step 201, a plurality of tasks that need to be scheduled are determined.

[0065] In the embodiment of the present application, the types and quantities of multiple tasks that need to be scheduled are not limited and can be determined based on the application scenario or based on input. For example, the computational process that needs to be scheduled is divided into multiple different computational tasks and put into a computational task list. The tasks that need to be scheduled are determined by the computational task list. The task list can be recorded as a one-dimensional array D i , i=1, 2, 3...represent the first task, the second task, the third task...the i-th task respectively, and i is a positive integer.

[0066] In step 202, a target scheduling solution is determined based on the dependency relationships among the multiple tasks, where the target scheduling solution satisfies the dependency constraints among the multiple tasks and the total scheduling duration constraints.

[0067] The dependency relationship between multiple tasks refers to the execution order relationship between the multiple tasks. For example, take the three tasks to be processed as Task A, Task B, and Task C. Task B needs to be executed after Task A, and Task C needs to be executed after Task B. Then the dependency relationship between Task A, Task B, and Task C is: Task B depends on Task A, and Task C depends on Task B. The target scheduling scheme needs to satisfy the dependency constraints between multiple tasks, which means that the target scheduling scheme needs to schedule multiple tasks according to the dependency relationships between the multiple tasks.

[0068] For tasks with dependencies, the method provided in the embodiment of the present application abstracts multiple tasks into a directed acyclic graph and performs task scheduling based on the directed acyclic graph. The goal of the overall scheduling is to minimize the overall scheduling time while satisfying the dependency constraints, that is, to satisfy the total scheduling duration constraint. In one possible implementation, the target scheduling scheme is determined based on the dependency relationships between multiple tasks, including but not limited to the following steps 21-23.

[0069] In step 2021, based on the dependency relationship between multiple tasks, a directed acyclic graph corresponding to the multiple tasks is constructed. The directed acyclic graph includes multiple nodes and directed edges. One node corresponds to one task. The nodes corresponding to the tasks with dependency relationships are connected by directed edges. The direction of the directed edge is used to indicate the dependency relationship between the tasks corresponding to the nodes connected by the directed edge.

[0070] The embodiment of the present application does not limit the method of constructing a directed acyclic graph corresponding to multiple tasks based on the dependency relationship between multiple tasks. For example, after determining multiple tasks, the dependency relationship between the multiple tasks can be determined, and the multiple tasks can be used as nodes of the directed acyclic graph respectively. The nodes with dependency relationships are connected with directed edges to obtain a directed acyclic graph. For example, the directed acyclic graph constructed for multiple tasks is graph G. If G ij =1, indicating task D i and Task D j There is a dependency relationship between them, and they need to wait for task D j After the operation is completed, task D can be run i , and if task D i and Task D j If the data is divided into different computing units, data transmission or data handling is required.

[0071] For ease of understanding, take the directed acyclic graph shown on the left side of Figure 3 as an example. The directed acyclic graph shows the dependency relationship between the 9 tasks numbered 1-9. As shown in Figure 3, Task 2 and Task 3 depend on Task 1 respectively, and the edge between Task 1 and Task 3 is represented by G 13 , the edge between task 2 and task 3 is represented as G 23 ; Task 4 depends on Task 2, and the edge between Task 2 and Task 4 is represented by G 24 ; Task 5 depends on Task 2 and Task 3 respectively, and the edge between Task 2 and Task 5 is represented by G 25 , the edge between task 5 and task 3 is represented by G 35 ; Task 6 depends on Task 3, and the edge between Task 3 and Task 6 is represented by G 36 ; Task 7 depends on Task 4, and the edge between Task 7 and Task 4 is represented by G 47; Task 8 depends on Task 5 and Task 6, and the edge between Task 6 and Task 8 is represented by G 68 , the edge between task 5 and task 8 is represented by G 58 ; Task 9 depends on Task 7 and Task 8, and the edge between Task 7 and Task 9 is represented by G 79 , the edge between task 8 and task 9 is represented by G 89 .

[0072] In step 2022, the directed acyclic graph is segmented to obtain a segmentation result, and the segmentation result corresponds to a cutting edge rate less than a threshold.

[0073] In an embodiment of the present application, splitting a directed acyclic graph means assigning the original computing task to a certain computing unit, and grouping multiple tasks according to the computing unit so that the number of edges between different groups is small. There are many methods for splitting a directed acyclic graph, and the size of the number of cut edges can be adjusted by parameters so that the splitting result meets the constraint of the cut edge rate. The embodiment of the present application does not limit the way in which a directed acyclic graph is split. For tasks with dependencies, it is necessary to achieve efficient scheduling of these tasks on multiple computing units that meet the dependency constraints. However, in scenarios such as autonomous driving of vehicles, for data transmission of tasks, because the bandwidth is limited, when the number of data transmissions is too many, that is, the number of cut edges of the DAG graph is too many, it will slow down the system performance. Therefore, when allocating and scheduling computing tasks, it is necessary to limit the proportion of the number of data transmissions, that is, to split the DAG, and after obtaining the split result, it is necessary to constrain the cut ratio (CR) of the split result.

[0074] For example, the original DAG graph can be segmented by balancing the minimum cut class method to obtain multiple segmentation results that meet the pruning rate constraint condition, so that the pruning rate corresponding to the segmentation result is less than a threshold. The embodiment of the present application does not limit the threshold value. It can be set based on experience, based on the application scenario, and can also be adjusted according to actual conditions. For example, the threshold value can be 0.4, so it is necessary to meet the CR of the segmentation result < 0.4.

[0075] The trimming rate can be expressed by the following formula:

[0076] For ease of understanding, take the directed acyclic graph shown on the left side of Figure 3 as an example. The directed acyclic graph shows the dependency relationship between the 9 tasks numbered 1-9. As shown in Figure 3, if the edge G between task 1 and task 3 is 13 , edge G between task 3 and task 6 36 , edge G between task 2 and task 4 24 , edge G between task 2 and task 5 25 , edge G between task 5 and task 858 , edge G between task 6 and task 8 68 , edge G between task 7 and task 9 79 , edge G between task 8 and task 9 89 To split, that is, G 13 , G 36 , G 24 , G 25 , G 58 , G 68 , G 79 and G 89 All of them are split edges, and the number of split edges is 8, while the total number of edges in the directed acyclic graph is 11. The pruning rate CR = 8 / 11, which is approximately 0.73. Still taking the pruning rate threshold of 0.4 as an example, since the pruning rate corresponding to the current pruning result is not less than the threshold, it is necessary to re-split until a pruning result that satisfies the pruning rate is less than the threshold is obtained. The overall input and output effect is shown in Figure 3. By abstractly modeling the problem, the directed acyclic graph shown on the left is obtained. Then, through allocation scheduling, the task time allocation scheduling diagram on the right is obtained (5 computing units are used as an example in Figure 3).

[0077] For example, the following uses the Metis algorithm package as an example to illustrate the method of segmenting a directed acyclic graph. First, set Metis to segment the weighted DAG, and the number of segments is the number of computing units. The goal is to minimize the number of cut edges, that is, the cut edge rate is less than the threshold. Afterwards, the weight of each node is set to the duration of each computing task, and the number of cut edges corresponds to the number of data transmissions between computing units. In the Metis algorithm package, the ufactor parameter can be used to control the tolerance of the result to imbalance, so the initial setting of ufactor=1 makes the result balance requirement strict and the number of cut edges large, and then increases the ufactor, reduces the balance requirement, reduces the number of cut edges and the cut edge rate, thereby obtaining multiple solutions that meet the cut edge rate constraint, that is, obtains multiple segmentation results with a cut edge rate less than the threshold.

[0078] In step 2023, a target scheduling solution is determined based on the segmentation result.

[0079] The target scheduling scheme is determined based on the segmentation results, including but not limited to the following steps A and B. Step A can be considered as the initial scheduling process, and step B is the iterative update process.

[0080] In step A, a greedy scheduling method is used to determine the scheduling time of each task corresponding to each segmentation result, and the total scheduling duration is determined according to the scheduling time of each task; and the initial scheduling result is determined according to the total scheduling duration.

[0081] After determining the computational unit for each task, the initial scheduling process then uses a greedy approach to schedule tasks as early as possible while satisfying task dependency constraints. This results in a series of initial solutions that satisfy both dependency constraints and the edge-cutting rate constraint. The optimal solution, that is, the one with the shortest total scheduling duration, is selected as the initial solution for step B.

[0082] In step A, because there is a dependency relationship between tasks, if there is an edge D in the DAG graph ij If , task i must complete before task j can be executed. To obtain an initial scheduling solution that satisfies dependency constraints, after determining that each task will run on a specific compute unit, the specific execution time can be determined according to the following process. The process of step A is shown in Figure 4. First, the original DAG is topologically sorted. Next, the runtime of each task is scheduled according to the topological sort order, and each task is assigned to a specific compute unit. Execution begins when all dependent tasks have completed. This results in a complete initialization result, i.e., multiple randomly generated partitioning schemes, resulting in multiple different initial scheduling solutions, such as Schedule 1 to Schedule N in Figure 4, where N is a positive integer greater than 1. Among these initial scheduling solutions, the solution with the shortest total scheduling duration is selected as the initial scheduling solution, which serves as the initial value for the iterative optimization solution in step B. In other words, step A, through the balanced minimum cut method combined with the greedy strategy, can initially obtain an initialization solution that satisfies both the task dependency constraints and the edge-cutting rate constraints, facilitating subsequent iterative optimization processes.

[0083] Step B: Adjust the initial scheduling result to obtain an adjusted scheduling plan; if the adjusted scheduling plan meets the total scheduling duration constraint, the adjusted scheduling plan is used as the target scheduling plan.

[0084] In the embodiment of the present application, the method for adjusting the initial scheduling result is not limited. For example, the initial scheduling result can be optimized based on the simulated annealing method framework, including but not limited to the following steps.

[0085] Step 1: Initialize the solution of the simulated annealing algorithm based on the initial scheduling result, set the initial temperature T and the maximum number of iterations L.

[0086] Step 2: Calculate the initial total scheduling time S.

[0087] Among them, T, L and S in the above-mentioned first and second steps can be set based on experience, based on application scenarios, or adjusted according to actual conditions. The embodiment of the present application does not limit the values ​​of T, L and S.

[0088] Step 3: Randomly select a move operation and calculate its impact on the total scheduling time, and record the difference as ΔS.

[0089] The third step is the process of adjusting the initial scheduling result to obtain an adjusted scheduling plan, which includes but is not limited to: performing a first move operation on the first task in the initial scheduling result, and obtaining an adjusted scheduling plan based on the result after the first move operation, where the first task is any task in the initial scheduling result.

[0090] The first move operation is performed on the first task in the initial scheduling result, including but not limited to at least one of the following move operation modes.

[0091] The first moving operation mode is to move the first task from the first computing unit to the second computing unit. The first computing unit is the computing unit to which the first task is allocated in the initial scheduling result, and the second computing unit is different from the first computing unit.

[0092] In the first moving operation mode, the first task can be any task in the initial scheduling result, that is, the first task is moved from one computing unit to another computing unit, thereby adjusting the initial scheduling result. The embodiment of the present application does not limit the position of the second computing unit to which the first task is moved.

[0093] The second moving operation mode is to move the first task from the first position to the second position, where the first position is the position of the first task in the computing unit assigned in the initial scheduling result, and the second position is another position of the first task in the computing unit assigned in the initial scheduling result, and the first position is different from the second position.

[0094] The second moving operation mode is to move the first task from one position of the same computing unit to another position. The embodiment of the present application does not limit the second position to which the first task is moved. The second moving operation mode adjusts the initial scheduling result through position adjustment.

[0095] The third moving operation mode is to move the first task from the first position to the third position. The third position is the nearest idle time position before the position of the first task in the computing unit allocated in the initial scheduling result. The third position is different from the first position.

[0096] Because shift operation method three can reduce the problem of excessively long idle time intervals in the scheduling results, it can achieve a high-performance solution and improve algorithm optimization. As shown in Figure 5, shift operation method three randomly selects the idle time of a computing unit in the time schedule graph and considers the following operations only for the computing tasks on this computing unit. For example, idle time 1 and the corresponding computing unit 1 in Figure 5 are assumed to be the tasks immediately preceding and following idle time 1 (as shown in Figure 5). Task 3 is the task before the next idle time (idle time 2 in Figure 5) (or the last task if there is no subsequent idle time). For each task in [task 2, task 3] (that is, the task currently scheduled after task 2 and before task 3), if the task can be executed as early as possible and can complete before task 2 starts (filling the idle time) while satisfying the DAG constraints, then the task is added to the candidate list. A task is randomly selected from the candidate list and inserted into the position of the earliest idle time found. This fills the idle time in the computing unit and adjusts the initial scheduling results.

[0097] Regardless of which of the above shifting operations is used, after adjusting the initial schedule to obtain the adjusted schedule, the total scheduling duration of the adjusted schedule can be calculated. For example, the start execution time of each task in the adjusted schedule can be accumulated to obtain the total scheduling duration. The total scheduling duration of the adjusted schedule can then be subtracted from the total scheduling duration of the original schedule to obtain the difference, which is ΔS.

[0098] Step 4: If ΔS < 0, then accept the current time schedule, otherwise accept the new time schedule with a probability of exp(-ΔS / T).

[0099] If ΔS<0, it means that the total scheduling duration of the adjusted scheduling scheme is less than the scheduling scheme before adjustment, and thus the adjusted scheduling scheme can be accepted as the current time scheduling diagram. If ΔS is greater than or equal to 0, it means that the total scheduling duration of the adjusted scheduling scheme is not less than the scheduling scheme before adjustment. Whether to accept the adjusted scheduling scheme requires further calculation of the probability of acceptance of the adjusted scheduling scheme, that is, the acceptance probability of the adjusted scheduling scheme. Exemplarily, the acceptance probability can be calculated using exp(-ΔS / T) as an example, but this application does not limit the calculation method of the acceptance probability, and other calculation methods of the acceptance probability can also be used. Functions that decrease with the number of iterations (equivalent to the cooling of the physical process) can be applied to the fourth step, and in practical applications, it can be determined by the spatial shape of the searched energy function.

[0100] Step 5: As the number of iterations increases, gradually reduce the temperature T and repeat steps 3 and 4 until the maximum number of iterations L is reached.

[0101] Step 6: Output the final time scheduling execution plan diagram, which is also the target scheduling result.

[0102] Regardless of which of the above-mentioned moving operation methods is adopted in the third step, for the above-mentioned steps 3 to 6, in a possible implementation method, the initial scheduling result is adjusted, and after the adjusted scheduling plan is obtained, the process of determining the target scheduling plan includes but is not limited to the following situations.

[0103] Case 1: Determine the difference between the total scheduling duration corresponding to the adjusted scheduling plan and the total scheduling duration corresponding to the scheduling plan before adjustment; if the difference is less than the duration threshold and the number of adjustments reaches the number of iterations, determine that the adjusted scheduling plan meets the total scheduling duration constraint.

[0104] The duration threshold can be set based on experience or based on an application scenario. The embodiment of the present application does not limit the duration threshold. Since the difference between the total scheduling duration corresponding to the adjusted scheduling scheme and the total scheduling duration corresponding to the scheduling scheme before the adjustment is less than the duration threshold, it means that the adjusted scheduling scheme itself is better than the scheduling duration of the scheduling scheme before the adjustment, and the number of adjustments reaches the number of iterations. Therefore, the adjusted scheduling scheme can be directly used as the target scheduling scheme that meets the total scheduling duration constraint.

[0105] Case 2: When the adjusted scheduling plan does not meet the total scheduling time constraint, determine the difference between the total scheduling time corresponding to the adjusted scheduling plan and the total scheduling time corresponding to the scheduling plan before adjustment; according to the relationship between the difference and the time threshold, obtain a scheduling plan that meets the total scheduling time constraint based on the scheduling plan before adjustment or the adjusted scheduling plan, and use the scheduling plan that meets the total scheduling time constraint as the target scheduling plan.

[0106] In case 2, according to the relationship between the difference and the duration threshold, a scheduling plan that meets the total scheduling duration constraint is obtained based on the scheduling plan before adjustment or the scheduling plan after adjustment, including but not limited to the following cases.

[0107] In case 2.1, based on the difference being less than the duration threshold and the number of adjustments not reaching the number of iterations, a second move operation is performed on the second task in the adjusted scheduling scheme until a scheduling scheme that meets the total scheduling duration constraint is obtained. The second task is any task in the adjusted scheduling scheme.

[0108] Since the difference between the total scheduling duration corresponding to the adjusted scheduling scheme and the total scheduling duration corresponding to the scheduling scheme before the adjustment is less than the duration threshold, it means that the adjusted scheduling scheme itself is better than the scheduling duration of the scheduling scheme before the adjustment, but the number of adjustments has not reached the number of iterations, so the iteration can continue, that is, the adjusted scheduling scheme is continued to be adjusted until the number of adjustments reaches the number of iterations, and a scheduling scheme that meets the total scheduling duration constraint is obtained, and the scheduling scheme that meets the total scheduling duration constraint is used as the target scheduling scheme. Among them, the embodiment of the present application does not limit the second task, which can be any task in the adjusted scheduling scheme, and the second task can be the same as the first task or different from the first task.

[0109] In case 2.2, based on the difference being greater than the duration threshold and the number of adjustments not reaching the number of iterations, the acceptance probability of the adjusted scheduling plan is determined; based on the acceptance probability reaching the threshold, a second move operation is performed on the second task in the adjusted scheduling plan until a scheduling plan that meets the total scheduling duration constraint is obtained, and the second task is any task in the adjusted scheduling plan.

[0110] For this situation 2.2, since the difference between the total scheduling duration corresponding to the adjusted scheduling scheme and the total scheduling duration corresponding to the scheduling scheme before adjustment is greater than the duration threshold, it means that the adjusted scheduling scheme is longer than the scheduling duration of the scheduling scheme before adjustment, and is not the optimal scheme. Since the number of adjustments has not reached the number of iterations, the iteration can continue, but whether to continue iterating with the scheduling scheme before adjustment or with the adjusted scheduling scheme requires further determination of the acceptance probability of the adjusted scheduling scheme. The calculation method of the acceptance probability can refer to the relevant description in the fourth step above. When the acceptance probability reaches the threshold, it means that the adjusted scheduling scheme can be accepted, and the adjusted scheduling scheme is continued to be adjusted until the number of adjustments reaches the number of iterations to obtain a scheduling scheme that meets the total scheduling duration constraint. The scheduling scheme that meets the total scheduling duration constraint is used as the target scheduling scheme. Among them, the embodiment of the present application does not limit the second task, which can be any task in the adjusted scheduling scheme. The second task can be the same as the first task or different from the first task.

[0111] In case 2.3, based on the difference being greater than the duration threshold and the number of adjustments not reaching the number of iterations, the acceptance probability of the adjusted scheduling scheme is determined; based on the acceptance probability not reaching the threshold, a second move operation is performed on the third task in the scheduling scheme before adjustment until a scheduling scheme that meets the total scheduling duration constraint is obtained, where the third task is any task in the scheduling scheme before adjustment.

[0112] The difference between case 2.3 and case 2.2 is that the acceptance probability does not reach the threshold, so it is necessary to continue iteration with the scheduling scheme before adjustment. The third task can be the same as or different from the first task or the second task, and this embodiment of the application does not limit this.

[0113] In case 2.4, based on the difference being greater than the duration threshold and the number of adjustments reaching the number of iterations, the acceptance probability of the adjusted scheduling plan is determined; based on the acceptance probability reaching the threshold, the adjusted scheduling plan is used as the scheduling plan that meets the total scheduling duration constraint.

[0114] In case 2.4, since the difference between the total scheduling duration corresponding to the adjusted scheduling plan and the total scheduling duration corresponding to the scheduling plan before adjustment is greater than the duration threshold, it means that the scheduling duration of the adjusted scheduling plan is longer than that of the scheduling plan before adjustment and is not the optimal plan. However, since the acceptance probability reaches the threshold, the adjusted scheduling plan is acceptable, and since the number of adjustments reaches the number of iterations, the adjusted scheduling plan is used as the scheduling plan that meets the total scheduling duration constraint.

[0115] In case 2.5, based on the difference being greater than the duration threshold and the number of adjustments reaching the number of iterations, the acceptance probability of the adjusted scheduling plan is determined; based on the acceptance probability not reaching the threshold, the scheduling plan before adjustment is used as the scheduling plan that meets the total scheduling duration constraint.

[0116] In case 2.5, since the difference between the total scheduling duration corresponding to the adjusted scheduling plan and the total scheduling duration corresponding to the scheduling plan before adjustment is greater than the duration threshold, it means that the scheduling duration of the adjusted scheduling plan is longer than that of the scheduling plan before adjustment and is not the optimal plan. Moreover, since the acceptance probability does not reach the threshold, that is, the adjusted scheduling plan is not accepted, and since the number of adjustments reaches the number of iterations, the scheduling plan before adjustment is used as the scheduling plan that meets the total scheduling duration constraint.

[0117] In step 203, multiple tasks are assigned to corresponding computing units according to the target scheduling scheme, and the assigned tasks are processed by the computing units.

[0118] Based on steps 201-203 above, taking the scheduling of computing tasks as an example, the task scheduling process can be illustrated in Figure 6. After a computing task is input, the overall framework is divided into two parts: the first part is the abstract modeling of the computing task, and the second part is the solution of the abstract problem by the scheduling module. These two parts are executed sequentially. The abstract modeling part is further divided into directed acyclic graph construction, task graph node attribute construction, task graph edge attribute construction, and processor modeling. The original task is converted into a DAG graph, and information such as computational load and computation time are constructed as graph node information. Data transmission volume and data transmission delay are constructed as task graph edge attributes. Processor performance is constructed as computing unit capabilities. During scheduling, based on the results of the abstract modeling, computing tasks are scheduled under constraints such as dependencies and communication volume (i.e., the pruning rate), resulting in the optimal scheduling and pruning results. The overall scheduling part is further divided into initial solution and iterative optimization. The balanced minimum cut method is used to quickly obtain an initial solution that meets the pruning rate constraint. This is then further optimized through an iterative approach, i.e., the iterative solution optimization shown in Figure 6, to optimize the final solution as much as possible, resulting in the optimal target scheduling solution. Afterwards, the tasks are scheduled and deployed according to the results, that is, according to the target scheduling plan.

[0119] In addition, the task scheduling method can also be embodied through the process shown in FIG7 , which realizes performance scheduling optimization after abstract modeling of the scene. For example, the basic information of the task and the computing unit is obtained, and a directed acyclic graph is generated based on the basic information. The vertex label information, i.e., the label information and edge label information of each node, and the processor modeling, i.e., the computing unit, is determined. After that, an initial pre-scheduling is performed, and iterative optimization is performed based on the result of the initial pre-scheduling, so as to obtain a target scheduling scheme that satisfies the dependency constraints and the total scheduling duration constraints, and the scheduling is performed according to the target scheduling scheme. Among them, the various processes shown in FIG7 can refer to the above-mentioned steps 201 to 203, which will not be repeated here.

[0120] The tasks are scheduled by the method provided in the embodiment of the present application, and the comparative results can be obtained by simulation experiments. In terms of time excellence, for the same task data set, the total scheduling duration obtained by the method provided in the embodiment of the present application is shorter than the simulated annealing method in the related art. When the number of computing units is fixed, the effect stability of the method provided in the embodiment of the present application is also better than the simulated annealing method in the related art, and multiple experiments can obtain relatively good results.

[0121] In addition, the method provided by the embodiment of the present application is not only applicable to vehicle autonomous driving scenarios, but also to resource allocation and scheduling of task graphs in other application scenarios, such as artificial intelligence (AI) training scenarios. Due to data transmission dependencies between tasks between operators, balanced task deployment is required in such scenarios to adapt computing power while minimizing data transmission volume. This type of problem is equivalent to the balanced minimum cut problem. The deployment and scheduling of AI training scenario computation graphs using the method provided by the embodiment of the present application also has similar effects to vehicle autonomous driving scenarios, and can effectively improve the scheduling performance of control under certain data transmission constraints.

[0122] The method provided in the embodiment of the present application determines a target scheduling scheme that not only satisfies dependency constraints but also satisfies total scheduling duration constraints, thereby reducing the dependency of computing tasks between different computing units and reducing the amount of data transmitted between different computing units, thereby improving the scheduling efficiency when scheduling tasks between multiple computing units, reducing bandwidth costs, and improving processing efficiency.

[0123] In addition, the method is based on the idea of ​​step-by-step optimization. As the number of tasks and the number of computing units increase, it provides balanced computing resource utilization and a limited amount of data handling, and has excellent scalability. The method provided in the embodiment of the present application also avoids the situation where the scheduling flexibility is not high due to the pruning rate constraint when directly using the greedy method, and a legal solution cannot be obtained. Furthermore, the method provided in the embodiment of the present application obtains a better simulated annealing initialization solution through the mobile operation, which improves the effect of the later iterative optimization. Compared with the simulated annealing method in the related art, it fills the idle time, improves the utilization efficiency, and shortens the scheduling time.

[0124] The above describes the task scheduling method provided by the embodiment of the present application. Corresponding to the above method, the embodiment of the present application also provides a task scheduling device. Figure 8 is a structural diagram of a task scheduling device provided by the embodiment of the present application, and the device is applied to a task scheduling device. Based on the following multiple modules shown in Figure 8, the task scheduling device shown in Figure 8 can perform all or part of the operations performed by the task scheduling device. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown therein, and the embodiment of the present application does not limit this. As shown in Figure 8, the device includes:

[0125] Determining module 801, used to determine multiple tasks that need to be scheduled;

[0126] The determination module 801 is further configured to determine a target scheduling solution based on the dependency relationships between the multiple tasks, where the target scheduling solution satisfies the dependency constraints between the multiple tasks and the total scheduling duration constraint;

[0127] The scheduling module 802 is used to allocate multiple tasks to corresponding computing units according to the target scheduling plan, and process the allocated tasks through the computing units.

[0128] In one possible implementation, the determination module 801 is used to construct a directed acyclic graph corresponding to multiple tasks based on the dependency relationship between the multiple tasks, where the directed acyclic graph includes multiple nodes and directed edges, one node corresponds to one task, and the nodes corresponding to the tasks with dependency relationships are connected by directed edges, and the direction of the directed edges is used to indicate the dependency relationship between the tasks corresponding to the nodes connected by the directed edges; the directed acyclic graph is segmented to obtain a segmentation result, and the segmentation rate corresponding to the segmentation result is less than a threshold; and a target scheduling plan is determined based on the segmentation result.

[0129] In one possible implementation, the determination module 801 is used to determine the scheduling time of each task corresponding to each segmentation result by adopting a greedy scheduling method, and determine the total scheduling duration according to the scheduling time of each task; determine the initial scheduling result according to the total scheduling duration; adjust the initial scheduling result to obtain an adjusted scheduling plan; and when the adjusted scheduling plan satisfies the total scheduling duration constraint, use the adjusted scheduling plan as the target scheduling plan.

[0130] In a possible implementation, the determination module 801 is configured to perform a first move operation on a first task in the initial scheduling result, and obtain an adjusted scheduling solution according to a result after the first move operation. The first task is any task in the initial scheduling result.

[0131] In a possible implementation, the determination module 801 is configured to move the first task from a first computing unit to a second computing unit, where the first computing unit is the computing unit to which the first task is allocated in the initial scheduling result, and the second computing unit is different from the first computing unit.

[0132] In one possible implementation, the determination module 801 is used to move the first task from a first position to a second position, where the first position is the position of the first task in the computing unit assigned in the initial scheduling result, and the second position is another position of the first task in the computing unit assigned in the initial scheduling result, and the first position is different from the second position.

[0133] In one possible implementation, the determination module 801 is used to move the first task from the first position to a third position, where the third position is the nearest idle time position before the position of the first task in the computing unit assigned in the initial scheduling result, and the third position is different from the first position.

[0134] In one possible implementation, the determination module 801 is also used to determine the difference between the total scheduling duration corresponding to the adjusted scheduling scheme and the total scheduling duration corresponding to the scheduling scheme before adjustment; when the difference is less than the duration threshold and the number of adjustments reaches the number of iterations, it is determined that the adjusted scheduling scheme meets the total scheduling duration constraint.

[0135] In one possible implementation, the determination module 801 is also used to determine the difference between the total scheduling duration corresponding to the adjusted scheduling scheme and the total scheduling duration corresponding to the scheduling scheme before adjustment when the adjusted scheduling scheme does not meet the total scheduling duration constraint; according to the relationship between the difference and the duration threshold, based on the scheduling scheme before adjustment or the adjusted scheduling scheme, a scheduling scheme that meets the total scheduling duration constraint is obtained, and the scheduling scheme that meets the total scheduling duration constraint is used as the target scheduling scheme.

[0136] In one possible implementation, the determination module 801 is used to perform a second move operation on the second task in the adjusted scheduling scheme based on the difference being less than the duration threshold and the number of adjustments not reaching the number of iterations, until a scheduling scheme that meets the total scheduling duration constraint is obtained, and the second task is any task in the adjusted scheduling scheme.

[0137] In one possible implementation, the determination module 801 is used to determine the acceptance probability of the adjusted scheduling scheme based on the difference being greater than the duration threshold and the number of adjustments not reaching the number of iterations; based on the acceptance probability reaching the threshold, performing a second move operation on the second task in the adjusted scheduling scheme until a scheduling scheme that meets the total scheduling duration constraint is obtained, and the second task is any task in the adjusted scheduling scheme; or, based on the acceptance probability not reaching the threshold, performing a second move operation on the third task in the scheduling scheme before adjustment until a scheduling scheme that meets the total scheduling duration constraint is obtained, and the third task is any task in the scheduling scheme before adjustment.

[0138] In one possible implementation, the determination module 801 is used to determine the acceptance probability of the adjusted scheduling scheme based on the difference being greater than the duration threshold and the number of adjustments reaching the number of iterations; based on the acceptance probability reaching the threshold, the adjusted scheduling scheme is used as the scheduling scheme that meets the total scheduling duration constraint; or, based on the acceptance probability not reaching the threshold, the scheduling scheme before adjustment is used as the scheduling scheme that meets the total scheduling duration constraint.

[0139] It should be understood that the device provided in FIG8 is merely an example of the division of the functional modules described above when implementing its functions. In actual applications, the functions described above can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0140] Referring to FIG. 9 , FIG. 9 shows a schematic diagram of the structure of a computer device 2000 provided in accordance with an exemplary embodiment of the present application. The computer device 2000 shown in FIG. 9 is configured to execute the operations involved in the task scheduling method shown in FIG. 2 . The computer device 2000 is, for example, a switch or router, and can be implemented using a general bus architecture.

[0141] As shown in FIG. 9 , a computer device 2000 includes at least one processor 2001 , a memory 2003 , and at least one communication interface 2004 .

[0142] The processor 2001 is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solution of the present application. For example, the processor 2001 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute the various logic blocks, modules, and circuits described in conjunction with the disclosure of the embodiments of the present invention. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0143] Optionally, computer device 2000 also includes a bus. The bus is used to transmit information between the various components of computer device 2000. The bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, for example. Buses can be categorized as address buses, data buses, control buses, and the like. For ease of illustration, FIG9 shows only one line, but this does not imply that there is only one bus or only one type of bus.

[0144] The memory 2003 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, or a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2003 is, for example, independent and connected to the processor 2001 via a bus. The memory 2003 can also be integrated with the processor 2001.

[0145] The communication interface 2004 uses any transceiver-like device for communicating with other devices or communication networks. The communication network can be Ethernet, a radio access network (RAN), or a wireless local area network (WLAN). The communication interface 2004 can include a wired communication interface or a wireless communication interface. Specifically, the communication interface 2004 can be an Ethernet interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a wireless local area network (WLAN) interface, a cellular network communication interface, or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In the embodiment of the present application, the communication interface 2004 can be used for the computer device 2000 to communicate with other devices.

[0146] In a specific implementation, as an embodiment, the processor 2001 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG9 . Each of these processors may be a single-core CPU processor or a multi-core CPU processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0147] In a specific implementation, as an embodiment, the computer device 2000 may include multiple processors, such as the processor 2001 and the processor 2005 shown in FIG9 . Each of these processors may be a single-core CPU or a multi-core CPU. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0148] In a specific implementation, as an embodiment, the computer device 2000 may further include an output device and an input device. The output device communicates with the processor 2001 and can display information in a variety of ways. For example, the output device can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device communicates with the processor 2001 and can receive user input in a variety of ways. For example, the input device can be a mouse, a keyboard, a touch screen device, or a sensor device.

[0149] In some embodiments, the memory 2003 is used to store program code 2010 for executing the solution of the present application, and the processor 2001 can execute the program code 2010 stored in the memory 2003. In other words, the computer device 2000 can implement the task scheduling method provided by the method embodiment through the processor 2001 and the program code 2010 in the memory 2003. The program code 2010 may include one or more software modules. Optionally, the processor 2001 itself may also store program code or instructions for executing the solution of the present application.

[0150] In a specific embodiment, the computer device 2000 of the embodiment of the present application may correspond to the task scheduling device in the above-mentioned method embodiments. The processor 2001 in the computer device 2000 reads the instructions in the memory 2003, so that the computer device 2000 shown in Figure 9 can execute all or part of the operations performed by the task scheduling device.

[0151] The computer device 2000 may also correspond to the task scheduling apparatus shown in FIG8 , and each functional module in the task scheduling apparatus is implemented using software of the computer device 2000. In other words, the functional modules included in the task scheduling apparatus are generated by the processor 2001 of the computer device 2000 after reading the program code 2010 stored in the memory 2003.

[0152] Among them, each step of the task scheduling method shown in Figure 2 is completed by the hardware integrated logic circuit or software instructions in the processor of the computer device 2000. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.

[0153] Referring to FIG. 10 , FIG. 10 shows a schematic diagram of the structure of a computer device 2100 provided in another exemplary embodiment of the present application. The computer device 2100 shown in FIG. 10 is configured to execute all or part of the operations involved in the task scheduling method shown in FIG. 2 . The computer device 2100 is, for example, a switch or router, and can be implemented using a general bus architecture.

[0154] As shown in FIG. 10 , the computer device 2100 includes a main control board 2110 and an interface board 2130 .

[0155] The main control board (2110), also known as the main processing unit (MPU) or route processor card, is used to control and manage various components in computer device 2100, including routing calculations, device management, device maintenance, and protocol processing. It includes a central processing unit (CPU) 2111 and memory 2112.

[0156] Interface board 2130 is also known as a line processing unit (LPU), line card, or service board. It provides various service interfaces and implements data packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces and POS (Packet over SONET / SDH) interfaces. Ethernet interfaces, for example, are Flexible Ethernet Clients (FlexE Clients) interfaces. Interface board 2130 includes a central processing unit (CPU) 2131, a network processor (NPU) 2132, a forwarding table memory 2134, and a physical interface card (PIC) 2133.

[0157] The central processing unit 2131 on the interface board 2130 is used to control and manage the interface board 2130 and communicate with the central processing unit 2111 on the main control board 2110 .

[0158] The network processor 2132 is used to implement message forwarding processing. The network processor 2132 can be in the form of a forwarding chip. The forwarding chip can be a network processor (NP). In some embodiments, the forwarding chip can be implemented using an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA). Specifically, the network processor 2132 is used to forward received messages based on the forwarding table stored in the forwarding entry memory 2134. If the destination address of the message is the address of the computer device 2100, the message is sent to the CPU (such as the central processing unit 2131) for processing. If the destination address of the message is not the address of the computer device 2100, the next hop and outgoing interface corresponding to the destination address are searched in the forwarding table based on the destination address, and the message is forwarded to the outgoing interface corresponding to the destination address. The processing of uplink messages may include processing the message inbound interface and forwarding table lookup; the processing of downlink messages may include forwarding table lookup, etc. In some embodiments, the central processing unit may also perform the functions of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, thereby eliminating the need for a forwarding chip in the interface board.

[0159] Physical interface card 2133 implements physical layer interconnection. Raw traffic enters interface board 2130 through this card, and processed packets are sent out from this physical interface card 2133. Physical interface card 2133, also known as a daughter card, can be installed on interface board 2130. It converts optical and electrical signals into packets, performs a validity check on these packets, and then forwards them to network processor 2132 for processing. In some embodiments, central processing unit 2131 can also perform the functions of network processor 2132, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for network processor 2132 in physical interface card 2133.

[0160] Optionally, computer device 2100 includes multiple interface boards. For example, computer device 2100 further includes interface board 2140. Interface board 2140 includes a central processing unit 2141, a network processor 2142, a forwarding table entry memory 2144, and a physical interface card 2143. The functions and implementation of each component in interface board 2140 are the same as or similar to those of interface board 2130 and are not described in detail here.

[0161] Optionally, computer device 2100 further includes a switch fabric board 2120. Switch fabric board 2120 may also be referred to as a switch fabric unit (SFU). If computer device 2100 includes multiple interface boards, switch fabric board 2120 is used to exchange data between the interface boards. For example, interface board 2130 and interface board 2140 can communicate via switch fabric board 2120.

[0162] The main control board 2110 is coupled to the interface board. For example, the main control board 2110, the interface board 2130, the interface board 2140, and the switching network board 2120 are connected to the system backplane via a system bus to achieve intercommunication. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 2110 and the interface boards 2130 and 2140, and communication is performed between the main control board 2110 and the interface boards 2130 and 2140 via the IPC channel.

[0163] Logically, computer device 2100 includes a control plane and a forwarding plane. The control plane includes a main control board 2110 and a central processing unit (CPU) 2111. The forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 2134, physical interface cards 2133, and a network processor 2132. The control plane performs routing functions, generates forwarding tables, processes signaling and protocol messages, and configures and maintains the computer device's status. The control plane sends the generated forwarding tables to the forwarding plane. On the forwarding plane, the network processor 2132 forwards messages received by the physical interface card 2133 based on the forwarding tables sent by the control plane. The forwarding tables sent by the control plane can be stored in the forwarding table entry memory 2134. In some embodiments, the control plane and forwarding plane can be completely separate and not located on the same computer device.

[0164] It's worth noting that there may be one or more main control boards (SBCs), which can include both active and standby SBCs. There may also be one or more interface boards. The higher the data processing capabilities of a computer device, the more interface boards it provides. An interface board can also have one or more physical interface cards. There may be no SBCs, one or more SBCs, and multiple SBCs can be used to achieve load balancing and redundant backup. In a centralized forwarding architecture, a computer device may not require a SBC; the interface board handles the entire system's service data processing. In a distributed forwarding architecture, a computer device may have at least one SBC, which enables data exchange between multiple interface boards, providing high-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of a computer device with a distributed architecture are greater than those of a centralized architecture. Alternatively, a computer device may consist of a single card, i.e., without a switching fabric board. The functions of the interface board and the main control board are integrated on this single card. In this case, the central processing unit (CPU) on the interface board and the CPU on the main control board can be combined into a single CPU on this single card, performing the combined functions of the two. This type of computer device has lower data exchange and processing capabilities (for example, low-end switches or routers). The specific architecture used depends on the specific networking deployment scenario and is not specified here.

[0165] In a specific embodiment, the computer device 2100 corresponds to the task scheduling apparatus applied to the task scheduling device shown in Figure 8. In some embodiments, the scheduling module 802 in the task scheduling apparatus shown in Figure 8 corresponds to the physical interface card 2133 in the computer device 2100, and the determination module 801 corresponds to the central processing unit 2111 or the network processor 2132 in the computer device 2100.

[0166] An embodiment of the present application further provides a communication device comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other via an internal connection path. The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals. When the processor executes the instructions stored in the memory, the processor executes the method required to be executed by the task scheduling device.

[0167] It should be understood that the processor described above may be a CPU, or other general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the Advanced Reduced Instruction Set Machine (ARM) architecture.

[0168] Furthermore, in an optional embodiment, the memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory may also include a non-volatile random access memory. For example, the memory may also store device type information.

[0169] The memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0170] An embodiment of the present application further provides a computer-readable storage medium, in which at least one instruction is stored. The instruction is loaded and executed by a processor to enable a computer to implement any of the task scheduling methods described above.

[0171] The embodiments of the present application further provide a computer program (product), which, when executed by a computer, can enable a processor or computer to execute the corresponding steps and / or processes in the above method embodiments.

[0172] An embodiment of the present application also provides a chip, including a processor, for calling and executing instructions stored in the memory from a memory, so that a communication device equipped with the chip executes any of the task scheduling methods described above.

[0173] An embodiment of the present application also provides another chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected through an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute any of the task scheduling methods described above.

[0174] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive).

[0175] Those skilled in the art will appreciate that the various method steps and modules described in conjunction with the embodiments disclosed herein can be implemented in software, hardware, firmware, or any combination thereof. In order to clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0176] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0177] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. As an example, the method of the embodiment of the present application can be described in the context of a machine executable instruction, and the machine executable instruction is such as included in the program module executed in the device on the real or virtual processor of the target. Generally speaking, a program module includes a routine, a program, a library, an object, a class, a component, a data structure, etc., which performs a specific task or realizes a specific abstract data structure. In various embodiments, the function of the program module can be merged or split between the described program modules. The machine executable instruction for the program module can be executed in a local or distributed device. In a distributed device, the program module can be located in both a local and a remote storage medium.

[0178] The computer program code for realizing the method for the embodiment of the application can be written in one or more programming languages.These computer program codes can be provided to the processor of general-purpose computer, special-purpose computer or other programmable data processing device, so that program code, when being executed by computer or other programmable data processing device, causes the function / operation specified in flow chart and / or block diagram to be implemented.Program code can be executed completely on computer, partly on computer, as independent software package, partly on computer and partly on remote computer or completely on remote computer or server.

[0179] In the context of the embodiments of the present application, computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, and the like.

[0180] Examples of signals may include electrical, optical, radio, acoustic or other forms of propagated signals, such as carrier waves, infrared signals, etc.

[0181] A machine-readable medium may be any tangible medium that contains or stores a program for or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. More detailed examples of machine-readable storage media include an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0182] Those skilled in the art will clearly understand that, for the sake of convenience and brevity of description, the specific working processes of the above-described systems, devices, and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0183] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, or can be electrical, mechanical or other forms of connection.

[0184] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0185] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.

[0186] If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0187] In this application, the terms "first," "second," and the like are used to distinguish between identical or similar items having substantially the same function or effect. It should be understood that "first," "second," and "nth" do not have a logical or temporal dependency, nor do they limit the quantity or order of execution. It should also be understood that although the following description uses the terms "first," "second," and the like to describe various elements, these elements should not be limited by these terms. These terms are simply used to distinguish one element from another.

[0188] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0189] In this application, the term "at least one" means one or more, and the term "plurality" means two or more. For example, "plurality of second messages" means two or more second messages. The terms "system" and "network" are often used interchangeably herein.

[0190] It should be understood that the terminology used in the description of the various examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0191] It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the listed items. The term "and / or" describes an association between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this application generally indicates that the associated objects are in an "or" relationship.

[0192] It will also be understood that the term “comprise” (also known as “includes,” “including,” “comprises,” and / or “comprising”) when used in this specification specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0193] It should also be understood that the terms “if” and “if” may be interpreted to mean “when” or “upon” or “in response to determining” or “in response to detecting.” Similarly, the phrases “if it is determined that ” or “if [stated condition or event] is detected” may be interpreted to mean “upon determining that ” or “in response to determining that ” or “upon detecting [stated condition or event]” or “in response to detecting [stated condition or event],” depending on the context.

[0194] It should be understood that determining B based on A does not mean determining B based solely on A. B can also be determined based on A and / or other information.

[0195] It should also be understood that references throughout this specification to "one embodiment," "an embodiment," or "one possible implementation" mean that specific features, structures, or characteristics associated with that embodiment or implementation are included in at least one embodiment of the present application. Therefore, the appearance of "in one embodiment," "in an embodiment," or "one possible implementation" throughout this specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0196] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application should be included in the scope of protection of the present application.

Claims

1. A task scheduling method, characterized in that: The method comprises: Identify multiple tasks that need to be scheduled; Determine a target scheduling scheme according to the dependency relationship between the multiple tasks, wherein the target scheduling scheme satisfies the dependency constraint between the multiple tasks and the total scheduling duration constraint; The multiple tasks are allocated to corresponding computing units according to the target scheduling scheme, and the allocated tasks are processed by the computing units.

2. The method according to claim 1, characterized in that: Determining the target scheduling scheme according to the dependency relationship between the multiple tasks includes: According to the dependency relationships between the multiple tasks, a directed acyclic graph corresponding to the multiple tasks is constructed, wherein the directed acyclic graph includes multiple nodes and directed edges, wherein one node corresponds to one task, and the nodes corresponding to the tasks having the dependency relationships are connected by the directed edges, and the directions of the directed edges are used to indicate the dependency relationships between the tasks corresponding to the nodes connected by the directed edges; The directed acyclic graph is segmented to obtain a segmentation result, wherein a segmentation rate corresponding to the segmentation result is less than a threshold value; A target scheduling scheme is determined according to the segmentation result.

3. The method according to claim 2, characterized in that Determining the target scheduling scheme according to the segmentation result includes: A greedy scheduling method is used to determine the scheduling time of each task corresponding to each segmentation result, and the total scheduling duration is determined according to the scheduling time of each task; Determine an initial scheduling result according to the total scheduling duration; Adjusting the initial scheduling result to obtain an adjusted scheduling plan; In the case where the adjusted scheduling scheme satisfies the total scheduling duration constraint, the adjusted scheduling scheme is used as the target scheduling scheme.

4. The method according to claim 3, characterized in that: The adjusting the initial scheduling result to obtain an adjusted scheduling scheme includes: A first move operation is performed on a first task in the initial scheduling result, and the adjusted scheduling scheme is obtained according to a result after the first move operation, wherein the first task is any one of the tasks in the initial scheduling result.

5. The method according to claim 4, characterized in that The performing a first move operation on the first task in the initial scheduling result includes: The first task is moved from a first computing unit to a second computing unit, where the first computing unit is the computing unit to which the first task is allocated in the initial scheduling result, and the second computing unit is different from the first computing unit.

6. The method according to claim 4, characterized in that The performing a first move operation on the first task in the initial scheduling result includes: Move the first task from a first position to a second position, wherein the first position is a position in a computing unit to which the first task is assigned in the initial scheduling result, and the second position is another position in the computing unit to which the first task is assigned in the initial scheduling result, and the first position is different from the second position.

7. The method according to claim 4, characterized in that The performing a first move operation on the first task in the initial scheduling result includes: The first task is moved from the first position to a third position, where the third position is a nearest free time position before the position in the computing unit to which the first task is assigned in the initial scheduling result, and the third position is different from the first position.

8. The method according to any one of claims 3 to 7, characterized in that: After the initial scheduling result is adjusted to obtain an adjusted scheduling solution, the method further includes: Determine the difference between the total scheduling duration corresponding to the adjusted scheduling scheme and the total scheduling duration corresponding to the scheduling scheme before the adjustment; When the difference is smaller than the duration threshold and the number of adjustments reaches the number of iterations, it is determined that the adjusted scheduling solution satisfies the total scheduling duration constraint.

9. The method according to any one of claims 3 to 7, characterized in that: After the initial scheduling result is adjusted to obtain an adjusted scheduling solution, the method further includes: In the case that the adjusted scheduling scheme does not satisfy the total scheduling duration constraint, determining the difference between the total scheduling duration corresponding to the adjusted scheduling scheme and the total scheduling duration corresponding to the scheduling scheme before the adjustment; According to the relationship between the difference and the duration threshold, a scheduling scheme that satisfies the total scheduling duration constraint is obtained based on the scheduling scheme before adjustment or the scheduling scheme after adjustment, and the scheduling scheme that satisfies the total scheduling duration constraint is used as the target scheduling scheme.

10. The method according to claim 9, characterized in that The acquiring, according to the relationship between the difference and the duration threshold, a scheduling scheme satisfying the total scheduling duration constraint based on the scheduling scheme before adjustment or the scheduling scheme after adjustment, includes: Based on the fact that the difference is less than the duration threshold and the number of adjustments does not reach the number of iterations, a second move operation is performed on the second task in the adjusted scheduling scheme until a scheduling scheme that meets the total scheduling duration constraint is obtained, and the second task is any one of the tasks in the adjusted scheduling scheme.

11. The method according to claim 9, characterized in that The acquiring, according to the relationship between the difference and the duration threshold, a scheduling scheme satisfying the total scheduling duration constraint based on the scheduling scheme before adjustment or the scheduling scheme after adjustment, includes: Based on the difference being greater than the duration threshold and the number of adjustments not reaching the number of iterations, determining the acceptance probability of the adjusted scheduling solution; Based on the acceptance probability reaching a threshold, performing a second move operation on the second task in the adjusted scheduling scheme until a scheduling scheme that satisfies the total scheduling duration constraint is obtained, the second task being any one of the tasks in the adjusted scheduling scheme; Alternatively, based on the acceptance probability not reaching a threshold, a second move operation is performed on the third task in the scheduling scheme before adjustment until a scheduling scheme that satisfies the total scheduling duration constraint is obtained, and the third task is any task in the scheduling scheme before adjustment.

12. The method according to claim 9, characterized in that The acquiring, according to the relationship between the difference and the duration threshold, a scheduling scheme satisfying the total scheduling duration constraint based on the scheduling scheme before adjustment or the scheduling scheme after adjustment, includes: Based on the difference being greater than the duration threshold and the number of adjustments reaching the number of iterations, determining the acceptance probability of the adjusted scheduling solution; Based on the acceptance probability reaching a threshold, taking the adjusted scheduling scheme as a scheduling scheme that satisfies the total scheduling duration constraint; Alternatively, based on the fact that the acceptance probability does not reach a threshold, the scheduling scheme before adjustment is used as a scheduling scheme that satisfies the total scheduling duration constraint.

13. A task scheduling device, characterized in that: The device comprises: A determination module is used to determine multiple tasks that need to be scheduled; The determination module is further used to determine a target scheduling scheme according to the dependency relationship between the multiple tasks, and the target scheduling scheme satisfies the dependency constraint between the multiple tasks and the total scheduling duration constraint; The scheduling module is used to allocate the multiple tasks to corresponding computing units according to the target scheduling scheme, and process the allocated tasks through the computing units.

14. The device according to claim 13, characterized in that The determining module is used to construct a directed acyclic graph corresponding to the multiple tasks according to the dependency relationship between the multiple tasks, wherein the directed acyclic graph includes multiple nodes and directed edges, one node corresponds to one task, and the nodes corresponding to the tasks with dependency relationship are connected by the directed edges, and the direction of the directed edges is used to indicate the dependency relationship between the tasks corresponding to the nodes connected by the directed edges; The directed acyclic graph is segmented to obtain a segmentation result, wherein a cutting edge rate corresponding to the segmentation result is less than a threshold value; and a target scheduling scheme is determined according to the segmentation result.

15. The device according to claim 14, characterized in that The determination module is used to determine the scheduling time of each task corresponding to each segmentation result by a greedy scheduling method, determine the total scheduling duration according to the scheduling time of each task; and determine the initial scheduling result according to the total scheduling duration; Adjusting the initial scheduling result to obtain an adjusted scheduling plan; In the case where the adjusted scheduling scheme satisfies the total scheduling duration constraint, the adjusted scheduling scheme is used as the target scheduling scheme.

16. The device according to claim 15, characterized in that The determination module is used to perform a first move operation on a first task in the initial scheduling result, and obtain the adjusted scheduling scheme according to a result after the first move operation, wherein the first task is any task in the initial scheduling result.

17. The device according to claim 16, characterized in that The determination module is used to move the first task from a first computing unit to a second computing unit, where the first computing unit is the computing unit to which the first task is allocated in the initial scheduling result, and the second computing unit is different from the first computing unit.

18. The device according to claim 16, characterized in that The determination module is used to move the first task from a first position to a second position, where the first position is the position of the first task in the computing unit assigned in the initial scheduling result, and the second position is another position of the first task in the computing unit assigned in the initial scheduling result, and the first position is different from the second position.

19. The device according to claim 16, characterized in that The determination module is used to move the first task from the first position to a third position, where the third position is the nearest idle time position before the position of the first task in the computing unit assigned in the initial scheduling result, and the third position is different from the first position.

20. The device according to any one of claims 15 to 19, characterized in that: The determination module is also used to determine the difference between the total scheduling duration corresponding to the adjusted scheduling scheme and the total scheduling duration corresponding to the scheduling scheme before adjustment; when the difference is less than the duration threshold and the number of adjustments reaches the number of iterations, it is determined that the adjusted scheduling scheme meets the total scheduling duration constraint.

21. The device according to any one of claims 15 to 19, characterized in that: The determination module is further configured to determine, when the adjusted scheduling scheme does not satisfy the total scheduling duration constraint, a difference between the total scheduling duration corresponding to the adjusted scheduling scheme and the total scheduling duration corresponding to the scheduling scheme before the adjustment; According to the relationship between the difference and the duration threshold, a scheduling scheme that satisfies the total scheduling duration constraint is obtained based on the scheduling scheme before adjustment or the scheduling scheme after adjustment, and the scheduling scheme that satisfies the total scheduling duration constraint is used as the target scheduling scheme.

22. The device according to claim 21, characterized in that The determination module is used to perform a second move operation on the second task in the adjusted scheduling scheme based on the difference being less than the duration threshold and the number of adjustments not reaching the number of iterations, until a scheduling scheme that satisfies the total scheduling duration constraint is obtained, and the second task is any one of the tasks in the adjusted scheduling scheme.

23. The device according to claim 21, characterized in that The determination module is used to determine the acceptance probability of the adjusted scheduling scheme based on the difference being greater than a duration threshold and the number of adjustments not reaching the number of iterations; based on the acceptance probability reaching the threshold, perform a second move operation on the second task in the adjusted scheduling scheme until a scheduling scheme that satisfies the total scheduling duration constraint is obtained, and the second task is any one of the tasks in the adjusted scheduling scheme; or, based on the acceptance probability not reaching the threshold, perform a second move operation on the third task in the scheduling scheme before the adjustment, until a scheduling scheme that satisfies the total scheduling duration constraint is obtained, and the third task is any one of the tasks in the scheduling scheme before the adjustment.

24. The device according to claim 21, characterized in that The determination module is used to determine the acceptance probability of the adjusted scheduling scheme based on the difference being greater than the duration threshold and the number of adjustments reaching the number of iterations; based on the acceptance probability reaching the threshold, use the adjusted scheduling scheme as a scheduling scheme that satisfies the total scheduling duration constraint; or, based on the acceptance probability not reaching the threshold, use the scheduling scheme before adjustment as a scheduling scheme that satisfies the total scheduling duration constraint.

25. A task scheduling device, characterized in that: The task scheduling device includes a memory and a processor; the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor, so that the task scheduling device implements the task scheduling method described in any one of claims 1-12.

26. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and the instruction is loaded and executed by the processor to implement the task scheduling method as described in any one of claims 1-12.

Citation Information

Patent Citations

  • Task scheduling method, apparatus and system

    CN108268319A

  • Task scheduling processing method and device and computer equipment

    CN110554909A

  • Task execution method and device, equipment and storage medium

    CN113342500A

  • Task scheduling method, task scheduling device, task scheduling equipment and storage medium

    CN113986503A

  • Task scheduling method, system and equipment based on directed acyclic graph and storage medium

    CN114625507A

Cited By

  • Task scheduling method and device for artificial intelligence algorithm test task, computer equipment, storage medium and program product

    CN121785749A