CN106455042B - A kind of time synchronization between nodes method, wireless sensor network and its node - Google Patents
A kind of time synchronization between nodes method, wireless sensor network and its node Download PDFInfo
- Publication number
- CN106455042B CN106455042B CN201611158015.6A CN201611158015A CN106455042B CN 106455042 B CN106455042 B CN 106455042B CN 201611158015 A CN201611158015 A CN 201611158015A CN 106455042 B CN106455042 B CN 106455042B
- Authority
- CN
- China
- Prior art keywords
- node
- time synchronization
- time
- child node
- child
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W56/00—Synchronisation arrangements
- H04W56/001—Synchronization between nodes
- H04W56/0015—Synchronization between nodes one node acting as a reference for the others
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W84/00—Network topologies
- H04W84/18—Self-organising networks, e.g. ad-hoc networks or sensor networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention discloses a kind of time synchronization between nodes method, wireless sensor network and its nodes.Wherein, which comprises receive multiple time synchronization data packets from father node, wherein length of a game t when time synchronization data packet includes father node sending time synchronization packets1;It obtains and corresponds to each length of a game t1Local zone time t locating for moment child node2, to obtain by local zone time t2With corresponding length of a game t1The multiple groups of composition map data;Multiple groups mapping data are fitted based on scheduled matching rule, to obtain with local zone time t2For independent variable, length of a game t1For the functional relation t of dependent variable1=f (t2).The time synchronization of multiple nodes in wireless sensor network can be accurately realized using the present invention as a result,.
Description
Technical field
The present invention relates to wireless sensor network fields, more particularly to a kind of inter-node times for wireless sensor network
Node in synchronous method, wireless sensor network and wireless sensor network.
Background technique
Wireless sensor network (Wireless Sensor Networks, WSN, can also abbreviation wireless sensor network) is one
Kind distributed sensor, its tip is the sensor that can perceive and check the external world.Sensor in WSN passes through nothing
Line mode communicates, therefore network settings are flexible, and device location can be changed at any time, can also carry out with internet wired or wireless
The connection of mode.
Time synchronization is a primary demand of wireless sense network application, most of to need to carry out wireless sensing net node association
With the application scenarios of data analysis, requiring wireless sensing net node has synchronous time reference, so that wireless sensing net node
The phase of acquisition data can be aligned.
Thus, it is desirable to a kind of time synchronization side that can synchronize the local zone time of the node in wireless sensor network
Case.
Summary of the invention
The main object of the present invention is to propose a kind of time synchronization between nodes method, wireless sensor network and its node,
It can accurately make the local zone time of wireless sensor network interior joint synchronous with the length of a game of clock source node.
According to an aspect of the invention, there is provided a kind of time synchronization between nodes method for wireless sensor network,
For keeping the local zone time of wireless sensor network interior joint synchronous with the length of a game of clock source node, wherein node towards when
The next-hop in clock source node direction is the father node of node, which is the child node of father node, is come from this method comprises: receiving
Multiple time synchronization data packets of father node, wherein when time synchronization data packet includes father node sending time synchronization packets
Length of a game t1;It obtains and corresponds to each length of a game t1Local zone time t locating for moment child node2, with obtain by it is local when
Between t2With corresponding length of a game t1The multiple groups of composition map data;Data are mapped to multiple groups based on scheduled matching rule
It is fitted, to obtain with local zone time t2For independent variable, length of a game t1For the functional relation t of dependent variable1=f (t2)。
In one embodiment of the invention, it obtains and corresponds to each length of a game t1Locating for child node described in moment
Local zone time t2The step of may include: that record receives sub- section when first bit in the time synchronization data packet
The locating local actual time t of point2', local zone timeWherein, r be the father node and the child node it
Between data transmission bauds.
In one embodiment of the invention, time synchronization data packet can be father node in the next of its own counter
A to count to child node transmission when occurring, length of a game can be the time of clock source node corresponding to next counting.
In one embodiment of the invention, multiple groups mapping data are fitted to obtain based on scheduled matching rule
With local zone time t2For independent variable length of a game t1For the functional relation t of dependent variable1=f (t2) the step of may include: to m group
It maps data and carries out linear fit, to obtain linear fit parameter a, b, t1=at2+ b, wherein m is the nature more than or equal to 2
Number.
In one embodiment of the invention, time synchronization between nodes method can also include: to m+1 group map data into
Row linear fit, to obtain linear fit parameter a ', b ';Judgement | whether a-a'| < ε is true, and wherein ε is preset normal
Number;In the case where determining to set up, determine that child node enters synchronous regime, and/or in the case where determining invalid, really
Stator node enters asynchronous state, and child node sends lock-out designation date packet to the secondary child node of the child node.
In one embodiment of the invention, 0 < ε < 1.
In one embodiment of the invention, before receiving multiple time synchronization data packets from father node, the party
Method can also include: to send multiple time synchronization requests to father node at predetermined intervals, wherein time synchronization data packet
It is that father node is sent in response to receiving time synchronization request.
In one embodiment of the invention, time synchronization between nodes method can also include: and work as to receive child node
When time synchronization is requested, judge whether father node is synchronous with the length of a game of clock source node;If it is determined that having synchronized, then father saves
Point is to child node sending time synchronization packets, and/or if it is determined that not synchronizing, then child node is every the predetermined time again to father
Node sending time synchronization request.
In one embodiment of the invention, if it is determined that it is synchronous, at the time of child node nth transmission time synchronization is requested and
Time interval between at the time of (n+1)th sending time synchronization request is 2n-1T0, wherein n is the nature more than or equal to 1
Number, T0For preset constant, and/or if it is determined that not synchronizing, child node is with time interval T0Sending time, which synchronizes, asks
It asks.
In one embodiment of the invention, father node can have at least two child nodes, and this method can also include:
Receive the time synchronization data packet that father node is sent to other child nodes;And/or it is sent in response to receiving father node
The time synchronization data packet of other nodes resets the time interval of sending time synchronization request.
According to another aspect of the present invention, additionally provide the node in a kind of wireless sensor network, wherein node towards
The next-hop of clock source node direction is the father node of node, which is the child node of father node, the counting of clock source node
Value is length of a game, which includes: receiving module, for receiving multiple time synchronization data packets from father node, wherein
Length of a game t when time synchronization data packet includes father node sending time synchronization packets1;Module is obtained, acquisition corresponds to
Each length of a game t1Local zone time t locating for moment child node2, to obtain by local zone time t2When with the corresponding overall situation
Between t1The multiple groups of composition map data;Fitting unit, for being fitted based on scheduled matching rule to multiple groups mapping data,
To obtain with local zone time t2For independent variable, length of a game t1For the functional relation t of dependent variable1=f (t2)。
In an embodiment of the invention, son when module record receives first bit in time synchronization data packet is obtained
Local actual time t locating for node2', local zone timeWherein, number of the r between father node and child node
According to Transmission bit rate.
In an embodiment of the invention, time synchronization data packet can be father node in the next of its own counter
It counts to child node transmission when occurring, length of a game can be the time of clock source node corresponding to next counting.
In an embodiment of the invention, fitting unit can map m group data progress linear fit, linear to obtain
Fitting parameter a, b, t1=at2+ b, wherein m is the natural number more than or equal to 2.
In an embodiment of the invention, fitting unit can be also used for mapping m+1 group data progress linear fit, with
Linear fit parameter a ', b ' are obtained, judgment module is also used to judge | whether a-a'| < ε is true, and wherein ε is preset normal
Number determines that the node enters synchronous regime, and/or in the case where determining invalid, really in the case where determining to set up
The fixed node enters asynchronous state, and sending module sends lock-out designation date packet to the child node of the node.
In an embodiment of the invention, 0 < ε < 1.
In an embodiment of the invention, node can also include: sending module, at predetermined intervals to father
Node sends multiple time synchronization requests, wherein time synchronization data packet is father node in response to receiving time synchronization request
And send.
In an embodiment of the invention, node can also include: judgment module, receive to come for the receiving module
From when the time synchronization request of the child node of the node, judge whether the node is synchronous with the length of a game of clock source node,
If having synchronized, sending module is to child node sending time synchronization packets, if and/or not synchronizing, the son of the node
Node is every the predetermined time again to the node sending time synchronization request.
In an embodiment of the invention, if judgment module judgement has synchronized, the child node nth transmission time of the node
Time interval between at the time of synchronization request and at the time of (n+1)th sending time synchronization request is 2n-1T0, n be greater than or
Natural number equal to 1, T0For preset constant, if and/or judgment module judgement do not synchronize, the child node of the node
With predetermined time interval T0Sending time synchronization request.
In an embodiment of the invention, father node can have at least two child nodes, and receiving module is also used to receive
Father node is sent to the time synchronization data packet of other child nodes, and/or receives father node hair in response to receiving module
The time synchronization data packet of other nodes is given, sending module resets the time interval of sending time synchronization request.
According to another aspect of the present invention, a kind of wireless sensor network, including multiple nodes are additionally provided, one of them
For clock source node, the count value of clock source node is length of a game, and the next-hop of node towards clock source node direction is section
The father node of point, node are the child node of father node, wherein child node receives multiple time synchronization data from father node
Packet, length of a game t when time synchronization data packet includes father node sending time synchronization packets1, the child node acquisition pair
It should be in each length of a game t1Local zone time t locating for child node described in moment2, to obtain by local zone time t2With with its
Corresponding length of a game t1The multiple groups of composition map data, and child node is based on scheduled matching rule and carries out to multiple groups mapping data
Fitting, to obtain with local zone time t2For independent variable, length of a game t1For the functional relation t of dependent variable1=f (t2)。
In an embodiment of the invention, child node record receives first bit Shi Zijie in time synchronization data packet
The locating local actual time t of point2', local zone timeWherein, data of the r between father node and child node
Transmission bit rate.
In an embodiment of the invention, time synchronization data packet is next counting of the father node in its own counter
It is sent when generation to child node, length of a game is the time of clock source node corresponding to next counting.
In an embodiment of the invention, child node carries out linear fit to m group mapping data, to obtain linear fit ginseng
Count a, b, t1=at2+ b, wherein m is the natural number more than or equal to 2.
In an embodiment of the invention, child node also carries out linear fit to m+1 group mapping data, to obtain Linear Quasi
Parameter a ', b ' are closed, judgement | whether a-a'| < ε is true, and wherein ε is preset constant, in the case where determining to set up, really
Stator node enters synchronous regime, and/or in the case where determining invalid, determines that child node enters asynchronous state,
And child node sends lock-out designation date packet to the secondary child node for belonging to the child node, refers in response to receiving lock-out
Show that data packet, secondary child node determine that it enters asynchronous state.
In an embodiment of the invention, 0 < ε < 1.
In an embodiment of the invention, child node sends multiple time synchronizations to father node at predetermined intervals and asks
It asks, wherein time synchronization data packet is that father node is sent in response to receiving time synchronization request.
In an embodiment of the invention, when the time synchronization for receiving child node is requested, whether father node judges it
Synchronous with the length of a game of clock source node, if it is determined that synchronized, then father node is to child node sending time synchronization packets,
And/or if it is determined that not synchronizing, then child node is every the predetermined time again to father node sending time synchronization request.
In an embodiment of the invention, if it is determined that having synchronized, child node nth transmission time synchronization request and (n+1)th
Time interval between secondary sending time synchronization request is 2n-1T0, wherein n is the natural number more than or equal to 1, T0To set in advance
Fixed constant, and/or if it is determined that not synchronizing, child node is with time interval T0Sending time synchronization request.
In an embodiment of the invention, father node has at least two child nodes, and child node is also used to receive father node
Be sent to other child nodes time synchronization data packet and/or child node in response to receive father node be sent to it is other
The time synchronization data packet of node resets the time interval of sending time synchronization request.
It to sum up, can using the present invention after setting clock source node for the wireless sensor network with multiple nodes
When the local zone time of the child node of clock source node (being a node jumped to the path of clock source node) being synchronized to first
The length of a game of clock source node.Then further according to the node of synchronized mistake, time synchronization between nodes of the invention are continued to use
Scheme is time-synchronized to length of a game for the child node of synchronized node.So that all in wireless sensor network
Node can be synchronized to length of a game.
Detailed description of the invention
Disclosure illustrative embodiments are described in more detail in conjunction with the accompanying drawings, the disclosure above-mentioned and its
Its purpose, feature and advantage will be apparent, wherein in disclosure illustrative embodiments, identical reference label
Typically represent same parts.
Fig. 1 is to show the schematic flow chart of time synchronization between nodes method according to an embodiment of the invention.
Fig. 2 is to show the structural block diagram of wireless sensor network according to an embodiment of the invention.
Fig. 3 is to show the functional block diagram of the node in wireless sensor network according to an embodiment of the invention.
Specific embodiment
The preferred embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Preferred embodiment, however, it is to be appreciated that may be realized in various forms the disclosure without the embodiment party that should be illustrated here
Formula is limited.On the contrary, these embodiments are provided so that this disclosure will be more thorough and complete, and can be by the disclosure
Range is completely communicated to those skilled in the art.
Before introducing the present invention, first to the invention mainly relates to several concepts and the precondition that is applicable in of the present invention
Do further brief description.
Wireless sensor network has multiple nodes, and each node can have a counter to record local zone time.?
It, can be by root after wireless sense network first uses certain Routing Protocol to establish the whole network other nodes to the routed path of root node
Node is set as clock source node (generally one), and the time that the counter of clock source node is recorded is length of a game.Its
In, clock source node can be consistent or almost the same with the counting period of the counter of other nodes, can also be inconsistent.
Local zone time: node local count device count value;
Length of a game: clock source node counter count value;
Father node: node is into the path of clock source node, if the next-hop of node A is node B, node B is section
The father node of point A;
Child node: node is into the path of clock source node, if the next-hop of node A is node B, node A is section
The child node of point B.
The present invention mainly proposes a kind of time synchronization between nodes scheme, utilizes time synchronization between nodes scheme of the invention
The local zone time of nodes one or more in wireless sensor network can be synchronized in length of a game.Its realization mechanism is, can
To use time synchronization between nodes scheme of the invention that the child node of clock source node is time-synchronized to clock source node
Length of a game, then further according to the node of synchronized mistake, continuing to use time synchronization between nodes scheme of the invention will
The child node of synchronous node is time-synchronized to length of a game, and so on, whole sections in wireless sense network may be implemented
The time of point is synchronized to length of a game.
In order to embody the universality of time synchronization between nodes scheme of the invention, below to arrive clock in wireless sensor network
Source node have a jump space child node and with the time synchronization between nodes scheme that for father node, the present invention will be described in detail.
Wherein, the father node addressed below, it can be understood as its local zone time has been synchronized to the length of a game of clock source node, or
The father node addressed below can also be interpreted as clock source node, correspondingly, the child node addressed below can be interpreted as
The child node jumped between clock source node with one.
Fig. 1 is to show the schematic flow chart of time synchronization between nodes method according to an embodiment of the invention.
Multiple time synchronization data packets from father node are received, wherein time synchronization number in step S110 referring to Fig. 1
Length of a game t when according to packet comprising father node sending time synchronization packets1。
Here, child node can send multiple time synchronization requests to father node at predetermined intervals.Wherein, make a reservation for
Time interval can be a fixed time interval, be also possible to the time interval changed according to certain rules.For example, son section
Time interval between at the time of point nth transmission time synchronization request and at the time of (n+1)th sending time synchronization request can
Think fixed time interval T0, it is also possible to the time interval 2 of a variationn-1T0, wherein n is the nature more than or equal to 1
Number, T0For a constant, size be may be set according to actual conditions, for example, can be by T0Be set as one it is relatively short when
Between such as 10s.Wherein, since routing may change, if the father node of child node changes, child node can be to
Its new father node sending time synchronization request.
In response to receiving time synchronization request every time, father node can send a time synchronization data to child node
Packet.Here, father node (can be next wink for counting jump when next counting of its own counter occurs
Between) sending time synchronization packets.Wherein, when father node is other nodes different from clock source node, father can be saved
Local zone time of the point in sending time synchronization packets is converted to length of a game t1It is recorded in time synchronization data packet;In father
Node be clock source node when, can directly using father node sending time synchronization packets when local zone time as length of a game
It is recorded in time synchronization data packet.
In this way, by counter jump moment sending time synchronization packets and record the length of a game at the moment can
Effectively avoid obtaining the quantization error that length of a game may introduce using counter values.
In step S120, obtains and correspond to length of a game t1Local zone time t locating for moment child node2, to obtain by local
Time t2With corresponding length of a game t1The multiple groups of composition map data.
Here acquired local zone time t2(i.e. t when being father node sending time synchronization packets1Moment) locating for child node
Time.Obtaining local zone time t2When, propagation time of the radio wave between child node and father node can be ignored.Specifically
Ground can recorde local actual time locating for child node when child node receives first bit in time synchronization data packet
t2' (i.e. the time that the counter of child node is recorded), then local zone timeWherein, r is father node and son
Data transmission bauds between node.
Due to the local zone time t of child node2It is to be indicated using counter counting, therefore child node is when receiving
Between first bit of synchronization packets true local zone time and counter there are a quantization error σ, when receiving
Time synchronization data packet number it is enough when, quantization error σ should be [0,1) between be uniformly distributed, therefore in order to arrange
Except this quantization error, correspond to length of a game t obtaining1Local zone time t2When, can plus 1/2 (unit be counter most
Subtotal figure unit), in this way when the time synchronization data packet received is enough, quantization error σ will converge to 0.It is excellent as a result,
Selection of land, local zone time
It can be obtained by using aforesaid way by local zone time t2With corresponding length of a game t1The multiple groups of composition map
Data.
In step S130, multiple groups mapping data are fitted based on scheduled matching rule, to obtain with local zone time
t2For independent variable, length of a game t1For the functional relation t of dependent variable1=f (t2)。
Obtaining functional relation t1=f (t2) after, child node can be calculated corresponding complete according to the own local time
Office's time.It is, for example, possible to use the mode of linear fit to multiple groups mapping data is fitted, with obtain linear fit parameter a,
B, then local zone time t2With length of a game t1Corresponding relationship be t1=at2+b.Hereafter linear fit parameter a, b is utilized, so that it may
Local zone time is converted into length of a game.
As a result, according to obtained functional relation can so that child node local zone time and clock source node the overall situation when
Between it is synchronous.
So far, the realization process of time synchronization between nodes scheme of the invention is schematically illustrated in conjunction with Fig. 1.As described above,
In order to embody universality, Fig. 1 is come for having the child node of a jump space and father node into the path of clock source node
Illustrate.
It in practical applications,, can be with after setting clock source node for the wireless sensor network with multiple nodes
It the use of time synchronization between nodes scheme of the invention (is first one to the path of clock source node by the child node of clock source node
The node of jump) local zone time be synchronized to the length of a game of clock source node.Then further according to the node of synchronized mistake, continue
The child node of synchronized node is time-synchronized to length of a game using time synchronization between nodes scheme of the invention.?
That is will be that a node jumped synchronizes to the path of clock source node using time synchronization between nodes scheme of the invention
Afterwards, time synchronization between nodes scheme of the invention can be continued with by the node foundation to the path of clock source node for double bounce
These paths are to synchronize a node deadline jumped.And so on, so that it may realize whole nodes in wireless sense network
Time is synchronized to length of a game.
In specific implementation, for some node (for ease of description, referred to herein as node A) in wireless sensor network,
Node A can be to his father's node sending time synchronization request, and node A also can receive the time synchronization from its child node
Request.When node A receives the time synchronization request of its child node as father node, it can first determine whether node A whether
It is synchronous with the length of a game of clock source node.
If having synchronized, node A can be to its child node sending time synchronization packets, so that child node can use
Its local zone time is synchronized to length of a game by time synchronization between nodes scheme of the invention.If not synchronizing, node A can be to it
Father node sending time synchronization request utilizes time synchronization between nodes scheme of the invention, node A if its father node has synchronized
The time synchronization data packet that can be sent according to its father node realizes the synchronization of node A.This way it is possible to realize wireless sensing
The synchronization of all nodes in network.
Wherein, when determining synchronous, the child node of node A sending time can be synchronized and be asked in such a way that index retracts
Ask, for example, at the time of the child node nth transmission time synchronization request of node A and (n+1)th sending time synchronization request when
Time interval between quarter is 2n-1T0, wherein n is the natural number more than or equal to 1, T0For preset constant, size
It may be set according to actual conditions, for example, can be by T0It is set as such as 10s of relatively short time.It is not same in judgement
When step, the child node of node A can be with T at regular intervals0Sending time synchronization request.
As an alternative embodiment of the present invention, when father node has multiple child nodes, the time of father node transmission
Synchronization packets can be multiplexed between its child node.Specifically, it is assumed that father node B has child node B1And B2, as father node B
Respond child node B1Time synchronization request, to child node B1When sending a time synchronization data packet, child node B2Listen to this
Time synchronization data packet, then child node B2Also it can use the calculating that the time synchronization data packet carries out time synchronization, if also,
Child node B2Last sending time synchronization request and the next time time interval of sending time synchronization request are T, then child node B2
After listening to time synchronization data packet, the time of sending time synchronization request next time can be reset, can be reset to here
Current time adds T.In this way, time synchronization request and time synchronization number can be substantially reduced by being multiplexed time synchronization data packet
According to the quantity forwarded of packet, communication efficiency is improved, reduces power consumption.Wherein, the last sending time synchronization request addressed here and
The time interval T of sending time synchronization request, which can be, next time is set according to the index rollback mode addressed above.
As another alternative embodiment of the invention, after obtaining functional relation using step S130, can also to
To functional relation test.
For example, the mode that linear fit can be used in step S130 is fitted multiple groups mapping data, it is linear to obtain
Fitting parameter a, b, then local zone time t2With length of a game t1Corresponding relationship be t1=at2+b。
It is assumed that step S130 is to carry out linear fit parameter a, b that linear fit obtains using m group mapping data, then can
To carry out linear fit using m+1 group mapping data (can also be that the more multiple groups such as m+2, m+3 map data) to obtain Linear Quasi
Close parameter a ', b '.Then judge | a-a'| < ε whether true (can also judge simultaneously here | whether b-b'| < ε ' is true),
Wherein ε is preset constant, such as 0 < ε < 1.Wherein, the specific value of ε may be set according to actual conditions, such as in essence
It spends in more demanding situation, ε can be set as a lesser numerical value (such as 0.01), in the less high situation of required precision
Under, ε can be set as a slightly larger numerical value (such as 0.1).In the case where determining to set up, it is believed that the function fitted
Relationship can reflect out local zone time t2With length of a game t1Corresponding relationship, can determine that child node comes into synchronization at this time
State.
And in the case where determining invalid, it is believed that when the functional relation fitted accurately cannot reflect local
Between t2With length of a game t1Corresponding relationship, can determine that child node enters asynchronous state at this time, in this way by node linear
The mistake that the verification of fitting parameter can effectively prevent the time drift of node local counter to introduce to time synchronization.
In addition in the case where determining invalid, the local established according to preceding m group time synchronization data packet can be disposed
Time t2With length of a game t1The m group of composition maps data, and time synchronization request time interval is reset.For example, with index
When rollback form sending time synchronization request (at the time of nth transmission time synchronization is requested with (n+1)th sending time synchronize ask
Time interval between at the time of asking is 2n-1T0), time synchronization request time interval can be reset into T0, can continue later
According to index rollback form sending time synchronization request.
Meanwhile child node can (such as can be to the son of the child node to one lock-out designation date packet of surrounding broadcast
Node sends lock-out designation date packet), when the child node (for the ease of distinguishing, being properly termed as secondary child node) of the node is received
It, can be not same from synchronous regime entrance if secondary child node has been in synchronous regime when to lock-out designation date packet
Step state, and obtained mapping data before are disposed, and time synchronization request weight can be retransmitted to its father node
New time started synchronizing process, and lock-out designation date packet can also be sent to its child node.In this way, for being detected
The node of timing error can correct the synchronous regime based on the synchronous other nodes of the node.
So far, time synchronization between nodes scheme of the invention is described in detail.Based on time synchronization between nodes of the invention
Scheme, the invention also provides a kind of wireless sensor networks.Fig. 2 is to show wireless sense network according to an embodiment of the invention
The structural block diagram of network.Wherein, the realization principle of the time synchronization between the node in wireless sensor network and detailed process are upper
Text combines Fig. 1 to elaborate, and only does brief introduction to wireless sensor network here, can be with for the details being directed to
Referring to related description above.
Referring to fig. 2, wireless sensor network 200 includes multiple nodes, and one of node is that clock source node (does not show in figure
Out).Wherein, the concept about clock source node, father node, child node, local zone time, length of a game may refer to say above
Bright, which is not described herein again.
Child node can send multiple time synchronization requests to father node at predetermined intervals.Such as it can be with index
The mode sending time synchronization request of rollback, specifically, first time sending time synchronization request is synchronous with second of sending time
The time interval of request is T0, then nth transmission time synchronization requests the time with (n+1)th sending time synchronization request later
Between be divided into 2n-1T0, wherein n is the natural number more than or equal to 1, T0For constant, size be may be set according to actual conditions, example
It such as, can be by T0It is set as relatively short a time such as 10s.
In response to receiving time synchronization request every time, father node can send a time synchronization data to child node
Packet.Here, father node (can be next wink for counting jump when next counting of its own counter occurs
Between) sending time synchronization packets.Wherein, when father node is other nodes different from clock source node, father can be saved
Local zone time of the point in sending time synchronization packets is converted to length of a game t1It is recorded in time synchronization data packet;In father
Node be clock source node when, can directly using father node sending time synchronization packets when local zone time as length of a game
It is recorded in time synchronization data packet.
Child node is available to correspond to each overall situation after receiving multiple time synchronization data packets from father node
Time t1The child node locating for local zone time t2, to obtain by local zone time t2With corresponding length of a game t1Structure
At multiple groups map data.
Wherein, child node can recorde when receiving first bit in the time synchronization data packet locating for child node
Local actual time t2', local zone timeWherein, data of the r between father node and child node transmit baud
Rate.Wherein, it may refer to related description above about the explanation of formula, which is not described herein again.
Child node can be fitted multiple groups mapping data based on scheduled matching rule, to obtain with local zone time t2
For independent variable, length of a game t1For the functional relation t of dependent variable1=f (t2)。
Here, child node carries out linear fit to m group mapping data, to obtain linear fit parameter a, b, t1=at2+ b,
Wherein, m is the natural number more than or equal to 2.
In addition, child node, which can also map data to m+1 group, carries out linear fit, to obtain linear fit parameter a ', b ',
And judge | whether a-a'| < ε is true, and wherein ε is preset constant, such as 0 < ε < 1.Wherein, the specific value of ε can be with
Be set according to actual conditions, such as in the higher situation of required precision, ε can be set as a lesser numerical value (such as
0.01), in the case where required precision is less high, ε can be set as a slightly larger numerical value (such as 0.1).
In the case where determining to set up, determine that the child node enters synchronous regime, and/or invalid in judgement
In the case of, determine that child node enters asynchronous state, and child node sends to the secondary child node for belonging to the child node and loses together
Designation date packet is walked, in response to receiving lock-out designation date packet, secondary child node determines that it enters asynchronous state.
As an alternative embodiment of the present invention, when the time synchronization for receiving child node is requested, father node may be used also
To judge whether it is synchronous with the length of a game of clock source node, if having synchronized, the father node is sent out to the child node
The time synchronization data packet is sent, if not synchronizing, child node can be synchronous to father node sending time again every the predetermined time
Request.
Wherein, if it is determined that having synchronized, child node sending time synchronization request, i.e. son can save in such a way that index retracts
Time interval between the request of point nth transmission time synchronization and (n+1)th sending time synchronization request is 2n-1T0, wherein n
For the natural number more than or equal to 1, T0For preset constant.If it is determined that do not synchronize, child node can according to it is fixed when
Between be spaced T0Sending time synchronization request.
As another alternative embodiment of the invention, when father node has at least two child nodes, child node is also used
The time synchronization data packet of other child nodes is sent in reception father node.Child node receives father node and is sent to other sections
After the time synchronization data packet of point, the time interval of sending time synchronization request can be reset.Father is multiplexed herein in relation to child node
Node is sent to the details of the time synchronization data packet of other child nodes, may refer to associated description above.
According to above it will be appreciated that, the node in wireless sensor network 200 of the invention can be used as child node, to its father node
Sending time synchronization request, can also be used as father node, to its child node sending time synchronization packets.Below with regard to wireless sensing
The functional module that node in network 200 can have is illustrated.
Fig. 3 is the functional module that shows the node in wireless sensor network according to an embodiment of the invention and can have
Schematic block diagram.It should be understood that functional module possessed by node shown in Fig. 3 is for realizing between node of the invention
Time Synchronizing, although it is not shown in the figure, node of the invention can also have as well known to those skilled in the art
Other hardware configurations, which is not described herein again.
Referring to Fig. 3, node 300 may include receiving module 310, obtain module 320 and fitting module 330.
Receiving module 310 can receive multiple time synchronization data packets from father node, wherein time synchronization data packet
Length of a game t when comprising father node sending time synchronization packets1。
It is available corresponding to each length of a game t to obtain module 3201Child node (i.e. node 300) locating for local
Time t2, to obtain by local zone time t2With corresponding length of a game t1The multiple groups of composition map data.
Here, when obtaining module 320 can recorde receiving module 310 and receives first bit in time synchronization data packet
Local actual time t locating for child node2', local zone timeWherein, r is between father node and child node
Data transmission bauds.
Fitting module 330 can be fitted multiple groups mapping data based on scheduled matching rule, to obtain with local
Time t2For independent variable, length of a game t1For the functional relation t of dependent variable1=f (t2)。
For example, fitting module 330, which can map data to multiple groups (such as m group), carries out linear fit, to obtain Linear Quasi
Close parameter a, b, t1=at2+b.After obtaining linear fit parameter a, b, child node can also reflect more multiple groups (such as m+1 group)
It penetrates data and carries out linear fit, to obtain linear fit parameter a ', b ', judgement | whether a-a'| < ε is true, and wherein ε is preparatory
The constant of setting, such as 0 < ε < 1.Wherein, the specific value of ε may be set according to actual conditions, such as higher in required precision
In the case of, ε can be set as a lesser numerical value (such as 0.01), and in the case where required precision is less high, ε can be set
For a slightly larger numerical value (such as 0.1).
In the case where determining to set up, it can determine that node 300 enters synchronous regime, in the case where determining invalid,
It can determine that node 300 enters asynchronous state, node 300 can send lock-out instruction to the child node of node 300 at this time
Data packet, the child node of node 300 can determine that it also enters asynchronous shape in response to receiving lock-out designation date packet
State.
Referring to Fig. 3, node 300 can also include sending module 350.Sending module 350 can be at predetermined intervals
Multiple time synchronization requests are sent to father node, wherein time synchronization data packet is father node in response to receiving time synchronization
Request and send.
Such as can by index retract in a manner of sending time synchronization request, specifically, first time sending time, which synchronizes, asks
The time interval for second of sending time synchronization request of summing is T0, then nth transmission time synchronization is requested and (n+1)th time later
The time interval of sending time synchronization request is 2n-1T0, wherein n is the natural number more than or equal to 1, T0For constant, size
It may be set according to actual conditions.
Referring to Fig. 3, node 300 can also include judgment module 340.When the time synchronization for receiving child node is requested,
Judgment module 340 may determine that whether the node is synchronous with the length of a game of clock source node, if it is determined that synchronous, sending module
350 can be to the child node sending time synchronization packets of node 300, if it is determined that not synchronizing, sending module 350 can be every predetermined
Father node sending time synchronization request of the time to node 300.
Wherein, the child node of node 300 can also be to its father node (i.e. node 300) sending time synchronization packets, this
In, when 340 predicate node 300 of judgment module is synchronous, the child node of node 300 can be in such a way that index retracts to node
300 send multiple time synchronization requests.I.e. node 300 child node nth transmission time synchronization request at the time of and (n+1)th time
Time interval between at the time of sending time synchronization request can be 2n-1T0, n is the natural number more than or equal to 1, T0It is pre-
The constant first set.When 340 predicate node 300 of judgment module is not synchronous, the child node of node 300 can be with regular time
It is spaced T0To 300 sending time synchronization request of node.
Time synchronization between nodes method according to the present invention, wireless sense network above is described in detail by reference to attached drawing
Network and its node.
According to the present invention, the following terms technical solution is disclosed:
1. a kind of time synchronization between nodes method for wireless sensor network, for making wireless sensor network interior joint
Local zone time is synchronous with the length of a game of clock source node, wherein the next-hop of node towards clock source node direction is described
The father node of node, the node are the child node of the father node, this method comprises:
Receive multiple time synchronization data packets from the father node, wherein the time synchronization data packet includes institute
State length of a game t when father node sends the time synchronization data packet1;
It obtains and corresponds to each length of a game t1Local zone time t locating for child node described in moment2, to obtain by this
Ground time t2With corresponding length of a game t1The multiple groups of composition map data;
Multiple groups mapping data are fitted based on scheduled matching rule, to obtain with local zone time t2To become certainly
Amount, length of a game t1For the functional relation t of dependent variable1=f (t2)。
2. time synchronization between nodes method described in above-mentioned 1st technical solution according to the present invention, wherein the acquisition pair
It should be in each length of a game t1Local zone time t locating for child node described in moment2The step of include:
When record receives that local locating for the child node is true when first bit in the time synchronization data packet
Between t2', local zone timeWherein, data transmission bauds of the r between the father node and the child node.
3. time synchronization between nodes method described in above-mentioned 1st technical solution according to the present invention, wherein the time is same
Step data packet is that the father node is sent when next counting of its own counter occurs to the child node, described complete
Office's time is the time of clock source node corresponding to next counting.
4. time synchronization between nodes method described in above-mentioned 1st technical solution according to the present invention, wherein described based on pre-
Fixed matching rule is fitted to obtain with local zone time t multiple groups mapping data2For independent variable length of a game t1For because
The functional relation t of variable1=f (t2) the step of include:
Linear fit is carried out to m group mapping data, to obtain linear fit parameter a, b, t1=at2+ b, wherein m be greater than
Or the natural number equal to 2.
5. time synchronization between nodes method described in above-mentioned 4th technical solution according to the present invention, further includes:
Linear fit is carried out to m+1 group mapping data, to obtain linear fit parameter a ', b ';
Judgement | whether a-a'| < ε is true, and wherein ε is preset constant;
In the case where determining to set up, determine that the child node enters synchronous regime, and/or
In the case where determining invalid, determine that the child node enters asynchronous state, the child node is to the sub- section
The secondary child node of point sends lock-out designation date packet.
6. time synchronization between nodes method described in above-mentioned 5th technical solution according to the present invention, wherein 0 < ε < 1.
7. time synchronization between nodes method described in above-mentioned 1st technical solution according to the present invention, wherein in the reception
Before the step of multiple time synchronization data packets from the father node, this method further include:
Multiple time synchronization requests are sent to the father node at predetermined intervals, wherein the time synchronization number
It is the father node according to packet to request and send in response to receiving the time synchronization.
8. time synchronization between nodes method described in above-mentioned 7th technical solution according to the present invention, further includes:
When receive the child node time synchronization request when, judge the father node whether with the clock source section
The length of a game of point is synchronous;
If it is determined that synchronous, then the father node sends the time synchronization data packet to the child node, and/or
If it is determined that not synchronizing, then the child node is every the predetermined time again to the father node sending time synchronization request.
9. time synchronization between nodes method described in above-mentioned 8th technical solution according to the present invention, wherein
If it is determined that synchronous, the child node nth transmission time synchronization is synchronous with (n+1)th sending time at the time of request
Time interval between at the time of request is 2n-1T0, wherein n is the natural number more than or equal to 1, T0It is preset normal
Amount, and/or
If it is determined that not synchronizing, the child node is with time interval T0Sending time synchronization request.
10. time synchronization between nodes method described in above-mentioned 7th technical solution according to the present invention, wherein father's section
Point has at least two child nodes, this method further include:
Receive the time synchronization data packet that the father node is sent to other child nodes;And/or
The time synchronization data packet for being sent to other nodes in response to receiving the father node, resetting send the time
The time interval of synchronization request.
11. the node in a kind of wireless sensor network, wherein the next-hop of node towards clock source node direction is described
The father node of node, the node are the child node of the father node, and the count value of the clock source node is length of a game, the section
It puts and includes:
Receiving module, for receiving multiple time synchronization data packets from father node, wherein the time synchronization data
Packet sends the length of a game t when time synchronization data packet comprising the father node1;
Module is obtained, obtains and corresponds to each length of a game t1Local zone time t locating for child node described in moment2, with
It obtains by local zone time t2With corresponding length of a game t1The multiple groups of composition map data;
Fitting module, for being fitted based on scheduled matching rule to multiple groups mapping data, to obtain with this
Ground time t2For independent variable, length of a game t1For the functional relation t of dependent variable1=f (t2)。
12. node described in above-mentioned 11st technical solution according to the present invention, wherein connect described in the acquisition module record
It receives module and receives local actual time t locating for child node when first bit in the time synchronization data packet2',
Local zone timeWherein, data transmission bauds of the r between the father node and the child node.
13. node described in above-mentioned 11st technical solution according to the present invention, wherein the time synchronization data packet is institute
State what father node was sent when next counting of its own counter occurs to the child node, the length of a game is next
The time of clock source node corresponding to a counting.
14. node described in above-mentioned 11st technical solution according to the present invention, wherein the fitting module maps m group
Data carry out linear fit, to obtain linear fit parameter a, b, t1=at2+ b, wherein m is the natural number more than or equal to 2.
15. node described in above-mentioned 14th technical solution according to the present invention, wherein the fitting unit is also used to m+
1 group of mapping data carries out linear fit, to obtain linear fit parameter a ', b ',
The judgment module is also used to judge | whether a-a'| < ε is true, and wherein ε is preset constant,
In the case where determining to set up, determine that the node enters synchronous regime, and/or
In the case where determining invalid, determine that the node enters asynchronous state, and the sending module is to the section
The child node of point sends lock-out designation date packet.
16. node described in above-mentioned 17th technical solution according to the present invention, wherein 0 < ε < 1.
17. node described in above-mentioned 11st technical solution according to the present invention, further includes:
Sending module, for sending multiple time synchronization requests to the father node at predetermined intervals, wherein institute
Stating time synchronization data packet is that the father node is sent in response to receiving the time synchronization request.
18. node described in above-mentioned 17th technical solution according to the present invention, further includes:
Judgment module, when the receiving module receives the time synchronization request of the child node from the node, institute
It states judgment module and judges whether the node is synchronous with the length of a game of clock source node,
If the judgment module judgement has synchronized, the sending module is synchronous to the child node sending time of the node
Data packet, and/or
If the judgment module judgement does not synchronize, the child node of the node is sent out to the node again every the predetermined time
Time synchronization is sent to request.
19. node described in above-mentioned 18th technical solution according to the present invention, wherein
If the judgment module judgement has synchronized, at the time of the child node nth transmission time synchronization of the node is requested
And at the time of (n+1)th sending time synchronization request between time interval be 2n-1T0, n is the natural number more than or equal to 1, T0
For preset constant, and/or
If the judgment module judgement does not synchronize, the child node of the node is with predetermined time interval T0Sending time is synchronous
Request.
20. node described in above-mentioned 17 technical solutions according to the present invention, wherein the father node has at least two sons
Node,
The receiving module is also used to receive the time synchronization data packet that the father node is sent to other child nodes, and
And/or person
The time synchronization data packet that the father node is sent to other nodes is received in response to the receiving module, it is described
Sending module resetting sends the time interval of the time synchronization request.
21. a kind of wireless sensor network, including multiple nodes, one of them is clock source node, the clock source node
Count value be length of a game, the next-hop of node towards clock source node direction is the father node of the node, which is
The child node of the father node, wherein
The child node receives multiple time synchronization data packets from the father node, the time synchronization data packet packet
The length of a game t when time synchronization data packet is sent containing the father node1,
The child node, which obtains, corresponds to each length of a game t1Local zone time t locating for child node described in moment2,
To obtain by local zone time t2With corresponding length of a game t1The multiple groups of composition map data,
The child node be based on scheduled matching rule to the multiple groups mapping data be fitted, with obtain with it is local when
Between t2For independent variable, length of a game t1For the functional relation t of dependent variable1=f (t2)。
22. wireless sensor network described in above-mentioned 21st technical solution according to the present invention, wherein
The child node record receives when first bit in the time synchronization data packet locating for the child node
Local actual time t2 ', local zone timeWherein, data of the r between the father node and the child node
Transmission bit rate.
23. wireless sensor network described in above-mentioned 21st technical solution according to the present invention, wherein
The time synchronization data packet is father node Xiang Suoshu when next counting of its own counter occurs
What child node was sent, the length of a game is the time of clock source node corresponding to next counting.
24. wireless sensor network described in above-mentioned 21st technical solution according to the present invention, wherein the child node is to m
Group mapping data carry out linear fit, to obtain linear fit parameter a, b, t1=at2+ b, wherein m is oneself more than or equal to 2
So number.
25. wireless sensor network described in above-mentioned 24th technical solution according to the present invention, wherein the child node is also right
M+1 group maps data and carries out linear fit, to obtain linear fit parameter a ', b ', judgement | and whether a-a'| < ε is true, wherein ε
For preset constant,
In the case where determining to set up, determine that the child node enters synchronous regime, and/or
In the case where determining invalid, determine that the child node enters asynchronous state, and the child node is to category
Lock-out designation date packet is sent in the secondary child node of the child node, in response to receiving the lock-out designation date packet,
The secondary child node determines that it enters asynchronous state.
26. wireless sensor network described in above-mentioned 25th technical solution according to the present invention, wherein 0 < ε < 1.
27. wireless sensor network described in above-mentioned 21st technical solution according to the present invention, wherein
The child node sends multiple time synchronization requests to the father node at predetermined intervals, wherein described
Time synchronization data packet is that the father node is sent in response to receiving the time synchronization request.
28. wireless sensor network described in above-mentioned 27th technical solution according to the present invention, wherein
When receive the child node time synchronization request when, the father node judge its whether with clock source node
Length of a game it is synchronous,
If it is determined that having synchronized, then the father node sends the time synchronization data packet to the child node, and/or
If it is determined that not synchronizing, then the child node is every the predetermined time again to the father node sending time synchronization request.
29. wireless sensor network described in above-mentioned 28th technical solution according to the present invention, wherein
If it is determined that having synchronized, the child node nth transmission time synchronization request and (n+1)th sending time synchronization request
Between time interval be 2n-1T0, wherein n is the natural number more than or equal to 1, T0For preset constant, and/or
If it is determined that not synchronizing, the child node is with time interval T0Sending time synchronization request.
30. wireless sensor network described in above-mentioned 27th technical solution according to the present invention, wherein the father node has
At least two child nodes,
The child node is also used to receive the time synchronization data packet that the father node is sent to other child nodes, and/
Or
The time synchronization data packet that the child node is sent to other nodes in response to receiving the father node, resetting hair
Send the time interval of the time synchronization request.
In addition, being also implemented as a kind of computer program according to the method for the present invention, which includes being used for
Execute the computer program code instruction of the above steps limited in the above method of the invention.Alternatively, according to the present invention
Method is also implemented as a kind of computer program product, which includes computer-readable medium, in the meter
The computer program for executing the above-mentioned function of limiting in the above method of the invention is stored on calculation machine readable medium.Ability
Field technique personnel will also understand is that, various illustrative logical blocks, module, circuit and algorithm in conjunction with described in disclosure herein
Step may be implemented as the combination of electronic hardware, computer software or both.
The flow chart and block diagram in the drawings show the possibility of the system and method for multiple embodiments according to the present invention realities
Existing architecture, function and operation.In this regard, each box in flowchart or block diagram can represent module, a journey
A part of sequence section or code, a part of the module, section or code include one or more for realizing defined
The executable instruction of logic function.It should also be noted that in some implementations as replacements, the function of being marked in box can also
To be occurred with being different from the sequence marked in attached drawing.For example, two continuous boxes can actually be basically executed in parallel,
They can also be executed in the opposite order sometimes, and this depends on the function involved.It is also noted that block diagram and/or stream
The combination of each box in journey figure and the box in block diagram and or flow chart, can the functions or operations as defined in executing
Dedicated hardware based system realize, or can realize using a combination of dedicated hardware and computer instructions.
Various embodiments of the present invention are described above, above description is exemplary, and non-exclusive, and
It is not limited to disclosed each embodiment.Without departing from the scope and spirit of illustrated each embodiment, for this skill
Many modifications and changes are obvious for the those of ordinary skill in art field.The selection of term used herein, purport
In the principle, practical application or improvement to the technology in market for best explaining each embodiment, or make the art
Other those of ordinary skill can understand each embodiment disclosed herein.
Claims (21)
1. a kind of time synchronization between nodes method for wireless sensor network, for making the local of wireless sensor network interior joint
Time is synchronous with the length of a game of clock source node, wherein the next-hop of node towards clock source node direction is the node
Father node, the node be the father node child node, this method comprises:
Receive multiple time synchronization data packets from the father node, wherein the time synchronization data packet includes the father
Node sends the length of a game t when time synchronization data packet1;
It obtains and corresponds to each length of a game t1Local zone time t locating for child node described in moment2, with obtain by it is local when
Between t2With corresponding length of a game t1The multiple groups of composition map data;
Multiple groups mapping data are fitted based on scheduled matching rule, to obtain with local zone time t2For independent variable, entirely
Office time t1For the functional relation t of dependent variable1=f (t2),
Wherein, linear fit is carried out to m group mapping data, to obtain linear fit parameter a, b, t1=at2+ b, wherein m is big
In or equal to 2 natural number;
Linear fit is carried out to m+1 group mapping data, to obtain linear fit parameter a ', b ';
Judgement | whether a-a'| < ε is true, and wherein ε is preset constant, 0 < ε < 1;
In the case where determining to set up, determine that the child node enters synchronous regime, and
In the case where determining invalid, determine that the child node enters asynchronous state, the child node is to the child node
Secondary child node sends lock-out designation date packet.
2. time synchronization between nodes method according to claim 1, wherein when the acquisition corresponds to each described global
Between t1Local zone time t locating for child node described in moment2The step of include:
Record receives local actual time t locating for child node when first bit in the time synchronization data packet2',
Local zone timeWherein, data transmission bauds of the r between the father node and the child node.
3. time synchronization between nodes method according to claim 1, wherein the time synchronization data packet is father's section
What point was sent when next counting of its own counter occurs to the child node, the length of a game is next counting
The time of corresponding clock source node.
4. time synchronization between nodes method according to claim 1, wherein in the reception from the more of the father node
Before the step of a time synchronization data packet, this method further include:
Multiple time synchronization requests are sent to the father node at predetermined intervals, wherein the time synchronization data packet
It is that the father node is sent in response to receiving the time synchronization request.
5. time synchronization between nodes method according to claim 4, further includes:
When receive the child node time synchronization request when, judge the father node whether with the clock source node
Length of a game is synchronous;
If it is determined that synchronous, then the father node sends the time synchronization data packet to the child node, and/or
If it is determined that not synchronizing, then the child node is every the predetermined time again to the father node sending time synchronization request.
6. time synchronization between nodes method according to claim 5, wherein
If it is determined that synchronous, at the time of the child node nth transmission time synchronization is requested and (n+1)th sending time synchronization request
At the time of between time interval be 2n-1T0, wherein n is the natural number more than or equal to 1, T0For preset constant, with
And/or person
If it is determined that not synchronizing, the child node is with time interval T0Sending time synchronization request.
7. time synchronization between nodes method according to claim 4, wherein the father node has at least two son sections
Point, this method further include:
Receive the time synchronization data packet that the father node is sent to other child nodes;And/or
The time synchronization data packet for being sent to other nodes in response to receiving the father node, resetting send the time synchronization
The time interval of request.
8. the node in a kind of wireless sensor network, wherein the next-hop of node towards clock source node direction is the node
Father node, which is the child node of the father node, and the count value of the clock source node is length of a game, the node packet
It includes:
Receiving module, for receiving multiple time synchronization data packets from father node, wherein the time synchronization data packet packet
The length of a game t when time synchronization data packet is sent containing the father node1;
Module is obtained, obtains and corresponds to each length of a game t1Local zone time t locating for child node described in moment2, to obtain
By local zone time t2With corresponding length of a game t1The multiple groups of composition map data;
Fitting module, for based on scheduled matching rule to the multiple groups mapping data be fitted, with obtain with it is local when
Between t2For independent variable, length of a game t1For the functional relation t of dependent variable1=f (t2), wherein
The fitting module carries out linear fit to m group mapping data, to obtain linear fit parameter a, b, t1=at2+ b,
In, m is the natural number more than or equal to 2;
The fitting module, which is also used to map data to m+1 group, carries out linear fit, to obtain linear fit parameter a ', b ';
Judgment module, for judging | whether a-a'| < ε true, wherein ε be preset constant, 0 < ε < 1,
In the case where determining to set up, determine that the node enters synchronous regime, and
In the case where determining invalid, determine that the node enters asynchronous state, and the sending module is to the node
Child node sends lock-out designation date packet.
9. node according to claim 8, wherein the acquisition module records the receiving module and receives the time
Local actual time t locating for child node when first bit in synchronization packets2', local zone time
Wherein, data transmission bauds of the r between the father node and the child node.
10. node according to claim 8, wherein the time synchronization data packet is the father node in its own meter
What next counting of number device was sent when occurring to the child node, the length of a game is clock corresponding to next counting
The time of source node.
11. node according to claim 8, further includes:
Sending module, for sending multiple time synchronization requests to the father node at predetermined intervals, wherein when described
Between synchronization packets to be the father node request and send in response to receiving the time synchronization.
12. node according to claim 11, further includes:
Judgment module, it is described to sentence when the receiving module receives the time synchronization request of the child node from the node
Disconnected module judges whether the node is synchronous with the length of a game of clock source node,
If the judgment module judgement has synchronized, child node sending time synchrodata of the sending module to the node
Packet, and
If the judgment module judgement does not synchronize, the child node of the node to the node when sending the predetermined time again
Between synchronization request.
13. node according to claim 12, wherein
If judgment module judgement has synchronized, at the time of the child node nth transmission time synchronization request of the node and n-th
Time interval between at the time of+1 sending time synchronization request is 2n-1T0, n is the natural number more than or equal to 1, T0It is pre-
The constant first set, and/or
If the judgment module judgement does not synchronize, the child node of the node is with predetermined time interval T0Sending time synchronization request.
14. node according to claim 11, wherein the father node has at least two child nodes,
The receiving module is also used to receive the time synchronization data packet that the father node is sent to other child nodes, and/or
Person
The time synchronization data packet that the father node is sent to other nodes, the transmission are received in response to the receiving module
Module reset sends the time interval of the time synchronization request.
15. a kind of wireless sensor network, including multiple nodes, one of them is clock source node, the meter of the clock source node
Numerical value is length of a game, and the next-hop of node towards clock source node direction is the father node of the node, which is described
The child node of father node, wherein
The child node receives multiple time synchronization data packets from the father node, and the time synchronization data packet includes institute
State length of a game t when father node sends the time synchronization data packet1,
The child node, which obtains, corresponds to each length of a game t1Local zone time t locating for child node described in moment2, with
To by local zone time t2With corresponding length of a game t1The multiple groups of composition map data,
The child node is based on scheduled matching rule and is fitted to multiple groups mapping data, to obtain with local zone time t2
For independent variable, length of a game t1For the functional relation t of dependent variable1=f (t2), wherein
The child node carries out linear fit to m group mapping data, to obtain linear fit parameter a, b, t1=at2+ b, wherein m
For the natural number more than or equal to 2;
The child node also carries out linear fit to m+1 group mapping data, to obtain linear fit parameter a ', b ', judgement | and a-a'
| whether < ε true, wherein ε be preset constant, 0 < ε < 1,
In the case where determining to set up, determine that the child node enters synchronous regime, and
In the case where determining invalid, determine that the child node enters asynchronous state, and the child node is to belonging to this
The secondary child node of child node sends lock-out designation date packet, described in response to receiving the lock-out designation date packet
Secondary child node determines that it enters asynchronous state.
16. wireless sensor network according to claim 15, wherein
The child node record receives local locating for child node when first bit in the time synchronization data packet
Actual time t2', local zone timeWherein, data transmission of the r between the father node and the child node
Baud rate.
17. wireless sensor network according to claim 15, wherein
The time synchronization data packet is the father node when next counting of its own counter occurs to the sub- section
What point was sent, the length of a game is the time of clock source node corresponding to next counting.
18. wireless sensor network according to claim 15, wherein
The child node sends multiple time synchronization requests to the father node at predetermined intervals, wherein the time
Synchronization packets are that the father node is sent in response to receiving the time synchronization request.
19. wireless sensor network according to claim 18, wherein
When the time synchronization for receiving the child node is requested, the father node judges whether it is complete with clock source node
Office's time synchronization,
If it is determined that having synchronized, then the father node sends the time synchronization data packet to the child node, and/or
If it is determined that not synchronizing, then the child node is every the predetermined time again to the father node sending time synchronization request.
20. wireless sensor network according to claim 19, wherein
If it is determined that having synchronized, between the child node nth transmission time synchronization request and (n+1)th sending time synchronization request
Time interval be 2n-1T0, wherein n is the natural number more than or equal to 1, T0For preset constant, and/or
If it is determined that not synchronizing, the child node is with time interval T0Sending time synchronization request.
21. wireless sensor network according to claim 18, wherein the father node has at least two child nodes,
The child node is also used to receive the time synchronization data packet that the father node is sent to other child nodes, and/or
The time synchronization data packet that the child node is sent to other nodes in response to receiving the father node, resetting send institute
State the time interval of time synchronization request.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611158015.6A CN106455042B (en) | 2016-12-15 | 2016-12-15 | A kind of time synchronization between nodes method, wireless sensor network and its node |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611158015.6A CN106455042B (en) | 2016-12-15 | 2016-12-15 | A kind of time synchronization between nodes method, wireless sensor network and its node |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106455042A CN106455042A (en) | 2017-02-22 |
CN106455042B true CN106455042B (en) | 2019-10-11 |
Family
ID=58216552
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611158015.6A Active CN106455042B (en) | 2016-12-15 | 2016-12-15 | A kind of time synchronization between nodes method, wireless sensor network and its node |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106455042B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10512054B2 (en) | 2017-10-26 | 2019-12-17 | Benchmark Electronics, Inc. | Synchronization and time transfer in wireless networks and method therefor |
CN111107620B (en) * | 2018-10-25 | 2023-02-21 | 中兴通讯股份有限公司 | Method and device for determining reference timing, storage medium and electronic device |
CN109615838B (en) * | 2018-12-14 | 2020-07-03 | 浙江大学 | Wi-Fi (wireless fidelity) -based low-cost low-power-consumption multi-terminal signal synchronous acquisition system |
CN113890665A (en) * | 2021-09-23 | 2022-01-04 | 北京超星未来科技有限公司 | Time synchronization method, system, storage medium and processor |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101262330A (en) * | 2008-03-05 | 2008-09-10 | 中科院嘉兴中心微系统所分中心 | A quick high-precision time synchronization method for wireless sensor network with belt feature |
CN101917759A (en) * | 2010-07-20 | 2010-12-15 | 重庆康如来科技有限公司 | Wireless sensor network time synchronization method based on linear fit |
CN103458498A (en) * | 2013-09-16 | 2013-12-18 | 山东省计算中心 | Intelligent wireless sensor network time synchronization method |
CN104053223A (en) * | 2013-03-13 | 2014-09-17 | 中国科学院大学 | Low-power wireless sensor network time synchronization method |
CN105959079A (en) * | 2016-07-14 | 2016-09-21 | 深圳市旗众智能自动化有限公司 | Clock synchronization method based on distributed control system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9226252B2 (en) * | 2013-06-03 | 2015-12-29 | King Fahd University Of Petroleum And Minerals | Recursive time synchronization protocol method for wireless sensor networks |
-
2016
- 2016-12-15 CN CN201611158015.6A patent/CN106455042B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101262330A (en) * | 2008-03-05 | 2008-09-10 | 中科院嘉兴中心微系统所分中心 | A quick high-precision time synchronization method for wireless sensor network with belt feature |
CN101917759A (en) * | 2010-07-20 | 2010-12-15 | 重庆康如来科技有限公司 | Wireless sensor network time synchronization method based on linear fit |
CN104053223A (en) * | 2013-03-13 | 2014-09-17 | 中国科学院大学 | Low-power wireless sensor network time synchronization method |
CN103458498A (en) * | 2013-09-16 | 2013-12-18 | 山东省计算中心 | Intelligent wireless sensor network time synchronization method |
CN105959079A (en) * | 2016-07-14 | 2016-09-21 | 深圳市旗众智能自动化有限公司 | Clock synchronization method based on distributed control system |
Also Published As
Publication number | Publication date |
---|---|
CN106455042A (en) | 2017-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106455042B (en) | A kind of time synchronization between nodes method, wireless sensor network and its node | |
CN106488550B (en) | Determine the method and apparatus of terminal Yu base station clock time deviation | |
CN100581164C (en) | Accurate time synchronization method and system facing measurement and control | |
CN105611621B (en) | A kind of master-slave synchronisation method suitable for multi-hop wireless sensor network | |
CN106059701A (en) | Device for testing clock synchronization correction value of time-triggered Ethernet by capturing protocol control frame | |
CN106171032B (en) | Data transmission method and equipment | |
CN104469413B (en) | The improved method that multiple terminals synchronization reproduction time deviation is calculated in a kind of LAN | |
CN110249372A (en) | Sensor-based system and method for synchronizing time | |
CN107508719A (en) | Measure the method, apparatus and network node of network delay | |
CN103168440B (en) | Time path compensation method and device | |
CN103546268B (en) | The compensation method of a kind of system time and equipment | |
CN106130710B (en) | A kind of clock synchronizing method and system | |
JP5811895B2 (en) | Communication apparatus and communication method | |
CN108155982A (en) | A kind of timestamp processing method and equipment | |
CN105359596B (en) | Method of adjustment, equipment and the system of Timing Advance | |
CN109996325A (en) | A kind of clock system and method for wireless sensor network | |
CN102447745B (en) | The processing method and processing device of message residence time in TC equipment | |
CN103108388A (en) | Method, device and system of wireless sensor network clock synchronization | |
CN104866399B (en) | UM-BUS bus run Failure Detection Controller and detection method | |
CN110166562A (en) | Data synchronous method, apparatus, storage medium and electronic equipment | |
CN108683472A (en) | A kind of clock synchronizing method based on Time delay measurement | |
CN106059697A (en) | Method for time synchronization | |
CN107395307A (en) | A kind of clock synchronizing method and equipment | |
CN108259105A (en) | A kind of time synchronizing method, apparatus and synchronizing network | |
CN108768573A (en) | A kind of clock synchronizing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |