A dynamic scheduling method based on longest path task insertion

By adopting a dynamic scheduling method based on longest path task insertion in a multiprocessor system, the problem of processor load imbalance is solved, the communication time and waiting time between key nodes are reduced, and the scheduling efficiency and system practicality are improved.

CN118295781BActive Publication Date: 2025-03-14CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410452191.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-16
Publication Date
2025-03-14
Estimated Expiration
2044-04-16

AI Technical Summary

Technical Problem

The task scheduling method of existing multi-processor parallel systems leads to unbalanced processor load, with overload and vacant states, which increases communication time and wait time, and reduces system efficiency and practicality.

Method used

The dynamic scheduling method based on the insertion of the longest path task is adopted. By obtaining the execution time and communication time of the task, the workflow is converted into a directed acyclic graph DAG, the priority score of the task is calculated, the key tasks are found, and their related tasks are uniformly placed on a processor for execution, reducing the communication time and waiting time between key nodes.

Benefits of technology

By inserting tasks on other paths into critical paths, communication time and waiting time between key nodes are reduced, scheduling time is shortened, scheduling efficiency is improved, and resource waste and time cost are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118295781B_ABST
    Figure CN118295781B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of computer technology, and specifically relates to a dynamic scheduling method based on the longest path task insertion, including: obtaining the execution time and communication time of tasks in a workflow, converting the workflow into a directed acyclic graph; calculating the priority of each task in the directed acyclic graph, and calculating the key tasks; specifying a processor to only process the key tasks, and other processors to process the remaining tasks, to obtain a task scheduling table; traversing the key tasks from back to front, and scheduling qualified non-key tasks to the processor that processes the key tasks for execution. The present invention reduces the communication time or waiting time between tasks, thereby achieving the purpose of shortening the completion time of the processor that processes the key tasks, achieving the purpose of accelerating the total task completion time, and effectively reducing the completion time of the workflow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer technology, specifically relating to a task scheduling method based on homogeneous processors. Background Technology

[0002] In recent years, research on multiprocessor (including multi-core processor) systems with high-performance computing capabilities has gradually matured. Multiprocessors have been adopted in many parallel systems; for example, cloud computing in the era of big data uses multiprocessing as a form of parallel processing. As the scale of data continues to grow, the demands on computing environments are increasing.

[0003] Currently, most multiprocessor parallel systems still use traditional task scheduling techniques (randomly assigning tasks to idle processors). This results in uneven task allocation across processors, with some processors overloaded while others remain idle. It also retains a significant amount of communication and waiting time, preventing the full realization of the high efficiency of multiprocessors and causing resource waste. Consequently, the time cost is high, making it difficult to meet the information processing time requirements of today's artificial intelligence and autonomous driving fields, resulting in low practicality. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention proposes a dynamic scheduling method based on longest path task insertion, comprising:

[0005] S1. Obtain the execution time and communication time of each task in the workflow on the processor;

[0006] S2. Transform the workflow into a directed acyclic graph (DAG);

[0007] S3. Based on the execution time and communication time of the task on the processor, the priority score of each task in the directed acyclic graph (DAG) is calculated using the downward and upward sorting methods respectively, and the key tasks are identified based on the priority scores.

[0008] S4. Select a processor P cp Only handle critical tasks; other processors P i Process other tasks, sort them according to priority scores to obtain a scheduling table, and record the earliest completion time (EFT) of each task. i ) and the processor's earliest completion time EFT(P) i ); where EFT(v i ) represents task v i The earliest completion time on the schedule, EFT(P) i ) indicates processor Pi The earliest completion time;

[0009] S5. Traverse the critical tasks from back to front. If a non-critical task meets the condition, place it in processor P. cp Execute the task and update it as a critical task;

[0010] S6. If there are non-critical tasks, they should be placed on processor P. cp If the above is executed, then repeat step S5 until no task meeting the conditions is placed in processor P. cp Executed in China.

[0011] The beneficial effects of this invention are:

[0012] This invention reduces communication and waiting time between critical nodes by inserting tasks from other paths into the critical path, which is the longest path, and by placing critical nodes on a single processor for execution. The total scheduling time is controlled by a single processor, which reduces the total scheduling time and eliminates communication time, thereby shortening the path length and greatly improving scheduling efficiency. Attached Figure Description

[0013] Figure 1 This is a schematic diagram of an undirected graph (DAG) for a dynamic scheduling method based on longest path task insertion according to the present invention.

[0014] Figure 2 This is a schematic representation of the scheduling process after the initial scheduling in this invention;

[0015] Figure 3 The scheduling representation intent for finding the first eligible non-critical task v6 and placing it into the processor scheduling for critical tasks in this invention;

[0016] Figure 4 This invention represents the final scheduling intent after finding all non-critical tasks that meet the criteria.

[0017] Figure 5 This represents the scheduling intent of traditional scheduling methods.

[0018] In the diagram, each row of the scheduler represents the task scheduling status of a processor, each cell represents a unit of time, the number of cells occupied by the same letter and number represents the execution time of that task, blank cells represent waiting time, yellow cells represent execution time, and the length of the scheduler represents the total scheduling time of the tasks. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] A dynamic scheduling method based on longest path task insertion includes:

[0021] S1. Obtain the execution time and communication time of each task in the workflow on the processor;

[0022] S2. Transform the workflow into a directed acyclic graph (DAG); for example... Figure 1 As shown, s represents the start task, t represents the end task, 1-9 represent task numbers, the numbers in parentheses represent the execution time, the numbers on the lines represent the communication time between tasks, the dark-colored tasks represent critical tasks, and the arrows represent the direction of task execution.

[0023] S3. Based on the execution time and communication time of the task on the processor, the priority score of each task in the directed acyclic graph (DAG) is calculated using the downward and upward sorting methods respectively, and the key tasks are identified based on the priority scores.

[0024] S4. Select a processor P cp Only handle critical tasks; other processors P i Process other tasks, sort them according to priority scores to obtain a scheduling table, and record the earliest completion time (EFT) of each task. i ) and the processor's earliest completion time EFT(P) i ); where EFT(v i ) represents task v i The earliest completion time on the schedule, EFT(P) i ) indicates processor P i The earliest completion time;

[0025] S5. Traverse the critical tasks from back to front. If a non-critical task meets the condition, place it in processor P. cp Execute the task and update it as a critical task;

[0026] S6. If there are non-critical tasks, they should be placed on processor P. cp If the above is executed, then repeat step S5 until no task meeting the conditions is placed in processor P. cp Executed in China.

[0027] The priority score of each task in the directed acyclic graph (DAG) is calculated using both downward and upward sorting methods, including:

[0028] Downward sorting method:

[0029]

[0030] Upward sorting method:

[0031]

[0032] Among them, rank down (v i ) represents the task v calculated using the downward sorting method. i Priority score, c k,i Indicates connection task v k With task v i The communication time, pred(v i ) represents task v i The parent task set, rank down (v k ) represents the task v calculated using the downward sorting method. k priority score, w i Indicates task v i Execution time on any processor; rank up (v i ) represents the task v calculated using the upward sorting method. i Priority score, succ(v) i ) represents task v i The set of subtasks, rank down (v j ) represents the task v calculated using the downward sorting method. j Priority score, c i,j Indicates connection task v i With task v j Communication time.

[0033] Specifically, in this case, the priority of each task is calculated, and the priorities of each task are shown in Table 1.

[0034] Table 1

[0035]

[0036]

[0037] Identify key tasks based on priority scores, including:

[0038] If rank down (v i) = rank up (v i If the rank is specified, then the task is a critical task; where rank is specified. down (v i ) represents the task v calculated using the downward sorting method. i Priority score, rank up (v i ) represents the task v calculated using the upward sorting method. i Priority score.

[0039] Tasks are sorted according to priority scores to obtain a scheduling table, including:

[0040] According to the upward sorting method, tasks with lower priority scores have higher priority. These are sorted first, and a queue (QueueCP{v) is set up. j As a scheduling table, critical tasks are placed into a queue according to their priority from lowest to highest. Specifically, in this case, QueueCP{s, 2, 4, 5, 9, t}. In this case, the processing priorities of all nodes are: S, 2, 1, 4, 5, 3, 6, 7, 8, 9, t, resulting in the following scheduling table: Figure 2 As shown.

[0041] Traverse the critical tasks from back to front. If a non-critical task meets the condition, place it in processor P. cp Execute the above and update the task to a critical task, including:

[0042] S51. Traverse the queue QueueCP{v from back to front. j If task v j There exists a non-critical parent task v i If S52 is not executed, then S57 is executed.

[0043] S52, if v i There exists a non-critical parent task v k Then record the communication time c. k,i Otherwise c k,i If the value is set to 0, then v k If multiple parent tasks exist, record the relationship between each parent task and v. i The communication time; where c k,i Indicates connection task v k With task v i Communication time;

[0044] Where v j Indicates v i subtasks, v k Indicates v i The parent task;

[0045] S53, Select communication time c k,i The biggest task v i Calculate v i Put into processor P cp The execution time T(v) i If T(v) i )≤c i,j If the condition is met, then execute S54; otherwise, execute S57; where c i,j Indicates connection task v i With task v j Communication time;

[0046] S54, if v i With v k In the same processor P i If executed above, then newEFT(P) i ) = EFT(P i Otherwise, newEFT(P) i ) = EFT(P i )-∑c k,i Among them, EFT(P) i ) indicates processor P i The earliest completion time, newEFT(P) i ) indicates the updated processor P i The earliest completion time;

[0047] S55 if v i With v j In the same processor P i If executed above, then RnewEFT(P) i ) = new EFT(P i )+∑c k,i Otherwise, keep the updated processor P. i The earliest completion time remains unchanged; among them, RnewEFT(P i ) indicates the updated processor P i The earliest completion time;

[0048] S56. If RnewEFT(P) i ) < EFT(P cp ), then v i Put it in P cp Execution; where EFT(P) cp ) indicates processor P cp The earliest completion time;

[0049] S57. Update tasks and continue traversing tasks backward from S51. If all critical tasks have been traversed, they will be placed in processor P. cpSet the task as a critical task and add it to the queue QueueCP{v j In the middle, clear the air conditioning meter;

[0050] S58. If a new task is added to the queue QueueCP{v j If the condition is met, then proceed to execute S4; otherwise, execution ends.

[0051] Calculate c k,i The biggest task v i Put into processor P cp The execution time T(v) i ),include;

[0052] T(v i ) = w i +∑c k,i

[0053] Wherein, T(v) i The task with the longest communication time is represented by (v). i Put into processor P cp The time taken for the above execution, w i Indicates the execution time of task vi on any processor, c k,i This indicates the communication time between task vk and task vi.

[0054] Specifically, in this case, v t Since none of the parent nodes are non-critical nodes, we continue traversing forward from v9. We find that v9 has non-critical parent nodes v6 and v8, and c 6,9 >c 8,9 At this point, choose c. k,i The largest task is v6, T6 = w6 + ∑c 3,6 =1+1=2, T6<c 6,9 Since v6 and v3 execute on the same processor P2, newEFT(P2) = EFT(P2) = 19. Because v6 has no non-critical child nodes, newEFT(P2) = 19. Because newEFT(P2) < EFT(P3),... cp =23, so put v6 in P cp implement.

[0055] Specifically, because v6 includes QueueCP{v j Therefore, it jumps to S4 to update the scheduling table, and then restarts from v. t Begin iterating. The updated schedule table is as follows: Figure 3 As shown, the update task continues to traverse forward and finds v t The non-critical parent node v8 of v9 does not meet the conditions. The non-critical parent node v3 of v6 is calculated to have T3 = w3 = 2. If T3 > c...3,6 If v5 does not meet the condition, then v4 does not meet the condition. Continuing to traverse forward, v5 also does not meet the condition. We find that v4 has a non-critical parent node v1. The same logic applies to v6, leading to the conclusion that v1 should be placed in P. cp Execute and update the scheduling table as follows: Figure 4 Jump back to S4 and re-traverse all key nodes. If no new nodes are added, the execution ends.

[0056] Specifically, in this case, the generated scheduling table is as follows: Figure 5 As shown, by comparison, the scheduling time required by the present invention is 21, while the time required by ordinary scheduling is 27, which significantly improves the scheduling efficiency.

[0057] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A dynamic scheduling method based on longest path task insertion, characterized in that: include: S1, obtain the execution time and communication time of each task in the workflow on the processor; S2, convert the workflow into a directed acyclic graph DAG; S3. Based on the execution time and communication time of the tasks on the processor, the priority score of each task in the directed acyclic graph DAG is calculated by using the downward and upward sorting methods, and the key tasks are found according to the priority scores. The priority score of each task in the directed acyclic graph DAG is calculated using the downward and upward sorting methods, including: Sort downwards: Sort upwards: Among them, rank down (v i ) represents the task v calculated according to the downward sorting method i The priority score, c k,i Represents the connection task v k With task v i The communication time, pred(v i ) represents task v i The parent task set, rank down (v k ) represents the task v calculated according to the downward sorting method k The priority score, w i Represents task v i Execution time on any processor; rank up (v i ) represents the task v calculated according to the upward sorting method i The priority score, succ(v i ) represents task v i The subtask set, rank down (v j ) represents the task v calculated according to the downward sorting method j The priority score, c i,j Represents the connection task v i With task v j Communication time; S4. Select a processor P cp Only handle critical tasks, other processors P i Process other tasks, sort the tasks according to the priority scores, get the schedule, and record the earliest completion time EFT (v i ) and the earliest completion time EFT(P i ); EFT(v i ) represents task v i The earliest completion time on the schedule, EFT (P i ) represents processor P i The earliest completion time; S5, traverse the critical tasks from back to front, if there is a non-critical task that meets the conditions, put it on processor P cp and update the task to a critical task; Traverse the critical tasks from back to front, if there are non-critical tasks that meet the conditions, put them on processor P cp and update the task to a critical task, including: S51, traverse the queue QueueCP from back to front {v j }, if task v j There is a non-critical parent task v i Then execute S52, if it does not exist, execute S57; S52, if v i There is a non-critical parent task v k , then record the communication time c k,i , otherwise c k,i The value is set to 0. If v k If there are multiple parent tasks, record each parent task and v i Communication time; where v j Indicates v i The subtask, v k Indicates v i The parent task of S53, select communication time c k,i The biggest task v i , calculate v i Put it into processor P cp The time taken to execute the above i ), if T(v i )≤c i,j , then execute S54, otherwise execute S57; S54, if v i With v k On the same processor P i Executed on, then newEFT(P i )=EFT(P i ), otherwise newEFT(P i )=EFT(P i )-∑c k,i ; Among them, EFT (P i ) represents processor P i The earliest completion time, newEFT(P i ) represents the updated processor P i The earliest completion time; S55 if v i With v j On the same processor P i If RnewEFT(P i )=newEFT(P i )+∑c k,i Otherwise, keep the updated processor P i The earliest completion time remains unchanged; among them, RnewEFT(P i ) represents the processor P after updating again i The earliest completion time; S56, if RnewEFT(P i ) <EFT(P cp ), then v i Put it in P cp Execution; Among them, EFT (P cp ) represents processor P cp The earliest completion time; S57, update the task, continue to traverse the task forward from S51, if all the key tasks have been traversed, then put them into processor P cp The task is set as a critical task and added to the queue QueueCP{v j }, and clear the air meter; S58, if there is a new task put into the queue QueueCP{v j }, then jump to S4, otherwise the execution ends; Calculate c k,i The biggest task v i Put it into processor P cp The time taken to execute the above i ),include; T(v i )=w i +∑c k,i Among them, T(v i ) represents the task v with the longest communication time i Put it into processor P cp The time taken to execute the above S6, if there are non-critical tasks placed on processor P cp If the task is executed on the processor P, step S5 is repeated until no task that meets the conditions is placed on the processor P. cp Executed in.

2. A dynamic scheduling method based on longest path task insertion according to claim 1, characterized in that: Identify key tasks based on priority scores, including: If rank down (v i )=rank up (v i ), then the task is a critical task; among them, rank down (v i ) represents the task v calculated according to the downward sorting method i The priority score, rank up (v i ) represents the task v calculated according to the upward sorting method i The priority score of .

3. The dynamic scheduling method based on longest path task insertion according to claim 1 is characterized in that: Sort the tasks according to the priority scores and get a schedule, including: According to the upward sorting method, the tasks with lower priority scores have higher priorities and are arranged first. Set the queue QueueCP{v j }As a scheduling table, key tasks are placed in the queue according to their priority from small to large.

Citation Information

Patent Citations

  • Workflow scheduling method based on critical path task prospects

    CN107301500A

  • Cost-based workflow scheduling method in IaaS environment

    CN117742920A