Summary of the invention
The object of this invention is to provide the set based on dump energy more reasonable, that can effectively reduce network energy consumption, prolongation network lifecycle of a kind of network route construction and divide multi-hop routing method.
For solving the problems of the technologies described above, as one aspect of the present invention, provide a kind of set based on dump energy to divide multi-hop routing method, comprising: step 1, is divided into multiple regions by wireless sensor network; Step 2, is divided into multiple first set with same node point number by all nodes in wireless sensor network by nearest principle; Step 3, according to the first position distribution being integrated in wireless sensor network, generates second set with multiple cluster heads; Step 4, for each cluster head is given weights; Step 5 is that the each cluster head in the second set is determined forward direction cluster head; Step 6 is that the each cluster head in the second set is determined down hop cluster head; Step 7, between member in each the first set and its corresponding cluster head, there is the first distance, between this member and Sink node, there is second distance, according to first distance and second distance between magnitude relationship, determine this member be the cluster head corresponding with it or with Sink node communication.
Further, wireless sensor network is square, and difference is eight.
Further, step 2 also comprises: random selection and first the same number of the first both candidate nodes of gathering in all nodes; In the node except the first both candidate nodes, the random near node of multiple distance measurements of selecting is as the second both candidate nodes, and wherein, the second both candidate nodes is relative's node of the first both candidate nodes; The first both candidate nodes and the set of the second both candidate nodes composition both candidate nodes.
Further, step 3 is pressed at least one mode and is determined candidate's cluster head: (1), if having a both candidate nodes that belongs to both candidate nodes set in region, adds the second set as candidate's cluster head this both candidate nodes so; (2), if there are two both candidate nodes that belong to both candidate nodes set in region, add the second set as candidate's cluster head one of random selection in these two both candidate nodes so; (3), if there are three both candidate nodes that belong to above both candidate nodes set in region, so this more than three is selected to two in both candidate nodes at random and add the second set as candidate's cluster head; (4) if do not belong to the both candidate nodes of both candidate nodes set in region, skip over so this region.
Further, the weights in step 4 are directly proportional to the node energy of this cluster head, and are inversely proportional to the distance of Sink node.
Further, the weights in step 4 calculate according to following formula:
Wherein,
W is weights;
Ei is the current energy of node;
Emax is the primary power of node;
Dmax is in all nodes and the maximum distance of Sink node;
D (i, sink) is the distance of node and Sink node.
Further, in step 5: the distance of establishing between cluster head i and Sink node is Disink, and the distance between cluster head j and Sink node is Djsink, and the distance between cluster head i and cluster head j is Dij, if meet the following conditions, cluster head j is the forward direction cluster head of cluster head i:
D
ij 2+D
isink 2>D
jsink 2
D
jsink 2+D
isink 2>D
ij 2。
Further, step 6 is determined down hop cluster head by following at least one mode:
(1), if a cluster head has more than two forward direction cluster heads, find out the two forward direction cluster heads nearest apart from this cluster head, and select larger that of weights as its interim down hop cluster head; If the weights of this interim father node are greater than the weights of this cluster head, using this interim down hop cluster head as down hop cluster head, otherwise using Sink node as down hop cluster head;
(2), if a cluster head has two forward direction cluster heads, selecting the forward direction cluster head that weights are larger is interim down hop cluster head; If the weights of this interim down hop cluster head are greater than the weights of this cluster head, using this interim down hop cluster head as down hop cluster head, otherwise using Sink node as down hop cluster head;
(3), if a cluster head only has a forward direction cluster head, the relatively weights of this cluster head and forward direction cluster head, if the weights of this forward direction cluster head are larger, are down hop cluster head by this forward direction cluster head, otherwise using Sink node as down hop cluster head;
(4) if forward direction cluster head is zero, using Sink node as down hop cluster head.
The invention enables the cluster head optimum of election, and between cluster head and base station, set up multi-hop route, reduce the communication distance between node, the balanced energy consumption of network, has improved performance and the life cycle of network to a great extent.
Embodiment
Below embodiments of the invention are elaborated, but the multitude of different ways that the present invention can be defined by the claims and cover is implemented.
The application is based on above deficiency, proposed a kind of set based on dump energy and divided multi-hop routing method, all the sensors node is divided into several and has the set of same node point number by nearest principle, makes cluster head distribution uniform; Between cluster head and base station (Sink node), establish multi-hop communication path according to weights size again, can avoid so the huge energy consumption that between cluster head and base station, telecommunication causes.Compared with traditional LEACH algorithm, the LEACH-ECM algorithm after the application improves makes network route construction more reasonable, and the balanced energy consumption of network has improved performance and the life cycle of network to a great extent.
Please refer to Fig. 1 to Fig. 3, the invention provides a kind of set based on dump energy and divide multi-hop routing method, comprising:
Step 1, is divided into multiple regions by wireless sensor network.Please refer to Fig. 1, in the embodiment shown in fig. 1, preferably, described wireless sensor network is square, and described difference is eight.In this embodiment, square network is divided into eight regions along diagonal, neutrality line, and marks sequence number 1-8.
Step 2, is divided into multiple first set with same node point number by all nodes in described wireless sensor network by nearest principle.In one embodiment, having 100 nodes in this network, like this, can be 20 first set respectively with 5 nodes by these 100 node division.
Step 3, according to described the first position distribution being integrated in described wireless sensor network, generates second set with multiple cluster heads.For example, can be according to these 20 distributions that are integrated into eight regions in network, select second set with multiple cluster heads.Especially, in the second set, the node of energy maximum is elected as final cluster head.
Step 4, for each described cluster head is given weights.Wherein, the more qualified relaying cluster head of serving as of cluster head that weights are larger.
Step 5, for the each cluster head in described the second set is determined forward direction cluster head.
Step 6, for the each cluster head in described the second set is determined down hop cluster head.
Step 7, between member in each described the first set and its corresponding cluster head, there is the first distance, between this member and Sink node, there is second distance, according to described first distance and described second distance between magnitude relationship, determine this member be the cluster head corresponding with it or with described Sink node communication.Like this, for bunch in member (first set in member), if bunch in the distance of member and cluster head be greater than and the distance of Sink, with Sink direct communication.If because bunch in member directly communicate by letter with cluster head, member's energy consumption in both having increased bunch, has also increased the energy consumption of cluster head.
The present invention is divided into all the sensors node in network several and has the set of same node point number by nearest principle, select some candidate's cluster head set according to the distribution being integrated in network, the point of selecting energy maximum in the set of candidate's cluster head is cluster head.Between cluster head and base station, establish multi-hop communication path according to weights size again.The present invention program makes network route construction more reasonable, has effectively reduced the energy consumption of network, and then the life cycle that has extended network.
The invention enables the cluster head optimum of election, and between cluster head and base station, set up multi-hop route, reduce the communication distance between node, the balanced energy consumption of network, has improved performance and the life cycle of network to a great extent.
Preferably, step 2 also comprises: random selection and described first the same number of the first both candidate nodes of gathering in all nodes; In the node except described the first both candidate nodes, select at random the near node of multiple distance measurements as the second both candidate nodes, wherein, relative's node that described the second both candidate nodes is described the first both candidate nodes; Described the first both candidate nodes and described the second both candidate nodes composition both candidate nodes set.For example, take the network of 100 nodes as example, can first in 100 nodes, select at random 20 nodes is the first both candidate nodes, in 80 remaining nodes, select successively the relative node (i.e. second both candidate nodes) of 4 nearest nodes as this first both candidate nodes, the node in the set after dividing is like this more approaching in position.
Preferably, step 3 is pressed at least one mode and is determined candidate's cluster head:
(1), if there is a both candidate nodes that belongs to described both candidate nodes set in described region, so this both candidate nodes is added described the second set as candidate's cluster head;
(2), if there are two both candidate nodes that belong to described both candidate nodes set in described region, select one to add described the second set as candidate's cluster head using random in these two both candidate nodes so;
(3), if there are three both candidate nodes that belong to above described both candidate nodes set in described region, more than three in both candidate nodes, select at random two to add described the second set as candidate's cluster head this so;
(4) if do not belong to the both candidate nodes of described both candidate nodes set in described region, skip over so this region.
Preferably, the described weights in step 4 are directly proportional to the node energy of this cluster head, and are inversely proportional to the distance of Sink node.
Preferably, the described weights in step 4 calculate according to following formula:
Wherein,
W is weights;
Ei is the current energy of node;
Emax is the primary power of node;
Dmax is in all nodes and the maximum distance of Sink node;
D (i, sink) is the distance of node and Sink node.
Preferably, in step 5: the distance of establishing between cluster head i and Sink node is Disink, and the distance between cluster head j and Sink node is Djsink, and the distance between cluster head i and cluster head j is Dij, if meet the following conditions, cluster head j is the forward direction cluster head of cluster head i:
D
ij 2+D
isink 2>D
jsink 2
D
jsink 2+D
isink 2>D
ij 2。
Preferably, step 6 is determined down hop cluster head by following at least one mode:
(1) if cluster head has more than two forward direction cluster heads described in one, find out the two forward direction cluster heads nearest apart from this cluster head, and select larger that of weights as its interim down hop cluster head; If the weights of this interim father node are greater than the weights of this cluster head, using this interim down hop cluster head as down hop cluster head, otherwise using Sink node as down hop cluster head;
(2), if cluster head has two forward direction cluster heads described in one, selecting the forward direction cluster head that weights are larger is interim down hop cluster head; If the weights of this interim down hop cluster head are greater than the weights of this cluster head, using this interim down hop cluster head as down hop cluster head, otherwise using Sink node as down hop cluster head;
(3), if cluster head only has a forward direction cluster head described in one, the relatively weights of this cluster head and forward direction cluster head, if the weights of this forward direction cluster head are larger, are down hop cluster head by this forward direction cluster head, otherwise using Sink node as down hop cluster head;
(4) if forward direction cluster head is zero, using Sink node as down hop cluster head.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.