Two bunches of head wireless sensor network routing methods
Technical field
The present invention relates to a kind of wireless sensor network routing method, particularly relate to a kind of two bunch head energy-saving routing method for wireless sensor network based on particle group optimizing, belong to sensor network technology field.
Background technology
Wireless sensor network is an important research field in current computer, communication, control subject, and it provides advantage for people's obtaining information.Sensor node is little, low price, easily hidden with deployment, can large area be distributed in need monitoring region in, self-organizing can form network.But the energy content of battery of sensor node is limited, and in most cases can not charge or change node, node energy is once be finished, mean that node is dead, the network operation is affected, therefore, the wireless sensor network routing method designing a kind of low energy consumption is the key technology of current this area research.
Routing Protocol based on sub-clustering is the class Wireless Sensor Network Routing Protocol that current researcher compares concern.According to a bunch difference for head production method, roughly clustering route protocol can be divided three classes.The first kind is as LEACH, EEUC, and a bunch head is random generation, although the method can effectively avoid a certain node to become a bunch head continuously, delay node death, bunch head number that often wheel produces is not fixed, easily cause bunch scope excessive or too small, be difficult to equalizing network energy consumption.Equations of The Second Kind, as HEED, CHTD, is a kind of complete distributed Clustering Algorithm, dynamically produces more reasonable bunch of head by internodal information interaction, but information interactive process needs a large amount of broadcast, causes extra energy expense.3rd class is as LEACH-C, BCDCP, and each node is by the information reporting such as self geographical position and present energy to aggregation node, and aggregation node selects suitable bunch head and rationally sub-clustering according to global information, but these class methods need aggregation node to understand global information.
Swarm intelligence, as the emerging evolutionary computing of one, is introduced into and solves routing issue in wireless sensor network, comprising ant group algorithm, particle swarm optimization algorithm, genetic algorithm etc.Particle swarm optimization algorithm has algorithm simply because of it, and the characteristics such as search speed is fast, are applicable to the wireless sensor network of finite energy." PSO-basedEnergy-balancedDoubleCluster-headsClusteringRou tingforwirelesssensornetworks " that HuYu, WangXiaohui deliver on ProcediaEngineering discloses a kind of wireless sensor network routing method PSO-MV.The method utilizes particle swarm optimization algorithm to select two bunch head, major and minor bunch of head selects wherein optimum node and suboptimum node to be elected to according to particle swarm optimization algorithm (PSO), more effectively alleviate the problem of single bunch of head overload, but bunch head capacity usage ratio is still not high.Number of patent application is that the Chinese patent application of CN201210043196.3 discloses a kind of wireless sensor network Routing Optimization Algorithm based on energy ezpenditure, be characterized in that the number by selecting to optimize leader cluster node improves network quality with the optimum node of selection as a bunch head, but there is the problem of bunch head overload.
For bunch head overload of Clustering Routing in prior art, the problem of capacity usage ratio not high quickening network death, based on collection energy consumption and the energy consumption minimized criterion of transmission, design the two bunch head energy-saving routing method of a kind of new particle group optimizing wireless sensor network, effective alleviation bunch head overload, improve bunch head capacity usage ratio, be of great significance with the object tool reaching prolonging network survival time.
Summary of the invention
The object of the present invention is to provide a kind of two bunch head wireless sensor network routing method, effectively alleviate bunch head overload, improve bunch head capacity usage ratio, with prolonging network survival time.
Object of the present invention is achieved by the following technical programs:
A kind of two bunch head wireless sensor network routing method, the method comprises the following steps:
1) carry out netinit, in monitored area, random placement is N number of has identical primary power, ID numbering from the ordinary node of 0 ~ N, and aggregation node is deployed in certain of network surrounding;
2) interim sub-clustering is carried out: all ordinary node self-energy information and positional information are sent to aggregation node, aggregation node is according to the ordinary node information collected, calculate the average energy of all ordinary nodes, and be greater than Stochastic choice ordinary node the ordinary node of average energy from dump energy and become interim leader cluster node; The interim leader cluster node that all successes are elected to is with certain power broadcasts message, and whether each interim leader cluster node is observed in its communication radius exists other interim leader cluster nodes; If there are other interim leader cluster nodes to exist, then the interim leader cluster node selecting energy maximum continues as interim leader cluster node, and the interim leader cluster node that other energy are little is abandoned being elected to, and becomes ordinary node; Final elected interim leader cluster node broadcasts its elected message, and ordinary node receives the message of interim leader cluster node broadcast, according to the power of its acknowledge(ment) signal, selects the strongest interim leader cluster node of signal to add in its bunch; Elected interim leader cluster node to collect bunch in the position of ordinary node and energy information;
3) selection of optimum main leader cluster node is carried out: based on the energy consumption minimized criterion of collection, the adaptive value function f that optimum main leader cluster node is chosen is:
f=αf
1+βf
2+γf
3
f
3=(d
max-d)/d
max
Wherein, k be bunch in ordinary node number, E (i) is the energy of ordinary node i, and E (c) is the leader cluster node energy at node place bunch, f
1represent that leader cluster node energy accounts for a bunch ratio for interior nodes gross energy; d
itocthe distance of ordinary node i apart from the leader cluster node of affiliated bunch, f
2in representing bunch, ordinary node is to the inverse of leader cluster node average distance, f
2larger represent leader cluster node distance bunch in ordinary node average distance less; d
maxbe the ultimate range of ordinary node to regional center that position is in edge, d is the distance of ordinary node i to regional center, f
3larger to represent ordinary node i distance areas center nearer, is more beneficial to data acquisition and sends data to secondary leader cluster node; α, beta, gamma is weight coefficient, alpha+beta+γ=1;
4) choosing of secondary leader cluster node is carried out based on the energy consumption minimized criterion of transmission: the adaptive value function g that secondary leader cluster node is chosen is:
g=εg
1+(1-ε)g
2
Wherein, k be bunch in ordinary node number, E (i) is the energy of ordinary node i, and E (c) is the leader cluster node energy at node place bunch, g
1represent that leader cluster node energy accounts for a bunch ratio for interior nodes gross energy; d
ctoBSthe distance of leader cluster node to aggregation node, d
itoBSthe distance of ordinary node i to aggregation node, g
2represent that leader cluster node accounts for the ratio of bunch interior nodes to aggregation node distance summation, g to the distance of aggregation node
2the larger leader cluster node that represents is less apart from the distance of aggregation node; ε is weight coefficient, 0 ﹤ ε ﹤ 1;
5) data transfer phase adopt bunch between multi-hop mode, first each secondary leader cluster node calculates the distance of its distance aggregation node, then this secondary leader cluster node distance distance of aggregation node and size of TH value is compared, described TH value is a threshold value preset, its value is always less than the maximum broadcasting area of node, if the distance of secondary leader cluster node distance aggregation node is less than TH value, then data are directly transferred to aggregation node in single-hop mode by secondary leader cluster node; When the distance of secondary leader cluster node distance aggregation node is greater than TH value, data multi-hop mode between repeatedly transmission is bunch, as down hop target, is delivered to aggregation node by more other the secondary leader cluster nodes of this secondary cluster-head node selection dump energy.
Compared with prior art, the invention has the beneficial effects as follows: wireless sensor network massive wireless sensor being divided into several bunches, select the secondary leader cluster node of optimum main leader cluster node and its relative position optimum according to the particle swarm optimization algorithm gathering energy consumption and the energy consumption minimized criterion of transmission; Main leader cluster node collection, transfer data to secondary leader cluster node, between secondary leader cluster node by multi-hop transmission to aggregation node.The method effectively can alleviate a bunch problem for head overload, improves two bunches of heads capacity usage ratio separately, avoids a bunch head quick death, and balanced network energy consumption, extends whole network life cycle.
Accompanying drawing explanation
Fig. 1 is the structure principle chart of wireless sensor network of the present invention;
Fig. 2 is the flow chart in interim sub-clustering stage of the present invention;
Fig. 3 is the flow chart of the main bunch head selection course of optimum of the present invention;
Fig. 4 is the flow chart of optimum secondary bunch head selection course of the present invention;
Fig. 5 is the analogous diagram that network often takes turns surviving node number.
Embodiment
Below in conjunction with the drawings and specific embodiments, the invention will be further described.
Two bunch head wireless sensor network routing method of the present invention is applicable to the massive wireless sensor of sub-clustering, as shown in Figure 1, in monitored area 1 wireless sensor network comprise several independently bunches 2 and an aggregation node 4; There is following sensor node for described bunch 2: several ordinary nodes 3, main leader cluster node 5, secondary leader cluster node 6 and interim leader cluster node.The function of ordinary node 3 is data acquisitions, and sends data to main leader cluster node 5.Interim leader cluster node produces from ordinary node, and its function is the ordinary node information in gathering bunch, and according to collection energy consumption and the energy consumption minimized criterion of transmission from bunch in select major and minor leader cluster node all surviving node.The function of main leader cluster node 5 is data acquisition and fusion, and gives secondary leader cluster node 6 by data retransmission.The function of secondary leader cluster node 6 be by bunch between communication send data to aggregation node 4.
The present invention proposes a kind of novel based on gathering energy consumption bunch head energy-saving routing method two with the particle group optimizing wireless sensor network of the energy consumption minimized criterion of transmission, the criterion of institute's foundation effectively can select optimum main leader cluster node and secondary leader cluster node, improve leader cluster node capacity usage ratio, make whole network energy consumption more balanced, and avoid the quick death of a certain node, finally effectively can improve the life span of network, its embodiment is as follows:
One, the netinit stage
First in monitored area, random placement is N number of has identical primary power, ID numbering from the ordinary node of 0 ~ N.Aggregation node is deployed in certain of network surrounding, and each ordinary node can directly communicate with aggregation node, and aggregation node Infinite Energy is large, can deal with data.
Two, the interim sub-clustering stage, as shown in Figure 2:
1. all ordinary node self-energy information and positional information are sent to aggregation node, aggregation node is according to the ordinary node information collected, calculate the average energy of all ordinary nodes, and be greater than Stochastic choice node the node of average energy from dump energy and become interim leader cluster node.
2. the interim leader cluster node that all successes are elected is with certain power broadcasts message.Whether each interim leader cluster node is observed in its communication radius exists other interim leader cluster nodes.If there are other interim leader cluster nodes to exist, then the interim leader cluster node selecting energy maximum continues as interim leader cluster node, and the interim leader cluster node that other energy are little is abandoned being elected to, and becomes ordinary node.
3. final elected interim leader cluster node broadcasts its elected message, and ordinary node receives the message of interim leader cluster node broadcast, according to the power of its acknowledge(ment) signal, selects the strongest interim leader cluster node of signal to add in its bunch.
4. interim leader cluster node to collect bunch in the position of ordinary node and energy information.
Three, the optimal double bunch head choice phase
According to interim leader cluster node collect bunch in ordinary node information and gather energy consumption and the energy consumption minimized criterion of transmission, utilize particle swarm optimization algorithm to select the secondary leader cluster node of optimum main leader cluster node and optimum.Wherein gather energy consumption minimized criterion and be applied to choosing of main leader cluster node, this criterion draws according to the feature of main leader cluster node task.For main leader cluster node, its main task is the data of ordinary node in being responsible for collecting bunch, therefore, it not only should have higher energy, and the average distance of ordinary node is the smaller the better in this nodal distance bunch, simultaneously in order to prevent main leader cluster node marginalisation, because allowing it draw close toward regional center, the distance transmitted with secondary leader cluster node can be shortened like this.The adaptive value function f that main leader cluster node is chosen can be drawn according to this criterion.Transmit energy consumption minimized criterion and be applied to choosing of secondary leader cluster node, this criterion draws according to the feature of secondary leader cluster node task.For secondary leader cluster node, its main task sends data to aggregation node, so it not only will have higher energy, and the distance of distance aggregation node is the smaller the better.The adaptive value function g that secondary leader cluster node is chosen can be drawn according to this criterion.Wherein optimal double bunch head selection course is as follows:
The flow process of optimum main bunch head selection course as shown in Figure 3;
1. initialization population.The position x of each particle of random initializtion
xid(t), x
yid(t) and speed v
xid(t), v
yid(t).The position of particle is adjusted, upgrades, is mapped to network node location.Network node position of the present invention is (p
xi, p
yi), make the absolute value of particle position and the difference of network node on x component be Δ p
xi=| x
xid(t)-p
xi|, the absolute value of the difference on y component is Δ p
yi=| x
yid(t)-p
yi|, particle position and the network node absolute value sum of difference on x, y component is
particle position after renewal is the position that its position and the network node network node that the absolute value sum of difference is minimum on x, y component are corresponding, even if Δ p
k=min (Δ p
1, Δ p
2..., Δ p
n), wherein the position of nodes k be particle upgrade after position.
2. gather according to main leader cluster node the adaptive value function f that energy consumption minimized criterion selects to draw, calculate the adaptive value f of each particle
i, wherein the adaptive value function of main leader cluster node is
f=αf
1+βf
2+γf
3
f
3=(d
max-d)/d
max
3. make the individual extreme value p of particle
idequal particle current location, global extremum p
gdequal position corresponding to particle that in current all particles, adaptive value is maximum.
4. upgrade the speed v of each particle
xid(t), v
yid(t) and position x
xid(t), x
yid(t), and the position of particle is adjusted, upgraded, be mapped to network node location.
5. upgrade individual extreme value p
idwith global extremum p
gd.Individual extreme value is position corresponding to this particle self history maximum adaptation value, and global extremum is position corresponding to all particle history maximum adaptation values.
6. repeated execution of steps 4-5 is until reach maximum iteration time.
7., when reaching maximum iteration time, select global extremum p
gdposition as main leader cluster node position.
The flow process of optimum secondary bunch head selection course as shown in Figure 4; Transmit according to secondary leader cluster node the adaptive value function g that energy consumption minimized criterion selects to draw, repeat above-mentioned steps 1-8 and select global extremum p
gdposition as secondary leader cluster node position, wherein the adaptive value function of secondary leader cluster node is
g=εg
1+(1-ε)g
2
The main leader cluster node utilizing above-mentioned particle swarm optimization algorithm to select broadcast its elected message to bunch in ordinary node complete collection and the fusion of data, then send the data to secondary leader cluster node.
Four, data transfer phase
Multi-hop mode between data transfer phase of the present invention adopts bunch, first each secondary leader cluster node calculates the distance of its distance aggregation node, then the size of the Distance geometry TH of more secondary leader cluster node distance aggregation node, described TH is a threshold value preset, its value is always less than the maximum broadcasting area of node, and the value of TH can obtain according to Multi simulation running the optimal parameter being applicable to native system.If the distance of secondary leader cluster node distance aggregation node is less than TH, then secondary leader cluster node by direct for data single-hop transmission to aggregation node; When the distance of secondary leader cluster node distance aggregation node is greater than TH, other the secondary leader cluster nodes selecting dump energy more as down hop, by data through repeatedly transferring to aggregation node.
In order to verify this method for routing validity, use emulation tool matlab to emulate, select 100 nodes to be randomly dispersed in the region of 100 × 100m2, all node primary powers are 0.5J.This method and LEACH, PSO-MV algorithm are contrasted, network often takes turns surviving node number as shown in Figure 5, and simulation result shows the result that this method is better than LEACH, PSO-MV algorithm, achieves good result.
In addition to the implementation, the present invention can also have other execution modes, and all employings are equal to the technical scheme of replacement or equivalent transformation formation, all drop in the protection range of application claims.