An Optimal Online Resource Allocation Algorithm for Energy Harvesting Body Area Networks

.


Introduction
According to the sixth national census report, the trend of population aging is aggravating year by year.People over 60 years of age account for 13.26% of the total population.People over 65 years of age account for 8.87% of the total population [1].The aging of the population has brought us a series of related questions [2].It is expected that about half of the medical resources will be used to solve the health problems of the elderly in future, which will be a serious challenge for the allocation of limited current medical resources.Chronic diseases have been a threat to human survival [3].Heart disease, malignancy, cerebrovascular disease, chronic respiratory disease, influenza and diabetes are the deadliest cause of death [4,5].Traditional medical care is that the doctor test and treat patient through the medical equipment in hospital.This requires that patients lie in the bed and connect a large number of lines, which not only greatly limits the patient's range of activities but also cannot complete the early diagnosis and remote health-care [6][7][8].Moreover, more and more wireless networks are used.Electronic devices are also becoming smaller and smaller [9].In such conditions, BANs have developed.
Body area networks have gained momentum as a means of monitoring people's behavior, which are networks attached to the human body [10].BAN is composed of some small and mobile sensors with communication capability, whose design problem is often addressed through mathematical optimization techniques (e.g., [7,[11][12][13]).By implanting these sensors into the human body or wearing them on the human body, they form a local area network.These sensors detect the patient's physiological signals in real time [14,15].In addition, they can collect and transmit patient's physiological signals at home and at random [16].Therefore, researchers are paying more and more attention to the use of BANs.In a BAN, each patient wears sensors on the body or embeds special sensors in the body that can continuously monitor the various physiological signals of the body and transmit it to the personal device wirelessly.Then, the information can be transmitted through the external network to the medical system.By analyzing and dealing with the collected data, the physiological signals of the human body are diagnosed, and the early diagnosis is completed, thus ensuring the safety of human life.
However, the BANs are facing great challenges.One of the most serious challenges is the energy efficiency [17].How to supply a sensor is related to how to provide a lasting service for BANs.At present, most of the sensors in BANs are configured with batteries, but the battery capacity is very limited [18][19][20].Considering the friendliness to patients, we cannot replace the battery frequently [21].More importantly, some physiological signal sensors, such as implanted blood pressure sensors, implanted PH sensors, they are implanted into the human body, so we cannot replace the battery.In this condition, energy harvesting technology is developed [22].Energy harvesting technology is very important to prolong sensor's lifetime in BANs [23].Many implanted sensors require a long lifetime.For example, a pacemaker or a glucose monitor would require a lifetime lasting more than five years [2].By using energy harvesting technology, sensors harvest energy from the renewable sources in the area of interest [24].In fact, the sensor in BANs is equipped with energy harvesting modules [25], which provide a time-independent amount of energy with respect to the batteries.The sensor harvest energy to collect data and transmit it.
In this paper, we investigate the energy efficiency in BAN that consists of a number of medical sensors, by jointly considering the data buffers and energy buffers' management.The sensor collects data and saves in its data buffers, and so does the energy.The channel condition is changing all the time and its variations are complex and unpredictable due to motion and shadowing effects of the human body.We use Lyapunov optimization theory and propose a resource allocation algorithm to achieve close-to-optimal time average user utility.The contributions of this paper are the following: 1.
By using energy harvesting technology, the lifetime of the system is greatly prolonged.Energy harvesting technology is very important to the BAN system.Sensors harvest energy from the renewable sources.We propose a framework to characterize the stochastic nature of the energy harvesting and energy consumption, we do not need any a priori knowledge of these stochastic processes.

2.
We propose an optimization problem to maximize the user utility.We use Lyapunov optimization approach to decompose the user utility optimization problem into three sub-problems, i.e., battery management, collecting rate control and transmission power allocation.We propose an optimal online resource allocation algorithm that makes decisions at the beginning of each time slot and then updates queues, and achieves close-to-optimal time average user utility.
The remaining parts of the paper are organized as follows.Related works are reviewed in Section 2. The system model is presented in Section 3. A resource allocation algorithm is proposed in Section 4. We analyze the performance of the proposed algorithm in Section 5. Simulation results are provided to evaluate the performance of the proposed algorithm in Section 6. Section 7 concludes this paper and future works.

Related Works
In [26], the authors design two algorithms to optimize the network utility.The first algorithm computes the data sampling rate and routes.To avoid missing opportunities for energy harvesting, the second algorithm is designed to adapt the sampling rate with the objective of maintaining the battery at a target level.The authors of [27] design a data gathering optimization algorithm to optimize data gathering in terms of network utility by jointly considering data gathering and data transmission.
A novel method has been considered to improve the performance of on-body communication by harvesting energy from ambient sources in and around the human body in [28].In [19], a selective gateway method based on the residual energy of the sensors has been proposed, to further increase the lifetime of the BANs, a thermal energy harvesting system has been proposed to harvest heat energy from human warmth.In [29], Zhang et al. develop a distributed sampling date control (DSRC) algorithm to decide the sampling rate for each rechargeable sensor node with a limited battery capacity while maximizing the network performance.Literatures [26,27,29] are assumed to have a good prior knowledge of energy harvesting.Practically, this is not true because energy harvesting is a dynamic and random process.We cannot predict it.In [30], Huang et al. design an online energy-limited scheduling algorithm(ESA), which jointly manages the energy and makes power allocation decisions for packet transmission, and does not require any knowledge of the harvestable energy process.In [31], the authors propose an intelligent solar energy-harvesting system for supplying a long term and stable power.In [32], the authors propose two new and insightful performance criteria to evaluate the new class of hybrid networks that comprise both energy harvesting and conventional nodes.
In [33], the authors propose a mathematical model that focuses on the maximization of the lifetime of the path of nodes involved in a data flow.In [34], the authors propose a global routing protocol based on Dijkstra's algorithm with a novel link cost function specialized for balancing energy consumption.In [35], the authors propose an integer linear programming model that optimizes the number and location of relays while minimizing the energy consumption.In [36], the authors maximize network lifetime based on joint resource allocation scheme for BANs.The authors show that the problem of optimizing network lifetime is equivalent to maximizing the residual energy of sensor nodes.The proposed scheme is capable of extending the lifetime of network as well as guaranteeing user quality of service (QoS) requirements.In [37], the authors propose a formulation to reduce the energy consumption of BANs through monitoring and eliminating the spatial correlated contention in the BANs sensors while avoiding multiple nodes sending the same data to prolong the sensor and network lifetime.In [38], the authors propose an energy-efficient fuzzy formulation based on adaptive routing protocol to prolong the network lifetime.This protocol is based on clustering protocol that makes use of direct transmission technique depending upon the criticality and the location of the sensor.The authors in [39] present an adaptive interference mitigation scheme for multiple coexisting BANs based on social interaction to reduce energy consumption.The energy consumption is reduced by optimizing the transmission time by synchronous and parallel transmission.However, literatures [34][35][36][37][38][39] just consider how to save energy or balance energy consumption, without considering harvesting energy from outside.It is not enough to prolong the lifetime of BANs.Lyapunov optimization theory [40] is a framework to combine stability and optimization techniques.It takes account of both the stability of the system and user utility maximization objectives [41].
Firstly, the above-mentioned works assume having good a priori knowledge of energy harvesting.Practically, this is not true because energy harvesting is a dynamic and random process.We cannot predict it.Secondly, the above-mentioned works consider how to save energy or balance energy consumption, without considering harvesting energy from outside.It is not enough to prolong the lifetime of BANs.They cannot meet the requirements of energy in BANs.Therefore, to solve the problem, this paper proposes a framework to characterize the stochastic process of energy harvesting and we design a problem formulation to maximize the user utility.

System Model
In this section, we present the system model of BAN and the optimization problem formulation.It is interesting to note that the BAN optimal design problem presents many connections with general wireless network design problem (see e.g., [42][43][44]).We consider a body area network, consisting of a personal device and N lightweight sensors, such as those shown in Figure 1.Let N = {1, 2, 3, • • • , N} denote the set of sensors.The system time is partitioned into time slots of constant duration, denoted by t.Let T = {1, 2, 3, • • • , T} denote the set of time slots.Each sensor has two queues: data queue and energy queue.Data queue is used to describe data collection and data transmission.Energy queue is used to describe energy consumption and energy harvesting.

Collecting Rate and Utility
In time slot t, let c n (t) represent the collecting rate of sensor n carried by the patient in BAN.c n (t) follows an independent and identical distribution.We assume that the collected data have a finite maximum c max , so that 0 The collecting rate is associated with a user utility function U n (c n (t)), which is a concave function over the interval 0 ≤ c n (t) ≤ c max with a bounded first derivative U n (c n (t)) and U(0) = 0 [23].We assume that utility function U n (c n (t)) has a finite maximum slope of ν.

Data Transmission
We let p n (t) denote the transmission power of sensor n carried by patient in time slot t.In the BAN, the sensor has a maximum transmission power p max .The following inequality must be satisfied: We use β n (t) to denote the signal to interference plus noise ratio of sensor n.According to the Shannon formula, the transmission rate r n (t) is defined as r n (t) = log(1 + Kβ n (t)).Here, K denotes the processing gain.Since log(Kβ n (t)) is very close to log(1 + Kβ n (t)), so we let We use sleeping mode to achieve opportunistic transmission.During the sleeping mode, the sensor just can collect data, cannot transmit data.We use z n (t) to denote the sensor's mode.If the data queue length is greater than L, which is a constant, z n (t) = 1, else z n (t) = 0.

Energy Consumption Model
c n (t) is the collecting rate of sensor n carried by patient in time slot t.We save the data in its data buffer.The energy consumption of collecting data is a linear function of c n (t) and is denoted by αc n (t).Thus, the total energy consumption a n (t) of sensor n carried by patient in time slot t is The total energy consumption is bounded by a n (t) ≤ αc max + p max , ∀n ∈ N. We use a max = αc max + p max to denote the upper bound of any sensor's energy consumption.

Queues Dynamic Model
We define I n (t) as the data queue occupancy of sensor n carried by patient and I(t) = {I 1 (t), I 2 (t), I 3 (t), • • • , I N (t)} represents a vector with the length of data queues of all sensors in time slot t.The data queue is given by: We define J n (t) as the energy queue occupancy of sensor n carried by patient and J(t) = {J 1 (t), J 2 (t), J 3 (t), • • • , J N (t)} represents a vector with the length of energy queues of all sensors in time slot t.The energy queue is given by: where h n (t) is energy harvesting rate.The harvested energy comes from movement and other stable energy sources like body heat.In addition, the energy harvesting rate is bounded by the energy supply rate e n (t), which determines the amount of harvestable energy of sensor.
Ω is a limited battery capacity.The total energy stored in battery is limited by the battery capacity Ω.Thus, in time slot t, the sum of the energy left in energy queue J n (t) and harvested energy h n (t) must be less than the battery capacity.Then, the following inequality should be satisfied in each time slot:

Optimization Problem Formulation
Based on the aforementioned models, a stochastic optimization problem is formulated whose goal is to maximize the time-average user utility of BANs.U n (c n (t)) is a concave function over the interval 0 ≤ c n (t) ≤ c max .We let O n (t) = U n (c n (t)).The time-average user utility can be written as We use c(t), h(t) and p(t) to denote collecting rate c n (t), energy harvesting rate h n (t) and transmission power p n (t).We define Y(t) = (c(t), h(t), p(t)) to represent the set of variables.To maximize the time-average user utility, we formulate a stochastic optimization problem as follows, subject to the constraints Equations ( 1) to (7).
(UEDP) max (1) to (7).(9) By optimizing the set of variables Y(t), we maximize the stochastic optimization problem.In the following section, we use Lyapunov optimization approach to decompose UEDP into a series of deterministic subproblems in each time slot.

Lyapunov Optimization
Laypunov optimization theory introduces a method to control the utility problem.We adopt Laypunov optimization theory to decompose the objective into optimization goals for each time slot.We define Θ(t) = (I(t), J(t)) as the network state in time slot t that represents the length of data queue and energy queue.We define a Laypunov function, L(t), as the sum of squares of backlogs in the data queues and the spare capacity in sensors' batteries.
where J n (t) = Ω − J n (t) denotes the spare capacity battery of sensor n.Laypunov function L(t) is a scalar to measure the occupancy of data queue and energy queue.A small value of Laypunov function L(t) means a small length of data queue and a full battery of capacity.According to the characteristics of the data queue and energy queue, L(t) is time coupled.We define the conditional Lyapunov drift, denoted by for converting time-coupled problem to non-time-coupled problem.Our goal is to minimize ∆(t) in each slot time.The data queue is pushed towards zero to stabilize the data queue.The energy queue is pushed towards their battery capacity Ω to guarantee having enough energy for data collection and data transmission.
The maximum user utility has not yet been incorporated in Laypunov function L(t).We include a weighted version of user utility into the Lyapunov drift.We use the ∆ to substitute the ∆(t), where V is a weight, which means how much we emphasize on user utility.Minimization of ∆ V (t) can minimize the ∆(t).By minimizing ∆ V (t), we can achieve two goals: (1) stabilizing the BAN system; and (2) maximizing the user utility.The drift-minus-utility ∆ V (t) is a quadratic function of the queue lengths and variables in Z(t), and we can derive the upper bound of ∆ V (t).Minimization of ∆ V (t) by minimizing its upper bound.Theorem 1.Given the network state, the upper bound of ∆ V (t) is: where B is a finite constant and independent of V, whose expression is following: and D V (t) is expressed as Proof.See proof of theorem 1.We minimize ∆ V (t)'s upper bound to minimize it.Since B is a constant, we minimize D V (t).

Sub-Problem Solution
D V (t) is relevant to the set of variables Y(t) = (c(t), h(t), p(t)), so we divide D V (t) into three parts according to the Y(t) = (c(t), h(t), p(t)).Each part is a sub-problem that needs to be optimized.These sub-problems are battery management, collecting rate control and transmission power allocation.The sub-problem of battery management optimizes the energy harvesting rate h n (t), which requires information on the energy queue occupancy J n (t) and energy supply rate e n (t).The sub-problem of collecting rate control optimizes the collecting rate c n (t), which requires information on the energy queue occupancy J n (t) and data queue occupancy I n (t).The sub-problem of transmission power allocation optimizes transmission power p n (t), which requires information on the energy queue occupancy J n (t), data queue occupancy I n (t), and transmission rate r n (t).In the following, we will solve the sub-problems separately.

• Battery Management
The sensor should harvest energy as much as possible for data collection and data transmission.
The system is stable only if the energy in the system is sufficient enough.In this sub-problem, we need to optimize energy harvesting rate h n (t).To keep the BAN system running, we should try to charge the battery of sensor n carried by patient as much as possible.For each sensor n ∈ N, combining the first term of D V (t) with the constraint Equation ( 9), we have the optimization problem of h n (t) as follows: The problem is linear of h n (t).In time slot t, we can get the value of energy queue occupancy J n (t).Thus, minimize the optimization problem just to maximize the h n (t) with the constraints.
If the battery of sensor n carried by patient is full, J n (t) equals 0, and we do not need to harvest energy, h n (t) = 0.If the battery is not full, J n (t) ≤ Ω and J n (t) ≥ 0, we need to harvest energy as much as possible, h n (t) = min(Ω − J n (t), e n (t)).According to the above, we can get h n (t) = 0, else.

• Collecting Rate Control
In this sub-problem, we consider data scheduling of sensor n carried by patient in BAN.We optimize the second part of D V (t) while ensuring the constraint Equation (1).We have the optimization problem of c n (t) as follows: In time slot t, we can get the values of energy queue occupancy J n (t) and data queue occupancy I n (t).α and V are constants.Thus, minimize the optimal problem just need to optimize the collection rate c n (t).According to Section 3.1, we can get that the utility function U(c n (t)) is a concave function; thus, the problem is convex.According to the convex optimization, let the collecting rate c * n (t) be the unique optimal solution, and we can get:

• Transmission Power Allocation
In this sub problem, we consider transmission power allocation of sensor n carried by the patient.We optimize the third part of D V (t) to get the optimal transmission power.Combining the third term of D V (t) with the constraint Equation ( 2), we have the optimization problem of p n (t) as follows: ∑ i=1, i =n p i (t) .Substituing the expression of β n (t) into r n (t).According to the nature of logarithmic function, we can get log(K We can get the value of log(∑ i=1,i =n p i (t)) in time slot t, and log(K) is a constant.Thus, the minimization problem can transform to min In time slot t, we can get the values of energy queue occupancy J n (t), data queue occupancy I n (t), and z n (t).They are constants in time slot t.Thus, minimization of the optimal problem just needs to optimize the transmission power p n (t), and the logarithmic function is concave.Thus, the problem is convex.Let the transmission power rate p * n (t) be the optimal solution, and we have:

Proposed Algorithm
In this subsection, we present an online resource allocation algorithm in Algorithm 1.The idea of this algorithm is to obtain the optimal harvested energy h * (t), collecting rate c * (t) and transmission power p * (t) according to the above subproblems firstly.Then, the algorithm updates data queues and energy queues according to Equations ( 5) and ( 6) in each time slot.There are four parts included in the online resource allocation algorithm.The first part is mainly to solve the sub-problem of battery management to achieve the optimal harvested energy h * (t) in time slot t.The second part is mainly to solve the sub-problem of collecting rate control to achieve the optimal collecting rate c * (t).The third part is mainly to solve the sub-problem of transmission power allocation to achieve the optimal transmission power p * (t).The fourth part is mainly to update the data queue occupancy I n (t + 1) and energy queue occupancy J n (t + 1) based on the results of the previous three parts.Figure 2 shows the three subproblems and the data flows among them.

Performance Analysis
In this section, we analyze the performance of the proposed online resource allocation algorithm.This section is divided into three sections: Section 5.1 Required Battery Capacity, Section 5.2 Bounded Data Queues and Section 5.3 Optimality of the Proposed Algorithm.Section 5.1 shows the battery capacity that we need to support the operation of BAN system.Section 5.2 shows that the data queues are bounded.Section 5.3 shows the gap between user utility achieved by the proposed algorithm and the optimal utility.

Required Battery Capacity
Only if there is enough energy in the battery of sensor n carried by the patient, the BAN system can have a stable operation; otherwise, it will not collect data or transmit data.Thus, we can get the required battery capacity in such a way that if the available energy is less than the maximum energy consumption, i.e., J n (t) ≤ a max , the sensor will not collect data or transmit data.Theorem 2 has shown the required battery capacity.
Theorem 2. The required battery capacity Ω supporting to the operation of BAN system is given by : Sensors will not collect and transmit data, i.e., c n (t) = 0 and r n (t) = 0 if and only if J n (t) ≤ a max , i.e., length of energy queue is less than the maximum of energy consumption.
Proof.See proof of theorem 2. To enable the BAN system to operate under the proposed resource allocation algorithm, the sensor n must be equipped with a battery of capacity Ω.

Bounded Data Queues
In this subsection, we give a theorem about bounded data queue of sensor n carried by patient.In order to ensure the stability of the BAN system, the data queue must be bounded.We use the constant I max to represent the upper bound of data queue.In Theorem 3, we give a theorem on upper bound of data queue.Theorem 3. The upper bound of data queue consists of weight V, slope of user utility function ν and the maximum of collecting rate c max .It is given by I max = Vν + c max .The length of data queue does not always exceed the upper bound: This inequality is satisfied at time t = 0.
Proof.See proof of theorem 3. From Theorem 3, the upper bound of data queue increases linearly with the weight V. To enable the BAN system to operate under the proposed resource allocation algorithm, the sensor n must be equipped with a data buffer of size I max .

Optimality of the Proposed Algorithm
In Theorem 4, we analyse the optimality of the proposed resource allocation algorithm.We show the performance gap between the user utility achieved by the proposed algorithm and optimal utility.Theorem 4. We define O and O * as the proposed algorithm user utility and optimal utility, and the performance gap between them is satisfied: Proof.See proof of theorem 4. B is a constant.There is a B V performance gap between the user utility achieved by proposed algorithm and optimal utility.It is easy to know that the user utility increases with the increase of V, and illustrate that V means how much we put an emphasis on user utility.It also shows that user utility function is a concave function.

Simulation Results
In this section, we present simulation results to evaluate the performance of the proposed online resource allocation algorithm.We consider a BAN system composed of five medical sensors.We set the system time T = 5000, the processing gain K is uniformly distributed between (0.9, 1.1), the maximum collecting data rata c max = 50, the maximum transmission power p max = 0.02 W, the upper bound of energy supply e max = 2; α = 5 × 10 −4 and upper bound of energy consumption a max = 0.04.Similar to [23], we define a concave utility function U(c n (t)) = log(1 + c n (t)), ∀n ∈ N and ν = 1.
Figure 3 presents the data queue dynamics with different V.As we can see from the figure, the larger the V, the longer the data queue length.This means that more data buffer is needed.After a period of time slot, the data queue is stable around a fixed value with small range of fluctuation, as shown in Equation (17).This means the BAN system is stable.In the initial stage, the data queue is very short, and the battery is fully charged.It can allow collecting a lot of data, so the data queues are growing very fast.
Figure 4 presents the energy queue dynamics with different V.As we can see from the figure, the energy queue is in a steady fluctuation.This is because the sensor consumes energy when it collects data and transmits data, and the process of harvesting energy is time varying and random.In addition, we can know that length of the energy queue will not exceed the capacity of the battery.In time slot t = 0, the value of energy queue is equal to the battery capacity, that is, the battery is full of energy.Figures 5 and 6 present the time-average data queue length and energy queue length.From these figures, we can see that the time-average queue length increases linearly with the increase of weight V, as shown in Equations ( 16) and (17).From Figures 3-6, we can get that the queue quickly stabilized around a time-average length.From Figures 5-7, we can get that, if we want to get more user utility, we will need a longer data buffer and a larger battery capacity.  Figure 7 shows the user utility.Under different values of V ranging from 100 to 500, the user utility increases from 1.8 to 3.1.We can see that the user utility grows rapidly with the increase of V in the initial stage, and then the growth of user utility slows down.This shows that user utility is a concave function of V, as shown in Equation (18).

Conclusions
In this paper, we developed an online resource allocation algorithm for BANs that maximizes user utility subject to energy limitation.This algorithm is an online algorithm and does not require any a priori knowledge of the the energy harvesting process and data collection process.We consider that the energy harvesting technique in BANs and energy sources come from renewable energy, such as body heat and kinetic energy.To save the energy consumption, we use the sleeping mode.We use Lyapunov optimization approach to decompose the user utility optimization problem into three sub-problems, i.e., battery management, collecting rate control, and transmission power allocation.For the optimality gap and the bounds of energy queues, data queues have been derived.Simulation results test and verify the performance of BAN system, as well as the proposed algorithm.
For our future work, we plan to investigate channel allocation problem based on Game Theory of the BANs.We consider the interference between sensors.Moreover, the communication of health related information between sensors in BANs and over the internet to servers is strictly private and confidential, so we plan to investigate security and privacy.

Figure 2 .
Figure 2. Parameters update diagram of the algorithm.