A Joint Optimization Strategy of Coverage Planning and Energy Scheduling for Wireless Rechargeable Sensor Networks

: Wireless Sensor Networks (WSNs) have the characteristics of large-scale deployment, ﬂexible networking, and many applications. They are important parts of wireless communication networks. However, due to limited energy supply, the development of WSNs is greatly restricted. Wireless rechargeable sensor networks (WRSNs) transform the distributed energy around the environment into usable electricity through energy collection technology. In this work, a two-phase scheme is proposed to improve the energy management efﬁciency for WRSNs. In the ﬁrst phase, we designed an annulus virtual force based particle swarm optimization (AVFPSO) algorithm for area coverage. It adopts the multi-parameter joint optimization method to improve the efﬁciency of the algorithm. In the second phase, a queuing game-based energy supply (QGES) algorithm was designed. It converts energy supply and consumption into network service. By solving the game equilibrium of the model, the optimal energy distribution strategy can be obtained. The simulation results show that our scheme improves the efﬁciency of coverage and energy supply, and then extends the lifetime of WSN.


Introduction
5G networks support more devices, ushering in a new era of ubiquitous connectivity. As important parts of 5G networks, wireless sensor networks (WSNs) will be used more widely based on the original network architecture [1] and bring more convenient services for mobile Internet users [2]. Due to the large scale of deployment, diverse functions, and complex terrain in most target areas in WSNs, the traditional battery power supply mode struggles to maintain the long-term operation of the network. In order to charge sensor network nodes, distributed energy around the environment, such as solar energy, thermal energy, vibrations, and electromagnetic waves, can be collected and converted into usable electrical energy. Wireless rechargeable sensor networks (WRSNs) use those energy harvesting technologies to increase the lifetime of WSN nodes, and have attracted much attention. In practice, microwave power transmission (MPT) has relatively high efficiency, and energy supply is realized by transmitting and receiving electromagnetic waves with antennas [3]. Changes in hydro-meteorological conditions, such as cloudy and rainy weather, will affect the charging of solar equipment, and too-low temperatures will lead to the acceleration of battery discharge speed. In order to simplify the system model, the influence of hydro-meteorological conditions is not considered in this paper. To efficiently supplement the energy of WSN nodes, the fixed platforms, mobile air platforms, or unmanned aerial vehicles (UAVs) can be set up over the target area for network coverage.
The coverage effect of WSNs affects the range and transmission quality of information within the target area. It can be changed by adjusting the antenna's azimuth, tilt, transmitting power, and other parameters. Coverage optimization mainly focuses on the supplementary coverage blind area, the reduction of repeatability of the overlapping area, and the improvement of the effectiveness and rapid convergence of the optimization algorithm [4]. As the adjustable parameters show a non-linear sharp increase with the growth of network size, how to achieve the optimization of the coverage algorithm under the premise of saving network resources is an important challenge [5]. After coverage, the design of the energy supply scheme, to a large degree, determines the performance and lifetime of WRSNs. If the power supply node (PSN) continues to charge the sensor nodes, the energy supplied may exceed the node demand, resulting in a waste of resources. However, periodic energy supply may cause the nodes with high loads to fall into dormancy or death due to their fast energy consumption. Therefore, it is necessary to design a reasonable energy supply scheme according to the different energy demands of nodes.
The optimization problems of area coverage and energy distribution are relatively complex. In consideration of limited resources, such as computing power and energy, for WSNs, a two-phase algorithm was designed to optimize the coverage of the region first and then optimize the energy distribution on this basis. In this paper, a power supply node with multiple antennas is configured on a platform with a certain height to carry out network coverage to the ground. Considering the interaction between multiple isomorphic antennas on a node, an annulus virtual force based particle swarm optimization (AVFPSO) algorithm is proposed to improve the performance of coverage. Then, a queuing game-based energy supply (QGES) algorithm is designed. It divides the energy provided by the nodes into energy packets with the same size, and establishes the system model of sending energy packets to multiple nodes in the covered area. Each energy packet wants to be used more efficiently, creating a competitive relationship. In the process of energy packets entering the storage of sensor nodes and being consumed, the nodes need to pay a price, such as reduced life of power components and waiting for network task transformation. The optimal strategy of node energy supply is obtained by minimizing the cost and solving the Nash equilibrium. By combining the two algorithms, a two-phase energy management (TPEM) scheme for WRSNs is obtained. The main contributions can be summarized as follows.
1. By introducing virtual force (VF) and combining it with particle swarm optimization (PSO), an efficient energy supply region coverage optimization algorithm is proposed. The joint debugging of antenna azimuth and tilt improves the effectiveness of the algorithm. 2. With the queuing game theory, the finite energy supply problem in WRSNs is transformed into a mathematical model of discrete energy packet service. The QGES algorithm provides energy to nodes with different energy consumption rates on demand, thereby improving the optimal allocation of limited resources. 3. In the solution of the energy supply system model, the influence of the random distribution of node energy consumption on the social welfare can be obtained. It has theoretical significance for the design of energy saving schemes, such as sensor node sleep strategy.
The remainder of this paper is organized as follows. The related work of the target area coverage optimization and the energy supply scheme are presented in Section 2. The system model and problem formulation of the two-phase energy management in WRSNs are described in Section 3. In Section 4, the AVFPSO algorithm is designed while considering the interaction between multiple antennas at the node. The optimal strategy of node charging is obtained by solving the energy supply system model, and a QGES algorithm for WRSNs is designed. The TPEM scheme is proposed by combining the two algorithms. Section 5 deals with the simulation and comparison results, followed by the conclusion in Section 6.

Related Work
The network structure of a WSN changes dynamically with the change of node state. Therefore, the coverage optimization of WSNs has always been important. In traditional sensor networks, the problem of directed sensor coverage is usually solved by an optimization algorithm [6][7][8]. In [6], an optimization strategy based on the genetic algorithm was proposed to achieve full target coverage by adjusting the direction and perception range of the sensors. In [7], nodes in a heterogeneous WSN were processed by clustering. The angle and coverage of nodes were adjusted by a greedy search algorithm, so as to achieve the fence coverage of directed sensor networks. For WRSNs, reference [9] proposed a hybrid integer linear programming method to complete network coverage through heuristic searching. They mainly studied the coverage of two-dimensional scenes under specific circumstances, but the number of parameters used for optimization was not large, and the scale of joint optimization was small. In [10], a differential evolution algorithm was adopted to solve the coverage problem of a directional sensor network in a three-dimensional environment. Reference [11] proposed a multi-objective optimization scheme of a comprehensive, three-dimensional, uncertain coverage model based on the fuzzy ring concept. The problem of three-dimensional environmental optimization conformed to the situation of large-scale joint optimization. However, eliminating the redundancy of solution space was not mentioned in these works, and the computational time would grow significantly with the increase of network size.
The research on wireless charging of sensor networks mainly focuses on cases wherein the sensor node is charged by the mobile charging node [12][13][14][15] and the charging node is fixed [16,17]. In [12], a charging model of the sector search algorithm using directional antenna was proposed. It had a better performance than the golden section search method with the all-directional antenna charging model. Reference [14] proposed HeuristicMaxLifetime and HeuristicMinCost algorithms by solving a partial energy charging model for sensor charging. They maximized the sum of the sensor lifetimes and minimized the travel distance of the charger. In reference [15], an annular charging model was adopted in consideration of different node energy consumption in different regions. Corresponding charging strategies were used for the nodes in and out of the ring. Mobile charging nodes themselves have high energy consumption, and environmental energy harvesting efficiency is random and unstable, which is difficult to be applied in practice. For charging nodes deployed at fixed heights, reference [16] proposed the greedy cone coverage algorithm and the adaptive cone coverage algorithm to deploy as few chargers as possible to make WRSNs sustainable. While focusing on the wireless charging efficiency, reference [17] proposed a fair charging model with radiation constraints in consideration of radiation hazards. These schemes usually did not consider the case of supplying energy simultaneously to multiple sensor nodes with different power consumption capacities. Under the condition of limited energy, the energy supply on demand improves the efficient allocation of resources and thus extends the life of the sensor network.
In recent years, some researchers have used game theory to design charging strategies [18,19]. In reference [18], a game collaborative scheduling algorithm was proposed with the introduction of the unique dynamic warning threshold and sacrifice-charge mechanism. The device that needs to choose the charging node was taken as the player of the game, and non-cooperative game theory was used to build the system model. The overall energy efficiency of the system was improved by solving the Nash equilibrium. Reference [19] adopted the non-cooperative Stackelberg game model and realized a new architecture with better performance than cache architecture and energy recovery architecture. The energy cache strategy, excitation strategy, and energy transfer strategy of the charging node were considered comprehensively. These solutions consider the system from a global perspective, rather than being limited to performance improvements in a particular scenario. Due to limited energy resources in WRSNs, there will be resource competition among node participants. Meanwhile, in order to achieve the common goal of the players in the small set, there will also be a cooperative relationship between players. These specific behaviors correspond to the description of game players' elements in game theory. This paper introduces virtual force and queuing game theory [20] to establish the energy management system model of WRSNs. A TPEM scheme is proposed to improve coverage optimization and energy supply efficiency for WRSNs. In the first stage of the TPEM scheme, an AVFPSO algorithm is designed by introducing the interaction force between multiple antennas on the node. In the process of particle optimization, the virtual force is added to pull the particles, so that the algorithm can converge to the global optimal solution faster. In the second phase, the system is modeled based on queuing game theory, with constraints such as limits on the modes and amount of energy supply, and the randomness of nodes' demand for energy. The arrival rate of energy packets selected to enter different sensor nodes is obtained by solving the minimization cost function, and the QGES algorithm of WRSNs based on the queuing game is designed.

System Model and Problem Formulation
MPT technology improves the lifetime of the WSN. The PSNs carried by fixed, aerial platforms or UAVs replenish energy for sensor nodes, which replaces the difficult charging scheme of changing batteries for each node. Fixed and aerial platforms have advantages of geographical location and large scale. In addition to its own large power supply, the PSN converts solar or wind into electric energy through energy harvesting technologies to charge the sensor nodes. Here, we focus on the system modeling for the target coverage optimization and energy supply of WRSNs, and formulate these two problems.

System Model
It is assumed that there are m PSNs in region R of the WRSNs. The PSNs are installed on fixed or mobile platforms with a certain height and equipped with a large-capacity power system, as shown in Figure 1. The mobile platforms, such as aerial platforms and UAVs, can be returned to recharge after completing the power supply mission and perform the next mission. B = {B 1 , B 2 , . . . , B m } represents the set of PSNs, where B i denotes the ith PSN. A = {A 11 , A 12 , . . . , A 1z , A 21 , . . . , A 2z , . . . , A m1 . . . , A mz } represents the set of antennas mounted on a node, where A ik denotes the kth antenna of the ith PSN. P = {P 1 , P 2 , . . . , P n } represents the set of signal strength sampling points, where P j denotes the jth sampling point. There are n sampling points in this region, which are generated at equal intervals after meshing the region. Each antenna charges multiple sensor nodes in the area covered. Remote field charging is realized by using MPT technology with high charge efficiency.
To achieve the target coverage of WRSNs, the azimuth φ ik and tilt θ ik of antenna A ik of the PSN can be adjusted. The relationship between antenna angle parameters and sampling point position is shown in Figure 2. Assuming that the location of the PSN is known, the problem of node location selection is not considered in this paper.
WRSNs are usually used in areas where maintenance is inconvenient and energy resources of PSNs are limited. In our scheme, the antenna charges all sensor nodes automatically according to the designed QGES algorithm in the area coverage. The energy is divided into multiple energy packets for a fixed duration. In an energy supply cycle, it is assumed that each antenna transfers energy packets in a Poisson distribution with time intervals following parameters λ to supply energy to the nodes. The energy packet consumption rates µ of different sensor nodes in the coverage area of the antenna obey the general distribution. The players in the game are the energy packets. Nodes receive energy packets and store them in the power system, where they wait for consumption, and then convert them into network value to obtain benefit ε. During charging and waiting, a sensor node needs to pay corresponding cost C per unit time, which indicates the decline of power life and the energy conversion efficiency of nodes. To maximize the social welfare of the energy supply system, the problem can be transformed into an optimal strategy for energy packets to be allocated to different sensor nodes with minimal cost. As shown in Figure 3, the power supply system model is composed of PSN antennas, sensors, and a power supply strategy based on a queuing game.

Problem Formulation
Problem 1. Two-parameter joint optimization of power supply target coverage. Under the constraint of azimuth φ and tilt θ of independent variables, the maximum of the coverage function is solved. To describe Problem 1, the following definitions are given.

Definition 1.
Evaluate whether a sampling point meets the coverage requirements according to the value of reference signal receiving power (RSRP). g j (φ, θ) represents the coverage at sampling point P j , which can be expressed as: where 1 indicates covered, 0 indicates not covered, and Th RSRP denotes the threshold value of RSRP. hr j (φ, θ) denotes the RSRP of the point P j , which is the maximum power of the RSRP from all antennas at the point. It can be given by hr j (φ, θ) = max(hs j (φ 11 , θ 11 ), hs j (φ 12 , θ 12 ), . . . , hs j (φ 1n , θ 1n ), . . . , hs j (φ mz , θ mz )) (2) Definition 2. The function hs j (φ ik , θ ik ) that represents the RSRP from the antenna A ik at the point P j can be given by where P T denotes is the transmitting power of the antenna, which is set as a constant; G R denotes the receiver gain and is set as a constant; L i,j denotes the path loss from the charging node C i to the sampling point P j . Based on COST231-HATA [21], the path loss L i,j can be obtained as where h i,j denotes the height of antenna A ij , h p denotes the height of the sampling point P j , d ij,k denotes the horizontal distance between the antenna A ij and the sampling point P j , and C M denotes the model correction factor. The directional gain is a function of horizontal and vertical angles. According to the approximate model given by 3GPP [22], it can be expressed as where G max denotes the maximum gain of the antenna, φ 3dB denotes the angle of the half power waveform width, G m denotes the maximum value of the reverse attenuation, and SLA V denotes the attenuation of the lateral lobe. The function hg j (φ ik , θ ik ) that represents the directional gain of the antenna A ik towards the sampling point P j can be given by where φ ik and θ ik denote the azimuth and tilt of the antenna A ij respectively; a ik,j and b ik,j denote the horizontal and vertical angles of the sampling point P j relative to the antenna A ij . φ ik,j and θ ik,j denote their relative angles respectively, which can be calculated as follows. If a ik,j = φ ik , The two-parameter joint optimization problem can be described as subject to: where the function f (φ, θ) represents the overall coverage in the region. The detailed calculation formula of the coverage calculation function f (φ, θ) has been given. The corresponding coverage rate can be obtained by modifying the antenna azimuth φ and tilt θ. Then, according to the characteristics of the antennas on the PSN, Equation (6) should be changed reasonably to reduce the number of calculations and improve the speed of calculation.

Problem 2.
Energy supply strategy with the minimum cost. The antenna of the PSN provides limited energy packets. The energy packets pay the cost when they enter sensor nodes with different power consumption capacity and are translated into network value. Under the condition of minimum cost, the optimal rate of energy packets being assigned to each sensor node is solved.
It is assumed that each antenna of the PSN covers A sensor nodes and provides energy packets in a Poisson distribution with rate Λ (Λ > 0). Energy packets are sent from the antennas of the PSN, allocated to different sensor nodes, received and stored in the power system of the node through electromagnetic transformation, waiting to provide energy for network tasks. The process of energy packet allocation to sensor nodes follows the Poisson distribution with parameter λ a , and satisfies ∑ A a=1 λ a = Λ. The time interval T a of the energy packets consumed by sensor node a follows the general distribution. It satisfies E (T a ) = 1 µ a , E T 2 a = q µ 2 a , and ∑ A a=1 µ a > Λ. Each energy packet that enters the sensor node obtains a fixed benefit ε. Each energy packet a needs to pay a waiting cost c a per unit time in the node. Sort the sensor nodes and get c 1 µ 1 ≤ c 2 µ 2 ≤ c a µ a . The solution to the optimal problem of the system is to find an allocation strategy λ * 1 , λ * 2 , · · · , λ * A of energy packets to the sensor node with the minimum cost of the entire energy supply system. According to the assumption, the queuing model of each sensor node is M/G/1. Γ a (λ a ) represents the average number of energy packets in the node queue. The average cost function of the system can be given by subject to: In equilibrium, the average cost of the system reaches a minimum, and each energy packet cannot reduce the system cost by entering any other node. Problem 2 can be described as a minimization cost function ψ λ and the optimal strategy of energy supply allocation is obtained by solving ψ λ .

A Two-Phase Energy Management Scheme for WRSNs
To solve Problems 1 and 2, we designed AVFPSO algorithm and QGES algorithm respectively. In the first phase, the PSN uses AVFPSO algorithm to jointly debug azimuth and tilt for full coverage of the target area. In the second phase, QGES algorithm is applied to realize energy supply on demand for sensor nodes with different energy consumption capacities under the condition of limited energy. The two-phase algorithms are integrated to form an efficient energy management scheme for WRSNs.

Annulus Virtual Force Algorithm
The virtual force algorithm was originally applied to the deployment of sensor nodes [23][24][25]. After the sensor node random position is initialized, the final position is changed through the interaction of virtual forces to achieve the enhancing effect of coverage. Each node makes a strategy selection based on the position relationship with other nodes. When the distance is less than a threshold, repulsive forces appear between nodes. On the contrary, when the distance is greater than the threshold, there is an attractive force between nodes. When the distance is exactly equal to the threshold, the interaction force between nodes is zero, and the nodes appear to be static.
There are l sensor nodes S = {s 1 , s 2 , . . . , s l } in the area, where the coordinates of the uth and vth nodes are s u (x u , y u ) and s v (x v , y v ) respectively. The distance d u,v between the two nodes is defined by The force − → F u,v between node s u and node s v is defined as where d th denotes the threshold value of the distance between nodes, which is responsible for controlling the distance between nodes. ω A denotes the coefficient of attraction between nodes, ω R denotes the coefficient of repulsion between nodes, and α u,v denotes the angle between the line between nodes and the horizontal direction. A node may be acted upon by multiple nodes, and − → F u = − → F u,1 + − → F u,2 + . . . − → F u,l means that node u is acted upon by all other nodes. The traditional virtual force algorithm considers the interaction forces between nodes in Euclidean space. Differently from the traditional virtual force algorithm, we consider the interaction force between isomorphic antennas on the charging nodes. Assume that the azimuth distribution of the antenna on the B i th charging node is shown in Figure 4, which are ϕ i,1 , ϕ i,2 , . . . , ϕ i,z respectively. Their distribution is not the coordinates in the Euclidean space, but the angle distribution on the ring structure and can be circulated.
The dotted line in the Figure 4 represents the circle with an azimuth, the position pointed at by the arrow represents a different azimuth, and the band interval near the azimuth represents the threshold limit range of azimuth. Then, the distance d u,v i between azimuth ϕ i,u and azimuth ϕ i,v is defined as The force − → F u,v i between azimuth ϕ i,u and azimuth ϕ i,v is defined as where ω A and ω R have the same meaning as Equation (14), and d th i represents the virtual force threshold of the antenna on the PSN. By observing the overlap of the limited threshold range of each azimuth in Figure 4, the type of force between the azimuths can be judged. There is no coincidence area between azimuth ϕ i,1 and azimuth ϕ i,2 , so there is attraction between them. Azimuth ϕ i,2 and azimuth ϕ i,3 overlap in some regions; i.e., there is repulsion between them. As a result, there is a tendency for the two azimuths to be adjusted to non-coincident states. Azimuth ϕ i,z and azimuth ϕ i,1 are just in adjacent states, so there is no interacting force between them. The other difference between the ring virtual force algorithm and the traditional virtual force algorithm is that only the adjacent azimuths interact with each other, while the non-adjacent azimuth angles do not interact with each other. For example, there is no force between azimuth ϕ i,1 and azimuth ϕ i,3 , and the coincidence problem of their limited threshold range is not taken into account.

AVFPSO Algorithm
Particle swarm optimization is an algorithm developed by simulating the unpredictable motion of a flock of birds. It evolves around the advantages of sharing information in groups. The initial PSO algorithm was formed by adding the nearest neighbor speed match and adding the multidimensional search, in addition to considering the accelerated search based on distance. Then the PSO algorithm was optimized by introducing parameters such as inertia weight ω P . Suppose the qth particle in the population is denoted as X q = (x q,1 , x q,2 , . . . , x q,W ). The best position it has ever experienced, the value with the best fit, is represented by pbest q = (p q,1 , p q,2 , . . . , p q,W ), where W denotes the dimension of the particle. The best adaptive value is given by gbest = arg max( f (X q )), q ∈ (1, 2, . . . , W) The moving velocity of particle is denoted by V q (v q,1 , v q,2 , . . . , v q,W ). The updating formula of velocity and position is given by and x q,w (t + 1) = x q,w (t) + V q,w (t) (19) where c 1 and c 2 denote acceleration constants, and r 1 and r 2 denote random values within the range of [0,1]. When the PSO algorithm and ring virtual force algorithm are combined to solve the coverage problem, f (X q ) in Equation (17) is replaced by f (φ, θ) in Equation (9) to calculate the optimal fitness value pbest * q as follows: After completing the speed update, when updating the positions of particles, the azimuths of the antennas on the same PSN are adjusted by virtual force according to Equation (16).

Solution of the Model
For the solution of the multi-node energy supply system model, the situation of the single-sensor node energy supply system is first considered. Similarly, each energy packet entering the sensor node receives fixed benefit ε, and the waiting cost per unit time is c. The ultimate goal is to select the appropriate energy packet delivery rate, so as to minimize the total cost. Since the energy packet emission rate obeys the Poisson distribution with parameter λ, and the energy packet consumption of sensor nodes obeys the general distribution with parameter µ, the queuing model of the energy supply system of the single-sensor node can be described as M/G/1. Assume that: X b : represents the number of energy packets left in the node when the bth energy packet is consumed, and the consumed energy packet is numbered as b. T b : represents the elapsed time (from the time when the bth energy packet is consumed) of the next ((b + 1) th) energy packet when the bth energy packet is consumed.
represents the number of new energy packets entering the node during the period when the (b + 1) th energy packet is being consumed.
According to the queuing situation, Let d β = P (Y b = β) > 0; then, it can be proved that {X b } forms a Markov chain, which is generally called an embedded Markov chain. If p α β = P (X b+1 = β| X b = α), p 0β can be given as When X b > 0, Since the time {T b , b ≥ 1} consumed by the energy packet is an independent identically distributed sequence of random variables, its public distribution function is denoted as G (t) = P (T b ≤ t). Then, where P ( Y b = β| T b = t) represents the probability of β new energy packets entering the system in time interval (0, t). Since the energy packet arrives according to Poisson flow, we can get Substituting Equation (25) into (24), Since d 0 = p 00 > 0 and the states of the Markov chain are interconnected, this Markov chain is periodically irreducible. It satisfies and It can be verified that the Markov chain is traversed when ρ < 1, so there is a stationary distribution p β , β ≥ 0 which satisfies Constructing the generating function to solve p β , let It can be obtained from Equations (22), (23) and (29) that when β = 0, Add up all the equations to get Therefore, the generating function of energy packet quantity distribution in the system can be deduced as Substituting Equation (32) into (31), Combining Equations (27) and (28), With Equations (34) and (31), applying L 'Hopital's rule twice more, the average number of energy packets in the system can be obtained as In the single-node power supply system with the queuing model M/G/1, the cost minimization problem of a single-node power supply system can be described as where λ satisfies 0 ≤ λ < µ.
Since Equation (36) is a differentiable strictly convex function, Γ (λ) represents the first derivative of Γ (ρ) with respect to λ, which can be given as Therefore, the optimal arrival rate λ * satisfies Combining Equations (38) and (37), ε is a fixed value satisfying ε > 0, and λ * (ε) is the optimal arrival rate. The solution of Equation (39) can be obtained as Due to 0 ≤ λ < µ, the optimal arrival rate of the energy packets is From the system model of Equations (11) and (12), the problem of minimizing cost for multi-node energy supply system can be described as According to the generalized Lagrangian multiplier method, Equation (42) satisfies Equation (38) for each sensor node a and partial benefit ε. Therefore, the optimal arrival rate similar to the single node can be obtained as In this case, ∑ A a=1 λ * a (ε) is a strictly increasing function of ε. Thus, there is one and only one ε * , such that ∑ A a=1 λ * a (ε * ) = Λ. If ε > c a µ a , λ * a (ε) > 0. Therefore, when h < a, λ * h (ε) > 0, which means that under the equilibrium state of the system, the former a sensor nodes obtain energy packets according to the arrival rate of λ * a (ε) to be charged. Other sensor nodes are not selected because of low energy efficiency and insufficient energy. Therefore, in the designed model of multi-node power supply system, ε > c A µ A needs to be set for supplying energy to all active sensors.
In the multi-node energy supply system with queuing model M/G/1 of each sensor node, the optimal arrival rate of each node energy packet can be obtained as In this case, the lowest cost of the energy supply system is

Model Analysis
When building the energy supply system model, it assumes that the energy consumption random process of sensor nodes follows the general distribution with parameter µ. It satisfies E (T b ) = 1 µ and E T 2 b = q µ 2 . When q = 2, D (T b ) = 1 µ 2 , which means that the node energy consumption process is simplified to a negative exponential distribution. Then In the multi-node power supply system with each sensor node queuing model M/M/1, the equilibrium solution can be obtained as When q = 1, D (T b ) = 0. In this case, the energy consumption time of the sensor node follows the deterministic distribution; when 1 < q < 2, it follows the 1 q−1 -order Irish distribution. By analyzing the random process of node energy consumption in WRSNs, the random distribution which minimizes the cost of energy supply system is gotten under the same system parameters. According to this conclusion, the energy consumption time distribution of sensor nodes can be designed by adding a sleep mechanism.

Realization of the TPEM scheme
The AVFPSO algorithm and QGES algorithm are combined to realize the TPEM scheme for WRSNs, as shown in Figure 5.
In the first phase of the TPEM scheme, the threshold interval of antenna azimuth on the same PSN is determined by the initialization of AVFPSO algorithm. The initial particle swarm is then generated within the range of each parameter. After that, the fitness of each particle swarm is calculated and iterated. Then we determine the relationship between the position and the threshold. If the adjacent azimuth threshold interval overlaps, the azimuth is adjusted by repulsion. If the adjacent azimuth threshold interval diverges, the azimuth is adjusted by attraction. If the adjacent azimuth threshold intervals happen to be next to each other, the next step is entered. The search for the maximum coverage is completed by the cross-iterative updating of two particle swarms. Finally, the optimal solution of azimuth and tilt is obtained to achieve the area coverage. The pseudocode of AVFPSO algorithm is described in Algorithm 1.  gbest w ← the position of the particle with best fitness; 20 t = t + 1;

end
After the completion of the first phase, the TPEM scheme executes the QGES algorithm in the second phase to charge sensor nodes. The parameter information of nodes µ a , c a , and q in the coverage area is obtained by the PSN. Random flow of energy packets with arrival rate Λ 0 < Λ < ∑ A a=1 µ a is generated from the PSN. The arrival rate λ * a of energy packets received by each sensor node is calculated according to Equation (45). λ * a is taken as the weight of sensor node a, and the PSN adopts the smooth weighted polling (SWP) algorithm to provide energy packets for each sensor node. The pseudocode of QGES algorithm is described in Algorithm 2.

Algorithm 2: QGES algorithm.
Input: Energy packets with arrival rate Λ are generated from the PSN.
1 initialization:; 2 The energy packet consumption time T a of sensor node a obeys the general distribution which satisfies E (T a ) = 1 µ a , E T 2 a = q µ 2 a and ∑ A a=1 µ a > Λ. 3 Each energy packet entering the sensor node receives fixed benefit ε and the waiting cost per unit time is c a . It satisfies c 1 8 According to Theorem 2, calculate the value of ε * , and λ * a .
The PSN adopts the smooth weighted polling (SWP) algorithm to provide energy packets for each sensor node a with the weight λ * a .

Parameter Settings
In the validation of the AVFPSO algorithm, COST-231 transmission model [21] was selected to calculate the path loss L i,j . The adjustable parameters were antenna azimuth objective: max f (φ, θ) and tilt objective: max f (φ, θ) with the effective range [0, 2π). The DSNPSO algorithm [26], a modified PSO algorithm suitable for directed sensor networks, was selected as the comparison algorithm. In the simulation, real data with terrain height in real environment were used to verify the effectiveness of the AVFPSO algorithm. The parameters are described below in Table 1. In the validation of the QGES algorithm, the energy packet consumption rate of sensor node determined the operating efficiency of the network element. Parameter q = 2, 3 2 , 1 was set to simulate the energy consumption interval obeying negative exponential distribution, 2-order Irish distribution, and deterministic distribution respectively. We set the number of sensor nodes with charging requirements as A = 3 and the energy consumption rate as µ = {10, 20, 35}. The energy packet generation rate of the PSN obeyed the Poisson distribution with parameter Λ = 50. Each energy packet was consumed and converted into a network value for data acquisition, storage, or forwarding. The network value return of each energy packet was set as ε. After the energy pack is charged into the sensor node, it needs to pay the waiting cost c before it is consumed. c is composed of the node energy storage space occupied by the energy pack and the reduction of power life. The cost of waiting can be translated into the loss of the data service and thus associated with the social welfare.

Numerical Simulation
The corresponding parameters of QGES algorithm were put into Equation (45) for numerical calculation in MATLAB, and the results are shown as Figure 6. It depicts the relationship between the optimal energy packet allocation rate λ * , the value of q, and energy consumption rate µ = {10, 20, 35} of the sensor node. When q increases from 1 to 2, it basically remains unchanged, indicating that different distribution of energy consumption interval has little influence on the optimal solution of the energy supply system. Obviously, the bigger µ is, the bigger the corresponding λ * is. It demonstrates that the nodes with higher energy consumption rate obtain more energy supply, which is consistent with normal rational cognition. However, under the optimal solution condition, the excess of the total energy consumption rate over total demand is not distributed uniformly among the nodes, but in a way that is proportional to the square root of their energy consumption rate. According to this conclusion, the design of energy supply strategy achieves the system cost minimization. Based on Equation (46), the minimum cost of the energy supply system can be obtained with the energy consumption rate µ = {10, 20, 35}. Figure 7 depicts the trend of the system minimum cost with the value q. q = 1 represents the energy consumption time interval of the nodes following the deterministic distribution; 1 < q < 2 represents the nodes following the 1 q−1 -order Irish distribution; and q = 2 represents the nodes following the negative exponential distribution. From Figure 7, the minimum cost of the energy supply system increases with the increase of the value q. In other words, the system cost is the lowest when the node energy consumption time interval follows the deterministic distribution. Therefore, when designing the working scheme of sensor nodes, making the energy dissipation interval obey the random distribution with as small a variance as possible should be considered. Finally, maximize the social welfare of the system.  Figure 8 shows the actual network deployment map, where the yellow circle represents the location of the PSN. Other colors represent different actual terrain, such as green for forests and blue for rivers. Three directional charging antennas are configured on the yellow PSN nodes. This scenario contains 23 PSNs and the number of covered assessment sampling points is 62,730. Firstly, the number of particle swarms was set to 10. As shown in Figure 9, the coverage implemented by AVFPSO algorithm was higher than that of DSNPSO algorithm in the whole iteration running interval. The AVFPSO algorithm also converged faster. Then we increased the number of particle swarms to 20. As shown in Figure 10, similarly to the previous results, the AVFPSO algorithm was still better than DSNPSO in terms of overall coverage performance and algorithm convergence. In the case of a larger particle swarm, the gap between the two was slightly larger than before. By comparing the AVFPSO algorithm with 10 particles and the DSNPSO algorithm with 20 particles, it can be observed that the performance of AVFPSO algorithm was still better than that of DSNPSO algorithm, even if the number of particle swarms was small. It means that the AVFPSO algorithm can get a faster search speed with the aid of virtual force algorithm. A real-time demand scheduling scheme (RCSS) [26] has been selected for a comparison of QGES algorithms. As shown in Figure 11, the Y-coordinate indicates the total electric quantity of the system. If the power is 0, it means that the system cannot work normally due to the power failure of one or more sensor nodes. Both algorithms start with the same initial electric quantity. The electric quantity obtained by each node is not uniform. When the electric quantity of some nodes is too low, the RCSS algorithm charges them to ensure the normal operation of the system. QGES algorithm is a balanced charging method based on the strategy of each node. The power of the system decreases slowly in a wave mode, indicating that each node in the network can maintain a relatively balanced power. As shown in Figure 12, within a short time after the system is started, the total power of the network charged by the RCSS algorithm decreases significantly. Overall, the QGES algorithm allows the system to maintain a higher power level than RCSS, allowing the network to operate for longer periods with the same amount of power.

Conclusions
The laying of 5G networks provides a foundation for future scenarios where things are connected. As the ends and edges of the Internet, WSNs provide massive data for the core network and reduce resource costs, such as manpower and equipment. The main constraint to the applications of WSNs is energy supply. In this paper, a TPEM scheme based on virtual force and the queuing game is proposed to extend the life cycles of WRSNs effectively. In the first phase, according to the position distribution characteristics of multiple antennas on the nodes, the AVFPSO algorithm was designed to achieve the coverage of the target area by solving the optimal azimuth and tilt. By using the virtual force to pull particles and by adjusting the optimal direction, the optimization algorithm can jump out of the local optimal solution and converge to the global optimal solution more quickly. After the coverage is completed, the limited energy is divided into energy packets and the queuing game theory is used to construct the energy supply system model. By solving the optimal energy supply strategy at the minimum cost, the QGES algorithm is designed to realize the optimal resources allocation of WRSNs. The change of system cost was analyzed with different random distributions of the energy consumption interval of nodes. The results show that the smaller the variance of the random distribution is, the lower the cost of the energy supply system-that is, the greater the social welfare that will be obtained. This conclusion can provide theoretical guidance for designing mechanisms such as node sleep scheduling. The system simulation results show that compared with the RCSS algorithm, the TPEM scheme achieves efficient energy management of WRSNs with lower total energy consumption in the same running time.