Received 15 July 2014; revised 9 November 2014; accepted 21 November 2014. Date of publication 7 January, 2015;
date of current version 6 March, 2015.
Digital Object Identifier 10.1109/TETC.2014.2387688

Just-in-Time Code Offloading for
Wearable Computing
ZIXUE CHENG, (Member, IEEE), PENG LI, (Member, IEEE), JUNBO WANG, (Member, IEEE),
AND SONG GUO, (Senior Member, IEEE)
School of Computer Science and Engineering, University of Aizu, Aizuwakamatsu 965-8580, Japan

ABSTRACT Wearable computing becomes an emerging computing paradigm for various recently
developed wearable devices, such as Google Glass and the Samsung Galaxy Smartwatch, which have
significantly changed our daily life with new functions. To magnify the applications on wearable devices
with limited computational capability, storage, and battery capacity, in this paper, we propose a novel
three-layer architecture consisting of wearable devices, mobile devices, and a remote cloud for code offload-
ing. In particular, we offload a portion of computation tasks from wearable devices to local mobile devices
or remote cloud such that even applications with a heavy computation load can still be upheld on wearable
devices. Furthermore, considering the special characteristics and the requirements of wearable devices, we
investigate a code offloading strategy with a novel just-in-time objective, i.e., maximizing the number of tasks
that should be executed on wearable devices with guaranteed delay requirements. Because of the NP-hardness
of this problem as we prove, we propose a fast heuristic algorithm based on the genetic algorithm to solve it.
Finally, extensive simulations are conducted to show that our proposed algorithm significantly outperforms
the other three offloading strategies.

INDEX TERMS Wearable computing, just-in-time, code offloading, cloud.

Along with the popularity of various wearable devices,
such as Google glass [1] and Magic Ring [2], wearable
computing has attracted more and more attentions since it
facilitates a new form of cyber-physical interaction com-
prising small body-worn devices that are always powered
on and accessible [3]–[6]. Various emerging applications,
such as healthy monitoring, reality augmentation, and ges-
ture or object recognition, require wearable devices to
provide fast processing and communication capability in
an energy-efficient manner. On the other hand, hardware
equipped on wearable devices is usually with limited size and
weight, hardly to provide enough capability and power for
complicated applications.
To fill the gap between resource demand and supply
on wearable devices, we propose a novel architecture that FIGURE 1. Architecture.
offloads some codes to nearby mobile devices with stronger
processing capability or a remote cloud with unlimited com- Several mobile devices, such as smartphones or tablets, are
putation resources. Specifically, we consider a three-layer in the middle layer, which can communicate with wear-
architecture as shown in Fig. 1. Wearable devices with limited able devices using short-range communication technologies
computation capability forms the first layer closest to users. like ZigBee or Bluetooth. Meanwhile, these mobile devices
2015 IEEE. Translations and content mining are permitted for academic research only.
Personal use is also permitted, but republication/redistribution requires IEEE permission.
74 See for more information. VOLUME 3, NO. 1, MARCH 2015

In this paper. [11] have proposed the idea of using cloud Under this three-layer architecture. direct previous ones. [21] ate the performance of our proposed algorithm. [20] present a com- directly applying the standard genetic algorithm with putation offloading scheme on mobile devices and propose high complexity. several solutions have been The main contributions of this paper are summarized proposed to find the optimal decision for partitioning applica- as follows. they However. we focus on the just-in-time objective whose hardness is analyzed in Section 5. which would lead to high commu- are referred to as w-tasks in the rest of our paper. maximizing the number machines at cloud. computing [7]–[10] that resource-constrained mobile devices several local mobile devices (MD) and a remote cloud (RC). The we develop a formulation that deals with the challenges approach first divides a Java program into methods and uses of both task assignment and task scheduling. [13] have as task graphs. and components of Java programs should be offloaded. Note that some to the cloud. to input parameters to compute the execution costs for these determine where and in which order these tasks should methods. This problem is proved to be NP-hard. The performance evaluation is given by existing work. Moreover. The rest of this paper is organized as follows. MARCH 2015 75 . CloneCloud [14] seamlessly offloads parts of certain level of user experience. tions before offloading. into the remote server. the authors present a partition • We propose a novel three-layer architecture for code scheme based on the profiling information about computation offloading from wearable devices to local mobile time and data sharing at the level of procedure calls. and partition. cloud. Different layers have distinct scheme constructs a cost graph. [16] show the Gaussian application (i. Yang et al. 1.. Oberheide et al. we investigate how to computing to enhance the capabilities of mobile devices. architecture. Section 4 formulates the problem. SYSTEM MODEL II. These tasks cation to the cloud. [15] use the static partitioning of w-tasks that are executed within a given delay from their method to improve the battery lifetime of mobile devices. to directly interact with users who cannot tolerate long delay solve a system of linear algebraic equations) can be offloaded between any two adjacent w-tasks.e. The proposed scheme partitions a program into the leaving the determination of other variables to a distributed subprograms by producing a program abstraction. VOLUME 3. and they communicate with algorithm [18] is applied with the objective to minimize each other using different wireless communication the total energy consumption of computation and the total technologies. they propose performance close to the optimal solution. i.e. remote execution cost estimated based on status of the current rithm to approximate the optimal solution. tasks like sensing or display cannot be offloaded. we consider a just-in-time applications from devices to their clones residing in virtual objective for code offloading. efficiently offload codes from wearable devices in the first Hyrax [12] has been proposed as a mobile cloud computing layer to computation resources in the second and the third platform that allows mobile devices to use cloud computing layers. we extend the idea of code some important related work in Section 2. Then.e. For other nication cost... Later. Li et al. on which a branch-and-bound processing capability. III. ing with a just-in-time objective with respect to user In [19]. IEEE TRANSACTIONS ON EMERGING TOPICS Cheng et al. Section 6 presents with respect to user experience. data communication cost. extensive simulations are conducted to evalu. it makes an optimal execution decision by be executed. To guarantee a performance.e. in which methods or functions are denoted proposed to outsource antivirus services from mobile devices by nodes and their relationship by edges. Instead of wireless channel condition. Wang et al. NETWORK MODEL Code offloading is a critical technique to enable mobile cloud We consider a network consisting of a wearable device (WD). these work simply offloads the whole appli- should be executed only on wearable devices. The devices and remote cloud. Luo et al. It is motivated by the fact that w-tasks Rudenko et al. RELATED WORK A. references of abstract memory locations. which has been little studied our proposed algorithm. The system model offloading to wearable computing by proposing a three-layer is presented in Section 3. NO. a partition scheme has emerged to non-w-tasks. We review Different from existing work. Thus. a genetic algorithm that converges to the global optimal partition running on the cloud side. The idea of this algorithm is to • We consider an optimization problem for code offload. i. we propose a code offloading algorithm to partially offload applications to cloud for achieving a better schedule them on mobile devices or cloud. i. simplified optimization problem. Section 8 finally concludes this paper.: Just-in-Time Code Offloading for Wearable Computing IN COMPUTING can communicate with remote cloud as the third layer via can outsource their computation and storage to the remote WiFi or LTE networks. we propose an enhanced algorithm by a polynomial time algorithm to find an optimal program creating chromosomes for global scheduling only. in Section 7. prune the search space to obtain an approximated solution. where all physical memory references are mapped into the • Finally. wearable applications are represented platforms for data processing.. In [17]. The extend this work by focusing on the system throughput rather results show that our algorithm can quickly converge to than the makespan of the application. respectively. the authors present an approach to decide which experience. comparing the local execution cost of each method with the • We develop a fast algorithm based on genetic algo. Moreover.

E). Wearable Computing) Problem]: given a network consisting We have NW ∪NnoW = N . and a remote tasks 1. In our system model. For example.. which may represent cloud. there are too many non-w-tasks between two w-tasks. several mobile devices. efficiency. In some cases. and each task i ∈ N is associated seeking a task scheduling to maximize the number of w-tasks with a weight si that represents the number of instructions to that can be executed within δ time after the previous w-task.. j) ∈ E is associated with a transmission cloud without resource constraints. For each processor in P.. n} problem for wearable devices with a relaxed objective. tasks in set N can be divided into two subsets NW and NnoW . we show that the multiprocessor schedul- ing problem has a solution if and only if the resulting instance of JCOW problem has a scheduling scheme that FIGURE 2. we have cWD ≤ cMD ≤ cRC . instead of executing all tasks in the task graph on the wearable end hardware. or a remote Each edge (i. but slower than cloud. For example. where batteries with limited capacity.. First. of a wearable device. The The problem is formally defined as follows. and result display. where set N = {1.. which consists of two w-tasks. picture capture. and some simple applications with low computation requirement. A task can execute Proof: It is easy to see that the JCOW problem is in only when all its predecessors have finished. the amount of intermediate data from task i to j. We use P(j) The remaining proof is done by reducing the well-known to denote the set of predecessors of task j.IEEE TRANSACTIONS ON EMERGING TOPICS IN COMPUTING Cheng et al. mobile devices communicate objective. First. we create a corresponding local device with the same processing capability. i and j.. we assign some of them to nearby mobile devices with faster than wearable device. device has the weakest processing capability because of low. j) ∈ A. i.. we suppose that there exists a feasible scheduling of multiprocessor scheduling IV. the wearable devices to local mobile devices and cloud. multiprocessor scheduling problem to the JCOW problem. such that the B. and NW ∩NnoW = ∅. Therefore.e. user input.g. and a set T of non-w-tasks that can be executed in parallel. PROBLEM STATEMENT problem such that all tasks can be finished before time δ. 1. we attempt to find a code offloading scheme that maximizes that must be executed on wearable devices. should be executed on wearable devices.: Just-in-Time Code Offloading for Wearable Computing which can be represented by a graph Gn (V . we investigate a code offloading acyclic graph Ga = (N . 3.g. we create a wearable device and a remote cloud.. j) ∈ A is associated with a weight eij that represents task scheduling can be evaluated in a polynomial time.. be executed. NO. 3G networks). In other words.e. satisfies the delay requirement. we propose to offload some codes from wearable Typically. directed link (i. respectively. i.g. In the following.e. 2. respectively. An example of task graph. An example of task graph is shown in Fig. To guar- through short-range wireless technologies (e. On the other hand. and an application represented by a task graph. The multiprocessor scheduling problem can be formally described as follows. denotes a number of tasks. rate rij depending on the adopted communication technology. 2 are w-tasks.e. 6. some tasks. APPLICATION MODEL duration between them cannot satisfy the threshold δ under A wearable application can be represented by a directed any scheduling. each NP class as the objective function associated with a given link (i. For example. we target on a novel just-in-time or ZigBee). MARCH 2015 . The relationship the number of w-tasks. more powerful hardware and more energy supply. and task j is the successor of task i. display or Local mobile devices communicate with the wearable device sensing. each of which starts within δ time after among tasks is represented by directed links in set A. we call task i is the predecessor of Theorem 1: The JCOW problem is NP-hard.. i. A). 2. the duration between any two w-tasks should with each other through direct link (e. To support more advanced applications with improved energy The processing capability of each node i ∈ V is denoted by ci . Bluetooth antee user experience. they can run only V denotes a set of nodes including all devices and cloud. QUESTION: Is there a task scheduling such that all tasks can be finished with time δ? We now describe the reduction from multiprocessor prob- lem to an instance of the JCOW problem. For a its previous w-task. this requirement is LTE direct) or wide area network (e. and the processing speed of mobile devices is device. Definition 1 [The JCOW (Just-in-time Code Offloading for which include w-tasks and non-w-tasks. and a set P of m processors.g. task j. . WiFi direct or be within a threshold δ. INSTANCE: Given a set T of n tasks. e. wearable devices are It is straightforward to verify that the corresponding solution usually equipped with low-end hardware and powered by in JCOW problem guarantees that the delay between two 76 VOLUME 3. E represents a set of communication links among nodes in V . Due to size and weight constraints. too strict to generate a feasible solution. Therefore. P(5) = {2. Each task t ∈ T has a length lt . In addition.. 2. and 8 in Fig. i. We also create a task graph as shown in Fig. 3} in Fig.

w-tasks i and j is less than δ. 4. task 3 or 5 on the other device. NP-complete. 8}. 5. j ∈ N . Then. but they are X closer to the wearable device. device. and run in parallel with nuij − n + 1 ≤ aj − ai ≤ n − 1 − (n − 2)uij . 5}. we have the following constraints for ai : {2. e. 6.. task 3 starts after task 2. 3. V. These can be described by the constraints: devices have limited processing capability. i ∈ N 0 . n − 1 (i. 5} is chosen. Compared with cloud. otherwise. leading to small latency uij = 1. 2. On the FIGURE 3. if task i ∈ N is assigned to node k ∈ V . if execution sequence {3. we can further conclude that the optimization 1. uij = 1. Task assignment determines on which device each task should If we consider a virtual task n0 as both the origin be executed. we specify a sequence of {1. if task j ∈ N is scheduled  form of the original problem is NP-hard. NO. 2. the global scheduling. 5}. For example. if task j ∈ N is scheduled after i ∈ N . In this section. we define an integer variable ai to denote that task i tasks 2. which forms a solution of the multiprocessor problem. the ones in the same device cannot violate the execution sequence defined by the global scheduling. 7. 1. we conclude that the JCOW problem is scheduling as follows. 3. An instance of task graph. Therefore.: Just-in-Time Code Offloading for Wearable Computing IN COMPUTING Since each task can be assigned to one and only one node in the network.e. 2. 6. we have two possible execution sequences. if acyclic. 7. We schedule the non-w-tasks but task 5 can start before task 4. the exis. Except w-tasks that should be executed only and termination of a circular scheduling. task 4 can quickly 1 ≤ ai ≤ n. ∀i ∈ N . we do not impose any sequence requirement for tasks on different devices. 5}. ∀i ∈ N . i.. otherwise. (1) k∈V For task scheduling. In addition to the tradeoff j∈N 0 X between processing speed and transmission delay. For example. 7} when they are assigned to three devices. task Note that constraint (5) becomes aj − ai = 1 if task i is the scheduling on all devices should be jointly considered to predecessor of j.g. with different performance. (5) while delaying the execution of task 4. other hand. 5} and {3. which is alway satisfied because of (4). 5. otherwise.e. PROBLEM FORMULATION To simplify the calculation of task execution time later. yij = 0. mobile predecessor.. In the global scheduling {1. 3. 4. 3. other tasks can be offloaded to N 0 = {n0 } ∪ N should have exactly one successor and one mobile devices and cloud. we can start w-task 6 earlier ∀i. (4) get its input data after task 2. Only local problem has a feasible solution such that the delay between scheduling should be obeyed. we define a binary variable xik for ( task assignment as follows: 1. 8}. 2 are assigned to the same mobile is scheduled in the ai -th place in the global scheduling. ( 1. First. we first define a global scheduling that determines the execution sequence when all tasks are assigned to the same node. Alternatively. When tasks are assigned to mul- tiple devices. i. and w-tasks is less than δ. Based We define a binary variable uij to specify the global on the above analysis. Then. When tasks are executed according to {2. To solve the JCOW problem.. 3. we need to deal with the  0. Since the decision form of JCOW problem is  NP-complete. then any task in on the wearable device. We use an example to explain the differences between uij xik = 0. In order to guarantee the resulting scheduling of tasks assigned to the same device. 8} for tasks in Fig. {2. 6. MARCH 2015 77 . we have the following constraint: X xik = 1. (3) tence of multiple mobile devices further complicates task i∈N 0 assignment. we develop an optimization framework for the we define another binary variable yij for task scheduling as JCOW problem by jointly considering both task assignment follows: and task scheduling. although it is after task 4 in assigned to each local device to the corresponding processors. and yij .e.  challenges of both task assignment and task scheduling. we suppose that the JCOW {4. 3 and 5 in Fig. which will generate three local scheduling {1. task 3 VOLUME 3. Now we only need to consider the scheduling of users in N Task scheduling determines the execution sequence by removing n0 .  uij = immediately after task i ∈ N . 2. and otherwise 1 − n ≤ aj − ai ≤ achieve the optimal performance. 2. IEEE TRANSACTIONS ON EMERGING TOPICS Cheng et al. j ∈ N 0. uij = 1. |aj − ai | ≤ n − 1). (2) for data delivery among tasks.

This heuristic 1.. the JCOW problem can be formulated as a a feasible solution of the problem. ∀j ∈ N . a −a a constraint leads to yij = 1 because 0 < j n i < 1 and aji > 1. different devices k and l. This process is repeated until some condition. (6) The scheduling of tasks on devices. but u35 = 0 because Algorithm 1 The Genetic Algorithm Framework task 5 is not a direct successor of task 3. i. Tjr }.. n ai 1: generate a set of feasible solutions as an initial popula- If task i is scheduled before task j. we need to first define T tjs− tis chromosomes that represent feasible solutions of our where T is a large constant.IEEE TRANSACTIONS ON EMERGING TOPICS IN COMPUTING Cheng et al. ∀j ∈ NW Tjr = max tie + .t. ∀i. Thus. above tion. However.: Just-in-Time Code Offloading for Wearable Computing is before task 5. ∀j ∈ N . otherwise. In this case. j ∈ NW . a network Gn . The basic idea is X xjk sj to start with a population consisting of a set of feasible solu- tje = tjs + . NO. hand of constraint (8) will be zero. respectively. i. (1)–(11). The execution start time tjs of task j is determined by: VI. ∀i. Output: aj − ai aj ≤ yij ≤ . (9) A.l)∈E s.. we need to consider the e and no mathematical solvers are available because of non- communication delay rklij . is satisfied. if w-task j starts within δ time from  zij = selection mimics the process of natural selection..  to reproduce. By defining a binary variable wj problem. ∀i ∈ P(j). (10) tions that are represented by chromosomes. The pseudo codes of our proposed yij [δ − (tjs − tis )] δyij algorithm are shown in Algorithm 1. task i should be ready. Chromosomes ck in one population are randomly selected to produce a new k∈V population by crossover and mutation operations. MARCH 2015 . i.. ≤ zij ≤ . Second. the second term in the right next section. Otherwise. a threshold δ. i.e. we propose a fast algorithm based on genetic The relationship between tjs and tje can be expressed as: algorithm [22] to solve the JCOW problem. j ∈ N . we have yij = 0 because n <0 4: randomly select two chromosomes and apply aj and 0 < ai < 1. are selected for survival according to their fitness  that is evaluated using our objective function. 6: end for which means no other tasks are currently executing on it.  more suitable chromosomes are. The 7: evaluate all chromosomes in the population and per- device available time Tja of task j should satisfy the following form selection constraint: 8: end while X Tja ≥ xjk xik yij tie . The task ready JCOW: max wj time Tjr can be calculated by: j∈NW X n X eij xik xjl o wj ≤ zij . (8) i∈P(j) rkl i∈NW (k. (12) If task j and one of its predecessor i ∈ P(j) are assigned to Note that the MINLP problem is in general NP-hard. number of populations or improvement of the best solution. by including all 78 VOLUME 3. ai < aj . ∀j ∈ N . offspring. crossover operation Any task j ∈ N can start to execute when two conditions 5: randomly select one chromosomes and apply muta- tion operation are satisfied. (11) To apply the genetic algorithm. ∀j ∈ N . the assigned device should be available. 1. (7) k∈V mixed-integer nonlinear programming (MINLP) problem as tie where is the finish time of task i. the more chances they have 0. BASIC IDEA In this section. We have the following constraints for zij : for example. follows. ALGORITHM tjs = max{Tja . i. the the previous w-task j. data delivery between linear constraints. The chro- Finally.e. which are also referred to as w-task j starts within δ time from its previous w-task i.e. 2: while number of generations is not exhausted do aj −ai 3: for each population do Otherwise. such that a chromosome contains all variables to form previous w-task. it has received data X from all its predecessors in the task graph.e. The relationship Input: between yij and scheduling variables aj can be represented by: A task graph Ga . we are motivated to design a fast them can be implemented via shared memory without com- heuristic algorithm to approximate the optimal solution in munication delay. we define a binary variable zij to describe whether mosomes in the new population. ai > aj . so we have y35 = 1. First.e. A straightforward method is to define a variable as to represent whether w-task j starts within δ time from any a gene.

the resulting scheduling {1. which can FIGURE 4. and other tasks are scheduled according to their order in parent 2. The other child can be constructed in a similar way. 4. 7. [23] that always generates valid scheduling lists from two valid parent chromosomes. MARCH 2015 79 . For example. algorithm. 3. 5. Then. that are both infeasible because task 4 appears twice and somes {1. 2. 2) MUTATION OPERATION We conduct mutation operation by swapping two randomly selected tasks in the global scheduling list. {6. but in the order of the other parent. An example of mutation operation.e. 7. 4} as its first 4 elements. 8} is invalid because task 5 cannot start before task 3 according to the task graph. we create two chromo. As shown in Fig. 3) FITNESS EVALUATION The fitness of each chromosome is evaluated by the number of w-tasks that satisfy the just-in-time requirement. i. we set the crossover point in the middle of two chromosomes shown in Fig. crossover. Specifically. if we swap tasks 3 and 5 of the chromosome in Fig. standard crossover operation generates two children construction. 8}. and yij ) in a chromosome. 6.: Just-in-Time Code Offloading for Wearable Computing IN COMPUTING kinds of variables.. we only need to deal with task assignment now. In the {1. 2 to illustrate our chromosome Fig. As an example shown in task graph example in Fig. For example. 7. We still use the straints imposed by our task graph. FIGURE 5. Since each chromosome determines a task scheduling sequence. Note that such a mutation operation may generate invalid scheduling. 6. we give the detailed design of crossover and As standard crossover operations may violate the prece- mutation operations on our defined chromosomes. 5. it would 1) CROSSOVER OPERATION be difficult to guarantee its feasibility after crossover and To conduct crossover operations in the standard genetic mutation operations. following. 2. 5. (b) Order crossover. and exchange the portions beyond the crosspoint to generate we propose to create chromosomes for global schedul. such as the ones for task assignment (xik ) B. we create a child chromosome with {1. 3. IEEE TRANSACTIONS ON EMERGING TOPICS Cheng et al. NO. An example of crossover operation. 2. 4. we check every chromosome after mutation and abandon invalid ones. 8}. aj . 4(b). (a) Standard be obtained by solving a simplified optimization framework. 4. we adopt the order crossover opera- tion [22]. 3. Given a chromosome. 8} and {1. 3. which task 6 even does not show up in the generated chromosome represent two possible global scheduling sequences. two new chromosomes. 1. 2. we construct the right fragment of the child by taking the remaining parts of the first parent. 7. 4(a). this operation would ing only. and leave the determination of other variables lead to infeasible scheduling that violates the precedence con- to a simplified optimization framework. 7. 5. 6. Then. 4. dence constraints. 4. VOLUME 3. 2. 3. 5. 5. given any two parent chromosomes. 4(a). 8}. To guarantee the feasibility. DETAILED DESIGN and scheduling (uij . we randomly select a point as the crossover point. Instead of including all variables in a chromosome. variables related with task scheduling. Unfortunately. we first randomly choose a crossover point and pass the left segment from the first parent to the child.

each containing of a ij Tjr ≥ tie + . and SGO is always lower than OLGA. (10). 0 ≤ vkl ∀i. ∀j ∈ N . the constraint (14) can be linearized by requirement in Fig. j ∈ N . ∀i ∈ P(j). settings will be first introduced. whose node and link weights are Gaussian distributed with mean 100 and variance 10.e. ∀i. ∀k ∈ V . increases to 25. (9). OLN ŷij (δ − tjs + tis ) ≤ zij T .5%. SIMULATION RESULTS ∀i ∈ P(j). For example. vkl (15) task graphs [21] with 15 tasks. We use ûij . 40% of them are randomly selected as X eij vkl w-tasks. the discussion of solving the MILP problem is max wj . ij ≤ xik . Since we focus problem can be formulated as: on problem formulation and genetic-based algorithm design X in this paper. We create random networks. and then study the performance by changing ij as: one parameter while fixing others. (22) OLAC. ∀i ∈ P(j). ∀k. Although many variables and constraints are eliminated. the task assignment problem can be formulated as follows. such that performance of all algorithms decreases. and (21). We randomly generate ij = xik xjl .IEEE TRANSACTIONS ON EMERGING TOPICS IN COMPUTING Cheng et al. The simulation ≤ zij ≤ . ∀i ∈ P(j). ij ti . (23) has about 28% performance degradation as the number of ψij ≤ δŷij ∀i. âj . ∀i. ∀i. subject to: Tja ≥ wkij ŷij . it is much lower than OLGA because 80 VOLUME 3. (25) limited. j ∈ NW . (8). ∀j ∈ N . (9). and yij . (14) algorithm. Although OLAC can improve the (1). followed by simulation T tjs − tis results that demonstrate the advantages of our proposed (1). the performance of OLN. ∀k ∈ V . which will significantly Although above formulation is a mixed-integer linear reduce the complexity of solving the MINLP problem formu. (16)−(18). ∀k.l)∈E rkl relationship can be described as rMM −MM = γ rMM −WD = γ 2 rMM −RC . j ∈ NW . programming (MILP) that is generally NP-hard. NO. and show the percent of w-tasks that satisfy the just-in-time In a similar way. respectively. the introducing a new variable ψij = zij (tjs − tis ). (17) Offloading all to cloud (OLAC): we offload all tasks except xik + xjl − 1 ≤ vkl ij ≤ xjl . (20). ∀i ∈ P(j). and the task assignment bound and mathematical tools like CPLEX. it can be lated in last section. (16) wearable device. j ∈ NW . A. To linearise these constraints. (21) We first investigate the influence of number of tasks. We first describe a default simulation setting with a number we define a new binary variable vkl of parameters. and the default value of γ is 50. (20) tie − T (1 − vkk ij ) ≤ wkij ≤ ij . and greedily assign one by one in the following to the network node that results in the earliest finish φijk = vkk time. PERFORMANCE EVALUATION X subject to: Tja ≥ xjk xik ŷij tie . (13) k∈V In this section. 0 ≤ wkij ≤ tie . MARCH 2015 . omitted due to space limit. aj . and yij . (24) tasks increases from 5 to 25. uij . Constraint (15) can be equivalently replaced by the we also consider other three schemes as follows. All simulation results are averaged over 30 random instances. and their k∈V performance degradation is more obvious. the corresponding percent is 79. ∀j ∈ N . For example. j ∈ NW . ∀i.3% when X the total number of tasks is 5. j∈NW VII. As the number of tasks max wj . and (12). SIMULATION SETTINGS above formulation is still difficult to solve because of non- linear constraints (8) and (13). The link rate (k. (10). e (19) Our proposed algorithm is denoted by OLGA in the which can be equivalently replaced by: following. we conduct extensive simulations to evaluate ŷij [δ − (tjs − tis )] δŷij the performance of our proposed algorithm. l ∈ V . ∀i. ∀i ∈ P(j). 6. ∀k.: Just-in-Time Code Offloading for Wearable Computing i. To linearize constraint (13). ∀k ∈ V . l ∈ V . and imposing all tasks to it will seriously delay tjs − tis − T (1 − zij ) ≤ ψij ≤ Tzij .. j ∈ N . can be fixed. (18) w-tasks to the cloud. For comparison. OLN shows poor performance because the processing capability of wearable device is very 0 ≤ ψij ≤ tjs − tis . ∀j ∈ N . Meanwhile. percent of just-in-time tasks under OLGA is 94. aj . ∀j ∈ N . and ŷij to denote the fixed quickly solved by advanced algorithms like branch-and- values of uij . (26) the execution of w-tasks. leading j∈NW X to 18% degradation. following linear constraints: Offloading nothing (OLN): all tasks are executed at the wearable device. ∀j ∈ N . performance of OLN. l ∈ V . such that the constraint (8) can be written in a linear form as: Among these tasks. Tvkk B. j ∈ NW . ∀i. we define a binary Simple greedy offloading (SGO): we start from the first variable φijk as: task in the task graph. j ∈ N . As the number of tasks grows. 1. 3 mobile devices and the cloud.

respectively.5% as the number of mobile device grows to 5.5%. the performance of OLAC and OLGA in Fig. The performance increases to 87. As the VOLUME 3. Percentage of just-in-time w-task versus different number of mobile devices. the performance of our proposed algorithm increases as the number of mobile devices grows. among mobile devices will overwhelm the benefits of code offloading when more mobile devices are involved. when there is only one mobile device.: Just-in-Time Code Offloading for Wearable Computing IN COMPUTING The influence of mobile devices is investigated by changing its number from 1 to 5.4% under OLN. many tasks are assigned to the wearable device with low processing speed in OLN. there are less other tasks between any two w-tasks. As shown in Fig. Also.2% and 81.6%. we only show number of w-tasks.4%. Percentage of just-in-time w-task versus different 10 to 200. 49.8%. Since OLN is not affected by γ . two devices brings about 20% performance improvement compared with the case with only one device. the overhead of data exchange number of tasks. OLGA always outperforms the other three algorithms because too FIGURE 8. For example. 60%. MARCH 2015 81 . and the just-in-time requirement can be easily satisfied. their performance increases to 39. The frequent com- munication between wearable device and cloud still incurs significant delay. the percentage of just-in-time w-tasks are 18. However. the performance gap decreases to 6% when the number of mobile devices increases from 4 to 5. Moreover. We then study the effect of w-tasks portion by fixing the number of total tasks to 15. As shown in Fig. Percentage of just-in-time w-task versus different into the network. respectively. 71. when 10% w-tasks exist in the task graph. OLAC. SGO and OLGA.1% and 92. For example. NO. 8. The reason is that when more w-tasks exist. we observe that performance improvement becomes less as more mobile devices join the network. We study the influence of γ by changing its value from FIGURE 7. 9. For example.6%. when each w-task finishes. 1. First. the perfor- mance of all algorithm increases as number of w-tasks grows. Percentage of just-in-time w-task versus different value of γ . IEEE TRANSACTIONS ON EMERGING TOPICS Cheng et al. 7. Second. There are two reasons for this phenomenon. FIGURE 9. As the portion of w-tasks grows to 50%. and frequent message exchange happens between wearable device and cloud under OLAC. the computation capability of mobile devices has been fully exploited by our algorithm as more devices are added FIGURE 6. it delivers results to the cloud that will later return data for next w-tasks. 75. the percentage of just-in-time w-tasks is 25.

our proposed algorithm always outperforms MapReduce. the percentage of just-in-time w-tasks is significantly higher than OLGA because GA spends a large increases under both algorithms. U. [2] L. 337–368. 2013. ‘‘Hyrax: Cloud computing on mobile devices using in Fig. Execution time versus different number of tasks. no. 29–32. [Online]. Othman. pp.’’ IEEE J. Sep. Luo. Arnrich. S. Affective Comput.8% and 96. vol. 82 VOLUME 3. Setz. Technol. W. Ahmed. Extensive simulation results show that our proposal outperforms other three offloading strategies significantly. 75–82. 2685–2700. Niyato. when there are 10 tasks. 2014. we study the problem of task assignment and scheduling for a given task graph with the just-in-time objective. Chan. no. pp. 3. 2013. Tech./Mar. Int.. [7] A. A. no.’’ Sensors. vol. Percentage of just-in-time w-task versus different simulations on this paper. Inf. cooperative resource management in mobile cloud computing. Dec. M. and E. vol. the corresponding percentage increases to OLGA achieves the percentage of Schumm. we employ mobile devices nearby to form a local mobile cloud with low communication delay with the wearable device.. Khan. no. and T. We also observe that the performance gap between OLAC and OLGA decreases from VIII. Sel. 393–413. we compare our proposed algorithm with tradi. Jun. vol. ACKNOWLEDGMENT The authors would like to thank members in Computer Net- work Lab of the University of Aizu. La Marca. operations until we obtain feasible chromosomes. tional genetic algorithm (GA) that uses all binary variables as Feb.’’ IEEE Commun. Jing. 1. ‘‘Deploying a wearable computing platform for computing education.and Nariyoshi Chida for discussions and FIGURE 10.7%.’’ IEEE Trans.: Pittsburgh.. [5] C. Khan. 3. Madani. no. G. 31. number of tasks.. 2010. 1. The mutation operation [10] M. and S. the execution time of GA Rep. portion of time to generate feasible chromosomes. Electron. 2012. 5775–5790. C. R. Jul. Instead of offloading all codes directly value of γ . no. Cheung. pp. Venkatasubramanian. traditional GA. 410–417.’’ Carnegie Mellon Univ. taxonomies. Cloud Comput.’’ in can be conducted by randomly mutating a binary variable. Zhou./Sep. vol. B. Z. Feb. [3] G. 1602–1609. N. PA. Consum. [8] S. Vasilakos. 84. E. 10. respectively. pp. GA needs more then requirement under OLAC and OLGA. we investigate just-in-time code offloading for the communication overhead becomes less under larger wearable computing. [11] X. challenges. pp. P. Ehlert. 227–237.’’ IEEE Trans. Jul. Xin Fan and Zhitao Deng. ing their portions after the point. Surveys Tuts. [4] M. As shown [12] E. For example. REFERENCES [1] GoogleGlass. Ubiquitous Virtual Reality.e. 16. ‘‘Cloud- based augmentation for mobile devices: Motivation. Ngai. J. ‘‘A framework for genes. Learn. As γ 2 minutes to guarantee 86% just-in-time w-tasks. Y. Z. to the remote cloud. pp. vol. ‘‘Design of a wearable device for reading positive expressions from facial EMG signals. R. NO. As shown there are 40% and 80% w-tasks that satisfy the just-in-time in Fig. On the other hand. Symp.’’ in Proc. CONCLUSION 40% to 14% as γ grows from 10 to 200. J. Available: https://www. S. Buyya. Proc. pp. pp. Y. 2010.. Suzuki. and A.: Just-in-Time Code Offloading for Wearable Computing value of γ grows. 3. ‘‘From augmented reality to augmented computing: A look at we abandon them and repeat above crossover and mutation cloud-mobile convergence. 56. respectively. 12. 12. Mar. FIGURE 11. Abolfazli. ‘‘A survey of mobile cloud computing application models. Biomed. Huang. 45–55. when γ = 10. 16. Lee. Lau. Cheng. Kaewpuang. Wang. 5. R. Jan. ‘‘Discriminating stress from cognitive load using a wearable EDA device. E. 2010. 11.. Cho and C. Conf. the time interval between any two w-tasks that should be executed on wearable device cannot be greater than a threshold. and R.3% within 5 seconds. Areas Commun. CMU-CS-09-164. ‘‘MuSIC: Mobility-aware optimal service allocation in mobile cloud computing. 1. Aug. This prob- lem is proved to be NP-hard.’’ IEEE Commun. Marinelli.-H. vol. A. and an efficient code offloading algorithm based on genetic algorithm is proposed. Surveys Tuts. Sanaei. pp. and U. USA. 2009. C. i. while grows to 200. MARCH 2015 . We apply the crossover operation by randomly select. ‘‘A low-power real-time operating system for ARC (actual remote control) wearable device. 2014.-H. [9] R.’’ IEEE Trans. 2. If the generated chromosomes represent infeasible solutions. ing a crossover point for two chromosomes and exchang. [6] A. Technol. Hossain. Troster. ‘‘Magic ring: A finger- worn device for multiple appliances control using static finger gestures.. IEEE 6th Int. vol. no. and W. Gani.’’ IEEE Trans.IEEE TRANSACTIONS ON EMERGING TOPICS IN COMPUTING Cheng et al.. V. pp. 1. and open Finally. especially. 2009. Rahimi. 14. Y. Gruebler and K. D. In such a three-layer architecture. That is because In this paper. no. 5.

and F. Shahookar and P. He joined the University of Aizu. situation awareness.’’ in Proc. Technology. He is a member of the Asso. as an Assistant Aizu. Compil. 740–746. Cao. became an Associate Professor in 1999. ubiquitous learning. Professor. pp. Comput. 1989. 526–529. Xu. in 1990 and 1993. ‘‘Task allocation for distributed multimedia Professor. 2008.-T. MARCH 2015 83 . Irwin. Naik. in 2004 and [21] L. Dr. University. 64. 5. Synth. Canada. and R. degree in computer science from the Uni- and Dr. He has also been in Organizing and Technical Committees of Communication Engineers. ubiq. 1st ed. T. ubiquitous computing. Jun. and Ph.S. Wang. and distributed systems. ‘‘Studying energy trade offs in offloading computa- tion/compilation in Java-enabled mobile devices. Circuits Syst. Int. Chandramouli. Jigang and S.. degree in computer sci- partitioning and execution of data stream applications in mobile cloud ence with the University of Aizu. pp. vol. no. IEEE 5th Int. no.. Li. degrees from the University of Elastic execution between mobile device and cloud. 31–35. Vijaykrishnan. 1993. Wuhan. [17] Z. His inter. Conf. MA. S. 2004. and G. Popek. T. Aizuwakamatsu. Comput. since 2014. 9. pp. respectively. Oct. Kang. 2. and the [14] B. Syst. numerous international conferences. pp. 9. Cloud Comput. He has authored over distributed algorithms. Conf. Parallel Distrib. Xu. Guo systems. no.-G. He is a Senior Member of the ACM. Institute of Electronics. University of Aizuwakamatsu. Inf. and Jan. His research inter- Professor. N. cross-layer optimization.. 1. pp. ‘‘A computation offloading scheme on handheld trical engineering and automation and M. ACM 6th Aizu. Thambipillai. Conf. pp. in 2007. computational communication systems.’’ in Proc. NO. Veh. Syst. Li. 6. M. and A. Computer Science and Engineering.’’ in Proc. Japan. Optimization. distance education. Japan. Boston. USA: Addison-Wesley. pp. functional safety. [16] A. Oberheide.. China. uation of wireless and mobile networks for reliable. Japan. computing. His research interests include processing on wirelessly networked handheld devices. 1998. P.’’ IEEE Trans. 250 papers in refereed journals and conferences uitous computing. performance eval- SIGMOBILE Mobile Comput. in 2009 and 2012.. Kuenning. in 2005.: Just-in-Time Code Offloading for Wearable Computing IN COMPUTING [13] J. 238–246. Goldberg. in 2011. degree devices. vol.E. ests are mainly in the areas of protocol design and has been a Full Professor since 2002. and Machine Internet of Things. 15–19. IEEE TRANSACTIONS ON EMERGING TOPICS Cheng et al. Archit. in 1993. 794–802.’’ ACM cloud computing. and performance analysis for wireless networks ests are design and implementation of protocols. the Head of the AND DISTRIBUTED SYSTEMS. ‘‘Saving portable computer battery power through remote process execution. Chen. where he is currently an Associate pp. Symp.. J.’’ in Proc.. Ihm. Degrees in engineering from the Tohoku versity of Ottawa. Ottawa. Int. Wang. Chun. Conf. and Internet of Things.’’ J. M. where he is currently an Associate [15] Z. [23] K. and wireless sensor networks. China. Aizuwakamatsu. Flinn. Li. 2011. Rudenko. Japan. Dec. Mazumder. SONG GUO (M’02–SM’11) received the ZIXUE CHENG (M’95) received the master’s Ph. 4th IEEE Int. ‘‘A framework for 2007. 2004. E. Cooke. [19] G. energy-efficient. and R. C. ‘‘A branch-and-bound algorithm for hard- ware/software partitioning. Embedded Syst. 301–314. Qinhuangdao. 500–511. E. [20] C. and on the editorial boards of many ciation for Computing Machinery. His current research interests include [22] D.’’ in Proc. Patti.. He is currently a Full Professor at the School of respectively. 2001.. Wang and Z. P. an Associate Editor of the IEEE TRANSACTIONS Division of Computer Engineering from 2010 to 2014.S. B. ‘‘CloneCloud: M. ‘‘A genetic approach to standard cell placement using meta-genetic parameter optimization.-Aided Design Integr. 1.. S. H. Information and others. K. C. Yang. Reiher. May 1990. embedded in these areas and received three IEEE/ACM best paper awards.E. Chan. Parallel JUNBO WANG received the B. S. Commun. no. degree in elec- Distrib. ON. J. vol. Sendai. Inf. He served as the director currently serves as an Associate Editor of IEEE TRANSACTIONS ON PARALLEL of University Business Innovation Center from 2006 to 2010. Li. Genetic Algorithms in Search.’’ in Proc. 1st from the Huazhong University of Science and Workshop Virtualization Mobile Comput. University. cost-effective communications. network coding. PENG LI (M’11) received the B. Rev.D. and A. Signal Process. 19–26. Sep. pp. J.D. Technol. M. Japan. ‘‘Computation offloading to save energy on handheld devices: A partition scheme.. Maniatis. cooperative communications. Aizuwakamatsu. 15.. pp.D. and has been the vice ON EMERGING TOPICS IN COMPUTING with duties on emerging paradigms in president of the University of Aizu. Tang. Veeraraghavan. Navigat. context/ Learning. [18] W. and R. Syst.’’ IEEE Trans. Comput. in electric circuits and systems from YanShan Jun. VOLUME 3. vol. smart grid. and the Ph. G. 2012. and Information Processing Society of Japan. Jahanian. J. degree ‘‘Virtualized in-cloud security services for mobile devices. 2004. 795–809. IEEE-IEE networking modeling. Kandemir.