Task scheduling method, device and equipment and computer readable storage medium
By constructing directed acyclic graphs, graph segmentation and scheduling adjustment methods, the data transmission problem of dependent tasks when scheduling between different computing units is solved, and the efficiency and processing capabilities of task scheduling are improved.
Patent Information
- Application Number
- CN202310979934.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-03
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, when dependent tasks are assigned to different computing units in task scheduling, the data transmission speed is slow and affects the task processing efficiency.
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.
It reduces the task dependence and data transmission volume between different computing units, improves the efficiency and processing capabilities of task scheduling, and reduces bandwidth costs.
Smart Images

Figure CN119440746A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a task scheduling method, device, equipment and computer-readable storage medium. Background Art
[0002] With the development of computer technology, there are more and more types of tasks that need to be processed, and there are more and more scenarios for task scheduling. For multiple tasks that need to be processed, how to schedule these tasks so that they can be processed and executed in an orderly manner has become an urgent problem to be solved.
[0003] In the related art, a priority scheduling strategy is used to determine the scheduling priority of a task, the execution order of the tasks is determined according to the scheduling priority of the tasks, and the tasks are scheduled according to the execution order of the tasks to achieve the scheduling of multiple tasks among multiple different computing units.
[0004] However, when using the priority scheduling strategy for task scheduling, different tasks are assigned to multiple different computing units. If there are dependent tasks assigned to multiple different computing units, data transmission between multiple different computing units will occur. When the bandwidth between computing units is limited, the data transmission speed will be slow, which will affect the efficiency of task processing. Summary of the invention
[0005] The present application provides a task scheduling method, apparatus, device and computer-readable storage medium to solve the problems in the related art. The technical solution is as follows:
[0006] In a first aspect, a task scheduling method is provided, the method comprising: determining a plurality of tasks that need to be scheduled; determining a target scheduling scheme according to dependencies between the plurality of tasks, the target scheduling scheme satisfying dependency constraints between the plurality of tasks and total scheduling duration constraints; allocating the plurality of tasks to corresponding computing units according to the target scheduling scheme, and processing the allocated tasks by the computing units.
[0007] The task scheduling method provided in the present application determines a target scheduling scheme that not only satisfies the dependency constraints, but also satisfies the 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.
[0008] In a 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, the nodes corresponding to the tasks with dependency relationships being connected by the directed edges, and the directions of the directed edges being used to indicate the dependency relationships between the tasks corresponding to the nodes connected by the directed edges; segmenting the directed acyclic graph to obtain a segmentation result, the segmentation result corresponding to the segmentation rate being less than a threshold; and determining a target scheduling scheme based on the segmentation result.
[0009] In one possible implementation, determining the target scheduling scheme based on the segmentation results includes: determining the scheduling time of each task corresponding to each segmentation result by a greedy scheduling method, and determining the total scheduling duration according to the scheduling time of each task; determining an initial scheduling result according to the total scheduling duration; adjusting the initial scheduling result to obtain an adjusted scheduling scheme; and when the adjusted scheduling scheme satisfies the total scheduling duration constraint, using the adjusted scheduling scheme as the target scheduling scheme.
[0010] In one possible implementation, the initial scheduling result is adjusted to obtain an adjusted scheduling scheme, including: performing a first move operation on a first task in the initial scheduling result, and obtaining the adjusted scheduling scheme based on a result after the first move operation, wherein the first task is any one of the tasks in the initial scheduling result.
[0011] 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, the first computing unit being the computing unit assigned to the first task in the initial scheduling result, and the second computing unit being different from the first computing unit.
[0012] 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 to the initial scheduling result, the second position being other positions of the first task in the computing unit assigned to the initial scheduling result, and the first position is different from the second position.
[0013] In one possible implementation, the first moving operation 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.
[0014] In a 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 the 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.
[0015] In a possible implementation, after adjusting the initial scheduling result to obtain an 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 the adjustment; according to the relationship between the difference and the duration threshold, based on the scheduling scheme before the 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.
[0016] In a 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.
[0017] In a 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.
[0018] In a possible implementation, the scheduling scheme that satisfies the total scheduling duration constraint is obtained based on the scheduling scheme before adjustment or the adjusted scheduling scheme according to the relationship between the difference and the duration threshold, including: 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 scheme; based on the acceptance probability reaching the threshold, using the adjusted scheduling scheme as the scheduling scheme that satisfies the total scheduling duration constraint; or, based on the acceptance probability not reaching the threshold, using the scheduling scheme before adjustment as the scheduling scheme that satisfies the total scheduling duration constraint.
[0019] In a second aspect, a task scheduling device is provided, the device comprising:
[0020] A determination module is used to determine multiple tasks that need to be scheduled;
[0021] 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;
[0022] 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.
[0023] 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 result corresponding to the segmentation rate is less than a threshold; and a target scheduling scheme is determined based on the segmentation result.
[0024] In one possible implementation, the determination module 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; when the adjusted scheduling plan satisfies the total scheduling duration constraint, use the adjusted scheduling plan as the target scheduling plan.
[0025] In a possible implementation, 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, and the first task is any task in the initial scheduling result.
[0026] In a 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 assigned to the first task in the initial scheduling result, and the second computing unit is different from the first computing unit.
[0027] 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 to the first task in the initial scheduling result, and the second position is another position of the computing unit assigned to the first task in the initial scheduling result, and the first position is different from the second position.
[0028] 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.
[0029] In a 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.
[0030] In a possible implementation, the determination module is also used to determine, when the adjusted scheduling scheme does not meet the total scheduling duration constraint, 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, 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.
[0031] 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 a 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.
[0032] 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, 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; or, based on the acceptance probability not reaching the threshold, performing 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, the third task being any one of the tasks in the scheduling scheme before the adjustment.
[0033] 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, using 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, using the scheduling scheme before adjustment as a scheduling scheme that satisfies the total scheduling duration constraint.
[0034] In a third aspect, a task scheduling device is provided, the device comprising 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.
[0035] In a possible implementation, the task scheduling device further includes a memory, where the memory is used to store at least one instruction.
[0036] In a fourth aspect, a computer-readable storage medium is provided, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement any task scheduling method described in the first aspect.
[0037] 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.
[0038] In a sixth aspect, a task scheduling device is provided, the device comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other through an internal connection path, the memory is used to store instructions, 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, and when the processor executes the instructions stored in the memory, the processor executes the method in the first aspect or any possible implementation of the first aspect.
[0039] Optionally, the number of the processors is one or more, and the number of the memories is one or more.
[0040] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0041] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips. This application does not limit the type of memory and the setting method of the memory and the processor.
[0042] In a 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.
[0043] In an 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.
[0044] 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
[0045] Figure 1 A schematic diagram of an implementation environment provided for an embodiment of the present application;
[0046] Figure 2 A flowchart of a task scheduling method provided in an embodiment of the present application;
[0047] Figure 3 A directed acyclic graph and a schematic diagram of scheduling results provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of an initial scheduling process provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of a mobile operation process provided in an embodiment of the present application;
[0050] Figure 6 A schematic diagram of a task scheduling process provided in an embodiment of the present application;
[0051] Figure 7 Another schematic diagram of a task scheduling process provided in an embodiment of the present application;
[0052] Figure 8 A schematic diagram of the structure of a task scheduling device provided in an embodiment of the present application;
[0053] Fig. 9 A schematic diagram of the structure of a computer device provided in an embodiment of the present application;
[0054] Fig.10 A schematic diagram of the structure of another computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] 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.
[0056] In the computer field, there are more and more types of tasks that need to be processed, and there are more and more task scheduling scenarios. For example, the entire computing process can be divided into different computing tasks, and these divided computing tasks can be scheduled. Through the task scheduling method, different computing tasks are divided into different computing units, so that the computing units can calculate different tasks in an orderly manner, thereby efficiently completing the computing needs of the entire computing process.
[0057] For multiple tasks that need to be scheduled, there is often a certain dependency between the tasks. For example, for multiple tasks including Task A and Task B, Task A must be executed first, and Task B can only be executed based on the execution result of Task A. When two dependent tasks are processed on different computing units, data transmission will occur, and there will be communication costs. Taking the vehicle's autonomous driving scenario as an example, the vehicle has multiple cameras, including but not limited to laser radar, millimeter wave radar, fisheye lens, front lens, rear lens, and various sensors on the body. The overall autonomous driving decision needs to be input into the neural network model as input information, and the neural network model is used for analysis and calculation to obtain accurate and effective driving decisions. In this scenario, the entire computing process needs to be efficient and low-latency, and in the face of such a large data traffic processing scenario, when processing multiple tasks corresponding to the computing process on multiple computing units, it is necessary to control the amount of data transmission to improve the overall computing efficiency.
[0058] However, since the computing tasks on the autonomous driving chips 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.
[0059] In this regard, an embodiment of the present application provides a task scheduling method, which is aimed at big data traffic processing scenarios such as vehicle automatic 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 to execute is determined. Under the condition of satisfying the dependency constraints, the overall scheduling time is minimized, thereby also satisfying the total scheduling duration constraint. For example, the method provided in the embodiment of the present application can abstract multiple tasks into a directed acyclic graph (DAG), and realize the allocation of multiple tasks to computing units such as chips or computing cores by segmenting and scheduling the directed acyclic graph, thereby reducing the overall running time and improving the running efficiency.
[0060] See also Figure 1, shows a schematic diagram of an implementation environment of the task scheduling method provided in an embodiment of the present application, the implementation environment includes but is not limited to a task scheduling device 101 and a computing unit 102. Figure 1 As shown, each computing unit 102 is connected to the task scheduling device 101 in a wired or wireless manner, and the number of computing units 102 is multiple. Figure 1 Only three computing units 102 are shown as an example for illustration. 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 capable of implementing task scheduling. The computing unit 102 can be a processor, a chip including a processor, or a processor core of a processor.
[0061] by Figure 1 Take the implementation environment shown as an example, see Figure 2 The task scheduling method provided in the embodiment of the present application includes the following steps 201 to 203.
[0062] In step 201, a plurality of tasks that need to be scheduled are determined.
[0063] In the embodiment of the present application, the types and quantities of the multiple tasks to be scheduled are not limited, and can be determined based on the application scenario or based on the input. For example, the computing process that needs to be scheduled is divided into multiple different computing tasks and put into the computing task list. The tasks that need to be scheduled are determined by the computing task list. Among them, 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.
[0064] In step 202, a target scheduling scheme is determined 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.
[0065] The dependency relationship between multiple tasks refers to the execution order relationship between multiple tasks. For example, the tasks to be processed are 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 constraint between multiple tasks, which means that the target scheduling scheme needs to schedule multiple tasks according to the dependency between multiple tasks.
[0066] 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 2021-2023.
[0067] In step 2021, based on the dependency relationship between the 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 edges is used to indicate the dependency relationship between the tasks corresponding to the nodes connected by the directed edges.
[0068] The embodiment of the present application does not limit the method of constructing a directed acyclic graph corresponding to multiple tasks according to 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 are respectively used as nodes of the directed acyclic graph, and the nodes with dependency relationships are connected using 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 movement is required.
[0069] For ease of understanding, Figure 3 Take the directed acyclic graph shown on the left side of the figure as an example. The directed acyclic graph shows the dependency relationship between the 9 tasks numbered 1-9, such as Figure 3 As shown, 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 by 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 G47 ; Task 8 depends on Task 5 and Task 6. 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 .
[0070] In step 2022, the directed acyclic graph is segmented to obtain segmentation results, and the segmentation result corresponds to a cutting edge rate that is less than a threshold value.
[0071] In the embodiment of the present application, the directed acyclic graph is segmented, that is, the original computing task is assigned to a certain computing unit, and multiple tasks are grouped according to the computing unit so that the number of edges between different groups is small. There are many methods for segmenting the directed acyclic graph, and the size of the number of cut edges can be adjusted by parameters so that the segmentation result meets the constraint of the cut edge rate. The embodiment of the present application does not limit the way in which the directed acyclic graph is segmented. For tasks with dependencies, it is necessary to achieve efficient scheduling of these tasks on multiple computing units to meet the constraints of the dependencies. However, in scenarios such as vehicle automatic driving, for data transmission of tasks, because of limited bandwidth, 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 the computing task is assigned and scheduled, it is necessary to limit the proportion of the number of data transmissions, that is, to segment the DAG, and after obtaining the segmentation result, it is necessary to constrain the cut edge rate (CR) of the segmentation result.
[0072] For example, the original DAG graph can be segmented by balancing the minimum cut class to obtain multiple segmentation results that meet the edge cutting rate constraint condition, so that the edge cutting rate corresponding to the segmentation result is less than the threshold. The embodiment of the present application does not limit the threshold, and can be set based on experience, or based on the application scenario, and can also be adjusted according to actual conditions. For example, the threshold can be 0.4, so it is necessary to meet the CR<0.4 of the segmentation result.
[0073] The trimming rate can be expressed by the following formula:
[0074]
[0075] For ease of understanding, Figure 3 Take the directed acyclic graph shown on the left side of the figure as an example. The directed acyclic graph shows the dependency relationship between the 9 tasks numbered 1-9, such as Figure 3 As shown, 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 424 , edge G between task 2 and task 5 25 , edge G between task 5 and task 8 58 , 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 are all split edges, the number of split edges is 8, and the total number of edges in the directed acyclic graph is 11, then the cutting edge ratio CR = 8 / 11, which is about 0.73. Taking the cutting edge ratio threshold of 0.4 as an example, since the cutting edge ratio corresponding to the current segmentation result is not less than the threshold, it is necessary to re-segment until a segmentation result that satisfies the cutting edge ratio less than the threshold is obtained. The overall input and output effect is as follows Figure 3 As shown, by abstract modeling of the problem, we get the directed acyclic graph shown on the left, and then by allocating and scheduling, we get the task time allocation scheduling graph on the right ( Figure 3 5 computing units are taken as an example).
[0076] Exemplarily, the following is an example of the way to segment a directed acyclic graph using the Metis algorithm package. First, Metis is set 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. After that, 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 tolerance of the result to imbalance can be controlled by the ufactor parameter, so the initial setting of ufactor=1 makes the result balance requirements strict, the number of cut edges is large, and then increases ufactor, reduces the balance requirements, reduces the number of cut edges and the cut edge rate, so as to obtain multiple solutions that meet the cut edge rate constraint, that is, multiple segmentation results with a cut edge rate less than the threshold are obtained.
[0077] In step 2023, a target scheduling solution is determined according to the segmentation result.
[0078] The target scheduling scheme is determined according to the segmentation result, including but not limited to the following steps A and B. Step A can be considered as an initial scheduling process, and step B is an iterative update process.
[0079] Step A: Use greedy scheduling to determine the scheduling time of each task corresponding to each segmentation result, 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.
[0080] After determining the computing unit for each task to run, the initial scheduling process uses a greedy method to schedule the task to run as early as possible while satisfying the task dependency constraints, and can obtain a series of initial solutions that satisfy both the dependency constraints and the edge cutting rate constraints. From these solutions, the best one, that is, the one with the shortest total scheduling time, is selected as the initial solution for step B.
[0081] In step A, because there is a dependency relationship between tasks, if there is an edge D in the DAG graph ij If , task j can only be executed after task i is completed. In order to obtain a scheduling initialization solution that satisfies the dependency constraint conditions, after determining that each task runs on a certain computing unit, the specific execution time can be determined according to the following process. The process of step A can be as follows Figure 4 As shown in the figure, first, the original DAG is topologically sorted. Then, the running time of each task is arranged according to the order of topological sorting, and each task is arranged on a specified computing unit. When all dependent tasks are executed, the task starts to execute. In this way, a complete initialization result can be obtained, that is, multiple different segmentation schemes are randomly generated, so multiple different initial scheduling schemes can be obtained, such as Figure 4 The scheduling result 1 to the scheduling result N in , N is a positive integer greater than 1. The solution with the shortest total scheduling time among these initial scheduling solutions is selected as the initial scheduling result, that is, the initial value of the iterative optimization solution in step B. In other words, step A can initially obtain an initialization solution that satisfies both the task dependency constraint and the edge cutting rate constraint by combining the balanced minimum cut method with the greedy strategy, so that the subsequent iterative optimization process can be carried out on this basis.
[0082] Step B, adjusting the initial scheduling result to obtain an adjusted scheduling plan; when the adjusted scheduling plan satisfies the total scheduling duration constraint, the adjusted scheduling plan is used as the target scheduling plan.
[0083] In the embodiment of the present application, the method of adjusting the initial scheduling result is not limited. Exemplarily, the initial scheduling result can be optimized based on the simulated annealing method framework, including but not limited to the following steps.
[0084] Step 1: Initialize the solution of the simulated annealing algorithm according to the initial scheduling result, and set the initial temperature T and the maximum number of iterations L.
[0085] Step 2: Calculate the initial total scheduling duration S.
[0086] Among them, T, L and S in the above-mentioned first and second steps can be set based on experience, can also be set based on application scenarios, and can also be adjusted according to actual conditions. The embodiments of the present application do not limit the values of T, L and S.
[0087] Step 3: Randomly select a move operation and calculate the impact on the total scheduling duration, and record the difference as ΔS.
[0088] 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, wherein the first task is any task in the initial scheduling result.
[0089] The first moving operation is performed on the first task in the initial scheduling result, including but not limited to at least one of the following moving operation modes.
[0090] The first moving operation mode is to move the first task from the first computing unit to the 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.
[0091] 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.
[0092] 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.
[0093] 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 by adjusting the position.
[0094] The third moving operation mode is to move the first task from the first position to the third position, where 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, and the third position is different from the first position.
[0095] Since mobile operation mode 3 can reduce the problem of too long idle time interval in the scheduling result, it can obtain a solution with excellent performance and improve the algorithm optimization degree, such as Figure 5 As shown, the mobile operation mode 3 will randomly select the idle time of a computing unit in the time scheduling diagram, and only the following operations can be considered for the computing tasks on this computing unit, such as Figure 5 Idle time 1 and corresponding computing unit 1. Assume that task 1 and task 2 are the tasks immediately following idle time 1 (such as Figure 5 Task 3 is the next free time (as shown). Figure 5 For each task in all [task 2, task 3] (that is, the task currently after task 2 and before task 3), if the task is executed as early as possible and can be completed before the start of task 2 (can fill in the idle time) while satisfying the DAG constraints, then add the task to the candidate list. Randomly select a task from the candidate list and insert it into the earliest idle time position found before. In this way, the idle time in the computing unit is filled, and then the initial scheduling result is adjusted.
[0096] Regardless of which of the above moving operation modes is used, after the initial scheduling result is adjusted to obtain the adjusted scheduling scheme, the total scheduling duration of the adjusted scheduling scheme can be calculated. For example, the start execution time of each task in the adjusted scheduling scheme is accumulated to obtain the total scheduling duration, and the total scheduling duration of the adjusted scheduling scheme is subtracted from the total scheduling duration of the scheduling scheme before adjustment, and the difference is ΔS.
[0097] Step 4: If ΔS<0, accept the current time schedule, otherwise accept the new time schedule with probability exp(-ΔS / T).
[0098] 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 the present application does not limit the calculation method of the acceptance probability, and other methods of calculating 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 can be determined by the spatial shape of the searched energy function.
[0099] 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.
[0100] Step 6: Output the final time scheduling execution plan diagram, which is also the target scheduling result.
[0101] Regardless of which of the above-mentioned mobile operation methods is adopted in the third step, for the above-mentioned third to sixth steps, 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.
[0102] Case 1: 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, determine that the adjusted scheduling scheme meets the total scheduling duration constraint.
[0103] Among them, the duration threshold can be set based on experience or based on the application scenario, and 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, so the adjusted scheduling scheme can be directly used as the target scheduling scheme that meets the total scheduling duration constraint.
[0104] Case 2: When the adjusted scheduling scheme does not meet the total scheduling duration constraint, 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; according to the relationship between the difference and the duration threshold, obtain a scheduling scheme that meets the total scheduling duration constraint based on the scheduling scheme before adjustment or the adjusted scheduling scheme, and use the scheduling scheme that meets the total scheduling duration constraint as the target scheduling scheme.
[0105] In case 2, 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 scheduling scheme after adjustment, including but not limited to the following cases.
[0106] 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.
[0107] 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 less than the duration threshold, it means that the adjusted scheduling scheme itself is better than the scheduling duration of the scheduling scheme before adjustment, but the number of adjustments has not reached the number of iterations, so the iteration can continue, that is, the adjusted scheduling scheme continues to be adjusted until the number of adjustments reaches the number of iterations, and a scheduling scheme that satisfies the total scheduling duration constraint is obtained, and the scheduling scheme that satisfies 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.
[0108] Case 2.2: Based on the difference being greater than the duration threshold and the number of adjustments not reaching the number of iterations, determine the acceptance probability of the adjusted scheduling plan; based on the acceptance probability reaching the threshold, perform a second move operation 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.
[0109] 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 iteration with the scheduling scheme before adjustment or with the adjusted scheduling scheme, it is necessary to further determine 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, and a scheduling scheme that satisfies the total scheduling duration constraint is obtained, and the scheduling scheme that satisfies 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.
[0110] 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, and the third task is any task in the scheduling scheme before adjustment.
[0111] The difference between situation 2.3 and situation 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 may be the same as the first task or the second task, or may be different, and this embodiment of the application does not limit this.
[0112] 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.
[0113] In case 2.4, 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 scheduling duration of the adjusted scheduling scheme is longer than that of the scheduling scheme before adjustment and is not the optimal scheme. However, since the acceptance probability reaches the threshold, that is, the adjusted scheduling scheme is acceptable, and since the number of adjustments reaches the number of iterations, the adjusted scheduling scheme is used as the scheduling scheme that meets the total scheduling duration constraint.
[0114] 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 scheme is determined; 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.
[0115] In case 2.5, 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 scheduling duration of the adjusted scheduling scheme is longer than that of the scheduling scheme before adjustment and is not the optimal scheme. Moreover, since the acceptance probability does not reach the threshold, that is, the adjusted scheduling scheme is not accepted, and since the number of adjustments reaches the number of iterations, the scheduling scheme before adjustment is used as the scheduling scheme that meets the total scheduling duration constraint.
[0116] 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.
[0117] Based on the above steps 201 to 203, taking the scheduling of computing tasks as an example, the task scheduling process can be as follows: Figure 6As shown in the figure, after the 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 process of the abstract problem through the scheduling module. The two parts are executed sequentially and progressively. 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 the computing amount, computing time and other information are constructed into graph node information. The data transmission volume and data transmission delay are constructed into task graph edge attributes, and the processor performance is constructed as the capability of the computing unit. During scheduling, the computing tasks are scheduled according to the abstract modeling results under the constraints of dependency, communication volume (that is, the cutting edge rate), and the best scheduling and cutting results are obtained. The overall scheduling part is divided into the initial solution and iterative optimization. The initial solution that meets the cutting edge rate constraint is quickly obtained through the balanced minimum cut method, and then further optimized through iteration, that is, Figure 6 The iterative solution optimization shown in makes the final solution as optimized as possible and obtains the optimal target scheduling solution. After that, the tasks are scheduled and deployed according to the result deployment, that is, according to the target scheduling solution.
[0118] In addition, the task scheduling method can also be implemented as follows Figure 7 The process shown in the figure realizes the scheduling optimization of performance by abstractly modeling the scene. For example, the basic information of tasks and computing units 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, are determined. Then, the initial pre-scheduling is performed, and iterative solution optimization is performed based on the result of the initial pre-scheduling, so as to obtain the target scheduling scheme that meets the dependency constraints and the total scheduling duration constraints, and the scheduling is performed according to the target scheduling scheme. Among them, the Figure 7 The various processes shown can refer to the processes of step 201 to step 203 above, which will not be repeated here.
[0119] The tasks are scheduled by the method provided by the embodiment of the present application, and the comparison 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 by 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 by 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.
[0120] In addition, the method provided in the embodiment of the present application is not only applicable to the vehicle autonomous driving scenario, but also to the resource allocation and scheduling of the task graph of other application scenarios such as artificial intelligence (AI) training scenarios. Due to the dependency between the tasks between operators due to data transmission, balanced task deployment is required in this scenario to adapt the computing power while minimizing the amount of data transmission. This type of problem is equivalent to the balanced minimum cut problem. The deployment and scheduling of the calculation graph of the AI training scenario using the method provided in the embodiment of the present application also has similar effects to the vehicle autonomous driving scenario, and can effectively improve the scheduling performance of the control under certain data transmission constraints.
[0121] The method provided in the embodiment of the present application determines a target scheduling scheme that not only satisfies the dependency constraints, but also satisfies the 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.
[0122] 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 constraint of the trimming rate 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 a mobile operation, which improves the effect of later iterative optimization. Compared with the simulated annealing method in the related art, it fills in the idle time, improves the utilization efficiency, and shortens the scheduling time.
[0123] The above introduces 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 1 is a schematic diagram of a task scheduling device provided in an embodiment of the present application, and the device is applied to a task scheduling device. Figure 8 As shown in the following multiple modules, the Figure 8 The task scheduling apparatus shown can perform all or part of the operations performed by the task scheduling device. It should be understood that the apparatus may include more additional modules than the modules shown or omit some of the modules shown, and the embodiments of the present application are not limited to this. Figure 8 As shown, the device comprises:
[0124] A determination module 801 is used to determine a plurality of tasks that need to be scheduled;
[0125] The determination module 801 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;
[0126] The scheduling module 802 is used to allocate multiple tasks to corresponding computing units according to the target scheduling scheme, and process the allocated tasks through the computing units.
[0127] In one possible implementation, a 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.
[0128] In one possible implementation, a determination module 801 is used to determine the scheduling time of each task corresponding to each segmentation result by 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.
[0129] In a possible implementation, the determination module 801 is used to perform a first move operation on a first task in the initial scheduling result, and obtain an adjusted scheduling scheme according to a result after the first move operation, and the first task is any task in the initial scheduling result.
[0130] In a possible implementation, the determination module 801 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.
[0131] In one possible implementation, 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 to the first task in the initial scheduling result, and the second position is another position of the first task in the computing unit assigned to the first task in the initial scheduling result, and the first position is different from the second position.
[0132] In one possible implementation, the determination module 801 is used to move the first task from the first position to the 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.
[0133] 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.
[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 adjusted scheduling scheme does not meet the total scheduling duration constraint; 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, and the scheduling scheme that meets the total scheduling duration constraint is used as the target scheduling scheme.
[0135] 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.
[0136] 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 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, performing a second move operation 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 one of the tasks in the scheduling scheme before adjustment.
[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 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.
[0138] It should be understood that the above Figure 8 When the device provided realizes its functions, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is 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 belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0139] See also Fig. 9 , Fig. 9 A schematic diagram of the structure of a computer device 2000 provided by an exemplary embodiment of the present application is shown. Fig. 9 The computer device 2000 shown is used to execute the above Figure 2 The operations involved in the task scheduling method shown in the figure. The computer device 2000 is, for example, a switch, a router, etc. The computer device 2000 can be implemented by a general bus architecture.
[0140] like Fig. 9 As shown, the computer device 2000 includes at least one processor 2001 , a memory 2003 , and at least one communication interface 2004 .
[0141] 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 units (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 devices, transistor logic devices, hardware components, 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 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 a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0142] Optionally, the computer device 2000 further includes a bus. The bus is used to transmit information between the components of the computer device 2000. The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 The fact that only one line is used in the diagram does not mean that there is only one bus or only one type of bus.
[0143] The memory 2003 is, for example, a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, or a random access memory (RAM) or other types of dynamic storage devices 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 compressed optical 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 the 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.
[0144] The communication interface 2004 uses any transceiver-like device to communicate with other devices or communication networks, and the communication network can be Ethernet, radio access network (RAN) or wireless local area network (WLAN), etc. The communication interface 2004 can include a wired communication interface and can also include 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 an embodiment of the present application, the communication interface 2004 can be used for the computer device 2000 to communicate with other devices.
[0145] In a specific implementation, as an embodiment, the processor 2001 may include one or more CPUs, such as Fig. 90 and CPU1 shown in FIG. Each of these processors may be a single-core CPU processor or a multi-core CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0146] In a specific implementation, as an embodiment, the computer device 2000 may include multiple processors, such as Fig. 9 2001 and 2005 are shown in FIG. Each of these processors may be a single-core CPU or a multi-core CPU. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0147] In a specific implementation, as an embodiment, the computer device 2000 may also 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 may 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 may be a mouse, a keyboard, a touch screen device, or a sensor device.
[0148] In some embodiments, the memory 2003 is used to store the 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. That is, 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 can also store the program code or instruction for executing the solution of the present application.
[0149] In a specific embodiment, the computer device 2000 of the embodiment of the present application may correspond to the task scheduling device in each of the above method embodiments. The processor 2001 in the computer device 2000 reads the instructions in the memory 2003, so that Fig. 9 The computer device 2000 shown is capable of performing all or part of the operations performed by the task scheduling device.
[0150] The computer device 2000 may also correspond to the above Figure 8 In the task scheduling device shown, each functional module in the task scheduling device is implemented by software of the computer device 2000. In other words, the functional modules included in the task scheduling device are generated after the processor 2001 of the computer device 2000 reads the program code 2010 stored in the memory 2003.
[0151] in, Figure 2 Each step of the task scheduling method shown is completed by an integrated logic circuit of hardware 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 a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field 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 conjunction with its hardware. To avoid repetition, it is not described in detail here.
[0152] See also Fig.10 , Fig.10 FIG. 2 shows a schematic diagram of the structure of a computer device 2100 provided by another exemplary embodiment of the present application. Fig.10 The computer device 2100 shown is used to perform the above Figure 2 All or part of the operations involved in the task scheduling method shown. The computer device 2100 is, for example, a switch, a router, etc. The computer device 2100 can be implemented by a general bus architecture.
[0153] like Fig.10 As shown, the computer device 2100 includes: a main control board 2110 and an interface board 2130 .
[0154] The main control board is also called the main processing unit (MPU) or route processor card. The main control board 2110 is used to control and manage various components in the computer device 2100, including routing calculation, device management, device maintenance, and protocol processing functions. The main control board 2110 includes: a central processing unit 2111 and a memory 2112.
[0155] The interface board 2130 is also called a line processing unit (LPU), a line card (linecard) or a service board. The interface board 2130 is used to provide various service interfaces and realize the forwarding of data packets. The service interface includes but is not limited to an Ethernet interface, a POS (Packet over SONET / SDH) interface, etc., and the Ethernet interface is, for example, a Flexible Ethernet Service Interface (Flexible Ethernet Clients, FlexE Clients). The interface board 2130 includes: a central processing unit 2131, a network processor 2132, a forwarding table entry memory 2134 and a physical interface card (physical interface card, PIC) 2133.
[0156] The central processor 2131 on the interface board 2130 is used to control and manage the interface board 2130 and communicate with the central processor 2111 on the main control board 2110 .
[0157] The network processor 2132 is used to implement the forwarding processing of the message. 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 by an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA). Specifically, the network processor 2132 is used to forward the received message based on the forwarding table stored in the forwarding table 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 processor 2131) for processing; if the destination address of the message is not the address of the computer device 2100, the next hop and the output interface corresponding to the destination address are found from the forwarding table according to the destination address, and the message is forwarded to the output interface corresponding to the destination address. Among them, the processing of the uplink message may include: processing of the message input interface, forwarding table search; the processing of the downlink message may include: forwarding table search, etc. In some embodiments, the central processor can also perform the function of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, so that the forwarding chip is not required in the interface board.
[0158] The physical interface card 2133 is used to implement the physical layer docking function, whereby the original traffic enters the interface board 2130, and the processed message is sent out from the physical interface card 2133. The physical interface card 2133, also called a daughter card, can be installed on the interface board 2130, and is responsible for converting the photoelectric signal into a message and forwarding the message to the network processor 2132 for processing after checking the legitimacy of the message. In some embodiments, the central processor 2131 can also perform the functions of the network processor 2132, such as implementing software forwarding based on a general-purpose CPU, so that the network processor 2132 is not required in the physical interface card 2133.
[0159] Optionally, the computer device 2100 includes a plurality of interface boards, for example, the computer device 2100 further includes an interface board 2140, and the 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 methods of the components in the interface board 2140 are the same or similar to those of the interface board 2130, and are not described in detail herein.
[0160] Optionally, the computer device 2100 further includes a switching fabric board 2120. The switching fabric board 2120 may also be referred to as a switch fabric unit (SFU). When the computer device 2100 has multiple interface boards, the switching fabric board 2120 is used to complete data exchange between the interface boards. For example, the interface board 2130 and the interface board 2140 may communicate via the switching fabric board 2120.
[0161] 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 through the system bus to achieve intercommunication. In a possible implementation, an inter-process communication (IPC) channel is established between the main control board 2110 and the interface board 2130 and the interface board 2140, and the main control board 2110 and the interface board 2130 and the interface board 2140 communicate through the IPC channel.
[0162] Logically, the 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 2111. The forwarding plane includes various components for performing forwarding, such as a forwarding table entry memory 2134, a physical interface card 2133, and a network processor 2132. The control plane performs functions such as a router, generating a forwarding table, processing signaling and protocol messages, and configuring and maintaining the status of the computer device. The control plane sends the generated forwarding table to the forwarding plane. On the forwarding plane, the network processor 2132 forwards the message received by the physical interface card 2133 based on the forwarding table sent by the control plane. The forwarding table sent by the control plane can be stored in the forwarding table entry memory 2134. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same computer device.
[0163] It is worth noting that there may be one or more main control boards, and when there are multiple boards, they may include a primary main control board and a backup main control board. There may be one or more interface boards. The stronger the data processing capability of the computer device, the more interface boards are provided. There may also be one or more physical interface cards on the interface board. There may be no switching network board, or there may be one or more switching network boards. When there are multiple switching network boards, they can jointly realize load sharing and redundant backup. Under the centralized forwarding architecture, the computer device may not need a switching network board, and the interface board is responsible for the processing function of the business data of the entire system. Under the distributed forwarding architecture, the computer device may have at least one switching network board, and the switching network board is used to realize data exchange between multiple interface boards, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of computer devices with distributed architecture are greater than those of computer devices with centralized architecture. Optionally, the computer device may have only one board, that is, no switching network board, and the functions of the interface board and the main control board are integrated on the board. In this case, the central processor on the interface board and the central processor on the main control board can be combined into one central processor on the board to perform the functions of the two. This type of computer device has low data exchange and processing capabilities (for example, low-end switches or routers and other computer devices). The specific architecture to be adopted depends on the specific networking deployment scenario, and no limitation is made here.
[0164] In a specific embodiment, the computer device 2100 corresponds to the above Figure 8 The task scheduling device shown is applied to the task scheduling device. In some embodiments, Figure 8 The scheduling module 802 in the task scheduling apparatus shown is equivalent to the physical interface card 2133 in the computer device 2100 , and the determination module 801 is equivalent to the central processing unit 2111 or the network processor 2132 in the computer device 2100 .
[0165] The embodiment of the present application also provides a communication device, which includes: a transceiver, a memory and a processor. The transceiver, the memory and the processor communicate with each other through 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, and when the processor executes the instructions stored in the memory, the processor executes the method required to be executed by the task scheduling device.
[0166] It should be understood that the processor may be a CPU, or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, 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 supporting the advanced reduced instruction set machine (ARM) architecture.
[0167] Further, 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 information about the device type.
[0168] The memory may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM) and direct memory bus random access memory (DR RAM).
[0169] An embodiment of the present application also provides a computer-readable storage medium, in which at least one instruction is stored. The instruction is loaded and executed by a processor so that a computer implements any of the task scheduling methods described above.
[0170] The embodiments of the present application also provide a computer program (product), which, when executed by a computer, can enable a processor or a computer to execute the corresponding steps and / or processes in the above method embodiments.
[0171] An embodiment of the present application also provides a chip, including a processor, for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes any of the task scheduling methods described above.
[0172] 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 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 of the task scheduling methods described above.
[0173] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, 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 instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. 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 a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (solid state disk)), etc.
[0174] Those of ordinary skill in the art will appreciate that, in conjunction with the various method steps and modules described in the embodiments disclosed herein, they 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 of ordinary skill 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.
[0175] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, 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.
[0176] 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 divided 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.
[0177] The computer program code for realizing the method for the embodiment of the present application can be written in one or more programming languages. These computer program codes can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by a computer or other programmable data processing device, causes the function / operation specified in the flow chart and / or block diagram to be implemented. The program code can be executed completely on a computer, partially on a computer, as an independent software package, partially on a computer and partially on a remote computer or completely on a remote computer or server.
[0178] In the context of the embodiments of the present application, computer program codes or related data may be carried by any appropriate 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.
[0179] Examples of signals may include electrical, optical, radio, acoustic or other forms of propagated signals, such as carrier waves, infrared signals, etc.
[0180] A machine-readable medium may be any tangible medium that contains or stores a program for or related to 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.
[0181] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0182] In the several embodiments provided in the present 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 only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, 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 it can be an electrical, mechanical or other form of connection.
[0183] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place or distributed on 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.
[0184] In addition, each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0185] If the integrated module is implemented in the form of a software function 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 to enable 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: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0186] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limitation on the quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another element.
[0187] 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.
[0188] The term "at least one" in this application means one or more, and the term "multiple" in this application means two or more, for example, multiple second messages means two or more second messages. The terms "system" and "network" are often used interchangeably herein.
[0189] It should be understood that the terms used in the description of the various examples herein are only for describing specific examples and are 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.
[0190] It should also be understood that the term "and / or" used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and / or" is a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.
[0191] It should 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.
[0192] 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 [a stated condition or event] is detected" may be interpreted to mean "upon determining that ..." or "in response to determining that ..." or "upon detecting [a stated condition or event]" or "in response to detecting [a stated condition or event]," depending on the context.
[0193] It should be understood that determining B based on A does not mean determining B only based on A. B can also be determined based on A and / or other information.
[0194] It should also be understood that the references to "one embodiment", "an embodiment", or "a possible implementation" throughout the specification mean that specific features, structures, or characteristics related to the embodiment or implementation are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment", or "a possible implementation" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0195] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application should be included in the protection scope 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.