J Med Syst (2015) 39: 126 DOI 10.1007/s10916-015-0320-5
MOBILE SYSTEMS
A Machine Learning Method for Power Prediction on the Mobile Devices Da-Ren Chen 1 & You-Shyang Chen 2 & Lin-Chih Chen 3 & Ming-Yang Hsu 1 & Kai-Feng Chiang 1
Received: 22 March 2015 / Accepted: 12 August 2015 / Published online: 26 August 2015 # Springer Science+Business Media New York 2015
Abstract Energy profiling and estimation have been popular areas of research in multicore mobile architectures. While short sequences of system calls have been recognized by machine learning as pattern descriptions for anomalous detection, power consumption of running processes with respect to system-call patterns are not well studied. In this paper, we propose a fuzzy neural network (FNN) for training and analyzing process execution behaviour with respect to series of system calls, parameters and their power consumptions. On the basis of the patterns of a series of system calls, we develop a power estimation daemon (PED) to analyze and predict the energy consumption of the running process. In the initial stage, PED categorizes sequences of system calls as functional groups and predicts their energy consumptions by FNN. In the operational stage, PED is applied to identify the predefined sequences of system calls invoked by running processes and estimates their energy consumption.
Keywords Power estimation . Energy profiling . Fuzzy neural networks . Linux This article is part of the Topical Collection on Mobile Systems. * You-Shyang Chen
[email protected] 1
Department of Information Management, National Taichung University of Science and Technology, Taichung City 404, Taiwan, Republic of China
2
Department of Information Management, Hwa Hsia University of Science and Technology, New Taipei City 235, Taiwan, Republic of China
3
Department of Information Management, National Dong Hwa University, Hualien 97401, Taiwan, Republic of China
Introduction Energy consumption has become one of the most critical problems for embedded systems and mobile devices [1–5], which provide a variety of services and ubiquitous application for users, such as smartphones [6], vehicle monitoring systems and wearable electronics. Although many low-power hardware designs have been emerged, application-related power saving methods should consider middleware aspect of the systems [7]. Most of the power estimation methods aiming at architecture level or hardware design have been proposed to increase the accuracy of power prediction. To save more energy, it is important to investigate program execution patterns on the middleware-level of mobile devices. System call sequences invoked by applications have inspired researchers to understand the behaviors of running processes. They have been studied thoroughly on the field of intrusion awareness, which is an essential part of information security operating system and architectures [8–10]. However, the power consumption patterns associated with the system call sequences are not yet studied by means of machine learning methods such as fuzzy neural networks (FNN) [11, 12] or adaptive boosting (AdaBoost) [13]. Power consumption prediction suffering from accuracy problems is usually solved under an accurate model. These models are difficult to describe the complicated dynamic nature of the running processes. Fuzzy logic provides an inference mechanism under cognitive uncertainty such as execution power, while neural networks provide ability at recognizing patterns. Hybrid systems combining fuzzy logic and neural networks provide their effectiveness in a variety of realworld problems [11]. Forrest et al. [14] apply short sequence of system calls to predict intrusion behavior of funning processes. They derive stable signatures from the system calls as normal behavior and detect abnormal execution from the
126 Page 2 of 11
processes. Liu et al. [15] demonstrate that neural networks can analyze encoded sequences of the system calls and can be applied to identify abnormal patterns of process execution. The results indicate that machine learning is a promising method to profile the execution pattern of system calls and predict the behavior of their processes. In this paper, we develop a power prediction method called power estimation daemon (PED) to analyze the power consumption of running processes with respect to system calls in Linux. Firstly, we construct a set of tables for recording the data about the relationship among system calls parameters and their power consumption. The data in the set of tables can be analyzed and grouped as individual series (groups) of system calls. We design a fuzzy neural network (FNN) model to estimate power consumption of the series (groups) of system calls by means of the training data derived from target applications performed on the mobile devices. The neural networks incorporate the fuzzy logic to recognize imprecise execution information and predict execution patters and power consumption of the series of system calls. We also develop tools for mobile devices that estimate the power consumption of the target applications by means of the results from the set of tables. This paper is organized as follows: Section 2 discusses literatures on power profiling and neural network applications. The proposed power estimation and machine-learning methods on a series of system calls are introduced in Section 3. Section 4 presents the experiment results and we conclude this paper in Section 5.
Previous works Power profiling helps users to understand the behavior of power consumption of target devices and improves their power efficiency. It can be applied to predict the remaining service time of the systems. Power profiling is usually classified into two types. The first type is called measurement-based profiling [16, 17] that probes the target devices using electronic equipment such as data acquisition (DAQ) or Volt-OhmMilliammeter (VOM). They are usually employed to record the devices’ energy consumption associated with their execution time, and analyze the energy consumption pattern of target programs. The second type of profiling is called modelbased profiling [18–23], which provides the pre-defined instructions/functions tables associated with hardware energy consumptions. It can be further classified into high-level model [20, 21] and low-level model [18, 19, 23–25]. High-level model is employed to analyze the energy consumption of system-level or function-level on the target systems. Qu et al. [21] propose a function-level power analysis model that sums the number of separate functions called by the processes during their execution time. It records the events due to function invocations in a database and analyzes the average energy
J Med Syst (2015) 39: 126
consumption for individual functions. Jung et al. [20] propose an energy prediction method for smartphones called DevScope, which controls the components on-the-fly using battery monitoring unit (BMU) updating rate, and develops the component power model automatically by analyzing the changes of power state. Low-level model is associated with energy consumption patterns constructed by instruction-level or architecture-level. It evaluates energy consumption by simulation or virtualization softwares. Tiwari et al. [23] model the baseline power consumption of processor instructions with different addressing and instruction formats. This method is employed to evaluate the energy cost of embedded software, and helps to verify whether a design meets its specified power constraints. Tsao et al. [24] propose SEProf to construct and manipulate the energy tables to derive the software energy consumption. It refers instruction-level to analyze the energy consumptions of the software. Brooks et al. proposes Wattch model [18] for architecture-level power analysis on the basis of the software simulator SimpleScalar [19]. Wattch model analyzes and predicts the energy consumption of different architectures and provides useful model for researchers on architecture and compiler design for energy efficiency. High-level power prediction models based on JVM, bytecode or function calls provide higher compatibility on different OS platform and lack accuracy for power prediction. On the contrary, low-level models usually simulate the cost of processor instructions and provide accurate power prediction. However, it has low portability and is difficult to be implemented on a variety of mobile devices. The unix-based OS provide libraries or APIs between user programs and OS kernel shown as Fig. 1. API is usually part of an implementation of the C library, such as GNU C library [21]. The library provides wrapper functions for the system calls, which usually have the same names as the system calls that they call. In Fig. 1, system calls can be regarded as a middleware between hardware (instruction level) and application (function/highlevel). In addition, in the modern OS architectures, most I/O access to hardware such as files, networking and memory allocations use system-call architectures. The system-call based prediction model could provide good compatibility on a variety of platforms and accurate power prediction. Linux [5, 26, 27, 25] is an open-sourced OS developed by community and is suitable for client–server infrastructures. To the best of our knowledge, this is the first time that power consumption can be predicted by means of recognizing patterns from a series of system calls using machine-learning methods [11–13]. The system-call-based power estimation will construct a new category of middle-layer power profiling in the model-based methods. It improves the existing methods in software compatibility and precision of power estimation. Based on the machine-learning methods, the precision of power prediction can be continuously improve by training raw data in the database such as system-call precedencies,
J Med Syst (2015) 39: 126
Page 3 of 11 126
Applicaons POSIX-compable
C library Linux kernel System calls
open( ) exec( ) fork( )
fork write open
socket( ) fopen( )
kernel H/W
close exit ,...
calloc( )
The profiling tools
about 380 system calls
(about 2000 funcons)
Linux specific
Applicaons Fig. 1 System-call architecture for Linux-based OSs
power consumptions and parameters produced by running processes. In this paper, we design a software to collect the system execution data from mobile devices and analyze the relationship among system-call data by using fuzzy neural networks. The data requires analysis and storage supports so as to generate precision estimation on power consumptions. Servers are employed to analyze and train up the data stored in the database which records power consumptions and execution behaviors of target processes associated with combination of OS and hardware. Users who download the information in accordance with their specification of individual mobile devices can precisely predict their power consumption of applications.
Power profiling method Local tables in the mobile device is maintained by MySQL®, which is a popular choice of database for use in web applications, while global tables are maintained by an internet server using SQL server® 2012. To construct the contents of the local tables for the proposed tool data-acquisition (DAQ) [28] and LabView® 2013 are applied to measure and analyze devices power consumption. DAQ NI2919 made by National Instruments® has ADC resolution with 24 bits and the maximum sample rate is 100 Hz. To collect the profiling data, the 24-Bit universal analog input is used together with the NI compact DAQ to measure voltage and current. LabView [29] designed by National Instruments® is a system development tool using a graphical language called BG^. It is widely used for DAQ and industrial instruments on a variety of operating systems such as MS Windows, Linux, and Mac OS.
System calls and interrupts are the common solutions for processes to access hardware. They are considered as the essential execution units in the architecture-level for the running programs. For example, whenever a process performs an action such as output ports, networks or writing data to disks, Linux kernel invokes system call write (). For predicting the system power consumption, we develop a resident program for Linux called power estimation daemon (PED) that takes down the derived interrupt vectors or system calls with their parameters from Linux kernel. The derived parameters will be evaluated when profiling the resulting power consumption with respect to those system calls to quantify the real execution energy. PED classifies the invoked system calls and analyzes their time instances. It also gets the resource ID, parameters and durations of each system call for the running programs. In addition, when a program accesses main memory, it performs the operations by using load/store instructions. For example, a system call is required to allocate and free dynamic memory. Once allocated, regular load/store instructions access the reserved memory region without using system calls. Therefore, PED equips a memory PED (mPED) tool [16] that keeps track and reports required memory cycles and their power consumptions of the current system calls acquired by PED. Memory bus cycle is usually referred to CPU cycle and takes a time periods for reading and/or writing data from and into memory. For deriving the duration on which the processors execute applications or access main memory, timer interrupt Table 1 The execution time results during the execution of write () in 100,000 times [16] % Time 0.00 0.00 0.00
Seconds
Usecs/Call
Calls
Errors
System call
0.000000 0.000000 0.000000
0 0 0
3 2 6
2
access brk execve
0.00 0.000000 0 0.00 0.000000 0 100.00 0.057595 1 0.00 0.000000 0 0.00 0.000000 0 0.00 0.000000 0 0.00 0.000000 0 0.00 0.000000 0 0.00 0.000000 0 0.00 0.000000 0 100.00 0.057595 System call usage for 32 bit mode: % time seconds usecs/call nan 0.000000 0 100 0.000000
2 5 100001 3 2 3 1 5 7 4 100037 calls 1 1
2 errors
lseek munmap write read open close uname mprotect mmap2 fstat64 total syscall set_tls total
126 Page 4 of 11
J Med Syst (2015) 39: 126
Table 2 An example of derived average energy consumption of system calls [16] No.
Power (mW)
System calls
Actions
1
0.00287
__NR_restart_syscall
Restart a system call
2
0.00939
__NR_exit
Exit a process
3 4
0.00762 0.00098
__NR_fork __NR_read
Construct a new process Read
5
0.00452
__NR_write
Write
6 7
0.0101 0.00162
__NR_open __NR_close
Open an object Close an object
8 9
0.00502 0.00941
__NR_waitpid __NR_creat
Wait for exit of a process Create an object
10
0.0059
__NR_link
Create a link
11
0.00592
__NR_unlink
Delete a link
frequency is an important parameter [30] to OS. In the Linux, whenever a timer interrupt is issued, the value of global variable jiffies is increased by one [30]. This variable is applied to trigger the context switching and the control execution time of processes. To compute accurate processor or memory energy consumption, mPED is designed to identify the timer interrupt and memory access instructions from the running programs. The kernel settings such as CONFIG_HZ, NO_HZ, HIGH_RES_TIMERS and High Precision Event Timer (HPET) [30] affect the kernel timer interrupts. mPED gets the current timer configurations using a predefined batch file proposed in [16]. mPED identifies process status such as sleep, execution, idle and power-off, etc. and thus it can compute the memory and CPU energy consumption per unit of
Fig. 2 The framework for PED and mPED tools
time. Combining with DAQ and LabVIEW®, PED constructs energy consumption tables for the given information and system calls, and builds a table to save the precedence relations among the system calls of target applications. The resident programs PED and mPED monitor the system calls, interrupts, memory access and CPU execution/status, and aggregate and report the information to the anslysis side. A DAQ is employed to probe the variations of voltage, energy dissipation and temperature, and reports on the fly to LabVIEW® in the analyzing side. After parsing the information from DAQ and tools, the information are aggregated into tables and stored in the database server. To derive energy consumption of individual system calls, PED performs most system calls individually in 100,000 times accompanying a combination of parameters in the local database and computes their average energy consumptions [16]. For example, to understand the execution time and energy consumption of system call write () with the most frequently used parameters, PED and mPED first derive its average execution time and energy consumption by employing DAQ and LabVIEW® shown in Table 1. The example of average energy consumptions for system calls is shown in Table 2. In Fig. 2, a flow chart for PED and mPED is composed of two stages: initial and operational stages. In the lower region, PED collects the information such as parameters, average power consumption and execution time of system calls and memory access in the initial stage, because the target systems are the combinations of various hardware and OS. The data is preprocessed and uploaded to a server for analyzing the acquired system calls and interrupts, and then stored in a
servers
Training FNN by FGs
database (global tables)
PED
FNN mPED
Operational stage
Memory CPU status PID
online Energy consumption estimation
Computing /mapping
Trace System calls
PID
Mobile device
Application
Initial stage
Aggregate offline tables
PED local(temporal) tables
Record power supply Computing /analyzing
Profiling System Calls
mPED Record memory access events
NI DAQ
J Med Syst (2015) 39: 126 Table 3
Page 5 of 11 126
The profiling results derived from PED and mPED [16]
System call ID
System call name
Invocation times
Power (mW)
3
fork
9111
171.051120
4
read
4645
12.387710
5 6
write open
21 87
0.251010 2.123780
10 19
link stat
13 42
0.179700 0.084700
33
gtty
26
0.301570
38 78
kill getrusage
5 57184
0.016970 613.786370
91 118
mmap ipc
564 13
10.018500 0.284610
122
setdomainname
3
0.004500
148 192
getsid upgetrlimit
11 437
0.027570 5.378230
220 251
mincore epoll_create
5401 3
91.112300 0.000600
286
accept
78
0.417800
291 293 305 306
sendto recvfrom msgctl shmat
21213 2 2 8
78.143810 0.049850 0.005950 0.074400
307
shmdt
3 total
0.033050 985.3241
CPU time Utime Stime
398 49686
CUtime CStime Power
334 433 270.156647
database. The data in the database servers will be employed by the mobile devices during their operational time. Table 4 An example of (a) the number of invoked system calls and (b) their relationship
(a) Sys. calls Times (b) Sys. calls Fork Execve Read Write Open Close Kill Getrusage Mmap
In the upper region of Fig. 2, PED monitors the interrupts and invocations to system calls regarding to their process id (PID) and obtains their most frequently used parameters. When a system call is invoked and traced by PED, its parameters and ID are acquired to construct a dynamic system call invocation (SCI) table for the target applications. The average power consumption of the system calls recorded in the tables associate the individual IDs and the combinations of their parameters. At the same time, mPED identifies the CPU status and memory cycles for current process, and associates their durations and the system calls information in the database [16]. For example, Table 3 presents the results computed by PED and mPED similar to that in [31]. In the bottom of the table, to calculate CPU power consumptions, mPED employs the system call information derived from PED and adds up the parameters in Eq. (1): Utime pstand þ Stime pexe þ ðCUtime CStimeÞ pidle ; ð1Þ
where Utime and Stime denotes the execution time of a process during which CPU’s status is standby and running, respectively. Notations CUtime and CStime denote the time when CPU is idle. pstand, pexe and pidle denote process power consumptions while CPU is in standby, execution and idle state, respectively. The values in the right column labeled by system calls denote the power consumption in the current process, which is also derived from the table. The system consumes about 978 mW of total power consumption due to the system calls. In the bottom line of the table, the CPU power consumption is 270 mW which is derived by mPED from Eq. (1) during the process execution. By using PED and mPED, we can identify the energy consumptions due to I/O or CPU and memory cycles of applications.
Fork 33
Execve 16
Read 8
Write 5
Open 17
Close 17
Kill 15
Getrusage 8
Mmap 8
Fork 0 2 1 1 1 1 2 1 1
Execve 2 0 1 1 1 1 2 1 1
Read 1 1 0 1 2 2 1 1 1
Write 1 1 1 0 2 2 1 1 1
Open 1 1 2 2 0 3 1 2 2
Close 1 1 2 2 3 0 1 2 2
Kill 2 2 1 1 1 1 0 2 2
Getrusage 1 1 1 1 2 2 2 0 3
Mmap 1 1 1 1 2 2 2 3 0
126 Page 6 of 11
J Med Syst (2015) 39: 126
writing group
Open
Write
information derived from mPED is also considered as a part of FGs, and thus power consumption due to memory access is also included in the system. PED produces the FGs for the target application in the following stages:
Close
Fig. 3 An example of a writing group [16]
System-call invocations (SCI) and functional groups (FG) This section introduces the structure of database which is mainly composed of SCI tables and system-call relation (SC_relation) graphs which are similar to SCR graphs in [31]. To generate SCI tables, the first stage defines the relationship among system calls in accordance with their functions, invocation times, and precedence. Their relationships are categorized as: inherent=3, triggered=2, unrelated=1 and itself=0. For example, the number of system call invocations from an application are shown in Table 4a, where the number of invocations to open () and close () is the same and their precedence can also be recognized in the database, thus having inherent relationship (i.e., 3). System call Getusage () is invoked by Linux to check the status of the resources manipulated by the pair of open () and close (), thus having the triggered relationship (i.e., 2). In addition, Mmap () is immediately invoked to check the memory mapping, and thus both open () and close () have triggered relation between Getusage () and Mmap (). In accordance with temporal tables (database), the invocation to Fork () is not affected by open () and vice versa, and thus having unrelated relation with open (). An example relations are shown in Table 4b. After constructing SC_relation, the system calls of target program are grouped according to their relevance and precedence called functional group (FG) in which the groups are organized in a topological order. In Fig. 3, a writing group composed of write (), close () and open () is presented using a simple directed acyclic graph (DAG) [16, 31]. FG reduces a group of SC_relation graphs so that we can decrease computational complexity and focus on the significant power/time prediction to target processes. The memory access
1. In the initial stage, PED counts the number of individual system call invocations and parameters, and analyzes their invocation precedence. 2. It tags the system calls in the following five classes: (a) Process control: load, execute, create/terminate process (fork, exit), get/set process attributes, etc. (b) File management: create/delete file, open/close, read/write, etc. (c) Device management: request/release device, get/set device attribute, etc. (d) Information management: get/set time or date, get/ set system data, etc. (e) Communication: create/delete connection, send/ receive message, etc. 3. In addition, PED records and recognizes the temporal and branch localities of system call invocations After receiving the information of the target applications, we produce SCI tables and employ statistical analysis software to identify the dependencies among system calls. In Fig. 4, for example, a FG is composed of a set of system calls constructed by PED according to SC_relation and SCI, which records and organizes a series of system calls into groups. In Fig. 5, PED also builds a DAG of the groups of system calls for the target applications. Power consumption estimation for FG In this section, the prediction for power consumption of each FG is proposed by means of a fuzzy neural network (FNN) model. Back-propagation neural network is a feed-forward multi-layer neural network and has been
Fig. 4 A detailed DAG for resource querying group [16]
Resource query function
Getrlimit
Getrusage
Times
Statfs
Setrlimit
Getitimer
Sigprocm ask
Quotactl
Mmap
Munmap
Mremap
J Med Syst (2015) 39: 126
Page 7 of 11 126
Fig. 5 An example of the DAG of groups of system calls [16]
Resource query funcon
Wring funcon Inial funcon
CPU running funcon
Linkage funcon
Networking
funcon
Data receiving funcon
Exit funcon
Reading funcon
an element of the domain of discourse shown in Eq. (2). 8 0 x< a > x−a > 2 > aþb > > a≤ x < < 2 b−a 2 ð2Þ S ðx; a; bÞ ¼ x−b 2 aþb > > ≤ x < b 1−2 > > b−a 2 > : 1 x≥b :
used widely for generating classifier, function approximation and prediction. In Fig. 6, the proposed fuzzy neural network has real weight coefficients, fuzzy input signals and multiple outputs with different types. Input layer has k neural cells which represent k power consumption values from the database. The k system call IDs correspond to their individual power consumptions in milliwatt, and without loss of generality, the power consumption of each system call is unique. In fuzzification layer each node has k outputs to the k nodes in hidden layer, while in the hidden layer each node has m outputs to that in the output layer. All of the system calls stored in the database are renumbered in accordance with their energy consumptions in increasing order. For example, the sorted items in Table 5 are derived from Table 3 and the values of New ID in the table are scaled from their individual energy consumptions. Each system call is further organized as the predefined FGs shown in Fig. 5, and can exist in one or more FGs. In Fig. 6, fuzzification layer transforms crisp input value by selecting appropriate membership function, and transmits them into network. There are many membership functions, such as smaller fuzzy distribution, medium fuzzy distribution and larger fuzzy distribution. For the larger power consumption values assigned to larger system call IDs, we use monotonically increasing function denoting a larger fuzzy distribution function (S type) with interval [a, b] and x denotes
Fig. 6 The FNN structure
1
The property of the function is presented in Fig. 7. The hidden layer in the network is manipulated by using non-linear method and sigmoid function. The output layer has m+1 cells corresponding to m+1 nodes and defined as the number of predefined FGs in the database. For an output node Oi and 0≤i≤m-1, it presents that an input sequence of system calls is propensity to the behavior of a FG i. In the supervised learning, we set 1 for the corresponding output node Oi with i≤m-1 and set power consumption of the input training sequence of system calls on the m-th output node. When recognizing, the maximum output node excepting node m will be the classification result with respect to FG, meanwhile, node m outputs its estimated power consumption. We apply back propagation method and the outputs of each layer represented as follow: outputlayer : oi ¼ f ðnet i Þ; net i Xm ¼ w y ; where i ¼ 1; 2; …; m: j¼0 j;i j
2
3
4
k-1
ð3Þ
Input layer
k
Fuzzification layer vj,k Hidden layer
wj,m O0
O1
Om-1
Om
Output layer
126 Page 8 of 11
J Med Syst (2015) 39: 126
hiddenlayer : yi ¼ f net j ; net j Xk ¼ v x ; where j ¼ 1; 2; …; k: h¼0 j;h h
ð4Þ
1
In Eqs. (3) and (4), f(x) denotes the sigmoid function and 1 f ðxÞ ¼ 1þe x In order to train the proposed FNN, we apply the following error function that produces higher accuracy results than other existing functions [32], E¼
2 1Xl t j −o j j¼1 2
ð5Þ
0.5
0
x
a
(a+b)/2
b
Fig. 7 Larger fuzzy distribution function
Operational stage
Initial stage
where tj denotes the expected output and oj is the practical output. The adjusting model is: If h is output unit: ∂E d ∂Ed ∂net h ¼ −η Δ whi ¼ − η ∂wh;i ∂net h ∂wh;i ¼ ηðt h −oh Þoh ðl−oh Þxh;i ¼ ηδh xh;i
Execute target applications and analyze System parameters Linux Kernel PED mPED
ð6Þ
Monitor System calls and CPU Compute average power consumptions and parameters of system events.
Linux kernel PED mPED
where δh(th −oh)oh(l−oh) and Ed denotes an input error term.
DAQ Report the platform and software configurations
(10) Report power estimation.
Analyze the event properties.
Table 5 The system call table and the power consumption of each system call New ID
SC names
00030 00149 00225 00211
epoll_create Link setdomainname stat
0.0003 0.00149 0.00225 0.00211
00275 00267 00297 00369
getsid read msgctl sendto
0.00275 0.00267 0.00297 0.00369
00424 00522 00930 01075 01140 01223 01256 01652 01697 01745 01885 02371 02469 02492 …
kill accept scmat getrusage write rgetrlimit gtty shmdt mincore mmap fork ipc open recvform …
Global tables
Server database
Avg. pw (mW)
0.00424 0.00522 0.00930 0.01075 0.01140 0.01223 0.01256 0.01652 0.01697 0.01745 0.01885 0.02371 0.02469 0.02492 …
Local tables
Step 1: Count invocation times, classify the purposes and analyze the dependency of system calls and memory cycles
(6) Generate SCI tables Step 2: (1) Construct SC_relation according to
SCI tables
(7) Generate FG
(2) Construct FGs and define their individual members (3) Determine the precedence of the FG according to global tables
Step 3: (1) Collect actual system call groups from running application according to FGs (2) Training FNN using the FGs
(8) Training FNN of FGs Step 4:
(9) Estimate power consumption
(1)Recognize FGs from the applications (2)Compute power consumption of unrecognized system calls (3)Estimate power consumption of applications by FGs
Fig. 8 A complete flow of the proposed tools
J Med Syst (2015) 39: 126
Page 9 of 11 126
Fig. 9 Hardware for experiments a DMA-4412U [34] and b DAQ NI 9219 [35]
If h is hidden unit: ∂E d ∂E d ∂net h ¼ −η ∂wh;i ∂net h ∂whi X ∂E d ∂Ed ∂net k ¼ ∂net h ∂net k ∂net h k∈downstreamðhÞ X ¼ −δk wk;h oh ðl−oh Þ
Δ whi ¼ − η
ð7Þ
k∈downstreamðhÞ
Where set δh =oh(l−oh)∑k∈downstream(h) −δkwk,h, then Δwh, i =ηδhxhi
In Eqs. (6) and (7), Δwhi denotes the correction of synaptic weight Δwh,i. To update the weight wh,i using gradient de scent, we choose a learning rate η defined as η ¼ c2 1− ttn . It is assigned with a large value in the beginning of training stage and then decreases rapidly [32]. The −1 is necessary so as to update in the direction of a minimum, not a maximum, of
16.000 14.000 12.000 10.000
Power consumpon (mW)
18.000
Power consumpon (mW)
8.000
the error function. Notation c2 is a constant in interval [0, 1] and be initialized to 0.5, tn denotes the maximal training number in advance and t denotes the t -th training process. The common used applications on the mobile devices are webmail, community websites, e-commerce and content websites [12]. Therefore, we provide a set of traces of Gmail, Facebook and Google chromes programs. In order to provide the training datasets, we gather 100 examples for each FG from the execution instances of Gmail, Facebook and Google Chrome. The size of each FG (i.e., the number of system calls in a FG) is not more than the number of input nodes k of FNN. Some of the input nodes are assigned Bdummy^ data, that is, system call ID is zero when the FG size is smaller than k. In Fig. 6, neural network learns these FGs by pre-labeled system call sequences and determines one of the m outputs (between 0 and m-1) as their individual desired output, and signals for 1 and 0 otherwise. Meanwhile, the desired value of the m+1th output is set as the power consumption of current input of FG. The initial weights of the FNN are determined randomly and then adapted by the network, and the thresholds (≥0.5) predefined in the neural cells are applied in the training process. In the supervised learning, when an output is greater than the threshold, it will be labeled as ‘1’, otherwise it will be labeled as ‘0’.
6.000 4.000 2.000 0.000
1
2
profiling-Facebook PED-Facebook
3
4
5
6
PED-Facebook profiling-Facebook
7
8
mes 9 10
profiling-Facebook PED-Facebook
Fig. 10 The average power consumption varying with the number of execution of each kind of applications
20 0 15 5 10 0 5 0
Facebo ook Gmail Chrome aapplicao on names
profiling 28 16.32 93 11.189 85 10.078
PED 6 16.316 44 11.124 81 10.068
Fig. 11 The prediction to the power consumption by the proposed tools
126 Page 10 of 11
J Med Syst (2015) 39: 126
After FNN has been trained, we input the datasets to identify their FG and predict their power consumptions. The datasets are composed of sequences of FG patterns from Gmail, Facebook and Google chrome traces excluding training datasets. FNN is used to decide the FG to which the input sequences belong and predict their power consumptions. We apply a sliding window [33] of length L to move along the trace. A shifting step of l