Mobile charging method of wireless sensor network based on greedy algorithm
Technical Field
The invention belongs to the technical field of energy supply of a wireless rechargeable sensor network, and particularly relates to a greedy algorithm-based mobile charging method of the wireless rechargeable sensor network.
Background
Nowadays, with the requirement of technology, the Wireless Rechargeable Sensor Network (WRSN) technology becomes the focus of many research fields, and in the Rechargeable Sensor network, a fixed base station is used for charging the whole networking, but the charging base station is expensive in manufacturing cost and consumes time and labor, which is a big disadvantage; there are also cases where the mobile vehicle is moved to each node for charging, and low energy utilization is a disadvantage of this method.
At present, some researches have been made on the deployment problem of charging base stations of wireless chargeable sensor networks aiming at different characteristics of the charging base stations. Wanpeng et al put forward a fixed base station optimization scheme of the whole sensor network in a patent of a charging base station deployment method of a wireless chargeable sensor network (patent number: CN109246602A), but the calculation process is complex and is difficult to be applied to the configuration of a large-scale sensor network. In the patent of 'a charging control method of wireless sensor network nodes' (patent number: 201611042178.8), royal jade and the like divide areas with different priorities according to the residual energy of the sensor nodes, and then use a trolley to charge according to the charging emergency degree of the nodes, but the dividing mode of the method cannot ensure that each node is just distributed in different areas according to different requirements, so that the moving path of the charging trolley cannot be reasonably planned.
Disclosure of Invention
The invention aims to provide a greedy algorithm-based mobile charging method for a wireless chargeable sensor network.
The method comprises the following specific steps:
step one, determining a plurality of charging stop point positions in a wireless sensor network; all wireless sensors are within an active charging region of at least one charging dwell point. And each charging stop point forms a stop point set M.
Step two, obtaining line segments between every two points in the stop point set M to obtain the line segments
And M is the number of charging stop points in the stop point set M. The
The line segments constitute a line set V.
And step three, taking an initial blank line set T.
And step four, adding the line segment with the shortest length in the line set V into the line set T and deleting the line segment from the line set V. Judging whether the line segments in the line set T are branched or not; if the branch appears, deleting the line segment which is just added into the line set T from the line set T; otherwise, go to step five.
Step five, judging whether the line segments in the line set T form a loop, and if the line segments in the line set T do not form a loop, executing the step four again; and if a loop is formed, entering a step six.
Step six, if the number of the line segments in the line set T is less than m, deleting the line segments which are recently added into the line set T from the line set T, and executing the step four and the step five again; if the number of the line segments in the line set T is equal to m, the m line segments forming the loop in the line set T are the charging paths.
Step seven, setting the position of a charging base station for charging the charging trolley; the charging trolley is driven out from the charging base station and runs along a charging path; when the charging trolley reaches a charging stop point, charging the wireless sensor in the effective charging area of the charging stop point; all wireless sensors are charged as the charging trolley travels and stops along the charging path.
Preferably, the specific method for determining each charge stop point in the step one is as follows:
step 1, establishing a planar rectangular coordinate system, and placing n common nodes corresponding to the positions of the n wirelessly chargeable sensors into a first quadrant of the planar rectangular coordinate system. A set formed by n common nodes is a total node set U; the n common nodes are all in a rectangular range. Then, with the geometric center of the rectangular range as a central point, sequencing and numbering the n common nodes from small to large according to the distances from the common nodes to the central point;
and step 2, assigning 1 to i.
Step 3, taking the common node with the minimum number in the total node set U as the ith central node Oi。
Step 4, using the ith central node OiAnd taking 2R as the radius of the circle as the center of the circle to obtain an ith characteristic circle, wherein R is the radius of an effective charging area of charging equipment on the charging trolley. Adding all common nodes positioned in the ith characteristic circle into a candidate set SiAnd removed from the total node set U.
And 5, determining the positions of one or more charging stop points in the range of the ith characteristic circle.
5-1. with the ith central node OiAnd taking R as the radius to make a circle by taking the circle as the center of the circle to obtain the ith central circle.
5-2, assign 1 to j.
5-3, optionally selecting a point on the outline of the ith central circle as the center of the circle, and making a circle by taking R as the radius to obtain a candidate circle; moving the center of the candidate circle for one circle along the edge of the ith central circle to determine a candidate set S capable of being coverediThe candidate circle position with the largest number of normal nodes is used as the covered circleij(ii) a Will cover round-ijFrom the candidate set SiRemoving and adding a feature set Qij。
5-4. if feature set QijOnly one common node is arranged in the charging device, and the common node is taken as a charging stop point cij。
If the feature set QijIf there are two common nodes, the middle point of the connecting line of the two common nodes is taken as the charging stop point cij。
If the feature set QijIf the number of the inner common nodes is more than or equal to three, taking a characteristic set QijTwo common nodes with the farthest distance in the node are marked as a first screening node p1A second screening node p2. Get the first screening node p1And a second screening node p2The midpoint of the connecting line is used as a candidate node. Finding candidate set QjRemoving the first screening node p1A second screening node p2The common node farthest from the candidate node is marked as a third screening node p3. If the third screening node p3If the distance between the candidate node and the candidate node is larger than R, entering the step 5-5; otherwise, taking the candidate node as a charging stop point cijAnd proceeds directly to step 5-6.
5-5, screening the node p by the first screening node1A second screening node p2A third screening node p3And establishing the characteristic triangle respectively for three vertexes of the characteristic triangle.Using the outer center of the characteristic triangle as a charging stop point cijThen proceed to step 5-6.
5-6. if the candidate set SiIf the common node exists, increasing j by 1, and repeatedly executing the steps 5-3 to 5-5; otherwise, go to step 6.
And 6, if the general node exists in the total node set U, increasing i by 1, and repeatedly executing the steps 3 to 5. If no common node exists in the total node set U, finishing all charging stop points cijDetermination of position, all charging stop points cijA set of stop points M is formed.
Preferably, in the seventh step, when the electric quantity in the charging trolley is lower than a preset value, the charging trolley returns to the charging base station to supplement the electric quantity for the charging trolley; and after the electric quantity of the charging trolley is supplemented, the charging trolley continuously runs to a charging path to charge each wireless sensor.
Preferably, in the fourth step, the branch indicates that any three or more line segments in the line set T are intersected at the same charging stop point. And step five, forming a plurality of line segments in the loop representation line set T to form a ring shape which is sequentially connected end to end.
Preferably, the charging base station is located at any charging stop point.
Preferably, the charging base station is located at a charging dense point. The charging intensive point is the charging stop point with the minimum sum of the distances from the charging stop points to two adjacent charging stop points.
The invention has the beneficial effects that:
1. the wireless charging trolley gets rid of the defects of the original wireless chargeable sensor network charging mode, combines the advantages of mobile charging and wireless omnidirectional charging equipment, enables the charging trolley to simultaneously charge a plurality of wireless chargeable sensors at one stop point, can maximally utilize energy radiated during charging, and improves the charging efficiency and the charging range to a new height.
2. The invention plans a charging path with shorter length at each selected charging stop point, and reduces the time and energy loss of the charging trolley in the transfer process.
3. According to the invention, the charging equipment can cover the wireless chargeable sensor as much as possible by moving the candidate circle on the center circle.
4. The method is based on a greedy algorithm, the time complexity of the algorithm is low, and the method can be suitable for application scenes with large quantity of rechargeable sensors.
Drawings
FIG. 1 is a schematic diagram of a charging stay point and a wirelessly rechargeable sensor network according to the present invention;
FIG. 2 is a schematic diagram of the first characteristic circle selected in step 3 according to the present invention;
FIG. 3 is a schematic diagram of the candidate circle moving on the center circle in step 4 according to the present invention;
FIG. 4 is a schematic diagram of three cases in step 5-3 of the present invention.
FIG. 5a is a schematic illustration of branch formation;
FIG. 5b is a schematic view of the formation of a loop;
fig. 6 is a schematic diagram of the movement of the charging carriage on the resulting charging path in the present invention.
FIG. 7 is a comparison line graph of the present invention algorithm (DGA) versus other algorithm paths.
Detailed Description
A charging method of a wireless sensor network based on energy consumption classification aims at that all wireless chargeable sensors in the wireless sensor network are arranged on the same plane. And charging the wireless chargeable sensors by using the charging trolley and the charging base station. The charging trolley is provided with wireless omnidirectional charging equipment which can charge one or more wireless chargeable sensors in an effective charging area. The effective charging area is internally provided with a circle which takes the circle as the center of the circle and has a radius of R. The method comprises the steps that a plurality of charging stop points are arranged in a wireless sensor network, so that all wireless chargeable sensors are in an effective charging area of at least one charging stop point; and the charging trolley moves to each charging stop point one by one along the charging path to charge all the wireless chargeable sensors.
As shown in fig. 1, n wireless chargeable sensors with random and known positions and a charging base station for replenishing the charging trolley with electricity are arranged on a deployment plane of the wireless sensor network. In fig. 1, the hollow dots are wireless chargeable sensors; point C is the location of the charging base station; the cross point is one of the charging stop points; the circular range is the effective charging area when the charging trolley moves to the charging stop point.
Example 1
The specific steps of the charging method of the wireless sensor network based on energy consumption classification are as follows:
step 1, establishing a planar rectangular coordinate system, and placing n common nodes corresponding to the positions of the n wirelessly chargeable sensors into a first quadrant of the planar rectangular coordinate system. A set formed by n common nodes is a total node set U; n common nodes are all in an H multiplied by L rectangular range; the lower left corner of the rectangular range is the origin of coordinates of the planar coordinate system. H. L is the length and the width of the rectangular range respectively, and the value of L is determined according to the positions of all the common nodes, so that the rectangular range covers all the common nodes; then, taking the geometric center of the rectangular range as a central point (H/2, L/2), and sequencing and numbering the n common nodes from small to large according to the distance from the common nodes to the central point; and if the distances are the same, taking the front of the common node row with the close coordinate origin.
And step 2, assigning 1 to i.
Step 3, taking the common node with the minimum number in the total node set U as the ith central node Oi。
Step 4, as shown in FIG. 2, with the ith central node OiAnd taking 2R as the radius of the circle as the center of the circle to obtain an ith characteristic circle, wherein R is the radius of an effective charging area of charging equipment on the charging trolley. Adding all common nodes positioned in the ith characteristic circle into a candidate set SiAnd removed from the total node set U.
And 5, determining the positions of one or more charging stop points in the range of the ith characteristic circle.
5-1, with the ith central node OiAs the center of circle, R is the radius to make a circle, and the ith center is obtainedAnd (4) a circle.
5-2, assign 1 to j.
5-3, as shown in FIG. 3, optionally selecting a point on the outline of the ith central circle as the center of the circle, and making a circle by taking R as the radius to obtain a candidate circle; moving the center of the candidate circle for one circle along the edge of the ith central circle to determine a candidate set S capable of being coverediThe candidate circle position with the most common nodes is used as the covering circle Oij(ii) a Will cover round-ijFrom the candidate set SiRemoving and adding a feature set Qij。
5-4. As shown in FIG. 4, if the feature set QijOnly one common node is arranged in the charging device, and the common node is taken as a charging stop point cij。
If the feature set QijIf there are two common nodes, the middle point of the connecting line of the two common nodes is taken as the charging stop point cij。
If the feature set QijIf the number of the inner common nodes is more than or equal to three, taking a characteristic set QijTwo common nodes with the farthest distance in the middle are marked as a first screening node p1A second screening node p2. Get the first screening node p1And a second screening node p2The midpoint of the connecting line is used as a candidate node. Finding candidate set QjRemoving the first screening node p1A second screening node p2The common node farthest from the candidate node is marked as a third screening node p3. If the third screening node p3If the distance between the candidate node and the candidate node is larger than R, entering the step 5-5; otherwise, taking the candidate node as a charging stop point cijAnd proceeds directly to step 5-6.
5-5, screening the node p by the first screening node1A second screening node p2A third screening node p3And establishing the characteristic triangle respectively for three vertexes of the characteristic triangle. Using the outer center of the characteristic triangle as a charging stop point cijThen proceed to step 5-6.
5-6. if the candidate set SiIf there is a normal node, j is increased by 1 and the process is repeated5-3 to 5-5; otherwise, go to step 6.
And 6, if the general node exists in the total node set U, increasing i by 1, and repeatedly executing the steps 3 to 5. If no common node exists in the total node set U, finishing all charging stop points cijDetermination of position, all charging stop points cijAnd forming a stop point set M and entering a step 7.
Step 7, sequencing the charging stop points in the stop point set M according to the sequence of the determined positions, obtaining a connecting line segment and a distance value between every two points in the stop point set M, and obtaining the connecting line segment and the distance value
And M is the number of charging stop points in the stop point set M. The device is
The line segments constitute a line set V. And collecting lines in V
The line segments are sorted and numbered in order from short to long.
Step 8, taking an initial blank line set T; assign 1 to i.
Step 9, line segment l with number i in line set Vi(i.e., the segment of shortest length) is added to line set T and deleted from line set V. Judging whether the line segments in the line set T are branched or not; if a branch occurs, the segment l just added to the line set TiDelete from line set T; otherwise, go to step 10. As shown in fig. 5a, the branch indicates that any three or more line segments in the line set T are intersected at the same charging stop point.
Step 10, judging whether the line segments in the line set T form a loop, if not, increasing i by 1, and executing step 9; if a loop is formed, the process proceeds to step 11. As shown in fig. 5b, a plurality of line segments in the loop indicating line set T form a closed loop shape which is connected end to end in sequence.
Step 11, if line set TIf the number of the line segments in the line set T is less than m, the line segment l which is most recently added into the line set T is addediDelete from line set T, increment i by 1, and perform steps 9 and 10; if the number of the line segments in the line set T is equal to m, the m line segments forming the loop in the line set T are the charging paths, as shown in fig. 6.
Step 12, setting the position of the charging base station; the charging base station is used for charging the charging trolley. The charging trolley runs from the charging base station to a charging stop point closest to the charging base station and runs along a charging path; stopping the charging trolley when the charging trolley reaches a charging stopping point, and charging the wireless sensor in a circular range with the charging stopping point as a circle center and R as a radius; and the charging trolley continues to drive to the next charging stop point until the wireless sensors in the circular range are fully charged.
When the electric quantity in the charging trolley is lower than a preset value, the charging trolley returns to the charging base station to supplement the electric quantity for the charging trolley; and after the electric quantity of the charging trolley is supplemented, the charging trolley continuously runs to a charging path to charge each wireless sensor.
In order to verify the advantages of the invention on the total running path of the Charging trolley, the algorithm of the invention is compared with two algorithms of 'GA' (genetic algorithm) and 'APS' (anchor point selection algorithm) in an article 'Joint Power Charging and Routing in Wireless Rechargeable Sensor Networks' (sensors); the results are shown in FIG. 7.
In fig. 7, the abscissa is the number of sensor nodes, and the ordinate is the total moving path of the charging trolley; triangular connection (GA) and star connection (APS) correspond to algorithms in the article "Joint Power Charging and Routing in Wireless Rechargeable Sensor Networks"; dot connection (DGA) corresponds to the present invention; it can be obviously seen that certain sensor nodes are arranged in the same plane, and the total moving path lengths of the three algorithms have little difference when the number of the nodes is small; after the number of nodes is increased to 200, gaps begin to be embodied; the total path length of movement required by the invention is obviously less; and thereafter the path value growth trend is slower as the number of nodes continues to increase. Therefore, the invention is more excellent in the realization of reducing the moving path of the trolley, and the charging efficiency of the whole wireless chargeable sensor network can be further improved.
Example 2
This example differs from example 1 in that: determining a specific charging base station position; and (3) the position of the charging base station is positioned at the central point of the rectangular range in the step 1.
Example 3
The present example differs from example 1 in that: determining a specific charging base station position; the charging base station position is located at any one charging stay point.
Example 4
The present example differs from example 1 in that: determining a specific charging base station position; the charging base station is located at a charging dense point. The charging intensive point is the charging stop point with the minimum sum of the distances from the charging stop points to two adjacent charging stop points.