A heuristic task scheduling method based on DAG

By dividing DAG nodes into subsets and optimizing scheduling, the resource waste problem of task scheduling algorithms on multi-core platforms is solved, and more efficient task execution and resource utilization are achieved.

CN115686795BActive Publication Date: 2025-08-08DALIAN UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211424686.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-14
Publication Date
2025-08-08
Estimated Expiration
2042-11-14

AI Technical Summary

Technical Problem

On multi-core platforms, the existing technology task scheduling algorithms cannot effectively limit the worst-case response time, resulting in waste of resources and poor performance.

Method used

The nodes of the DAG are divided into multiple subsets, and each subset is scheduled, and finally merged into the scheduling of the entire DAG. Through priority order and core resource allocation, the task execution time is optimized.

Benefits of technology

It reduces the average response time of the system, increases the number of tasks completed within a unit time, reduces resource waste, and makes full use of multi-core hardware computing capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115686795B_ABST
    Figure CN115686795B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of real-time embedded systems, and specifically relates to a heuristic task scheduling method based on DAG. The present invention divides the nodes of DAG into several subsets, then schedules each node subset, and merges the scheduling of all node subsets into scheduling for all task nodes on the entire DAG. The method can complete static scheduling of the system during the compilation phase of the design of an embedded system with a DAG structure. By using the scheduling method for tasks on DAG proposed by the present invention, the average response time of the system is effectively reduced compared to the classic Graham list scheduling algorithm, and embedded systems with limited computing resources can increase the number of tasks completed per unit time and complete tasks with as few running cores as possible, thereby avoiding resource waste.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of real-time embedded systems, and in particular relates to a DAG-based heuristic task scheduling method. Background Art

[0002] Real-time and embedded systems are transitioning from single-core to multi-core platforms. Software must be parallelized on multi-core platforms to fully utilize the computing power of multi-core hardware. Multi-core refers to the integration of two or more complete computing engines (cores) within a single processor. Multi-core systems are more scalable and can incorporate more powerful computing units in a more compact form factor. Such systems consume less power and generate less heat due to computing power consumption.

[0003] Currently, most real-time parallel tasks can be modeled as directed acyclic graphs (DAGs). DAGs are highly expressive models in real-time systems and are a common model for modeling parallel programs. Scheduling DAG tasks on multi-core processors is a key issue in high-performance computing. In real-time scenarios, a good scheduler should not only achieve competitive performance in practice but also be predictable in theory. Task scheduling refers to the process by which a system executes tasks at specific, agreed-upon times to automatically complete them. Task scheduling frees up manpower, allowing the system to automatically execute tasks. The task scheduling system is responsible for specifying when each task runs and ends, as well as properly handling dependencies between tasks.

[0004] The response time of a DAG refers to the time it takes to execute all nodes in G under the scheduling algorithm applied on a multi-core platform. In the field of real-time embedded systems, a challenging problem is how to effectively bound the worst case response time (WCRT).

[0005] The classic Graham list scheduling algorithm provides a safe upper bound for the system's response time analysis, but its analysis results are significantly higher than those of the actual system. In embedded systems with very limited computing resources, such errors may cause huge waste of resources. Summary of the Invention

[0006] Real-time embedded systems are transitioning from single-core platforms to multi-core platforms. Software must be parallelized on multi-core platforms. In order to fully utilize the computing power of multi-core hardware platforms, this paper proposes a heuristic scheduling method for task scheduling on DAG with improved response time bounds.

[0007] The technical solution of the present invention:

[0008] A DAG-based heuristic task scheduling method, the steps are as follows:

[0009] Step 1: Determine the system's DAG model

[0010] The real-time tasks on the real-time system or embedded system are modeled as DAG G = (V, E), where V is a set of nodes and E is a set of edges; each node v in V i Represents a continuous execution code with execution time e i ; Each edge (v i ,v j )∈E represents node v i and v j The priority relationship between i It is v j The predecessor node, v j It is v i The successor node; if v i It is v j The predecessor node of the predecessor node is called node v i It is v j The ancestor node is called v j It is v i Descendant nodes of ;.

[0011] Step 2: Divide the nodes in the DAG into several node subsets

[0012] The node set V of DAG G is divided into several subsets, and the node partition is expressed as P(V) = {V1, V2, ..., V l}, where V l =k (k = 1, ..., l) represents the kth subset of P(V); the node partition P(V) is solved by finding a set of path sequences in G, where the path sequence set is denoted as Π = {π1,π2, ...,π l}, so that The path covers all nodes in V, that is And every path π of π k Contains at least one that does not belong to {π1,...,π k-1}, that is,

[0013] Step 3: Schedule each node subset separately and integrate them into the schedule of the entire DAG

[0014] Serially schedule the node subset of P(V). First, each node v i The start time b i and end time f iare initialized to +∞ and 0 respectively; then, subsets of P(V) are added from V1 to V l Schedule one by one; for each subset V k , assuming V k The nodes in V are sorted in order of priority, i.e. k Any node v in i and v j , if v i It is v j ancestor node, then i <j。

[0015] For the node set V k Each node v in i The scheduling includes: calculating the available time interval, core allocation and rescheduling process, specifically: first, calculating the available time interval [t a ,t b ); then, if there are enough core resources in the available time interval [t a ,t b ) execute v i , the core is assigned to v i , and decide node v i otherwise, by rescheduling v i The descendant nodes of v are used to extend the available time interval and schedule v in the extended available time interval i .

[0016] Finally, the node subsets in P(V) are serially scheduled in the order of their subscripts, which is the schedule of the entire DAG.

[0017] The beneficial effects of the present invention are:

[0018] This invention proposes a new method for scheduling tasks on a DAG. This method divides the nodes of the DAG into several subsets, then schedules each node subset and combines the scheduling of all node subsets into a schedule for all task nodes on the entire DAG. This method can statically schedule the system during the compilation phase of an embedded system design with a DAG structure. By using the proposed method for scheduling tasks on a DAG, the average response time of the system is effectively reduced compared to the classic Graham list scheduling algorithm. This method can enable embedded systems with limited computing resources to complete more tasks per unit time and use the fewest possible number of running cores to complete tasks, thereby avoiding resource waste. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 Flow chart of the steps of the method of the present invention;

[0020] Figure 2is an example graph of a DAGG, and also an example graph of the residual graph G1 of graph G;

[0021] Figure 3 is an example graph of the remaining graph G2 of graph G;

[0022] Figure 4 is an example graph of the remaining graph G3 of graph G;

[0023] Figure 5 The figure shows the comparison of the response time between the scheduling method of the present invention and the classic list scheduling method. DETAILED DESCRIPTION

[0024] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and technical solutions.

[0025] The basic process of the DAG-based heuristic task scheduling method of the present invention is as follows: Figure 1 The specific steps are as follows:

[0026] Step 1: Determine the system's DAG model

[0027] The real-time tasks on a real-time system or embedded system are modeled as DAG G = (V, E), where V is a set of nodes and E is a set of edges. Each node v in V i Represents a continuous execution code with execution time e i ; Each edge (v i ,v j )∈E represents node v i and v j The priority relationship between i It is v j The predecessor node, v j It is v i The successor node of v i The set of predecessor nodes is PRED(v i ) means, v i The set of successor nodes is SUCC(v i ) means. If v i It is v j The predecessor node of the predecessor node is called node v i It is v j The ancestor node is called v j It is v i Descendant nodes of Node v i The set of ancestor nodes and the set of descendant nodes are respectively represented by ANCS(v i ) and DESC(v i) represents a node without a predecessor node. A node without a successor node is called a sink node. Without loss of generality, assume that G has a source node v src and a sink node v snk .like Figure 2 The following is an example DAG graph, where v1, ..., v7 are node labels in the DAG, and the numbers on the nodes represent their execution time (in milliseconds). If G has multiple source / sink nodes, a fake source / sink node with an execution time of 0 can be added to meet the assumptions of the present invention.

[0028] The path π of G is a node sequence, that is, π=(v1,v2,...,v k ), where v k is the kth node of π. The length of path π, len(π), is the total execution time of the nodes in π, i.e. The longest path π of G * is the path with the maximum length in G, that is, π * =argmax{len(π)|π is a path in G}. The length of G, len(G), is expressed as the longest path π in G. * The length of G, that is, len(G) = len(π * ). The total amount of G, vol(G), is expressed as the sum of the execution time of all nodes in G, that is,

[0029]

[0030] The present invention is based on a multi-core platform consisting of m cores The node of scheduling G, that is where c1,...,c m Represents the available cores. The scheduling of G is to assign each node of G More formally, the present invention models the schedule s as a function s(x, t), such that if a node v of G i At time t in the core c x If the kernel c x (x∈{1,...,m}) is idle at time t, then s(x,t)=-1. The present invention uses s -1 (i) = {t|s(x, t) = i} to represent the core execution node v i The time slice set of b i =min{t|t∈s -1 (i)} is v i The start time, f i =max{t|t∈s -1 (i)}+1 is v iThe end time of node v i From b i Start execution, in f i End execution. A feasible schedule must satisfy the following constraints:

[0031] (1) At any time t, a node can only be executed by one core, that is, for any node v i ∈G, if s(x,t)=s(l,t), then x=l.

[0032] (2) At any time t, a core cannot execute more than one node simultaneously, i.e., for any core c x ∈C, if s(x,t)=i and s(x,t)=j, then i=j.

[0033] (3) Node v i The execution continues i Time unit, i.e. |s -1 (i)|=e i .

[0034] (4) Each node v i Only in v i It can only be executed when all the predecessor nodes are completed, that is,

[0035] (5) A node can be migrated from one core to another for execution. For example, if the node v i In nuclear c x is executed and is interrupted before its execution is completed, then v i Can be on another core c l Resume execution.

[0036] Step 2: Divide the nodes in the DAG into several node subsets

[0037] The node set V of DAGG is divided into several subsets, and the node partition is expressed as P(V) = {V1, V2, ..., V l}, where V l =k (k=1,...,l) represents the kth subset of P(V).

[0038] A graph partition P(V) satisfies the following conditions:

[0039] (1) Any two subsets V of P(V) h and V k are disjoint, i.e. (where 1≤h,k≤l and h≠k). It ensures that nodes can only be contained in exclusive subsets.

[0040] (2) The subset of P(V) covers all nodes of G, that is, It guarantees that every node of G can be contained in a subset of P(V).

[0041] (3) Subset V k There is a priority order between any two nodes, namely V k Any two nodes of V cannot be executed in parallel at any time. k All nodes of V belong to a path. k = {v1, v2, ...} nodes are sorted in order of priority, that is, for the sorted subset V k Any adjacent node v in i and v i+1 , v i It is v i+1 ancestors.

[0042] The node partition P(V) is solved by finding a set of path sequences in G, where the path sequence set is denoted as Π={π1,π2,...,π l}, so that the path of π covers all nodes in V, that is, And every path π of π k Contains at least one that does not belong to {π1,...,π k-1}, that is, Using the paths in π, we compute each subset V in P(V) as follows k :

[0043]

[0044] Furthermore, the residual graph method is used to find the path sequence. The residual graph is defined as: given a path sequence Π={π1,...,π l} and integer 1≤k≤l, the residual graph G of G k (k=1,2,...) is a graph with the same topology as the original graph G. k Each node v i Execution time In (3) we define: If v i Belong to the path π1,...,π l ∈Π, then G k v in i Execution time is 0. Otherwise, v i has the same execution time e as in the original graph G i .

[0045]

[0046] Obviously G1=G, so the example of G1 is Figure 2 To better understand the remaining graph, Figure 3 and Figure 4 They respectively show Figure 2 The residual graphs G2 and G3 obtained from the DAG G in .

[0047] The remaining graph G k The path π in has a residual length Residual graph G k The longest path π * is the residual graph G k The path with the largest remaining length among all the paths in

[0048] Iteratively solve the subsets of node partition P(V) and the paths in the path sequence π:

[0049] At the beginning, the node partition P(V) and the path sequence Π are initialized to empty, and the variable l is initialized to 1. In the while loop structure, l is used as the iteration indicator, and the loop condition is

[0050] In each round of iteration, first solve the remaining graph G l The longest path π * Then use the longest path π * And formula (2), a new subset V is constructed new ={v i |v i ∈π *}-∪ π∈Π {v i |v i ∈π}. * Add to π and subset V new Add to the node partition P(V). From this we can see that π * is the lth path in π, and V k The present invention updates the value of the iteration indicator l to add 1, and continues the process until the node partition P(V) covers all nodes of V, that is, After the iterative process is completed, the node partition P(V) and path sequence Π are finally returned.

[0051] Furthermore, we solve the given residual graph G l The longest path π * The method is: given the residual graph G l , for any node v i, using S(v i ) indicates that on the path π * (v i ) is the set of nodes passed through in the process, where π * (v i ) refers to the slave node v i Start and in all from v i In the starting path (in the remaining graph G l The path with the longest length in the definition of i The node set S(v i ) is initialized to contain only one node v i Get the node set of G l The topological order of the nodes in G l ), and solve G in the reverse order of σ (i.e. from sink node to source node) l The node set S(v i ). For each node v i , there are two possible situations:

[0052] (1) Case 1: v i There is no successor node (e.g., v i is a sink node), then v i The node set S(vi) contains only one initialized node v i .

[0053] (2) Case 2: v i There is a successor node, then for v i Each successor node v j , its weight w(v j ) is expressed as S(v j ) is the sum of the (remaining) execution time of all nodes in According to S(v j ) definition, weight w(v j ) is equal to G l Chinese j is the length of the longest path from the starting point. Select v i A successor node v with the maximum weight * , and v * The node set S(v * ) merged into v i The node set S(v i ).

[0054] Repeat this process until all nodes in σ are traversed, and the longest path solved is the node set starting from the source node, that is, π * =S(v src ), which is contained in the residual graph Gl All the nodes passed through in the longest path of

[0055] Step 3: Schedule each node subset separately and integrate it into the schedule for the entire DAG

[0056] The node subset of the serial schedule P(V). First, initialize the start time b i and the end time f i of each node v i [[ID=...]]分别初始化为+∞和0。然后,将P(V)的子集从V1到V to +∞ and 0 respectively. Then, schedule the subsets of P(V) one by one from V1 to V l . For each subset V k , assume that the nodes in V k are sorted in priority order, that is, for any node v k and v i in V j , if v i is an ancestor node of v j , then i < j. Schedule the nodes in V k as follows in sequence.

[0057] The scheduling of a node v k in the node set V i is carried out (at most) in three steps: calculating the available time interval, kernel allocation, and rescheduling process. First, calculate the available time interval [t i , t a during which node v b can be executed. Then, if there are sufficient kernel resources to execute v a within the available time interval [t b , t i , allocate the kernel to v i and determine the time period during which node v i is executed; otherwise, extend the available time interval by rescheduling the descendant nodes of v i and schedule v i within the extended available time interval.

[0058] Furthermore, for the first step of the scheduling of node v i : the method of calculating the available time interval. The scheduling of v i is not independent of the scheduling of other nodes. More specifically, for any ancestor node v i and any descendant node v s of v d , the present invention assumes that nodes v s and v d have already been scheduled beforehand. The start time b i of node v i must be greater than vi Ancestor v s The end time of v i End time f i Must be less than v i Descendants of v d The present invention uses t a and t b Represents node v i The earliest time that execution can begin and v i The latest time that the execution must be completed. a ,t b ) is the node v i Available time interval for execution. i If there are ancestors, then t a Equal to v that has been scheduled in advance i The maximum completion time of the ancestor, t a =max{f j |v j ∈ANCS(v i )}, otherwise t a =0; if v i If there are descendants, then t b Equal to v that has been scheduled in advance i The minimum starting time of the descendants of b =min{b j |v j ∈DESC(v i )}, otherwise t b =+∞.

[0059] Furthermore, for node v i The second step of scheduling: core allocation. In the available time interval [t a ,t b ) allocates cores to execute v i Use I ab To collect [t a ,t b ) time slices, during which there are some idle cores that can execute node v i More specifically, for the interval [t a ,t b ) at each time point t, if a kernel c x If it is idle at time t, store s(x,t) in I ab In the middle, it means core c x Node v can be executed at time t i Node v i At a time point t, it can only be executed on one core at most. Only idle cores can execute node vi If there is e i can be used to execute v i The time slice, i.e. |I ab |≥e i , then the initial e i time slices (and associated cores) to execute node v i If [t a ,t b ) does not have enough available time slices, i.e. |I ab | <e i , the available time interval should be extended to ensure that there is time to execute v i e i In addition, node v i It can be in the interval [t a ,t b ) period is assigned to more than one core.

[0060] Furthermore, for node v i The third step of scheduling: rescheduling the process. If the available time interval [t a ,t b ) is too narrow to execute node v i , then by rescheduling v i Descendant nodes to expand the interval [t a ,t b ). For v i Each descendant node v j , if it has been scheduled in advance, v j From the assignment to v j For any core c x , if c x At a time point t, execute v j (i.e. s(x,t)=j), then the kernel c x Reset to the idle state, that is, s(x,t)=-1. In addition, v j The start time of v is reset to +∞ and v j The end time is reset to 0, indicating that v j Through the above process, v i All descendants of are set to the unscheduled state, so the execution of v i The available interval is extended to [t a ,+∞), during which there must be enough idle time slices to execute v i Then use the method in the second step to schedule v i Node v i Can be in t aAfter that, it will be executed on the first idle time slice. i Descendants of v j , it needs to be rescheduled in the subsequent steps. j Stored to node set V res and reschedule V res Nodes in .

[0061] Furthermore, for rescheduling V res First get V res The priority of the nodes, i.e. σ res =PrecedenceOrder(V res ). More specifically, for V res Any two nodes v i and v j There are two possible situations: if v i and v j There are precedence constraints between them. Without loss of generality, assume that v i It is v j The ancestors, in this case, in σ res In, v i In v j Before; otherwise, v i and v j There is no priority constraint, and it can be executed in parallel. According to the conditions of node partition P(V), v i and v j must belong to different subsets of P(V), let v i Belong to V h , let v j Belong to V k , without loss of generality, assume that during the graph partitioning process, V h Earlier than V k is constructed, in this case, in σ res In, v i In v j Then use the above method to schedule V res Nodes in .

[0062] Through the above process, the sequential execution schedule of the node subset of P(V) is finally obtained, which is the static feasible schedule of G.

[0063] Analyze real-time performance: Analyze the response time limit of the DAG under the scheduling method proposed in this invention.

[0064] Assume that the schedule s of G (under the scheduling method proposed in this invention) lasts for R(s) time slices, and these time slices are divided into two disjoint parts (for example, T1∪T2) as follows: for each time point t=1,2,...,R(s), if a node of the longest path of G (that is, the first path π1 in Π) is executed at time point t, then let t be in T1; otherwise, all nodes of π1 will not be executed at time point t, in which case, let t be in T2. Obviously, R(s)=|T1|+|T2|. In addition, since |T1|=len(G), we have

[0065] R(s)=len(G)+|T2| (4)

[0066] Among them, for |T2|, by distinguishing whether there is an idle core at time point t of T2, T2 is divided into two disjoint subsets (for example, ). If there is an idle core at time point t, let t be in the time set Otherwise, if all cores are busy at time t, let t be the time set Therefore, the upper bound of |T2| is

[0067]

[0068] For any time set T, the present invention uses W(T) to represent the amount of work performed in the time set T.

[0069] have

[0070]

[0071] Construct a critical path π of G that satisfies the following constraints:

[0072] (1) The last node of π is the sink node of G;

[0073] (2) The first node of π is the source node of G;

[0074] (3) The i-th node v of π i is the (i+1)th node v of π i+1 The predecessor node of v i+1 has the largest completion time among all predecessor nodes of .

[0075] For any time point t, if a node of π is executed at time point t, then the path π covers t. In addition, if the core is idle at time point t, then t is called idle time. If all cores are busy at time point t, then t is called busy time. I and T BThey represent the set of all idle times and the set of all busy times in the schedule s. Obviously, the critical path π covers T I All your free time.

[0076] From the above, we can see that if the critical path π of G is the same as the longest path π1, then |T2| = 0 and R(s) = len(G). If the critical path π contains several nodes that are not passed by the longest path π1, the critical path π can be divided into a series of alternating sub-paths, that is, π = (L1, J1, L2, J2, ...), where L k is the kth subpath of π that contains only the nodes in the longest path π1, and J k is the kth subpath of π that does not contain nodes in π1. For each subpath L k , use I L (k) indicates the same as L k Related interval, where if k≥2, L k The left boundary is equal to J k-1 The completion time of the last node; otherwise, if k = 0, then L k The left boundary of L is equal to 0. k The right boundary is equal to L k The completion time of the last node of . Similarly, for each subpath J k , use I J (k) to represent the same as J k The associated interval, where J k The left boundary is equal to L k The end time of the last node, and J k The right boundary is equal to J k The end time of the last node of the schedule is divided into several non-overlapping time intervals (I L (1),I J (1),I L (2),I J (2),...).

[0077] In the following, the present invention shows the amount of work that should be performed during the intervals IL(K) and IJ(K), respectively.

[0078] Among them, in I L (k) The amount of work performed in the time interval. L At any time point t in (k), if t is covered by the critical path π, then at least one core is busy at time t (a node executing π). If t is not covered by π, then all cores are busy at time t. Let Len(L k ) is the path L kThe length of use To represent I not covered by π L (k) time set, we can get

[0079]

[0080] From the above, we can see that in I L The amount of work W performed in (k) L (k) at least

[0081]

[0082] On the other hand, in I J (k) The amount of work performed in the time interval. Let L′ k is the longest path π1 in time interval I J (k) The subpath executed in interval I J The time in (k) can be divided into four parts:

[0083]

[0084] in, and Represent L′ k Covered I J (k) The set of idle time and the set of busy time. and Respectively represent the k Covered I J (k) is the set of idle times and the set of busy times. The amount of work performed in each subinterval is bounded by the following constraints:

[0085] (1) For any time L′ k Node v i and J k Node v j is executed at time t. Therefore, The amount of work performed At least

[0086] (2) For any time All cores are busy at time t. Therefore, in the interval and The amount of work performed and are equal to and

[0087] (3) For any time Jk A node of is executed at time t. Therefore, The amount of work performed At least

[0088] In summary, in time interval I J (k) The amount of work performed within W J (k) has the following lower bound:

[0089]

[0090] And because L′ k The length is equal to L′ k The sum of all the time covered, i.e. And the subpath J of the critical path π k Cover I J All the free time in (k) can be obtained Further available Therefore, in the time interval I J (k) The amount of work performed within W J Another equivalent expression for the lower bound of (k) is:

[0091]

[0092] Since the total workload of G is equal to ∑ k (W L (k)+W J (k)), and from formulas (8) and (11), we have

[0093]

[0094] And because it is easy to get len(G)=∑ k (len(L k )+len(L′ k )),as well as And len(G)-len(π)=∑ k (len(L′ k )-len(J k )),as well as as well as The equivalent expression of formula (12) is as follows:

[0095]

[0096] Combined with formula (5), the upper bound of |T2| is:

[0097]

[0098] Combined with formula (4), the upper bound of the response time of DAG G can be obtained:

[0099]

[0100] Where m represents the number of cores used for scheduling, and π′ represents the second longest path in G.

[0101] This paper uses the upper bound of the response time in formula (15) to analyze the real-time performance of the DAG. vol(G) can be calculated using formula (1); len(G) can be obtained by calculating the length of the longest path π1 in the remaining graph G1 using the method in step 3; and len(π′) can be obtained as follows:

[0102] For each node v in the longest path π1 in G i , the loop performs the following calculations: First, remove node v from G i , and obtain the subgraph G′ of G. Apply the method in step 3 to G′ to solve the longest path π of G′. * Because π * Contains at least one node that is not included in π1, so the longest path π of G′ * is a candidate for the second longest path of G. Initialize the variable len(π′) to 0. In each round of the loop, if the path π * The length of π is greater than the value of the variable len(π′), so len(π * ) is assigned to len(π′).

[0103] Figure 5 The comparison of the response time between the scheduling method of the present invention and the classic list scheduling method obtained by analyzing the formula (15) is shown. SUN R represents the average response time of the DAG scheduled by the scheduling algorithm proposed in this invention, GRA The average response time of a DAG scheduled by the classic Graham list scheduling algorithm is shown in milliseconds. The horizontal axis m represents the number of available cores, and the vertical axis represents the average response time of the system. The number of nodes in the randomly generated DAG analyzed is (at most) 160, and the execution time of each node is within the range of [1,100] ms. The ratio of the total number of DAGs to the longest path is As can be seen from the figure, when the number of cores is in the range of [2,18], the response time R SUN are all smaller than R GRA , which shows that the scheduling method proposed in this invention is beneficial.

Claims

1. A DAG-based heuristic task scheduling method, characterized in that: Here are the steps: Step 1: Determine the system's DAG model The real-time tasks on the real-time system or embedded system are modeled as DAG G = (V, E), where V is a set of nodes and E is a set of edges; each node v in V i Represents a continuous execution code with execution time e i ; Each edge (v i ,v j )∈E represents node v i and v j The priority relationship between i It is v j The predecessor node, v j It is v i The successor node; if v i It is v j The predecessor node of the predecessor node is called node v i It is v j The ancestor node is called v j It is v i Descendant nodes of; Step 2: Divide the nodes in the DAG into several node subsets The node set V of DAG G is divided into several subsets, and the node partition is expressed as P(V) = {V1, V2, ..., V l }, where V l =k (k = 1, ..., l) represents the kth subset of P(V); the node partition P(V) is solved by finding a set of path sequences in G, where the path sequence set is denoted as Π = {π1,π2, ...,π l }, so that the path of π covers all nodes in V, that is, And every path π of π k Contains at least one that does not belong to {π1,...,π k-1 }, that is, Step 3: Schedule each node subset separately and integrate them into the schedule of the entire DAG Serially schedule a subset of nodes in P(V); first, each node v i The start time b i and end time f i are initialized to +∞ and 0 respectively; then, subsets of P(V) are added from V1 to V l Schedule one by one; for each subset V k , assuming V k The nodes in V are sorted in order of priority, i.e. k Any node v in i and v j , if v i It is v j ancestor node, then i <j; For the node set V k Each node v in i The scheduling includes: calculating the available time interval, core allocation and rescheduling process, specifically: first, calculating the available time interval [t a ,t b ); then, if there are enough core resources in the available time interval [t a ,t b ) execute v i , the core is assigned to v i , and decide node v i otherwise, by rescheduling v i The descendant nodes of v are used to extend the available time interval and schedule v in the extended available time interval i ; Finally, the node subsets in P(V) are serially scheduled in the order of their subscripts, which is the schedule of the entire DAG.

Citation Information

Patent Citations

  • Method, system, and computer program product for multi-mission scheduling

    US20080040190A1