The content of the invention
It is an object of the invention to provide a kind of network route construction more rationally, be effectively reduced network energy consumption, prolong
The set based on dump energy of network lifecycle long divides multi-hop routing method.
In order to solve the above technical problems, as one aspect of the present invention, there is provided a kind of set based on dump energy
Multi-hop routing method is divided, including:Step 1, multiple regions are divided into by wireless sensor network;Step 2, by wireless senser
All nodes in network are divided into multiple first sets with same node point number by closest principle;Step 3, root
Position distribution according to first set in wireless sensor network, generation has the second set of multiple cluster heads;Step 4, is every
Individual cluster head assigns a weights;Step 5, is that each cluster head determination in second set is preceding to cluster head;Step 6, is second set
Each interior cluster head determines next-hop cluster head;Step 7, has the between the corresponding cluster head of member in each first set
One distance, has second distance between the member and Sink node, according to the magnitude relationship between the first distance and second distance,
Determine that the member is corresponding cluster head or is communicated with Sink node.
Further, wireless sensor network is square, is distinguished as eight.
Further, step 2 also includes:Random selection is waited with the same number of the first of first set in all nodes
Select node;The near node of multiple distance measurements is randomly choosed in the node in addition to the first both candidate nodes to be saved as the second candidate
Point, wherein, the second both candidate nodes are relative's nodes of the first both candidate nodes;First both candidate nodes and the second both candidate nodes composition are waited
Select node set.
Further, step 3 presses at least one mode and determines candidate's cluster head:(1)If there is one in region to belong to
The both candidate nodes of both candidate nodes set a, then both candidate nodes are added into second set as candidate's cluster head;(2)If area
There are two both candidate nodes for belonging to both candidate nodes set, then an addition will be randomly choosed in two both candidate nodes in domain
Second set is used as candidate's cluster head;(3)If having more than three both candidate nodes for belonging to both candidate nodes set in region, then
Second set as candidate's cluster head is added using randomly choosing two in more than three both candidate nodes;(4)If do not had in region
Belong to the both candidate nodes of both candidate nodes set, then skip over the region.
Further, the weights in step 4 are directly proportional to the node energy of the cluster head, and with the distance of Sink node into anti-
Than.
Further, the weights in step 4 are calculated according to following formula:
Wherein,
W is weights;
Ei is the present 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:If the distance between cluster head i and Sink node are Disink, cluster head j and Sink node
The distance between be Djsink, the distance between cluster head i and cluster head j be Dij, if meeting following condition, cluster head j is cluster head i
Forward direction cluster head:
Dij 2+Disink 2> Djsink 2
Djsink 2+Disink 2> Dij 2。
Further, step 6 determines next-hop cluster head by following at least one modes:
(1)If a cluster head has before more than two to cluster head, the two forward direction cluster heads nearest apart from the cluster head are found out, and
Larger that of weights is selected as its interim next-hop cluster head;If the weights of the temporary parent are more than the weights of the cluster head,
Using the interim next-hop cluster head as next-hop cluster head, otherwise using Sink node as next-hop cluster head;
(2)If a cluster head has two forward direction cluster heads, the larger forward direction cluster head of selection weights is interim next-hop cluster
It is first;If the weights of the interim next-hop cluster head are more than the weights of the cluster head, using the interim next-hop cluster head as next-hop cluster
Head, otherwise using Sink node as next-hop cluster head;
(3)If comparing the weights of the cluster head and forward direction cluster head to cluster head before a cluster head only one of which, if this is preceding to cluster head
Weights it is larger, then by this it is preceding to cluster head be next-hop cluster head, otherwise using Sink node as next-hop cluster head;
(4)If forward direction cluster head is zero, using Sink node as next-hop cluster head.
Cluster head the invention enables election is optimal, and multihop routing is set up between cluster head and base station, between reduction node
Communication distance, the balanced energy ezpenditure of network greatly enhances the performance and life cycle of network.
Specific embodiment
Embodiments of the invention are described in detail below, but the present invention can be defined by the claims and cover
Multitude of different ways is implemented.
The application is based on not enough above, it is proposed that a kind of set based on dump energy divides multi-hop routing method, institute
Having sensor node to be divided into several by closest principle has the set of same node point number so that cluster head distribution is more equal
It is even;Cluster head and base station(Sink node)Between establish multi-hop communication path further according to weights size, can so avoid cluster head with
The huge energy consumption that telecommunication is caused between base station.Compared with traditional LEACH algorithms, the LEACH- after the application improvement
ECM algorithms cause that network route construction is more reasonable, the balanced energy ezpenditure of network, greatly enhance the performance of network
And life cycle.
Fig. 1 to Fig. 3 is refer to, multi-hop routing method, bag are divided the invention provides a kind of set based on dump energy
Include:
Step 1, multiple regions are divided into by wireless sensor network.Fig. 1 is refer to, it is in the embodiment shown in fig. 1, excellent
Selection of land, the wireless sensor network is square, described to be distinguished as eight.In this embodiment, by square mesh along right
Linea angulata, neutrality line are divided into eight regions, and mark sequence number 1-8.
Step 2, all nodes in the wireless sensor network are divided into multiple by closest principle has
The first set of same node point number.In one embodiment, there are 100 nodes in the network, so, can be by this 100
Node division is 20 has 5 first sets of node respectively.
Step 3, according to position distribution of the first set in the wireless sensor network, generation has multiple clusters
First second set.For example, with multiple cluster heads the can be selected according to this 20 set eight distributions in region in a network
Two set.Especially, the maximum node of energy is elected as final cluster head in second set.
Step 4, is that each described cluster head assigns a weights.Wherein, the bigger cluster head of weights is more qualified serves as relaying
Cluster head.
Step 5, is that each cluster head determination in the second set is preceding to cluster head.
Step 6, is that each cluster head in the second set determines next-hop cluster head.
Step 7, has the first distance between the corresponding cluster head of member in each described first set, the member with
There is second distance, according to the magnitude relationship between the described first distance and the second distance, it is determined that should between Sink node
Member is corresponding cluster head or is communicated with the Sink node.So, to member in cluster(Member in first set)
For, if the distance of member and cluster head is more than the distance with Sink in cluster, with Sink direct communications.If because member in cluster
Directly communicated with cluster head, then both increased the energy consumption of member in cluster, also increase the energy consumption of cluster head.
All the sensors node in network is divided into several by the present invention by closest principle has same node point
Several set, some candidate's cluster head set are selected according to set distribution in a network, and energy is selected in candidate's cluster head set
Maximum point is cluster head.Between cluster head and base station multi-hop communication path is established further according to weights size.The present invention program causes net
Network route construction is more reasonable, is effectively reduced the energy ezpenditure of network, and then extend Network morals.
Cluster head the invention enables election is optimal, and multihop routing is set up between cluster head and base station, between reduction node
Communication distance, the balanced energy ezpenditure of network greatly enhances the performance and life cycle of network.
Preferably, step 2 also includes:The same number of first with the first set is randomly choosed in all nodes
Both candidate nodes;The near node of multiple distance measurements is randomly choosed in the node in addition to first both candidate nodes to be waited as second
Node is selected, wherein, second both candidate nodes are relative's nodes of first both candidate nodes;First both candidate nodes and institute
State the composition both candidate nodes set of the second both candidate nodes.For example, by taking 100 networks of node as an example, can first in 100 nodes with
Machine selects 20 nodes for the first both candidate nodes, selects 4 closest node conducts successively in remaining 80 nodes
Relative's node of first both candidate nodes(That is the second both candidate nodes), so divide after set in node compare in position
It is close.
Preferably, step 3 presses at least one mode and determines candidate's cluster head:
(1)If there are the both candidate nodes for belonging to the both candidate nodes set, then by this in the region
Both candidate nodes add the second set as candidate's cluster head;
(2)If there are two both candidate nodes for belonging to the both candidate nodes set, then by this two in the region
One is randomly choosed in both candidate nodes and adds the second set as candidate's cluster head;
(3)If there are more than three both candidate nodes for belonging to the both candidate nodes set, then by this in the region
Two are randomly choosed in more than three both candidate nodes and adds the second set as candidate's cluster head;
(4)If not belonging to the both candidate nodes of the both candidate nodes set in the region, then skip over the region.
Preferably, the weights in step 4 are directly proportional to the node energy of the cluster head, and with the distance of Sink node into
Inverse ratio.
Preferably, the weights in step 4 are calculated according to following formula:
Wherein,
W is weights;
Ei is the present 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:If the distance between cluster head i and Sink node are Disink, cluster head j and Sink node it
Between distance be Djsink, the distance between cluster head i and cluster head j be Dij, if meeting following condition, cluster head j is cluster head i
Forward direction cluster head:
Dij 2+Disink 2> Djsink 2
Djsink 2+Disink 2> Dij 2。
Preferably, step 6 determines next-hop cluster head by following at least one modes:
(1)If cluster head described in has before more than two to cluster head, the two forward direction clusters nearest apart from the cluster head are found out
Head, and larger that of weights is selected as its interim next-hop cluster head;If the weights of the temporary parent are more than the power of the cluster head
Value, then using the interim next-hop cluster head as next-hop cluster head, otherwise using Sink node as next-hop cluster head;
(2)If cluster head described in has two forward direction cluster heads, the larger forward direction cluster head of selection weights is interim next
Jump cluster head;If weights of the weights of the interim next-hop cluster head more than the cluster head, using the interim next-hop cluster head as next
Cluster head is jumped, otherwise using Sink node as next-hop cluster head;
(3)If to cluster head before cluster head only one of which described in, comparing the weights of the cluster head and forward direction cluster head, if this it is preceding to
The weights of cluster head are larger, then by this it is preceding to cluster head be next-hop cluster head, otherwise using Sink node as next-hop cluster head;
(4)If forward direction cluster head is zero, using Sink node as next-hop cluster head.
The preferred embodiments of the present invention are the foregoing is only, is not intended to limit the invention, for the skill of this area
For art personnel, the present invention can have various modifications and variations.It is all within the spirit and principles in the present invention, made any repair
Change, equivalent, improvement etc., should be included within the scope of the present invention.