Sie sind auf Seite 1von 12

Research Article

International Journal of Distributed


Sensor Networks
2017, Vol. 13(5)
An optimal energy-saving real-time Ó The Author(s) 2017
DOI: 10.1177/1550147717707891
task-scheduling algorithm for mobile journals.sagepub.com/home/ijdsn

terminals

Ziran Peng1,2 and Guojun Wang3

Abstract
This article discusses the principles, mechanisms, and strategy of hard real-time task scheduling appropriate for mobile
terminal equipment. Mobile terminals have timeliness requirements for completing hard real-time tasks and also clear
energy-management requirements. Therefore, this study attempts to schedule tasks under these two constraints to
achieve an optimal level of energy savings. First, terminal equipment operating time and standby time should meet the
maximum requirements, and second, all tasks should meet the constraints of real-time parallel scheduling. We propose a
scheduling strategy based on grouping according to the latest cut-off time, with each group adopting a dynamic optimiza-
tion strategy to make scheduling decisions. The feasibility and validity of this algorithm are demonstrated through experi-
ments and simulations.

Keywords
Mobile terminal, real-time task scheduling, earliest deadline first scheduling, optimal energy saving, step-by-step optimiza-
tion strategy

Date received: 4 November 2016; accepted: 9 April 2017

Academic Editor: Juan Cano

Research background order in which tasks are run according to the deadline
of task completion such that tasks with the earliest
Research status of real-time task scheduling based deadlines are run first.1 The least-leisure-time-first
on intelligent terminal systems (LSF) algorithm assigns the highest priority to the
Mobile intelligent terminals that run a number of hard task with the shortest deadline to ensure that the most
real-time tasks that must be completed within the speci- urgent tasks are executed first. Based on the EDF
fied time have relatively high requirements for real- algorithm, Vrimani et al.2 proposed a new scheduling
time task scheduling. Failure to meet these require-
ments can result in the malfunction of systems such
as traffic control systems and medical monitoring sys- 1
School of Information Science and Engineering, Central South
tems. Periodic real-time tasks must be executed once University, Changsha, China
during each fixed period of time. For example, the 2
Hunan Vocational College of Commerce, Changsha, China
signal analysis and diagnosis task of a medical moni- 3
School of Computer Science & Educational Software, Guangzhou
toring system is a periodic real-time task. Given a University, Guangzhou, China
task-scheduling algorithm, if the execution of each
Corresponding author:
task can be completed within its deadline, the task Guojun Wang, School of Computer Science and Educational Software,
scheduling is denoted as feasible. The earliest-dead- Guangzhou University, Guangzhou, Guangdong Province, 510006, China.
line-first (EDF) scheduling algorithm determines the Email: csgjwang@163.com

Creative Commons CC-BY: This article is distributed under the terms of the Creative Commons Attribution 4.0 License
(http://www.creativecommons.org/licenses/by/4.0/) which permits any use, reproduction and distribution of the work without
further permission provided the original work is attributed as specified on the SAGE and Open Access pages (http://www.uk.sagepub.com/aboutus/
openaccess.htm).
2 International Journal of Distributed Sensor Networks

strategy based on genetic algorithm to address the


defects of the EDF algorithm.

Problem analysis and research objectives


Although the EDF algorithm has been improved, the
algorithm is not appropriate for energy-sensitive
devices such as mobile terminals because it does not
consider the energy consumption of peripherals. Due
to the rapid development and proliferation of on-chip
processor systems and mobile intelligent terminals with
advances in mobile computing and the Internet of Figure 1. Mobile health-monitoring watch developed in this
Things, intelligent embedded real-time systems have article for scheduling hard real-time tasks.
become increasingly critical. For mobile intelligent
terminals, the power standby time has become a critical
performance index, making energy management an Based on this background information, this study
increasingly important issue in mobile real-time sys- considers peripheral energy consumption as the primary
tems. The energy consumption of complementary metal factor in the energy consumption of the entire system.6
During exploration of the principles, mechanisms, and
oxide semiconductor (CMOS)-integrated processing
strategy of hard real-time task scheduling appropriate
chips has two main aspects: capacitor power consump-
for mobile terminal equipment, we establish a relevant
tion and leakage current power consumption.3,4
system model composed of the processor, tasks, and the
Modern integrated chip technology generally uses vol-
total energy consumption of the system. We propose a
tage/frequency regulation and dynamic power manage-
new optimal energy-saving algorithm for the hard real-
ment (DPM) technology to reduce power consumption.
time task scheduling of mobile terminals. The feasibility
In general, the dynamic energy consumption decreases
and validity of this algorithm is demonstrated through
with decreasing central processing unit (CPU) fre-
experiments and simulations that assess the power con-
quency. However, for a mobile terminal, chip energy
sumption of a mobile health-monitoring wristwatch
management is only one component in energy-
that implements the proposed algorithm and the EDF
management concern because the chip controls the
algorithm.
external devices through the interface. In fact, most of
the interrupted tasks processed by the system are inter-
related with management of external equipment run Article structure
states.5
Generally, the energy consumption of these periph- In this article, the algorithm is introduced in five main
erals accounts for 25%–95% of the energy consump- parts. The first part introduces the current situation
tion of the entire system. In the working mode of and main research objectives, the second part reviews
intelligent mobile health-monitoring equipment, life related work, and the third part describes the system
detection sensors and life signal processing modules model. Because the scheduling of tasks is a complicated
consume 50% of the energy of the overall system, process involving many factors in the hardware and
whereas in standby mode, the energy consumption of software systems, it is necessary to establish a theoreti-
the processor is 75% of the total system consumption. cal model to strictly define the quantity of and logical
Operating data obtained from the MWatch health- relationship between the components and to establish a
monitoring wristwatch show that in the working mode, theory for discussing the scheduling algorithms of the
the operating current of the bi-signal front-end process- system. The fourth part focuses on the scheduling algo-
ing RC network and the active power amplifier chip is rithm. Using three theorems, the theoretical basis of the
17 mA, and the current consumption of the power reg- scheduling algorithm and the correctness of the algo-
ulation management module is 1.5 mA. The organic rithm are presented, and the concrete algorithm is out-
light-emitting diode (OLED) display consumes 25 mA, lined. The fifth part is the experimental and simulation
the average operating current of the capacitive touch results that verify the correctness and feasibility of the
screen is 2.5 mA, and the operating current of other algorithm. The sixth part provides the conclusions.
external devices is approximately 0.5 mA. The peak
current of the processor is 12 mA. Therefore, it can be
Related work
estimated that the power consumption of the processor
in the working state accounts for only 20.5% of the To improve the efficiency of real-time periodic task sys-
consumption of the overall system. tems, a common real-time task model was proposed,7
Peng and Wang 3

which allowed the end time and cycle time of a periodic systems. The algorithm improves the performance of
task to be changed over a given period of time. The sys- their genetic algorithm through a significant change to
tem efficiency was improved, and both the EDF and the genetic function, and the introduction of a new
LSF algorithms were further optimized by accelerating operator, ensuring consistent coverage of sample vari-
the speed of task scheduling and reducing the waiting ety and the whole space. In addition, the random initial
time through timely adjustment of task deadlines and population has been replaced by some fixed initial pop-
periods under the condition of ensuring the normal ulation, with a partially optimized solution, to reduce
operation of system scheduling.8 Burns and other the reproducibility of the genetic algorithm. Compared
researchers proposed a scheduling strategy based on a with other task-scheduling algorithms, the new algo-
weight (priority) value.9 This strategy performed some rithm is applicable to the practical application of het-
tasks from the task set selectively to ensure that the sys- erogeneous computing systems with extensive
tem had the best overall weight value. To increase the characteristics. The results show that the proposed
unit weight value of the system, the task weight density algorithm results in significant improvements. In order
was determined according to the maximum execution to deal with the scheduling of tasks on heterogeneous
time and the task weight, and then the highest value systems, M Akbari and H Rashidi14 proposed an algo-
density first (HVDF) algorithm was proposed, using rithm that reduces the execution time while allowing
the maximum weight density, to prioritize the execution maximum parallelization. The algorithm is based on
of tasks in order to contribute the highest weights to the multi-objective scheduling azalea optimization algo-
the system.8 rithm (MOSCOA). In this algorithm, each cuckoo rep-
J Liu and J Guo10 studied the energy efficiency sche- resents a dispatch solution, which takes into account
duling of periodic real-time tasks on multi-core proces- the tasks assigned to them, along with the order of the
sors with voltage islands and proposed a voltage processors. By the target migration operator in the
maximum capacity first (voltage island largest capacity algorithm to complete global optimization, and push
first (VILCF)) algorithm for energy-efficient scheduling each repetitive plan to an optimized plan to protect the
of periodic real-time multi-core processors. This global optimal, MOSCOA realizes a large number of
achieved better energy efficiency, by making full use of random graphs, and realistic applications, whose
the remaining capacity of each island, before opening graphs possess extensive features and show that
more islands or increasing the voltage level of the cur- MOSCOA is superior to the previous task-scheduling
rent active island. The experimental results show that algorithm. D Konar et al.15 studied the efficient real-
VILCF is superior to the existing algorithm when there time task scheduling assisted by a hybrid quantum-
are multiple cores in the voltage island. K Li11 exam- inspired heuristic genetic algorithm (HQIGA) in a mul-
ined how the core allocates tasks and schedules tasks, tiprocessor environment. The HQIGA method uses a
when multiple processors of cloud computing data cen- revolving door operation to explore the variable chro-
ters are shared by a large number of concurrent tasks, mosomes described in the qubit of the Hilbert hyper-
in order to minimize energy consumption. By adding space. Simulation results show that HQIGA is superior
the constant velocity method into the algorithm, the to both the classical genetic algorithm (CGA) and
performance of the scheduling algorithm is improved mixed particle swarm optimization (MPSO) in the use
further. M Fan et al.6 proposed an on-line power man- of numerous codes and achieves significant improve-
agement method to minimize the power consumption ments in the scheduling time.
of single-processor real-time scheduling under reliabil-
ity constraints. The simulation results show that using
runtime kinetics, the proposed method can save more System model
energy than using previous work under reliability
constraints. The author is a core member of the mobile health-
HE Zahaf et al.12 focus on real-time scheduling monitoring system key technology project research
based on dynamic voltage and frequency scaling team and presided over the research and development
(DVFS). They present a model of the performance and of an intelligent health care watch. The developed intel-
energy consumption of parallel real-time tasks carried ligent health care watch is an intelligent terminal that
out on the ARM big LITTLE architecture. The optimi- offers real-time electrocardiography (ECG) monitoring
zation problem is first defined as an integer nonlinear in which ECG information can be extracted, detected,
programming (INLP) problem, and then, a heuristic and analyzed and sent to a remote server through Wi-
method is proposed in order to find an effective solu- Fi for further processing. As shown in Figure 2, the
tion to the problem. The results show that the method optimal real-time scheduling problem is an important
has a good energy-saving effect. M Akbari et al.13 used sub-task of the project. For intelligent mobile terminal
a genetic algorithm to solve the static task-scheduling equipment, certain external devices are driven by the
problem of processors in heterogeneous computing firmware, such as the display, capacitive touch screen,
4 International Journal of Distributed Sensor Networks

Figure 2. System structure of the mobile health-monitoring watch.

FLASH, and medical sensors, among others. Each time


that the device is initialized, the operating system needs
only to perform an interrupt call on the line. Selected
external devices have a single feature that does not
require a firmware-driven peripheral, such as a power
management chip similar to the power-gating header.
However, for the system, the same calls to the firmware
are made via external interrupts that can be abstracted
into a class of external interrupt devices for unified
management.16

Processor model
Assuming a single-processor system with an operating
Figure 3. Processor energy consumption versus clock
frequency v, we denote pd (v) as the dynamic power con-
frequency.
sumption at runtime, which primarily derives from the
power consumption caused by the gate charge, the dis-
charge capacitance, and the short-circuit power con- shown in Figure 3. The energy consumption of a pro-
sumption caused by the short-circuit transient current. cessor that performs a single clock cycle at frequency v
It is well known that pd (v) is proportional to the third is p(v)=v = av2 + b=v. The value of v for which p(v)=v
power of v, which can be represented as pd (v) = av3 . attains a minimum value is denoted as the critical fre-
This statement means the static power consumption quency. Without consideration of processor perfor-
ps (v), which is independent of v, is primarily due to the mance, it is clear that the minimum energy
leakage power consumption generated by the leakage consumption is obtained at the lower bound of v.
current. In general, ps (v) is a constant, and we set The processor has two states: the sleep state and the
ps (v) = b. Therefore, the processor power function is active state. When the processor is in the sleep state,
p(v) = pd (v) + ps (v) = av3 + b, a.0, b  0. This pro- DPM can turn off the processor clock to reduce the
cessor power consumption model applies to multiple processor voltage to a very low level. At that time, the
dynamic voltage frequency scaling (DVFS) processors, power consumption of the device is negligible.17 A pro-
and pðvÞ is a strictly convex increasing function, as cessor that is executing a task is in the active state.
Peng and Wang 5

When the processor is idle in the active state, the mini- Gt1 , t2 = sRt1 ^T + D  t2 (G)
ð2Þ
mum power consumption processor executes the idle = fjjj 2 G ^ j½ R  t 1 ^ j½T + j½D  t 2 g
operation instruction at a very low frequency.18
We denote the idle power consumption as pidle and
assume that it is not less than the minimum possible Definition 7. jkey 2 Gt1 , t2 if it satisfies jkey ½R + jkey ½D
power consumption of the processor at the lower = minfjj ½R + jj ½D0  j  s, jj 2 Gt1 , t2 g, and jkey is
bound of v, denoted in this work as pmin such that the key tuple of Gt1 , t2 . If the subsequence j01 , j02 , . . . , j0r
pidle  pmin . When the period during which the proces- of Gt1 , t2 , which does not include jkey , satisfies
sor sits idle is greater than the maximum idle period tu , t1  ji ½T  + ji ½C  ji + 1 ½T , jr ½T  + jr ½C  t 2 , then the
the processor is placed in the sleep state. Setting Esw as subsequence is referred to as a feasible scheduling of
the energy consumption required for the processor to Gt1 , t2 that is relative to jkey and is denoted as
switch between operating states and tsw as the time cost SCGt1 , t2 (jkey ).
of state switching, the process of switching the operat- This work considers two sets of tasks. One set is rep-
ing state is energy efficient when (tu  tsw )Pidle  Esw resented by the hard real-time periodic task set
such that tu  Esw =Pidle + tsw . Obviously, if the energy GT (R, T, P, C, D), where P indicates the power con-
savings increase, the longer the processor resides in the sumed by the peripherals of the task while waiting for a
sleep mode. time Dt at idle for scheduling. Setting the peripheral
operating current associated with the process as I and
the operating voltage is U, P = UIDt, and the total
Task model energy consumed by a hard-cycle task set P peripheral
Definition 1. G(R, T , P, C, D) represents a task model, during a super cycle of a task is EH = Nk= 1 pk Dtk .
where R is the time when the task is released, T is the For the intelligent health-monitoring wristwatch devel-
time when the task is scheduled, P is the power con- oped in this study, most of the hard real-time tasks are
sumed when the task is waiting, C is the time required related to peripherals or sensors. For example, in
to execute the task, and D is the final deadline for the module-related ECG monitoring data acquisition tasks,
task to be completed. We refer to G as a real-time task the digital-to-analog converter generates a hard inter-
set, and j 2 G indicates that j is a task entity in the task rupt after the acquisition and conversion of a segment
set. According to Definition 1, each j has five attribute of data. At the same time, the ECG module remains in
components, where, for example, j½R represents the the active state and consumes 3.3 V 3 17 mA of
time component when the task is released. power at idle. The ECG module resides in a waiting
mode until the CPU sets the general-purpose input/out-
put (GPIO) control register state to turn off the power
Definition 2. Given a task set G(X , Y ), where X and Y supply of the RC network. If each waiting time of this
are attribute fields of G, when j½X  = §, the image set of task is Dt = 500 ms and the ECG sampling frequency is
§ in Z is Z§ = fj½Zjj 2 G, j½X  = §g. 200 Hz, then the power consumption due to scheduling is
P = (200 Hz 3 0.5 ms 3 3.3 V 3 17 mA)/1000 =
Definition 3. The task projection operation p forms a 5.61 mW. The second hard real-time random task set
new task set from several attribute columns selected GO (R, T, P, C, D) does not consider cycles.
from G and is denoted as pA (G) = fj½Ajj 2 Gg.
Energy consumption model
Definition 4. The task selection operation s forms tasks P
Definition 8. PWSCGt, d (j1 ,j2 , ..., jr ) = ri= 1 ji ½P, where
selected from G that satisfy a given condition and is PWSCGt,d (j1 ,j2 , ..., jr ) is denoted as the power output of
denoted as sF (G) = fjjj 2 G ^ F(j) = ‘‘true’’g. the feasible scheduling SCGt, d (j1 ,j2 , ..., jr ).

Definition 5. Gt is a subset of the tasks that enter the Definition 9. PCSCGt, d (j1 , j2 , . . . , jr ) is denoted as the
scheduling process at the moment t and is denoted as power loss of the feasible scheduling
SCGt, d (j1 , j2 , . . . , jr ) if
Gt = sRt (G) = fjjj 2 G ^ j½ R  t g ð1Þ
X
r X
i1
PCSCGt, d (j1 , j2 , . . . , jr ) = (ji ½P jj ½C)
Definition 6. Gt1 , t2 is the subset of tasks that enter the i=2 j=0
scheduling process at the moment t1 and that have ð3Þ
X X
r
absolute deadlines greater than or equal to t2 . It is + ji ½P jj ½C
denoted as ji 2Gt, d ^ji 62SCGt, d j=0
6 International Journal of Distributed Sensor Networks

!
Definition 10. In addition to the condition of Definition X
k 1 X
k1

9, if SCGt, d (j1 , j2 , . . . , jr ) also satisfies jk ½P ji ½C + jk + 1 ½P ji ½C + jk + 1 ½C


i=0 i=0
!
SCGt, d (j1 , j2 , . . . , jr ) X
k 1 X
k 1
ð4Þ  jk + 1 ½P ji ½C + jk ½P ji ½C + jk + 1 ½C
= MIN (SCGt, d (j01 , j02 , . . . , j0m ), j0k 2 Gt, d ) i=0 i=0

then we denote this feasible scheduling as the optimal ð5Þ


energy-saving scheduling OPESGt, d (j1 , j2 , . . . , jr ).
must be met. After expanding equation (5), we obtain
This work does not consider the energy consumption
the following inequality
costs of switching between the active and sleep states of
processors, and only a single-processor environment is X
k 1 X
k 1
considered. Based on this assumption, it is proposed jk ½P ji ½C + jk + 1 ½P ji ½C + jk + 1 ½Pj½C
that the OPESGt, d (j1 , j2 , . . . , jr ) assigning all tasks in i=0 i=0
the task set to the same processor must satisfy the fol- X
k 1 X
k 1
lowing properties.  jk + 1 ½P ji ½C + jk ½P ji ½C + jk ½Pjk + 1 ½C
i=0 i=0
ð6Þ
Theorem 1. For S = (t1 , t2 , . . . , tk , tk + 1 . . . ), where
tk = (Rk , Tk , Ck , Pk , Dk ) and tk + 1 = (Rk + 1 , Tk + 1 , The elimination of equivalent terms yields
Ck + 1 , Pk + 1 , Dk + 1 ) in a feasible scheduling sequence,
the necessary and sufficient conditions are jk + 1 ½Pjk ½C  jk ½Pjk + 1 ½C ð7Þ

1. Tk + Ck  Rk + Dk , Tk + 1 + Ck + 1  Rk + 1 This statement can also be written as


+ Dk + 1 jk ½P=jk ½C  jk + 1 ½P=jk + 1 ½C, and therefore, the pro-
2. Tk + Ck  Rk + 1 + Dk + 1  Ck + 1 position is proven.

Proof. The necessity is obvious, and we only discuss the


Energy-saving optimal scheduling
adequacy here. Because of the limitations
Tk + Ck  Rk + Dk , each task can be completed by the algorithm
deadline. Because Tk + Ck  Rk + 1 + Dk + 1  Ck + 1 , we Theoretical basis of the algorithm
assume that the (k + 1)th task enters the scheduling
operation immediately after the kth task is completed. Definition 11. rk = jk ½P=jk ½C and is denoted as the
The deadline of the (k + 1)th task is Tk + Ck + Ck + 1 . power factor for a task item. Obviously, in the schedul-
Because the deadline of the (k + 1)th task is able case, the priority of the scheduling increases with
Rk + 1 + Dk + 1 , the task-scheduling constraint condition increasing rk .
must only satisfy Tk + Ck + Ck + 1  Rk + 1 + Dk + 1 .
This statement is exactly equivalent to equation (2) of
Theorem 3. We use rk as the priority, ranging from high
Theorem 1. Therefore, the adequacy is proven.
to low, for scheduling to be implemented in task set
Gt, d . If the resulting feasible scheduling sequence satis-
Theorem 2. In the OPESGt, d (j1 , j2 , . . . , jr ), the condition fies PWSCGt, d (j1 , j2 , . . . , jr ) = MAX (PWSCGt, d (j01 , j02 , . . . ,
jk ½P=jk ½C  jk + 1 ½P=jk + 1 ½C must be satisfied. jm )), j0k 2 Gt, d , then the scheduling sequence must also
satisfy condition (4), and this scheduling represents the
Proof. Because j1 . . . jk , jk + 1 . . . jr is the optimal OPESGt, d (j1 , j2 , . . . , jr ).
energy-saving scheduling of task set Gt, d ,
j1 . . . jk , jk + 1 . . . jr must be a feasible scheduling, and
Proof. We prove this statement by the method of coun-
the sequence j1 . . . jk + 1 , jk . . . jr generated by the
terevidence. Suppose SCGt, d (j1 , j2 , . . . , jr ) does not sat-
exchange in the orders of two elements is also a feasible
isfy OPESGt, d (j1 , j2 , . . . , jr ), and when jr .j0r ,
scheduling SCGt, d (j1 . . . jk + 1 , jk . . . jr ). By Definition 9,
SCGt, d (j1 , j2 , . . . , j0r ) satisfies
the power loss for optimal scheduling is given by equa-
tion (3). Compared with equation (3), the power loss of
PCSCGt, d (j1 , j2 , . . . , jr )  PCSCGt, d (j1 , j2 , . . . , j0r ) ð8Þ
SCGt, d (j1 . . . jk + 1 , jk . . . jr ) has only two differences,
which
P are described
Pk1 as follows: jk + 1 ½P
k1 Thus, by definition, the following inequality is met
i=0 i j ½C + j k ½P( i=0 i j ½C + j k +1 ½C).
Because OPESGt, d (j1 , j2 , . . . , jr ) fulfills condition
equation (4) by Definition 10, the condition
Peng and Wang 7

X
r1 X
i1   X
r1 Inference 1. We assume rk as a fixed priority, and a
ðji ½PÞ jj ½C + jr ½P jj ½C schedule in task set Gt, d is implemented according to
i=2 j=1 j=1
the rate-monotonic scheduling (RM) algorithm. The
X
r X X
r
+ j0 r ½P jj ½C + ji ½P jj ½C sequence SCGt, d (j1 , j2 , . . . , jr ) obtained is not necessa-
j=1 ji 6¼j0 r ^ji 2Gt, d ^ji 62SCGt, d j=1 rily the OPESGt, d (j1 , j2 , . . . , jr ).

X
r1 X
i1   X
r1
 ðji ½PÞ jj ½C + j0 r ½P jj ½C Proof. Let jr be the last element in the resulting schedul-
i=2 j=1 j=1
ing sequence according to the RM algorithm, that is,
X
r X X
r
+ jr ½P jj ½C + ji ½P jj ½C jr + 1 2 Gt, d , jr + 2 2 Gt, d and rr  rr + 1  rr + 2 .
j=1 ji 6¼jr ^ji 2Gt, d ^ji 62SCGt, d j=1 Depending on the definition, the following conditions
might exist
ð9Þ
jr ½C  jr + 1 ½C + jr + 2 ½C  d  jr ½T 
Eliminating equivalent terms on both sides of the ð15Þ
inequality yields jr ½P  jr + 1 ½P + jr + 2 ½P

X
r1 X
r This statement indicates that a new schedule can be
(jr ½P  j0r ½P) jj ½C  (jr ½P  j0r ½P) jj ½C ð10Þ constructed with a substitution of jr + 1 , jr + 2 for jr and
j=1 j=1 that PWSCGt, d (j1 , j2 , . . . , jr + 1 , jr + 2 ) must be greater
than PWSCGt, d (j1 , j2 , . . . , jr ). Therefore, an appropriate
Setting jr ½P  j0r ½P, we draw the conclusion jr + 1 ½C, jr + 2 ½C exists such that
X
r1 X
r
PWSCGt, d (j1 , j2 , . . . , jr + 1 , jr + 2 )  PWSCGt, d
jj ½C  jj ½C ð11Þ ð16Þ
j=1 j=1 (j1 , j2 , . . . , jr ), jk 2 Gt, d

By definition, jj ½C.0, jj 2 Gt, d , and therefore, the


above conclusion cannot be established, and the propo-
Inference 2. Scheduling in task set Gt, d is implemented
sition is proven. Because OPESGt, d (j1 , j2 , . . . , jr ) satis-
according to the EDF algorithm, and the resulting
fies condition (4), the condition
SCGt, d (j1 , j2 , . . . , jr ) is not necessarily the
! OPESGt, d (j1 , j2 , . . . , jr ).
X
k1 X
k1
jk ½P ji ½C + jk + 1 ½P ji ½C + jk + 1 ½C
i=0 i=0
! Verification. This inference is easily verified because from
X
k 1 X
k 1
 jk + 1 ½P ji ½C + jk ½P ji ½C + jk + 1 ½C Definition 5, Gt, d = sRt^Dd (G) = fjjj 2 G ^ j½R 
i=0 i=0 t ^ j½D  d:g. Because every task in task set Gt, d can
ð12Þ be completed within the deadline d, the proposition
becomes an RM scheduling problem.
must be met. After expanding the above, we obtain the As discussed, this study considers the optimal
following inequality energy-saving scheduling process. After scheduling the
task items from high to low priority according to the
X
k 1 X
k 1 energy consumption factor, the optimal energy-saving
jk ½P ji ½C + jk + 1 ½P ji ½C + jk + 1 ½Pj½C solution is obtained by constructing a scheduling
i=0 i=0
sequence in a step-by-step manner. Assuming an order
X
k 1 X
k1
of decisions j1 , j2 , . . . , jn , after making the decision ji ,
 jk + 1 ½P ji ½C + jk ½P ji ½C + jk ½Pjk + 1 ½C
i=0 i=0
the problem involves one of the following choices: ji is
ð13Þ abandoned, and the state remains unchanged, or ji is
retained as the solution element of the optimal
Elimination of equivalent terms yields sequence, and the state vector changes accordingly, as
follows
jk + 1 ½Pjk ½C  jk ½Pjk + 1 ½C ð14Þ
PWSCGt, d (j1 , j2 , . . . , ji ) = PWSCGt, d
This statement can also be written as ð17Þ
(j1 , j2 , . . . , ji1 ) + ji ½P
jk ½P=jk ½C  jk + 1 ½P=jk + 1 ½C. Therefore, the proposi-
tion is proven.
8 International Journal of Distributed Sensor Networks

PCSCGt, d (j1 , j2 , . . . , ji ) = PCSCGt, d OPESSCGt, d (j1 , j2 , . . . , jr )


ð21Þ
X
i1 X
r = MIN(PCSCGt, d (j01 , j02 , . . . , jm )), j0k 2 Gt, d
(j1 , j2 , . . . , ji1 ) + ji ½P jj ½C  ji ½P jj ½C
j=0 j=0
This type of dynamic planning and scheduling algo-
ð18Þ rithm is herein denoted as a decisive path scheduling
(DPS) algorithm.
P
Definition 12. Let Oi = d  ij = 0 jj ½C, Oi = Oi1 
ji ½C. The resulting sequence from the decision of the
kth step is (j01 , j02 , . . . , j0r ), and FPk (Ok ) represents the DPS algorithm
subsequent power output value of the sequence, that is, In this article, we clarify the function of the DPS algo-
FPk (Ok ) = PWSCGt, d (j01 , . . . , j0k ). Each step requires two rithm using an example and present the main steps. Let
different decisions that must be integrated. According a set of tasks Gt1 = 102, t2 = 109 exist, as listed in Table 1.
to Definition 9, this process can be expressed as Because j4 is the deadline’s earliest critical tuple, j4
must be scheduled at the time when
FPk (Ok ) = MAX (FPk1 (Ok1 ), FPk1 j4 ½T  = t + d  j4 ½C = 108. The prerequisite is to
ð19Þ
(Ok1  jk ½C) + jk ½P) obtain the optimal energy-saving scheduling
SCGd1, d2 (j4 ). Because j6 is less than r4 , the j6 tuple is
Obviously, this example is a process of optimal selec-
excluded from the scheduling. Therefore, we obtain the
tion. If it can be guaranteed that FPk1 (Ok1 ) is an opti-
sequence (j5 , j1 , j3 , j2 ), which is scheduled in the time
mal choice, then FPk (Ok ) can be treated as an optimal
period18 according to the value of r from high to low.
choice based on the previous optimal decision, and the
In this example, we consider the following step-by-step
result is obviously optimal.
process based on the initialization sequence
S0 = ff;g, FP0 (0) = 0g.
Theorem 4. According to equation (19), and based on For the first step, we perform decision making on
recursive relations, we make a dynamic decision from j5 : abandon j5 , FP1 (0) = FP1 (0) = 0; accept j5 ,
the sequence represented by FP0 (O0 ). The result must FP1 (j5 ½C) = FP1 (4) = 20; merge them and obtain the
be optimal. solution set

Proof. The following holds from Definition 9 S1 = fff;g, FP1 (0) = 0)g, ffj5 g, FP1 (4) = 20)gg ð22Þ

For the second step, we perform decision making on


FPk (Ok ) = PWSCGt, d (j01 , . . . , j0k )
j1 : abandon j5 , FP2 (0) = 0, FP2 (4) = 20; accept j1 ,
= MAX(FPk1 (Ok1 ), FPk1 (Ok1  jk ½C) FP2 (3) = 12, FP2 (7) = 32; merge them and obtain the
+ jk ½P) ð20Þ solution set
 
We define the maximization conditions for solving ff;g, FP2 (0) = 0)g, ffj5 g, FP2 (4) = 20)g
the problem MAX(PWSCGt,P (j01 , . . . , j0k )) and the prob- S2 =
d ffj1 g, FP2 (3) = 12)g, ffj1 , j5 g, FP2 (7) = 32)g
lem constraints Oi = d  ij = 0 jj ½C  0. We specify
ð23Þ
the steps needed to solve the problem and make sche-
duling decisions according to the tuple sequence For the third step, we perform decision making on
rk = jk ½P=jk ½C from high to low priority. This method j3 : abandon j3 , the solution set is j3 , and we obtain s2
of solving problems is consistent with the principle of and accept j3 to obtain the solution set
optimization, where regardless of the initial state of the
process and whatever the initial decision, the remaining  
decision-making process constitutes an optimal decision ffj3 g, FP3 (3) = 9)g, ffj3 , j5 g, FP3 (7) = 29)g
S30 =
ffj1 , j3 g, FP3 (6) = 21)g, ffj1 , j5 , j3 g, FP3 (10) = 41)g
sequence relative to the initial state. Thus, the result
must be optimal. In other words, we can obtain a solu- ð24Þ
tion vector satisfying MAX(PWSCGt, d (j01 , . . . , j0k )).
According to Theorem 2, this statement is equivalent to where the solution set ffj1 , j5 , j3 g, FP3 (10) = 41)g
finding a solution passes beyond the domain of the problem, 0  O  7
and is discarded. After merging S3 and S30 , we obtain
the solution set

 
ff;g, FP3 (0) = 0)g, ffj5 g, FP3 (4) = 20)g, ffj1 g, FP3 (3) = 12)g, ffj1 , j5 g, FP3 (7) = 32)g
S3 = ð25Þ
ffj3 g, FP3 (3) = 9)g, ffj3 , j5 g, FP3 (7) = 29)g, ffj1 , j3 g, FP3 (6) = 21)g
Peng and Wang 9

Table 1. Task set example.

G R T C P D r

j1 100 t 3 12 13 4.0
j2 100 t 2 5 11 2.5
j3 101 t 3 9 9 3.0
j4 101 t 1 2 8 2.0
j5 102 t 4 20 10 5.0
j6 102 t 10 15 9 1.5

For the fourth step, we perform decision making on Analysis of the DPS algorithm
j2 : abandon j2 , the solution set is S3 and accept j2 and We denote the power consumption of each task by
by excluding the solution that passes beyond the estab- ji ½P. The space P complexity of the
lished domain, we obtain the solution set P DPS algorithm
i n
is
determined as 0\i\n1 jSi j = 0\i\n1 2 = 2  1
  and is O(2n ). If the generation of Si by Si1 requires a
ffj2 g, FP3 (2) = 5)g, ffj5 , j2 g, FP3 (6) = 25)g
S40 = time FðjSi1 jÞ, then Pthe calculated total time of
ffj1 , j2 g, FP3 (5) = 17)g
S1 , S2 , . . . , Sn1 is F( jSi1 j). However, there exists
ð26Þ jSi j  2i such that the total number of operations of the
Si tuple ji and its time cost ji ½C are expressed as inte-
After merging S3 , S40 , we obtain the solution set gers. Therefore, the elements in each of the ordered
8 9
>
> ff;g, FP3 (0) = 0)g, ffj2 g, FP4 (2) = 5)g >
>
pairs Si should be integers, which
P P yields jSi j  1 +
< = 0\i\n1 i j ½P and j Si j  1 + minf 0\i\n1 j i ½C, Og.
ffj1 g, FP4 (3) = 12)g, ffj5 g, FP4 (4) = 20)g
S4 = In this case, the time and space complexity of DPS is
>
> ffj1 , j2 g, FP3 (5) = 17)g, ffj5 , j2 g, FP3 (6) = 25)g >
>
: ;
ffj1 , j5 g, FP4 (7) = 32)g ( )!
X
ð27Þ n
O min 2 , n ji ½C, nO ð28Þ
0\i\n
From S4 , FP4 (7) = 32 can be easily obtained as the
optimal solution, and the optimal energy-saving solu- The above analysis indicates that the performance of
tion set is fj1 , j5 g. The main steps of the DPS algorithm the DPS algorithm is unsatisfactory when n is large.
are given as follows. However, viewed from the perspective of practical use,
the number of real-time scheduling tasks for mobile
portable devices is limited. According to statistics
Algorithm 1. DPS.

(1) For i = 1 to N2 1 do
(2) S0 = S ;
(3) u = jS0 j;
(4) For j = 1 to u do
(5) If Oi1, j + ji ½C  O then
(6) Oi1, j = Oi1, j + ji ½C; FPi (Oi, j ) = FPi (Oi, j ) + ji ½C
(7) k = 0;
(8) While Oi1, k  Oi, j and FPi1 (Oi1, k )\FPi (Oi, j ) do
(9) k = k + 1;
(10) End while
(11) If k \ u and Oi1, k  Oi, j FPi1 (Oi1, k )\FPi (Oi, j ) then
(12) S0 = S0  S0k ;
(13) Else if k = u then
(14) S0j = S0j [ ji ;
(15) End if
(16) End if
(17) End for (j)
(18) S = Merge(S0 , S);
(19) End for (i)
(20) Output(S);
10 International Journal of Distributed Sensor Networks

obtained for the MWatch health-monitoring wrist-


watch in the working state, in a period of 1024 clock
cycles, the hard real-time tasks generated by the system
range from 0 to 7, which indicates that the most serious
scheduling calculations for the current system are
27 = 128, which is acceptable. In practice, a stricter
and finer rule can eliminate a large number of unneces-
sary intermediate results in advance, and the algorithm
converges rapidly.19
We further discuss the functioning of hard real-time
scheduling algorithms based on the DPS algorithm, as
follows. First, we fully sort the hard real-time task set
Gt (j1 , j2 , . . . , jn ) according to the deadline and obtain
the scheduling tasks set Gt1 , t2 . Second, we apply the
DPS algorithm to process Gt1 , t2 and obtain Figure 4. Real-time system energy consumptions of the
OPESGt, d (j1 , j2 , . . . , jr ). Finally, we update G according GS2011M-based health wristwatch.
to the scheduling result. If Gt is null, the algorithm
ends; otherwise, the above-mentioned steps are Experimental and simulation results
repeated. This algorithm is denoted herein as the hier-
Through ‘‘Key technology of a mobile health-
archical reliability-driven scheduling (HRDS) algo-
monitoring watch’’ project, we performed a number of
rithm. The steps of the HRDS algorithm are given as
comparative experiments using the proposed algo-
follows.
rithm in the mobile-embedded platform shown in
Figure 4 and fully verified its effectiveness and feasi-
Algorithm 2. HRDS. bility in this platform. The platform chip is based on

INPUT: Gt (j1 , j2 , . . . , jn ), S = ;
(1) t 1 = t, t2 = j1 ½R + j1 ½D  j1 ½C;
(2) Gt1 , t2 = sRt1 ^T + D  t2 (G) = fjjj 2 G ^ j½R  t 1 ^ j½T + j½D  t2 g
(3) S = S [ OPESGt, d (j1 , j2 , . . . , jr ) = DPS(Gt1 , t2 )
(4) If Gt1 , t2  OPESGt, d (j1 , j2 , . . . , jr ) 6¼ ;
(5) Gt (j1 , j2 , . . . , jn ) = Gt1 , t2  OPESGt, d (j1 , j2 , . . . , jr )
(6) Repeat steps (1) to (4);
(7) END IF
OUTPUT(S)

Theorem 5. For the schedulable task set the GainSpan GS2011M module, which uses an
SCGt, d (j1 , j2 , . . . , jr ), the output S after completion of ARMÒ CortexÒ M3 two-core CPU, where one core is
the HRDS algorithm is an optimal energy-saving sche- used for Wi-Fi wireless communications and the other
duling, that is, S = OPESGt, d (j1 , j2 , . . . , jr ). for Application processing. The hard real-time tasks
listed in Table 2 were performed during stress testing
of the algorithm.
Proof. From the arithmetic operation process, we Table 3 shows the real-time process set abstract for
observe that S = S1 [ S2 [ , . . . , Sm and the real-time task set. A portion of the task exists
Sk = OPESGt, d (j1 , j2 , . . . , jr ). For any tuple, ji must because the release time is random, and another por-
appear in a subset Sj assuming ji 2 Sj0 , tion of the task is released in accordance with the fixed
0 0
S = S1 [ S2 [ , . . . , Sj , . . . , Sm exists, and operating cycle. Thus, the task of release time must be
PCSCGt, d (S)  PCSCGt, d (S 0 ). This statement indicates that treated as a random time for dynamic processing. The
PCSCGt, d (S)  PCSCGt, d (S 0 ), which obviously contradicts system maintains a queue S that has been scheduled
the nature of the DPS algorithm discussed earlier, thus and is waiting to run and an EDF queue G that waits
proving the energy-saving optimality of the HRDS for scheduling. When G is nonempty, the element j is
algorithm from a negative perspective. selected from the header of G to perform DPS
Peng and Wang 11

Table 2. Real-time process of the GS2011M health-monitoring platform.

Task number Task function Operating time (ms) Operating cycle (ms) Deadline (ms)

T1 Touch screen driver 125 20 1000


T2 LED switches 150 10 1000
T3 Power supply monitoring 28 8000 9000
T4 Signal monitoring 10 8000 9000
T5 FASH driver 65 20 1000
T6 ECG module control 20 No 5000
T7 SpO2 module control 15 No 5000
T8 ECG data reading and writing 75 50 500
T9 SpO2 data reading and writing 75 50 500
T10 Infrared light driver 15 20 100
T11 Pulse driver 12 200 100
T12 Power supply voltage regulator 28 No 9000

LED: light-emitting diode; ECG: electrocardiography.

Table 3. Real-time process set abstracted as a real-time task set.

G R T C P D r

j1 l1 t1 125 25 1000 0.20


j2 l2 t2 150 40 1000 0.27
j3 l3 t3 28 4 9000 0.14
j4 l4 t4 10 4 9000 0.40
j5 l5 t5 65 4 1000 0.06
j6 l6 t6 20 35 5000 1.75
j7 l7 t7 15 40 5000 2.67
j8 l8 t8 75 5 500 0.07
j9 l9 t9 75 3 500 0.04
j10 l10 t 10 15 3 100 0.20
j12 l11 t 11 12 30 100 2.50
j13 l12 t 12 28 6 9000 0.21

scheduling. If the optimal scheduling is satisfied, j is


moved from G to S and so on until it is empty. Because
the task j6 , j7 , j11 with a high-energy consumption factor
always maintains priority in processing of the HRDS
scheduling algorithm, although the energy consumption
of j6 , j7 , j11 accounts for nearly 1/2 of the total energy
consumption of the system, the energy consumption of
the system decreases rapidly, and thus, the advantages of
HRDS scheduling algorithm are quite obvious.
Figure 4 shows the energy consumption curves of the
GS2011M mobile platform environment in terms of the
kernel implementing the EDF scheduling algorithm and
the HRDS scheduling algorithm. According to the data, Figure 5. MATLAB simulation of real-time system energy
the energy consumption of the device is significantly consumption.
reduced with the HRDS scheduling algorithm, and the
average power consumption is only 37% of that with algorithm on the MATLAB platform and increased the
the EDF algorithm. The main reason for this result is number of hard real-time processes to 100. Figure 5
the high power consumption of the external equipment presents a comparison of the simulation data. In this
of the operating environment, which accounts for 79% case, compared with the actual environment, the data
of the total system power consumption, and thus, the effect is slightly worse, mainly because the number of
actual effect of using the HRDS algorithm is significant. tasks has increased, and therefore, CPU idle time is
We simulated the above environment with the EDF reduced and the ratio of peripheral power consumption
scheduling algorithm and the HRDS scheduling to CPU power consumption is decreased. However,
12 International Journal of Distributed Sensor Networks

compared with the energy consumption when using the leakage. In: Proceedings of the 2010 ACM symposium on
EDF algorithm, the average energy consumption with applied computing, Sierre, 22–26 March 2010, pp.9–14.
the HRDS algorithm is substantially less and is only New York: ACM.
61% of that of the EDF algorithm. Relatively, the 5. Zhang F and Chanson ST. Blocking-aware processor
effect is highly significant.20 voltage scheduling for real-time tasks. ACM T Embed
Comput S 2004; 3: 307–335.
6. Fan M, Han Q and Yang X. Energy minimization for
Conclusion on-line real-time scheduling with reliability awareness. J
Syst Software 2017; 127: 168–176.
The main goal of current hard real-time scheduling of
7. Jejurikar R and Gupta R. Energy-aware task scheduling
periodic and non-periodic tasks is to save energy while with task synchronization for embedded real-time sys-
ensuring the real-time completion of tasks. In this arti- tems. IEEE Trans Comput Aided Des Integrated Circ Syst
cle, we discussed the nature and effect of the energy 2006; 25: 1024–1037.
consumption factor in the case of peripheral energy loss 8. Jejurikar R and Gupta R. Energy aware non-preemptive
sensitivity. In addition, we introduced the basic idea of scheduling for hard real-time systems. In: Proceedings of
the algorithm and its basic theory and proposed an the 17th Euromicro conference on real-time systems, Palma
energy-saving priority scheduling algorithm. The de Mallorca, 6–8 July 2005, pp.21–30. New York: IEEE.
results from the experiments and simulations show that 9. Yan L, Luo J and Han K. Joint dynamic voltage scaling
HRDS can ensure real-time scheduling and minimize and adaptive body biasing for heterogeneous distributed
real-time embedded systems. IEEE Trans Comput Aided
energy consumption in the case of schedulable tasks.
Des Integrated Circ Syst 2005; 24: 1030–1041.
However, because the volume of the calculation is 10. Liu J and Guo J. Energy efficient scheduling of real-time
somewhat large, if the scale increases with the problem, tasks on multi-core processors with voltage islands.
it is expected to cause greater overhead to the system. Future Gener Comp Sy 2016; 56: 202–210.
11. Li K. Scheduling parallel tasks with energy and time con-
Acknowledgement straints on multiple manycore processors in a cloud com-
puting environment. Future Gener Comp Sy. Epub ahead of
Z.P. and G.W. conceived and designed the experiments, Z.P. print 11 January 2017. DOI: 10.1016/j.future.2017.01.010.
performed the experiments, G.W. analyzed the data and con- 12. Zahaf HE, Benyamina AEH, Olejnik R, et al. Energy-effi-
tributed analysis tools, and Z.P. wrote and edited the main cient scheduling for moldable real-time tasks on heteroge-
manuscript text. All authors reviewed the manuscript. neous computing platforms. J Syst Architect 2017; 74: 46–60.
13. Akbari M, Rashidi H and Alizadeh SH. An enhanced
Declaration of conflicting interests genetic algorithm with new operators for task scheduling
The author(s) declared no potential conflicts of interest with in heterogeneous computing systems. Eng Appl Artif Intel
respect to the research, authorship, and/or publication of this 2017; 61: 35–46.
article. 14. Akbari M and Rashidi H. A multi-objectives scheduling
algorithm based on cuckoo optimization for task alloca-
Funding tion problem at compile time in heterogeneous systems.
Expert Syst Appl 2016; 60: 234–248.
The author(s) disclosed receipt of the following financial sup-
15. Konar D, Bhattacharyya S, Sharma K, et al. An
port for the research, authorship, and/or publication of this arti-
improved Hybrid Quantum-Inspired Genetic Algorithm
cle: This research was supported by National Natural Science
(HQIGA) for scheduling of real-time task in multiproces-
Foundation of China (61632009, 61472451, 61272151, and
sor system. Appl Soft Comput 2017; 53: 296–307.
61462006), Natural Science Foundation of Hunan Province
16. Melhem R, Mosse D and Elnozahy E. The interplay of
(2017JJ5038) and the ‘‘Mobile Health’’ Ministry of Education -
power management and fault recovery in real-time sys-
China Mobile Joint Laboratory (MOE-DST No. [2012]311).
tems. IEEE T Comput 2004; 53: 217–231.
17. Saidani T, Piskorski S, Lacassagne L, et al. Paralleliza-
References tion schemes for memory optimization on the cell proces-
1. Saifullah A, Xu Y, Lu C, et al. Real-time scheduling for sor: a case study of image processing algorithm. In:
wirelessHART networks. In: Proceedings of the 31st Proceedings of the workshop on memory performance:
IEEE real-time systems symposium, San Diego, CA, 30 dealing with applications, Brasov, 16 September 2007,
November–3 December 2010, pp.150–159. New York: pp.9–16. New York: ACM Press.
IEEE. 18. Peng Z and Wang G. Study on parallel algorithm of
2. Vrimani D and Jain S. Real time scheduling with virtual wavelet transform based on MPSoC platform. Comput
nodes for self stabilization in wireless sensor networks. Eng Appl J 2017; 53(5): 67–74.
Int J Inform Tech Knowl Manag 2011; 4: 477–483. 19. Mathew M and Weng N. Adaptive sensor node sleep
3. Rhn J-H, Sun J-H, Kim K, et al. Utility accrual real-time scheduling for quality-of-experience enhancement. Int J
scheduling for (m, k)-firm deadline-constrained streams Distrib Sens N 2016; 2016: 6960876.
on multiprocessors. Electron Lett 2011; 47: 316–317. 20. Shi W, Wang J, Zhang H, et al. A new link scheduling
4. Yang C, Chen J, Thiele L, et al. Energy-efficient real- algorithm for 60 GHz-WPAN communication system.
time task scheduling with temperature-dependent Int J Distrib Sens N 2016; 2016: 6395385.

Das könnte Ihnen auch gefallen