Invention content
The present invention proposes a kind of efficiency cloud method for scheduling task, and efficiently scheduling can be carried out rationally to cloud task, is closed
Low-energy-efficiency resource is closed, in resource homogeneity and isomery, while not increasing scheduling length, reduces the totality of task execution
Energy consumption saves the energy consumption of resource.
According to an aspect of the invention, it is proposed that a kind of efficiency cloud method for scheduling task.The method may include:Step
1:Establish comprising multiple tasks it is oriented without cycle scheme, calculate each task all resources average calculation times;Step 2:
According to the average calculation times of each task, the priority of each task is determined, obtain the scheduling sequence of each task;Step 3:
According to the scheduling sequence of each task, minimum value or the minimum of computation time on the earliest finish time of each task are calculated,
Obtain initial schedule scheme;Step 4:The energy valid value of each resource of the initial schedule scheme is calculated, deleting can valid value minimum
Resource, obtain resource collection, for the resource collection repeat step 1-3, obtain final scheduling scheme.
Preferably, each task is in the average calculation times of all resources:
Wherein, wi' it is task niIn the average calculation times of all resources, q is total number resource, and j is resource sequence number, wi,jFor
Task niIn resource pjThe calculating time.
Preferably, the priority of the task is calculated using export task as starting point by recursive fashion;Wherein, it is described go out
The priority of mouthful task is:
priority(nexit)=w'exit(2)
Wherein, priority (nexit) it is export task nexitPriority, w'exitFor export task nexitIn all moneys
The average calculation times in source;Each the priority of task is:
Wherein, priority (ni) it is task niPriority, succ (ni) it is task niImmediate successor task set, nk
For niSubsequent tasks, ci,kFor task niWith nkBetween call duration time.
Preferably, the minimum value on the earliest finish time for calculating each task is:
minEFT(ni,pj)=min (wi,j+EST(ni,pj))(4)
Wherein, minEFT (ni,pj) it is task niIn resource pjEarliest finish time minimum value, EFT (ni,pj) it is to appoint
Be engaged in niIn resource pjEarliest finish time, EST (ni,pj) it is task niIn resource pjOn early start execute the time.
Preferably, the EST (ni,pj) be:
Wherein, pred (ni) it is task niDirect precursor set of tasks, avail [j] be resource j for task execution
Earliest ready time, nmFor niPredecessor task, AFT (nm) it is task nmActual finish time, cm,iFor task nmWith niBetween
Call duration time.
Preferably, the minimum of computation time of each task is:
FCT=minwi,j (6)
Wherein, FCT is the minimum of computation time.
Preferably, the energy valid value for calculating each resource of the initial schedule scheme is:
Wherein, EEjFor resource pjEnergy valid value, Edyn,jFor resource pjDynamic energy consumption, Esta,jFor resource pjStatic energy
Consumption, Etotal,jFor resource pjTotal energy consumption.
Preferably, resource pjDynamic energy consumption be:
Wherein, A is the on-off times in each clock cycle, and C is effective charge, vmaxFor the maximum power supply electricity of processor
Pressure, fmaxFor the maximum frequency of operation of processor.
Preferably, resource pjStatic energy consumption be:
Wherein, vminFor the minimum supply voltage of processor, fminFor the minimum running frequency of processor, △ widle,jFor place
Manage device pjFree time.
Preferably, resource pjTotal energy consumption be:
The present invention has other characteristics and advantages, these characteristics and advantages are from the attached drawing and subsequent tool being incorporated herein
It will be apparent, or will carry out in the drawings and the subsequent detailed description incorporated herein in body embodiment
Statement in detail, the drawings and the detailed description together serve to explain specific principles of the invention.
Specific implementation mode
The present invention is more fully described below with reference to accompanying drawings.Although showing the preferred embodiment of the present invention in attached drawing,
However, it is to be appreciated that may be realized in various forms the present invention without should be limited by embodiments set forth here.On the contrary, providing
These embodiments are of the invention more thorough and complete in order to make, and can will fully convey the scope of the invention to ability
The technical staff in domain.
Fig. 1 shows the flow chart of the step of efficiency cloud method for scheduling task according to the present invention.
In this embodiment, efficiency cloud method for scheduling task according to the present invention may include:Step 1:It establishes comprising more
A task it is oriented without cycle scheme, calculate each task all resources average calculation times;Step 2:According to each task
Average calculation times, determine the priority of each task, obtain the scheduling sequence of each task;Step 3:According to each task
Scheduling sequence, calculate minimum value or the minimum of computation time on the earliest finish time of each task, obtain initial schedule scheme;
Step 4:The energy valid value of each resource of initial schedule scheme is calculated, the resource of energy valid value minimum is deleted, obtains resource collection, needle
Step 1-3 is repeated to resource collection, obtains final scheduling scheme.
In one example, each task is in the average calculation times of all resources:
Wherein, wi' it is task niIn the average calculation times of all resources, q is total number resource, and j is resource sequence number, wi,jFor
Task niIn resource pjThe calculating time.
In one example, the priority of task is calculated using export task as starting point by recursive fashion;Wherein, it exports
The priority of task is:
priority(nexit)=w'exit (2)
Wherein, priority (nexit) it is export task nexitPriority, w'exitFor export task nexitIn all moneys
The average calculation times in source;Each the priority of task is:
Wherein, priority (ni) it is task niPriority, succ (ni) it is task niImmediate successor task set, nk
For niSubsequent tasks, ci,kFor task niWith nkBetween call duration time.
In one example, the minimum value for calculating the earliest finish time of each task is:
minEFT(ni,pj)=min (wi,j+EST(ni,pj)) (4)
Wherein, minEFT (ni,pj) it is task niIn resource pjEarliest finish time minimum value, EFT (ni,pj) it is to appoint
Be engaged in niIn resource pjEarliest finish time, EST (ni,pj) it is task niIn resource pjOn early start execute the time.
In one example, EST (ni,pj) be:
Wherein, pred (ni) it is task niDirect precursor set of tasks, avail [j] be resource j for task execution
Earliest ready time, nmFor niPredecessor task, AFT (nm) it is task nmActual finish time, cm,iFor task nmWith niBetween
Call duration time.
In one example, the minimum of computation time of each task is:
FCT=minwi,j (6)
Wherein, FCT is the minimum of computation time.
In one example, the energy valid value of each resource of calculating initial schedule scheme is:
Wherein, EEjFor resource pjEnergy valid value, Edyn,jFor resource pjDynamic energy consumption, Esta,jFor resource pjStatic energy
Consumption, Etotal,jFor resource pjTotal energy consumption.
In one example, resource pjDynamic energy consumption be:
Wherein, A is the on-off times in each clock cycle, and C is effective charge, vmaxFor the maximum power supply electricity of processor
Pressure, fmaxFor the maximum frequency of operation of processor.
In one example, resource pjStatic energy consumption be:
Wherein, vminFor the minimum supply voltage of processor, fminFor the minimum running frequency of processor, △ widle,jFor place
Manage device pjFree time.
In one example, resource pjTotal energy consumption be:
Fig. 2 shows the oriented schematic diagrames without cycle figure DAG models of task according to an embodiment of the invention.
Fig. 3 shows resource connected graph according to an embodiment of the invention.
Specifically, efficiency cloud method for scheduling task may include:
Step 1:It includes that the oriented of multiple tasks is schemed without cycle to establish, i.e. DAG models, by a specific cloud computing application
Oriented no cycle figure DAG models are expressed as, as shown in Fig. 2, being expressed as G=(V, E), V is the set for including v task, and E is to appoint
Line set between business, the execution sequence constraint between each edge (i, j) ∈ E expression tasks, represents task niIt must be in task njStart
Preceding completion executes.Weights in each edge represent the communication cost (call duration time) between two tasks.If the task in DAG models
Without any predecessor task, then the task is referred to as entrance task nentryIf without any subsequent tasks, which is referred to as export task
nexit.Cloud resource is expressed as initial resource set P, P={ p1,p2,…,pq, it is complete connection topological structure between resource, such as
Shown in Fig. 3.W indicates the calculating cost matrix of v × p, element wi,jExpression task niIn resource pjOn the calculating time, calculate every
A task is formula (1) in the average calculation times of all resources.
Step 2:According to the average calculation times of each task, determine that the priority of each task is formula (3), task is excellent
The calculating needs of first grade are calculated since export task in a recursive manner, for export task nexit, since there is no subsequent for it
Task, therefore its priority is formula (2), according to the task priority of definition, descending sort is carried out to task, you can obtain each
The scheduling sequence of task.
Step 3:Optimal resource selection is to be followed successively by task choosing optimal scheduling money according to the scheduling sequence of each task
Source may include two kinds of selection criteria:
(1) so that the task can obtain EFT on earliest finish time in resource, EST (n are enabledi,pj) indicate task ni
Resource pjOn early start execute the time, EFT (ni,pj) indicate task niIn resource pjOn earliest finish time, for entering
Mouth task nentry:
EST(nentry,pj)=0 (11)
For the non-entrance task in task image, EST and EFT need the recursive calculation since entrance task, first calculate ni
EST be formula (5), and then calculate niOn the earliest finish time of each resource, task n is obtainediEarliest finish time
Minimum value is formula (4), niAll direct precursor tasks must assure that and completed, if task nkIt is resource pjIt is upper last
Scheduler task, then avail [j] is resource pjComplete nkTime, i.e., resource p at this timejIn ready state, other are can perform
Business.Internal layer max is to return to the ready time, i.e. task n in EST equatioiesiRequired total data reaches resource pjTime.
(2) so that it is formula (6), task n that task obtains minimum of computation time FCT in resourcemIt is dispatched to resource pjAfterwards,
nmUpper resource pjOn earliest start time and earliest finish time be respectively equal to practical time started AST (nm) and actually accomplish
Time AFT (nm).After all tasks in task image are scheduled, scheduling length makespan (overall deadline) is to export
Task nexitActual finish time be formula (12):
Makespan=AFT (nexit) (12)
Wherein, makespan is scheduling length, i.e., the overall deadline, AFT (nexit) it is export task nexitReality it is complete
At the time.According to the earliest finish time of each task or minimum of computation time, initial schedule scheme is obtained.
Step 4:After obtaining task initial schedule scheme, need to assess the resource efficiency under initial schedule scheme.It calculates
The energy valid value of each resource of initial schedule scheme, enables EEjIndicate resource pjEnergy valid value, be meant that resource pjIt is practical to execute
The dynamic energy consumption of task accounts for resource pjThe ratio of overall energy consumption under open state, resource pjOverall energy consumption under open state is
The sum of the static energy consumption for the dynamic energy consumption and resource space idle that resource executes, i.e. formula (7), wherein resource energy consumption uses CMOS
Model, the total energy consumption E of resourcetotalDynamic energy consumption E when task is executed including processordynWith the static energy when processor free time
Consume Esta, i.e. formula (13):
Etotal=Edyn+Esta (13)
Wherein, the power consumption calculation of processor resource is formula (14):
P=ACv2f (14)
Wherein, A indicates that the on-off times in each clock cycle, C indicate that effective charge, v indicate the power supply electricity of processor
Pressure, f indicate the running frequency of processor.For specific processor resource, parameter A and C are constant, therefore, dynamic
Power consumption is mainly influenced by the voltage of processor and frequency.
Current processor is each equipped with dynamic voltage/frequency adjustment DVFS functions, i.e. processor can run on different etc.
On the voltage/frequency of grade.If the frequency Operation class of processor resource is Pyatyi, it is expressed as f={ f1,f2,f3,f4,f5, operation
Voltage class corresponds to V={ v1,v2,v3,v4,v5, frequency level is corresponded with voltage class, and incremented by successively.Order is handled
Device minimum frequency is fmin, maximum frequency fmax, minimum voltage grade is vmin, highest voltage level fmax.Then fmin=f1,
fmax=f5, vmin=v1, vmax=v5.When processor is in idle condition, remained operational with low-limit frequency grade, it is static at this time
Power consumption PstaFor formula (15):
When processor resource executes task, task is handled with highest frequency grade, at this time dynamic power consumption PdynFor
Formula (16):
After processor resource completes the last one task, you can completely close, energy consumption is 0 at this time.For single processor
Resource pjFor, execute task niDynamic energy consumption be formula (8), for single processor resource pjFor, static energy consumption
For formula (9), wherein △ widle,jIndicate processor pjFree time.Then processor pjTotal energy consumption be formula (10).
The total energy consumption that resource collection P executes set of tasks V is formula (17):
In equation, only as task niIt is dispatched to resource pjWhen upper execution, just calculated at this time with maximum execution voltage and frequency
Task execution energy consumption.
After obtaining the energy valid value of each resource, descending arrangement is carried out to resource by energy valid value, deletes the money of energy valid value minimum
Source, i.e. initial resource collection are combined into P={ p1,p2,…,ph…,pq, wherein resource phFor the resource of energy valid value minimum, then money is deleted
Source ph, obtain resource collection P '=P/ { ph}={ p1,p2,…,pq}.According to resource collection P ', step 1-3 is repeated, is obtained final
Scheduling scheme.
The present invention carries out rationally efficiently scheduling to cloud task, closes low-energy-efficiency resource, in resource homogeneity and isomery,
While not increasing scheduling length, the overall energy consumption of task execution is reduced, saves the energy consumption of resource.
Using example
A concrete application example is given below in the scheme and its effect of the embodiment of the present invention for ease of understanding.This field
It should be understood to the one skilled in the art that the example is only for the purposes of understanding the present invention, any detail is not intended to be limited in any way
The system present invention.
The efficiency method for scheduling task of design is analyzed by a specific example, the task image that example uses is such as
Shown in Fig. 2, resource map is as shown in figure 3, execution time of the task in each resource is as shown in table 1, and digital unit is h in table.
Table 1
Verification analysis is carried out in the validity of two kinds of homogeneity resource and heterogeneous resource to designed dispatching method.
When resource is homogeneity, the processor ability of resource is identical, that is, possesses identical voltage and frequency and identical fortune grade etc.
Grade executes dynamic power consumption P when taskdynWith the quiescent dissipation P when free timestaIt is identical.When resource is isomery, respectively
The processor ability of a resource is different, that is, possesses different voltage and frequency, corresponding dynamic power consumption PdynWith static work(
Consume PstaAlso it differs.
When all resources are homogeneity, dynamic power consumption P is setdyn=9W, quiescent dissipation Psta=3W.When resource is isomery
When, each resource power consumption value is as shown in table 2.
Table 2
Resource |
Dynamic power consumption Pdyn/W |
Quiescent dissipation Psta/W |
P1 |
10 |
1.4 |
P2 |
12 |
1.5 |
P3 |
4 |
1 |
P4 |
8 |
1.3 |
P5 |
5 |
1.1 |
The assessment of dispatching method performance is according to the weighting function F for being set as time and energy consumption:
F=α × Makespan+ β × Energy (18)
Wherein, α indicates time factor, and β indicates Energy consumption factor, α, β ∈ [0,1], and alpha+beta=1, taken in experiment α=β=
0.5, i.e., there is same preference with energy optimization to time-optimized.Makepsan indicates the scheduling length of task, Energy tables
Show the overall energy consumption of resource when completing all task schedulings.The resource for closing energy valid value minimum, can reduce overall energy consumption, but have
It may lead to the increase of scheduling length, but can be made and be commented by formula (18) in the comprehensive performance of scheduling length and energy consumption
Estimate.
1) homogeneity resource scenarios
Fig. 4 shows primitive scheduling sequential when homogeneity Resource Calculation minEFT according to an embodiment of the invention
Figure.
1. carry out optimal resource selection as standard using minEFT, the task scheduling sequence diagram that is obtained before task rescheduling
As shown in Figure 4.The energy consumption and its energy valid value situation of each resource are as shown in table 3.Can be seen that the minimum resource of energy valid value is P2,
P2 is when readjustment is spent by removed resource collection, and the sum of energy consumption of all resources is 318+420+333+372+387=at this time
1830kwh, task scheduling length makespan=114s, at this point, FBefore readjustment degree=972.
Table 3
Resource |
Dynamic energy consumption/kwh |
Static energy consumption/kwh |
The sum of energy consumption/kwh |
It can valid value |
P1 |
144 |
174 |
318 |
0.45283 |
P2 |
117 |
303 |
420 |
0.278571 |
P3 |
189 |
144 |
333 |
0.567568 |
P4 |
216 |
156 |
372 |
0.580645 |
P5 |
387 |
0 |
387 |
1 |
The tune obtained after readjustment degree when Fig. 5 shows homogeneity Resource Calculation minEFT according to an embodiment of the invention
Spend sequence diagram.
The scheduling sequence diagram carried out after task rescheduling is as shown in Figure 5.The energy consumption and its energy valid value situation such as table 4 of each resource
It is shown.As can be seen that resource P2 is closed, energy consumption is not generated.The sum of energy consumption of all resources is 318+327+372+732 at this time
=1749kwh, task scheduling length makespan=114s, total energy consumption is reduced, and scheduling length is constant.At this point, FAfter readjustment degree
=931 < FBefore readjustment degree, comprehensive performance is more excellent.
Table 4
Resource |
Dynamic energy consumption/kwh |
Static energy consumption/kwh |
The sum of energy consumption/kwh |
It can valid value |
P1 |
144 |
174 |
318 |
0.45283 |
P2 |
0 |
0 |
0 |
None |
P3 |
198 |
129 |
327 |
0.60550 |
P4 |
216 |
156 |
372 |
0.58064 |
P5 |
585 |
147 |
732 |
0.79918 |
Fig. 6 shows primitive scheduling sequential when homogeneity Resource Calculation minFCT according to an embodiment of the invention
Figure.
2. carry out optimal resource selection with minFCT, task scheduling sequence diagram such as Fig. 6 for being obtained before task rescheduling
It is shown.The energy consumption and its energy valid value situation of each resource are as shown in table 5.Can be seen that the minimum resource of energy valid value is P4, and P4 is in weight
By removed resource collection when scheduling.The sum of energy consumption of all resources is 381+540+186+201+198=1506kwh at this time,
Task scheduling length makespan=114s.At this point, FBefore readjustment degree=810.
Table 5
Resource |
Dynamic energy consumption/kwh |
Static energy consumption/kwh |
The sum of energy consumption/kwh |
It can valid value |
P1 |
207 |
174 |
381 |
0.54330 |
P2 |
297 |
243 |
540 |
0.55 |
P3 |
90 |
96 |
186 |
0.48387 |
P4 |
81 |
120 |
201 |
0.40298 |
P5 |
198 |
0 |
198 |
1 |
The tune obtained after readjustment degree when Fig. 7 shows homogeneity Resource Calculation minFCT according to an embodiment of the invention
Spend sequence diagram.
The scheduling sequence diagram carried out after task rescheduling is as shown in Figure 7.The energy consumption and its energy valid value situation such as table 6 of each resource
It is shown.As can be seen that resource P4 is closed, energy consumption is not generated.The sum of energy consumption of all resources is 456+537+186+198 at this time
=1377kwh, task scheduling length makespan=113s, total energy consumption are reduced, and scheduling length reduces.At this point, FAfter readjustment degree
=745<FBefore readjustment degree, comprehensive performance is more excellent.
Table 6
Resource |
Dynamic energy consumption/kwh |
Static energy consumption/kwh |
The sum of energy consumption/kwh |
It can valid value |
P1 |
324 |
132 |
456 |
0.71052 |
P2 |
297 |
240 |
537 |
0.55307 |
P3 |
90 |
96 |
186 |
0.48387 |
P4 |
0 |
0 |
0 |
None |
P5 |
198 |
0 |
198 |
1 |
2) heterogeneous resource situation
Fig. 8 shows primitive scheduling sequential when heterogeneous resource according to an embodiment of the invention calculates minEFT
Figure.
1. carry out optimal resource selection with minEFT, task scheduling sequence diagram such as Fig. 8 for being obtained before task rescheduling
It is shown.The energy consumption and its energy valid value situation of each resource are as shown in table 7.Can be seen that the minimum resource of energy valid value is P2, and P2 is in weight
By removed resource collection when scheduling.The sum of energy consumption of all resources is 241.2+307.5+132+259.6+215=at this time
1155.3kwh task scheduling length makespan=114s.At this point, FBefore readjustment degree=634.65.
Table 7
Fig. 9 shows the tune obtained after readjustment degree when heterogeneous resource according to an embodiment of the invention calculates minEFT
Spend sequence diagram.
The scheduling sequence diagram carried out after task rescheduling is as shown in Figure 9.The energy consumption and its energy valid value situation such as table 8 of each resource
It is shown.As can be seen that resource P2 is closed, energy consumption is not generated.The sum of energy consumption of all resources is 241.2+131+259.6 at this time
+ 378.9=1010.69kwh, task scheduling length makespan=114s, total energy consumption is reduced, and scheduling length is constant.
At this point, FAfter readjustment degree=562.34<FBefore readjustment degree, comprehensive performance is more excellent.
Table 8
Resource |
Dynamic energy consumption/kwh |
Static energy consumption/kwh |
The sum of energy consumption/kwh |
It can valid value |
P1 |
160 |
81.199 |
241.2 |
0.66334 |
P2 |
0 |
0 |
0 |
None |
P3 |
88 |
43 |
131 |
0.73959 |
P4 |
192 |
67.6 |
259.6 |
0.73959 |
P5 |
325 |
53.9 |
378.9 |
0.85774 |
Figure 10 shows primitive scheduling sequential when heterogeneous resource according to an embodiment of the invention calculates minFCT
Figure.
2. carry out optimal resource selection with minFCT, task scheduling sequence diagram such as Figure 10 for being obtained before task rescheduling
It is shown.The energy consumption and its energy valid value situation of each resource are as shown in table 9.Can be seen that the minimum resource of energy valid value is P3, and P3 is in weight
By removed resource collection when scheduling.The sum of energy consumption of all resources is 311.2+517.5+72+124+110=at this time
1134.7kwh task scheduling length makespan=114s.At this point, FBefore readjustment degree=624.35.
Table 9
Resource |
Dynamic energy consumption/kwh |
Static energy consumption/kwh |
The sum of energy consumption/kwh |
It can valid value |
P1 |
230 |
81.199 |
311.2 |
0.7390 |
P2 |
396 |
121.5 |
517.5 |
0.7652 |
P3 |
40 |
32 |
72 |
0.5555 |
P4 |
72 |
52 |
124 |
0.5806 |
P5 |
110 |
0 |
110 |
1 |
It is obtained after readjustment degree when Figure 11 shows heterogeneous resource calculating minFCT according to an embodiment of the invention
Dispatch sequence diagram.
The scheduling sequence diagram carried out after task rescheduling is as shown in figure 11.The energy consumption and its energy valid value situation such as table of each resource
Shown in 10.As can be seen that resource P3 is closed, energy consumption is not generated.The sum of energy consumption of all resources is 380.4+517.5+ at this time
124+110=1131.9kwh task scheduling length makespan=114s, total energy consumption reduces, and scheduling length is constant.At this point,
FAfter readjustment degree=622.95<FBefore readjustment degree, comprehensive performance is more excellent.
Table 10
Resource |
Dynamic energy consumption/kwh |
Static energy consumption/kwh |
The sum of energy consumption/kwh |
It can valid value |
P1 |
335 |
45.399 |
380.4 |
0.8885 |
P2 |
396 |
121.5 |
517.5 |
0.7652 |
P3 |
0 |
0 |
0 |
None |
P4 |
72 |
52 |
124 |
0.5806 |
P5 |
110 |
0 |
110 |
1 |
In conclusion the present invention carries out rationally efficiently scheduling to cloud task, low-energy-efficiency resource is closed, in resource homogeneity and different
In the case of structure, while not increasing scheduling length, the overall energy consumption of task execution is reduced, saves the energy consumption of resource.
It will be understood by those skilled in the art that above to the purpose of the description of the embodiment of the present invention only for illustratively saying
The advantageous effect of bright the embodiment of the present invention is not intended to limit embodiments of the invention to given any example.
Various embodiments of the present invention are described above, above description is exemplary, and non-exclusive, and
It is not limited to disclosed each embodiment.Without departing from the scope and spirit of illustrated each embodiment, for this skill
Many modifications and changes will be apparent from for the those of ordinary skill in art field.