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 optimization strategy to make scheduling decisions. The feasibility and validity of this algorithm are demonstrated through experiments and simulations.
Keywords
Research background
Research status of real-time task scheduling based on intelligent terminal systems
Mobile intelligent terminals that run a number of hard real-time tasks that must be completed within the specified time have relatively high requirements for real-time task scheduling. Failure to meet these requirements can result in the malfunction of systems such as traffic control systems and medical monitoring systems. Periodic real-time tasks must be executed once during each fixed period of time. For example, the signal analysis and diagnosis task of a medical monitoring system is a periodic real-time task. Given a task-scheduling algorithm, if the execution of each task can be completed within its deadline, the task scheduling is denoted as feasible. The earliest-deadline-first (EDF) scheduling algorithm determines the order in which tasks are run according to the deadline of task completion such that tasks with the earliest deadlines are run first. 1 The least-leisure-time-first (LSF) algorithm assigns the highest priority to the task with the shortest deadline to ensure that the most urgent tasks are executed first. Based on the EDF algorithm, Vrimani et al. 2 proposed a new scheduling 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 Things, intelligent embedded real-time systems have become increasingly critical. For mobile intelligent terminals, the power standby time has become a critical performance index, making energy management an increasingly important issue in mobile real-time systems. The energy consumption of complementary metal oxide semiconductor (CMOS)-integrated processing chips has two main aspects: capacitor power consumption and leakage current power consumption.3,4 Modern integrated chip technology generally uses voltage/frequency regulation and dynamic power management (DPM) technology to reduce power consumption. In general, the dynamic energy consumption decreases with decreasing central processing unit (CPU) frequency. However, for a mobile terminal, chip energy management is only one component in energy-management concern because the chip controls the external devices through the interface. In fact, most of the interrupted tasks processed by the system are interrelated with management of external equipment run states. 5
Generally, the energy consumption of these peripherals accounts for 25%–95% of the energy consumption of the entire system. In the working mode of intelligent mobile health-monitoring equipment, life detection sensors and life signal processing modules consume 50% of the energy of the overall system, whereas in standby mode, the energy consumption of the processor is 75% of the total system consumption. Operating data obtained from the MWatch health-monitoring wristwatch show that in the working mode, the operating current of the bi-signal front-end processing RC network and the active power amplifier chip is 17 mA, and the current consumption of the power regulation management module is 1.5 mA. The organic light-emitting diode (OLED) display consumes 25 mA, the average operating current of the capacitive touch screen is 2.5 mA, and the operating current of other external devices is approximately 0.5 mA. The peak current of the processor is 12 mA. Therefore, it can be estimated that the power consumption of the processor in the working state accounts for only 20.5% of the consumption of the overall system.

Mobile health-monitoring watch developed in this article for scheduling hard real-time tasks.
Based on this background information, this study considers peripheral energy consumption as the primary factor in the energy consumption of the entire system. 6 During exploration of the principles, mechanisms, and strategy of hard real-time task scheduling appropriate for mobile terminal equipment, we establish a relevant system model composed of the processor, tasks, and the total energy consumption of the system. We propose a new optimal energy-saving algorithm for the hard real-time task scheduling of mobile terminals. The feasibility and validity of this algorithm is demonstrated through experiments and simulations that assess the power consumption of a mobile health-monitoring wristwatch that implements the proposed algorithm and the EDF algorithm.
Article structure
In this article, the algorithm is introduced in five main parts. The first part introduces the current situation and main research objectives, the second part reviews related work, and the third part describes the system model. Because the scheduling of tasks is a complicated process involving many factors in the hardware and software systems, it is necessary to establish a theoretical model to strictly define the quantity of and logical relationship between the components and to establish a theory for discussing the scheduling algorithms of the system. The fourth part focuses on the scheduling algorithm. Using three theorems, the theoretical basis of the scheduling algorithm and the correctness of the algorithm are presented, and the concrete algorithm is outlined. The fifth part is the experimental and simulation results that verify the correctness and feasibility of the algorithm. The sixth part provides the conclusions.
Related work
To improve the efficiency of real-time periodic task systems, a common real-time task model was proposed, 7 which allowed the end time and cycle time of a periodic task to be changed over a given period of time. The system efficiency was improved, and both the EDF and LSF algorithms were further optimized by accelerating the speed of task scheduling and reducing the waiting time through timely adjustment of task deadlines and periods under the condition of ensuring the normal operation of system scheduling. 8 Burns and other researchers proposed a scheduling strategy based on a weight (priority) value. 9 This strategy performed some tasks from the task set selectively to ensure that the system had the best overall weight value. To increase the unit weight value of the system, the task weight density was determined according to the maximum execution time and the task weight, and then the highest value density first (HVDF) algorithm was proposed, using the maximum weight density, to prioritize the execution of tasks in order to contribute the highest weights to the system. 8
J Liu and J Guo 10 studied the energy efficiency scheduling of periodic real-time tasks on multi-core processors with voltage islands and proposed a voltage maximum capacity first (voltage island largest capacity first (VILCF)) algorithm for energy-efficient scheduling of periodic real-time multi-core processors. This achieved better energy efficiency, by making full use of the remaining capacity of each island, before opening more islands or increasing the voltage level of the current active island. The experimental results show that VILCF is superior to the existing algorithm when there are multiple cores in the voltage island. K Li 11 examined how the core allocates tasks and schedules tasks, when multiple processors of cloud computing data centers are shared by a large number of concurrent tasks, in order to minimize energy consumption. By adding the constant velocity method into the algorithm, the performance of the scheduling algorithm is improved further. M Fan et al. 6 proposed an on-line power management method to minimize the power consumption of single-processor real-time scheduling under reliability constraints. The simulation results show that using runtime kinetics, the proposed method can save more energy than using previous work under reliability constraints.
HE Zahaf et al. 12 focus on real-time scheduling based on dynamic voltage and frequency scaling (DVFS). They present a model of the performance and energy consumption of parallel real-time tasks carried out on the ARM big LITTLE architecture. The optimization problem is first defined as an integer nonlinear programming (INLP) problem, and then, a heuristic method is proposed in order to find an effective solution to the problem. The results show that the method has a good energy-saving effect. M Akbari et al. 13 used a genetic algorithm to solve the static task-scheduling problem of processors in heterogeneous computing systems. The algorithm improves the performance of their genetic algorithm through a significant change to the genetic function, and the introduction of a new operator, ensuring consistent coverage of sample variety and the whole space. In addition, the random initial population has been replaced by some fixed initial population, with a partially optimized solution, to reduce the reproducibility of the genetic algorithm. Compared with other task-scheduling algorithms, the new algorithm is applicable to the practical application of heterogeneous computing systems with extensive characteristics. The results show that the proposed algorithm results in significant improvements. In order to deal with the scheduling of tasks on heterogeneous systems, M Akbari and H Rashidi 14 proposed an algorithm that reduces the execution time while allowing maximum parallelization. The algorithm is based on the multi-objective scheduling azalea optimization algorithm (MOSCOA). In this algorithm, each cuckoo represents a dispatch solution, which takes into account the tasks assigned to them, along with the order of the processors. By the target migration operator in the algorithm to complete global optimization, and push each repetitive plan to an optimized plan to protect the global optimal, MOSCOA realizes a large number of random graphs, and realistic applications, whose graphs possess extensive features and show that MOSCOA is superior to the previous task-scheduling algorithm. D Konar et al. 15 studied the efficient real-time task scheduling assisted by a hybrid quantum-inspired heuristic genetic algorithm (HQIGA) in a multiprocessor environment. The HQIGA method uses a revolving door operation to explore the variable chromosomes described in the qubit of the Hilbert hyperspace. Simulation results show that HQIGA is superior to both the classical genetic algorithm (CGA) and mixed particle swarm optimization (MPSO) in the use of numerous codes and achieves significant improvements in the scheduling time.
System model
The author is a core member of the mobile health-monitoring system key technology project research team and presided over the research and development of an intelligent health care watch. The developed intelligent health care watch is an intelligent terminal that offers real-time electrocardiography (ECG) monitoring in which ECG information can be extracted, detected, and analyzed and sent to a remote server through Wi-Fi for further processing. As shown in Figure 2, the optimal real-time scheduling problem is an important sub-task of the project. For intelligent mobile terminal equipment, certain external devices are driven by the firmware, such as the display, capacitive touch screen, 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

System structure of the mobile health-monitoring watch.
Processor model
Assuming a single-processor system with an operating frequency v, we denote

Processor energy consumption versus clock frequency.
The processor has two states: the sleep state and the active state. When the processor is in the sleep state, DPM can turn off the processor clock to reduce the processor voltage to a very low level. At that time, the power consumption of the device is negligible. 17 A processor that is executing a task is in the active state. When the processor is idle in the active state, the minimum power consumption processor executes the idle operation instruction at a very low frequency. 18
We denote the idle power consumption as
Task model
Definition 1
Definition 2
Given a task set
Definition 3
The task projection operation
Definition 4
The task selection operation
Definition 5
Definition 6
Definition 7
This work considers two sets of tasks. One set is represented by the hard real-time periodic task set
Energy consumption model
Definition 8
Definition 9
Definition 10
In addition to the condition of Definition 9, if
then we denote this feasible scheduling as the optimal energy-saving scheduling
This work does not consider the energy consumption costs of switching between the active and sleep states of processors, and only a single-processor environment is considered. Based on this assumption, it is proposed that the
Theorem 1
For
Proof
The necessity is obvious, and we only discuss the adequacy here. Because of the limitations
Theorem 2
In the
Proof
Because
Because
must be met. After expanding equation (5), we obtain the following inequality
The elimination of equivalent terms yields
This statement can also be written as
Energy-saving optimal scheduling algorithm
Theoretical basis of the algorithm
Definition 11
Theorem 3
We use
Proof
We prove this statement by the method of counterevidence. Suppose
Thus, by definition, the following inequality is met
Eliminating equivalent terms on both sides of the inequality yields
Setting
By definition,
must be met. After expanding the above, we obtain the following inequality
Elimination of equivalent terms yields
This statement can also be written as
Inference 1
We assume
Proof
Let
This statement indicates that a new schedule can be constructed with a substitution of
Inference 2
Scheduling in task set
Verification
This inference is easily verified because from Definition 5,
As discussed, this study considers the optimal energy-saving scheduling process. After scheduling the task items from high to low priority according to the energy consumption factor, the optimal energy-saving solution is obtained by constructing a scheduling sequence in a step-by-step manner. Assuming an order of decisions
Definition 12
Let
Obviously, this example is a process of optimal selection. If it can be guaranteed that
Theorem 4
According to equation (19), and based on recursive relations, we make a dynamic decision from the sequence represented by
Proof
The following holds from Definition 9
We define the maximization conditions for solving the problem
This type of dynamic planning and scheduling algorithm is herein denoted as a decisive path scheduling (DPS) algorithm.
DPS algorithm
In this article, we clarify the function of the DPS algorithm using an example and present the main steps. Let a set of tasks
Task set example.
Because
For the first step, we perform decision making on
For the second step, we perform decision making on
For the third step, we perform decision making on
where the solution set
For the fourth step, we perform decision making on
After merging
From
Algorithm 1
DPS.
Analysis of the DPS algorithm
We denote the power consumption of each task by
The above analysis indicates that the performance of the DPS algorithm is unsatisfactory when n is large. However, viewed from the perspective of practical use, the number of real-time scheduling tasks for mobile portable devices is limited. According to statistics obtained for the MWatch health-monitoring wristwatch 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 unnecessary 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
Algorithm 2
HRDS.
Theorem 5
For the schedulable task set
Proof
From the arithmetic operation process, we observe that
Experimental and simulation results
Through “Key technology of a mobile health-monitoring watch” project, we performed a number of comparative experiments using the proposed algorithm in the mobile-embedded platform shown in Figure 4 and fully verified its effectiveness and feasibility in this platform. The platform chip is based on the GainSpan GS2011M module, which uses an ARM® Cortex® M3 two-core CPU, where one core is used for Wi-Fi wireless communications and the other for Application processing. The hard real-time tasks listed in Table 2 were performed during stress testing of the algorithm.

Real-time system energy consumptions of the GS2011M-based health wristwatch.
Real-time process of the GS2011M health-monitoring platform.
LED: light-emitting diode; ECG: electrocardiography.
Table 3 shows the real-time process set abstract for the real-time task set. A portion of the task exists because the release time is random, and another portion of the task is released in accordance with the fixed operating cycle. Thus, the task of release time must be treated as a random time for dynamic processing. The system maintains a queue
Real-time process set abstracted as a real-time task set.
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, the energy consumption of the device is significantly reduced with the HRDS scheduling algorithm, and the average power consumption is only 37% of that with the EDF algorithm. The main reason for this result is the high power consumption of the external equipment of the operating environment, which accounts for 79% of the total system power consumption, and thus, the actual effect of using the HRDS algorithm is significant.
We simulated the above environment with the EDF scheduling algorithm and the HRDS scheduling algorithm on the MATLAB platform and increased the number of hard real-time processes to 100. Figure 5 presents a comparison of the simulation data. In this case, compared with the actual environment, the data effect is slightly worse, mainly because the number of tasks has increased, and therefore, CPU idle time is reduced and the ratio of peripheral power consumption to CPU power consumption is decreased. However, compared with the energy consumption when using the EDF algorithm, the average energy consumption with the HRDS algorithm is substantially less and is only 61% of that of the EDF algorithm. Relatively, the effect is highly significant. 20

MATLAB simulation of real-time system energy consumption.
Conclusion
The main goal of current hard real-time scheduling of periodic and non-periodic tasks is to save energy while ensuring the real-time completion of tasks. In this article, we discussed the nature and effect of the energy consumption factor in the case of peripheral energy loss sensitivity. In addition, we introduced the basic idea of the algorithm and its basic theory and proposed an energy-saving priority scheduling algorithm. The results from the experiments and simulations show that HRDS can ensure real-time scheduling and minimize energy consumption in the case of schedulable tasks. However, because the volume of the calculation is somewhat large, if the scale increases with the problem, it is expected to cause greater overhead to the system.
Footnotes
Acknowledgements
Z.P. and G.W. conceived and designed the experiments, Z.P. performed the experiments, G.W. analyzed the data and contributed analysis tools, and Z.P. wrote and edited the main manuscript text. All authors reviewed the manuscript.
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This research was supported by National Natural Science Foundation of China (61632009, 61472451, 61272151, and 61462006), Natural Science Foundation of Hunan Province (2017JJ5038) and the “Mobile Health” Ministry of Education - China Mobile Joint Laboratory (MOE-DST No. [2012]311).
