CN111867042A - MESH network synchronization method with time difference detection function - Google Patents

MESH network synchronization method with time difference detection function Download PDF

Info

Publication number
CN111867042A
CN111867042A CN202010303928.2A CN202010303928A CN111867042A CN 111867042 A CN111867042 A CN 111867042A CN 202010303928 A CN202010303928 A CN 202010303928A CN 111867042 A CN111867042 A CN 111867042A
Authority
CN
China
Prior art keywords
node
synchronization
nodes
time difference
message
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.)
Granted
Application number
CN202010303928.2A
Other languages
Chinese (zh)
Other versions
CN111867042B (en
Inventor
高小玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yunlian Huitong Technology Co ltd
Original Assignee
Beijing Yunlian Huitong Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Yunlian Huitong Technology Co ltd filed Critical Beijing Yunlian Huitong Technology Co ltd
Priority to CN202010303928.2A priority Critical patent/CN111867042B/en
Publication of CN111867042A publication Critical patent/CN111867042A/en
Application granted granted Critical
Publication of CN111867042B publication Critical patent/CN111867042B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • H04W56/0015Synchronization between nodes one node acting as a reference for the others
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The application provides a MESH network synchronization method with a time difference detection function, and belongs to the technical field of wireless networks. The method mainly comprises the following steps: firstly, a network hierarchy with the source node as the center and other nodes with hop number from the source node as the grade is established among network nodes. Each node takes a node with a lower level than the node itself as a master node and synchronizes with the master node. The synchronization process is divided into an initial synchronization process, a time difference detection process, and a resynchronization process. When the node is started, the initial synchronization to the main node is completed through a bidirectional interaction mechanism of the synchronization message, the node calculates the time difference between the node and the main node through a time difference detection process in the following period, and when the time difference reaches a threshold value, the node automatically resynchronizes to the main node. And when the synchronization is performed again, the delay error between the nodes is avoided by a virtual open-loop synchronization mode. Compared with the FTSP synchronization protocol and the TPSN synchronization protocol, the method is simulated, and the result shows that the method has better performance in synchronization precision and synchronization overhead.

Description

MESH network synchronization method with time difference detection function
Technical Field
The application relates to the technical field of wireless networks, in particular to a MESH network synchronization method with a time difference detection function.
Background
The wireless MESH network is a centerless distributed network which is composed of a plurality of types of nodes and has multi-hop property, self-organization property and self-management property, has the advantages of high transmission bandwidth, long transmission distance, self-organization of the network, strong self-healing capability, easy rapid deployment, installation, simple maintenance and the like, is very suitable for being used in environments with complicated geographic environments and remote no communication infrastructure, and provides a reliable, effective and safe guarantee means for the transmission of comprehensive services such as voice, pictures, video and the like. As a distributed network, strict time synchronization needs to be maintained between wireless MESH nodes. The existing common synchronization technology is timed by an external synchronization system (such as GPS, Beidou and the like), the synchronization mode has high precision and high synchronization speed, but the synchronization method cannot be applied to the condition that the external environment is complex and even a wartime satellite is damaged, so that distributed synchronization can be carried out among all nodes in the wireless MESH network.
Among the distributed synchronization methods, the master-slave synchronization method has been widely studied because of its high synchronization convergence speed. Typical master-slave time synchronization protocols include the TPSN protocol and the FTSP protocol. Compared with the TPSN protocol, the FTSP protocol can reduce the synchronization times and reduce the overhead caused by synchronization. However, in the FTSP protocol, the time information collected by the node all experiences transmission delay, but the protocol itself does not consider delay errors. In addition, both protocols only set a fixed resynchronization period in resynchronization, but when the external environment changes randomly, the fixed resynchronization period cannot adapt to synchronization errors between nodes in time.
Disclosure of Invention
The purpose of the application is to provide a time synchronization method capable of detecting synchronization errors between nodes. The method is based on a master-slave synchronization mode, synchronization is rapidly completed between nodes through bidirectional interaction similar to NTP during initial synchronization, and synchronization errors between the nodes are detected in real time in a later time through a synchronization error detection process until an error value reaches a threshold value and then are resynchronized. The method implementation comprises the following steps:
establishing a master-slave type synchronization hierarchy, for a multi-hop MESH network, in order to realize the synchronization of all nodes to the same node, establishing a hierarchy which takes a source node as a center and other nodes take hop number from the source node as a grade, and finally realizing the synchronization of all nodes to the source node with the lowest grade by synchronizing the nodes with higher grade to the nodes with lower grade.
When the network is not established, a synchronization source node needs to be determined first, so that all nodes synchronize with the synchronization source node. The method adopts a competition mode to select a source node, and a node which is started up firstly in a specified neighborhood range becomes a main node.
After a source node is started, if a node is started in a hop range of the source node, a one-hop neighbor node receives a synchronous message of the source node before the self cycle number variable is updated to 6. And comparing the value of the cycle variable of the one-hop neighbor node by using the cycle variable of the synchronous message.
In the method, if the variable value of the cycle number in the synchronous message is larger than the variable value of the cycle number in the node, the node takes the sending node of the synchronous message as a main node. The method has the advantages that the nodes with higher levels are determined as the master nodes by the nodes with higher levels, so that the nodes with higher levels are initially synchronized to the nodes with lower levels, and finally all the nodes are synchronized to the source node with the lowest level.
In the method, except for a source node, after other nodes are accessed to the network, one node is determined as a main node of the node in each period, so that the synchronization to the main node or the time difference between the node and the main node can be detected in each period.
When the node is started to determine the main node, the variable of the self periodicity is updated to be the same as the periodicity of the main node. Therefore, in order to ensure that the node can still determine the master node in the following period, if any node does not become the source node after being started, the self period number variable does not record the self period number any more, and only records the period number of the master node.
After the network source node is established in the method, the initial synchronization is carried out, and the steps are as follows:
the initial synchronization process comprises open-loop synchronization and closed-loop synchronization, and the synchronization process is that the open-loop synchronization is performed first and then the closed-loop synchronization is performed. However, since the synchronization packet of the node with a lower level is subjected to transmission delay when received by the node with a higher level, the node with a higher level still has a time difference with the source node after the open-loop synchronization, and time correction is required, so that the node with a higher level needs to immediately send a reply packet.
When the node with lower grade receives the reply message of the node with higher grade, the reply message also experiences transmission delay. And after receiving the feedback message of the node with the higher level, the node with the higher level can adjust the local time according to the calculated correction time, thereby eliminating the transmission delay of the message and completing the closed-loop synchronization.
According to the method, because the clock drift values of different nodes are different, time difference still occurs between the nodes due to clock drift after initial synchronization, and the time difference is accumulated to be larger along with the time, so that resynchronization is needed to be performed timely. I.e. a time difference detection procedure, the nodes can be automatically synchronized according to the time difference between each other.
The time difference detection process according to the method is as follows: after the node carries out initial synchronization to the main node, if the synchronization message of the main node is received again, the clock drift error value of the main node relative to the node is calculated by using the time in the synchronization message, the correction value calculated in the initial synchronization process and the local time when the synchronization message is received. And if the clock drift error value is larger than the time difference threshold value, the node performs synchronization again to the main node, otherwise, the node does not perform synchronization again. The time difference threshold value can be variably set according to the maximum allowable time deviation between the nodes, so that the controllability of the time difference between the nodes is realized.
The node according to the method may further fit a clock drift error curve with the calculated clock drift error value at each cycle to compensate for the clock drift value, the method fitting the clock drift error curve with a minimum two-multiplication. Through compensation, the increase speed of the clock drift error between the node and the main node can be reduced, the resynchronization time is prolonged, and the resynchronization times are reduced.
According to the resynchronization process of the method, if the node firstly carries out open-loop synchronization according to the initial synchronization process, a time delay error is generated with the main node, so that a virtual open-loop synchronization strategy is adopted: when the node receives the synchronous message of the main node and judges that the node needs to be synchronized with the main node again, the node does not carry out open-loop synchronization with the main node, but records the difference value between the time value in the synchronous message of the main node and the local time when the message is received, and simulates the local time when the node sends the return message under the condition of carrying out open-loop synchronization according to the message sending time.
Drawings
In order to more clearly illustrate the technical solution of the method of the present application, the drawings that are needed to be used in the method of the present application will be briefly described below, it should be understood that the following drawings only illustrate certain embodiments of the present application and therefore should not be considered as limiting the scope, and that for a person skilled in the art, other relevant drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a processing flow when a node receives a packet in the method of the present application.
Fig. 2 shows a synchronization message format used in the method of the present application.
Fig. 3 is a schematic diagram of an initial synchronization process of the method of the present application.
Fig. 4 is a diagram of a reply message format used by the method of the present application.
Fig. 5 shows a feedback packet format used in the method of the present application.
Fig. 6 is a schematic diagram of a time difference detection process of the method of the present application.
Fig. 7 is a diagram illustrating a resynchronization process according to the method of the present application.
FIG. 8 is a topological diagram of a simulation test employed by the method of the present application.
Fig. 9 is a synchronization frequency statistical chart of two nodes of the TPSN protocol and the method of the present application.
Fig. 10 is a graph comparing the synchronization accuracy and the synchronization convergence rate with the FTSP protocol according to the method of the present application.
FIG. 11 is a graph of the time difference between a node and a node at a lower level in the method of the present application.
Detailed Description
The technical solution of the method of the present application will be described clearly and completely with reference to the accompanying drawings in the method of the present application, and it is obvious that the described method process is only a part of the process of the present application, not the whole process. Thus, the following detailed description of specific implementations of the present application, presented in the figures, is not intended to limit the scope of the claimed application, but is merely representative of selected processes of the present application. All other methods, which can be derived by one skilled in the art without any inventive step based on the implementation of the present application, are within the scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Referring to fig. 1, fig. 1 is a processing flow of a node receiving a message in the method of the present application. When receiving the message, the node firstly judges the message type, and replies the message and feeds back the message according to the judged synchronous message. And judging whether a main node exists according to the number value of the cycles during the synchronization message, if so, taking the sending node of the synchronization message as the main node of the main node, judging whether the node is a new main node, if so, re-synchronizing, otherwise, detecting the synchronization error and finishing. And when the self does not have the main node, the sending node of the synchronous message is used as the main node of the self, and the open-loop synchronization of the initial synchronization process is carried out, and then the process is finished. And (3) judging whether the ID of the reply message is equal to the M-ID field or not by the reply message, if not, directly ending, if so, judging whether the MC field is 1, if so, calculating a correction value, and ending after sending the feedback message, and if not, directly ending. The feedback message firstly judges whether the Ack-ID field is equal to the ID value of the feedback message, if not, the process is directly finished, and if so, the closed-loop synchronization of the initial synchronization process is carried out.
Referring to fig. 2, fig. 2 is a diagram illustrating a format of a sync message used in the method of the present application. When the network is not established, a synchronization source node needs to be determined first, so that all nodes are synchronized with the synchronization source node. The method adopts a competition mode to select a source node, and a node which is started firstly in a specified neighborhood range becomes a main node, wherein the competition mode is as follows:
each node is in a listening state after being started, a timer is started, and a cycle variable cycle-num in the node is added with 1 every time a cycle is elapsed. And when the cycle-num count is 6, if the node still does not receive the synchronous messages sent by other nodes, the node becomes a source node. The source node periodically sends a synchronous message, the sending period is T, wherein the value of a Cycle-number variable Cycle-number, the ID and the M-ID fields of the Cycle-number field are all filled in the ID of the node, the Grade field is filled in 0 to indicate that the Grade of the node is 0, and the local Time when the synchronous message is sent is filled in the Time field.
After a source node is started, if a node is started in a hop range of the source node, a hop neighbor node receives a synchronous message of the source node before the cycle-num of the node is updated to 6. And comparing the Cycle-Num value of the one-hop neighbor node by using the Cycle-Num of the synchronous message. And if the Cycle-Num value in the synchronous message is larger than the internal Cycle-Num value of the node, the node takes the sending node of the synchronous message as a main node. Therefore, the one-hop neighbor node determines the source node as the master node, sets the self level as 1, and updates the Cycle-Num value to the Cycle-Num value. The level 1 node then initially synchronizes to the master node.
The level 1 node also periodically sends a synchronization message, after the node which is 2 hops away from the source node is started, the synchronization message of the level 1 node is received before the Cycle-Num of the node is updated to 6, and the level 1 node is determined as the main node of the node by comparing the Cycle-Num value in the message with the Cycle-Num value of the node. Since the 2-hop node is just started, the level-1 node is determined to be the master node, so that the level of the 2-hop node is 2, the Cycle-Num is updated to the value of the Cycle-Num field, and the 2-hop node performs initial synchronization to the level-1 node.
After the initial synchronization is completed, the 2-level node also periodically sends a synchronization message, and by analogy, the n-level node is determined as the master node by the n + 1-level node, so that the initial synchronization from the n + 1-level node to the n-level node is realized, and finally all the nodes are synchronized to the source node with the lowest level.
In the method, except for a source node, after other nodes are accessed to the network, one node is determined as a main node of the node in each period, so that the synchronization to the main node can be ensured in each period or the time difference between the node and the main node can be detected. However, when the node is started to determine the master node, the cycle-num variable of the node is updated to be the same as the cycle number of the master node. Therefore, in order to ensure that the node can still determine the master node in the following period, if any node does not become the source node after being started, the cycle-num of the node does not record the cycle of the node, but only records the cycle of the master node. Assuming that the node A is a source node, assuming that the node B is started when the cycle number of the node A reaches 10, determining the node A as a main node of the node B after the node B receives a synchronous message of the node A, and updating a cycle-num of a variable of the cycle number of the node B to 10. When the number of cycles of the node A reaches 11, the node A sends a synchronous message, and when the node B receives the message, the variable cycle-num of the number of cycles of the node B is still 10, so that the node A is still determined as a main node.
Referring to fig. 3, fig. 3 is a schematic diagram of an initial synchronization process of the method, which is described by taking an initial synchronization from a level 1 node to a source node as an example, assuming that the source node is at a local time t0Sending a synchronous message at any Time, and adjusting the local Time to the value of a Time field, namely t, after receiving the synchronous message by the level 1 node0And time, thereby completing the open loop synchronization. But the synchronous message of the source node is subjected to the transmission delay delta k when being received by the level 1 node0Therefore, the difference between the open-loop synchronization of the level 1 node and the source node is still time, and time correction is needed, so that the level 1 node needs to send a reply message immediately.
Referring to fig. 4, fig. 4 shows a format of a reply message in the method, because the level 1 node determines the source node as its own master node, the M-ID field is filled in the ID of the source node. The NC field is filled with 1 indicating that the master node is required to perform the time correction calculation at this time. The Time field is filled in the local Time when the reply message is sent, which is assumed to be t1
When the source node receives the reply message of the level 1 node, the reply message also experiences the transmission delay delta k1. The source node records the local time t when the reply message is receivedbAnd analyzing the field, if it is judged that the M-ID is equal to the self ID value and the NC field is equal to 1, calculating a time correction value Δ of by equation (1), where t is 1And replying the Time value in the message for the level 1 node. Due to the time delay delta k of the message passing from the level 1 node to the source node1In comparison withApproximately equal to the time delay delta k of the message from the source node to the level 1 node in a short time interval0So a value can be calculated. Then the source node also immediately sends a feedback message.
Figure BSA0000206671070000071
Referring to fig. 5, fig. 5 shows a feedback message format of the present method, wherein the Offset field is filled with the calculated Δ of value, and the Ack-ID field is filled with the ID of the level 1 node to indicate the destination address of the message.
And after the level 1 node receives the feedback message of the source node, the local time can be adjusted according to the Offset, so that the transmission delay of the message is eliminated, and the closed-loop synchronization is completed. And then, the level 1 node periodically sends a synchronization message after retreating for SIFS time, so that the level 2 node performs initial synchronization, and the synchronization process is open-loop synchronization and then closed-loop synchronization.
Referring to fig. 6, fig. 6 is a schematic diagram of a time difference detection process in the method, where a source node is at a local time t0Sending synchronous message, after receiving, the 1-level node carries out open-loop synchronization to adjust the time to t0However, the time difference between the level 1 node and the source node at this time is divided by the transmission delay Δ k0In addition, there is a clock drift difference Δ s (Δ k) of the source node relative to the level 1 node during this time 0). Suppose a level 1 node is at local time t2Sending a reply message all the time, so that the time difference between the source node and the level 1 node is increased by the slave t0To t2Clock drift error Δ s (t) over this period of time0,t2). When the reply message is received by the source node, the transmission delay delta k from the level 1 node to the main node is experienced0' and the clock drift difference Δ s (Δ k) of the master node during this time0') of the correction value Δ of calculated in accordance with equation (1) as described above1Is represented by formula (2) wherein Δ k0And Δ k0' may be considered the same for a short time.
Figure BSA0000206671070000081
Then the source node sends a feedback message, and the level 1 node is assumed to be at the local time t2' when the message is received, the time difference between the level 1 node and the master node is increased by Δ s (t)2,t2') at this time, the time difference is Δ V1
Figure BSA0000206671070000082
Therefore, the level 1 node has a time difference Δ R1 with the source node after being compensated by the correction value Δ of 1.
Figure BSA0000206671070000083
T of source node in next period3When the synchronous message is sent all the time, the local time of the level 1 node is assumed to be t3' then it is synchronized from t which completes the closed loop2' time to t3' this time in turn generates a clock drift error Δ s (t) with the source node2,t3'). Level 1 node at t4The synchronous message of the source node is received at any time and experiences transmission delay delta k1At this Time, the level 1 node does not perform open loop synchronization to the master node again, but adds the calculated correction value delta of to the Time value in the synchronization message 1(compensation transmission delay), and then subtracting the local time to obtain a difference value delta w2Is (in the formula,. DELTA.k)0And Δ k1Treated as the same in a short time period)
Figure BSA0000206671070000091
Analogizing in turn, if the nth period source node is at the time txWhen the synchronous message is sent, the local time corresponding to the level 1 node is txIf yes, the synchronous message is transmitted with a delay delta kn-1After 1 level node at local time tyAnd (4) receiving. The level 1 node adds the corrected value delta of to the Time value in the synchronous message1Local time tyThen subtract the local time tyCalculated Δ wnHas a value of
Figure BSA0000206671070000092
In which the value of the transmission delay deltakn-1Relative to Δ k0Is mainly determined by the change of the air propagation delay caused by the change of the node position. And when the speed of motion or rest between nodes is not particularly fast, Δ kn-1Relative to Δ k0The amount of change in (c) is very small and can be regarded as 0. So if the level 1 node receives the synchronous message of the source node in each period after the initial synchronization to the source node, the calculated delta wnThe value is approximately equal to the clock drift error value of the source node relative to itself.
Referring to fig. 7, fig. 7 is a schematic diagram of a resynchronization process in the method, when resynchronization is performed, if a node performs open-loop synchronization first according to an initial synchronization process, a delay error is generated with a master node, so a virtual open-loop synchronization policy is adopted: when a node receives a synchronization message of a main node and judges that the node needs to be synchronized with the main node again, the node does not carry out open-loop synchronization with the main node, but records a difference value delta (t) between a Time value in the synchronization message of the main node and local Time when the message is received Time-tLocal). The node assumes taSending a reply message at any moment, and then sending delta (t)a-(tTime-tLocal) Time field of the reply message is filled, which simulates the local Time when the node sends the reply message with open-loop synchronization. Therefore, when the master node receives the reply message, the Time field can be used to calculate the correction value Δ of according to equation (1), and closed-loop synchronization can also be completed.
Referring to fig. 8, fig. 8 is a topological diagram of a simulation test adopted by the method, in which a text protocol, a TPSN protocol, and an FTSP protocol are simulated on OPNET 14.5, and simulation scenarios and parameters are configured identically: nodes 0, 1, 2 are in a chain topology (0 and 1 are 2.5km apart, 1 and 2 are 2.9km apart), and the Rxgroup module sets the maximum communication distance between the nodes to 5km, so nodes 0 and 2 cannot communicate directly. The other parameters are configured as in table 1. The clock model adopts a formula (7) to float the clockThe shift value alpha is improved to change along with time, and the clock drift of the node can change along with the external environment in reality. In the formula (7) < alpha >0Represents the initial value of clock drift, beta is the variation rate of the drift value, and the threshold theta is only configured in the protocol. The resynchronization period of both the TPSN protocol and the FTSP protocol is set to 1 s.
L(t)=(1+α)t+L(t0)=(1+(α0+βt))t+L(t0)=(1+α0)t+βt2+L(t0) (7)
TABLE 1 simulation parameter configuration Table
Figure BSA0000206671070000101
Referring to fig. 9, fig. 9 is a statistical chart of the synchronization times of the nodes of the present method and the TPSN protocol, and the present method and the TPSN protocol are compared in terms of the synchronization times: the method and the synchronization times of the nodes 1 and 2 in the TPSN protocol are shown (the node 0 is the master node at first when being started and does not synchronize with other nodes). It can be seen that under the same simulation time, the synchronization times of the nodes 1 and 2 in the method are respectively 200 times and 600 times, while the synchronization times of the nodes 1 and 2 in the TPSN protocol exceed 1000 times, because the TPSN protocol resynchronizes in each TDMA period, and the protocol of the present document resynchronizes when the monitored clock drift error exceeds the threshold, the method has obviously reduced synchronization times compared with the FTSP protocol.
Referring to fig. 10, fig. 10 is a comparison between the synchronization accuracy and the synchronization convergence rate of the method and the FTSP protocol according to the time difference between the node in the method and the FTSP protocol with respect to the node in the lower level: local time differences of the node 1 and the node 0 and the node 2 and the node 1 in the method and the FTSP protocol are shown, and the horizontal axis represents simulation time. It can be seen that the local time difference between the node 1 and the node 0 in the method is already converged at the simulation time of about 2s, while the local time difference between the node 1 and the node 0 in the FTSP protocol is sharply reduced and converged at the simulation time of about 3s, and the same local time difference between the node 2 and the node 1 is converged faster in the method. Therefore, the method is verified to be faster than the FTSP protocol in synchronous convergence speed. In addition, it can be seen that, in the method, when the node 1 and the node 2 converge synchronously, the local time difference between the node 1 and the node 0 is kept around 0us, while when the node 1 and the node 2 converge synchronously, the local time difference between the node 1 and the node 0 is kept around 11 us. Therefore, the method has better performance than the FTSP on the synchronization precision, and the time interval of the ordinate in the figure is further shortened to observe the synchronization and monitoring process of the protocol.
Referring to fig. 11, fig. 11 is a time difference diagram of a node in the method relative to a node of a lower level, and it can be seen that the local time difference between node 1 and node 0 in the method rapidly decreases from 1us to converge to near 0us when the simulation time is about 21s, which is precisely because the nodes detect that the time difference exceeds the threshold and then resynchronize immediately, which proves that the nodes in the method can synchronize automatically according to the time difference threshold.

Claims (10)

1. A MESH network synchronization method with time difference detection function is a synchronization method based on multi-hop MESH network, comprising the following steps:
firstly, a network hierarchy with the source node as the center and other nodes with hop number from the source node as the grade is established among network nodes. Each node takes a node with a lower level than the node itself as a master node and synchronizes with the master node. The synchronization process is divided into an initial synchronization process, a time difference detection process, and a resynchronization process. When the node is started, the initial synchronization to the main node is completed through a bidirectional interaction mechanism of the synchronization message, the node calculates the time difference between the node and the main node through a time difference detection process in the following period, and when the time difference reaches a threshold value, the node automatically resynchronizes to the main node. And when the synchronization is performed again, the delay error is prevented from being generated again among the nodes by a virtual open-loop synchronization mode, and finally, the synchronization of all the nodes to the source node with the lowest level is realized.
2. The method of claim 1, wherein a synchronization source node is first determined to synchronize all nodes to when the network is not established.
3. The method of claims 1 and 2, wherein the source node is selected in a competitive manner, and the node that is first powered on in the neighborhood is defined to be the master node.
4. The method according to claims 1 and 3, characterized in that after the source node is powered on, if there are nodes within a hop range, the one-hop neighbor node will receive the synchronization message of the source node before the self cycle number variable is updated to 6. And comparing the value of the cycle variable of the one-hop neighbor node by using the value of the cycle variable of the synchronous message.
5. The method of claim 4, wherein if the value of the cycle count variable in the synchronization message is greater than the value of the cycle count variable within the node, the node is to use the sending node of the synchronization message as the master node. By the mode that the nodes with higher levels determine the nodes with lower levels as the main nodes, the nodes with higher levels perform initial synchronization to the nodes with lower levels, and finally all the nodes synchronize to the source node with the lowest level.
6. The method of claim 1, wherein the other nodes except the source node are allowed to access the network and determine a node as its own master node in each period, thereby ensuring that each period can synchronize with the master node or detect a time difference between itself and the master node.
7. A method as claimed in claims 1 and 3, wherein the node is powered on to determine the master node, and the variable of the number of cycles is updated to be the same as the number of cycles of the master node. In order to ensure that the node can still determine the master node in the following period, if any node does not become the source node after being started, the self period number variable does not record the self period number any more, and only records the period number of the master node.
8. A method according to claims 1 and 3, characterized in that after establishing a network source node, an initial synchronization is performed by the steps of:
the initial synchronization process comprises open-loop synchronization and closed-loop synchronization, and the synchronization process is that the open-loop synchronization is performed first and then the closed-loop synchronization is performed. However, since the synchronization packet of the node with a lower level is subjected to transmission delay when received by the node with a higher level, the node with a higher level still has a time difference with the source node after the open-loop synchronization, and time correction is required, so that the node with a higher level needs to immediately send a reply packet.
When the node with lower grade receives the reply message of the node with higher grade, the reply message also experiences transmission delay. And after receiving the feedback message of the node with the higher level, the node with the higher level can adjust the local time according to the calculated correction time, thereby eliminating the transmission delay of the message and completing the closed-loop synchronization.
9. The method according to claims 1 and 3, characterized in that after the network source node is established, due to different clock drift values of different nodes, a time difference is generated between the nodes after initial synchronization due to clock drift, and the time difference is accumulated to be larger as time goes by, so that time difference detection needs to be performed timely, and the nodes can be automatically synchronized according to the time difference, and the steps are as follows:
the detection process is first induced by analyzing the synchronization errors present in the initial synchronization process. After the node carries out initial synchronization to the main node, if the synchronization message of the main node is received again, the clock drift error value of the main node relative to the node is calculated by using the time value in the synchronization message, the correction value calculated in the initial synchronization process and the local time when the synchronization message is received. And if the clock drift error value is larger than the time difference threshold value, the node performs synchronization again to the main node, otherwise, the node does not perform synchronization again. The time difference threshold value can be variably set according to the maximum allowable time deviation between the nodes, so that controllability of the time difference between the nodes is realized.
In addition, the node can also utilize the calculated clock drift error value to fit a clock drift error curve in each period so as to compensate the clock drift value, and the method adopts a least square method to fit the clock drift error curve. Through compensation, the increase speed of the clock drift error between the node and the main node can be reduced, the resynchronization time is prolonged, and the resynchronization times are reduced.
10. A method according to claims 1-9, characterized in that a node determines a unique node as its own master node in each cycle, and that a node needs to resynchronize to a new master node when it finds out that a change of master node has occurred. Resynchronization is also performed when the clock drift difference calculated by the node (relative to the master node) exceeds a time difference threshold after initial synchronization.
During resynchronization, if the node performs open-loop synchronization first according to the initial synchronization process, a delay error is generated with the master node, so a virtual open-loop synchronization strategy is adopted: when the node receives the synchronization message of the main node and judges that the node needs to be synchronized with the main node again, the node does not carry out open-loop synchronization with the main node, but records the difference value between the time value in the synchronization message of the main node and the local time when the message is received, and simulates the local time when the node sends a reply message under the condition of carrying out open-loop synchronization.
CN202010303928.2A 2020-04-15 2020-04-15 MESH network synchronization method with time difference detection function Active CN111867042B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010303928.2A CN111867042B (en) 2020-04-15 2020-04-15 MESH network synchronization method with time difference detection function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010303928.2A CN111867042B (en) 2020-04-15 2020-04-15 MESH network synchronization method with time difference detection function

Publications (2)

Publication Number Publication Date
CN111867042A true CN111867042A (en) 2020-10-30
CN111867042B CN111867042B (en) 2022-11-04

Family

ID=72985093

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010303928.2A Active CN111867042B (en) 2020-04-15 2020-04-15 MESH network synchronization method with time difference detection function

Country Status (1)

Country Link
CN (1) CN111867042B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101174939A (en) * 2006-11-03 2008-05-07 中国科学院沈阳自动化研究所 Wireless meshed network low-spending high-precision time synchronization process for industry monitoring
CN103684648A (en) * 2012-09-21 2014-03-26 中兴通讯股份有限公司 Ring network node clock effectiveness judgment method and device
US20160315757A1 (en) * 2015-04-21 2016-10-27 U.S.A. As Represented By The Administrator Of The National Aeronautics And Space Administration Self-Stabilizing Distributed Symmetric-Fault Tolerant Synchronization Protocol
CN106302679A (en) * 2016-08-08 2017-01-04 腾讯科技(深圳)有限公司 A kind of virtual objects moves synchronous method, client and server
CN106921456A (en) * 2015-12-24 2017-07-04 中国科学院沈阳自动化研究所 Multi-hop wireless backhaul network time synchronization error compensation method based on PTP protocol
WO2018098791A1 (en) * 2016-12-01 2018-06-07 重庆邮电大学 Clock synchronization frequency deviation estimation method applicable to multi-hop wireless sensor network
CN108900273A (en) * 2018-08-09 2018-11-27 山东省计算中心(国家超级计算济南中心) A kind of consistent method for synchronizing time of wireless sensor network multi-hop
CN110493893A (en) * 2019-09-02 2019-11-22 上海无线电设备研究所 A kind of adaptive dynamic networking method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101174939A (en) * 2006-11-03 2008-05-07 中国科学院沈阳自动化研究所 Wireless meshed network low-spending high-precision time synchronization process for industry monitoring
CN103684648A (en) * 2012-09-21 2014-03-26 中兴通讯股份有限公司 Ring network node clock effectiveness judgment method and device
US20160315757A1 (en) * 2015-04-21 2016-10-27 U.S.A. As Represented By The Administrator Of The National Aeronautics And Space Administration Self-Stabilizing Distributed Symmetric-Fault Tolerant Synchronization Protocol
CN106921456A (en) * 2015-12-24 2017-07-04 中国科学院沈阳自动化研究所 Multi-hop wireless backhaul network time synchronization error compensation method based on PTP protocol
CN106302679A (en) * 2016-08-08 2017-01-04 腾讯科技(深圳)有限公司 A kind of virtual objects moves synchronous method, client and server
WO2018098791A1 (en) * 2016-12-01 2018-06-07 重庆邮电大学 Clock synchronization frequency deviation estimation method applicable to multi-hop wireless sensor network
CN108900273A (en) * 2018-08-09 2018-11-27 山东省计算中心(国家超级计算济南中心) A kind of consistent method for synchronizing time of wireless sensor network multi-hop
CN110493893A (en) * 2019-09-02 2019-11-22 上海无线电设备研究所 A kind of adaptive dynamic networking method

Also Published As

Publication number Publication date
CN111867042B (en) 2022-11-04

Similar Documents

Publication Publication Date Title
US10056999B2 (en) Time synchronization error compensation method for multi-hop wireless backhaul network based on PTP
US9226252B2 (en) Recursive time synchronization protocol method for wireless sensor networks
JP5318928B2 (en) Node in wireless system and method of synchronizing time and frequency of node
CN101335587B (en) Accurate time synchronization method for industrial wireless network
WO2023077760A1 (en) Industrial wireless network-and-tsn fusion-oriented cross-network time synchronization method
CN111490844B (en) Clock synchronization method and device and electronic equipment
CN106452650A (en) Clock synchronizing frequency deviation estimation method applicable to multi-hop wireless sensor network
KR20100131015A (en) Method and system for implementing the time division multiple access method to ad-hoc multihopping wireless networks
CN113055117A (en) Clock synchronization device and method of wireless distributed network
CN110278048B (en) Hierarchical Ad Hoc network time synchronization method based on clustering algorithm
Pinho et al. A robust gradient clock synchronization algorithm for wireless sensor networks
CN104243079A (en) Microsecond clock synchronization method for real-time Ethernet
Krummacker et al. Intra-network clock synchronization for wireless networks: From state of the art systems to an improved solution
WO2018098791A1 (en) Clock synchronization frequency deviation estimation method applicable to multi-hop wireless sensor network
CN111885694B (en) Air self-organizing network time synchronization system
So et al. MTSF: A timing synchronization protocol to support synchronous operations in multihop wireless networks
CN111867042B (en) MESH network synchronization method with time difference detection function
CN108924922B (en) Chain synchronization time synchronization method of WSN (Wireless sensor network) cluster topology
CN114584246B (en) FPGA-based wireless ad hoc network time synchronization method, system and medium
Rentel et al. Network synchronization in wireless ad hoc networks
Brown III et al. Non-hierarchical clock synchronization for wireless sensor networks
Shen et al. Clapping and broadcasting synchronization in wireless sensor networks
CN107343314B (en) Time synchronization method and device of wireless sensor network
Guo et al. Fast layered-synchronization algorithm for adhoc networks
CN111787607B (en) Method for improving synchronization precision of ad hoc network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant