Background technology
The communication network that wireless sensor network is comprised of the node that has in a large number the functions such as data acquisition, data processing and wireless data transceiving.Due to the restriction of cost and volume, these nodes all adopt powered battery usually, therefore have limited data analysis and transmittability.In a lot of the application, need to be with the clock synchronous of each sensor node, in order to carry out the application in the fields such as Distributed localization, time division multiple access, distributed collaboration and distributed object tracking estimated such as the time of advent.Between node, clock synchronous can have several different methods, for example by GPS (global positioning system) or base station time service, but this method needs each sensor node assembling GPS or cellular communication module, not only can increase the cost of equipment, also can increase their power consumption.Another method is exactly to carry out distributed synchronization by switching clock information between node; but these class methods have all adopted complicated Routing Protocol to carry out the exchange of clock information traditionally; so usually can due to the problem of communication delay or network capacity, cause the problem that protocol overhead is large, convergence precision is low and convergence rate is slow.
Under above-mentioned background, being born can be applicable to the synchronous Gossip algorithm of wireless-sensor network distribution type.In this algorithm, each node is waken up randomly, then the node that wakes up randomly with its certain selected (or certain group) adjacent node switching clock information, these two subsequently (maybe this group) nodes utilize respectively protruding merging (Convex Combination) algorithm to merge these clock informations, and replace own original clock with new clock information.Claiming this moment this algorithm to complete once upgrades or an iteration.Can prove on mathematics, by this algorithm, all nodes in network can be realized clock synchronous (or be called realized common recognition), and finally the clock of each node equals the mean value of the initial clock of these nodes just.Therefore using the Gossip algorithm in wireless sensor network carries out the synchronous meaning of distributed clock and is: 1) avoid hot issue.Owing to having adopted random walk (Random Walk) pattern to carry out clock information transmission, therefore avoided forming the fixed topology such as tree-shaped or netted take Centroid as root, therefore can make grouping better evade the hot spot region.2) reduce protocol overhead and energy consumption.Owing to not needing to carry out Route establishment and maintenance, so the Gossip algorithm has effectively reduced protocol overhead, and then reduce node energy consumption.In addition, be grouped in each transmission and all carried out before merging compression, so number of packet greatly reduces, also can effectively reduce the energy consumption of node.3) communication reliability.Owing to not needing the end-to-end route by fixing to come transfer clock information, so the Gossip algorithm avoided route break problem of single point failure, improved the reliability of network.4) improve network scalability (Scalability).Carried out in transmittance process due to clock information merging compression, thereby in network, the increase node only can increase the convergence of algorithm time, can't significantly increase the traffic carrying capacity of network.Therefore this algorithm can utilize Internet resources better, thereby improves the autgmentability of network.5) reduce hsrdware requirements.Tradition is communication pattern end to end, and the node in network needs buffered packet until it is correctly sent.When more or traffic carrying capacity is increased sharply when the nodes in network, node needs more time processing channel race problem, have a large amount of groupings during this and need to carry out buffer memory, this is a huge challenge for the very limited wireless sensor node of storage capacity.And each node in the Gossip algorithm only need to be preserved its clock information and gets final product, in case receive new clock information, it can merge two clock information compressions at once, so it only can take the data transmit queue of finite length, and irrelevant with scale and the business model of network.Therefore, the Gossip algorithm can well adapt to architecture and the mode of operation of wireless sensor network, has good application prospect.
The Gossip algorithm was proposed by people such as Tsitsiklis first in 1984, and this algorithm only utilizes the local information of network node and the information of its neighbor node to carry out exchanges data, had solved the average common recognition problem under the distribution occasion.The Gossip algorithm can be widely used in source orientation problem, Parameter Estimation Problem, Kalman filtering etc., has been subject to especially in recent years the extensive concern of academia.The present invention relates to the distributed average common recognition algorithm in a kind of wireless sensor network, this algorithm can make nodes all in wireless sensor network reach average common recognition state, compare with traditional algorithm, this algorithm has convergence rate faster, and that be proved to be to restrain on mathematics and converge on average, simultaneously, this algorithm has good adaptability to the packet loss problem in actual application, topologies change problem.
Although a lot of achievements in research about wireless sensor network Gossip algorithm aspect have been arranged both at home and abroad, research in the past mainly lays particular emphasis on the research of paired Gossip algorithm (Pair-wise Gossip Algorithm) and geographical Gossip algorithm (Geographic Gossip Algorithm).This two classes algorithm although therefore can make nodal clock converge on the average of their initial clocks, but can only be used for two-way link owing to only having selected node to carry out exchanges data at every turn when upgrading, well do not utilize the broadcast characteristic of wireless channel.Several years up to date, the research for broadcasting Gossip algorithm (Broadcast Gossip Algorithm) just appearred in the world.In this class algorithm, when its clock information of a node broadcasts, all nodes that can receive this clock information all can upgrade their data.Owing to not needing the reverse data exchange, so this class algorithm is more suitable in asymmetrical wireless channel.Simultaneously, have more node to participate in because each clock upgrades, so this class convergence of algorithm speed is faster.In addition, because broadcasting Gossip algorithm no longer needs to select at random adjacent node, thereby make algorithm more simple and be easy to realize.Yet regrettably, at present in the world all broadcasting Gossip algorithm all be faced with two problems: perhaps they can not guarantee that the clock of each node converges on the mean value of their initial clocks (namely on average knowing together); Perhaps can converge to mean value, but can't be from its convergence of mathematics proof.For the former, the synchronised clock finally reached of each node can have larger deviation with the average of their initial clocks so, is unfavorable for carrying out network operation and data analysis.And the latter is due to can not be from its convergence of mathematics proof, so the reliability of algorithm can't be guaranteed, and this algorithm is also extremely slow from simulation analysis result convergence rate.
Summary of the invention
The present invention is faced with in order to solve present all broadcasting Gossip algorithms the mean value that the clock that can not guarantee each node converges on their initial clocks, cause the synchronised clock that each node is finally reached that larger deviation can be arranged with the average of their initial clocks, be unfavorable for carrying out network operation and data analysis problems, thereby a kind of distributed clock synchronous method based on broadcasting Gossip algorithm is provided.
Based on the distributed clock synchronous method of broadcasting Gossip algorithm, it comprises the steps:
Step 1: to including the wireless sensor network initialization of N node, and initialization in-degree information and scrambling parameter; Wherein N is positive integer,
Be the in-degree information of node i, ε is the scrambling parameter;
Step 2: set two variablees of node, x
i(t) be the present clock variable of node i, y
i(t) be the adjoint variable of node i, wherein x
i(0) be the initial clock value of node i, and y
i(0)=0, namely initial time is t=0; And the setting timer, the count value of described timer satisfies any random distribution;
Step 3: the state that judges each node: enter step 5 during for the triggering node k that regularly expires when node, when node is to enter step 6 when receiving the outer neighbors j of spot broadcasting; Otherwise continue to monitor;
Step 4: with two variate-values of regularly expired triggering node k, namely trigger the present clock variate-value x of node k
k(t) and adjoint variable value y
k(t), utilize spot broadcasting to be broadcast to respectively its outer neighbors j;
Step 5: clock variate-value and state variable value to the node in wireless sensor network upgrade, and will trigger the timer removing of node k;
Step 6: judge in wireless sensor network, whether two variablees of N node all converge on same synchronised clock value, and namely in wireless sensor network, the clock variable of N node is all identical, and the adjoint variable of N node is all identical; If yes then enter step 8, otherwise reset timer and return to step 4;
Step 7: obtain the clock synchronous result, complete iterative process.
Step 1 is described to the initialized process of the wireless sensor network that includes N node is:
The wireless sensor network that includes N node is set up directed simple graph G=(V, E), V={1 wherein, 2 ..., N} is node set, E is the limit set; When node i that and if only if can directly receive grouping from node j, claim limit (i, j) ∈ E to exist, claim that node i is the outer neighbour of node j this moment, and node j is the interior neighbour of node i, and
Order
With
The interior adjacent set of representation node i and outer adjacent set respectively,
With
Be respectively in-degree and the out-degree of node i, symbol | X|
cThe gesture of set X is got in representative.
Described step 5: in the process that clock variate-value and the state variable value of the node in wireless sensor network upgraded:
For triggering node k, state value, the adjoint variable value of this node sent to outer neighbors j, then the adjoint variable of triggering node k is set to 0;
In formula: x
k(t) expression triggers node k at t clock variable constantly, y
k(t) expression triggers node k at t adjoint variable constantly.
For outer neighbors j, upgrade according to the information of receiving:
In formula: x
j(t) the outer neighbors j of expression is at t adjoint variable constantly, y
j(t) represent outer neighbors j at t adjoint variable constantly,
In-degree for outer neighbors j.
The value of described scrambling parameter ε is Re (ξ
2)/2, wherein ξ
2The second little characteristic value for matrix L;
Described L is
Wherein θ is
Satisfy: if j=k and
So
Otherwise
The present invention is based on broadcasting Gossip algorithm and realize guaranteeing that the clock of each node converges on the mean value of their initial clocks, make synchronous that each node finally reaches there is no the relatively large deviation problem with the average of their initial clock all the time.The present invention proposes a kind of distributed clock simultaneous techniques with low convergence error based on broadcasting Gossip algorithm, and this algorithm can be from its convergence of mathematics proof.When given iterations, method of the present invention has minimum convergence error, when given convergence error, method of the present invention has the fastest convergence rate, and the distributed clock synchronous method that therefore the present invention is based on broadcasting Gossip algorithm has best performance in all broadcasting Gossip algorithms.
Embodiment
Embodiment one, in conjunction with Fig. 1, this embodiment is described.
Based on the distributed clock synchronous method of broadcasting Gossip algorithm, it comprises the steps:
Step 1: to including the wireless sensor network initialization of N node, and initialization in-degree information and scrambling parameter; Wherein N is positive integer,
Be the in-degree information of node i, ε is the scrambling parameter;
Step 2: set two variablees of node, x
i(t) be the present clock variable of node i, y
i(t) be the adjoint variable of node i, wherein x
i(0) be the initial clock value of node i, and y
i(0)=0, namely initial time is t=0; And the setting timer, the count value of described timer satisfies any random distribution;
Step 3: the state that judges each node: enter step 5 during for the triggering node k that regularly expires when node, when node is to enter step 6 when receiving the outer neighbors j of spot broadcasting; Otherwise continue to monitor;
Step 4: with two variate-values of regularly expired triggering node k, namely trigger the present clock variate-value x of node k
k(t) and adjoint variable value y
k(t), utilize spot broadcasting to be broadcast to respectively its outer neighbors j;
Step 5: clock variate-value and state variable value to the node in wireless sensor network upgrade, and will trigger the timer removing of node k;
Step 6: judge in wireless sensor network, whether two variablees of N node all converge on same synchronised clock value, and namely in wireless sensor network, the clock variable of N node is all identical, and the adjoint variable of N node is all identical; If yes then enter step 8, otherwise reset timer and return to step 4;
Step 7: obtain the clock synchronous result, complete iterative process.
Operation principle: the present invention utilizes broadcasting Gossip algorithm to obtain the clock synchronous of wireless sensor network, and in this algorithm, the clock value of each node is not only restrained, and converges on the average of their initial clocks.Can also prove on mathematics, if scrambling parameter ε value is Re (ξ
2)/2, the algorithm that proposes so has the fastest convergence rate.
The method of this patent has convergence rate or better convergence precision faster than every other broadcasting Gossip algorithm.When given iterations, this method convergence error in all broadcasting Gossip algorithms is minimum; When given convergence error, this method convergence rate is the fastest.When practical application, distributed clock is synchronously weighed performance index by these two parameters.The perhaps iterations of node in limiting network, the perhaps error of given convergence.Satisfy one of these two conditions, algorithm is just thought and has been restrained.
Concrete steps of the present invention are in detail:
Step 1: to including the wireless sensor network initialization of N node, and initialization in-degree information and scrambling parameter; Wherein N is positive integer,
Be the in-degree information of node i, ε is the scrambling parameter;
For the wireless sensor network that N node arranged, it can be modeled as an oriented free hand drawing G=(V, E), V={1 here, 2 ..., N} is node set, and E is the limit set.When node i that and if only if can directly receive grouping from node j, just claim limit (i, j) ∈ E to exist, claim that node i is the outer neighbour (Out-neighbor) of node j this moment, and node j is the interior neighbour (In-neighbor) of node i.In the present invention, with the existence that does not allow from ring, namely
Like this, even when a node sends grouping, it can receive the grouping that it sends by wireless channel itself, also will directly abandon.Definition
With
The interior adjacent set of representation node i and outer adjacent set respectively, and definition
With
In-degree (In-degree, graph theory term represent quantity adjacent in a node) and out-degree (Out-degree, graph theory term represent the outer adjacent quantity of a node), symbol here for node i | X|
cThe gesture (i.e. the quantity of element in the set) of set X is got in representative.
In-degree information is divided into dual mode according to the radio sensing network topological structure and obtains: it is as follows that the mode that (1) obtains voluntarily obtains the in-degree information process: each node is intercepted the grouping of its node transmission on every side, thereby can know the adjacent node information around its.Node just can obtain by the mode of intercepting the quantity of its adjacent node like this, thereby obtains in-degree information; (2) directly setting means obtains in-degree information.If network topology structure is fairly simple, when nodes is less, also can directly set the in-degree information of each node.If network is random distribution, so preferably just adopt the mode of obtaining voluntarily in-degree information.
Step 2: set two variablees of node, x
i(t) be the present clock variable of node i, y
i(t) be the adjoint variable of node i, wherein x
i(0) be the initial clock value of node i, and y
i(0)=0, namely initial time is t=0; And the setting timer, the count value of described timer satisfies any random distribution;
Each node i in network is all preserved two variablees, and one is its present clock variable x
i(t), another is adjoint variable y
i(t).X wherein
i(0) be the initial clock value of each node, and specify y
i(0)=0.
Step 3: the state that judges each node: enter step 5 during for the triggering node k that regularly expires when node, when node is to enter step 6 when receiving the outer neighbors j of spot broadcasting; Otherwise continue to monitor;
Step 4: with two variate-values of regularly expired triggering node k, namely trigger the present clock variate-value x of node k
k(t) and adjoint variable value y
k(t), utilize spot broadcasting to be broadcast to respectively its outer neighbors j;
Step 5: clock variate-value and state variable value to the node in wireless sensor network upgrade, and will trigger the timer removing of node k;
The detailed process of these its variablees of node updates is as follows:
For triggering node k, state value, the adjoint variable value of this node sent to outer neighbors j, then the adjoint variable of triggering node k is set to 0;
In formula: x
k(t) expression triggers node k at t clock variable constantly, y
k(t) expression triggers node k at t adjoint variable constantly.
For outer neighbors j, upgrade according to the information of receiving:
In formula: x
j(t) the outer neighbors j of expression is at t adjoint variable constantly, y
j(t) represent outer neighbors j at t adjoint variable constantly,
In-degree for outer neighbors j.
It is the clock renewal that other nodes l only carries out oneself.
In above-mentioned iterative algorithm, x (t+1) is mainly used to store the stored synchronised clock estimated value of node in each iterative process; Y (t+1) is used for storing the deviation between synchronisation of nodes clock estimated value and actual value in each iterative process; ε is the scrambling parameter, and by changing this parameter, algorithm will have different convergence rates, and the back can discuss its value in detail.Because above-mentioned algorithm is typical linear iterative algorithm, therefore can explain with the form of matrix, namely
Here matrix of a linear transformation W
k(t) lower footnote k represents that current clock upgrades and is initiated by node k.
Step 6: judge in wireless sensor network, whether two variablees of N node all converge on same synchronised clock value, and namely in wireless sensor network, the clock variable of N node is all identical, and the adjoint variable of N node is all identical; If yes then enter step 8, otherwise reset timer and return to step 4;
For broadcasting Gossip algorithm, when the renewal in any t moment, certain the node k that only has this time renewal to activate broadcasts its state value, and only has the outer neighbors of node k
Just can receive this state value and carry out state and upgrade.Therefore, only has node in network
And limit (j, k) ∈ E has participated in current state value renewal.Based on this reason, the node in figure G all can be kept still will all delete except the limit beyond (j, k) ∈ E, and construct a new figure G
kThen be this new figure G
kGenerate corresponding spot broadcasting weighting adjacency matrix
Spot broadcasting weighting indegree matrix
With spot broadcasting weighting Laplacian Matrix
For ease of describing, the below provides the specific definition of these three kinds of matrixes.
Spot broadcasting weighting adjacency matrix
Each element in this matrix
Satisfy: if j=k and
So
Otherwise
Spot broadcasting weighting indegree matrix
Each element in this matrix
Satisfy: if
So
Otherwise
Spot broadcasting weighting Laplacian Matrix
Here
Represent complete 1 vector and Diag (v) represents that a diagonal matrix and its diagonal element are the corresponding element of vector v.
These three kinds of weighting matrixs are respectively:
Utilize this three kinds of matrixes, can be with transformation matrix W
k(t) describe with following formula.
Here I is unit matrix, and e
kBe the base vector of standard, namely it is 1 except k element, and all the other elements are all 0.Can verify
Here
With
Be respectively complete 1 column vector and full 0 column vector.If therefore vector x (t) and y (t) converge on respectively
With
(c is a constant here), so whole iterative algorithm has just entered a fixed point, and after this state value of vector x (t) and y (t) will can not change, thereby enter convergence state.And this moment, all nodes were obtained common recognition, namely for two node i and j arbitrarily, and lim
T → ∞x
i(t)=lim
T → ∞x
j(t).It may be noted that if in network, all links are all bi-directional symmetrical so node is arbitrarily had
Can prove this moment, in this algorithm, the clock value of each node is not only restrained, and converges on the average of their initial clocks.
Step 7: obtain the clock synchronous result, complete iterative process.
Discuss from mathematical theory:
If scrambling parameter ε value is Re (ξ
2)/2, the algorithm that proposes so has the fastest convergence rate, here ξ
2The second little characteristic value for matrix L.Utilize matrix perturbation theory and Markov matrix theory, can obtain following two conclusions.
1. algorithms of conclusion can guarantee that each node can reach clock synchronous according to mathematic expectaion, namely
Here,
It is because each matrix W that this formula is set up
k(t) be independent identically distributed random matrix.Utilize character and the matrix perturbation theory of Markov matrix, can prove matrix
Eigenvalue of maximum be 1, and be one single; And the mould of its all the other characteristic values is so the long-pending convergence of the power of this matrix restrains result as shown in formula (3), wherein vectorial all less than 1
With
Be respectively matrix
Corresponding to left eigenvector and the right characteristic vector of
characteristic value 1, and satisfy normalizing condition
Be not difficult to find out from formula (3), the clock of all nodes is the value of converging on finally
The second moment convergence of
conclusion 2. algorithm of carrying, the i.e. limit
Exist, wherein
Two variate-values of each node when each clock upgrades and the difference of all node initializaing variable mean values have been represented.
Comprehensive conclusion 1 and conclusion 2 as can be known, the clock synchronization algorithm of carrying not only can be restrained according to probability, and convergence error bounded, so algorithm can prove its convergence on mathematics.
For the ease of relatively, existing existing two kinds of broadcasting Gossip algorithms in the world are called after BGA-1 and BGA-2 respectively, and they and the algorithm (called after BBGA) of the present invention's proposition are carried out Performance Ratio.Wherein BGA-1 can prove algorithmic statement, but algorithm can not converge on the broadcasting Gossip algorithm of initial clock average; And BGA-2 can not prove its constringent broadcasting Gossip algorithm by mathematical measure.In performance evaluation below, there are 100 or 500 nodes in network, and generate random geometry figure by them.Adopted two kinds of different scrambling parameter configuration in emulation, wherein BBGA-opt represents that scrambling parameter ε gets optimal value Re (ξ
2)/2; And BBGA-0.5 represents scrambling parameter ε value 0.5.The below comes respectively the performance of parser from convergence rate and convergence error two aspects.
1) convergence rate
In order to analyze convergence rate, at first define the evaluation criterion of convergence rate, i.e. variance
Be not difficult to find out the variance of the clock variable that when q (t) has measured each iteration, each node keeps from formula (4).When node is built consensus, q (t) will converge to 0.Therefore, q (t) converges on 0 speed speed and can be used for the convergence rate of measure algorithm.
2) convergence error
In order to analyze convergence error, can define departure function
If an algorithm can guarantee to converge on the average of the initial clock of all nodes, r (t) will converge on 0 so; Otherwise the size of r (t) convergency value has just determined the size of convergence error.Therefore departure function r (t) can be used for the convergence error of measure algorithm.
Fig. 2 and Fig. 4 be between algorithm at the simulation results of 100 nodes and 500 meshed networks convergence variances, this simulation result has shown convergence of algorithm speed simultaneously.Fig. 2 and Fig. 5 be between algorithm at the simulation results of 100 nodes and 500 meshed networks convergence deviations, this simulation result has shown the convergence of algorithm error simultaneously.Can find out from simulation result, the BGA-1 convergence rate is the fastest, but this is cost to the maximum with convergence error.The BGA-2 convergence rate is the slowest, but convergence precision is the highest.BBGA algorithm proposed by the invention, no matter scrambling parameter is got optimal value or 0.5, and their performance is all between BGA-1 and BGA-2.Obviously, the performance of BBGA-opt is better than BBGA-0.5, but the optimization of scrambling parameter need to be known topology of networks in advance, so only be suitable for small-scale application.
To sum up, synchronous for distributed clock, because the clock that does not need each node finally strictly converges on the average of their initial clocks, as long as this convergency value satisfies certain required precision.Be not difficult to find out from above simulation analysis, algorithm proposed by the invention is better than BGA-1 aspect convergence precision, being better than BGA-2 aspect convergence rate, is therefore the equilibrium between convergence rate and convergence precision, more meets the application requirements of distributed clock synchronized algorithm.Simultaneously, use because BBGA-0.5 has simple and easy to do and is applicable to large scale network, therefore have optimum engineering practice and be worth.