CN109885383B - Non-unit time task scheduling method with constraint condition - Google Patents

Non-unit time task scheduling method with constraint condition Download PDF

Info

Publication number
CN109885383B
CN109885383B CN201811272629.6A CN201811272629A CN109885383B CN 109885383 B CN109885383 B CN 109885383B CN 201811272629 A CN201811272629 A CN 201811272629A CN 109885383 B CN109885383 B CN 109885383B
Authority
CN
China
Prior art keywords
task
time
unit time
tasks
scheduling scheme
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
CN201811272629.6A
Other languages
Chinese (zh)
Other versions
CN109885383A (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.)
Guangdong Institute of Science and Technology
Original Assignee
Guangdong Institute of Science and Technology
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 Guangdong Institute of Science and Technology filed Critical Guangdong Institute of Science and Technology
Priority to CN201811272629.6A priority Critical patent/CN109885383B/en
Publication of CN109885383A publication Critical patent/CN109885383A/en
Application granted granted Critical
Publication of CN109885383B publication Critical patent/CN109885383B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a non-unit time task scheduling method with constraint conditions, which is used for realizing the following steps: sequencing a plurality of tasks to be executed within a preset time period according to task values; dividing a preset time period into a plurality of time slots with the same width; placing tasks in a time slot according to the ordering for execution, comparing the running time of the tasks with the time slot when each placement is performed, allowing the execution if the running time does not exceed the width of the time slot, maintaining a task scheduling scheme when new tasks are added each time, and generating a corresponding task scheduling scheme when each maintenance is performed; and comparing all the generated task scheduling schemes with the task number of non-unit time executed by the scheduling scheme, and selecting the corresponding scheduling scheme with the maximum task number of non-unit time as an optimal task scheduling scheme. The beneficial effects of the invention are as follows: improved task scheduling efficiency and reduced system resource consumption.

Description

Non-unit time task scheduling method with constraint condition
Technical Field
The invention relates to a non-unit time task scheduling method with constraint conditions, and belongs to the field of calculation data processing.
Background
On a single processor, in order to complete as many tasks as possible in a limited time, scheduling optimization of these tasks is required, so this is an optimal scheduling problem, requiring a deadline and timeout penalty to be set for each task as constraints. Most computing tasks cannot be completed in a single unit of time, the time to complete the task is made up of multiple units of time and task scheduling also takes priority into account.
Disclosure of Invention
Aiming at the problems, the invention provides a non-unit time task scheduling method with constraint conditions, the task scheduling problem facing to the non-unit time is analyzed in detail, the similarity of related problems is obtained after the problem is decomposed, the task scheduling problem can be regarded as a relatively simple problem to be analyzed, and finally, the non-unit task scheduling algorithm with constraint conditions is provided by combining with the solution of a plurality of simple problems to be improved.
An overview of several example aspects of the present disclosure is as follows. This summary is provided for the convenience of the reader to provide a basic understanding of the embodiments and does not fully limit the scope of the invention. This summary is not an extensive overview of all contemplated embodiments, and is intended to neither identify key or critical elements of all aspects nor delineate the scope of any or all aspects. Its sole purpose is to present some concepts of one or more embodiments in a simplified form as a prelude to the more detailed description that is presented later. For convenience, the term "some embodiments" may be used herein to refer to a single embodiment or multiple embodiments of the disclosure.
The technical scheme of the invention comprises a non-unit time task scheduling method with constraint conditions, which is characterized by comprising the following steps: s1, sorting a plurality of non-unit time tasks with constraint conditions to be executed in a preset time period according to task values; s2, dividing a preset time period into a plurality of time slots with the same width; s3, placing tasks with non-unit time in a time slot for execution according to the sequence of the step S1, comparing the task running time with the time slot when each time is placed, allowing execution if the running time does not exceed the time slot width, taking the tasks with a plurality of non-unit time and corresponding time slot widths which are already running as task scheduling schemes, maintaining the task scheduling schemes when new tasks are added each time, and generating a corresponding task scheduling scheme when each time is maintained; s4, comparing all the task scheduling schemes generated in the step S3 with the task number of non-unit time executed by the scheduling scheme, and selecting the corresponding scheduling scheme with the largest task number of non-unit time as the optimal task scheduling scheme.
According to the non-unit time task scheduling method with the constraint condition, the constraint condition is a deadline and a corresponding penalty.
According to the non-unit time task scheduling method with the constraint condition, the task comprises a task sequence number, a task running time, a task deadline and a task value, wherein the task value is a time-out penalty of the task.
According to the non-unit time task scheduling method with constraint conditions, the step S3 specifically comprises the following steps: comparing the running time of the non-unit time task to be added into the time slot with the width of the time slot, if the running time of the non-unit time task is larger than the width of the time slot, prohibiting the non-unit time task from being added into the time slot for running, simultaneously, not updating the task scheduling scheme, and searching for the next non-unit time task by using the original task scheduling scheme; if the running time of the task in the non-unit time is smaller than the width of the time slot, adding the task in the corresponding non-unit time into the time slot for running, updating the task scheduling scheme, and searching for the task in the next non-unit time by using the new task scheduling scheme.
According to the non-unit time task scheduling method with the constraint condition, the length of the time slot can be set in a self-defined mode.
The non-unit time task scheduling method with constraint conditions, wherein the method further comprises the following steps: if a plurality of time slots with the same width in the preset time are integers, performing task scheduling according to the step S3; if the preset time period includes a plurality of standard time slots with the same width and an additional time slot, and the time slot is smaller than the plurality of standard time slots with the same width, merging the additional time slot with the time slot at the tail, and executing step S3 on a plurality of tasks which are not placed in the time slot and are not in unit time at the tail, and selecting the maximum value task which can be placed in the time slot at the tail for executing.
According to the non-unit time task scheduling method with constraint conditions, the step S3 further comprises: generating a corresponding task scheduling scheme for adding tasks once every execution, wherein the scheduling scheme comprises a total time slot length, the number of tasks and a total task value; comparing all task scheduling schemes generated by adding one task each time, and taking the scheduling scheme with the maximum total time slot length, the maximum task number and the highest total task value as a non-unit time task for solving a plurality of constraint conditions to be executed.
The beneficial effects of the invention are as follows: the task scheduling problem of non-unit time is converted into a relatively simple problem to analyze, and finally, the non-unit task scheduling with constraint conditions is provided by combining and improving the solution of the conversion problem, so that the task scheduling efficiency is improved, and the consumption of system resources is reduced.
Drawings
Fig. 1 shows a general flow chart of the method according to the invention.
Detailed Description
The technical scheme of the invention comprises a non-unit time task scheduling method with constraint conditions, and is suitable for clearly and completely describing the conception, specific structure and technical effects produced by the invention in the following way with reference to the embodiment and the attached drawings so as to fully understand the purposes, scheme and effects of the invention.
It should be noted that, unless otherwise specified, when a feature is referred to as being "fixed" or "connected" to another feature, it may be directly or indirectly fixed or connected to the other feature. Further, the descriptions of the upper, lower, left, right, etc. used in this disclosure are merely with respect to the mutual positional relationship of the various components of this disclosure in the drawings. As used in this disclosure, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Furthermore, unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the description presented herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and/or" as used herein includes any combination of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element of the same type from another. For example, a first element could also be termed a second element, and, similarly, a second element could also be termed a first element, without departing from the scope of the present disclosure. The use of any and all examples, or exemplary language (e.g., "such as") provided herein, is intended merely to better illuminate embodiments of the invention and does not pose a limitation on the scope of the invention unless otherwise claimed.
On a single processor, in order to complete as many tasks as possible in a limited time, scheduling optimization of these tasks is required, so this is an optimal scheduling problem [1], requiring a deadline and timeout penalty to be set for each task as constraints.
Fig. 1 shows a general flow chart of the method according to the invention. The method specifically comprises the following steps: s1, sorting a plurality of non-unit time tasks with constraint conditions to be executed in a preset time period according to task values; s2, dividing a preset time period into a plurality of time slots with the same width; s3, placing tasks with non-unit time in a time slot for execution according to the sequence of the step S1, comparing the task running time with the time slot when each time is placed, allowing execution if the running time does not exceed the time slot width, taking the tasks with a plurality of non-unit time and corresponding time slot widths which are already running as task scheduling schemes, maintaining the task scheduling schemes when new tasks are added each time, and generating a corresponding task scheduling scheme when each time is maintained; s4, comparing all the task scheduling schemes generated in the step S3 with the task number of non-unit time executed by the scheduling scheme, and selecting the corresponding scheduling scheme with the largest task number of non-unit time as the optimal task scheduling scheme.
The technical proposal of the invention further provides the following technical proposal
The tasks need to run several units of time for non-unit time, and the time spent switching between tasks is ignored in the following analysis. Assume that a non-unit time task a runs at a time ofAnd a may be +.>Beginning atArbitrary time points->Ending (assuming task a has not been completed), the remaining completion time of task a isAfter a number of unit times, task a may continue to run from another point in time untilWhen the task is completed. Let the set of several tasks of non-unit time be S, one schedule of S is a task execution sequence in S +.>Wherein->Representing the task from->Starting the operation at the time point, at the time point +.>Pause (or end), the execution sequence specifies that any one task can be run at any one point in time, starting at point in time 0.
The input of the question is as follows: set comprising n non-unit time tasksThe method comprises the steps of carrying out a first treatment on the surface of the Given a period of time T (containing T time units), as the maximum time span for execution of the task sequence; given task->Corresponding non-negative integer deadlines->And task->The requirement is->Finishing the inner part; given task->Corresponding non-negative integer timeAnd task->Is +.>Each unit time; given task->Corresponding non-negative integer penaltyIf task->Is not at->The inner completion is punished->Otherwise there is no penalty. The nature of the problem is that a suitable schedule needs to be found in the set S such that the sum of penalties is minimized.
1. Problem analysis
Description of the problem: given n terms of known weightAnd value->And a backpack of one volumeFind out to be suitable for the backThe most valuable subset of the items of the package [6 ]]. Assuming that all weights and knapsack capacity are positive integers, the total value need not be an integer.
An instance defined by the first i items,has rights->Value->And the backpack capacity j, and,. Let->Is the optimal solution for this example. Here, the capacity j of all subsets of the first i items that partition fit into the backpack is divided into two categories: excluding the ith item and including the ith item. Note that:
1. in the subsets excluding the ith item, the value of the optimal subset is defined asThe method comprises the steps of carrying out a first treatment on the surface of the 2. Generating an optimal subset among the subsets comprising the ith item and the first +.>Optimal subset capacity ∈of items>. The value of the optimal subset is +.>
Thus, the value of the optimal solution in all possible subsets of the first i items is the maximum of these two values. If the i-th item is not suitable for the backpack, the value of the best subset selected from the i-th item is the same as the value of the best subset from the firstSelection of the individual items, from which:
initial conditions were defined as follows:
from the definition of the problem, comparing the 0-1 knapsack problem with the task scheduling problem in the non-unit time, if the condition of the deadline of the latter is removed, the given T unit time is regarded as the maximum load weight of the knapsack, the running time of each task is regarded as the weight of the task, the corresponding overtime penalty is regarded as the value of the task, the task scheduling problem in the non-unit time can be regarded as the 0-1 knapsack problem, and correspondingly, the solving method of the optimal solution of the 0-1 knapsack problem can be similarly regarded as the reference of the solving method of the task scheduling problem in the non-unit time.
2.2 task scheduling problem analysis reasoning per unit time with deadlines and penalties
A unit time task, similar to a non-unit time task schedule, is a job, such as a program to be run on a computer, that requires only one unit time to complete. The scheduling of a given finite set of tasks per unit time S [8], S is permuting the order in which these tasks are specified to be performed.
The problem has the following inputs:
1. aggregationTasks in unit time;
2. a set of n integer deadlinesSo that each->Satisfy->And task->Should be made of +.>Completing;
3. a set of n non-negative weights or penaltiesIf task->Not at the cut-off time->The previous completion is penalized, otherwise, no penalty is provided.
In view of the above, it is desirable to find a schedule of S that minimizes the overall penalty due to missed deadlines.
Thus, the search finds the best schedule for the assigned set of tasks A. After determining A, se:Sup>A canonical ordering of the best schedule may be generated by listing the elements of the actual schedule A and then listing the recent tasks (S-A) in monotonically increasing deadline order.
If there is a schedule of these tasks, set A is not late for the tasks. It is apparent that the early task sets of the schedule form a single set of tasks. Consider the question whether a given task set a is individual. For the followingLet->Represents the number of tasks in A, the deadline of which is t or earlier,/or more>
For task set A, lemma 1, the following statement is equivalent.
1. Set a is separate.
2. For the followingThere is->
3. If the tasks in A are arranged in order of monotonically increasing deadlines, no tasks are late.
It is easy to see that, above the task scheduling problem in unit time, the task completion time is changed from a single unit time to a plurality of unit times, namely, the task in non-unit time can be regarded as the task in unit time, so that the task in non-unit time is scheduled in unit time in a generalized mode except for the constraint condition of deadlines led out by unit time and corresponding penalties.
1. Algorithm problem conversion
3.1 task scheduling problem conversion
2.2, the task scheduling problem is different from the task scheduling problem in unit time in that the task in the latter is in unit time, so that the task can start running before the deadline only; while the task in question requires several units of timeTo run if we want to guarantee task +.>Not "punished" we have to guarantee +.>Can be at->The operation starts before and there is enough time (+)>) So that is +.>Can be at->(or before) completion.
Because the non-unit time tasks in the subject matter do not need to run continuously, the non-unit time tasks can be processedDivided into->Each task has a deadline of +.>Task->The penalty of (1) is defined as:
if it belongs toIs->Each unit time task can be completed in the respective deadline (or before), and the penalty is 0;
if any one belongs toThe task per unit time of (a) is not completed in (or before) its own deadline, then the penalty is +.>
After the task scheduling problem in the non-unit time is converted, whether the task scheduling problem in the unit time can be solved by a solving algorithm of the task scheduling problem in the unit time can be considered. Problems are given with respect to independent collectionsAConcept of (d) and its equivalentsAnd converts its solution into a set of build tasksSIs a separate set of (a)ASo that it is assembled thatAThe problem of maximum sum of timeout penalties for the involved tasks. To construct an independent collectionAConsideration is needed to determine how a runtime istDeadline ofdTask of (2)aWhether or not to join an existing independent collectionAA new independent set is formed. For tasks per unit timeFrom independent collectionsAIt can be known that as long as +.>Then taskaCan be added into independent collectionA. But for non-unit time tasks as set forth hereinaDue to the need to ensure all ofaA kind of electronic devicetTasks can be performed in a unit timed(or before) is completed, so that +.>TasksaCan join the independent collectionA. Thus, the conditions for determination are identical for both the unit-time task and the non-unit-time task.
2, giving a running time astDeadline ofdTask of (2)aAnd an existing independent collectionAIf (3)aSatisfying the following conditionsaCan be added toAConstitute a new independent set:
assuming that there is one (sum of timeout penalties) ratioALarge aggregate, taskaIs thatATimeout penalty in (1)dThe smallest task, then there must be one that is not in the aggregateAIn (2), the timeout penalty isTask of (1)>So that->And->Capable of joining collectionsA-aAt this time, only the task is replacedaAnd task->A ratio can be obtainedALarge collections. But cannot find such a taskBecause if->And->Can join the collection->Then->Must be already in the collectionAIn that in constructing the collectionAThe time is chosen from big to small according to the time-out penalty of the task. Thus can proveAIs thatSIs a maximum independent set of (a) in the set.
However, for the task scheduling problem of non-unit time, the method in the task scheduling problem of unit time cannot guarantee the obtained setAIs the largest.
For example: given one containsTTime slots of 7 unit time, including as shown in Table 15The following tasks:
TABLE 1
Task now,/>,/>,/>,/>Is according to->From big to small, one can try to solve a maximum independent set by using the solution of task scheduling problem with deadlines and penalties in unit timeA. Task->Due to->Therefore->Can be added withA. Then consider +.>,/>Therefore->Can also be addedA. Then go to->,/>Therefore->Is also added toA. At this time, the state of the time slot is as shown in table 2 (in which the unit time tasks belonging to the same non-unit time task are denoted by the same task number):
TABLE 2
The remaining slots are only time 1, so the following tasksAnd->It is impossible to complete. The total penalty for the task currently in the time slot is calculated first as 15, however this is not a maximum, as the task scheduling approach as in table 3 can be found such that the total penalty is 16.
TABLE 3 Table 3
3.2 0-1 backpack problem transformation
From 2.1, it is clear that the 0-1 backpack differs from the subject matter herein in that the latter adds a "deadline" constraint on the "item" (i.e., task) which, in addition to the "empty space", is required to meet the "deadline" constraint, to ensure that the "item" can be loaded into the "backpack".
Another description of the task scheduling problem for non-unit time is given below, making it closer to the 0-1 knapsack problem:
given a givenNKnown run time isThe value is->With a period of +.>And a length ofTAnd finding a task schedule which can be fed into the fixed time slot and has the maximum value under the condition of meeting the task deadline.
From the recursion (1) of the backpack problem, for the firstiAn item, if not selected or if the item itself cannot be added to a backpack, theniMaximum value that individual items can obtain and the fronti -1. The same applies to each. Otherwise, it will find a point where the first can be put downiSchemes for individual articles (i.e) Comparing this scheme with the previous scheme +.>Selecting a maximum value as the front valueiMaximum value of the individual item, i.e.)>. This recursion applies equally to the subject matter here, but is not guaranteed to be the firstiPersonal task joining scheme->The deadline constraints can still be met afterwards. Thus, there is also a need to select the firstiBefore the task, judge scheme->Add the firstiWhether or not the constraint of deadlines can still be satisfied after the task, if not, the first can not be selectediAnd (3) tasks. The recursion provided herein is given below:
there is a need to consider how to determine a given scenarioAdd the firstiWhether or not the deadline constraint can still be met after each task. For the existing scheme->The information available is only the current maximum, which obviously cannot be determined, which information needs to be added?
In the previous analysis, a known independent set is givenAAnd a taskaCan judge the taskaWhether or not to addA. Thus, the added information is just each schemeCorresponding independent setsAI.e. has been added to at presentAIs a task in (a). Each of +.>Expanded to a length ofNTable +1->Wherein N is the number of tasks, +.>Representing the maximum value corresponding to the current scheme for 1 +.>
To solve a set using the previous methodAIt is also necessary to order tasks from big to small in value first.
The algorithm design is analyzed in 3.1 and 3.2, and the following algorithm can be obtained according to the definition of the task scheduling problem in non-unit time and the solution of the knapsack problem 0-1 and the task scheduling problem in unit time:
input given T unit time, N taskstask[1..N]) Each task contains 4 attributes (1≤i≤N):
task[i]Num: sequence number of task
task[i]And (t): runtime of tasks
task[i]D: deadlines of tasks
task[i]V: value of task (or timeout penalty)
Output, maximum value that can be obtained, and corresponding task scheduling scheme, i.e. over time slots of T units of time
Each point runs which task respectively, and if the corresponding time slot is empty, the point can run any task without affecting the final result. SortByValue (task [1..N ]);
2:fori←0toNdo
3:forj←0toTdo4:fork←0toNdo5:F[i][j][k]←0;6:endfor7:endfor8:endfor9:fori←1toTdo10:forj←1toNdo11:iftask[j].t>ithen12:F[j][i][0]←F[j-1][i][0]13:copyF[j-1][i][1..N]toF[j][i][1..N]14:else15:if(F[j-1][i][0]F[j-1][i-task[j].t][0]+task[j].v)or(check(F[j-1][i-task[j].t],j,i)=FALSE)then16:F[j][i][0]←F[j-1][i][0]17:copyF[j-1][i][1..N]toF[j][i][1..N]18:else19:F[j][i][0]←F[j-1][i-task[j].t][0]+task[j].v20:copyF[j-1][i-task[j].t][1..N]toF[j][i][1..N]21:F[j][i][j]←122:endif23:endif24:endfor25:endfor26:printSchedule
the whole algorithm is based on the 0-1 knapsack problem, and maintenance on each scheme is added, and whether a certain task can be added into a certain scheme or not is judged.
In line 1, tasks are firstly ordered from big to small according to value, and lines 2-8 initialize a table to be maintained
The length i of the 9 th row time slot increases from 1to T, and after each increase, the 10 th row j represents the calculation of the recursion formula (3) starting from task 1to task N.
Line 11, if task j's run time is greater than the current time slot length i, then task j cannot run; line 15, if schemePreferably, or in case of a time slot length i, the scheme +.>If task j cannot be added, still select scheme +.>Otherwise line 18 is in scheme +.>Task j is added on the basis of (1). Note that in lines 13, 17, 20, the corresponding scheme is copied to the current scheme, respectively, line 21 is to be copied corresponding +.>Set to 1. Finally, line 27 output maximum and scheduling scheme
The Check function realizes:
Input:
current scheme S1]If (3)S[i]=1() The solution is described as comprising task i;
newly added firstaTasks;
length of current time slotT
One length isTTime slot structure of +1 (time point 0 cannot be used) times, which is initially the conditionT+1 disjoint sets, which support the following operations:
findempty (k): a point in time before the location k and not used is found, if not, a 0 is returned;
use (p, i): the point in time at position p is used for task i and the set to which point in time p belongs is combined with the set preceding p. Output if the firstaThe individual tasks can join scheme S, return TRUE, otherwise return FALSE.1:fori1toado2:ifS [ i ]]=1ori=athen3:forj←task[i].ddowntotask[i].d-task[i].tdo4:ifj>Tthen5:k←T6:else7:k←j8:endif9:p←timeslots.FindEmpty(k)10:ifp=0then11:returnFALSE12:endif13:timeslots.Use(p,i)14:endfor15:endif16:endfor17:returnTRUE
Line 1, since the previous task was selected from 1 st to Nth, at detection of line 1aOnly need to scan during each task
Line 2, ifS[i]=1 indicates that the ith task has been in scheme S, ifi=aAlthoughBut can be assumed firstaCan be added to S and then a determination is made as to whether the assumption is true.
Line 3, j from task [ i ]]D to task [ i ]]T, corresponds to dividing task j into tasks [ i ]]T tasks with unit time, the time limit is respectively
Lines 4-8, if the deadline j of the task is greater than the length of the current time slot, then one can only start from the last point of the time slot. The latter work is to find a point in time for each unit time task. If a point in time p can be found, p is assigned to task i, if not (p=0), the assumption before the description does not hold, then FALSE is returned, otherwise TRUE is returned.
The temporal complexity of the algorithm is analyzed below. Before this, the time complexity of check is analyzed. Looking directly at the pseudo code, chThe time complexity of eck is not well analyzed, considering analysis from another perspective. First, the implementation of check is based on a fast disjoint SET forest of merging and path compression by rank, where FindEmpty (k) is based on FIND-SET operation and Use (p, i) is based on UNION operation. For a given time slot of length T, check can only perform at most T FindEmpty (k) and T Use (p, i) operations, since each time an empty time point is found, this time point is used, and when T time points are all used, check returns either FALSE or TRUE. So the time complexity of check can be regarded approximately asO(T)。
Re-analyzing the time complexity of the schedule, assuming line 1 employs a time complexity ofLines 2-8 are obviously +.>Considering- + consider that in the worst case, check is performed every cycle, lines 9-25 have a temporal complexity of +.>Finally, printSchedule can be in +.>And (3) finishing. Therefore, the time complexity of the whole scheduling algorithm is +.>
4, test and results.
The solving algorithm of the non-unit time task scheduling problem combines the 0-1 knapsack problem and the unit time task scheduling problem, if a group of tasks with the running time of 1 is input, the problem to be solved is degenerated into the unit time task scheduling problem, if a group of tasks with the deadline of more than or equal to the time slot length T is input, the problem is degenerated into the 0-1 knapsack problem, that is, the 0-1 knapsack problem and the unit time task scheduling problem can be solved, and the algorithm of the non-unit time task scheduling problem can be solved.
Thus, three sets of data are set:
1. data on 0-1 knapsack problem
2. Data of prior art concerning problems of task scheduling per unit time with penalties
3. For data of a task scheduling problem other than unit time, this set of data is from example (1), and it can be known that the algorithm of the task scheduling problem in unit time cannot solve this set of data, then it can be tried whether the algorithm of problem 0 can solve it.
4. Data for a non-unit time task scheduling problem, this set of data modifies the deadline of the task above the 3 rd set of data so that the maximum available is smaller.
3.1 test data
A first set of data:
TABLE 4 first set of data
A second set of data:
TABLE 5 second set of data
Third set of data:
TABLE 6 third set of data
Fourth set of data:
TABLE 7 fourth set of data
3.2 experimental results
A first group:
TABLE 8 results of the first set of data experiments
TABLE 9 first set of policies
The resulting maximum and loading strategy is consistent with the results of the prior art data on the 0-1 knapsack problem described above, but the resulting table is different because the items (tasks) are ordered.
Second group:
TABLE 10 results of the second set of experiments
TABLE 11 second set of policies
The resulting scheduling strategy is consistent with the prior art scheduling strategy described above with respect to punished task scheduling per unit time, where the algorithm computes the maximum value, but the results are consistent.
Third group:
TABLE 12 third set of experimental results
TABLE 13 third set of policies
Consistent with the analysis of the examples herein.
Fourth group:
/>
TABLE 14 fourth set of experimental results
Table 15 fourth set of policies
By comparison, the algorithm provided herein can give optimal scheduling by using constraint conditions in non-unit time-oriented task scheduling, and has excellent performance.
The task scheduling problem oriented to the non-unit time is analyzed in detail, the task scheduling problem oriented to the non-unit time is converted into a relatively simple problem to be analyzed according to similarity comparison of a decomposition result and other related problems through decomposing the problem, and finally, a non-unit task scheduling algorithm with constraint conditions is provided by combining and improving a solution method of the conversion problem. Experiments prove that the algorithm can solve the problem 0, the problem 1 and the problem 2, can give optimal scheduling by using constraint conditions, and has excellent performance. The time complexity of the algorithm is. It should be appreciated that embodiments of the invention may be implemented or realized by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer readable memory. The methods may be implemented in a computer program using standard programming techniques, including a non-transitory computer readable storage medium configured with a computer program, where the storage medium so configured causes a computer to operate in a specific and predefined manner, in accordance with the methods and drawings described in the specific embodiments. Each program may be implemented in a high level procedural or object oriented programming language to communicate with a computer system. However, the program(s) can be implemented in assembly or machine language, if desired. In any case, the language may be compiled or interpretedIs a language of (c). Furthermore, the program can be run on a programmed application specific integrated circuit for this purpose.
Furthermore, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes (or variations and/or combinations thereof) described herein may be performed under control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications), by hardware, or combinations thereof, collectively executing on one or more processors. The computer program includes a plurality of instructions executable by one or more processors.
Further, the method may be implemented in any type of computing platform operatively connected to a suitable computing platform, including, but not limited to, a personal computer, mini-computer, mainframe, workstation, network or distributed computing environment, separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, and so forth. Aspects of the invention may be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and/or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer, which when read by a computer, is operable to configure and operate the computer to perform the processes described herein. Further, the machine readable code, or portions thereof, may be transmitted over a wired or wireless network. When such media includes instructions or programs that, in conjunction with a microprocessor or other data processor, implement the above steps, the invention herein includes these and other different types of non-transitory computer-readable storage media. The invention also includes the computer itself when programmed according to the methods and techniques of the invention.
A computer program can be applied to the input data to perform the functions herein to convert the input data to generate output data that is stored to the non-volatile memory. The output information may also be applied to one or more output devices such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects produced on a display.
The present invention is not limited to the above embodiments, but can be modified, equivalent, improved, etc. by the same means to achieve the technical effects of the present invention without departing from the spirit and principle of the present invention. Various modifications and variations are possible in the technical solution and/or in the embodiments within the scope of the invention.

Claims (2)

1. A non-unit time task scheduling method with constraint conditions is characterized by comprising the following steps:
s1, sorting a plurality of non-unit time tasks with constraint conditions to be executed within a preset time period according to task values;
s2, dividing a preset time period into a plurality of time slots with the same width;
s3, placing tasks with non-unit time in time slots for execution according to the step S1 sequence, comparing the task running time with the time slots when each time is placed, allowing execution if the running time does not exceed the time slot width, maintaining the task scheduling scheme when a plurality of tasks with non-unit time and corresponding time slot widths are already running as a task scheduling scheme, generating a corresponding task scheduling scheme when new tasks are added each time, generating a corresponding task scheduling scheme when each maintenance is performed, and merging the additional time slots with the standard time slots at the tail part if the additional time slots are smaller than the standard time slots with the same width, placing the additional time slots at the tail part for executing the tasks for a plurality of tasks with non-unit time which are not placed in the time slots, and selecting the maximum value task which can be placed in the tail time slots for execution;
s4, comparing all task scheduling schemes generated in the step S3 with the number of tasks in non-unit time executed by the scheduling schemes, and selecting a corresponding scheduling scheme with the maximum number of tasks in non-unit time as an optimal task scheduling scheme;
wherein the constraint conditions are deadlines and corresponding penalties;
the task comprises a task sequence number, a task running time, a task deadline and a task value, wherein the task value is a timeout penalty of the task;
the step S3 specifically includes:
comparing the running time of the non-unit time task to be added into the time slot with the width of the time slot, if the running time of the non-unit time task is larger than the width of the time slot, prohibiting the non-unit time task from being added into the time slot for running, simultaneously, not updating the task scheduling scheme, and searching for the next non-unit time task by using the original task scheduling scheme;
if the running time of the non-unit time task is smaller than the width of the time slot, adding the corresponding non-unit time task into the time slot for running, updating a task scheduling scheme, and searching for the next non-unit time task by using a new task scheduling scheme;
the step S3 further includes: generating a corresponding task scheduling scheme for each task adding, wherein the corresponding scheduling scheme comprises a total time slot length, a task number and a total task value; comparing all task scheduling schemes generated by adding tasks once, and taking the scheduling scheme with the maximum total time slot length, the maximum task number and the highest total task value as the scheduling scheme for solving a plurality of non-unit time tasks with constraint conditions to be executed.
2. The non-unit time task scheduling method with constraint conditions according to claim 1, wherein the length of the time slot can be set in a self-defined manner.
CN201811272629.6A 2018-10-30 2018-10-30 Non-unit time task scheduling method with constraint condition Active CN109885383B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811272629.6A CN109885383B (en) 2018-10-30 2018-10-30 Non-unit time task scheduling method with constraint condition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811272629.6A CN109885383B (en) 2018-10-30 2018-10-30 Non-unit time task scheduling method with constraint condition

Publications (2)

Publication Number Publication Date
CN109885383A CN109885383A (en) 2019-06-14
CN109885383B true CN109885383B (en) 2023-08-01

Family

ID=66924844

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811272629.6A Active CN109885383B (en) 2018-10-30 2018-10-30 Non-unit time task scheduling method with constraint condition

Country Status (1)

Country Link
CN (1) CN109885383B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113780745B (en) * 2021-08-16 2024-05-14 华中科技大学 IT personnel scheduling method and system driven by door-to-door service demand

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102323895A (en) * 2011-09-02 2012-01-18 广东中大讯通软件科技有限公司 Real-time scheduling method of embedded operating system based on STB (Set Top Box)
CN103514048A (en) * 2013-10-15 2014-01-15 上海交通大学 Sensing participation system and task distribution method of sensing participation system
CN103995742A (en) * 2014-05-20 2014-08-20 万向钱潮股份有限公司 Embedded type real-time scheduling control device and method based on MCU
CN106095582A (en) * 2016-06-17 2016-11-09 四川新环佳科技发展有限公司 The task executing method of cloud platform
CN106681807A (en) * 2016-11-28 2017-05-17 中国人民解放军国防科学技术大学 Method for parallelizing preprocessing of tasks of imaging satellites on basis of Spark
CN107430510A (en) * 2015-12-31 2017-12-01 华为技术有限公司 Data processing method, device and system

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4750350B2 (en) * 2003-03-13 2011-08-17 パナソニック株式会社 Task switching device, method and program
EP2323035B1 (en) * 2009-11-16 2019-04-17 Red Bend Software Scheduling system
JP5069325B2 (en) * 2010-03-11 2012-11-07 株式会社豊田中央研究所 Task execution control device and program
CN101964752B (en) * 2010-10-19 2013-02-06 杨忠明 Broadband network access method for dynamic adjustment resource allocation
WO2013030630A1 (en) * 2011-09-02 2013-03-07 Freescale Semiconductor, Inc. Data processing system and method for task scheduling in a data processing system
CN102591721A (en) * 2011-12-30 2012-07-18 北京新媒传信科技有限公司 Method and system for distributing thread execution task
CN102867107B (en) * 2012-08-16 2015-05-13 中国人民解放军国防科学技术大学 Multi-imaging satellite emergency task dynamic scheduling method
CN103729248B (en) * 2012-10-16 2017-12-15 华为技术有限公司 A kind of method and apparatus of determination based on cache perception task to be migrated
US20150310380A1 (en) * 2014-04-28 2015-10-29 Patent Investment & Licensing Company Dispatch system having control shared with dispatched service providers
CN106126326A (en) * 2016-06-23 2016-11-16 东软集团股份有限公司 Timing task management method and apparatus
US10031776B2 (en) * 2016-11-21 2018-07-24 Ca, Inc. Workflow job distribution in a data processing system with agent time window constraints
CN108345501B (en) * 2017-01-24 2021-10-29 全球能源互联网研究院有限公司 Distributed resource scheduling method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102323895A (en) * 2011-09-02 2012-01-18 广东中大讯通软件科技有限公司 Real-time scheduling method of embedded operating system based on STB (Set Top Box)
CN103514048A (en) * 2013-10-15 2014-01-15 上海交通大学 Sensing participation system and task distribution method of sensing participation system
CN103995742A (en) * 2014-05-20 2014-08-20 万向钱潮股份有限公司 Embedded type real-time scheduling control device and method based on MCU
CN107430510A (en) * 2015-12-31 2017-12-01 华为技术有限公司 Data processing method, device and system
CN106095582A (en) * 2016-06-17 2016-11-09 四川新环佳科技发展有限公司 The task executing method of cloud platform
CN106681807A (en) * 2016-11-28 2017-05-17 中国人民解放军国防科学技术大学 Method for parallelizing preprocessing of tasks of imaging satellites on basis of Spark

Also Published As

Publication number Publication date
CN109885383A (en) 2019-06-14

Similar Documents

Publication Publication Date Title
Megow et al. Dual techniques for scheduling on a machine with varying speed
Potts et al. Integrating scheduling with batching and lot-sizing: a review of algorithms and complexity
Zeballos A constraint programming approach to tool allocation and production scheduling in flexible manufacturing systems
Chen et al. Fast identification of custom instructions for extensible processors
Dell'Amico et al. The bin packing problem with precedence constraints
KR102182198B1 (en) Data processing graph compilation
Kim et al. Time-feasible reachability tree for noncyclic scheduling of timed Petri nets
Şen et al. A strong preemptive relaxation for weighted tardiness and earliness/tardiness problems on unrelated parallel machines
Memik et al. A super-scheduler for embedded reconfigurable systems
CN109885383B (en) Non-unit time task scheduling method with constraint condition
Symons et al. LOMA: Fast auto-scheduling on DNN accelerators through loop-order-based memory allocation
Li et al. Chemical reaction optimization for heterogeneous computing environments
Chou et al. On the asymptotic optimality of a simple on-line algorithm for the stochastic single-machine weighted completion time problem and its extensions
Timmer et al. Module selection and scheduling using unrestricted libraries
Kodase et al. Transforming structural model to runtime model of embedded software with real-time constraints
Carneiro et al. Cellular automata-based model with synchronous updating for task static scheduling
Azari et al. Improving performance through path-based hardware/software partitioning
Kushwaha et al. An Investigation of List Heuristic Scheduling Algorithms for Multiprocessor System.
KR102195886B1 (en) Distributed processing system and operating method thereof
Hall et al. Scheduling with finite capacity output buffers
Salmon et al. Scheduling real-time systems with periodic tasks using a model-checking approach
Koziris et al. Optimal time and efficient space free scheduling for nested loops
Hamidzadeb et al. Dynamic scheduling of real-time tasks, by assignment
Adams Creation of simple, deadline, and priority scheduling algorithms using genetic programming
Kohútka et al. FPGA-based Task Scheduler for Mixed-Criticality Real-Time 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