Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a time synchronization system and a time synchronization method of an adaptive networking based on ultra-wideband wireless communication, and the system and the method are used for performing time synchronization on unsynchronized nodes in an adaptive hierarchical processing mode among the nodes on the basis of bidirectional communication. The invention adopts the following technical scheme:
the invention provides a time synchronization system of self-adaptive networking based on ultra-wideband wireless communication in a first aspect, which comprises: the node equipment comprises at least one main node and at least one slave node, wherein different main nodes are connected through wires, and the main nodes are connected with the slave nodes and/or the slave nodes are connected with the slave nodes through ultra-wideband wireless communication; the slave nodes comprise slave nodes which complete time synchronization and slave nodes which do not complete time synchronization, the slave nodes which do not complete time synchronization receive broadcast information of all surrounding nodes, at least 1 node is selected from the currently received broadcast information according to a preferred mechanism, time synchronization is initiated to the preferred at least 1 node, and meanwhile time synchronization can be provided for a plurality of slave nodes which are not larger than the level of the node.
Furthermore, the master node comprises a reference transmitting module, a reference receiving module, a reference processing module and a reference time unit; the reference transmitting module broadcasts reference frame information periodically by taking a local clock as a reference; the reference receiving module receives broadcast information of all nodes around the main node; the reference processing module is used for processing the received broadcast information, analyzing the time information of the slave node and calculating the time deviation and the distance value between the slave node and the master node; the reference time unit takes a local clock as a reference clock.
Furthermore, the slave node comprises a synchronous transmitting module, a synchronous receiving module, a synchronous processing module and a synchronous time unit; the synchronous transmitting module broadcasts synchronous frame information by a slave node transmitting mechanism; the synchronous receiving module receives broadcast information of all nodes around the node; the broadcast information comprises reference frame information of a main node and/or synchronous frame information of a slave node; the synchronous processing module is used for processing the received broadcast information, analyzing the time information of the master node and/or the slave node, calculating the time difference information between the slave node and the master node, and updating the synchronous frame information at the next transmission moment; and the synchronization time unit disciplines the local clock by using the time difference information of the current node and the main node to complete the time synchronization with the main node.
Furthermore, the slave node transmitting mechanism is that the slave node broadcasts the synchronization frame information of the current node after delaying the time of the product of the current slave node number and the single node transmitting interval by taking the transmitting time of the master node as a starting point in one transmitting period of the master node.
Further, the preferred mechanism performs screening according to the principle of simultaneously satisfying the node grade principle, the reliability principle and the distance principle; the node grade principle is a node with the highest priority node grade; the reliability principle is that the nodes with the success rate of receiving node information needing to meet a preset threshold value are optimized; the distance principle is that the closest node is preferably selected from the nodes of the same node level.
The invention also provides a time synchronization method of the self-adaptive networking based on the ultra-wideband wireless communication, wherein the time synchronization information is interacted between the main node and the slave node to obtain the clock information of the reference node, and the time synchronization information is transmitted through the ultra-wideband wireless channel, wherein the time synchronization information is interacted between the main node and the slave node to obtain the clock information of the reference node, and the time synchronization method specifically comprises the following steps:
s1: the master node broadcasts the transmission time t1 of the current broadcast through an ultra-wideband wireless channel;
s2: the slave node receives the broadcast information of the master node, acquires t1 in the broadcast information, and records the receiving time of the current broadcast information ast 2;
s3: broadcasting the transmission time t3 of the current broadcast and the t1 and t2 from the node through an ultra-wideband wireless channel;
s4: the main node receives the broadcast information of the slave nodes, acquires t1, t2 and t3 in the broadcast information, records the receiving time of the current broadcast information as t4, and calculates the time offset and the distance value according to t1, t2, t3 andt 4;
s5: the main node broadcasts the current broadcast transmitting time t5 of the node, the time offset and the distance value through an ultra-wideband wireless channel;
s6: the slave node receives the broadcast information of the master node, acquires t5, time offset and a distance value in the broadcast information, records that the receiving time of the current broadcast information is t6, and calculates the time change offset according to t1, t2, t5 and t6 for local clock taming.
Further, the master node may interact with a plurality of slave nodes for time synchronization information.
Further, the master node may be a synchronized slave node.
Further, the slave node may exchange time synchronization information with at least 1 master node.
Further, the slave node includes a synchronized slave node or an unsynchronized slave node.
Compared with the prior system and method, the invention has the advantages that:
1. the time synchronization system and the method of the self-adaptive networking based on the ultra-wideband wireless communication can realize the long-distance node time synchronization through the gradual downward synchronization.
2. The time synchronization system and method based on the self-adaptive networking of the ultra-wideband wireless communication, which are provided by the invention, have the advantages of convenience in installation, flexibility in networking, good expandability and low deployment cost.
Detailed Description
The embodiment of the invention provides a time synchronization system and a time synchronization method for self-adaptive networking based on ultra-wideband wireless communication.
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention will be described in further detail below with reference to the drawings and specific examples.
In an embodiment of the present invention, a time synchronization system for adaptive networking based on ultra-wideband wireless communication is provided, as shown in fig. 2, including a plurality of node devices at different node levels, where the node devices include at least one master node and at least one slave node, different master nodes are connected by wire, and the master node is connected with the slave node and/or the slave node is connected with the slave node by ultra-wideband wireless communication; the slave nodes comprise slave nodes which complete time synchronization and slave nodes which do not complete time synchronization, the slave nodes which do not complete time synchronization receive broadcast information of all surrounding nodes, at least 1 node is selected from the currently received broadcast information according to a preferred mechanism, time synchronization is initiated to the preferred at least 1 node, and meanwhile time synchronization can be provided for a plurality of slave nodes which are not larger than the level of the node. The node equipment comprises a plurality of node equipment of different node levels, wherein the node equipment comprises two main nodes and a plurality of slave nodes; if the node grade of the main node is highest, the serial number is 0; in order to prevent the master nodes from failing to cause system breakdown, two master nodes are adopted to send synchronization information to the slave nodes, and the master nodes are connected through awire 30 in order to ensure time same frequency synchronization between the master nodes; the master node broadcasts the reference frame information to provide time synchronization information for surrounding slave nodes, and themaster node 1 can provide time synchronization information for theslave nodes 1 and 2 which are close to each other under the limitation of ultra-wideband transmission distance; theslave node 1 receives information of all surrounding nodes, initiates time synchronization to themaster node 1 and themaster node 2, takes themaster node 1 as a master calibration node and takes themaster node 2 as a backup calibration node according to an optimal mechanism, disciplines a clock of the slave node according to the time information of the master calibration node, completes the time synchronization with themaster node 1, does not process the time information of the backup calibration node, and performs the clock discipline of the slave node by using the time information of the backup calibration node when the master calibration node is abnormal, thereby completing the time synchronization with themaster node 2. The node level of thesynchronized slave node 1 is 1, and time synchronization can be provided for theslave node 2 and theslave node 3; theslave node 2 takes themaster node 1 as a master calibration node and theslave node 1 as a backup calibration node according to a preferred mechanism, the node level of thesynchronized slave node 2 is 1, and time synchronization information can be provided for theslave node 3 and theslave node 4; and so on until all the slave nodes complete the time synchronization and node level assignment. The different node grades are set as the highest node grade of the master node, the grade is 0, the lowest node grade of the slave node which does not complete time synchronization is x, the node grade of the slave node which completes time synchronization with the master node after receiving the information of the master node is added with 1 on the basis of the node grade of the master node, the node grade is 1, the node grade of the slave node which completes time synchronization after receiving the information of the slave node of thenode grade 1 is added with 1 on the basis of thenode grade 1, and the node grade is 2 until all the slave nodes n complete node grade distribution. The setting of the rank is not limited to 0 and x, and may be set by user selection or may be set to another numerical value or code. The system comprises at least one main node and at least one slave node, wherein the transmission time of the main node is taken as the basis, and in order to prevent the conflict of the transmission time of each node, the transmission time of other slave nodes is based on local identification; other slave nodes adaptively select the synchronized node to perform time synchronization according to a grade principle, a reliability principle and a distance principle in the system, and after the time synchronization between the slave nodes and the synchronized node is completed, the slave nodes send synchronization information to adjacent nodes until all the nodes are synchronized.
In order to ensure the time synchronization of the nodes in the serial, the synchronization process of the synchronized nodes and the unsynchronized slave nodes is mainly divided into the following two aspects:
1) the master calibration node and the slave node carry out data interaction through the ultra-widebandwireless communication 10;
2) the backup calibration node and the slave node interact data via ultra-widebandwireless communication 20.
The serial network topology structure is suitable for long and narrow environments such as tunnels.
In another embodiment of the present invention, as shown in fig. 3, the node device includes a plurality of node devices of different node levels, where the node devices include 2 master nodes and a plurality of slave nodes arranged in a mesh; the node with the different node grade as the master node has the highest grade and is numbered as 0, and the synchronous information is transmitted to the adjacent slave nodes; the information received by the slave node mainly comes from the main calibration node and the backup calibration node, and self-adaptive grading is carried out according to different environments to finish time synchronization; in order to ensure the time same frequency synchronization among the main nodes, the main nodes are connected through awire 30, and the design of 2 main nodes can effectively prevent the catastrophic influence on the whole system when one main node is abnormal; the master node broadcasts the reference frame information to provide time synchronization information for surrounding slave nodes, and themaster node 1 can provide time synchronization information for theslave nodes 1, 7 and 10 which are close to each other under the limitation of ultra-wideband transmission distance; theslave node 7 receives information of all surrounding nodes, initiates time synchronization to themaster node 1 and themaster node 2, takes themaster node 1 as a master calibration node and takes themaster node 2 as a backup calibration node according to an optimal mechanism, disciplines the clock of the slave node according to the time information of the master calibration node, completes the time synchronization with themaster node 1, does not process the time information of the backup calibration node, and performs the clock discipline of the slave node by using the time information of the backup calibration node when the master calibration node is abnormal, thereby completing the time synchronization with themaster node 2. The node level of thesynchronized slave node 7 is 1, and time synchronization can be provided for theslave node 8 and theslave node 11; theslave node 8 takes theslave node 7 as a main calibration node and theslave node 10 as a backup calibration node according to a preferred mechanism, the node level of thesynchronized slave node 8 is 2, and time synchronization information can be provided for theslave node 9 and theslave node 12; the time synchronization with theslave node 8 is completed by theslave node 12 according to the optimized mechanism, the time information of the backup calibration node is not processed, when the master calibration node is abnormal, the time information of the backup calibration node is used for domesticating the clock of the slave node, and the time synchronization with theslave node 9 is completed. When theslave node 12 completes the time synchronization, the node level of theslave node 12 is 3; when theslave node 12 cannot receive the information of theslave node 8, the master calibration node of theslave node 12 is switched to theslave node 9, the node level is changed to 4, and thesynchronized slave node 12 can provide time synchronization information to theslave node 16; and so on until all the slave nodes complete the time synchronization and node level assignment.
In order to ensure the time synchronization of nodes in the mesh, the synchronization process of the synchronized nodes and the unsynchronized slave nodes is mainly divided into the following two aspects:
1) the master calibration node and the slave node carry out data interaction through the ultra-wideband wireless 10;
2) the backup calibration node and the slave node perform data interaction through the ultra-wideband wireless 20.
The net-shaped arrangement structure is suitable for complex environments such as underground parking lots, shopping malls and the like.
When the slave node receives the reference frame information, the node grade of the slave node is 1; when the slave node completes synchronization, the node level of the slave node is equal to the node level number plus 1 in the received synchronization frame data. After successfully receiving the reference frame information of the master node or the synchronous frame information of the slave nodes completing synchronization, starting to initiate clock synchronization to the two nodes with the highest node level in the received information, receiving the broadcast information of all the nodes around by the synchronous slave nodes, selecting the optimal two nodes from the currently received information according to an optimal mechanism, and initiating time synchronization to the two nodes, wherein one of the two nodes is a master calibration node, and the other node is a backup calibration node. The optimal node selection mechanism performs general selection according to the principle that a node grade principle, a reliability principle and a distance principle are simultaneously met, wherein the node grade principle is a node with the highest priority node grade; the reliability principle depends on the comparison between the receiving success rate and a preset threshold, the receiving success rate needs to be counted by a short observation period, the receiving times and the non-receiving times are counted, and the reliability principle is finally calculated, when the receiving success rate is larger than or equal to the preset threshold, the node is determined to be reliable, the value is 1, the time synchronization request can be initiated, otherwise, the node is unreliable, the value is 0, and the time synchronization request cannot be initiated; the distance rule indicates that when there are a plurality of nodes of the same node level, a node closest to the node is preferable.
Determining whether node information needs to be exchanged according to a judgment condition of a preferred mechanism, wherein a specific scheme of the preferred mechanism is shown in table 1, wherein a1 and a2 respectively represent node level numbers of primary calibration and backup calibration; b1 and B2 respectively represent the reliability marks of the main calibration and the backup calibration, and when the reliability is equal to 1, the mark represents reliable, otherwise, the mark is unreliable; c1, C2 represent the distance of the calibration and backup calibration, respectively, from the sync base station.
TABLE 1
| Rank comparison | Reliability of | Distance comparison | Whether to switch |
| A1<A2 | B1=1B2=1 | Is irrelevant | Whether or not |
| A1<A2 | B1=0B2=1 | Is irrelevant | Is that |
| A1<A2 | B1=0B2=0 | C1>C2 | Is that |
| A1<A2 | B1=1B2=0 | Is irrelevant | Whether or not |
| A1=A2 | B1=1B2=1 | Is irrelevant | Whether or not |
| A1=A2 | B1=0B2=1 | Is irrelevant | Is that |
| A1=A2 | B1=0B2=0 | C1>C2 | Is that |
| A1=A2 | B1=1B2=0 | Is irrelevant | Whether or not |
| A1>A2 | B1=1B2=1 | Is irrelevant | Is that |
| A1>A2 | B1=0B2=0 | C1>C2 | Is that |
| A1>A2 | B1=0B2=1 | Is irrelevant | Is that |
| A1>A2 | B1=1B2=0 | Is irrelevant | Whether or not |
The slave nodes perform time synchronization step by step through step processing, and the distance of the time synchronization processing of the network nodes is expanded; and two optimal nodes for completing time synchronization are selected for time synchronization processing, so that the time synchronization precision is improved.
An embodiment of a host node according to the present invention is described below, and fig. 4 shows a schematic diagram of the embodiment, where the host node includes: the device comprises a reference transmitting module, a reference receiving module, a reference processing module and a reference time unit;
the reference transmitting module broadcasts reference frame information periodically by taking a local clock as a reference;
the reference receiving module receives broadcast information of all nodes around the main node;
the reference processing module is used for processing the received broadcast information, analyzing the time information of the slave node, calculating the time difference between the slave node and the master node, and updating the reference frame information at the next transmission moment;
the reference time unit takes a local clock as a reference clock.
An embodiment of a slave node provided in the implementation of the present invention is described below, and fig. 5 shows a schematic diagram of the embodiment, where the slave node includes: the device comprises a synchronous transmitting module, a synchronous receiving module, a synchronous processing module and a synchronous time unit;
the synchronous transmitting module broadcasts synchronous frame information by a slave node transmitting mechanism;
the synchronous receiving module receives broadcast information of all nodes around the node;
the broadcast information comprises reference frame information of a main node and/or synchronous frame information of a slave node;
the synchronous processing module is used for processing the received broadcast information, analyzing the time information of the master node and/or the slave node, calculating the time difference information between the slave node and the master node, and updating the synchronous frame information at the next transmission moment;
and the synchronization time unit disciplines the local clock by using the time difference information of the current node and the main node to finish time synchronization with the main node.
An embodiment of a method for time synchronization of an adaptive networking based on ultra-wideband wireless communication according to an embodiment of the present invention is described below, and fig. 6 shows a flowchart of the embodiment, where the method includes:
s1: the master node broadcasts the transmission time t1 of the current broadcast through an ultra-wideband wireless channel;
s2: the slave node receives the broadcast information of the master node, acquires t1 in the broadcast information, and records the receiving time of the current broadcast information ast 2;
s3: broadcasting the transmission time t3 of the current broadcast and the t1 and t2 from the node through an ultra-wideband wireless channel;
s4: the main node receives the broadcast information of the slave nodes, acquires t1, t2 and t3 in the broadcast information, records the receiving time of the current broadcast information as t4, and calculates the time offset and the distance value according to t1, t2, t3 and t4, wherein the time offset calculation formula is
The distance value is calculated by the formula
c is the speed of light;
s5: the main node broadcasts the current broadcast transmitting time t5 of the node, the time offset and the distance value through an ultra-wideband wireless channel;
s6: the slave node receives the broadcast information of the master node, acquires t5, time offset and a distance value in the broadcast information, records that the receiving time of the current broadcast information is t6, and calculates the time change offset according to t1, t2, t5 and t6 for local clock taming.
In this embodiment, the master node may interact with a plurality of slave nodes to provide time synchronization for the plurality of slave nodes, so that the cascade hierarchy of the entire system may be effectively reduced, and the time synchronization accuracy of the entire system may be improved.
In this embodiment, the master node may be a synchronized slave node. The synchronized slave node can be used as a master node to synchronize other slave nodes.
In this embodiment, the slave node can interact time synchronization information with more than 2 master nodes at the same time, so as to realize synchronous backup and increase the flexibility of system arrangement;
fig. 5 shows that the master node and the slave node interact time synchronization information in the entire time synchronization method, where t1, t4, and t5 are time values recorded by the clock of the master node, and t2, t3, and t6 are time values recorded by the clock of the slave node.
In this embodiment, in step S4, the distance value between two nodes can be used to select two optimal nodes from the nodes to initiate the judgment condition of time synchronization.
In the present embodiment, in step S6, the time variation amount of the master node is t1-t5The time variation of the slave node is t2-t6Then the time-varying offset of the two-node interaction is ((t)1-t5)-(t2-t6) Using the offset for local clock discipline, updating the time change offset through continuous bidirectional communication between the master node and the slave node, and using the time change offset for time adjustment of the slave node to ensure the time of the slave nodeTime synchronization with the master node.
In another embodiment, the slave node includes a synchronized slave node or an unsynchronized slave node, for example, as shown in fig. 3, theslave node 7 may exchange time synchronization information with themaster node 1, may also exchange time synchronization information with slave nodes such as theslave node 8 and theslave node 9, and thesynchronized slave node 7 has a node level of 1 and may provide time synchronization to theslave node 8 and theslave node 11; theslave node 8 takes theslave node 7 as a main calibration node and theslave node 10 as a backup calibration node according to a preferred mechanism, the node level of thesynchronized slave node 8 is 2, and time synchronization information can be provided for theslave node 9 and theslave node 12; the time synchronization with theslave node 8 is completed by theslave node 12 according to the optimized mechanism, the time information of the backup calibration node is not processed, when the master calibration node is abnormal, the time information of the backup calibration node is used for domesticating the clock of the slave node, and the time synchronization with theslave node 9 is completed. When theslave node 12 completes the time synchronization, the node level of theslave node 12 is 3; when theslave node 12 cannot receive the information of theslave node 8, the master calibration node of theslave node 12 is switched to theslave node 9, the node level is changed to 4, and thesynchronized slave node 12 can provide time synchronization information to theslave node 16; and so on until all the slave nodes complete the time synchronization and node level assignment. Thereby improving the flexibility of slave node arrangement.
In conclusion, the time synchronization system based on the ultra-wideband wireless communication adaptive networking breaks through the limitation of a node communication system in wired connection, can randomly place the positions of nodes, improves the flexibility and convenience of node arrangement, improves the precision of time synchronization, and can be applied to a plurality of scenes, such as tunnels, parking lots, markets and the like.
Although the present invention has been described with reference to the preferred embodiments, it is not intended to be limited thereto. Those skilled in the art can make numerous possible variations and modifications to the present invention, or modify equivalent embodiments to equivalent variations, without departing from the scope of the invention, using the teachings disclosed above. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical spirit of the present invention should fall within the protection scope of the technical scheme of the present invention, unless the technical spirit of the present invention departs from the content of the technical scheme of the present invention.