CRCM: A New Combined Data Gathering and Energy Charging Model for WRSN

.


Introduction
Wireless sensor networks (WSNs) are used to monitor different environmental parameters in different domains, such as the military, medical treatment, and so on [1][2][3]. Sensor nodes are deployed randomly in an area to sense environmental parameters, such as temperature, humidity, and light. After collecting data, sensor nodes need to deliver it to the sink in each cycle. However, since the sensor nodes cannot be recharged, in general, the lifetime of the WSNs is limited by the battery capacity of the sensor nodes.
Many researchers have researched some effective approaches for prolonging the lifetime of the network. Some researchers focused on reducing the energy consumption of the battery, but the limited capacity of the battery restricts the lifetime of WSNs eventually. Other researchers have considered rechargeable batteries, the WSNs being updated to a wireless rechargeable sensor network (WRSN). To replenish energy to the batteries, the paramount consideration is the nature of the energy, such as solar energy, thermal energy, and wind energy [4]. Though the lifetime of the WRSN is obviously prolonged, with the unstable state of the external condition and low charging efficiency, sensor nodes could still exhaust their energy at any time. This scheme cannot actually solve the limited energy problem of the sensor nodes.

1.
To reduce the energy consumption to the largest extent, we consider the MC as a moving sink to gather sensing data from sensor nodes when charging them. A new recharging model, combined recharging and collecting data model on-demand (CRCM), was established in which the MC will recharge the on-demand sensor nodes and collect all of the data of the sensor nodes in the cluster at the same time.

2.
To establish the CRCM, we have considered the hexagon-based [21] (HB) algorithm to sort all sensor nodes into different clusters. While NJNP cannot satisfy the scheduler with high charging efficiency to structure the charging path, we then consider both the residual energy and geographic position of each sensor node, the REGP algorithm is proposed to calculate the priority of each cluster, and the charging queue is ultimately established. 3.
In a large WRSN, we have also considered the multi-MC's algorithm to adapt the increasing quantity of sensor nodes. To make sure no sensor nodes exhaust their energy while waiting for the next charging cycle, we have calculated the longest cycle time a MC can serve. The DMC algorithm is subsequently raised to solve the least number of MCs problem. 4.
The remainder of this paper is constituted as follows: in Section 2, we have discussed the related works about previous studies and experiments of WPT; in Section 3 we have shown the system model and three algorithms to solve the problems; then some simulations have been realized to compare each parameter to Earliest Deadline First (EDF) [22] and NJNP in Section 4; and, finally, we conclude this paper in Section 5.

Related Works
To prolong the lifecycle of the network, two methods are supplied as 'energy saving' and 'energy acquiring'. 'Energy saving' is the most direct approach. Sensor nodes can be alive and turned off to reduce the energy consumption, because not all the sensor nodes need to be alive for the WSNs to be functional [23]. The selected sensor nodes can be alive to form a connected wireless network, and the inactive sensor nodes can be turned off to prolong the lifecycle of the WSNs. Liu has proposed an algorithm called distributed cooperative communication nodes control (DCCNC) to achieve higher reliability communication and longer network lifetime [24]. They have proposed an algorithm to determine the appropriate number of sensor nodes to participate in the cooperative communication and, as a result, the resource is constrained. In 'energy acquiring' aspect, Yang has used the solar energy to avoid battery exhaustion as well as maximizing the per-node utility [25]. To adapt the time-varying solar energy, the energy monitoring and prediction is also very important by energy-aware support. With the development of WPT, MC carries certain energy to travel to different sensor nodes with an optimal path. Xie has an overall consideration about the traveling path, stop points, charging schedule and the flow routing [26]. The charging path is optimized by the stopping points comparing to stopping at the location of sensor node with the shortest traveling distance.
However, data gathering and energy charging have always been discussed separately in recent years, Hu and Wang have studied the optimization of charging and data collection in a WRSN, and they have solved the problem about how to allocate the insufficient energy to the sensor nodes and deciding their corresponding data sensing rates [27]. Data gathering and energy charging can be replenished by MCs. Liu has proposed novel methods to distribute the sensor nodes, and also calculated the number of MCs [28]. In this paper, we consider the energy charging and data gathering at the same time by a MC [29][30][31]. With the data collecting by MC, the energy consumption of a sensor node can be decreased significantly. Figure 1 shows the energy consumption of a sensor in the whole process. We can see the transport and receiving modules consume the most of the energy, the idle listening module also belongs to the communication part, and the energy consumption of communication follows the formula E = kd n (2 < n < 4), the parameter n is influenced by the communication distance, i.e., when the communication distance is long, the parameter n will be also larger, and, meanwhile, the communicating consumption of the sensor node will increase [32,33]. monitoring and prediction is also very important by energy-aware support. With the development of WPT, MC carries certain energy to travel to different sensor nodes with an optimal path. Xie has an overall consideration about the traveling path, stop points, charging schedule and the flow routing [26]. The charging path is optimized by the stopping points comparing to stopping at the location of sensor node with the shortest traveling distance. However, data gathering and energy charging have always been discussed separately in recent years, Hu and Wang have studied the optimization of charging and data collection in a WRSN, and they have solved the problem about how to allocate the insufficient energy to the sensor nodes and deciding their corresponding data sensing rates [27]. Data gathering and energy charging can be replenished by MCs. Liu has proposed novel methods to distribute the sensor nodes, and also calculated the number of MCs [28]. In this paper, we consider the energy charging and data gathering at the same time by a MC [29][30][31]. With the data collecting by MC, the energy consumption of a sensor node can be decreased significantly. Figure 1 shows the energy consumption of a sensor in the whole process. We can see the transport and receiving modules consume the most of the energy, the idle listening module also belongs to the communication part, and the energy consumption of communication follows the formula (2 4) n E kd n = < < , the parameter n is influenced by the communication distance, i.e., when the communication distance is long, the parameter n will be also larger, and, meanwhile, the communicating consumption of the sensor node will increase [32,33]. The TX91501 (Powercast, 620 Alpha Drive, Pittsburgh, PA, 15238, USA) is a typical charging equipment produced by Powercaster. In order to study the WPT efficiency of TX91501 [34], we have performed an experiment to contrast the efficiency of different distance. With the change of the distance between the TX91501 and the spectrum analyzer (GSP-730 manufactured by GWINSTEK), we have calculated the valid and farthest distance. Figure 2b shows the efficiency change of different distances: in reality, the efficiency is higher when the distance is lower, and the farthest distance is 50 cm. The TX91501 (Powercast, 620 Alpha Drive, Pittsburgh, PA, 15238, USA) is a typical charging equipment produced by Powercaster. In order to study the WPT efficiency of TX91501 [34], we have performed an experiment to contrast the efficiency of different distance. With the change of the distance between the TX91501 and the spectrum analyzer (GSP-730 manufactured by GWINSTEK), we have calculated the valid and farthest distance. Figure 2b shows the efficiency change of different distances: in reality, the efficiency is higher when the distance is lower, and the farthest distance is 50 cm.
Then we give the equation about the relationship between the efficiency ε and the distance d. The valid and farthest distance is D/3, and when the charging distance exceeds d, the efficiency is too small that we do not put up with [35,36].
Then we give the equation about the relationship between the efficiency ε and the distance d . The valid and farthest distance is 3 D , and when the charging distance exceeds d , the efficiency is too small that we do not put up with [35,36].

System Model
Some useful symbols are defined in Table 1.

System Model
Some useful symbols are defined in Table 1. Residual energy of sensor node S i in cluster C j when reporting to the sink L The length of the region θ Charging threshold V c The traveling velocity of MC d The valid and farthest charging distance τ j The serving time of cluster C j t j d The time of data gathering in cluster C j t i c The time of charging for sensor node S i t i r The residual time of sensor node S i t j w The waiting time for MC's coming to cluster C j P c Charging rate of MC P i The energy consumption of sensor node S i P d (j) The geographic position priority of cluster C j P e (j) The residual energy priority of cluster C j P(j) The combined priority of cluster C j ε i Charging efficiency of sensor node S i T A charging cycle There are plenty of sensor nodes in the WRSN, we use the set {S 1 , S 2 , . . . , S i , . . . , S n } to express the sensor nodes, and each sensor node carries the initial energy of E o . Every sensor node can obtain its geographic position and residual energy anytime and anywhere. All sensor nodes are deployed randomly in an L × L square region, and the sink is located at the center of the region. Several MCs carry enough energy to recharge the sensor nodes with the speed of V c , and in this paper we assumed each MC has enough energy to charge all sensor nodes which need to be served. We defined the valid and farthest charging distance as d, and the charging efficiency as ε i of S i . In each cycle, not all the sensor nodes need to be recharged, but all nodes should report data to the sink, and we also proposed the MC as a mobile sink, that is, the MC comes to a cluster to charge several sensor nodes which need to be recharged and collect data of all sensor nodes in this cluster at the same time. In Figure 3, there are several sensor nodes deployed in the region, and in the middle of the region sits the sink. The cycle in Figure 3 represents the cluster, sensor nodes are divided into different clusters, we defined the set of clusters as C 1 , C 2 , . . . , C j , . . . , C m , and the MC will stay at the middle of the cluster to charge the sensor nodes and collect data. deployed randomly in an L L × square region, and the sink is located at the center of the region.
Several MCs carry enough energy to recharge the sensor nodes with the speed of c V , and in this paper we assumed each MC has enough energy to charge all sensor nodes which need to be served.
We defined the valid and farthest charging distance as d , and the charging efficiency as i ε of i S .
In each cycle, not all the sensor nodes need to be recharged, but all nodes should report data to the sink, and we also proposed the MC as a mobile sink, that is, the MC comes to a cluster to charge several sensor nodes which need to be recharged and collect data of all sensor nodes in this cluster at the same time. In Figure 3, there are several sensor nodes deployed in the region, and in the middle of the region sits the sink. The cycle in Figure 3 represents the cluster, sensor nodes are divided into different clusters, we defined the set of clusters as 1 2 { , ,..., ,..., } j m C C C C , and the MC will stay at the middle of the cluster to charge the sensor nodes and collect data. When one sensor node i S is on the verge of exhausting its energy, it will send a charging request to the sink, then the sink arranges a MC to visit the cluster which the sensor node belongs to. The MC starts off from the sink, and follows the route calculated in advance to visit each cluster. After serving all clusters, the MC returns to the sink waiting for the next arrangement. We define j τ as the time of serving the cluster j C by the MC, i.e., a MC will stay at cluster j C for j τ time to charge sensor nodes and collect data: When one sensor node S i is on the verge of exhausting its energy, it will send a charging request to the sink, then the sink arranges a MC to visit the cluster which the sensor node belongs to. The MC starts off from the sink, and follows the route calculated in advance to visit each cluster. After serving all clusters, the MC returns to the sink waiting for the next arrangement. We define τ j as the time of serving the cluster C j by the MC, i.e., a MC will stay at cluster C j for τ j time to charge sensor nodes and collect data: where τ j is the maximum time for a MC to serve the cluster C j , t j d is the time of all sensor nodes in cluster C j translating their data, t i c is the time of the MC charging sensor node S i , and n denotes the number of sensor nodes which need to be charged in a cluster.
The time for the MC to charge the sensor node S i is t i c , which can be calculated by Equation (3): where e j i (1 ≤ i ≤ n ) is the residual energy of one sensor node S i in the cluster C j when sensor node S i reports to the sink, t j w represents the waiting time of the MC to visit the cluster C j , P c is the charging speed of the MC, and P i is the energy consumption of sensor node S i . ε i is the charging efficiency of sensor node S i according to Equation (1). Then we can see the waiting time for a MC to visit a cluster C j is the sum of the serving time of the previous cluster C j−1 , the waiting time of the previous cluster C j−1 , and the time of a MC traveling from the previous cluster C j−1 to cluster C j . We obtain t j w from Equation (4): Thus, the residual time of a sensor node is calculated by Equation (5):

Problem Formulation
By the experiment we can know that the energy consumption of communication is closely related to the communication distance. In this paper, the CRMC determined the operating model of the WRSN, which means that the energy consumption of each sensor node can be sharply reduced by a short communication distance. Since every sensor node should be served, data can be totally gathered, finally. However, to ensure the stable operation of the CRMC, there are three problems that need to be solved: Problem 1: Does there exist a method of clustering where the MC can charge sensor nodes which are running out of energy and collect data from the all sensor nodes in the same cluster at the same time?
To solve the clustering algorithm, this paper has proposed the HB algorithm to classify sensor nodes.

Problem 2:
How do we design a charging route to ensure the emergency sensor node can be recharged preferential and no sensor nodes die in the whole process?
The charging queue plays the most important role in the whole process, we have considered the comprehensive factors including the residual energy and geographic position to optimize the charging queue.

Problem 3:
One MC cannot satisfy the large WRSN, and sensor nodes could die when the MC comes to visit the cluster in the process. How do we calculate the number of MCs to ensure no sensor nodes run out of energy in each charging cycle?
Too long a charging queue is more likely not to be served by one MC, so we have employed a method to partition the charging queue to calculate the number of MCs by the DMC algorithm.

The Hexagon-Based Algorithm
For problem 1, sensor nodes are divided into several clusters, all sensor nodes in the same cluster need to report data to the MC, but not all sensor nodes need to be recharged. We propose an algorithm based on this work mode, the square region is separated into several hexagonal areas, and each hexagonal area is a cluster, the length of the side is equal to the charging distance d, thus, the MC will stand at the middle of the hexagon area. All sensor nodes in the hexagon area are within the charging range d, when the MC visits the cluster, sensor nodes which need to be charged can be recharged and all the data can be transported to the MC. Figure 4 shows the HB algorithm working in a region, several sensor nodes are divided into different hexagonal areas, when the distance between sensor node and the center of the hexagonal area is less than √ 3d/2, i.e., the sensor node is within the limits of the incircle of the hexagon, the sensor node can only belong to one cluster certainly or belong to two possible clusters, also, some sensor nodes sit on the edge of two hexagons or at the point of the three hexagons. In this paper, we propose a method of labelling to distinguish which cluster the sensor node belongs to. This method is illustrated by Figure 5.
each hexagonal area is a cluster, the length of the side is equal to the charging distance d , thus, the MC will stand at the middle of the hexagon area. All sensor nodes in the hexagon area are within the charging range d , when the MC visits the cluster, sensor nodes which need to be charged can be recharged and all the data can be transported to the MC. Figure 4 shows the HB algorithm working in a region, several sensor nodes are divided into different hexagonal areas, when the distance between sensor node and the center of the hexagonal area is less than 3 2 d , i.e., the sensor node is within the limits of the incircle of the hexagon, the sensor node can only belong to one cluster certainly or belong to two possible clusters, also, some sensor nodes sit on the edge of two hexagons or at the point of the three hexagons. In this paper, we propose a method of labelling to distinguish which cluster the sensor node belongs to. This method is illustrated by Figure 5.  Excircle Incircle Sensor node Center of the hexagon Figure 5. Four situations of sensor nodes sitting in the region.
We can know that there are four possible positions of the sensor nodes in the WRSN. To distinguish the sensor nodes precisely and fast, we have considered a method of labelling which is shown in Figure 5. We defined x1 to be the condition that the sensor node is in the incircle of the hexagon, in other words, the distance between the sensor node and the center of one hexagon meet . When the sensor node is within the range of the incircle of the cluster 4 C and the excircle of cluster 3 C from Figure 5, the distance between sensor node and cluster 3 C follows: < , we use x3 to label the sensor node when the sensor node is in a annulus; similarly, when , there are two hexagons meeting the condition, we use x1 and x2 to label the sensor node of possible clusters; and, lastly, when 4 7 { , } dist S C d = in Figure 5c, there are three possible clusters and we label the sensor node with x1, x2, and x3 separately, the number of labelling is the serial number of each cluster.
The Table 2 reflects the different consequences of the labelling of the sensor nodes. For sensor We can know that there are four possible positions of the sensor nodes in the WRSN. To distinguish the sensor nodes precisely and fast, we have considered a method of labelling which is shown in Figure 5. We defined x1 to be the condition that the sensor node is in the incircle of the hexagon, in other words, the distance between the sensor node and the center of one hexagon meet the condition: 0 ≤ dist S i , C j < √ 3d/2. When the sensor node is within the range of the incircle of the cluster C 4 and the excircle of cluster C 3 from Figure 5, the distance between sensor node and cluster C 3 follows: √ 3d/2 < dist{S 2 , C 3 } < d, we use x3 to label the sensor node when the sensor node is in a annulus; similarly, when dist{S 3 , C 5 } = √ 3d/2, there are two hexagons meeting the condition, we use x1 and x2 to label the sensor node of possible clusters; and, lastly, when dist{S 4 , C 7 } = d in Figure 5c, there are three possible clusters and we label the sensor node with x1, x2, and x3 separately, the number of labelling is the serial number of each cluster. The Table 2 reflects the different consequences of the labelling of the sensor nodes. For sensor node S 1 , 0 ≤ dist{S 1 , C 1 } < √ 3d/2, so x1 of the S 1 is assigned a value of 1, and other labelling parameters are 0. For S 2 , sensor node is labelled twice, one labelling is when 0 ≤ dist{S 2 , C 4 } < √ 3d/2, so the x1 of S 2 is bounded of the value of 4, another is when √ 3d/2 < dist{S 2 , C 3 } < d, we label the x3 of S 2 as 3 and, obviously, S 2 is closer to the center point of the hexagon which S 2 is in the range of the incircle of cluster C 4 . We just assign the x3 of S 2 with the value of 0, and the sensor node S 3 can be confirmed to belong to cluster C 4 . For S 3 , the x1 and x2 are labelled with values of 5 and 6 at the same time, that is, the S 3 is on the edge of cluster C 5 and cluster C 6 . Then we consider the distance between the cluster and the sink, we choose the closest one to be the appropriate cluster. If the distance is equal, we randomly select from cluster C 5 and cluster C 6 . S 4 is at the intersection point of the cluster C 7 , C 8 , and C 9 , and we similarly consider the distance to the sink, and choose the optimal cluster, like S 3 . According to Algorithm 1, each sensor node can belong to the optimal cluster, the information is labelled in x1 of each sensor node. Proof. Since n sensor nodes are considered, each sensor node needs to calculate the distance to each cluster, the time complexity of once whole traversal is O(n × m). Then the time complexity of labelling is O(n), according to the definition of time complexity, and O(n × m + n) is simplified as O(n × m). This completes the proof.

The Residual Energy and Geographic Position Algorithm
In the WRSN, the residual energy and the geographic position of the sensor nodes should be both considered, in this paper, we have proposed the combination of energy priority and position priority. We use the HB algorithm to distinguish the sensor nodes into different clusters, so which cluster is visited preferentially is of great importance.
We consider the residual energy as the sum of all sensor nodes which need to be recharged in a cluster, it means in a cluster, not all sensor nodes require to be recharged, we only calculate the residual energy of segmental sensor nodes, and the charging efficiency is as a result higher than charging for all sensor nodes. Then the residual energy priority can be provided as: where the n means the number of sensor nodes which need to be recharged in the cluster C j , e j i represents the residual energy of sensor S i in the cluster C j , obviously the P e (j) is always lower than 1, and when the P e (j) is going to 0, the priority of the cluster is larger. Then we consider the geographic position priority. The first cluster should be the most emergency priority, the residual energy priority of each cluster can be calculated by Equation (6). Then all clusters which need be served should be traversed to calculate the distance to the sink. Combining the residual energy priority P e (j), the first cluster is founded. As the first cluster is confirmed, the same method is used to find next the most emergency priority cluster. We define the P d (j) as the geographic position priority: where dist C j , C j means the distance between the cluster C j and the previous cluster C j , due to the length of side of the square region is L, the longest distance about a MC begins from one cluster to another cluster in the region is √ 2L. Thus, the P d (j) is also always lower than 1. Similarly, the geographic position priority of a cluster is larger when the P d (j) is smaller.
Lastly, we combine the residual energy priority and the geographic position priority to obtain the final priority of the cluster: We use α and β to modify the ratio of the P e (j) and the P d (j), and α,β follows the limits that α + β = 1. When α is equal of 0, the priority of the cluster can be the same as NJNP, and when β is equal of 0, the priority of the cluster is the same as EDF. P(j) reflects the priority of a cluster, it determines which cluster is served preferentially. As the P(j) is larger, the priority is higher.
When all sensor nodes which need to be recharged have reported the charging request to the sink, the sink arranges a MC to visit each cluster follows the charging queue. We use the priority to structure the charging queue, because the MC starts from the sink, we consider the head of the queue as the sink, and the remaining elements are all clusters which need to be visited. This means when MC starts from the sink, the forward clusters in the queue can be visited preferentially.
In Algorithm 2, the sink is joined in queue Q beforehand. When the network begins, all clusters which contain low-energy sensor nodes can be traversed, these clusters are signed as the type of '1'. When exiting clusters which need to be served, the first cluster can be found by the largest priority from all clusters. Once the cluster is chosen to be joined into queue Q, the type of this cluster transforms into '0'. This implies in next traversal, this cluster will not be considered. When all clusters join in queue Q, queue Q is accomplished. Ultimately, queue Q contains the sink and all clusters which need to be visited, a MC can follow the queue to serve all clusters need to be visited. When all sensor nodes in queue Q are recharged, one cycle is ended, the other sensor nodes proceed with their work and can be recharged in the next cycle or later.

Algorithm 2: Residual Energy and Geographic Position Algorithm (REGP)
Input: The empty sequence of Q, sensor nodes S i and clusters C j Output: The optimized charging sequence Q 1: Let Sink be the head ∈ Q 2: for All S i ∈ S(0 < i ≤ n) do 3: if Energy of S i < θ then 4: C j .type = 1, where j = S i .x1 5: end if 6: end for 7: while Exiting C j .type = 1 do 8: for All C j ∈ C(0 < j ≤ m) do 9: if C j .type = 1 then 10: Calculate the P(j) and find the largest P(j) of C j 11: Q ← Q ∪ C j Proof. The worst situation is all sensor nodes need to be recharged and all clusters need to be checked, so the time complexity of traversal is O(n) and the time complexity of checking clusters is O(m), the last time complexity is, therefore, O(n + m).

The Dynamic Mobile Charger Algorithm
With the number of sensor nodes increasing, one MC cannot satisfy the whole WRSN. To make sure all sensor nodes are alive throughout the whole process, we need to calculate the least number of MCs to serve the cluster. In this paper, we have raised an algorithm to partition sequence Q, the most important constraint is Equation (9), which shows the residual time of one cluster must be larger than the waiting time, so we partition the sequence Q by Equation (9) However, only with the constraint from Equation (9) is there still a risk of running out of energy. From Figure 6, the horizontal axis means the lifetime of a sensor node, and the sensor node could die when it does not participate in the first charging cycle. During one charging cycle if there is a sensor node that meets the charging threshold, it needs to be charged, but the charger cannot respond to its request. Until the next charging cycle begins, the sensor node could die. Or it could die even though this sensor becomes the first served object joining in the next charging queue, it cannot wait for the MC's arrival.  (9) is there still a risk of running out of energy. From Figure 6, the horizontal axis means the lifetime of a sensor node, and the sensor node could die when it does not participate in the first charging cycle. During one charging cycle if there is a sensor node that meets the charging threshold, it needs to be charged, but the charger cannot respond to its request. Until the next charging cycle begins, the sensor node could die. Or it could die even though this sensor becomes the first served object joining in the next charging queue, it cannot wait for the MC's arrival.
In Equation (10), the right of the inequation is the longest time of the MC travelling from the sink to the first cluster. When the time of the charging cycle is less than the limit, the sensor node can surely pull through a charging cycle without dying. To ensure all sensor nodes can survive, i E tends to the charging threshold θ , and the consumption i P also tends toward the largest value, then the charging cycle T of a MC is limited by Equation (11): Remove the elements from 2 to 1 t − and update the Q

12:
1 k k = + In Equation (10), the right of the inequation is the longest time of the MC travelling from the sink to the first cluster. When the time of the charging cycle is less than the limit, the sensor node can surely pull through a charging cycle without dying. To ensure all sensor nodes can survive, E i tends to the charging threshold θ, and the consumption P i also tends toward the largest value, then the charging cycle T of a MC is limited by Equation (11): In Algorithm 3, The waiting time can be calculated by two adjacent elements in sequence Q. For example, since the first element of sequence Q is the sink, then the second element is the first cluster which the MC should visit, and the waiting time is calculated by the distance between the sink and the cluster. Next is the third element, the waiting time is the sum of the waiting time of the first cluster, the serving time of the first cluster, and the time of the MC travels from the first cluster to the second cluster. This is defined in Equation (4). We partition sequence Q once a MC cannot visit the cluster in sequence Q in a timely manner, then we can obtain a charging route for a MC. At the same time we remove these clusters from sequence Q, and update Q to repartition the sequence. When all clusters are removed from Q the least number of MCs can be calculated. The serving time of a MC is calculated as follows: A serving time of a MC can be represented by Equation (12), it is the sum of the waiting time of the last cluster in a MC's charging queue and the serving time by MC, ultimately, the MC returns to the sink.  Remove the elements from 2 to t − 1 and update the Q 12: k = k + 1 13: t = 2 14: Update the l 15: for All Q(t) ∈ Q(1 < t ≤ l) do 16: Calculate the waiting time t

Simulations
In this section, we evaluate the performance of the algorithms by simulation. We set the number of the sensor nodes n as 100, L as 100 m, and the energy consumption P i of each sensor node is randomly in the range [0.0002, 0.001]. We use the NJNP algorithm and EDF algorithm to compare our algorithms, and we also use the DMC algorithm to calculate the number of MCs in each algorithm.

The Energy Change of a Sensor Node
Once an existing a sensor node needs to be charged, it reports to the sink with a charging request. The whole WRSN can run for a long time without any sensor nodes dying. Due to each sensor node needing to be recharged, the energy of the sensor is changed periodically. In Figure 7, the horizontal axis is the running time, and the ordinate is the residual energy of the sensor node. We can see the energy of the sensor node is always higher than 0.1, and the energy induces a periodic sawtooth-like behavior. When the energy of the sensor node is lower than the charging threshold θ, the MC comes to charge the sensor node. As a result, the energy increases gradually. Since the MC cannot always come to the sensor node in time, the lowest energy in each charging cycle is different. At the same time, due to the sensor node always consuming its energy, the maximum energy is also different after each charging cycle.
the horizontal axis is the running time, and the ordinate is the residual energy of the sensor node. We can see the energy of the sensor node is always higher than 0.1, and the energy induces a periodic sawtooth-like behavior. When the energy of the sensor node is lower than the charging threshold θ , the MC comes to charge the sensor node. As a result, the energy increases gradually.
Since the MC cannot always come to the sensor node in time, the lowest energy in each charging cycle is different. At the same time, due to the sensor node always consuming its energy, the maximum energy is also different after each charging cycle.

Path Diagram of One Charging Cycle
The REGP algorithm determines the charging queue of all clusters, and the DMC algorithm calculates the numbers of MCs. In Figure 8, we show the path diagram of REGP compared to NJNP and EDF. With the energy and position considered together, the path of REGP is sharply different to NJNP and EDF. The number of clusters served by the first MC in Figure 5a is 16, but in NJNP the number is 10. The number of MCs in NJNP is 2, however, the number of MCs in our REGP is 1. From Figure 5c, the path diagram of EDF is chaotic, the number of MCs is 2, and due to not considering the position of clusters, a MC can only serve fewer clusters.

Path Diagram of One Charging Cycle
The REGP algorithm determines the charging queue of all clusters, and the DMC algorithm calculates the numbers of MCs. In Figure 8, we show the path diagram of REGP compared to NJNP and EDF. With the energy and position considered together, the path of REGP is sharply different to NJNP and EDF. The number of clusters served by the first MC in Figure 5a is 16, but in NJNP the number is 10. The number of MCs in NJNP is 2, however, the number of MCs in our REGP is 1. From Figure 5c, the path diagram of EDF is chaotic, the number of MCs is 2, and due to not considering the position of clusters, a MC can only serve fewer clusters.

Number of MCs in Each Charging Cycle
Only one MC cannot serve all sensor nodes in one charging cycle, so several MCs are arranged to ensure no sensor nodes die in the whole process. Since no sensor nodes can die in the WRSN, even if only one sensor node needs to be recharged, the sink should also dispatch a MC to visit the cluster. At the same time, there would be number of sensor nodes that need to be served, so the number of the MCs may also be large. In Figure 9, the maximum number of MCs is 4, and the minimum is 1, and the number of MCs is always changing irregularly. The number of MCs is calculated in advance by the DMC algorithm. When the first charging cycle begins, the DMC algorithm has calculated the number of MCs as 1, and then one MC starts from the sink and serves all clusters needed. The MC returns to the sink after charging, then the next charging cycle begins and the number of MCs increases to 4. The process is always carried out periodically.

Number of MCs in Each Charging Cycle
Only one MC cannot serve all sensor nodes in one charging cycle, so several MCs are arranged to ensure no sensor nodes die in the whole process. Since no sensor nodes can die in the WRSN, even if only one sensor node needs to be recharged, the sink should also dispatch a MC to visit the cluster. At the same time, there would be number of sensor nodes that need to be served, so the number of the MCs may also be large. In Figure 9, the maximum number of MCs is 4, and the minimum is 1, and the number of MCs is always changing irregularly. The number of MCs is calculated in advance by the DMC algorithm. When the first charging cycle begins, the DMC algorithm has calculated the number of MCs as 1, and then one MC starts from the sink and serves all clusters needed. The MC returns to the sink after charging, then the next charging cycle begins and the number of MCs increases to 4. The process is always carried out periodically.
At the same time, there would be number of sensor nodes that need to be served, so the number of the MCs may also be large. In Figure 9, the maximum number of MCs is 4, and the minimum is 1, and the number of MCs is always changing irregularly. The number of MCs is calculated in advance by the DMC algorithm. When the first charging cycle begins, the DMC algorithm has calculated the number of MCs as 1, and then one MC starts from the sink and serves all clusters needed. The MC returns to the sink after charging, then the next charging cycle begins and the number of MCs increases to 4. The process is always carried out periodically.

Total number of MCs in the Whole Process
In this paper, we consider the beginning of the charging as the time when one sensor node meets the charging threshold. That means if only one sensor node needs to be recharged at one time, the sink also arranges a MC to serve the cluster. Thus, the lifecycle of the whole WSRN is largely increased, and the total quantity of MCs in the whole process reflects the charging efficiency of the MCs. The lower number of MCs means a longer charging cycle and a longer serving time of each MC. From Figure 10, the time of the whole process is set as 2000 rounds, with the number of sensor nodes increases, the total quantity of MCs also increases. We can see the EDF and NJNP are always higher than the REGP algorithm, and the REGP algorithm has fewer MCs in each process. With the charging queue not optimized, NJNP may always need more MCs in each charging cycle.

Total number of MCs in the Whole Process
In this paper, we consider the beginning of the charging as the time when one sensor node meets the charging threshold. That means if only one sensor node needs to be recharged at one time, the sink also arranges a MC to serve the cluster. Thus, the lifecycle of the whole WSRN is largely increased, and the total quantity of MCs in the whole process reflects the charging efficiency of the MCs. The lower number of MCs means a longer charging cycle and a longer serving time of each MC. From Figure 10, the time of the whole process is set as 2000 rounds, with the number of sensor nodes increases, the total quantity of MCs also increases. We can see the EDF and NJNP are always higher than the REGP algorithm, and the REGP algorithm has fewer MCs in each process. With the charging queue not optimized, NJNP may always need more MCs in each charging cycle.

Total Number of Emergency Sensor Nodes in the Whole Process
Emergency sensor nodes are the sensor nodes which meet one third of the charging threshold, and fewer emergency sensor nodes represent the higher stability of the WSRN. This is owing to the DMC algorithm: with more MCs, more sensor nodes can be recharged in time. From Figure 11, the time of the whole process is also set as 2000 rounds, and the REGP is always lower than EDF and NJNP. With fewer emergency sensor nodes in the whole process, the REGP algorithm performs better than EDF and NJNP, in that the EDF does not consider the position of each sensor, and it could bring about more time of moving of the MC. At the same time, NJNP does not consider the residual energy of each sensor node, causing more emergency sensor nodes not be recharged in time.

Total Number of Emergency Sensor Nodes in the Whole Process
Emergency sensor nodes are the sensor nodes which meet one third of the charging threshold, and fewer emergency sensor nodes represent the higher stability of the WSRN. This is owing to the DMC algorithm: with more MCs, more sensor nodes can be recharged in time. From Figure 11, the time of the whole process is also set as 2000 rounds, and the REGP is always lower than EDF and NJNP. With fewer emergency sensor nodes in the whole process, the REGP algorithm performs better than EDF and NJNP, in that the EDF does not consider the position of each sensor, and it could bring about more time of moving of the MC. At the same time, NJNP does not consider the residual energy of each sensor node, causing more emergency sensor nodes not be recharged in time.

Total Number of Emergency Sensor Nodes in the Whole Process
Emergency sensor nodes are the sensor nodes which meet one third of the charging threshold, and fewer emergency sensor nodes represent the higher stability of the WSRN. This is owing to the DMC algorithm: with more MCs, more sensor nodes can be recharged in time. From Figure 11, the time of the whole process is also set as 2000 rounds, and the REGP is always lower than EDF and NJNP. With fewer emergency sensor nodes in the whole process, the REGP algorithm performs better than EDF and NJNP, in that the EDF does not consider the position of each sensor, and it could bring about more time of moving of the MC. At the same time, NJNP does not consider the residual energy of each sensor node, causing more emergency sensor nodes not be recharged in time.
Total numbers of emergency sensor nodes Figure 11. Total number of emergency sensor nodes in the whole process.

Average Serving Time of a MC in the Whole Process
In this paper, we consider the serving time with respect to the whole time for a MC to start from the sink and return to the sink. As shown in the Figure 12, with the number of sensor nodes increasing, the average serving time of the whole process decreases, and the decrease is attributed to Figure 11. Total number of emergency sensor nodes in the whole process.

Average Serving Time of a MC in the Whole Process
In this paper, we consider the serving time with respect to the whole time for a MC to start from the sink and return to the sink. As shown in the Figure 12, with the number of sensor nodes increasing, the average serving time of the whole process decreases, and the decrease is attributed to the increasing number of emergency sensor nodes. To ensure no sensor nodes died, more MCs need to be dispatched to deal with the emergency sensor nodes. From Figure 12, we can also see that the REGP algorithm is always higher than EDF and NJNP. This means that, in the REGP algorithm, the number of emergency sensor nodes is smaller than EDF and NJNP, and higher serving time also represents a higher efficiency of MCs. the increasing number of emergency sensor nodes. To ensure no sensor nodes died, more MCs need to be dispatched to deal with the emergency sensor nodes. From Figure 12, we can also see that the REGP algorithm is always higher than EDF and NJNP. This means that, in the REGP algorithm, the number of emergency sensor nodes is smaller than EDF and NJNP, and higher serving time also represents a higher efficiency of MCs.

Conclusions
In order to increase the efficiency of charging and decrease the energy consumption of communication, we use the MC to collect the data when charging. We proposed an effective recharging model, CRCM, in the WRSN. Then, to ensure the MC can collect data and charge at the same time, we propose the HB algorithm to sort all sensor nodes in the region. When the MC comes

Conclusions
In order to increase the efficiency of charging and decrease the energy consumption of communication, we use the MC to collect the data when charging. We proposed an effective recharging model, CRCM, in the WRSN. Then, to ensure the MC can collect data and charge at the same time, we propose the HB algorithm to sort all sensor nodes in the region. When the MC comes to the middle of each cluster, all sensor nodes in the cluster can be charged and data can be collected at the same time. Due to the very close communication distance, the energy consumption of communication can be decreased greatly. Then we proposed the REGP algorithm to determine which cluster is visited first. As the priority queue has been established, the DMC algorithm is established to partition the queue to calculate the number of MCs. Finally, we compared the REGP algorithm with EDF and NJNP, the results of the simulation have proved that the REGP algorithm is better than EDF and NJNP algorithm. In the future, we will consider the optimization of the number of MCs in each charging cycle to reduce the average number of MCs.