Summary of the invention
The invention provides a kind of solution based on topology modulation, for the time synchronized service in wireless sensor network, the performance of all Time synchronization algorithms can be promoted, thus improve the precision of time synchronized.Described technical scheme is as follows:
Based on a method for the Time Synchronization for Wireless Sensor Networks of topology fine setting, described method comprises:
Adopt RBS mechanism, at described wireless sensor network middle distance be double bounce node between set up virtual link;
Build the virtual level optimized;
Utilize the virtual topology that described optimization virtual level provides, running time synchronized algorithm;
Wherein, the described virtual level optimized that builds comprises:
Utilizing by RBS mechanism is the virtual link set up between the node of double bounce at described wireless sensor network middle distance, builds virtual level;
Adopt the method shortening described virtual topology diameter, described virtual level optimized, obtains the model of described optimization virtual level, comprising:
According to Laplacian Matrix second minimal eigenvalue of wireless sensor network non-directed graph, determine the upper bound of the diameter of described virtual topology, obtain the relation of Laplacian Matrix second minimal eigenvalue of described wireless sensor network non-directed graph and the diameter of described virtual topology;
According to the relation of Laplacian Matrix second minimal eigenvalue of described wireless sensor network non-directed graph and the diameter of described virtual topology, diameter minimization problem is changed into the optimization problem of maximization second minimal eigenvalue;
By the process of maximum second minimal eigenvalue of Laplacian Matrix that solves described wireless sensor network non-directed graph, obtain the virtual level topology of minimum diameter.
Further, the restrictive condition of setting real network, is limited the model of described optimization virtual level.
Further, the restrictive condition of described real network comprises:
The number of degrees of described wireless sensor network interior joint are limited;
In described wireless sensor network, only extracting part partial node, adopt RBS mechanism, at the described node middle distance be extracted be double bounce node between set up virtual link, make the optimization virtual level limit number after being restricted be more than or equal to primitive network limit number, be less than or equal to the limit number of the virtual level after all nodes all utilize RBS mechanism to set up virtual link between the node of distance for double bounce;
Reduce the quantity setting up virtual link, to reduce energy loss, the limit number of the optimization virtual level after being restricted be less than or equal to:
2(1+φ)|E|;
Wherein, φ represents and builds the percentage that limit number that new virtual level newly adds virtual link accounts for original network topology limit number, and E represents the limit number of original network topology.
Further, described " relation of the second minimal eigenvalue of the Laplacian Matrix of wireless sensor network non-directed graph and the diameter of described virtual topology " is:
Wherein, diam (L) diameter that is described virtual topology;
Δ=Δ (G) is the maximum number of degrees of described wireless sensor network non-directed graph G;
λ
2(L) be the second minimal eigenvalue of the Laplacian Matrix of described wireless sensor network non-directed graph;
N is the exponent number of the Laplacian Matrix of described wireless sensor network non-directed graph.
Further, according to the relation of Laplacian Matrix second minimal eigenvalue of described wireless sensor network non-directed graph and the diameter of described virtual topology, described " diameter minimization problem being changed into the optimization problem of maximization second minimal eigenvalue " is expressed as:
When Laplacian Matrix second minimal eigenvalue of described wireless sensor network non-directed graph is maximum, the diameter of described virtual topology is minimum.
Further, formula is passed through:
s.t.P
TL(G)P≥γI
n-1
Solve the second minimal eigenvalue that the Laplacian Matrix of described wireless sensor network non-directed graph is maximum;
Wherein, G
lthe virtual topology that expression Optimized model is set up under the restrictive condition of described real network, the therefore Optimized model set up under being shown in the restrictive condition of described real network of described formula table.
L (G) is the Laplacian Matrix of described wireless sensor network non-directed graph;
Second minimal eigenvalue λ of the Laplacian Matrix of described wireless sensor network non-directed graph
2the upper bound of γ, for a fixing Laplacian Matrix L (G), max γ=λ
2;
I is unit matrix, and n is the exponent number of the Laplacian Matrix of described wireless sensor network non-directed graph.
Further, use a kind of heuritic approach to the equations of described Optimized model, to build virtual level.
Further, described " heuritic approach " comprising:
Calculate the Laplacian Matrix L (G) of original network topology;
Calculate the characteristic vector of the second minimal eigenvalue of described Laplacian Matrix L (G);
3 parameters are set arbitrarily, and assignment is preset initial value;
Be the node i of double bounce at described wireless sensor network middle distance, the virtual link set up between j;
Calculating at described wireless sensor network middle distance is the node i of double bounce, after setting up virtual link between j, and the characteristic vector of second minimal eigenvalue of the Laplacian Matrix L (G) of new virtual topology;
Choose node i, j, node i, j meets: in these two node i described, after setting up virtual link between j, and the characteristic vector of second minimal eigenvalue of new Laplacian Matrix L (G) is maximum;
Export described node i, the ID of j.
Further, described " using a kind of heuritic approach to the equations of described Optimized model, to build virtual level " comprising:
Two node i are obtained by described heuritic approach, j, and described node i, j meets: in these two node i described, after setting up virtual link between j, the characteristic vector of second minimal eigenvalue of the Laplacian Matrix L (G) of new virtual topology is maximum;
In described two node i, between j, set up a virtual link, form a new virtual level topology;
Again by described new virtual level topology by described heuritic approach, again find the node that two new, after making to set up virtual link between described two nodes, the characteristic vector of second minimal eigenvalue of the Laplacian Matrix L (G) of described new virtual topology is maximum;
Increase a virtual link again, form a new virtual level topology;
Method described in circulation performs, constantly increases new virtual link, builds new virtual level;
Set cycle-index as required;
The new virtual level obtained after circulation terminates is the equations to described Optimized model, builds the virtual level of gained;
On the virtual level built under described Optimized model running time synchronized algorithm.
Further, the Laplacian Matrix of the wireless sensor network non-directed graph of described optimization is symmetrical matrix.
This solution based on topology modulation provided by the invention, by setting up virtual level, and on virtual level running time synchronized algorithm, improve the performance of all Time synchronization algorithms, thus improve the precision of time synchronized.
Embodiment
Below in conjunction with drawings and Examples, the present invention is described in further detail.Be understandable that, specific embodiment described herein, only for explaining the present invention, but not limitation of the invention.
Embodiment
Wireless sensor network is modeled as the non-directed graph G=(V, E) of connection, the diameter of definition figure is D, (wherein, V represents all nodes in network, and E represents the communication link between any two nodes).Each node in network has hardware clock, and safeguards a logical timer.The frequency of hardware clock is unstable, is vulnerable to the impact of environmental factor, makes hardware clock there is clock drift, and drift has bound.In synchronizing process, between node, receive and dispatch synchronization message by wireless telecommunications, in information exchanging process, there is uncertain delay T, postponing also is bounded, in CC2420 radio-frequency (RF) transceiver, hardware clock drift can reach 40ppm per second, and message transmission delay can reach several milliseconds.The logical clock value exported to make different nodes is consistent as much as possible, and we adopt technical scheme below:
Fig. 3 is the method flow diagram of a kind of Time Synchronization for Wireless Sensor Networks based on topology fine setting that the embodiment of the present invention provides; As shown in the figure, the method comprises:
Step 101: adopt RBS (Reference Broadcast Synchronization reference-broadcast synchronization algorithm) mechanism, at described wireless sensor network middle distance be double bounce node between set up virtual link;
Wireless sensor network is modeled as original connected undirected graph G=(V by us, E), wherein, V represents all nodes in network, E represents the communication link between any two nodes, be between the node of double bounce by these wireless sensor network middle distances, utilize and set up RBS mechanism virtual link.Concrete:
RBS mechanism belongs to recipient-recipient's time synchronized pattern, make use of the broadcast channel characteristic of wireless data link layer, a node sends broadcast, and the group node receiving broadcast passes through the local moment of recording when receiving message more separately, realizes internodal time synchronized.
Fig. 4 is the RBS communication mechanism one that the embodiment of the present invention provides, Fig. 5 is the RBS communication mechanism two that the embodiment of the present invention provides, as shown in Figure 4, first node R and Section Point A and the 3rd Node B are neighbours, in the t1 moment, after first node R broadcasts a signal, because the packet receiving time is of short duration, can think that all neighbours of first node R receive this signal all simultaneously.As shown in Figure 5, wherein solid arrow represents that the message that Section Point A broadcasts, dotted arrow represent the message of the 3rd Node B broadcasts.Section Point A and the 3rd Node B record logical timer when receiving bag and hardware clock.Section Point A forms a report, report comprises first node the R signal of broadcasting and the time receiving signal that Section Point A listens to, then this report broadcast is gone out by Section Point A, until all nodes listening to the signal that first node R broadcasts all receive this report, then these nodes can utilize the report of other nodes received to estimate the clock of the other side.The error estimated is:
Wherein, ξ is clock drift, ξ ∈ (0,1), L (t) is logical timer, and l (t) is opposite logical clock frequency, l (t) ∈ (α, β), α, β > 0, if the 3rd Node B is at t
0moment receives the report that Section Point A broadcasts, Δ L=L
b(t)-L
b(t
0).
RBS mechanism can eliminate the time synchronization error that transmission delay, access time delay and propagation delay time cause effectively, improves the precision of time synchronized by removing these 3 main source of error.
Step 102: build the virtual level optimized;
Step 102 specifically comprises step 1021 ~ 1022:
Step 1021: utilizing by RBS mechanism is the virtual link set up between the node of double bounce at described wireless sensor network middle distance, builds virtual level;
Step 1022: adopt the method shortening described virtual topology diameter, described virtual level is optimized, obtains the model of described optimization virtual level, to improve the precision that Time synchronization algorithm runs on described virtual topology;
Step 1022 specifically comprises step 1022a ~ 1022c:
Dividing value due to timing tracking accuracy is Ω (DT/2), and wherein D represents the diameter of network, and T represents transmission delay, so the size influence time synchronization accuracy of network.By shortening the diameter of virtual topology, synchronized algorithm can be improved and operate in synchronization accuracy on virtual topology.
In addition, also to set the restrictive condition of real network, the model optimizing virtual level is limited.Because:
For RBS agreement, realize the time synchronized between two nodes, node needs reception broadcast, and then exchanging a time synchronized message, average needs 2 message send and 3 message sinks, and energy ezpenditure is larger, suppose that any two nodes in network can communicate, so the diameter of network can be reduced to 1, but due to the quantitative limitation of wireless sensing net node energy, diameter can not be reduced to so little.Therefore the restrictive condition of following real network will be added:
What 1. become in order to avoid some node number of degrees causes power consumption to increase very greatly, and occurs the situation of communication congestion, will be limited the number of degrees of wireless sensor network interior joint;
2. in wireless sensor network, only extracting part partial node, adopt RBS mechanism, at the node middle distance be extracted be double bounce node between set up virtual link, make the optimization virtual level limit number after being restricted be more than or equal to primitive network limit number, be less than or equal to the limit number of the virtual level after all nodes all utilize RBS mechanism to set up virtual link between the node of distance for double bounce;
3. reduce the quantity setting up virtual link, to reduce energy loss, the limit number of the optimization virtual level after being restricted be less than or equal to:
2(1+φ)|E|;
Wherein, φ represents and builds the percentage that limit number that new virtual level newly adds virtual link accounts for original network topology limit number, and E represents the limit number of original network topology.
Before original network topology is optimized, first understand fully the relation of wireless sensor network topology and matrix:
Wireless senser bottom-layer network can be abstracted into simple without being connected figure, G=(V, E), V represents all nodes in network, E represents the communication link between any two nodes, for each node V, represents the number of degrees of node with deg (v).N × n adjacency matrix of so scheming G can be expressed as:
With matrix D=diag (d
1..., d
n) represent the degree matrix of scheming G.The Laplacian Matrix of then scheming G is:
L(G)=D-A
Step 1022a: according to Laplacian Matrix second minimal eigenvalue of wireless sensor network non-directed graph, determine the upper bound of the diameter of described virtual topology, obtain the relation of the second minimal eigenvalue of the Laplacian Matrix of described wireless sensor network non-directed graph and the diameter of described virtual topology;
Laplacian Matrix is symmetrical positive semidefinite matrix, and its all characteristic value is all non-negative.Use λ
1(L)≤λ
2(L)≤...≤λ
n(L) represent all characteristic values of Laplacian Matrix L (G), its intermediate value be 0 characteristic value number be consistent with the number scheming G connected set, for a connected graph, when only having a connected set, λ
1(L)=0, and λ
2> 0.As from the foregoing, the second minimal eigenvalue λ
2(L) be the important parameter of effect diagram diameter.The Laplacian Matrix of wireless sensor network non-directed graph is symmetrical matrix.
Concrete, " relation of the second minimal eigenvalue of the Laplacian Matrix of wireless sensor network non-directed graph and the diameter of described virtual topology " is:
Wherein, diam (L) diameter that is virtual topology;
Δ=Δ (G) is the maximum number of degrees of wireless sensor network non-directed graph G;
λ
2(L) be Laplacian Matrix second minimal eigenvalue of wireless sensor network non-directed graph;
N is the exponent number of the Laplacian Matrix of described wireless sensor network non-directed graph.
Step 1022b: according to the relation of Laplacian Matrix second minimal eigenvalue of described wireless sensor network non-directed graph and the diameter of described virtual topology, diameter minimization problem is changed into the optimization problem of maximization second minimal eigenvalue;
Namely, when Laplacian Matrix second minimal eigenvalue of wireless sensor network non-directed graph is maximum, the diameter of virtual topology is minimum.
Pass through formula:
s.t.P
TL(G)P≥γI
n-1
Solve the second minimal eigenvalue that the Laplacian Matrix of wireless sensor network non-directed graph is maximum;
Wherein, G
lthe virtual topology that expression Optimized model is set up under the restrictive condition of described real network, the therefore Optimized model set up under being shown in the restrictive condition of described real network of described formula table.
L (G) is the Laplacian Matrix of described wireless sensor network non-directed graph;
Second minimal eigenvalue λ of the Laplacian Matrix of described wireless sensor network non-directed graph
2the upper bound of γ, for a fixing Laplacian Matrix L (G), max γ=λ
2;
I is unit matrix, and n is the exponent number of the Laplacian Matrix of described wireless sensor network non-directed graph.
Step 1022c: by the process of maximum second minimal eigenvalue of Laplacian Matrix that solves wireless sensor network non-directed graph, obtains the virtual level topology of minimum diameter;
First, we introduce vector x=[x
ij], if ij is the virtual link introduced, then x
ij=1, otherwise x
ij=0.Above-mentioned optimization problem can be rewritten into Integral nonlinear program-ming (Integer NonlinearProgramming, INLP) problem like this, be expressed as:
We know that INLP problem is nondeterministic polynomial difficulty (non-deterministic polynomial, NP – hard) problem.
Therefore, solving of formula above-mentioned is difficult, needs a heuritic approach fast, to the equations of Optimized model, to build virtual level.
Heuritic approach comprises:
Calculate the Laplacian Matrix L (G) of original network topology;
Calculate the characteristic vector of the second minimal eigenvalue of described Laplacian Matrix L (G);
3 parameters are set arbitrarily, and assignment is preset initial value;
Be the node i of double bounce at described wireless sensor network middle distance, the virtual link set up between j;
Calculating at described wireless sensor network middle distance is the node i of double bounce, after setting up virtual link between j, and the characteristic vector of second minimal eigenvalue of the Laplacian Matrix L (G) of new virtual topology;
Choose node i, j, node i, j meets: in these two node i described, after setting up virtual link between j, and the characteristic vector of second minimal eigenvalue of new Laplacian Matrix L (G) is maximum;
Export described node i, the ID of j.
The basic calculating thinking of heuritic approach is as follows: for the adjacency matrix A:=a of figure G
ij, the change produced when adding a limit in the drawings and a
ijand a
ji1 is become from 0.Corresponding Laplacian Matrix be changed to l
ii=l
ii+ 1, l
jj=l
jj+ 1, l
ij=l
ij-1, l
ji=l
ji-1.Laplacian Matrix after change can be expressed as L by us
g=L
g+ Q,
We can be expressed as Q=xx matrix Q
t, x
t=(0 ... 0, x
i=1,0 ..., 0, x
j=-1,0 ..., 0)
n × 1.We know λ
2(L (G))=v
2 tl (G) v
2, v
2represent λ
2characteristic vector.When a new interpolation limit, λ
2'=(v
2 t) ' (L+xx
t) v
2'.Here we suppose: for a network, and only adding a limit can not have a huge impact the structure of network, thus we can to λ
2' estimate, λ
2'=v
2 t(L+xx
t) v
2=λ
2+ xx
tv
2.
By the equations of above heuritic approach to Optimized model, can virtual level be built, specifically comprise:
Two node i are obtained by described heuritic approach, j, and described node i, j meets: in these two node i described, after setting up virtual link between j, the characteristic vector of second minimal eigenvalue of the Laplacian Matrix L (G) of new virtual topology is maximum;
In described two node i, between j, set up a virtual link, form a new virtual level topology;
Again by described new virtual level topology by described heuritic approach, again find the node that two new, after making to set up virtual link between described two nodes, the characteristic vector of second minimal eigenvalue of the Laplacian Matrix L (G) of described new virtual topology is maximum;
Increase a virtual link again, form a new virtual level topology;
Method described in circulation performs, constantly increases new virtual link, builds new virtual level;
Set cycle-index as required, this number of times experimentally tests and need to set;
The new virtual level obtained after circulation terminates is the equations to described Optimized model, builds the virtual level of gained;
Operating time synchronized algorithm on the virtual level built under Optimized model.
Step 103: utilize the virtual topology that virtual level provides, running time synchronized algorithm.
Utilize under the restrictive condition of real network, the virtual topology set up by virtual topology Optimized model, running time synchronized algorithm.
This solution based on topology modulation that the embodiment of the present invention provides, by setting up virtual level, and on virtual level running time synchronized algorithm, improve the performance of all Time synchronization algorithms, thus improve the precision of time synchronized.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be read-only memory, disk or CD etc.
Below be only illustrating of doing for the preferred embodiments of the present invention and know-why thereof; and the restriction not technology contents of the present invention carried out; anyly be familiar with those skilled in the art in technical scope disclosed in this invention; the change easily expected or replacement, all should be encompassed in protection scope of the present invention.