WO2024124755A1 - Synchronization method and apparatus for wireless mesh network, and electronic device - Google Patents
Synchronization method and apparatus for wireless mesh network, and electronic device Download PDFInfo
- Publication number
- WO2024124755A1 WO2024124755A1 PCT/CN2023/087765 CN2023087765W WO2024124755A1 WO 2024124755 A1 WO2024124755 A1 WO 2024124755A1 CN 2023087765 W CN2023087765 W CN 2023087765W WO 2024124755 A1 WO2024124755 A1 WO 2024124755A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- execution time
- mesh network
- relative execution
- mesh
- network node
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 238000012545 processing Methods 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 6
- 230000006870 function Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 10
- 230000001360 synchronised effect Effects 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 230000009471 action Effects 0.000 description 5
- 230000001052 transient effect Effects 0.000 description 5
- 239000013078 crystal Substances 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000003111 delayed effect Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000009434 installation Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 241000723369 Cocculus trilobus Species 0.000 description 1
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 239000003999 initiator Substances 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 230000008054 signal transmission Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W56/00—Synchronisation arrangements
- H04W56/001—Synchronization between nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W84/00—Network topologies
- H04W84/02—Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
- H04W84/10—Small scale networks; Flat hierarchical networks
- H04W84/12—WLAN [Wireless Local Area Networks]
-
- 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
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Definitions
- the present application relates to the technical field of wireless mesh networks, for example, to a synchronization method and device, and electronic equipment for wireless mesh networks.
- Wireless mesh network is a high-capacity, high-bandwidth distributed network. It can be regarded as the integration of wireless local area network (WLAN) and Ad hoc mobile self-organizing network, and it brings out the advantages of both.
- WLAN wireless local area network
- Ad hoc mobile self-organizing network In a large-capacity Bluetooth Mesh network, due to the large coverage area, a group control command message needs to be relayed by multiple Mesh network nodes before it can reach the farthest node. No matter how the relay strategy of the Mesh network node is optimized, it takes time to receive, process and relay messages. After multiple relays, this time will increase exponentially, resulting in the inability of devices in the Mesh network to receive Mesh control messages in the same time.
- the coverage area of the Mesh network is large, it will cause the inconsistency of the device responses of the Mesh network nodes that can be seen by the naked eye. For example, if all the lights are turned on, if the coverage area of the Mesh network is large, it can be clearly seen that the lights are turned on in batches from near to far, rather than at the same time as can be seen by the naked eye.
- the Bluetooth Mesh network uses absolute time for network synchronization. If the device of the Mesh network node cannot quickly resynchronize the network clock after power failure and power-on again, it is easy to cause the device of the Mesh network node to fail to accurately achieve synchronization operation.
- the embodiments of the present disclosure provide a synchronization method and device, and an electronic device for a wireless mesh network, which use a relative time method to implement synchronization operations of Mesh control messages, thereby improving the accuracy of synchronization operations implemented by devices at Mesh network nodes.
- a synchronization method for a wireless mesh Mesh network includes: obtaining an external relative execution time in a Mesh control message received by the Mesh network node; obtaining an internal relative execution time saved by the Mesh network node; and when the external relative execution time is less than the internal relative execution time, correcting the internal relative execution time.
- a synchronization device for a wireless mesh network includes a processor and a memory storing program instructions, and the processor is configured to execute the aforementioned synchronization method for a wireless mesh network when executing the program instructions.
- the electronic device includes: an electronic device body; and the aforementioned synchronization device for a wireless mesh network, which is installed in the electronic device body.
- FIG1 is a schematic diagram of a flow chart of a synchronization method for a wireless mesh network provided by an embodiment of the present disclosure
- FIG2 is a flow chart of another synchronization method for a wireless mesh network provided by an embodiment of the present disclosure
- FIG3 is a flow chart of another synchronization method for a wireless mesh network provided by an embodiment of the present disclosure.
- FIG4 is a flow chart of another synchronization method for a wireless mesh network provided by an embodiment of the present disclosure.
- FIG5 is a flow chart of another synchronization method for a wireless mesh network provided by an embodiment of the present disclosure.
- FIG6 is a scenario diagram of a synchronization method for a wireless mesh network provided by an embodiment of the present disclosure
- FIG7 is a scenario diagram of another synchronization method for a wireless mesh network provided by an embodiment of the present disclosure.
- FIG8 is a schematic diagram of the structure of a synchronization device for a wireless mesh network provided by an embodiment of the present disclosure
- FIG. 9 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure.
- the term “plurality” means two or more than two.
- the character "/" indicates that the objects before and after are in an "or” relationship.
- A/B means: A or B.
- the term “and/or” is a description of the association relationship between objects, indicating that three relationships may exist.
- a and/or B means: A or B, or, the three relationships of A and B.
- the term "corresponding" may refer to an association relationship or a binding relationship, and the correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
- Wireless mesh network is also called "multi-hop network". It is a dynamic and continuously expandable network architecture that realizes transmission between wireless devices. A large number of mesh network nodes (terminal devices of mesh network nodes) in the mesh network can automatically connect to form a mesh structure through wireless. Each mesh network node in the network can only communicate with adjacent mesh network nodes. Therefore, it is a self-organizing and self-managing intelligent network. It can build a flexible network without a backbone network.
- the core idea to solve the problem of consistent response of Mesh network nodes is clock synchronization and delayed execution, that is, the Mesh control message sent is a delayed execution message, and the Mesh control message contains the specific value of the delay time.
- the synchronization scheme of Bluetooth Mesh network uses absolute time for synchronization, and the master node needs to periodically send synchronization signals to synchronize the entire Mesh network.
- Mesh network uses absolute time for synchronization, and the synchronization signal will increase the load of the Mesh network. If the synchronization message and the control message conflict, the possibility of control failure will increase.
- the Mesh network node needs to quickly resynchronize the network clock to achieve good synchronization control of the Mesh network.
- the Mesh network uses relative time to synchronize control messages.
- the Mesh network control message does not calibrate the absolute time, but contains relative time, with the moment when the Mesh network control message is received as the anchor point.
- the Mesh network node starts to use the crystal oscillator to time when it receives the Mesh network control message, executes the action when the delay time (relative time) arrives, and continuously monitors the Mesh network control message in the air.
- an embodiment of the present disclosure provides a synchronization method for a wireless mesh network, wherein the mesh network includes a plurality of mesh network nodes connected to each other, and the synchronization method includes the following steps:
- S101 Obtaining an external relative execution time in a Mesh control message received by a Mesh network node.
- a Mesh network node When a Mesh network node receives a Mesh control message relayed by a mobile phone or other Mesh network node, it extracts the relative execution time (also called delay time or execution time) in the Mesh control message.
- the relative execution time in the message is the internal relative execution time; when the Mesh network node receives the Mesh control message relayed by the mobile phone or other Mesh network nodes again, the relative execution time in the Mesh control message is extracted as the external relative execution time.
- the broadcast data structure of the Mesh control message includes a Mesh protocol structure and a timestamp located after the Mesh protocol structure.
- the Mesh protocol structure of the Mesh control message includes the model layer (Model Layer), foundation model layer (Foundation Model Layer), access layer (Access Layer), upper transport layer (Upper Transport Layer), lower transport layer (Lower Transport Layer), network layer (Network Layer), bearer layer (Bearer Layer) and Bluetooth low energy core specification layer (Bluetooth Low Energy Core Specification) which are electrically connected in sequence.
- the Mesh control message will be encrypted and obfuscated by the Mesh network relay nodes during the relay process.
- the Mesh network receiving nodes need to decrypt and modify the message layer by layer to obtain the delay time in the Mesh control message and achieve network synchronization. This increases the burden of the Mesh protocol, reduces the relay efficiency, and destroys the architecture of the Mesh protocol.
- obtaining the external relative execution time in the Mesh control message received by the Mesh network node includes: identifying the timestamp in the broadcast data structure of the Mesh control message; obtaining the relative execution time in the execution time byte of the timestamp; and using the relative execution time in the execution time byte of the timestamp as the external relative execution time.
- the external relative execution time (delay time) in the timestamp is used to update the internal relative execution time saved by the Mesh network node to achieve time synchronization of the Mesh network.
- delay time time in the broadcast data structure of the Mesh control message
- the Mesh network receiving node since the timestamp is set separately in the Mesh protocol structure, the Mesh network receiving node does not need to decrypt and modify it layer by layer, and can directly and timely obtain the external relative execution time in the timestamp to complete network synchronization, thereby improving the accuracy of the device synchronization operation of the Mesh network node.
- the internal relative execution time is stored in the internal variables of the Mesh network node.
- the Mesh network node continuously updates the relative execution time according to the internal system clock, such as starting the timer and the minimum period interrupt. Each time the interrupt is triggered, the relative execution time stored in the internal variable is subtracted from the interrupt period to obtain the updated relative execution time, which is then updated to the internal variables of the Mesh network node.
- the main control node of the Mesh network (the initiator of the Mesh network synchronization) sends multiple (e.g., 8) repeated control packets (Mesh control messages) to improve the control success rate of the Mesh network synchronization.
- the repeated control packets are sent serially, and the interval between each two adjacent repeated control packets is a preset time (e.g., the preset time range is between 20-30ms). Since there is a time gap between the first repeated control packet and the last repeated control packet (e.g., a maximum difference of 210ms), it will cause errors in the control consistency of the devices of the Mesh network nodes.
- the mobile phone main control node of the Mesh network
- 8 repeated control packets (Mesh control messages) at preset intervals, where the external relative execution time of the 8 Mesh control messages is 200ms.
- the relay time inside the Mesh network node is 20ms.
- the external relative execution time of the first Mesh control message sent by the mobile phone received by Mesh network node 1 is 200ms
- the external relative execution time of the first Mesh control message relayed by Mesh network node 1 received by Mesh network node 2 is 180ms
- the external relative execution time of the first Mesh control message relayed by Mesh network node 2 received by Mesh network node 3 is 160ms
- the external relative execution time of the first Mesh control message relayed by Mesh network node 3 received by Mesh network node 4 is 140ms
- the external relative execution time of the first Mesh control message relayed by Mesh network node 4 received by Mesh network node 5 is 120ms
- the external relative execution time of the first Mesh control message relayed by Mesh network node 5 received by Mesh network node 6 is 100ms.
- the external relative execution time in the fourth Mesh control message sent by the mobile phone received by Mesh network node 7 is 200ms
- the external relative execution time in the fourth Mesh control message relayed by Mesh network node 7 received by Mesh network node 6 is 180ms
- the external relative execution time in the first Mesh control message relayed by Mesh network node 6 received by Mesh network node 5 is 160ms.
- the external relative execution time received in the fourth Mesh control message is 200ms, but this Mesh control message has been delayed by 60ms (taking the preset duration as 20ms as an example).
- the received external relative execution time of 100ms is less than the saved internal relative execution time of 160ms, so the saved internal relative execution time is corrected (to 100ms).
- the mesh network node needs to continuously detect the external relative execution time in the subsequent mesh control message, and correct the internal relative execution time when the external relative execution time is less than the internal relative execution time, thereby improving the consistency of mesh network synchronization.
- correcting the internal relative execution time includes: obtaining an actual time interval between the external relative execution time and the internal relative execution time; and correcting the internal relative execution time when the actual time interval is less than a time interval threshold.
- the value range of the time interval threshold can be [80ms, 100ms], for example, 80ms, 85ms, 90ms, 95ms, 100ms.
- the Mesh network node executes the action, thereby improving the accuracy and consistency of Mesh network synchronization.
- T 21 is the corrected internal relative execution time
- T 1 is the external relative execution time
- T 01 is the first internal processing time of the Mesh network node
- T s1 is the first random delay time.
- the acquired external relative execution time T1 is 100ms
- the first internal processing time T01 of the Mesh network node is 20ms
- the first random delay time Ts1 is 2ms
- the external relative execution time, the first internal processing time and the first random delay time are used to correct the internal relative execution time saved by the Mesh network node, thereby improving the accuracy of the internal relative execution time.
- the Mesh network node uses the corrected internal relative execution time to perform synchronous update of the Mesh network, thereby improving the consistency of synchronous update of the Mesh network.
- the external relative execution time is compared with the internal relative execution time saved by the Mesh network node, and when the external relative execution time is less than the internal relative execution time, the internal relative execution time is corrected in time.
- the synchronization operation of the Mesh network node is realized by using the relative time method, the Mesh network node uses the internal crystal oscillator for timing, and the device of the Mesh network node does not need to quickly resynchronize the network clock after power failure and power on again, which can improve the accuracy of the synchronization operation of the device of the Mesh network node in the Mesh network.
- an embodiment of the present disclosure provides a synchronization method for a wireless mesh network, wherein the mesh network includes a plurality of mesh network nodes connected to each other, and the synchronization method includes the following steps:
- S201 Obtaining an external relative execution time in a Mesh control message received by a Mesh network node.
- the value range of the second random delay time T s2 is 1-10 ms, for example, 2 ms, 3 ms, 7 ms, and 10 ms.
- T 31 is the corrected relay relative execution time
- T 1 is the external relative execution time
- T 02 is the second internal processing time of the Mesh network node
- T s1 is the first random delay time
- the acquired external relative execution time T1 is 100ms
- the second internal processing time T02 of the Mesh network node is 30ms
- the first random delay time Ts1 is 2ms
- the relay Mesh control message can be effectively prevented from colliding with other control messages.
- the external relative execution time, the second internal processing time and the first random delay time are used to correct the relay relative execution time in the Mesh network relay node, thereby improving the accuracy of the relay relative execution time.
- the Mesh network relay node After the Mesh network relay node corrects the relay relative execution time in the relay Mesh control message of the Mesh network node, it forwards the modified relay Mesh control message to other Mesh network nodes.
- the Mesh network node when the Mesh network node is a relay node, by adding a second random delay time, it is possible to effectively avoid the relay Mesh control message from colliding with other control messages.
- the relay relative execution time in the relay Mesh control message of the Mesh network node is corrected.
- the next Mesh network node uses the corrected relay relative execution time (i.e., the external relative execution time in the Mesh control message received by the next Mesh network node) to perform synchronous update of the Mesh network, thereby improving the accuracy and consistency of synchronous update of the Mesh network.
- an embodiment of the present disclosure provides a synchronization method for a wireless mesh network, wherein the mesh network includes a plurality of mesh network nodes connected to each other, and the synchronization method includes the following steps:
- S301 Obtaining an external relative execution time in a Mesh control message received by a Mesh network node.
- the mesh network node After the mesh network node parses and determines the external relative execution time in the mesh control message, it compares it with the saved internal The relative execution time is compared. If the external relative execution time is less than the internal relative execution time, and the actual time interval between the external relative execution time and the internal relative execution time is less than the time interval threshold, the internal relative execution time is corrected; if the external relative execution time is less than the internal relative execution time, and the actual time interval between the external relative execution time and the internal relative execution time is greater than the time interval threshold, it indicates that the Mesh control message containing the external relative execution time is very likely to be an interference message caused by the retransmission of the previous Mesh control message, and the received Mesh control message is discarded; if the external relative execution time is greater than the internal relative execution time, it indicates that the Mesh control message containing the first relative execution message is interference information caused by retransmission, and the received Mesh control message is discarded. In this way, the Mesh network node is prevented from correcting its stored internal relative execution time
- an embodiment of the present disclosure provides a synchronization method for a wireless mesh network, wherein the mesh network includes a plurality of mesh network nodes connected to each other, and the synchronization method includes the following steps:
- S401 Obtain a Mesh control message received by a Mesh network node; wherein the broadcast data structure of the Mesh control message includes a Mesh protocol structure and a timestamp after the Mesh protocol structure.
- the timestamp includes a first preset number of byte length (length) bytes, a second preset number of byte type (AD Type) bytes, and a third preset number of byte execution time (timestamp) bytes.
- the format of the timestamp is 4 bytes
- the first preset byte number is 1 byte
- the second preset byte number is 1 byte
- the third preset byte number is 2 bytes.
- the format of the 4-byte timestamp can be: length (1 byte) + AD Type (1 byte) + timestamp (2 bytes).
- the Bluetooth Mesh protocol is implemented based on Bluetooth Low Energy (BLE) broadcasting.
- BLE Bluetooth Low Energy
- the data broadcast by BLE is composed of one or more AD structures (AD Struct).
- the Mesh control message can be considered as an independent AD Struct. Due to its complex hierarchical structure, the payload left for the access layer is only 11 bytes at most. When the word count of the access layer payload is 11 bytes, the BLE broadcast data has reached the maximum value (31 bytes) and can no longer accommodate the next AD Struct. Therefore, a 4-byte AD Struct is added to the broadcast data structure of the Mesh control message to represent the timestamp.
- the Mesh control message of the custom model can only support up to 7 bytes. Excluding the 3-byte custom opcode (vendor opcode), only 4 bytes of parameter payload are left. After evaluation and analysis, the 4-byte parameter payload can also meet the execution requirements of common Mesh network node devices (such as wall switches, lamps or sensors) after compression. Therefore, it is proved that the broadcast data structure of the Mesh control message (7-byte access layer Mesh protocol structure + 4-byte timestamp) is feasible.
- the 4-byte parameter payload is as follows: transaction code Tid (1 byte) + brightness Lightness (1 byte) + hue Hue (1 byte) + saturation Saturation (1 byte).
- transaction code Tid that is, transaction id
- the three HLS parameters that control color originally require 2 bytes to represent, but the control granularity of 256 can already meet user needs and will not affect the user experience, so it can be represented by 1 byte.
- the design of the timestamp format in the embodiment of the present disclosure without affecting the original implementation function of the Mesh control message, because the timestamp is set separately in the Mesh protocol structure, the Mesh network receiving node does not need to decrypt and modify layer by layer, and can directly and timely obtain the external relative execution time in the timestamp, and then complete network synchronization, thereby improving the accuracy of the device synchronization operation of the Mesh network node.
- S402 Determine the external relative execution time in the timestamp.
- determining the external relative execution time in the timestamp includes: identifying the timestamp in the broadcast data structure of the Mesh control message; obtaining the relative execution time in the execution time byte of the timestamp; and using the relative execution time in the execution time byte of the timestamp as the external relative execution time.
- the receiving nodes of the Mesh network do not need to decrypt and modify layer by layer.
- the accuracy of the external relative execution time in the obtained timestamp is improved, thereby improving the accuracy of the device synchronization operation of the Mesh network nodes.
- S403 Correcting the internal relative execution time stored in the Mesh network node according to the external relative execution time.
- the internal relative execution time saved by the Mesh network node is corrected according to the external relative execution time, including: when the external relative execution time is less than the internal relative execution time, correcting the internal relative execution time.
- the Mesh network node After receiving the Mesh control message for the first time and saving the external relative execution time in the Mesh control message, the Mesh network node continuously detects the external relative execution time in subsequent Mesh control messages, and corrects the internal relative execution time when the external relative execution time is less than the internal relative execution time, so as to improve the accuracy and consistency of Mesh network synchronization.
- the synchronization method for wireless mesh network provided by the embodiment of the present disclosure is used to improve the broadcast data structure of the Mesh control message, split it into a Mesh protocol structure and a timestamp located after the Mesh protocol structure, and use the time
- the external relative execution time (delay time) in the timestamp is used to update the internal relative execution time saved by the Mesh network node to achieve time synchronization of the Mesh network.
- the Mesh network receiving node since the timestamp is set separately in the Mesh protocol structure, the Mesh network receiving node does not need to decrypt and modify it layer by layer, and can directly and timely obtain the external relative execution time in the timestamp, and then complete the network synchronization, thereby improving the accuracy of the device synchronization operation of the Mesh network node; at the same time, the relative time method is used to achieve the synchronization operation of the Mesh network node.
- the Mesh network node uses the internal crystal oscillator for timing.
- the device of the Mesh network node does not need to quickly resynchronize the network clock after power failure and power on again, which can further improve the accuracy of the device synchronization operation of the Mesh network node in the Mesh network.
- the embodiment of the present disclosure provides a synchronization method for a wireless mesh network, and the synchronization method includes the following steps:
- S501 Obtain a Mesh control message received by a Mesh network node; wherein the broadcast data structure of the Mesh control message includes a Mesh protocol structure and a timestamp after the Mesh protocol structure.
- S502 Determine the external relative execution time in the timestamp.
- S503 Correct the internal relative execution time saved by the Mesh network node according to the external relative execution time.
- S505 Forward the modified relay Mesh control message to other Mesh network nodes.
- the Mesh network relay node After the Mesh network relay node corrects the relay relative execution time in the relay Mesh control message of the Mesh network node, it forwards the modified relay Mesh control message to other Mesh network nodes.
- the relay relative execution time in the relay Mesh control message of the Mesh network node is corrected.
- the next Mesh network node uses the corrected third relative execution time to perform synchronous update of the Mesh network, thereby improving the accuracy and consistency of synchronous update of the Mesh network.
- the synchronization method for a wireless mesh network further includes: updating the internal relative execution time stored by the mesh network node according to the system clock.
- the Mesh network node continuously updates the relative execution time according to the internal system clock, such as starting the timer and the minimum period interrupt. Each time the interrupt is triggered, the relative execution time saved in the internal variable is subtracted from the interrupt period to obtain the updated relative execution time, which is then updated to the internal variable of the Mesh network node.
- the internal relative execution time saved by the Mesh network node is updated.
- the device of the Mesh network node executes the action to realize the synchronous operation of the Mesh network.
- a synchronization device for a wireless mesh network including a processor (processor) 80 and a memory (memory) 81, and may also include a communication interface (Communication Interface) 82 and bus 83.
- the processor 80, the communication interface 82, and the memory 81 can communicate with each other through the bus 83.
- the communication interface 82 can be used for information transmission.
- the processor 80 can call the logic instructions in the memory 81 to execute the synchronization method for the wireless mesh network of the above embodiment.
- logic instructions in the above-mentioned memory 81 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
- the memory 81 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions/modules corresponding to the method in the embodiment of the present disclosure.
- the processor 80 executes the functional application and data processing by running the program instructions/modules stored in the memory 81, that is, the synchronization method for the wireless mesh network in the above method embodiment is implemented.
- the memory 81 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc.
- the memory 81 may include a high-speed random access memory and may also include a non-volatile memory.
- the synchronization device for wireless mesh Mesh network By using the synchronization device for wireless mesh Mesh network provided by the embodiment of the present disclosure, after obtaining the external relative execution time in the Mesh control message received by the Mesh network node, the external relative execution time is compared with the internal relative execution time saved by the Mesh network node, and when the external relative execution time is less than the internal relative execution time, the internal relative execution time is corrected in time.
- the synchronization operation of the Mesh network node is realized by using the relative time method, the Mesh network node uses the internal crystal oscillator for timing, and the device of the Mesh network node does not need to quickly resynchronize the network clock after power failure and power on again, which can improve the accuracy of the synchronization operation of the device of the Mesh network node in the Mesh network.
- an embodiment of the present disclosure provides an electronic device (e.g., a computer, a server, etc.) 90, including: an electronic device body, and the above-mentioned synchronization device 91 for a wireless mesh Mesh network.
- the synchronization device 91 for a wireless mesh Mesh network is installed on the electronic device body.
- the installation relationship described here is not limited to placement inside the product, but also includes installation connections with other components of the product, including but not limited to physical connections, electrical connections, or signal transmission connections. It can be understood by those skilled in the art that the synchronization device 91 for a wireless mesh Mesh network can be adapted to a feasible electronic device body, thereby realizing other feasible embodiments.
- the embodiment of the present disclosure provides a computer program.
- the computer program When the computer program is executed by a computer, the computer implements the above-mentioned synchronization method for a wireless mesh network.
- An embodiment of the present disclosure provides a computer program product, which includes computer instructions stored on a computer-readable storage medium.
- the program instructions When executed by a computer, the computer implements the above-mentioned synchronization method for a wireless mesh network.
- the present disclosure provides a computer-readable storage medium storing computer-executable instructions.
- the machine executable instructions are configured to execute the above-mentioned synchronization method for a wireless mesh network.
- the computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
- the technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure.
- the aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.
- the technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure.
- the aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.
- the first element may be called the second element, and similarly, the second element may be called the first element, as long as all occurrences of the "first element” are renamed consistently and all occurrences of the "second element” are renamed consistently.
- the first element and the second element are both elements, but may not be the same element.
- the words used in this application are only used to describe the embodiments and are not used to limit the claims.
- the singular forms "a”, “an”, and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise.
- the term “and/or” as used in this application refers to any and all possible combinations of one or more of the associated listed items.
- the term "comprise” and its variations “comprises” and/or comprising refer to the presence of stated features, integers, steps, operations, elements, and/or components, but do not exclude one or more other features.
- an element defined by the sentence “comprising a " does not exclude the presence of other identical elements in the process, method or device comprising the element.
- each embodiment may focus on the differences from other embodiments, and the same and similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts may refer to the description of the method part.
- the disclosed methods and products can be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
- the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
- each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
- each box in the flowchart or block diagram may represent a module, a program segment, or a portion of a code, and the module, program segment, or a portion of a code contains one or more executable instructions for implementing a specified logical function.
- the functions marked in the boxes may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes may actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
The present application relates to the technical field of wireless Mesh networks, and discloses a synchronization method for a wireless Mesh network. The Mesh network comprises a plurality of Mesh network nodes connected to each other, and the synchronization method comprises: obtaining external relative execution time in a Mesh control message received by each Mesh network node; obtaining internal relative execution time stored in the Mesh network node; and when the external relative execution time is less than the internal relative execution time, correcting the internal relative execution time. The present application further discloses a synchronization apparatus for a wireless Mesh network and an electronic device.
Description
本申请基于申请号为202211607106.9、申请日为2022年12月14日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on the Chinese patent application with application number 202211607106.9 and application date December 14, 2022, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference.
本申请涉及无线Mesh网络技术领域,例如涉及一种用于无线网状Mesh网络的同步方法及装置、电子设备。The present application relates to the technical field of wireless mesh networks, for example, to a synchronization method and device, and electronic equipment for wireless mesh networks.
无线网状Mesh网络是一种高容量、高带宽的分布式网络,可以看成是无线局域网WLAN和Ad hoc移动自组织网络的融合,且发挥了两者的优势。在大容量的蓝牙Mesh网络中,由于覆盖面积大,一条组控命令消息需要经过多个Mesh网络节点中继才可以到达最远端节点。Mesh网络节点的中继策略无论如何优化,在接收消息、处理消息以及中继消息的过程中都需要耗时,经过多次中继之后,这个耗时会成倍增加,导致Mesh网络中的设备无法在相同的时间内收到Mesh控制消息。如果Mesh网络的覆盖面积很大,会造成肉眼可见的Mesh网络节点的设备响应的不一致。例如,打开所有灯,如果Mesh网络的覆盖面积很大,可以明显看出灯是由近到远分批次亮的,而不是肉眼可见的同时亮。Wireless mesh network is a high-capacity, high-bandwidth distributed network. It can be regarded as the integration of wireless local area network (WLAN) and Ad hoc mobile self-organizing network, and it brings out the advantages of both. In a large-capacity Bluetooth Mesh network, due to the large coverage area, a group control command message needs to be relayed by multiple Mesh network nodes before it can reach the farthest node. No matter how the relay strategy of the Mesh network node is optimized, it takes time to receive, process and relay messages. After multiple relays, this time will increase exponentially, resulting in the inability of devices in the Mesh network to receive Mesh control messages in the same time. If the coverage area of the Mesh network is large, it will cause the inconsistency of the device responses of the Mesh network nodes that can be seen by the naked eye. For example, if all the lights are turned on, if the coverage area of the Mesh network is large, it can be clearly seen that the lights are turned on in batches from near to far, rather than at the same time as can be seen by the naked eye.
发现相关技术中存在如下问题:It is found that the following problems exist in the related technology:
蓝牙Mesh网络使用绝对时间来进行网络同步,如果Mesh网络节点的设备每次在断电并重新上电后不能快速重新同步网络时钟,容易导致该Mesh网络节点的设备不能准确实现同步操作。The Bluetooth Mesh network uses absolute time for network synchronization. If the device of the Mesh network node cannot quickly resynchronize the network clock after power failure and power-on again, it is easy to cause the device of the Mesh network node to fail to accurately achieve synchronization operation.
发明内容Summary of the invention
为了对披露的实施例的一些方面有基本的理解,下面给出了简单的概括。所述概括不是泛泛评述,也不是要确定关键/重要组成元素或描绘这些实施例的保护范围,而是作为后面的详细说明的序言。In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key/critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
本公开实施例提供了一种用于无线网状Mesh网络的同步方法及装置、电子设备,采用相对时间的方式来实现Mesh控制消息的同步操作,提高Mesh网络节点的设备实现同步操作的准确性。
The embodiments of the present disclosure provide a synchronization method and device, and an electronic device for a wireless mesh network, which use a relative time method to implement synchronization operations of Mesh control messages, thereby improving the accuracy of synchronization operations implemented by devices at Mesh network nodes.
在一些实施例中,用于无线网状Mesh网络的同步方法,Mesh网络包括彼此连接的多个Mesh网络节点;同步方法包括:获得Mesh网络节点接收的Mesh控制消息中的外部相对执行时间;获得Mesh网络节点保存的内部相对执行时间;在外部相对执行时间小于内部相对执行时间的情况下,修正内部相对执行时间。In some embodiments, a synchronization method for a wireless mesh Mesh network is provided, wherein the Mesh network includes a plurality of Mesh network nodes connected to each other; the synchronization method includes: obtaining an external relative execution time in a Mesh control message received by the Mesh network node; obtaining an internal relative execution time saved by the Mesh network node; and when the external relative execution time is less than the internal relative execution time, correcting the internal relative execution time.
在一些实施例中,用于无线网状Mesh网络的同步装置包括处理器和存储有程序指令的存储器,处理器被配置为在执行程序指令时,执行前述用于无线网状Mesh网络的同步方法。In some embodiments, a synchronization device for a wireless mesh network includes a processor and a memory storing program instructions, and the processor is configured to execute the aforementioned synchronization method for a wireless mesh network when executing the program instructions.
在一些实施例中,电子设备包括:电子设备主体;以及前述用于无线网状Mesh网络的同步装置,被安装于电子设备主体。In some embodiments, the electronic device includes: an electronic device body; and the aforementioned synchronization device for a wireless mesh network, which is installed in the electronic device body.
以上的总体描述和下文中的描述仅是示例性和解释性的,不用于限制本申请。The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application.
一个或多个实施例通过与之对应的附图进行示例性说明,这些示例性说明和附图并不构成对实施例的限定,附图中具有相同参考数字标号的元件示为类似的元件,附图不构成比例限制,并且其中:One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:
图1是本公开实施例提供的一个用于无线网状Mesh网络的同步方法的流程示意图;FIG1 is a schematic diagram of a flow chart of a synchronization method for a wireless mesh network provided by an embodiment of the present disclosure;
图2是本公开实施例提供的另一个用于无线网状Mesh网络的同步方法的流程示意图;FIG2 is a flow chart of another synchronization method for a wireless mesh network provided by an embodiment of the present disclosure;
图3是本公开实施例提供的另一个用于无线网状Mesh网络的同步方法的流程示意图;FIG3 is a flow chart of another synchronization method for a wireless mesh network provided by an embodiment of the present disclosure;
图4是本公开实施例提供的另一个用于无线网状Mesh网络的同步方法的流程示意图;FIG4 is a flow chart of another synchronization method for a wireless mesh network provided by an embodiment of the present disclosure;
图5是本公开实施例提供的另一个用于无线网状Mesh网络的同步方法的流程示意图;FIG5 is a flow chart of another synchronization method for a wireless mesh network provided by an embodiment of the present disclosure;
图6是本公开实施例提供的一个用于无线网状Mesh网络的同步方法的情境示意图;FIG6 is a scenario diagram of a synchronization method for a wireless mesh network provided by an embodiment of the present disclosure;
图7是本公开实施例提供的另一个用于无线网状Mesh网络的同步方法的情境示意图;FIG7 is a scenario diagram of another synchronization method for a wireless mesh network provided by an embodiment of the present disclosure;
图8是本公开实施例提供的一个用于无线网状Mesh网络的同步装置的结构示意图;FIG8 is a schematic diagram of the structure of a synchronization device for a wireless mesh network provided by an embodiment of the present disclosure;
图9是本公开实施例提供的一个电子设备的结构示意图。FIG. 9 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure.
为了能够更加详尽地了解本公开实施例的特点与技术内容,下面结合附图对本公开实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本公开实施例。在以下的技术描述中,为方便解释起见,通过多个细节以提供对所披露实施例的充分理解。然而,在没有这些细节的情况下,一个或多个实施例仍然可以实施。在其它情况下,为简化附图,熟知的结构和装置可以简化展示。
In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
本公开实施例的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开实施例的实施例。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含。The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
除非另有说明,术语“多个”表示两个或两个以上。本公开实施例中,字符“/”表示前后对象是一种“或”的关系。例如,A/B表示:A或B。术语“和/或”是一种描述对象的关联关系,表示可以存在三种关系。例如,A和/或B,表示:A或B,或,A和B这三种关系。术语“对应”可以指的是一种关联关系或绑定关系,A与B相对应指的是A与B之间是一种关联关系或绑定关系。Unless otherwise specified, the term "plurality" means two or more than two. In the disclosed embodiment, the character "/" indicates that the objects before and after are in an "or" relationship. For example, A/B means: A or B. The term "and/or" is a description of the association relationship between objects, indicating that three relationships may exist. For example, A and/or B means: A or B, or, the three relationships of A and B. The term "corresponding" may refer to an association relationship or a binding relationship, and the correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
无线网状Mesh网络也称为“多跳网络”,它是一个动态的可以不断扩展的网络架构,实现无线设备之间的传输。Mesh网络中大量Mesh网络节点(Mesh网络节点的终端设备)能自动通过无线连成网状结构,网络中的每个Mesh网络节点只能和邻近Mesh网络节点进行通信,因此是一种自组织、自管理的智能网络,不需主干网即可构筑富有弹性的网络。Wireless mesh network is also called "multi-hop network". It is a dynamic and continuously expandable network architecture that realizes transmission between wireless devices. A large number of mesh network nodes (terminal devices of mesh network nodes) in the mesh network can automatically connect to form a mesh structure through wireless. Each mesh network node in the network can only communicate with adjacent mesh network nodes. Therefore, it is a self-organizing and self-managing intelligent network. It can build a flexible network without a backbone network.
在大容量的蓝牙Mesh网络中,解决Mesh网络节点响应一致性的问题,核心思想是时钟同步和延迟执行,也就是所发送的Mesh控制消息是一个延迟执行的消息,Mesh控制消息中包含了延迟时间的具体数值。In a large-capacity Bluetooth Mesh network, the core idea to solve the problem of consistent response of Mesh network nodes is clock synchronization and delayed execution, that is, the Mesh control message sent is a delayed execution message, and the Mesh control message contains the specific value of the delay time.
目前,蓝牙Mesh网络的同步性方案使用绝对时间来进行同步的,需要主节点周期性地发送同步信号来同步整个Mesh网络。Mesh网络采用绝对时间来进行同步,同步信号会增加Mesh网络的负载,如果同步消息和控制消息产生冲突,会增加控制失败的可能性。此外,Mesh网络节点的设备在断电并重新上电后,需要Mesh网络节点快速重新同步网络时钟,才能很好地实现Mesh网络的同步控制。At present, the synchronization scheme of Bluetooth Mesh network uses absolute time for synchronization, and the master node needs to periodically send synchronization signals to synchronize the entire Mesh network. Mesh network uses absolute time for synchronization, and the synchronization signal will increase the load of the Mesh network. If the synchronization message and the control message conflict, the possibility of control failure will increase. In addition, after the device of the Mesh network node is powered off and powered on again, the Mesh network node needs to quickly resynchronize the network clock to achieve good synchronization control of the Mesh network.
本公开实施例中,Mesh网络采用相对时间来同步控制消息,Mesh网络控制消息中不会标定绝对时间,而是包含相对时间,以收到Mesh网络控制消息的时刻作为锚点。Mesh网络节点在收到mesh网络控制消息时开始使用晶振计时,当延迟时间(相对时间)到达时执行动作,并且持续监听空中的Mesh网络控制消息。In the disclosed embodiment, the Mesh network uses relative time to synchronize control messages. The Mesh network control message does not calibrate the absolute time, but contains relative time, with the moment when the Mesh network control message is received as the anchor point. The Mesh network node starts to use the crystal oscillator to time when it receives the Mesh network control message, executes the action when the delay time (relative time) arrives, and continuously monitors the Mesh network control message in the air.
结合图1所示,本公开实施例提供一种用于无线网状Mesh网络的同步方法,Mesh网络包括彼此连接的多个Mesh网络节点,同步方法包括以下步骤:As shown in FIG. 1 , an embodiment of the present disclosure provides a synchronization method for a wireless mesh network, wherein the mesh network includes a plurality of mesh network nodes connected to each other, and the synchronization method includes the following steps:
S101:获得Mesh网络节点接收的Mesh控制消息中的外部相对执行时间。S101: Obtaining an external relative execution time in a Mesh control message received by a Mesh network node.
Mesh网络节点接收到手机或其他Mesh网络节点中继发送的Mesh控制消息时,提取Mesh控制消息中的相对执行时间(也可称为延时时间或执行时间)。其中,Mesh网络节点首次接收到手机或其他Mesh网络节点中继发送的Mesh控制消息时,提取Mesh控制消
息中的相对执行时间为内部相对执行时间;Mesh网络节点再次接收到手机或其他Mesh网络节点中继发送的Mesh控制消息时,提取Mesh控制消息中的相对执行时间为外部相对执行时间。When a Mesh network node receives a Mesh control message relayed by a mobile phone or other Mesh network node, it extracts the relative execution time (also called delay time or execution time) in the Mesh control message. The relative execution time in the message is the internal relative execution time; when the Mesh network node receives the Mesh control message relayed by the mobile phone or other Mesh network nodes again, the relative execution time in the Mesh control message is extracted as the external relative execution time.
可选地,Mesh控制消息的广播数据结构包括Mesh协议结构和位于Mesh协议结构后的时间戳。Optionally, the broadcast data structure of the Mesh control message includes a Mesh protocol structure and a timestamp located after the Mesh protocol structure.
Mesh控制消息的Mesh协议结构包括顺次电连接的模型层(Model Layer)、基础模型层(Foundation Model Layer)、接入层(Access Layer)、上层传输层(Upper Transport Layer),下层传输层(Lower Transport Layer)、网络层(Network Layer)、承载层(Bearer Layer)和蓝牙低能耗核心规范层(Bluetooth Low Energy Core Specification)。The Mesh protocol structure of the Mesh control message includes the model layer (Model Layer), foundation model layer (Foundation Model Layer), access layer (Access Layer), upper transport layer (Upper Transport Layer), lower transport layer (Lower Transport Layer), network layer (Network Layer), bearer layer (Bearer Layer) and Bluetooth low energy core specification layer (Bluetooth Low Energy Core Specification) which are electrically connected in sequence.
Mesh控制消息的相对执行时间的字段如若设置在Mesh协议结构(例如接入层或承载层)中,Mesh控制消息在中继过程中,经过Mesh网络中继节点的层层加密与混淆,Mesh网络接收节点需要层层解密与修改才能获得Mesh控制消息中的延时时间,实现网络同步。这样,增加了Mesh协议的负担,减弱了中继效率,并且破坏了Mesh协议的架构。If the relative execution time field of the Mesh control message is set in the Mesh protocol structure (such as the access layer or the bearer layer), the Mesh control message will be encrypted and obfuscated by the Mesh network relay nodes during the relay process. The Mesh network receiving nodes need to decrypt and modify the message layer by layer to obtain the delay time in the Mesh control message and achieve network synchronization. This increases the burden of the Mesh protocol, reduces the relay efficiency, and destroys the architecture of the Mesh protocol.
通过改进Mesh控制消息的广播数据结构,将其拆分成Mesh协议结构和位于Mesh协议结构后的时间戳。在Mesh控制消息的广播数据结构中,由于时间戳单独设置于Mesh协议结构后,Mesh网络接收节点无需层层解密与修改,可以直接并及时获得时间戳中的外部相对执行时间,完成网络同步,从而提高Mesh网络节点的设备同步操作的准确性。By improving the broadcast data structure of the Mesh control message, it is split into a Mesh protocol structure and a timestamp after the Mesh protocol structure. In the broadcast data structure of the Mesh control message, since the timestamp is set separately after the Mesh protocol structure, the Mesh network receiving node does not need to decrypt and modify it layer by layer, and can directly and timely obtain the external relative execution time in the timestamp to complete network synchronization, thereby improving the accuracy of the device synchronization operation of the Mesh network node.
可选地,获得Mesh网络节点接收的Mesh控制消息中的外部相对执行时间,包括:识别Mesh控制消息的广播数据结构中的时间戳;获得时间戳的执行时间字节中的相对执行时间;将时间戳的执行时间字节中的相对执行时间作为外部相对执行时间。Optionally, obtaining the external relative execution time in the Mesh control message received by the Mesh network node includes: identifying the timestamp in the broadcast data structure of the Mesh control message; obtaining the relative execution time in the execution time byte of the timestamp; and using the relative execution time in the execution time byte of the timestamp as the external relative execution time.
利用时间戳中的外部相对执行时间(延迟时间)来更新Mesh网络节点保存的内部相对执行时间,实现Mesh网络的时间同步。在Mesh控制消息的广播数据结构中,由于时间戳单独设置于Mesh协议结构后,Mesh网络接收节点无需层层解密与修改,可以直接并及时获得时间戳中的外部相对执行时间,完成网络同步,从而提高Mesh网络节点的设备同步操作的准确性。The external relative execution time (delay time) in the timestamp is used to update the internal relative execution time saved by the Mesh network node to achieve time synchronization of the Mesh network. In the broadcast data structure of the Mesh control message, since the timestamp is set separately in the Mesh protocol structure, the Mesh network receiving node does not need to decrypt and modify it layer by layer, and can directly and timely obtain the external relative execution time in the timestamp to complete network synchronization, thereby improving the accuracy of the device synchronization operation of the Mesh network node.
S102:获得Mesh网络节点保存的内部相对执行时间。S102: Obtain the internal relative execution time saved by the Mesh network node.
实际应用中,内部相对执行时间保存在Mesh网络节点的内部变量中。Mesh网络节点根据内部的系统时钟,不断地更新该相对执行时间,例如启动定时器,最小周期中断,每次中断触发时,将内部变量中保存的相对执行时间减去中断周期,获得更新后的相对执行时间,并更新至Mesh网络节点的内部变量中。In actual applications, the internal relative execution time is stored in the internal variables of the Mesh network node. The Mesh network node continuously updates the relative execution time according to the internal system clock, such as starting the timer and the minimum period interrupt. Each time the interrupt is triggered, the relative execution time stored in the internal variable is subtracted from the interrupt period to obtain the updated relative execution time, which is then updated to the internal variables of the Mesh network node.
S103:在外部相对执行时间小于内部相对执行时间的情况下,修正内部相对执行时间。
S103: When the external relative execution time is less than the internal relative execution time, correct the internal relative execution time.
在Mesh网络的同步过程中,Mesh网络的主控制节点(Mesh网络同步的发起者)发送多个(例如8个)重复控制包(Mesh控制消息)来提高Mesh网络同步的控制成功率。重复控制包是串行发送的,相邻的每两个重复控制包间隔预设时长(例如预设时长的取值范围在20-30ms之间),由于第一个重复控制包和最后一个重复控制包之间存在时间差距(例如最多相差210ms),会给Mesh网络节点的设备的控制一致性带来误差。During the synchronization process of the Mesh network, the main control node of the Mesh network (the initiator of the Mesh network synchronization) sends multiple (e.g., 8) repeated control packets (Mesh control messages) to improve the control success rate of the Mesh network synchronization. The repeated control packets are sent serially, and the interval between each two adjacent repeated control packets is a preset time (e.g., the preset time range is between 20-30ms). Since there is a time gap between the first repeated control packet and the last repeated control packet (e.g., a maximum difference of 210ms), it will cause errors in the control consistency of the devices of the Mesh network nodes.
结合如下图6、图7所示,手机(Mesh网络的主控制节点)分别间隔预设时间,连续发送8个重复控制包(Mesh控制消息),其中,8个Mesh控制消息中的外部相对执行时间均为200ms。Mesh网络节点内部的中继耗时为20ms。As shown in Figures 6 and 7 below, the mobile phone (main control node of the Mesh network) sends 8 repeated control packets (Mesh control messages) at preset intervals, where the external relative execution time of the 8 Mesh control messages is 200ms. The relay time inside the Mesh network node is 20ms.
Mesh网络节点1接收到手机发送的第一个Mesh控制消息中的外部相对执行时间为200ms,Mesh网络节点2接收到Mesh网络节点1中继的第一个Mesh控制消息中的外部相对执行时间为180ms,Mesh网络节点3接收到Mesh网络节点2中继的第一个Mesh控制消息中的外部相对执行时间为160ms,Mesh网络节点4接收到Mesh网络节点3中继的第一个Mesh控制消息中的外部相对执行时间为140ms,Mesh网络节点5接收到Mesh网络节点4中继的第一个Mesh控制消息中的外部相对执行时间为120ms,Mesh网络节点6接收到Mesh网络节点5中继的第一个Mesh控制消息中的外部相对执行时间为100ms。The external relative execution time of the first Mesh control message sent by the mobile phone received by Mesh network node 1 is 200ms, the external relative execution time of the first Mesh control message relayed by Mesh network node 1 received by Mesh network node 2 is 180ms, the external relative execution time of the first Mesh control message relayed by Mesh network node 2 received by Mesh network node 3 is 160ms, the external relative execution time of the first Mesh control message relayed by Mesh network node 3 received by Mesh network node 4 is 140ms, the external relative execution time of the first Mesh control message relayed by Mesh network node 4 received by Mesh network node 5 is 120ms, and the external relative execution time of the first Mesh control message relayed by Mesh network node 5 received by Mesh network node 6 is 100ms.
Mesh网络节点7接收到手机发送的第四个Mesh控制消息中的外部相对执行时间为200ms,Mesh网络节点6接收到Mesh网络节点7中继的第四个Mesh控制消息中的外部相对执行时间为180ms,Mesh网络节点5接收到Mesh网络节点6中继的第一个Mesh控制消息中的外部相对执行时间为160ms。The external relative execution time in the fourth Mesh control message sent by the mobile phone received by Mesh network node 7 is 200ms, the external relative execution time in the fourth Mesh control message relayed by Mesh network node 7 received by Mesh network node 6 is 180ms, and the external relative execution time in the first Mesh control message relayed by Mesh network node 6 received by Mesh network node 5 is 160ms.
对于Mesh网络节点7,其接收到第四个Mesh控制消息中的外部相对执行时间为200ms,但是这包Mesh控制消息已经延迟了60ms(以预设时长的取值为20ms为例)。对于Mesh网络节点6,认为接收的外部相对执行时间100ms小于保存的内部相对执行时间160ms,则修正保存的内部相对执行时间(为100ms)。For Mesh network node 7, the external relative execution time received in the fourth Mesh control message is 200ms, but this Mesh control message has been delayed by 60ms (taking the preset duration as 20ms as an example). For Mesh network node 6, it is considered that the received external relative execution time of 100ms is less than the saved internal relative execution time of 160ms, so the saved internal relative execution time is corrected (to 100ms).
因此,Mesh网络节点需要持续检测后续的Mesh控制消息中的外部相对执行时间,并在外部相对执行时间小于内部相对执行时间的情况下,修正内部相对执行时间。由此,提高Mesh网络同步的一致性。Therefore, the mesh network node needs to continuously detect the external relative execution time in the subsequent mesh control message, and correct the internal relative execution time when the external relative execution time is less than the internal relative execution time, thereby improving the consistency of mesh network synchronization.
可选地,修正内部相对执行时间,包括:获得外部相对执行时间和内部相对执行时间的实际时间间隔;在实际时间间隔小于时间间隔阈值的情况下,修正内部相对执行时间。Optionally, correcting the internal relative execution time includes: obtaining an actual time interval between the external relative execution time and the internal relative execution time; and correcting the internal relative execution time when the actual time interval is less than a time interval threshold.
时间间隔阈值的取值范围可以是[80ms,100ms],例如,80ms、85ms、90ms、95ms、100ms。当Mesh控制消息中的外部相对执行时间与内部相对执行时间的实际时间间隔大于时间间隔阈值时,说明包含该外部相对执行时间的Mesh控制消息极有可能是前一包Mesh
控制消息重传引发的干扰消息。例如,发送本次的Mesh控制消息之前,对于手机前期发送的其他Mesh控制消息中经过重传而未消散的Mesh控制消息,该Mesh控制消息中的外部相对时间虽然远小于内部相对时间,但显然该Mesh控制消息为干扰消息。因此,通过判断外部相对执行时间和内部相对执行时间的实际时间间隔与时间间隔阈值的大小,来确定接收到的Mesh控制消息是否为干扰消息,避免Mesh网络节点根据干扰信息修正其保存的内部相对执行时间,进而在内部相对执行时间到达时,Mesh网络节点执行动作,提高Mesh网络同步的准确性与一致性。The value range of the time interval threshold can be [80ms, 100ms], for example, 80ms, 85ms, 90ms, 95ms, 100ms. When the actual time interval between the external relative execution time and the internal relative execution time in the Mesh control message is greater than the time interval threshold, it means that the Mesh control message containing the external relative execution time is very likely to be the previous Mesh control message. Interference messages caused by retransmission of control messages. For example, before sending this Mesh control message, for the Mesh control messages that were retransmitted but not dissipated in other Mesh control messages sent by the mobile phone earlier, although the external relative time in the Mesh control message is much smaller than the internal relative time, it is obvious that the Mesh control message is an interference message. Therefore, by judging the actual time interval between the external relative execution time and the internal relative execution time and the time interval threshold, it is determined whether the received Mesh control message is an interference message, so as to avoid the Mesh network node correcting its saved internal relative execution time according to the interference information, and then when the internal relative execution time arrives, the Mesh network node executes the action, thereby improving the accuracy and consistency of Mesh network synchronization.
可选地,修正内部相对执行时间,包括按照如下公式计算获得修正后的内部相对执行时间:
T21=T1-T01-Ts1 Optionally, correcting the internal relative execution time includes calculating the corrected internal relative execution time according to the following formula:
T21 = T1 - T01 - Ts1
T21=T1-T01-Ts1 Optionally, correcting the internal relative execution time includes calculating the corrected internal relative execution time according to the following formula:
T21 = T1 - T01 - Ts1
其中,T21为修正后的内部相对执行时间,T1为外部相对执行时间,T01为Mesh网络节点的第一内部处理时间,Ts1为第一随机延迟时间。Wherein, T 21 is the corrected internal relative execution time, T 1 is the external relative execution time, T 01 is the first internal processing time of the Mesh network node, and T s1 is the first random delay time.
例如,获取的外部相对执行时间T1为100ms,Mesh网络节点的第一内部处理时间T01为20ms,第一随机延迟时间Ts1为2ms,则修正后的第二相对时间为T21=T1-T01-Ts1=100ms-20ms-2ms=78ms。For example, the acquired external relative execution time T1 is 100ms, the first internal processing time T01 of the Mesh network node is 20ms, and the first random delay time Ts1 is 2ms, then the corrected second relative time is T21 = T1 - T01 - Ts1 =100ms-20ms-2ms=78ms.
利用外部相对执行时间、第一内部处理时间以及第一随机延迟时间来修正Mesh网络节点保存的内部相对执行时间,提高内部相对执行时间的准确性。Mesh网络节点利用修正后的内部相对执行时间来进行Mesh网络的同步更新,提升了Mesh网络同步更新的一致性。The external relative execution time, the first internal processing time and the first random delay time are used to correct the internal relative execution time saved by the Mesh network node, thereby improving the accuracy of the internal relative execution time. The Mesh network node uses the corrected internal relative execution time to perform synchronous update of the Mesh network, thereby improving the consistency of synchronous update of the Mesh network.
采用本公开实施例提供的用于无线网状Mesh网络的同步方法,获得Mesh网络节点接收的Mesh控制消息中的外部相对执行时间后,比较外部相对执行时间和Mesh网络节点保存的内部相对执行时间的大小,并在外部相对执行时间小于内部相对执行时间的情况下,及时修正内部相对执行时间。这样,采用相对时间的方式来实现Mesh网络节点的同步操作,Mesh网络节点利用内部晶振计时,Mesh网络节点的设备在断电并重新上电后无需快速重新同步网络时钟,能够提高Mesh网络中的Mesh网络节点的设备实现同步操作的准确性。By adopting the synchronization method for wireless mesh Mesh network provided by the embodiment of the present disclosure, after obtaining the external relative execution time in the Mesh control message received by the Mesh network node, the external relative execution time is compared with the internal relative execution time saved by the Mesh network node, and when the external relative execution time is less than the internal relative execution time, the internal relative execution time is corrected in time. In this way, the synchronization operation of the Mesh network node is realized by using the relative time method, the Mesh network node uses the internal crystal oscillator for timing, and the device of the Mesh network node does not need to quickly resynchronize the network clock after power failure and power on again, which can improve the accuracy of the synchronization operation of the device of the Mesh network node in the Mesh network.
结合图2所示,本公开实施例提供一种用于无线网状Mesh网络的同步方法,Mesh网络包括彼此连接的多个Mesh网络节点,同步方法包括以下步骤:As shown in FIG. 2 , an embodiment of the present disclosure provides a synchronization method for a wireless mesh network, wherein the mesh network includes a plurality of mesh network nodes connected to each other, and the synchronization method includes the following steps:
S201:获得Mesh网络节点接收的Mesh控制消息中的外部相对执行时间。S201: Obtaining an external relative execution time in a Mesh control message received by a Mesh network node.
S202:获得Mesh网络节点保存的内部相对执行时间。S202: Obtain the internal relative execution time saved by the Mesh network node.
S203:在外部相对执行时间小于内部相对执行时间的情况下,修正内部相对执行时间。S203: When the external relative execution time is less than the internal relative execution time, correct the internal relative execution time.
S204:在Mesh网络节点为中继节点的情况下,获得第二随机延迟时间。
S204: When the Mesh network node is a relay node, obtain a second random delay time.
第二随机延迟时间Ts2的取值范围为1-10ms,例如2ms、3ms、7ms、10ms。The value range of the second random delay time T s2 is 1-10 ms, for example, 2 ms, 3 ms, 7 ms, and 10 ms.
S205:第二随机延迟时间后,将Mesh网络节点的中继Mesh控制消息转发到其他Mesh网络节点。S205: After the second random delay time, forward the relay Mesh control message of the Mesh network node to other Mesh network nodes.
可选地,按照如下公式计算修正后的中继Mesh控制消息中的中继相对执行时间:
T31=T1-T02-Ts1 Optionally, the corrected relay relative execution time in the relay Mesh control message is calculated according to the following formula:
T31 = T1 - T02 - Ts1
T31=T1-T02-Ts1 Optionally, the corrected relay relative execution time in the relay Mesh control message is calculated according to the following formula:
T31 = T1 - T02 - Ts1
其中,T31为修正后的中继相对执行时间,T1为外部相对执行时间,T02为Mesh网络节点的第二内部处理时间,Ts1为第一随机延迟时间。Wherein, T 31 is the corrected relay relative execution time, T 1 is the external relative execution time, T 02 is the second internal processing time of the Mesh network node, and T s1 is the first random delay time.
例如,获取的外部相对执行时间T1为100ms,Mesh网络节点的第二内部处理时间T02为30ms,第一随机延迟时间Ts1为2ms,则修正后的第三相对时间为T31=T1-T02-Ts1=100ms-30ms-2ms=68ms。For example, the acquired external relative execution time T1 is 100ms, the second internal processing time T02 of the Mesh network node is 30ms, and the first random delay time Ts1 is 2ms, then the corrected third relative time is T31 = T1 - T02 - Ts1 =100ms-30ms-2ms=68ms.
通过增加第二随机延迟时间,可以有效避免中继Mesh控制消息与其他控制消息撞包。利用外部相对执行时间、第二内部处理时间以及第一随机延迟时间来修正Mesh网络中继节点中的中继相对执行时间,提高中继相对执行时间的准确性。By adding the second random delay time, the relay Mesh control message can be effectively prevented from colliding with other control messages. The external relative execution time, the second internal processing time and the first random delay time are used to correct the relay relative execution time in the Mesh network relay node, thereby improving the accuracy of the relay relative execution time.
Mesh网络中继节点修正Mesh网络节点的中继Mesh控制消息中的中继相对执行时间后,将修改后的中继Mesh控制消息转发到其他Mesh网络节点。After the Mesh network relay node corrects the relay relative execution time in the relay Mesh control message of the Mesh network node, it forwards the modified relay Mesh control message to other Mesh network nodes.
本公开实施例中,在Mesh网络节点为中继节点的情况下,通过增加第二随机延迟时间,可以有效避免中继Mesh控制消息与其他控制消息撞包。同时,修正Mesh网络节点的中继Mesh控制消息中的中继相对执行时间。下一Mesh网络节点利用修正后的中继相对执行时间(即下一Mesh网络节点接收的Mesh控制消息中的外部相对执行时间)来进行Mesh网络的同步更新,提升了Mesh网络同步更新的准确性与一致性。In the embodiment of the present disclosure, when the Mesh network node is a relay node, by adding a second random delay time, it is possible to effectively avoid the relay Mesh control message from colliding with other control messages. At the same time, the relay relative execution time in the relay Mesh control message of the Mesh network node is corrected. The next Mesh network node uses the corrected relay relative execution time (i.e., the external relative execution time in the Mesh control message received by the next Mesh network node) to perform synchronous update of the Mesh network, thereby improving the accuracy and consistency of synchronous update of the Mesh network.
结合图3所示,本公开实施例提供一种用于无线网状Mesh网络的同步方法,Mesh网络包括彼此连接的多个Mesh网络节点,同步方法包括以下步骤:As shown in FIG. 3 , an embodiment of the present disclosure provides a synchronization method for a wireless mesh network, wherein the mesh network includes a plurality of mesh network nodes connected to each other, and the synchronization method includes the following steps:
S301:获得Mesh网络节点接收的Mesh控制消息中的外部相对执行时间。S301: Obtaining an external relative execution time in a Mesh control message received by a Mesh network node.
S302:获得Mesh网络节点保存的内部相对执行时间。S302: Obtain the internal relative execution time saved by the Mesh network node.
S303:在外部相对执行时间小于内部相对执行时间,且,外部相对执行时间和内部相对执行时间的实际时间间隔小于时间间隔阈值的情况下,修正内部相对执行时间。S303: When the external relative execution time is less than the internal relative execution time and the actual time interval between the external relative execution time and the internal relative execution time is less than the time interval threshold, correct the internal relative execution time.
S304:在外部相对执行时间小于内部相对执行时间,且,外部相对执行时间和内部相对执行时间的实际时间间隔大于时间间隔阈值的情况下,丢弃接收的Mesh控制消息。S304: When the external relative execution time is less than the internal relative execution time and the actual time interval between the external relative execution time and the internal relative execution time is greater than the time interval threshold, discard the received Mesh control message.
S305:在外部相对执行时间大于内部相对执行时间的情况下,丢弃接收到的Mesh控制消息。S305: When the external relative execution time is greater than the internal relative execution time, discard the received Mesh control message.
Mesh网络节点解析并确定Mesh控制消息中的外部相对执行时间后,与保存的内部
相对执行时间进行比较。如果外部相对执行时间小于内部相对执行时间,且,外部相对执行时间和内部相对执行时间的实际时间间隔小于时间间隔阈值,则修正内部相对执行时间;如果外部相对执行时间小于内部相对执行时间,且,外部相对执行时间和内部相对执行时间的实际时间间隔大于时间间隔阈值,表明包含该外部相对执行时间的Mesh控制消息极有可能前一包Mesh控制消息重传引发的干扰消息,则丢弃接收的Mesh控制消息;如果外部相对执行时间大于内部相对执行时间的情况下,表明包含第一相对执行消息的该Mesh控制消息为重传引发的干扰信息,则丢弃接收到的Mesh控制消息。如此,避免Mesh网络节点根据干扰信息修正其保存的内部相对执行时间,在内部相对执行时间到达时,Mesh网络节点执行动作,提高Mesh网络同步的准确性与一致性。After the mesh network node parses and determines the external relative execution time in the mesh control message, it compares it with the saved internal The relative execution time is compared. If the external relative execution time is less than the internal relative execution time, and the actual time interval between the external relative execution time and the internal relative execution time is less than the time interval threshold, the internal relative execution time is corrected; if the external relative execution time is less than the internal relative execution time, and the actual time interval between the external relative execution time and the internal relative execution time is greater than the time interval threshold, it indicates that the Mesh control message containing the external relative execution time is very likely to be an interference message caused by the retransmission of the previous Mesh control message, and the received Mesh control message is discarded; if the external relative execution time is greater than the internal relative execution time, it indicates that the Mesh control message containing the first relative execution message is interference information caused by retransmission, and the received Mesh control message is discarded. In this way, the Mesh network node is prevented from correcting its stored internal relative execution time according to the interference information. When the internal relative execution time arrives, the Mesh network node executes the action, thereby improving the accuracy and consistency of Mesh network synchronization.
结合图4所示,本公开实施例提供一种用于无线网状Mesh网络的同步方法,Mesh网络包括彼此连接的多个Mesh网络节点,同步方法包括以下步骤:As shown in FIG. 4 , an embodiment of the present disclosure provides a synchronization method for a wireless mesh network, wherein the mesh network includes a plurality of mesh network nodes connected to each other, and the synchronization method includes the following steps:
S401:获得Mesh网络节点接收的Mesh控制消息;其中,Mesh控制消息的广播数据结构包括Mesh协议结构和位于Mesh协议结构后的时间戳。S401: Obtain a Mesh control message received by a Mesh network node; wherein the broadcast data structure of the Mesh control message includes a Mesh protocol structure and a timestamp after the Mesh protocol structure.
可选地,时间戳包括第一预设字节数的长度(length)字节、第二预设字节数的类型(AD Type)字节以及第三预设字节数的执行时间(timestamp)字节。Optionally, the timestamp includes a first preset number of byte length (length) bytes, a second preset number of byte type (AD Type) bytes, and a third preset number of byte execution time (timestamp) bytes.
实际应用中,时间戳的格式为4字节,第一预设字节数为1字节,第二预设字节数为1字节,第三预设字节数为2字节。4字节时间戳的格式可以是:length(1字节)+AD Type(1字节)+timestamp(2字节)。In actual applications, the format of the timestamp is 4 bytes, the first preset byte number is 1 byte, the second preset byte number is 1 byte, and the third preset byte number is 2 bytes. The format of the 4-byte timestamp can be: length (1 byte) + AD Type (1 byte) + timestamp (2 bytes).
蓝牙Mesh协议是在低功耗蓝牙(BLE)广播基础上实现的,BLE广播的数据是由一个或多个AD结构(AD Struct)叠加而成。Mesh控制消息可以认为是一个独立的AD Struct,由于它的层级结构较为负责,留给access layer的负载payload最多只有11个字节,当access layer的payload的字数为11个字节时,BLE广播数据已达到最大值(31个字节),已经无法容纳下一个AD Struct。因此在Mesh控制消息的广播数据结构中增加一个4字节AD Struct来表示时间戳。The Bluetooth Mesh protocol is implemented based on Bluetooth Low Energy (BLE) broadcasting. The data broadcast by BLE is composed of one or more AD structures (AD Struct). The Mesh control message can be considered as an independent AD Struct. Due to its complex hierarchical structure, the payload left for the access layer is only 11 bytes at most. When the word count of the access layer payload is 11 bytes, the BLE broadcast data has reached the maximum value (31 bytes) and can no longer accommodate the next AD Struct. Therefore, a 4-byte AD Struct is added to the broadcast data structure of the Mesh control message to represent the timestamp.
自定义模型(vendor model)的Mesh控制消息最多只可以支持7个字节,除去3字节的自定义操作码(vendor opcode),只剩下4个字节参数负载(parameter payload)。经过评估分析,4字节的parameter payload压缩后,对于常见的Mesh网络节点设备(例如墙壁开关、灯品类或传感器品类),也能够满足其执行动作要求。由此,证明Mesh控制消息的广播数据结构(7字节的access layer的Mesh协议结构+4字节的时间戳)的方案是可行的。The Mesh control message of the custom model (vendor model) can only support up to 7 bytes. Excluding the 3-byte custom opcode (vendor opcode), only 4 bytes of parameter payload are left. After evaluation and analysis, the 4-byte parameter payload can also meet the execution requirements of common Mesh network node devices (such as wall switches, lamps or sensors) after compression. Therefore, it is proved that the broadcast data structure of the Mesh control message (7-byte access layer Mesh protocol structure + 4-byte timestamp) is feasible.
举例来看,控制灯的颜色变化是最复杂的灯控消息,消息依赖的payload是最多的,
但是4字节的参数负载parameter payload也可以满足用户的需求。4字节参数负载如下:事务编码Tid(1字节)+亮度Lightness(1字节)+色调Hue(1字节)+饱和度Saturation(1字节)。这里,事务编码Tid,即transation id,用于表示该消息在应用层的唯一性。控制颜色的HLS三个参数原需要2字节表示,但是256的控制颗粒度已经可以满足用户的需求,不会影响用户体验,因此可以使用1个字节表示。For example, controlling the color change of a light is the most complex light control message, and it relies on the most payloads. However, a 4-byte parameter payload can also meet user needs. The 4-byte parameter payload is as follows: transaction code Tid (1 byte) + brightness Lightness (1 byte) + hue Hue (1 byte) + saturation Saturation (1 byte). Here, the transaction code Tid, that is, transaction id, is used to indicate the uniqueness of the message at the application layer. The three HLS parameters that control color originally require 2 bytes to represent, but the control granularity of 256 can already meet user needs and will not affect the user experience, so it can be represented by 1 byte.
由此可见,本公开实施例中对于时间戳格式的设计,在不影响Mesh控制消息原有实现功能的前提下,由于时间戳单独设置于Mesh协议结构后,Mesh网络接收节点无需层层解密与修改,可以直接并及时获得时间戳中的外部相对执行时间,进而完成网络同步,从而提高Mesh网络节点的设备同步操作的准确性。It can be seen that the design of the timestamp format in the embodiment of the present disclosure, without affecting the original implementation function of the Mesh control message, because the timestamp is set separately in the Mesh protocol structure, the Mesh network receiving node does not need to decrypt and modify layer by layer, and can directly and timely obtain the external relative execution time in the timestamp, and then complete network synchronization, thereby improving the accuracy of the device synchronization operation of the Mesh network node.
S402:确定时间戳中的外部相对执行时间。S402: Determine the external relative execution time in the timestamp.
可选地,确定时间戳中的外部相对执行时间,包括:识别Mesh控制消息的广播数据结构中的时间戳;获得时间戳的执行时间字节中的相对执行时间;将时间戳的执行时间字节中的相对执行时间作为外部相对执行时间。Optionally, determining the external relative execution time in the timestamp includes: identifying the timestamp in the broadcast data structure of the Mesh control message; obtaining the relative execution time in the execution time byte of the timestamp; and using the relative execution time in the execution time byte of the timestamp as the external relative execution time.
实际应用中,首先,确定Mesh控制消息的广播数据结构的总字节数以及Mesh协议结构的字节数,并根据Mesh控制消息的广播数据结构的总字节数以及Mesh协议结构的字节数计算时间戳的字节数;对计算获得的时间戳的字节数与预存的时间戳的字节数进行验证;在计算获得的时间戳的字节数与预存的时间戳的字节数一致的情况下,按照(计算获得的/预存的)时间戳的字节数确定Mesh控制消息的广播数据结构中的时间戳。然后,按照时间戳中相对执行时间的第三预设字节数获得相对执行时间(外部相对执行时间)。In practical applications, first, determine the total number of bytes of the broadcast data structure of the Mesh control message and the number of bytes of the Mesh protocol structure, and calculate the number of bytes of the timestamp based on the total number of bytes of the broadcast data structure of the Mesh control message and the number of bytes of the Mesh protocol structure; verify the number of bytes of the calculated timestamp and the number of bytes of the pre-stored timestamp; when the number of bytes of the calculated timestamp is consistent with the number of bytes of the pre-stored timestamp, determine the timestamp in the broadcast data structure of the Mesh control message according to the number of bytes of the (calculated/pre-stored) timestamp. Then, obtain the relative execution time (external relative execution time) according to the third preset number of bytes of the relative execution time in the timestamp.
由于时间戳单独设置于Mesh协议结构后,Mesh网络接收节点无需层层解密与修改,并且通过对计算获得的时间戳的字节数与预存的时间戳的字节数进行验证,提高获得的时间戳中的外部相对执行时间的准确性,从而提高Mesh网络节点的设备同步操作的精准性。Since the timestamp is set separately in the Mesh protocol structure, the receiving nodes of the Mesh network do not need to decrypt and modify layer by layer. By verifying the number of bytes of the calculated timestamp and the number of bytes of the pre-stored timestamp, the accuracy of the external relative execution time in the obtained timestamp is improved, thereby improving the accuracy of the device synchronization operation of the Mesh network nodes.
S403:根据外部相对执行时间修正Mesh网络节点保存的内部相对执行时间。S403: Correcting the internal relative execution time stored in the Mesh network node according to the external relative execution time.
可选地,根据外部相对执行时间修正Mesh网络节点保存的内部相对执行时间,包括:在外部相对执行时间小于内部相对执行时间的情况下,修正内部相对执行时间。Optionally, the internal relative execution time saved by the Mesh network node is corrected according to the external relative execution time, including: when the external relative execution time is less than the internal relative execution time, correcting the internal relative execution time.
Mesh网络节点在首次接收Mesh控制消息并保存Mesh控制消息中的外部相对执行时间后,持续检测后续的Mesh控制消息中的外部相对执行时间,并在外部相对执行时间小于内部相对执行时间的情况下,修正内部相对执行时间,以提高Mesh网络同步的准确性与一致性。After receiving the Mesh control message for the first time and saving the external relative execution time in the Mesh control message, the Mesh network node continuously detects the external relative execution time in subsequent Mesh control messages, and corrects the internal relative execution time when the external relative execution time is less than the internal relative execution time, so as to improve the accuracy and consistency of Mesh network synchronization.
采用本公开实施例提供的用于无线网状Mesh网络的同步方法,改进Mesh控制消息的广播数据结构,将其拆分成Mesh协议结构和位于Mesh协议结构后的时间戳,利用时间
戳中的外部相对执行时间(延迟时间)来更新Mesh网络节点保存的内部相对执行时间,实现Mesh网络的时间同步。在Mesh控制消息的广播数据结构中,由于时间戳单独设置于Mesh协议结构后,Mesh网络接收节点无需层层解密与修改,可以直接并及时获得时间戳中的外部相对执行时间,进而完成网络同步,从而提高Mesh网络节点的设备同步操作的准确性;同时,采用相对时间的方式来实现Mesh网络节点的同步操作,Mesh网络节点利用内部晶振计时,Mesh网络节点的设备在断电并重新上电后无需快速重新同步网络时钟,能够进一步提高Mesh网络中的Mesh网络节点的设备实现同步操作的准确性。The synchronization method for wireless mesh network provided by the embodiment of the present disclosure is used to improve the broadcast data structure of the Mesh control message, split it into a Mesh protocol structure and a timestamp located after the Mesh protocol structure, and use the time The external relative execution time (delay time) in the timestamp is used to update the internal relative execution time saved by the Mesh network node to achieve time synchronization of the Mesh network. In the broadcast data structure of the Mesh control message, since the timestamp is set separately in the Mesh protocol structure, the Mesh network receiving node does not need to decrypt and modify it layer by layer, and can directly and timely obtain the external relative execution time in the timestamp, and then complete the network synchronization, thereby improving the accuracy of the device synchronization operation of the Mesh network node; at the same time, the relative time method is used to achieve the synchronization operation of the Mesh network node. The Mesh network node uses the internal crystal oscillator for timing. The device of the Mesh network node does not need to quickly resynchronize the network clock after power failure and power on again, which can further improve the accuracy of the device synchronization operation of the Mesh network node in the Mesh network.
结合图5所示,本公开实施例提供一种用于无线网状Mesh网络的同步方法,同步方法包括以下步骤:As shown in FIG5 , the embodiment of the present disclosure provides a synchronization method for a wireless mesh network, and the synchronization method includes the following steps:
S501:获得Mesh网络节点接收的Mesh控制消息;其中,Mesh控制消息的广播数据结构包括Mesh协议结构和位于Mesh协议结构后的时间戳。S501: Obtain a Mesh control message received by a Mesh network node; wherein the broadcast data structure of the Mesh control message includes a Mesh protocol structure and a timestamp after the Mesh protocol structure.
S502:确定时间戳中的外部相对执行时间。S502: Determine the external relative execution time in the timestamp.
S503:根据外部相对执行时间修正Mesh网络节点保存的内部相对执行时间。S503: Correct the internal relative execution time saved by the Mesh network node according to the external relative execution time.
S504:在Mesh网络节点为中继节点的情况下,修正Mesh网络节点的中继Mesh控制消息中的中继相对执行时间。S504: When the Mesh network node is a relay node, correct the relay relative execution time in the relay Mesh control message of the Mesh network node.
S505:将修改后的中继Mesh控制消息转发到其他Mesh网络节点。S505: Forward the modified relay Mesh control message to other Mesh network nodes.
Mesh网络中继节点修正Mesh网络节点的中继Mesh控制消息中的中继相对执行时间后,将修改后的中继Mesh控制消息转发到其他Mesh网络节点。After the Mesh network relay node corrects the relay relative execution time in the relay Mesh control message of the Mesh network node, it forwards the modified relay Mesh control message to other Mesh network nodes.
本公开实施例中,在Mesh网络节点为中继节点的情况下,修正Mesh网络节点的中继Mesh控制消息中的中继相对执行时间。下一Mesh网络节点利用修正后的第三相对执行时间来进行Mesh网络的同步更新,提升了Mesh网络同步更新的准确性与一致性。In the embodiment of the present disclosure, when the Mesh network node is a relay node, the relay relative execution time in the relay Mesh control message of the Mesh network node is corrected. The next Mesh network node uses the corrected third relative execution time to perform synchronous update of the Mesh network, thereby improving the accuracy and consistency of synchronous update of the Mesh network.
在一些实施例中,用于无线网状Mesh网络的同步方法还包括:根据系统时钟,更新Mesh网络节点保存的内部相对执行时间。In some embodiments, the synchronization method for a wireless mesh network further includes: updating the internal relative execution time stored by the mesh network node according to the system clock.
Mesh网络节点根据内部的系统时钟,不断地更新该相对执行时间,例如启动定时器,最小周期中断,每次中断触发时,将内部变量中保存的相对执行时间减去中断周期,获得更新后的相对执行时间,并更新至Mesh网络节点的内部变量中。The Mesh network node continuously updates the relative execution time according to the internal system clock, such as starting the timer and the minimum period interrupt. Each time the interrupt is triggered, the relative execution time saved in the internal variable is subtracted from the interrupt period to obtain the updated relative execution time, which is then updated to the internal variable of the Mesh network node.
根据系统时钟,更新Mesh网络节点保存的内部相对执行时间,在内部相对执行时间到达时,Mesh网络节点的设备执行动作,实现Mesh网络同步操作,通过提高内部相对执行时间的精准性,进一步提升Mesh网络中的Mesh网络节点的设备实现同步操作的准确性。According to the system clock, the internal relative execution time saved by the Mesh network node is updated. When the internal relative execution time is reached, the device of the Mesh network node executes the action to realize the synchronous operation of the Mesh network. By improving the accuracy of the internal relative execution time, the accuracy of the synchronous operation of the devices of the Mesh network nodes in the Mesh network is further improved.
结合图8所示本公开实施例提供一种用于无线网状Mesh网络的同步装置,包括处理器(processor)80和存储器(memory)81,还可以包括通信接口(Communication Interface)
82和总线83。其中,处理器80、通信接口82、存储器81可以通过总线83完成相互间的通信。通信接口82可以用于信息传输。处理器80可以调用存储器81中的逻辑指令,以执行上述实施例的用于无线网状Mesh网络的同步方法。In conjunction with the embodiment of the present disclosure shown in FIG8 , a synchronization device for a wireless mesh network is provided, including a processor (processor) 80 and a memory (memory) 81, and may also include a communication interface (Communication Interface) 82 and bus 83. The processor 80, the communication interface 82, and the memory 81 can communicate with each other through the bus 83. The communication interface 82 can be used for information transmission. The processor 80 can call the logic instructions in the memory 81 to execute the synchronization method for the wireless mesh network of the above embodiment.
此外,上述的存储器81中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。In addition, the logic instructions in the above-mentioned memory 81 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
存储器81作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序,如本公开实施例中的方法对应的程序指令/模块。处理器80通过运行存储在存储器81中的程序指令/模块,从而执行功能应用以及数据处理,即实现上述方法实施例中的用于无线网状Mesh网络的同步方法。The memory 81 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions/modules corresponding to the method in the embodiment of the present disclosure. The processor 80 executes the functional application and data processing by running the program instructions/modules stored in the memory 81, that is, the synchronization method for the wireless mesh network in the above method embodiment is implemented.
存储器81可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端设备的使用所创建的数据等。此外,存储器81可以包括高速随机存取存储器,还可以包括非易失性存储器。The memory 81 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 81 may include a high-speed random access memory and may also include a non-volatile memory.
采用本公开实施例提供的用于无线网状Mesh网络的同步装置,获得Mesh网络节点接收的Mesh控制消息中的外部相对执行时间后,比较外部相对执行时间和Mesh网络节点保存的内部相对执行时间的大小,并在外部相对执行时间小于内部相对执行时间的情况下,及时修正内部相对执行时间。这样,采用相对时间的方式来实现Mesh网络节点的同步操作,Mesh网络节点利用内部晶振计时,Mesh网络节点的设备在断电并重新上电后无需快速重新同步网络时钟,能够提高Mesh网络中的Mesh网络节点的设备实现同步操作的准确性。By using the synchronization device for wireless mesh Mesh network provided by the embodiment of the present disclosure, after obtaining the external relative execution time in the Mesh control message received by the Mesh network node, the external relative execution time is compared with the internal relative execution time saved by the Mesh network node, and when the external relative execution time is less than the internal relative execution time, the internal relative execution time is corrected in time. In this way, the synchronization operation of the Mesh network node is realized by using the relative time method, the Mesh network node uses the internal crystal oscillator for timing, and the device of the Mesh network node does not need to quickly resynchronize the network clock after power failure and power on again, which can improve the accuracy of the synchronization operation of the device of the Mesh network node in the Mesh network.
结合图9所示,本公开实施例提供了一种电子设备(例如:计算机、服务器等)90,包括:电子设备主体,以及上述的用于无线网状Mesh网络的同步装置91。用于无线网状Mesh网络的同步装置91被安装于电子设备主体。这里所表述的安装关系,并不仅限于在产品内部放置,还包括了与产品的其他元器件的安装连接,包括但不限于物理连接、电性连接或者信号传输连接等。本领域技术人员可以理解的是,用于无线网状Mesh网络的同步装置91可以适配于可行的电子设备主体,进而实现其他可行的实施例。As shown in FIG9 , an embodiment of the present disclosure provides an electronic device (e.g., a computer, a server, etc.) 90, including: an electronic device body, and the above-mentioned synchronization device 91 for a wireless mesh Mesh network. The synchronization device 91 for a wireless mesh Mesh network is installed on the electronic device body. The installation relationship described here is not limited to placement inside the product, but also includes installation connections with other components of the product, including but not limited to physical connections, electrical connections, or signal transmission connections. It can be understood by those skilled in the art that the synchronization device 91 for a wireless mesh Mesh network can be adapted to a feasible electronic device body, thereby realizing other feasible embodiments.
本公开实施例提供了一种计算机程序,当所述计算机程序被计算机执行时,使所述计算机实现上述用于无线网状Mesh网络的同步方法。The embodiment of the present disclosure provides a computer program. When the computer program is executed by a computer, the computer implements the above-mentioned synchronization method for a wireless mesh network.
本公开实施例提供了一种计算机程序产品,所述计算机程序产品包括存储在计算机可读存储介质上的计算机指令,当所述程序指令被计算机执行时,使所述计算机实现上述用于无线网状Mesh网络的同步方法。An embodiment of the present disclosure provides a computer program product, which includes computer instructions stored on a computer-readable storage medium. When the program instructions are executed by a computer, the computer implements the above-mentioned synchronization method for a wireless mesh network.
本公开实施例提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算
机可执行指令设置为执行上述用于无线网状Mesh网络的同步方法。The present disclosure provides a computer-readable storage medium storing computer-executable instructions. The machine executable instructions are configured to execute the above-mentioned synchronization method for a wireless mesh network.
上述的计算机可读存储介质可以是暂态计算机可读存储介质,也可以是非暂态计算机可读存储介质。The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
本公开实施例的技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括一个或多个指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开实施例所述方法的全部或部分步骤。而前述的存储介质可以是非暂态存储介质,包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等多种可以存储程序代码的介质,也可以是暂态存储介质。The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.
本公开实施例的技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括一个或多个指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开实施例所述方法的全部或部分步骤。而前述的存储介质可以是非暂态存储介质,包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等多种可以存储程序代码的介质,也可以是暂态存储介质。The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.
以上描述和附图充分地示出了本公开的实施例,以使本领域的技术人员能够实践它们。其他实施例可以包括结构的、逻辑的、电气的、过程的以及其他的改变。实施例仅代表可能的变化。除非明确要求,否则单独的部件和功能是可选的,并且操作的顺序可以变化。一些实施例的部分和特征可以被包括在或替换其他实施例的部分和特征。本公开实施例的范围包括权利要求书的整个范围,以及权利要求书的所有可获得的等同物。当用于本申请中时,虽然术语“第一”、“第二”等可能会在本申请中使用以描述各元件,但这些元件不应受到这些术语的限制。这些术语仅用于将一个元件与另一个元件区别开。例如,在不改变描述的含义的情况下,第一元件可以叫做第二元件,并且同样第,第二元件可以叫做第一元件,只要所有出现的“第一元件”一致重命名并且所有出现的“第二元件”一致重命名即可。第一元件和第二元件都是元件,但可以不是相同的元件。而且,本申请中使用的用词仅用于描述实施例并且不用于限制权利要求。如在实施例以及权利要求的描述中使用的,除非上下文清楚地表明,否则单数形式的“一个”(a)、“一个”(an)和“所述”(the)旨在同样包括复数形式。类似地,如在本申请中所使用的术语“和/或”是指包含一个或一个以上相关联的列出的任何以及所有可能的组合。另外,当用于本申请中时,术语“包括”(comprise)及其变型“包括”(comprises)和/或包括(comprising)等指陈述的特征、整体、步骤、操作、元素,和/或组件的存在,但不排除一个或一个以上其它特
征、整体、步骤、操作、元素、组件和/或这些的分组的存在或添加。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法或者设备中还存在另外的相同要素。本文中,每个实施例重点说明的可以是与其他实施例的不同之处,各个实施例之间相同相似部分可以互相参见。对于实施例公开的方法、产品等而言,如果其与实施例公开的方法部分相对应,那么相关之处可以参见方法部分的描述。The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, individual components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. The scope of the embodiments of the present disclosure includes the entire scope of the claims, and all available equivalents of the claims. When used in this application, although the terms "first", "second", etc. may be used in this application to describe each element, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, without changing the meaning of the description, the first element may be called the second element, and similarly, the second element may be called the first element, as long as all occurrences of the "first element" are renamed consistently and all occurrences of the "second element" are renamed consistently. The first element and the second element are both elements, but may not be the same element. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term "and/or" as used in this application refers to any and all possible combinations of one or more of the associated listed items. In addition, when used in this application, the term "comprise" and its variations "comprises" and/or comprising refer to the presence of stated features, integers, steps, operations, elements, and/or components, but do not exclude one or more other features. The existence or addition of a feature, an entirety, a step, an operation, an element, a component and/or a grouping of these. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method or device comprising the element. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts may refer to the description of the method part.
本领域技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,可以取决于技术方案的特定应用和设计约束条件。所述技术人员可以对每个特定的应用来使用不同方法以实现所描述的功能,但是这种实现不应认为超出本公开实施例的范围。所述技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
本文所披露的实施例中,所揭露的方法、产品(包括但不限于装置、设备等),可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,可以仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例。另外,在本公开实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
附图中的流程图和框图显示了根据本公开实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这可以依所涉及的功能而定。在附图中的流程图和框图所对应的描述中,不同的方框所对应的操作或步骤也可以以不同于描述中所披露的顺序发生,有时不同的操作或步骤之间不存在特定的顺序。例如,两个连续的操作或步骤实际上
可以基本并行地执行,它们有时也可以按相反的顺序执行,这可以依所涉及的功能而定。框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
The flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the systems, methods, and computer program products according to the embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a portion of a code, and the module, program segment, or a portion of a code contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the boxes may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes may actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different boxes may also occur in an order different from that disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually occur in an order different from that disclosed in the description. The operations may be performed substantially in parallel, or they may sometimes be performed in reverse order, depending on the functions involved. Each block in the block diagram and/or flow chart, and combinations of blocks in the block diagram and/or flow chart, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims (12)
- 一种用于无线网状Mesh网络的同步方法,所述Mesh网络包括彼此连接的多个Mesh网络节点;所述同步方法包括:A synchronization method for a wireless mesh network, wherein the mesh network includes a plurality of mesh network nodes connected to each other; the synchronization method includes:获得Mesh网络节点接收的Mesh控制消息中的外部相对执行时间;Obtain the external relative execution time in the Mesh control message received by the Mesh network node;获得所述Mesh网络节点保存的内部相对执行时间;Obtaining the internal relative execution time saved by the Mesh network node;在所述外部相对执行时间小于所述内部相对执行时间的情况下,修正所述内部相对执行时间。When the external relative execution time is less than the internal relative execution time, the internal relative execution time is corrected.
- 根据权利要求1所述的同步方法,其中所述修正所述内部相对执行时间,包括:The synchronization method according to claim 1, wherein the correcting the internal relative execution time comprises:获得所述外部相对执行时间和所述内部相对执行时间的实际时间间隔;Obtaining an actual time interval between the external relative execution time and the internal relative execution time;在所述实际时间间隔小于时间间隔阈值的情况下,修正所述内部相对执行时间。When the actual time interval is smaller than the time interval threshold, the internal relative execution time is corrected.
- 根据权利要求1或2所述的同步方法,其中所述修正所述内部相对执行时间,包括:The synchronization method according to claim 1 or 2, wherein the correcting the internal relative execution time comprises:按照如下公式计算获得修正后的内部相对执行时间:
T21=T1-T01-Ts1 The corrected internal relative execution time is calculated according to the following formula:
T21 = T1 - T01 - Ts1其中,T21为修正后的内部相对执行时间,T1为外部相对执行时间,T01为Mesh网络节点的第一内部处理时间,Ts1为第一随机延迟时间。Wherein, T 21 is the corrected internal relative execution time, T 1 is the external relative execution time, T 01 is the first internal processing time of the Mesh network node, and T s1 is the first random delay time. - 根据权利要求1至3任一项所述的同步方法,其中还包括:The synchronization method according to any one of claims 1 to 3, further comprising:在所述Mesh网络节点为中继节点的情况下,获得第二随机延迟时间;When the Mesh network node is a relay node, obtaining a second random delay time;所述第二随机延迟时间后,将所述Mesh网络节点的中继Mesh控制消息转发到其他Mesh网络节点。After the second random delay time, the relay Mesh control message of the Mesh network node is forwarded to other Mesh network nodes.
- 根据权利要求1至4任一项所述的同步方法,其中还包括:The synchronization method according to any one of claims 1 to 4, further comprising:在所述外部相对执行时间大于所述内部相对执行时间的情况下,丢弃接收到的所述Mesh控制消息。In a case where the external relative execution time is greater than the internal relative execution time, the received Mesh control message is discarded.
- 根据权利要求1至5任一项所述的同步方法,其中还包括:The synchronization method according to any one of claims 1 to 5, further comprising:在所述外部相对执行时间小于所述内部相对执行时间,且,所述外部相对执行时间和所述内部相对执行时间的实际时间间隔大于时间间隔阈值的情况下,丢弃接收的所述Mesh控制消息。When the external relative execution time is less than the internal relative execution time and an actual time interval between the external relative execution time and the internal relative execution time is greater than a time interval threshold, the received Mesh control message is discarded.
- 根据权利要求1至6任一项所述的同步方法,其中所述Mesh控制消息的广播数据结构包括Mesh协议结构和位于所述Mesh协议结构后的时间戳。The synchronization method according to any one of claims 1 to 6, wherein the broadcast data structure of the Mesh control message includes a Mesh protocol structure and a timestamp located after the Mesh protocol structure.
- 根据权利要求7所述的同步方法,其中所述获得Mesh网络节点接收的Mesh控制消息中的外部相对执行时间,包括: The synchronization method according to claim 7, wherein obtaining the external relative execution time in the Mesh control message received by the Mesh network node comprises:识别所述Mesh控制消息的广播数据结构中的时间戳;Identifying a timestamp in a broadcast data structure of the Mesh control message;获得所述时间戳的执行时间字节中的相对执行时间;Obtaining the relative execution time in the execution time byte of the timestamp;将所述时间戳的执行时间字节中的相对执行时间作为所述外部相对执行时间。The relative execution time in the execution time byte of the timestamp is used as the external relative execution time.
- 一种用于无线网状Mesh网络的同步装置,包括处理器和存储有程序指令的存储器,其中所述处理器被配置为在执行所述程序指令时,执行以下步骤:A synchronization device for a wireless mesh network includes a processor and a memory storing program instructions, wherein the processor is configured to perform the following steps when executing the program instructions:获得Mesh网络节点接收的Mesh控制消息中的外部相对执行时间;Obtain the external relative execution time in the Mesh control message received by the Mesh network node;获得所述Mesh网络节点保存的内部相对执行时间;Obtaining the internal relative execution time saved by the Mesh network node;在所述外部相对执行时间小于所述内部相对执行时间的情况下,修正所述内部相对执行时间。When the external relative execution time is less than the internal relative execution time, the internal relative execution time is corrected.
- 一种电子设备,包括:An electronic device, comprising:电子设备主体;以及,an electronic device body; and,如权利要求9所述的用于无线网状Mesh网络的同步装置,被安装于所述电子设备主体。The synchronization device for a wireless mesh network as described in claim 9 is installed in the electronic device body.
- 一种计算机程序,当所述计算机程序被计算机执行时,使所述计算机实现如权利要求1至8任一项所述的用于无线网状Mesh网络的同步方法。A computer program, when executed by a computer, enables the computer to implement the synchronization method for a wireless mesh network according to any one of claims 1 to 8.
- 一种计算机程序产品,所述计算机程序产品包括存储在计算机可读存储介质上的计算机指令,当所述程序指令被计算机执行时,使所述计算机实现如权利要求1至8任一项所述的用于无线网状Mesh网络的同步方法。 A computer program product, comprising computer instructions stored on a computer-readable storage medium, wherein when the program instructions are executed by a computer, the computer implements the synchronization method for a wireless mesh network as claimed in any one of claims 1 to 8.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211607106.9A CN116321399A (en) | 2022-12-14 | 2022-12-14 | Synchronization method and device for wireless Mesh network and electronic equipment |
CN202211607106.9 | 2022-12-14 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024124755A1 true WO2024124755A1 (en) | 2024-06-20 |
Family
ID=86787527
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/087765 WO2024124755A1 (en) | 2022-12-14 | 2023-04-12 | Synchronization method and apparatus for wireless mesh network, and electronic device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN116321399A (en) |
WO (1) | WO2024124755A1 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102377558A (en) * | 2010-08-24 | 2012-03-14 | 西门子公司 | System and method for time synchronization in communication network |
CN110224777A (en) * | 2019-06-05 | 2019-09-10 | 深圳市英特瑞半导体科技有限公司 | A kind of method and its system based on 1588 agreement passing times |
CN114465689A (en) * | 2021-12-23 | 2022-05-10 | 东莞市李群自动化技术有限公司 | Method, system, equipment and storage medium for synchronously processing signal instructions of channel group |
CN114765586A (en) * | 2021-01-13 | 2022-07-19 | 华为技术有限公司 | Method, device and system for detecting time synchronization performance |
-
2022
- 2022-12-14 CN CN202211607106.9A patent/CN116321399A/en active Pending
-
2023
- 2023-04-12 WO PCT/CN2023/087765 patent/WO2024124755A1/en unknown
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102377558A (en) * | 2010-08-24 | 2012-03-14 | 西门子公司 | System and method for time synchronization in communication network |
CN110224777A (en) * | 2019-06-05 | 2019-09-10 | 深圳市英特瑞半导体科技有限公司 | A kind of method and its system based on 1588 agreement passing times |
CN114765586A (en) * | 2021-01-13 | 2022-07-19 | 华为技术有限公司 | Method, device and system for detecting time synchronization performance |
CN114465689A (en) * | 2021-12-23 | 2022-05-10 | 东莞市李群自动化技术有限公司 | Method, system, equipment and storage medium for synchronously processing signal instructions of channel group |
Also Published As
Publication number | Publication date |
---|---|
CN116321399A (en) | 2023-06-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8914662B2 (en) | Implementing transparent clock by correcting time information carried in data using residence time information | |
EP2882233B1 (en) | Service agent method, modem, and terminal | |
TWI429236B (en) | Coordinated timing network configuration parameter update procedure | |
CN101511042A (en) | Data synchronization method and device | |
WO2024124756A1 (en) | Synchronization method and apparatus for wireless mesh network, and electronic device | |
CN108293236A (en) | Method, corresponding user equipment and the network node of time unifying timer for redefining cordless communication network | |
US9730172B2 (en) | Base station device and method of updating counter of base station device | |
US11398875B2 (en) | Simplified synchronized ethernet implementation | |
CA3073612A1 (en) | Method and device for controlling frequency hopping transmitter and receiver | |
CN111511013B (en) | Method, electronic device, and computer storage medium for synchronizing control signals | |
JP2009231885A (en) | System and method for synchronization between phs base stations | |
US8462779B2 (en) | Frame transfer apparatus and frame transfer method | |
WO2024124755A1 (en) | Synchronization method and apparatus for wireless mesh network, and electronic device | |
JP2018528680A (en) | Anchor master AM management method and node | |
CN102404104B (en) | Adaptive synchronicity method and system based on different delayed time mechanism | |
JP2013172442A (en) | Electronic device, communication system, and computer program | |
CN104767605A (en) | Industrial Ethernet synchronization method and device | |
JP2015106916A (en) | Data transmission system and method | |
CN113748715B (en) | Cell group configuration in a split base station architecture | |
JP6085864B2 (en) | Time synchronization system, time synchronization method, slave node, and computer program | |
JP6676202B2 (en) | Anchor master AM management method and node | |
CN111083805B (en) | DRX configuration method and device | |
KR20220043904A (en) | Method for performing bmca of 5g system operating as tsn bridge | |
JP6051658B2 (en) | Wireless communication apparatus, wireless communication method and program | |
KR20060113834A (en) | Periodic synchronus method for start of super-frame in residential ethernet |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23901969 Country of ref document: EP Kind code of ref document: A1 |