Synchronization method and apparatus for wireless mesh network, and electronic device

By using relative time in the Bluetooth Mesh network, comparing external and internal execution times and correcting the internal time, the problem of inaccurate synchronization after device power failure is solved, achieving higher synchronization accuracy and consistency.

CN116321399BActive Publication Date: 2026-04-17HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD
Filing Date
2022-12-14
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Bluetooth Mesh networks cannot quickly resynchronize the network clock after a device is powered off and then powered on again, resulting in inaccurate synchronization.

Method used

The synchronization of Mesh network nodes is performed using a relative time approach. By comparing the external relative execution time with the internal relative execution time, the internal relative execution time is corrected. The internal crystal oscillator is used for timing, avoiding frequent network clock synchronization.

Benefits of technology

It improves the accuracy of synchronization operations of Mesh network node devices after power failure and power restoration, reduces network load and the possibility of control failure, and enhances synchronization consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116321399B_ABST
    Figure CN116321399B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of wireless Mesh networks, and discloses a synchronization method for a wireless Mesh network, wherein the Mesh network comprises a plurality of Mesh network nodes connected to each other, the synchronization method comprises the following steps: obtaining external relative execution time in a Mesh control message received by a Mesh network node; obtaining internal relative execution time saved by the Mesh network node; and correcting the internal relative execution time in the case that the external relative execution time is less than the internal relative execution time. The synchronization operation of the Mesh network node is realized by using the relative time mode, the Mesh network node is clocked by using an internal crystal oscillator, the device of the Mesh network node does not need to quickly re-synchronize the network clock after being powered off and then powered on, and the accuracy of the synchronization operation of the device of the Mesh network node in the Mesh network can be improved. The application further discloses a synchronization device for a wireless Mesh network and an electronic equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of wireless mesh network technology, and for example to a synchronization method, apparatus, and electronic device for wireless mesh networks. Background Technology

[0002] Wireless mesh networks are high-capacity, high-bandwidth distributed networks that can be seen as a fusion of Wireless Local Area Networks (WLANs) and Ad hoc mobile ad hoc networks, leveraging the advantages of both. In high-capacity Bluetooth mesh networks, due to the large coverage area, a group control command message needs to be relayed through multiple mesh network nodes to reach the furthest node. No matter how optimized the relay strategy of the mesh network nodes is, there is always time involved in receiving, processing, and relaying messages. After multiple relays, this time consumption increases exponentially, causing devices in the mesh network to receive mesh control messages at different times. If the mesh network coverage area is very large, it can cause visually inconsistent device responses across mesh network nodes. For example, when turning on all the lights, if the mesh network coverage area is large, it is clearly visible that the lights turn on in batches from near to far, rather than simultaneously as seen by the naked eye.

[0003] Currently, Bluetooth Mesh networks use absolute time for synchronization, requiring the master node to periodically send synchronization signals to synchronize the entire Mesh network. These synchronization signals contain the absolute time of the action to be performed; for example, the synchronization signal might tell all devices on the Mesh network to perform an action at 11:00:05. Because Bluetooth Mesh networks use absolute time for synchronization, devices on the Mesh network nodes need to quickly resynchronize their network clocks every time they are powered off and then back on.

[0004] In the process of implementing the embodiments of this disclosure, at least the following problems were found in the related art:

[0005] Bluetooth Mesh networks use absolute time for network synchronization. If the devices on a Mesh network node cannot quickly resynchronize their network clocks after each power outage and power-on, it can easily lead to the devices on that Mesh network node failing to achieve accurate synchronization.

[0006] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0007] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.

[0008] This disclosure provides a synchronization method, apparatus, and electronic device for wireless mesh networks. It uses a relative time approach to synchronize mesh control messages, thereby improving the accuracy of synchronization operations for mesh network nodes.

[0009] In some embodiments, a synchronization method for a wireless mesh network, the mesh network including multiple 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 stored by the mesh network node; and correcting the internal relative execution time if the external relative execution time is less than the internal relative execution time.

[0010] In some embodiments, the synchronization apparatus for a wireless mesh network includes a processor and a memory storing program instructions, the processor being configured to execute the aforementioned synchronization method for a wireless mesh network when executing the program instructions.

[0011] In some embodiments, the electronic device includes: an electronic device body; and the aforementioned synchronization device for a wireless mesh network, which is mounted on the electronic device body.

[0012] The synchronization method, apparatus, and electronic device for wireless mesh networks provided in this disclosure can achieve the following technical effects:

[0013] In this disclosed technical solution, 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 stored by the Mesh network node. If the external relative execution time is less than the internal relative execution time, the internal relative execution time is corrected in a timely manner. This method of using relative time to achieve synchronization of Mesh network nodes, with the Mesh network node utilizing its internal crystal oscillator for timing, eliminates the need for rapid resynchronization of the network clock after power failure and restoration, thus improving the accuracy of synchronization among Mesh network nodes.

[0014] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description

[0015] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are shown as similar elements. The drawings are not to be scaled. And wherein:

[0016] Figure 1 This is a flowchart illustrating a synchronization method for a wireless mesh network provided in an embodiment of this disclosure;

[0017] Figure 2 This is a flowchart illustrating another synchronization method for a wireless mesh network provided in an embodiment of this disclosure;

[0018] Figure 3 This is a flowchart illustrating another synchronization method for a wireless mesh network provided in an embodiment of this disclosure;

[0019] Figure 4 This is a flowchart illustrating another synchronization method for a wireless mesh network provided in an embodiment of this disclosure;

[0020] Figure 5 This is a flowchart illustrating another synchronization method for a wireless mesh network provided in an embodiment of this disclosure;

[0021] Figure 6 This is a schematic diagram illustrating a synchronization method for a wireless mesh network provided in an embodiment of this disclosure.

[0022] Figure 7 This is a schematic diagram illustrating another synchronization method for wireless mesh networks provided in this disclosure.

[0023] Figure 8 This is a schematic diagram of the structure of a synchronization device for a wireless mesh network provided in an embodiment of this disclosure;

[0024] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0025] To provide a more detailed understanding of the features and technical content of the embodiments of this disclosure, the implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this disclosure. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.

[0026] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0027] Unless otherwise stated, the term "multiple" means two or more. In embodiments of this disclosure, the character " / " indicates that the preceding and following objects are in an "OR" relationship. For example, A / B means: A or B. The term "and / or" describes an association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B. The term "correspondence" can refer to an association or binding relationship; A corresponding to B means that there is an association or binding relationship between A and B.

[0028] Wireless mesh networks, also known as "multi-hop networks," are dynamic and continuously expandable network architectures that enable transmission between wireless devices. A large number of mesh network nodes (the terminal devices of the mesh network nodes) can automatically connect wirelessly to form a mesh structure. Each mesh network node can only communicate with its neighboring mesh network nodes, making it a self-organizing and self-managing intelligent network that can build a resilient network without a backbone.

[0029] In high-capacity Bluetooth Mesh networks, the core idea for solving the problem of consistent response from Mesh network nodes is clock synchronization and delayed execution. That is, the Mesh control message sent is a delayed execution message, which contains the specific value of the delay time.

[0030] Currently, Bluetooth Mesh networks use absolute time for synchronization, requiring the master node to periodically send synchronization signals to synchronize the entire Mesh network. Using absolute time for synchronization increases the network's load, and conflicts between synchronization and control messages increase the likelihood of control failures. Furthermore, after a device in the Mesh network is powered off and then powered back on, the Mesh network node needs to quickly resynchronize its network clock to ensure proper synchronization control.

[0031] In this embodiment of the disclosure, the Mesh network uses relative time to synchronize control messages. The Mesh network control messages do not specify absolute time, but instead include relative time, with the moment the Mesh network control message is received as the anchor point. When a Mesh network node receives a Mesh network control message, it starts using a crystal oscillator to time, performs an action when the delay time (relative time) arrives, and continuously listens for Mesh network control messages in the air.

[0032] Combination Figure 1 As shown, this disclosure provides a synchronization method for a wireless mesh network, the mesh network including multiple interconnected mesh network nodes, the synchronization method including the following steps:

[0033] S101: Obtain the external relative execution time in the Mesh control message received by the Mesh network node.

[0034] When a mesh network node receives a mesh control message relayed by a mobile phone or other mesh network nodes, it extracts the relative execution time (also known as delay time or execution time) from the mesh control message. Specifically, when a mesh network node first receives a mesh control message relayed by a mobile phone or other mesh network nodes, the relative execution time extracted from the mesh control message is the internal relative execution time; when a mesh network node receives a mesh control message relayed by a mobile phone or other mesh network nodes again, the relative execution time extracted from the mesh control message is the external relative execution time.

[0035] Optionally, the broadcast data structure of the Mesh control message includes a Mesh protocol structure and a timestamp following the Mesh protocol structure.

[0036] The Mesh protocol structure for Mesh control messages includes the Model Layer, Foundation Model Layer, Access Layer, Upper Transport Layer, Lower Transport Layer, Network Layer, Bearer Layer, and Bluetooth Low Energy Core Specification layer, which are connected in sequence.

[0037] If the relative execution time field of the Mesh control message is set in the Mesh protocol structure (such as the access layer or bearer layer), the Mesh control message will undergo layers of encryption and obfuscation by the Mesh network relay nodes during relay. The receiving nodes in the Mesh network will 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 on the Mesh protocol, reduces relay efficiency, and disrupts the Mesh protocol architecture.

[0038] By improving the broadcast data structure of Mesh control messages, it is split into a Mesh protocol structure and a timestamp located after the Mesh protocol structure. In the broadcast data structure of Mesh control messages, since the timestamp is set separately after the Mesh protocol structure, the receiving nodes of the Mesh network do not need to decrypt and modify it layer by layer. They can directly and promptly obtain the external relative execution time in the timestamp to complete network synchronization, thereby improving the accuracy of device synchronization operations of Mesh network nodes.

[0039] 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.

[0040] By utilizing the external relative execution time (delay time) in the timestamp to update the internal relative execution time stored by the Mesh network nodes, time synchronization of the Mesh network is achieved. In the broadcast data structure of Mesh control messages, 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. They can directly and promptly obtain the external relative execution time in the timestamp to complete network synchronization, thereby improving the accuracy of device synchronization operations of Mesh network nodes.

[0041] S102: Obtain the internal relative execution time stored by the Mesh network node.

[0042] In practical applications, the internal relative execution time is stored in the internal variables of the Mesh network node. The Mesh network node continuously updates this relative execution time according to its internal system clock, for example, by starting a timer or a minimum-cycle interrupt. Each time an interrupt is triggered, the relative execution time stored in the internal variable is subtracted from the interrupt cycle to obtain the updated relative execution time, which is then updated in the Mesh network node's internal variables.

[0043] S103: When the external relative execution time is less than the internal relative execution time, adjust the internal relative execution time.

[0044] During the synchronization process of a mesh network, the master control node (the initiator of mesh network synchronization) sends multiple (e.g., 8) repeated control packets (mesh control messages) to improve the success rate of mesh network synchronization. These repeated control packets are sent serially, with a preset interval between each pair of adjacent repeated control packets (e.g., the preset interval ranges from 20-30ms). Because there is a time difference between the first and last repeated control packets (e.g., a maximum difference of 210ms), it can introduce errors into the control consistency of the devices on the mesh network nodes.

[0045] Combined as follows Figure 6 , Figure 7 As shown, the mobile phone (the master control node of the Mesh network) continuously sends eight repetitive control packets (Mesh control messages) at preset time intervals. The external relative execution time of each of the eight Mesh control messages is 200ms. The relay time within the Mesh network node is 20ms.

[0046] The external relative execution time of the first Mesh control message received by Mesh Network Node 1 from the mobile phone is 200ms. The external relative execution time of the first Mesh control message relayed by Mesh Network Node 2 from Mesh Network Node 1 is 180ms. The external relative execution time of the first Mesh control message relayed by Mesh Network Node 3 from Mesh Network Node 2 is 160ms. The external relative execution time of the first Mesh control message relayed by Mesh Network Node 4 from Mesh Network Node 3 is 140ms. The external relative execution time of the first Mesh control message relayed by Mesh Network Node 5 from Mesh Network Node 4 is 120ms. The external relative execution time of the first Mesh control message relayed by Mesh Network Node 6 from Mesh Network Node 5 is 100ms.

[0047] The external relative execution time of the fourth Mesh control message received by Mesh network node 7 from the mobile phone is 200ms. The external relative execution time of the fourth Mesh control message relayed by Mesh network node 6 from Mesh network node 7 is 180ms. The external relative execution time of the first Mesh control message relayed by Mesh network node 6 from Mesh network node 5 is 160ms.

[0048] For Mesh network node 7, the external relative execution time in the fourth Mesh control message it receives is 200ms, but this Mesh control message has been delayed by 60ms (taking the preset duration of 20ms as an example). For Mesh network node 6, it considers the received external relative execution time of 100ms to be less than the saved internal relative execution time of 160ms, and therefore corrects the saved internal relative execution time (to 100ms).

[0049] Therefore, Mesh network nodes need to continuously monitor the external relative execution time in subsequent Mesh control messages and correct the internal relative execution time if the external relative execution time is less than the internal relative execution time. This improves the consistency of Mesh network synchronization.

[0050] Optionally, the internal relative execution time is corrected by: obtaining the actual time interval between the external relative execution time and the internal relative execution time; and correcting the internal relative execution time if the actual time interval is less than a time interval threshold.

[0051] The time interval threshold can range from [80ms, 100ms], for example, 80ms, 85ms, 90ms, 95ms, and 100ms. When the actual time interval between the external relative execution time and the internal relative execution time in a Mesh control message is greater than the time interval threshold, it indicates that the Mesh control message containing that external relative execution time is highly likely to be an interference message caused by the retransmission of a previous Mesh control message. For example, before sending this Mesh control message, for other Mesh control messages sent by the phone previously that have been retransmitted but not dissipated, although the external relative time in the Mesh control message is much smaller than the internal relative time, it is clearly an interference message. Therefore, by judging the magnitude of the actual time interval between the external relative execution time and the internal relative execution time compared to the time interval threshold, it is determined whether the received Mesh control message is an interference message. This prevents Mesh network nodes from correcting their stored internal relative execution time based on interference information, and ensures that the Mesh network nodes execute actions when the internal relative execution time arrives, thereby improving the accuracy and consistency of Mesh network synchronization.

[0052] Optionally, the internal relative execution time is corrected, including calculating the corrected internal relative execution time according to the following formula:

[0053] T 21 =T1-T 01 -T s1

[0054] Among them, T 21T1 represents the corrected internal relative execution time, and T2 represents the external relative execution time. 01 T is the first internal processing time of a Mesh network node. s1 This is the first random delay time.

[0055] For example, the obtained external relative execution time T1 is 100ms, and the first internal processing time T of the Mesh network node is... 01 The first random delay time T is 20ms. s1 If the time is 2ms, then the corrected second relative time is T. 21 =T1-T 01 -T s1 =100-20-2=78.

[0056] The internal relative execution time stored by Mesh network nodes is corrected by using external relative execution time, first internal processing time, and first random delay time, thereby improving the accuracy of the internal relative execution time. Mesh network nodes use the corrected internal relative execution time to perform synchronous updates of the Mesh network, improving the consistency of Mesh network synchronous updates.

[0057] The synchronization method for wireless mesh networks provided in this disclosure obtains the external relative execution time in the Mesh control message received by the Mesh network node, compares the external relative execution time with the internal relative execution time stored by the Mesh network node, and promptly corrects the internal relative execution time if the external relative execution time is less than the internal relative execution time. This method uses relative time to achieve synchronization of Mesh network nodes. Since the Mesh network node uses its internal crystal oscillator for timing, the device does not need to quickly resynchronize the network clock after power failure and power restoration, thus improving the accuracy of synchronization operations for the Mesh network nodes.

[0058] Combination Figure 2 As shown, this disclosure provides a synchronization method for a wireless mesh network, the mesh network including multiple interconnected mesh network nodes, the synchronization method including the following steps:

[0059] S201: Obtain the external relative execution time in the Mesh control message received by the Mesh network node.

[0060] S202: Obtain the internal relative execution time stored by the Mesh network node.

[0061] S203: If the external relative execution time is less than the internal relative execution time, adjust the internal relative execution time.

[0062] S204: When the Mesh network node is a relay node, obtain the second random delay time.

[0063] Second random delay time T s2 The value range is 1-10ms, for example 2ms, 3ms, 7ms, 10ms.

[0064] S205: After the second random delay time, the relay Mesh control message of the Mesh network node is forwarded to other Mesh network nodes.

[0065] Optionally, the relative execution time of the relay in the corrected relay Mesh control message can be calculated according to the following formula:

[0066] T 31 =T1-T 02 -T s1

[0067] Among them, T 31 The corrected relay relative execution time is T1, and the external relative execution time is T. 02 T is the second internal processing time of the Mesh network node. s1 This is the first random delay time.

[0068] For example, the acquired external relative execution time T1 is 100ms, and the second internal processing time T of the Mesh network node is... 02 The first random delay time T is 30ms. s1 If the time is 2ms, then the corrected third relative time is T. 31 =T1-T 02 -T s1 =100-30-2=68.

[0069] By adding a second random delay time, packet collisions between relay mesh control messages and other control messages can be effectively avoided. The accuracy of the relay relative execution time is improved by using the external relative execution time, the second internal processing time, and the first random delay time to correct the relay relative execution time in the mesh network relay nodes.

[0070] After correcting the relative execution time in the relay Mesh control message of the Mesh network node, the relay node forwards the modified relay Mesh control message to other Mesh network nodes.

[0071] In this embodiment, when a Mesh network node acts as a relay node, adding a second random delay time effectively prevents packet collisions between relay Mesh control messages and other control messages. Simultaneously, 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 Mesh network synchronization updates, improving the accuracy and consistency of Mesh network synchronization updates.

[0072] Combination Figure 3 As shown, this disclosure provides a synchronization method for a wireless mesh network, the mesh network including multiple interconnected mesh network nodes, the synchronization method including the following steps:

[0073] S301: Obtain the external relative execution time in the Mesh control message received by the Mesh network node.

[0074] S302: Obtain the internal relative execution time stored by the Mesh network node.

[0075] 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, the internal relative execution time is corrected.

[0076] S304: 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, discard the received Mesh control message.

[0077] S305: If the external relative execution time is greater than the internal relative execution time, discard the received Mesh control message.

[0078] After parsing and determining the external relative execution time in the Mesh control message, the Mesh network node compares it with the stored internal relative execution time. If the external relative execution time is less than the internal relative execution time, and the actual time interval between the external and internal relative execution times is less than a 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 and internal relative execution times is greater than the time interval threshold, it indicates that the Mesh control message containing this external relative execution time is highly likely to be interference caused by a retransmission of a 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 time is interference caused by a retransmission, and the received Mesh control message is discarded. This avoids the Mesh network node correcting its stored internal relative execution time based on interference information. When the internal relative execution time arrives, the Mesh network node executes the action, improving the accuracy and consistency of Mesh network synchronization.

[0079] Combination Figure 4 As shown, this disclosure provides a synchronization method for a wireless mesh network, the mesh network including multiple interconnected mesh network nodes, the synchronization method including the following steps:

[0080] S401: Obtain the Mesh control message received by the Mesh network node; wherein, the broadcast data structure of the Mesh control message includes the Mesh protocol structure and the timestamp located after the Mesh protocol structure.

[0081] Optionally, the timestamp includes a first preset number of length bytes, a second preset number of type bytes, and a third preset number of execution time bytes.

[0082] In practical applications, the timestamp format is 4 bytes, with the first preset byte size being 1 byte, the second preset byte size being 1 byte, and the third preset byte size being 2 bytes. The format of a 4-byte timestamp can be: length (1 byte) + AD Type (1 byte) + timestamp (2 bytes).

[0083] The Bluetooth Mesh protocol is implemented based on Bluetooth Low Energy (BLE) broadcast. BLE broadcast data is composed of one or more AD structures superimposed. A Mesh control message can be considered an independent AD structure. Due to its complex hierarchical structure, the payload space allocated to the access layer is limited to a maximum of 11 bytes. When the access layer's payload reaches 11 bytes, the BLE broadcast data has reached its maximum size (31 bytes), which is insufficient to accommodate another AD structure. Therefore, a 4-byte AD structure is added to the broadcast data structure of the Mesh control message to represent the timestamp.

[0084] The vendor model's mesh control message can only support a maximum of 7 bytes. After deducting the 3-byte vendor opcode, only 4 bytes of parameter payload remain. Evaluation and analysis show that the 4-byte parameter payload, after compression, can meet the execution requirements of common mesh network node devices (such as wall switches, light fixtures, or sensors). Therefore, this proves that the broadcast data structure for mesh control messages (7 bytes of access layer mesh protocol structure + 4 bytes of timestamp) is feasible.

[0085] For example, controlling the color change of a light is the most complex lighting control message, with the most dependent payloads. However, a 4-byte parameter payload can still meet user needs. The 4-byte parameter payload is as follows: Transaction ID (Tid) (1 byte) + Lightness (1 byte) + Hue (1 byte) + Saturation (1 byte). Here, the Transaction ID (Tid) is used to indicate the uniqueness of the message at the application layer. The three HLS parameters controlling the color originally required 2 bytes, but a control granularity of 256 is sufficient for user needs and will not affect the user experience; therefore, 1 byte can be used.

[0086] Therefore, the timestamp format design in this embodiment of the present disclosure, without affecting the original implementation function of the Mesh control message, allows the Mesh network receiving node to directly and promptly obtain the external relative execution time in the timestamp after the timestamp is set separately in the Mesh protocol structure, without the need for layer-by-layer decryption and modification, thereby completing network synchronization and improving the accuracy of device synchronization operation of the Mesh network node.

[0087] S402: Determine the external relative execution time in the timestamp.

[0088] 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.

[0089] In practical applications, firstly, the total number of bytes in the broadcast data structure of the Mesh control message and the number of bytes in the Mesh protocol structure are determined, and the number of bytes for the timestamp is calculated based on these figures. The calculated number of bytes for the timestamp is then verified against the pre-stored number of bytes for the timestamp. If the calculated number of bytes for the timestamp matches the pre-stored number of bytes, the timestamp in the broadcast data structure of the Mesh control message is determined according to the (calculated / pre-stored) timestamp count. Then, the relative execution time (external relative execution time) is obtained based on the third preset number of bytes relative to the execution time in the timestamp.

[0090] 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 it layer by layer. Furthermore, by verifying the number of bytes of the calculated timestamp with 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.

[0091] S403: Correct the internal relative execution time stored by the Mesh network node based on the external relative execution time.

[0092] Optionally, the internal relative execution time stored by the Mesh network node is corrected based on the external relative execution time, including: correcting the internal relative execution time when the external relative execution time is less than the internal relative execution time.

[0093] 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 monitors the external relative execution time in subsequent Mesh control messages. If the external relative execution time is less than the internal relative execution time, the node corrects the internal relative execution time to improve the accuracy and consistency of Mesh network synchronization.

[0094] The synchronization method for wireless mesh networks provided in this disclosure improves the broadcast data structure of Mesh control messages by splitting it into a Mesh protocol structure and a timestamp located after the Mesh protocol structure. The external relative execution time (delay time) in the timestamp is used to update the internal relative execution time stored by the Mesh network nodes, achieving time synchronization of the Mesh network. In the broadcast data structure of the Mesh control messages, since the timestamp is separately set after the Mesh protocol structure, the receiving nodes of the Mesh network do not need to decrypt and modify it layer by layer. They can directly and promptly obtain the external relative execution time in the timestamp, thereby completing network synchronization and improving the accuracy of device synchronization operations of the Mesh network nodes. Simultaneously, by using relative time to achieve synchronization operations of the Mesh network nodes, and since the Mesh network nodes use internal crystal oscillators for timing, the devices of the Mesh network nodes do not need to quickly resynchronize the network clock after power failure and power restoration, further improving the accuracy of device synchronization operations in the Mesh network.

[0095] Combination Figure 5 As shown, this disclosure provides a synchronization method for a wireless mesh network, the synchronization method including the following steps:

[0096] S501: Obtain the Mesh control message received by the Mesh network node; wherein, the broadcast data structure of the Mesh control message includes the Mesh protocol structure and the timestamp located after the Mesh protocol structure.

[0097] S502: Determine the external relative execution time in the timestamp.

[0098] S503: Correct the internal relative execution time stored by the Mesh network node based on the external relative execution time.

[0099] S504: When a Mesh network node is a relay node, correct the relay relative execution time in the relay Mesh control message of the Mesh network node.

[0100] S505: Forward the modified relay mesh control message to other mesh network nodes.

[0101] After correcting the relative execution time in the relay Mesh control message of the Mesh network node, the relay node forwards the modified relay Mesh control message to other Mesh network nodes.

[0102] In this embodiment, when a 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 Mesh network synchronization updates, improving the accuracy and consistency of Mesh network synchronization updates.

[0103] In some embodiments, the synchronization method for a wireless mesh network further includes updating the internal relative execution time stored by the mesh network nodes according to the system clock.

[0104] Mesh network nodes continuously update the relative execution time based on their internal system clock. For example, by starting a timer or a minimum-cycle interrupt, each time an interrupt is triggered, the relative execution time stored in the internal variable is subtracted from the interrupt cycle to obtain the updated relative execution time, which is then updated in the internal variable of the Mesh network node.

[0105] Based on the system clock, the internal relative execution time stored by the Mesh network nodes is updated. When the internal relative execution time arrives, the devices of the Mesh network nodes perform actions to achieve Mesh network synchronization. By improving the accuracy of the internal relative execution time, the accuracy of the synchronization operation of the devices of the Mesh network nodes in the Mesh network is further improved.

[0106] Combination Figure 8 The present disclosure provides a synchronization device for a wireless mesh network, including a processor 80 and a memory 81, and may further include a communication interface 82 and a bus 83. The processor 80, communication interface 82, and memory 81 can communicate with each other via the bus 83. The communication interface 82 can be used for information transmission. The processor 80 can call logical instructions in the memory 81 to execute the synchronization method for the wireless mesh network described in the above embodiment.

[0107] Furthermore, the logic instructions in the aforementioned memory 81 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0108] The memory 81, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor 80 executes functional applications and data processing by running the program instructions / modules stored in the memory 81, that is, implementing the synchronization method for wireless mesh networks in the above method embodiments.

[0109] The memory 81 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 81 may include high-speed random access memory and may also include non-volatile memory.

[0110] The synchronization device for wireless mesh networks provided in this disclosure obtains the external relative execution time in the Mesh control messages received by the Mesh network nodes, compares the external relative execution time with the internal relative execution time stored by the Mesh network nodes, and promptly corrects the internal relative execution time if the external relative execution time is less than the internal relative execution time. In this way, by using relative time to achieve synchronization of Mesh network nodes, and since the Mesh network nodes utilize internal crystal oscillators for timing, the devices in the Mesh network nodes do not need to quickly resynchronize the network clock after power failure and power restoration, thus improving the accuracy of synchronization operations of the devices in the Mesh network.

[0111] Combination Figure 9 As shown, this disclosure provides an electronic device (e.g., a computer, server, etc.) 90, including: an electronic device body and the aforementioned synchronization device 91 for a wireless mesh network. The synchronization device 91 for the wireless mesh network is installed in the electronic device body. The installation relationship described herein 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. Those skilled in the art will understand that the synchronization device 91 for the wireless mesh network can be adapted to feasible electronic device bodies to achieve other feasible embodiments.

[0112] This disclosure provides a computer program that, when executed by a computer, enables the computer to implement the above-described synchronization method for wireless mesh networks.

[0113] This disclosure provides a computer program product including computer instructions stored on a computer-readable storage medium, which, when executed by a computer, cause the computer to implement the above-described synchronization method for a wireless mesh network.

[0114] This disclosure provides a computer-readable storage medium storing computer-executable instructions configured to perform the above-described synchronization method for a wireless mesh network.

[0115] The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0116] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this disclosure. The aforementioned storage medium can be a non-transitory storage medium, including: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code; it can also be a transient storage medium.

[0117] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this disclosure. The aforementioned storage medium can be a non-transitory storage medium, including: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code; it can also be a transient storage medium.

[0118] The foregoing description and accompanying drawings fully illustrate embodiments of the present disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included or substituted for parts and features of other embodiments. The scope of the embodiments of this disclosure includes the entire scope of the claims and all available equivalents of the claims. While the terms “first,” “second,” etc., may be used in this application to describe elements, these elements should not be limited by these terms. These terms are used only to distinguish one element from another. For example, a first element may be called a second element without changing the meaning of the description, and similarly, a second element may be called a first element, provided that all occurrences of “first element” are consistently renamed and all occurrences of “second element” are consistently renamed. First and second elements are both elements, but may not be the same element. Moreover, the terminology used in this application is only for describing embodiments and is not intended to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “the” are intended to also include the plural forms. Similarly, the term “and / or” as used herein means including one or more of the associated listed elements and all possible combinations thereof. Additionally, when used herein, the terms “comprise” and its variations “comprises” and / or “comprising” refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase “comprising an…” does not exclude the presence of additional identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.

[0119] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0120] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed units may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to implement this embodiment according to actual needs. Furthermore, the functional units in the embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0121] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse 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 blocks may also occur in a different order than 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 be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

Claims

1. A synchronization method for a wireless mesh mesh network, characterized in that, The mesh network comprises multiple interconnected mesh network nodes; the synchronization method includes: Obtain the external relative execution time from the Mesh control messages received by the Mesh network nodes; Obtain the internal relative execution time stored by the Mesh network node; If the external relative execution time is less than the internal relative execution time, the internal relative execution time is adjusted. Specifically, when a Mesh network node first receives a Mesh control message relayed by a mobile phone or other Mesh network node, it extracts the relative execution time in the Mesh control message as the internal relative execution time; when a Mesh network node receives a Mesh control message relayed by a mobile phone or other Mesh network node again, it extracts the relative execution time in the Mesh control message as the external relative execution time.

2. The synchronization method of claim 1, wherein, The correction of the internal relative execution time includes: Obtain the actual time interval between the external relative execution time and the internal relative execution time; If the actual time interval is less than the time interval threshold, the internal relative execution time is corrected.

3. The synchronization method of claim 1, wherein, The correction of the internal relative execution time includes: The corrected internal relative execution time is calculated using the following formula: Among them, T 21 T1 represents the corrected internal relative execution time, and T2 represents the external relative execution time. 01 T is the first internal processing time of a Mesh network node. S1 This is the first random delay time.

4. The synchronization method of claim 1, wherein, Also includes: When the Mesh network node is a relay node, a second random delay time is obtained; After the second random delay time, the relay Mesh control message of the Mesh network node is forwarded to other Mesh network nodes.

5. The synchronization method according to claim 1, characterized in that, Also includes: If the external relative execution time is greater than the internal relative execution time, the received Mesh control message is discarded.

6. The synchronization method of claim 1, wherein, Also includes: 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 a time interval threshold, the received Mesh control message is discarded.

7. The synchronization method according to any one of claims 1 to 6, characterized in that, The broadcast data structure of the Mesh control message includes a Mesh protocol structure and a timestamp following the Mesh protocol structure.

8. The synchronization method of claim 7, wherein, The process of obtaining the external relative execution time in the Mesh control messages received by the Mesh network node includes: Identify the timestamp in the broadcast data structure of the Mesh control message; Obtain the relative execution time from the execution time bytes of the timestamp; The relative execution time in the execution time byte of the timestamp is used as the external relative execution time.

9. A synchronization device for a wireless mesh network, comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to perform the synchronization method for a wireless mesh network as described in any one of claims 1 to 8 when executing the program instructions.

10. An electronic device, comprising: include: The main body of the electronic device; and, The synchronization device for a wireless mesh network as described in claim 9 is installed on the main body of the electronic device.

Citation Information

Patent Citations

  • Clock synchronization method and device of wireless Mesh network

    CN115348659A