CN109308216B - Single-core system real-time task scheduling method aiming at inaccurate calculation - Google Patents

Single-core system real-time task scheduling method aiming at inaccurate calculation Download PDF

Info

Publication number
CN109308216B
CN109308216B CN201810260316.2A CN201810260316A CN109308216B CN 109308216 B CN109308216 B CN 109308216B CN 201810260316 A CN201810260316 A CN 201810260316A CN 109308216 B CN109308216 B CN 109308216B
Authority
CN
China
Prior art keywords
task
time
deadline
tasks
scheduling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810260316.2A
Other languages
Chinese (zh)
Other versions
CN109308216A (en
Inventor
王文浩
李幼萌
章亦葵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin University
Original Assignee
Tianjin University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin University filed Critical Tianjin University
Priority to CN201810260316.2A priority Critical patent/CN109308216B/en
Publication of CN109308216A publication Critical patent/CN109308216A/en
Application granted granted Critical
Publication of CN109308216B publication Critical patent/CN109308216B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • G06F9/4887Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues involving deadlines, e.g. rate based, periodic

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a real-time task scheduling method for a single-core system aiming at inaccurate calculation, which comprises the following steps: step one, establishing a task model in a single-core system according to task characteristics; step two, an offline scheduling module and an online scheduling module are constructed in the task model according to task scheduling time points; step three, constructing a task calculation precision unit for the online scheduling module according to the execution precision of the task; step four, constructing a task calculation over-deadline average degree unit for the online scheduling module according to the average degree of the task over deadline; step five, constructing a task cut-off time exceeding frequency calculation unit for the online scheduling module according to the frequency of the task exceeding the cut-off time; the invention can make full use of the systematic computing resources by respectively ensuring the computing precision, the exceeding degree of the deadline time and the exceeding probability upper limit of the deadline time on the premise of ensuring certain QoS (quality of service).

Description

Single-core system real-time task scheduling method aiming at inaccurate calculation
Technical Field
The invention relates to the scheduling of tasks of an approximate computation and real-time system, in particular to a real-time task scheduling method of a single-core system aiming at inaccurate computation
Background
In the related art of the recommendation method, the scheduling algorithm mainly includes:
WCET (worst execution time). The worst execution time for a computer task is the maximum amount of time that the task needs to execute on a particular hardware platform. Is important in the scheduling analysis of a hardware real-time system. Most of the conventional real-time scheduling algorithms at present adopt a pessimistic strategy to meet the deadline constraint of the worst case, which causes great waste of resources and energy.
2. And (4) a real-time scheduling algorithm. The real-time scheduling algorithm is mainly divided into an offline scheduling algorithm and an online scheduling algorithm.
In the offline scheduling algorithm, MILP (mixed integer linear programming) is generally used. The linear programming is an important branch of earlier research, faster development, wide application and more mature method in operational research, and is a mathematical method for assisting people in scientific management. MILP is one of integer linear programming models. Mainly used for solving the NP-hard problem. When the objective function is linear, the constraint condition is linear, and the decision variable can take any integer or decimal, the feasible solution of the single-core task scheduling can be solved through mixed linear programming
In the line scheduling algorithm, an EDF scheduling algorithm and an RMS scheduling algorithm are frequently used. EDF scheduling algorithm: the early Deadline First algorithm also becomes a Deadline driven scheduling algorithm, and is a dynamic scheduling algorithm. When the EDF is scheduled, the priority of the tasks is dynamically distributed according to the deadline of the tasks. The shorter the cutoff time, the higher the priority. EDF scheduling algorithms have proven to be the most dynamic and conditional. The RMS scheduling algorithm: the scheduling algorithm of tasks in monotonic rate priority assignment (RMPA), called monotonic rate scheduling. The scheduling algorithm means that the priority of the task is allocated according to the task period Tl. The scheduling priority is determined according to the execution period of the tasks, the tasks with small execution periods have higher priority, and the tasks with long periods have lower priority.
3. And (4) approximate calculation. In computer science, approximation calculation is an algorithm used to find an approximation method to solve an optimization problem. The approximation calculation is usually associated with the NP-hard problem. Since it is unlikely that an effective polynomial time can be accurately calculated to solve the NP-hard problem, a solution polynomial time sub-optimal solution is considered. Unlike heuristic algorithms, approximate calculations can often quickly find a reasonable solution within a provable solution quality and provable runtime range. Ideally, the approximation is optimally achieved by a small constant factor (e.g., within 5% of the optimal solution). Approximation calculations are increasingly used for problems with known accurate polynomial time algorithms but with too large inputs.
For many real-time scheduling algorithms, the worst-case execution time (WCET) is generally considered to be a critical parameter that satisfies the time limit constraint when the task runs in the worst case. Due to the use of WCET, these algorithms are quite pessimistic, much larger than the average execution time. Therefore, the scheduling strategy using WCET is too conservative, which means that much resources and energy are wasted. Without violations, all tasks must complete execution before the expiration date, even in the worst case. The WCET will be used to test schedulability. In many cases, the actual execution time is much less than the WCET. So there is some slack time in running. However, to reach the deadline in the worst case, other tasks cannot be scheduled to run while idle, which means that the resources of the processor are not fully utilized.
This problem can be solved by designing a total more aggressive solution strategy. For example, more tasks are allocated to be executed when the processor is idle, so as to achieve the purpose of fully utilizing the processor resources, or the frequency of the processor is reduced to save more energy. But also leads to new problems: theoretically, high load work cannot guarantee deadline constraints. In the present invention, we use an inaccurate calculation to solve this problem.
Traditional real-time scheduling algorithms employ pessimistic strategies to meet worst-case deadlines, resulting in significant waste of resources and energy. To solve this problem, we propose an offline non-preemptive scheduling algorithm based on MILP. The real-time constraint of the aperiodic task set with QoS (quality of service) guarantees is met by performing inaccurate calculation on the algorithm and the task granularity. Furthermore, we propose two pre-processing algorithms and three online scheduling schemes to improve different QoS (quality of service) factors at run-time. The present invention is primarily concerned with the application of imprecise calculations at the algorithm and task level. On the one hand, the approach algorithm level is achieved by precision assurance [13], reducing the execution time of the task to meet the deadline. On the other hand, schedulability is improved to an acceptable level during some occasional or small scale offending tasks. On the other hand, schedulability is increased to an acceptable level in case some occasional or small scale violations of the deadline are allowed.
Task scheduling is a key part of a kernel of a real-time system, and how to schedule tasks is to enable each task to be completed within the time limit of the task scheduling is an important research field of the real-time operating system.
Disclosure of Invention
The invention aims to overcome the defects in the background technology and provide a real-time task scheduling method for a mononuclear system aiming at inaccurate calculation. In addition, we propose three lightweight online scheduling adjustment methods, which make use of the time slack generated at runtime to perform targeted optimization on three indicators affecting QoS (quality of service) to use different task types. The simulation result shows that compared with the traditional scheduling algorithm, the method can support more task loads and less energy consumption on the premise of ensuring QoS (quality of service).
The technical scheme of the invention is as follows:
a real-time task scheduling method for an imprecise calculation single-core system comprises the following steps:
step one, establishing a task model in a single-core system according to task characteristics;
step two, an offline scheduling module and an online scheduling module are constructed in the task model according to task scheduling time points;
step three, constructing a task calculation precision unit for the task of the online scheduling module according to the execution precision of the task;
step four, constructing a task calculation over-deadline average degree unit for the online scheduling module according to the average degree of the task over deadline;
and fifthly, constructing a task cutoff time exceeding frequency calculation unit for the online scheduling module according to the frequency of the task exceeding the cutoff time.
The task calculation precision unit in the third step adopts the following steps:
step one, inputting the current time T, and tasks which are not executed in a task set T ', wherein T' is a part belonging to T. Assigning the current time to lastFinishTime, circularly judging whether the execution mode of the current task is 1 or not each time, and if the current task is executed in an inaccurate mode, calculating a slack time slot: subtracting the maximum value of lastFinishTime and task release time from the start time of the current task;
step two, judging whether the relaxation time can meet the time required by the current task to be converted from the inaccurate calculation mode to the accurate calculation mode, and if the relaxation time meets the condition, converting the current task from the inaccurate calculation mode to the accurate calculation mode;
step three, if the current task is executed in the accurate mode at first, the circular judgment is not carried out; the release time of the task and the maximum value of lastFinishTime are assigned as the start time of the task each time, and the completion time of the task under the worst condition is assigned as the lastFinishedtime.
The task exceeding deadline unit in the fourth step adopts the following steps:
step one, inputting the current time T, the serial number i of the next task and a task set T ', assigning the task set T ' to newT ' each time, taking one task tau j in the task set T ' each time, if the task exceeds the deadline, storing the set T ', assigning the maximum value of the current time T and the release time of the task tau i to the start time of the task, and assigning the worst execution time of the current task to lastFinishTime.
Step two, circularly judging the task tau between the ith task and the jth taskkThe release interval of the kth task is compared with lastFinishTime, and the maximum value is assigned as the start time sk of the task. And comparing the lastFinishTime with the release time of the ith task, and taking the maximum value as the start time si of the task.
And step three, circularly judging each task behind the jth task, comparing the release time of the task with the lastFinishTime, taking the maximum value as the start time of the task, and assigning the end time of the task under the worst condition as the new lastFinishTime.
Step four, if all tasks in the generated scheduling result meet the constraint condition of MILP, then: if the sum of the time exceeding the deadline of all the tasks is smaller than the sum of the time exceeding the deadline, exchanging the ith task and the jth task in the task set T ', and assigning T ' to newT '. .
Compared with the prior art, the invention has the advantages that: the invention provides a research for realizing non-preemptive real-time scheduling by introducing inaccurate calculation, and improves the schedulability of tasks on the premise of ensuring certain QoS (quality of service) from the aspects of off-line scheduling and on-line scheduling.
A. Offline scheduling method
The deadline requirements for non-hard real-time tasks may not be very strict. Therefore, the deadline of the task is relaxed, and the actual execution end time of the task is allowed to exceed the deadline to a certain extent without influencing the overall execution effect. By relaxing the cut-off time, the time relaxation caused by pessimistic calculation of the WCET can be effectively reduced, and the efficiency and the schedulability are improved.
B. Online scheduling method
The off-line scheduling algorithm of the non-preemptive periodic task based on the inaccurate calculation can achieve the effect of more fully utilizing the calculation resources of the system on the premise of ensuring certain QoS (quality of service) by setting the calculation precision, the degree exceeding the deadline and the upper limit of the probability exceeding the deadline.
In addition, we propose three lightweight online dispatch algorithms. The following effects can be achieved by the three algorithms respectively:
1. on the premise of ensuring certain QoS (quality of service), the overall precision of the tasks executed by the processor is improved.
2. On the premise of ensuring certain QoS (quality of service), the total time of the tasks executed by the processor exceeding the deadline is reduced, so that the overall execution effect of the tasks is ensured.
3. On the premise of ensuring certain QoS (quality of service), the frequency of the tasks executed by the processor exceeding the deadline is reduced, so that the overall execution effect of the tasks is ensured.
Drawings
FIG. 1: et aliAt biAnd wiThe distribution condition between the two;
FIG. 2 is a drawing: (f)i-di) And (d)i-ri) A schematic diagram of (a);
FIG. 3: probability of completing the task before the deadline;
FIG. 4 is a drawing: legend for ARTBD algorithm;
FIG. 5: legend for ARFDV algorithm;
attached table 1: meaning of a symbol;
Detailed Description
The invention is further illustrated by the following specific examples and the accompanying drawings. The examples are intended to better enable those skilled in the art to better understand the present invention and are not intended to limit the present invention in any way.
The invention establishes a task model suitable for the invention according to task characteristics. The system is modeled from an algorithm level and a task level. According to different time of task scheduling, an offline scheduling method and an online scheduling method are respectively provided. In the online scheduling process, we define QoS (quality of service) as three indicators: the calculation accuracy of the task, the degree of the task exceeding the deadline, and the probability of the task exceeding the deadline. Aiming at three different indexes, in order to achieve different purposes, three online scheduling system models are respectively established.
1. Task model
And creating a task single-core task model according to the characteristics of the aperiodic single-core task. The task set T has n aperiodic real-time tasks. Each task has 2 precision modes at runtime, one is a precision mode and the other is an inexact mode. The inaccurate mode can be realized by considering an approximate calculation. By the implementation method, under an inaccurate mode, the task can be more reasonably scheduled and operated on the premise of ensuring QoS (quality of service), so that the task can be smoothly performed, the resource utilization rate is low, and the execution time is less than that of the accurate mode.
At the same time, we build a probabilistic model of execution time. The actual execution time of the system varies with different factors and is random. All, we need to analyze the possible relationship between the actual execution time and the worst execution time, and analyze the characteristics of the execution time probability model according to different situations.
Each task τiRepresented by a six-tuple (r)i,si,di,mi,bi,wi),riDenotes τiRelease time of siIndicating the start time of the scheduler assignment, diRepresents the last deadline, which is a set of constants given before the start of the schedule. r isi,siAnd diDenotes all time points, miIndicating the accuracy mode of the current task execution, assigned by the scheduler. m isiThere are two values, 0 or 1. 0 denotes the precision mode execution and 1 denotes the non-precision mode execution. biIs the BCET, w in which the current task is executed in the selected modeiIs the WCET that the current task is executing in the selected mode. biAnd wiAll time-spanned, tasks being performed in different modes, biAnd wiWill also be different. They are determined by mi and can be calculated by the formulas (1) and (2). (details of the symbols are shown in the attached Table 1)
In (1) and (2), B is containedi,Wi,B’iAnd W'iMay be implemented by a number of techniques.
Furthermore, fiThe execution end time indicating the worst case of the task can be calculated by equation (3).
fi=si+wi (3)
Executing the time probability model: et for actual execution time of taskiAnd (4) showing. It is apparent that etiCan not be less than bi nor more than wi。etiWill be in the interval [ b ]i,wi]And (4) internally generating randomly. In reality, execution time may vary widely. To simplify the problem, we assume etiSatisfies biAnd wiAre uniformly distributed, and the distribution is shown in figure 1.
EtiThe probability of not greater than t can be calculated according to equation (4) with F at [ b ]i,wi]May be varied within the range of (1).
Figure DEST_PATH_IMAGE002
2. Offline scheduling module
We use the MILP algorithm to implement. The linear programming is an important branch of earlier research, faster development, wide application and more mature method in operational research, and is a mathematical method for assisting people in scientific management. MILP is one of integer linear programming models. Mainly used for solving the NP-hard problem. When the objective function is linear and the constraint condition is also linear, and the decision variables can take any integer or decimal number, the feasible solution of the single-core task scheduling can be solved through mixed linear programming.
The MILP algorithm: the non-hard real-time task τ i may not have very strict deadline requirements. The execution time for completion of these tasks exceeding the deadline does not produce fatal errors, but degrades the QoS (quality of service). The evaluation of whether the QoS (quality of service) is degraded can use the following two indicators:
1) the relative degree to which the worst-case task end time exceeds the deadline, ai. It can be calculated by equation (5).
Due to etiIs in the interval [ Bi,Wi]Internal random generation until task τ i is completed, τiThe actual execution time after the deadline can be determined. The maximum extent of over-time can be evaluated in the worst case. If a task is a hard real-time task, then αiThe value cannot be greater than 0, which means τiMust be done before the expiration date. Alpha is alphaiThe larger the value, the greater the extent to which the task's completion time exceeds the deadline in the worst case. As shown in fig. 2.
Figure DEST_PATH_IMAGE004
2) Probability p of task completion by execution before deadlinei. According to formula (4), piCan pass through P (et)i<dli-si) To calculate. When the value of pi is 1,the probability of a task completing before the deadline is 1, which is related to alphaiThe effect is the same for a value of 0. PiThe smaller the value, the higher the probability that the task violates the deadline constraint. As shown in fig. 3.
Figure DEST_PATH_IMAGE006
By using alphaiAnd piTo limit the deadline constraints, we propose an MILP formula that can provide a schedulable solution for non-schedulable tasks with a certain QoS (quality of service) under strict constraints. The method only provides a scheduling solution for the task set T and meets the relaxation constraint condition. The constraints of the MILP formula are as follows:
1) task tauiMust not start earlier than the release time
si≥ri (7)
2) The processor can only execute one task at a time, any two tasks τiAnd τjThe execution times of (2) cannot overlap in the time axes (8) and (9). Variable yij(i>j) The value of which is 0 or 1iAnd τ j. When tau isiAt taujWhen previously executed, yij(i>j) Is 1, otherwise is 0.
fi≤si+(1-yij)·∞ (8)
fj≤si+yij·∞ (9)
Figure DEST_PATH_IMAGE008
3) Ratio alpha of time to maximum allowed execution time for exceeding the deadline in the worst caseiMust not be greater than Ai(11). For example, if τ i is a hard real-time task, then AiMust be equal to 0; if τiIs a (firm and soft real-time task), then AiAnd may be greater than 0. So Ai is task dependentThe feature gives an empirical value that guarantees a certain QoS (quality of service) even if the deadline constraint is violated in the worst case.
αi≤Ai (11)
4) The probability that the task is completed before the deadline must not be less than Pi(12). Same as AiSame, PiIs also an empirical value given for different characteristics of the task, used to control the task τiProbability of completion within the deadline on the premise of guaranteeing QoS (quality of service).
pi≤Pi (12)
The MILP solution: MILP is an NP-Hard problem. In order to ensure the performance of the solution, a heuristic algorithm is adopted for solution. Since this MILP formula has no objective function, we take the initial feasible solution as the final solution. The cost of computing the initial feasible solution is much lower than solving the optimal solution, so the method for solving the problem can obtain better performance. Pretreatment and online adjustment and time delay recovery.
3. Online scheduling module
In the online scheduling system model, different execution strategies are formulated according to different tasks. We reclaim different types of time slack that is generated during task execution and take full advantage of the time slack to increase the time utilization of the processor.
The sensitivity to QoS (quality of service) is also different for different types of tasks. For example: the occasional occurrence of a large delay in the audio-video playback has a greater impact on the user experience than the frequent occurrence of a small delay; frequent violations of deadlines for some near real-time tasks (e.g., navigation programs) have much greater impact on the user experience than low probability violations of deadlines to a greater extent, and some soft real-time tasks are more sensitive to computational accuracy than time requirements. Therefore, we define QoS (quality of service) as three indicators.
Calculating precision of tasks: for a task model requiring high precision in execution, scheduling is required to improve the task computation precision, that is, tasks in a non-precision computation execution mode are converted into a precision mode to be executed as much as possible.
Degree of task exceeding deadline: for a task model requiring an average execution degree of tasks, a system model needs to be designed for scheduling so as to realize that the degree of exceeding the deadline of a task set is as small as possible.
Probability of task exceeding deadline: for task models that require tasks to be performed as far as possible before the deadline, we need to design a system model to schedule to achieve as little probability as possible that the task exceeds the deadline.
When executing a task set, if the execution end time of the current task is earlier than the start time of the next task specified by the MILP. The processor will idle for this interval. This idle time may be defined as a time slack. Temporal redundancy occurs both in offline scheduling and runtime.
The time gaps may be used to optimize QoS (quality of service), for example, to improve the accuracy of tasks, to reduce the time for tasks to exceed deadline, and to reduce the frequency of occurrences of exceeding deadline conditions. Since QoS (quality of service) of different tasks may have different effects on these three factors, the preprocessing and online adjustment algorithms that optimize each factor will be discussed below.
When a task is completed, context switching of the task is performed in the system. In context switching of tasks, the scheduler will trigger the adaptation algorithm. Considering the overhead of task switching in a real-time system, the online adjustment algorithm must have high performance. Finding a globally optimal solution is an NP-Hard problem that does not guarantee the performance of the system. Therefore, a heuristic online adjustment algorithm is designed to simplify the problem, and an approximate optimal solution is calculated by using a better-performance algorithm.
1) Time relaxation
There are two types of slack in scheduling: offline relaxation and runtime relaxation
Offline relaxation: in offline scheduling, constraints (8) and (9) are both based on WCET. These constraints only guarantee that any start-up time interval for both tasks cannot be smaller than WCET. So even in the worst case, offline scheduling cannot guarantee that there is no time interval between the completion execution time of the current task and the start time of the next task.
Secondly, relaxation of operation time: the actual execution time of each task is typically less than the WCET, and thus, the processor is idle between the actual execution completion time and the scheduled execution completion time, referred to as a runtime slack.
Through pre-processing and online tuning, offline relaxation and runtime relaxation can be utilized to improve QoS (quality of service).
2) Pretreatment of
The pre-processing must be run before all tasks are performed. The invention provides two preprocessing algorithms to improve scheduling performance.
Preprocessing accumulated relaxation: to improve accuracy, under the MILP constraint, slack may be utilized to convert a portion of a task from inaccurate mode execution to accurate mode execution. If a task to be executed is executed in an imprecise mode and there is slack before the task is executed, the task may change its execution mode. Therefore, collecting sufficiently large slack in the pre-processing is important to improve the accuracy of the task set.
The PAS algorithm performs the process of: the algorithm firstly inputs a task set T (including the execution sequence, the starting time and the like of each task) generated by MILP offline scheduling, and assigns the last task in the task set T to Ti each time, wherein i is the subscript of the task. And comparing the last execution time of the task under the deadline constraint with the start time of the task in the last cycle, subtracting the WCET of the task executed in the precise mode from the smaller value of the last execution time of the task as the new start time of the task, and removing the task from the task set T, and thus cycling to stop until the task set T is empty. In the first cycle, the value of upperbound is assigned to infinity, and then after each cycle obtains a new start time of the task, new values are assigned to the upperbound, which is most compared with the execution time of the next cycle and the next task.
In the PAS algorithm, the start times of all tasks must be delayed as much as possible to allow forAll time ahead of the first task to be performed is accumulated. To obtain maximum slack, the tasks in T are delayed in order from back to front, as determined during offline scheduling. lfiDenotes τ under constraints (11) and (12)iMay be calculated by (13). The latest start time can be derived from the minimum value obtained by comparing the start time of the next task with the maximum time allowed in (11) and (12) (row 5). It allows all the time to be gathered together before the first task is executed. In this way, the adjustment of the accuracy can take full advantage of these slack. This preprocessing can make the effect of algorithm 3 more pronounced.
lfi=min{(Ai+1)·di-ri,(1-Pi)(wi-bi)+di} (13)
Secondly, pretreatment for eliminating relaxation: to reduce the frequency of exceeding the sum of the cut-off times or the cut-off time, all tasks must be run as early in the sequence as possible. In these cases, the relaxation should be eliminated as much as possible after the pretreatment.
The PES algorithm is executed as follows: the algorithm still needs to input a task set T generated by MILP offline scheduling, assign a first task in the task set T to Ti each time, wherein i is a subscript of the task, compare the end time of the task executed according to the precise mode in the last cycle (namely, the execution time is WCET) with the release time of the current task each time, and take the maximum value as the start time of the current task. And ending until the task set T is empty. And after each cycle is finished, assigning the starting time of the current task and the WCET in the current task precision mode to the lowerbound, and comparing the starting time of the current task with the release time of the next task.
In the PES algorithm, each siIs the maximum value between the release time of the current task and the end execution time of the previous task. Thus, each task will run as early as possible under the constraints imposed by MILP, which can reduce the total time and deadline after the deadline has been exceededLimiting the frequency of violations. This preprocessing may enhance the effect of the ATRBD algorithm and the ARFDV algorithm.
3) Optimization for three indicators affecting QoS (quality of service)
(ii) online scheduling for improved accuracy
The AIP algorithm is executed as follows: the algorithm first inputs the current time T, the tasks in the task set T 'that have not yet been executed, where T' is part of T. Assigning the current time to lastFinishTime, circularly judging whether the execution mode of the current task is 1 (namely inaccurate execution) each time, and if the current task is executed in the inaccurate mode, calculating the slack time slack: and subtracting the maximum value of lastFinishTime and task release time from the start time of the current task, and continuing to judge whether the slack time can meet the time required by the current task to be converted from the inaccurate calculation mode to the accurate calculation mode (if Wi-Wi' is less than or equal to slack, the conversion condition is met), and if the condition is met, converting the current task from the inaccurate calculation mode to the accurate calculation mode. If the current task is initially executed in precision mode (mi is 0), no loop determination is made. The determination is made by dynamic online scheduling after the execution of each task is complete. Wherein the release time of a task and the maximum value of lastFinishTime are assigned to the start time of the task each time, and the worst case completion time of the task is assigned to lastFinishedtime.
During scheduling, the adjustment may change the execution mode of the tasks assigned by the MILP from imprecise to exacting as much as possible while satisfying the MILP constraints. Therefore, with offline relaxation and runtime relaxation, the accuracy of the task can be improved at runtime. Switching of the precision mode means that the actual execution time of the task may be longer than the original precision mode, and additional time may be balanced by using slack time.
The scheduler will execute the AIP algorithm during context switching of a task in order to adjust the start time and precision mode of the next task by using slack. If the slack is large enough, the precision is switched (lines 5 and 6) and then the next task τ is scheduled at the earliest time (line 9)i
② on-line scheduling for reducing time exceeding deadline
The implementation process of the ARTBD algorithm is as follows: the algorithm firstly inputs the current time T, the serial number i of the next task and the task set T ', assigns the task set T' to newT 'each time, takes one task tau j in the task set T' each time, and if the task exceeds the deadline (exj)>0) The set T' is saved and the maximum of the current time T and the release time of the task τ i is assigned as the start time of the task, and the worst case execution time of the current task is assigned as lastFinishTime. Continuing to circularly judge the task tau between the ith task and the jth taskkThe release interval of the kth task is compared with lastFinishTime, and the maximum value is assigned as the start time sk of the task. And comparing the lastFinishTime with the release time of the ith task, and taking the maximum value as the start time si of the task. Then, each task behind the jth task is judged in a circulating mode, the release time of the task is compared with lastFinishTime to the greatest extent, the maximum value is taken as the starting time of the task, and the ending time of the task under the worst condition is assigned as new lastFinishTime. When the operations are executed, if all tasks in the generated scheduling result meet the MILP constraint condition, then: if the sum of the time that all tasks exceed the deadline is less than the sum of the previous exceeding times, the ith and jth tasks in the task set T ' are swapped, and T ' is assigned to newT '. And finally returning a new set newT' through loop judgment.
This adjustment is intended to reduce the total time beyond the task deadline. Individual tasks tau beyond deadlineiTime out of deadline exiCan be calculated by equation (14). Therefore, Σ ex can be usediTo indicate the total time over the deadline.
exi=max(fi-di,0) (14)
The main idea of the adjustment is to implement Σ ex for all unexecuted tasks by exchanging the execution order of the tasksiIs minimized. To achieve the low overhead of the on-line tuning algorithm, we only consider the next task τ to be executed in the MILP schedulingiAnd exchanges with other unexecuted tasks. An example is shown in figure 4.
In the ARTBD algorithm, the next task to be executed will attempt to swap with other unexecuted tasks separately, which may violate its deadline (line 4). After the swap, the start time of each task is recalculated to ensure that each task will be executed as early as possible according to the new execution order (lines 6 to 17). If the new execution order fails to satisfy the constraint, the schedule will not swap and try the next task that violates the deadline (line 18). Otherwise, it will be calculated. When smaller than the old candidate (line 19), τiAnd τjWill be swapped (line 21). In addition, the returned value candidate will be replaced by a new execution time table (line 22).
T' (line 5) must be saved before each swap and restored at the end of the iteration (line 25) because each new schedule must be calculated from the original schedule. The original schedule is not modified during the iteration. The new scheduling schedule will be stored in newT'.
In the iterative process, when j and i are equal, it means that all tasks will only be executed in advance without any exchange, which is also a candidate for returning a value. After scheduling is completed, the scheduler will use the new schedule to execute the tasks.
On-line scheduling for reducing frequencies exceeding a deadline
This adjustment scheme (called ARFDV) is similar to the algorithm ARTBD. The only difference is that line 19 and line 23 are replaced, which is a feature that defines the deadline violation frequency, where isExiIs a boolean value (15) that indicates whether there is a possibility of exceeding the expiration date. It can be calculated by (15).
Figure DEST_PATH_IMAGE010
In some cases, this adjustment has similar results to ARTBD. In other cases, however, the difference between ARTBD and ARFDV is evident. In fig. 4, the total time beyond the deadline has been reduced, but there is no change after the swap, which would not have occurred in the ARFDV. Swapping will only occur in the reduced case. This is illustrated in figure 5.
It should be understood that the embodiments and examples discussed herein are illustrative only and that various modifications or changes in light thereof will be suggested to persons skilled in the art and are to be included within the spirit and purview of this application and scope of the appended claims.

Claims (1)

1. A real-time task scheduling method for an imprecise calculation single-core system is characterized by comprising the following steps:
step one, establishing a task model in a single-core system according to task characteristics;
step two, an offline scheduling module and an online scheduling module are constructed in the task model according to task scheduling time points;
step three, constructing a task calculation precision unit for the task of the online scheduling module according to the execution precision of the task;
step 3.1, inputting the current time T and tasks which are not executed in a task set T ', wherein T' is a part of T; assigning the current time to lastFinishTime, circularly judging whether the execution mode of the current task is inaccurate execution each time, and if the current task is inaccurate execution mode, calculating a slack time slot: subtracting the maximum value of lastFinishTime and task release time from the start time of the current task; wherein: the task set T has n aperiodic real-time tasks;
step 3.2, judging whether the relaxation time can meet the time required by the current task to be converted from the inaccurate calculation mode to the accurate calculation mode, and if so, converting the current task from the inaccurate calculation mode to the accurate calculation mode;
3.3, if the current task is executed in the accurate mode at first, no cyclic judgment is made; assigning the release time of the task and the maximum value of lastFinishTime as the start time of the task each time, and assigning the completion time of the task to lastFinishTime under the worst condition;
step four, constructing a task calculation over-deadline average degree unit for the online scheduling module according to the average degree of the task over deadline;
step 4.1, inputting the current time T, the serial number i of the next task and a task set T ', assigning the task set T ' to newT ' each time, taking one task tau j in the task set T ' each time, if the task exceeds the deadline, storing the set T ', assigning the maximum value of the release time of the current time T and the task tau i to the start time of the task, and assigning the execution time of the current task under the worst condition to lastFinishTime;
step 4.2, circularly judging the task tau between the ith and jth taskskComparing the release time of the kth task with lastFinishTime, and assigning the maximum value as the start time sk of the task; comparing lastFinishTime with the release time of the ith task, and taking the maximum value as the start time si of the task;
step 4.3, circularly judging each task behind the jth task, comparing the release time of the task with the lastFinishTime, taking the maximum value as the start time of the task, and assigning the end time of the task under the worst condition as new lastFinishTime;
step, if all tasks in the generated scheduling result meet the constraint condition of the given Mixed Integer Linear Programming (MILP), then: if the sum of the time exceeding the deadline of all the tasks is smaller than the sum of the time exceeding the deadline, exchanging the ith task and the jth task in the task set T ', and assigning the T ' to newT ';
and fifthly, constructing a task cutoff time exceeding frequency calculation unit for the online scheduling module according to the frequency of the task exceeding the cutoff time.
CN201810260316.2A 2018-03-27 2018-03-27 Single-core system real-time task scheduling method aiming at inaccurate calculation Active CN109308216B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810260316.2A CN109308216B (en) 2018-03-27 2018-03-27 Single-core system real-time task scheduling method aiming at inaccurate calculation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810260316.2A CN109308216B (en) 2018-03-27 2018-03-27 Single-core system real-time task scheduling method aiming at inaccurate calculation

Publications (2)

Publication Number Publication Date
CN109308216A CN109308216A (en) 2019-02-05
CN109308216B true CN109308216B (en) 2021-10-15

Family

ID=65225777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810260316.2A Active CN109308216B (en) 2018-03-27 2018-03-27 Single-core system real-time task scheduling method aiming at inaccurate calculation

Country Status (1)

Country Link
CN (1) CN109308216B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045799B (en) * 2019-11-11 2023-03-14 西北工业大学 Low-safety key task scheduling method based on recovery redistribution
CN115357360B (en) * 2022-08-23 2023-05-12 重庆大学 Method and system for maximizing reliability of real-time processor system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271406A (en) * 2008-02-22 2008-09-24 浙江大学 Slack time on-line redistribution method in RM low-power consumption scheduling of embedded system
CN204229219U (en) * 2014-07-15 2015-03-25 中国市政工程华北设计研究总院有限公司 Household gas burner tool electronic controller emulation test system
CN105843364A (en) * 2016-03-24 2016-08-10 华中科技大学 Task scheduling algorithm for tradeoff optimization of time and energy consumption under heterogeneous parallel system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271406A (en) * 2008-02-22 2008-09-24 浙江大学 Slack time on-line redistribution method in RM low-power consumption scheduling of embedded system
CN100580632C (en) * 2008-02-22 2010-01-13 浙江大学 Slack time on-line redistribution method in RM low-power consumption scheduling of embedded system
CN204229219U (en) * 2014-07-15 2015-03-25 中国市政工程华北设计研究总院有限公司 Household gas burner tool electronic controller emulation test system
CN105843364A (en) * 2016-03-24 2016-08-10 华中科技大学 Task scheduling algorithm for tradeoff optimization of time and energy consumption under heterogeneous parallel system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于不精确计算模型的实时容错调度算法及其应用研究;计莉;《万方数据库》;20110818;全文 *

Also Published As

Publication number Publication date
CN109308216A (en) 2019-02-05

Similar Documents

Publication Publication Date Title
Van Tilborg et al. Foundations of real-time computing: Scheduling and resource management
Squillante et al. Using processor-cache affinity information in shared-memory multiprocessor scheduling
US20080077928A1 (en) Multiprocessor system
CN111176817B (en) Method for analyzing interference between DAG (demand-oriented architecture) real-time tasks on multi-core processor based on division scheduling
ahmed Bhuiyan et al. Mixed-criticality multicore scheduling of real-time gang task systems
Jiang et al. Real-time scheduling of parallel tasks with tight deadlines
Lee et al. Reducing peak power consumption inmulti-core systems without violatingreal-time constraints
CN109308216B (en) Single-core system real-time task scheduling method aiming at inaccurate calculation
Xu et al. Minimizing expected energy in real-time embedded systems
CN110275765B (en) Data parallel job scheduling method based on branch DAG dependency
Ye et al. Astraea: A fair deep learning scheduler for multi-tenant gpu clusters
Niknafs et al. Runtime resource management with workload prediction
CN112231081B (en) PSO-AHP-based monotonic rate resource scheduling method and system in cloud environment
Babu et al. Energy efficient scheduling algorithm for cloud computing systems based on prediction model
Reghenzani et al. A multi-level dpm approach for real-time dag tasks in heterogeneous processors
Zhang et al. Sensitivity analysis of arbitrary deadline real-time systems with EDF scheduling
Shin et al. Optimizing intratask voltage scheduling using profile and data-flow information
Ding et al. Integrated instruction cache analysis and locking in multitasking real-time systems
Salmani et al. A fuzzy-based multi-criteria scheduler for uniform multiprocessor real-time systems
CN112698911B (en) Cloud job scheduling method based on deep reinforcement learning
Kessler et al. Robustness and energy-elasticity of crown schedules for sets of parallelizable tasks on many-core systems with DVFS
Capannini et al. A job scheduling framework for large computing farms
Dong et al. A general analysis framework for soft real-time tasks
Geeraerts et al. Safe and optimal scheduling for hard and soft tasks
He et al. Optimizing schedule length for DAG type applications with energy consumption constraint in heterogeneous computing systems

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant