A method for global network time synchronization based on SFD interruption
By introducing the SFD interrupt mechanism and time header information element into the IEEE 802.15.4 protocol, the time synchronization problem of smart devices in the IEEE 802.15.4 protocol is solved, realizing low-power, low-cost microsecond-level network-wide time synchronization, which is suitable for Thread and ZigBee devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2026-03-17
AI Technical Summary
Existing IEEE 802.15.4 protocol smart devices suffer from high power consumption, cost sensitivity, and insufficient synchronization accuracy in time synchronization. In particular, the NTP protocol is not applicable to low-power, low-cost smart devices, and cannot achieve microsecond-level network-wide time synchronization.
By utilizing the SFD interrupt mechanism in the IEEE 802.15.4 protocol, and introducing time header information elements into the data frame, including the time synchronization sequence number and the current network time, time synchronization is triggered by the SFD interrupt, thereby achieving network-wide time synchronization.
It achieves low-power, low-cost microsecond-level time synchronization across the entire network, suitable for intelligent devices such as Thread and ZigBee, and supports more time-sensitive intelligent application scenarios.
Smart Images

Figure CN115529101B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this disclosure generally relate to the field of wireless communication, and more specifically to a network-wide time synchronization method based on SFD interrupts. Background Technology
[0002] Smart devices typically use crystal oscillators as their hardware clock source, such as quartz crystal oscillators. However, crystal oscillators drift due to factors like temperature, voltage, and humidity, causing frequency offset errors and resulting in accumulated time offset errors in the system. To achieve time synchronization between different smart devices, time synchronization protocols are commonly used. One of the most common and widely used time synchronization protocols is the Network Time Protocol (NTP). NTP ensures that system time errors remain within a certain range through periodic time synchronization, achieving millisecond-level accuracy on local area networks and tens of milliseconds on wide area networks. Other time synchronization protocols include PTP / OCP TAP, a hardware-based Ethernet high-precision time protocol that guarantees nanosecond-level synchronization accuracy. It is mainly used in high-precision time synchronization network systems, such as automotive Ethernet, telecommunications networks, and 5G communication networks.
[0003] However, for a range of standard wireless communication networks based on the IEEE 802.15.4 underlying protocol, such as the Thread protocol, ZigBee protocol, and UWB (Ultra Wide Band) protocol, they are typically used in low-power, low-cost smart devices. For these types of smart devices, NTP-based time synchronization schemes are not suitable, mainly for the following reasons:
[0004] Firstly, the NTP protocol requires an IP-accessible NTP server to perform time synchronization, but smart devices based on the 802.15.4 underlying protocol (such as ZigBee devices, Thread devices, etc.) do not support the IP protocol stack.
[0005] Secondly, the NTP time synchronization protocol requires periodically sending and receiving synchronization data frames. To achieve high-precision time synchronization, smart devices need to frequently interact with each other, increasing device power consumption.
[0006] Thirdly, smart devices based on the IEEE 802.15.4 underlying protocol are usually cost-sensitive, and the low-cost crystal oscillators they use will produce relatively large offsets, thus requiring more frequent time synchronization.
[0007] Therefore, there is an urgent need for a network-wide time synchronization method for smart devices based on the IEEE 802.15.4 protocol, which can take into account low power consumption design while achieving microsecond-level network-wide time synchronization. Summary of the Invention
[0008] Therefore, this application aims to provide a network-wide time synchronization method for smart devices using the IEEE 802.15.4 protocol. This method leverages the hardware SFD (start-of-frame delimiter) interrupt mechanism in IEEE 802.15.4 to achieve precise time synchronization. This method can be applied to smart hardware products such as Thread and Zigbee, enabling more time-sensitive smart applications. The method disclosed in this application can achieve microsecond-level network-wide time synchronization while also considering the low-power design of smart devices.
[0009] In a first aspect, a method for synchronizing time in a wireless mesh network is disclosed, the wireless mesh network including multiple network nodes communicating based on the IEEE 802.15.4 protocol, the method comprising: a data frame transmitted by the network nodes including a Start Frame Initial Delimiter (SFD) and a MAC frame header field (MHR), wherein the MAC frame header field includes a Time Header Information Element, the Time Header Information Element including a Time Synchronization Sequence Number (TimeSyncSeq) and the current network time (Time); and the network nodes performing time synchronization based on an SFD interrupt triggered by the Start Frame Initial Delimiter and the Time Header Information Element.
[0010] Preferably, the method further includes: a first network node among multiple network nodes sending a data frame, wherein the current network time (Time) in the time header information element is set to the local time or network time of the first network node; a second network node among multiple network nodes receiving and parsing the data frame, and determining whether the time synchronization sequence number in the data frame is greater than the local time synchronization sequence number; and when it is determined that the time synchronization sequence number in the data frame is greater than the local time synchronization sequence number, the second network node updates its local time according to the current network time in the data frame.
[0011] More preferably, when the second network node receives the Start Frame Initial Delimiter (SFD) in the data frame, it triggers an SFD interrupt and records the timestamp as T1; it continues to receive until a complete data frame is received, and parses the data frame to obtain the current network time T0 in the MAC frame header field, records the timestamp when parsing is completed as T2; and updates the local time to T0+|T2-T1|.
[0012] More preferably, during the transmission of a data frame, the first network node among the multiple network nodes triggers an SFD interrupt after transmitting the Start Frame Initial Delimiter (SFD) to set the current network time (Time) in the time header information element to the local time or network time of the first network node.
[0013] Preferably, the data frame further includes a preamble sequence, a physical frame header (PHR) field, a MAC payload field, and a MAC frame tail field (MFR).
[0014] More preferably, the first network node among the multiple network nodes sends data frames to other network nodes via unicast or broadcast.
[0015] More preferably, the current network time in the data frame is 64 bits.
[0016] More preferably, the data frame is a beacon frame, a data frame, a response frame, or a command frame.
[0017] More preferably, the data frame is a custom-designed dedicated data frame.
[0018] More preferably, the wireless mesh network is a Thread protocol network, and the first network node is the leader node in the Thread protocol network.
[0019] More preferably, the wireless mesh network is a ZigBee protocol network, and the first network node is a coordinator node in the ZigBee protocol network.
[0020] More preferably, the first network node periodically sends data frames, wherein the time synchronization sequence number in the time header information element increments with each period.
[0021] In a second aspect, a wireless device is disclosed, configured to communicate with other wireless devices in a wireless mesh network based on the IEEE 802.15.4 protocol. The wireless device includes processing circuitry configured to: transmit data frames, wherein the data frames include a Start Frame Initial Delimiter (SFD) and a MAC frame header field (MHR), the MAC frame header field including a Time Header Information Element, the Time Header Information Element including a Time Synchronization Sequence Number (TimeSyncSeq) and the current network time (Time); during the transmission of the data frames, after transmitting the Start Frame Initial Delimiter (SFD), an SFD interrupt is triggered to set the current network time (Time) in the Time Header Information Element to the local time or network time of the wireless device.
[0022] Preferably, the wireless device sends data frames to other wireless devices in the wireless mesh network via unicast or broadcast.
[0023] Preferably, the data frame is a beacon frame, a data frame, a response frame, or a command frame.
[0024] Preferably, the data frame is a custom-defined dedicated data frame.
[0025] Preferably, the wireless mesh network is a Thread protocol network, and the wireless device is the leader node in the Thread protocol network.
[0026] Preferably, the wireless mesh network is a ZigBee protocol network, and the wireless device is a coordinator node in the ZigBee protocol network.
[0027] More preferably, the wireless device periodically transmits data frames, wherein the time synchronization sequence number in the time header information element increments with each cycle.
[0028] In a third aspect, a wireless device is disclosed, configured to communicate with other wireless devices in a wireless mesh network based on the IEEE 802.15.4 protocol. The wireless device includes processing circuitry configured to: receive data frames from the wireless mesh network, wherein the data frames include a Start Frame Delimiter (SFD) and a MAC header field (MHR), the MAC header field including a Time Header Information Element, the Time Header Information Element including a Time Synchronization Sequence Number (TimeSyncSeq) and the current network time (Time); determine whether the Time Synchronization Sequence Number in the data frame is greater than the local Time Synchronization Sequence Number; and when it is determined that the Time Synchronization Sequence Number in the data frame is greater than the local Time Synchronization Sequence Number, the wireless device updates its local time according to the current network time in the data frame.
[0029] Preferably, when the wireless device receives the Start Frame Initial Delimiter (SFD) in the data frame, it triggers an SFD interrupt and records the timestamp as T1; it continues to receive until the complete data frame is received, and parses the data frame to obtain the current network time T0 in the MAC frame header field, records the timestamp when the parsing is completed as T2; and updates the local time to T0+|T2-T1|.
[0030] In a fourth aspect, a wireless mesh network is disclosed, comprising multiple network nodes communicating based on the IEEE 802.15.4 protocol, wherein: a first network node among the multiple network nodes transmits data frames, wherein the data frames include a Start Frame Initial Delimiter (SFD) and a MAC frame header field (MHR), the MAC frame header field including a Time Header Information Element, the Time Header Information Element including a Time Synchronization Sequence Number (TimeSyncSeq) and the current network time (Time); during the transmission of data frames, the first network node among the multiple network nodes triggers an SFD interrupt after transmitting the Start Frame Initial Delimiter (SFD) to set the current network time (Time) in the Time Header Information Element to the local time or network time of the wireless device; at least one second network node among the multiple network nodes receives data frames from the wireless mesh network; and determines whether the Time Synchronization Sequence Number in the data frame is greater than the local Time Synchronization Sequence Number; and when it is determined that the Time Synchronization Sequence Number in the data frame is greater than the local Time Synchronization Sequence Number, the at least one second network node updates its local time according to the current network time in the data frame.
[0031] Preferably, when at least one second network node receives the Start Frame Initial Delimiter (SFD) in a data frame, it triggers an SFD interrupt and records a timestamp as T1; it continues to receive data until a complete data frame is received, and parses the data frame to obtain the current network time T0 in the MAC frame header field, records the timestamp when parsing is completed as T2; and updates the local time to T0+|T2-T1|.
[0032] In a fifth aspect, a network node in a wireless mesh network is disclosed, comprising a microcontroller and a transceiver operatively coupled to the microcontroller, the network node being used to perform the method according to any one of the above claims.
[0033] In a sixth aspect, a computer-readable storage medium is disclosed, comprising computer instructions that, when executed on an electronic device, perform any of the methods described above.
[0034] It should be noted that, where appropriate, any feature of any embodiment of the disclosed embodiments can be applied to any other embodiment. Similarly, any advantage of any embodiment of the embodiments can be applied to other embodiments, and vice versa. Further objects, features, and advantages of the appended embodiments will become apparent from the following description.
[0035] Some embodiments are intended to address, mitigate, or eliminate at least some of the above or other disadvantages. Attached Figure Description
[0036] Figure 1A schematic diagram of the format of a data frame according to an embodiment of this application is shown.
[0037] Figure 2 The format of a Time Header Information Element according to an embodiment of this application is shown.
[0038] Figure 3 A schematic diagram illustrating the steps of a time synchronization method according to an embodiment of this application is shown.
[0039] Figure 4 A schematic diagram of a Thread wireless mesh network is shown.
[0040] Figure 5 A schematic diagram illustrating the time synchronization process in a Thread wireless mesh network is shown. Detailed Implementation
[0041] This disclosure will now be discussed with reference to several exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and thus achieve the purposes of this disclosure, and not to imply any limitation on the scope of this disclosure.
[0042] It should be understood that although the terms “first” and “second”, etc., may be used herein to describe various elements, these elements should not be limited by these terms. These terms are used only to distinguish elements from one another. For example, without departing from the scope of the exemplary embodiments, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element. As used herein, the term “and / or” includes any and all combinations of one or more of the associated listed items.
[0043] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments. As used herein, the singular forms “a,” “an,” and “the” are intended to also include the plural forms unless the context clearly indicates otherwise. It will be further understood that, when used herein, the terms “comprising,” “including,” “having,” “with,” “containing,” and / or “incorporated” indicate the presence of the stated features, elements, and / or components, but do not exclude the presence or addition of one or more other features, elements, components, and / or combinations thereof.
[0044] In the following description and claims, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains. Some exemplary embodiments of this disclosure will now be described with reference to the accompanying drawings.
[0045] Example 1
[0046] In a first aspect of this application, a method for synchronizing time in a wireless mesh network is provided. The wireless mesh network includes multiple network nodes communicating based on the IEEE 802.15.4 protocol. The method includes: a data frame transmitted by the network nodes including a Start Frame Initial Delimiter (SFD) and a MAC frame header field (MHR), wherein the MAC frame header field includes a Time Header Information Element, which includes a Time Synchronization Sequence Number (TimeSyncSeq) and the current network time (Time); the network nodes perform time synchronization based on an SFD interrupt triggered by the Start Frame Initial Delimiter and the Time Header Information Element. Preferably, the data frame further includes a preamble sequence, a Physical Frame Header (PHR), a MAC payload field, and a MAC frame trailer field (MFR).
[0047] Specifically, such as Figure 1 The diagram illustrates a format of a data frame according to an embodiment of this application.
[0048] Specifically, Figure 1 The frame format of a data frame based on IEEE 802.15.4 is shown. The data frame includes a preamble sequence, a start frame initial delimiter (SFD), a physical frame header (PHR), a MAC frame header (MHR), a MAC payload, and a MAC frame trailer (MFR). The MAC frame header includes a time header information element.
[0049] As an example, and not a limitation, the preamble sequence is used for synchronization. The start frame begins with a one-byte initial delimiter (SFD) as a flag. The Physical Frame Header (PHR) field may include packet length information. The MAC Frame Header (MHR) field marks the start of a MAC layer data frame.
[0050] The IEEE 802.15.4 protocol includes a Start-of-Frame (SFD) mechanism. Specifically, data frames are transmitted via radio frequency (RF) in the aforementioned frame format. The Start-of-Frame (SFD) delimiter indicates the end of the preamble and the beginning of the Physical Frame Header (PHR) field. Hardware devices based on IEEE 802.15.4 trigger an SFD interrupt after transmitting or receiving an SFD. The sender generates an SFD interrupt (send_sfd_done) after transmitting the SFD, and the receiver generates an SFD interrupt (recv_sfd_done) after receiving the SFD.
[0051] As an example and not a limitation, this application includes a time header information element in the MAC frame header field and uses the SFD interrupt triggered by the initial delimiter of the start frame to update the time synchronization sequence number and the current network time in the MAC frame header field of the data frame, and further realizes network-wide time synchronization based on the time header information element.
[0052] Figure 2 The format of a Time Header Information Element according to an embodiment of this application is shown. The Time Header Information Element includes an IE header, a Vendor OUI (vendor identifier), a SubType (type of a custom element), a TimeSyncSeq (time synchronization sequence number), and Time (current network time). More preferably, the current network time (Time) in the data frame is 64 bits.
[0053] Figure 3 The steps of the time synchronization method proposed in this application, based on the above data frame format, particularly the format of the time header information element, are illustrated. This method can be applied to multiple network nodes in a network. The specific implementation steps include: (1) A first network node among the multiple network nodes sends a data frame, and the current network time (Time) in the time header information element is set to the local time or network time of the first network node; (2) A second network node among the multiple network nodes receives and parses the data frame, and determines whether the time synchronization sequence number in the data frame is greater than the local time synchronization sequence number; and (3) When it is determined that the time synchronization sequence number in the data frame is greater than the local time synchronization sequence number, the second network node updates its local time according to the current network time in the data frame.
[0054] As an example and not a limitation, in step (1), the first network node among the multiple network nodes triggers an SFD interrupt (send_sfd_done) after sending the Start Frame Initial Delimiter (SFD) during the transmission of a data frame, so as to set the current network time (Time) in the time header information element to the local time or network time of the first network node.
[0055] As an example rather than a limitation, in step (2), when the second network node receives the Start Frame Initial Delimiter (SFD) in the data frame, it triggers an SFD interrupt (recv_sfd_done) and records the timestamp as T1; it continues to receive until the complete data frame is received, and parses the data frame to obtain the current network time T0 in the MAC frame header field, records the timestamp when the parsing is completed as T2; and updates the local time to T0+|T2-T1|.
[0056] As an example, and not a limitation, the first network node in a group of network nodes sends data frames to the other network nodes via unicast or broadcast.
[0057] As an example and not a limitation, the data frames in the above format can be beacon frames, data frames, response frames, or command frames. Furthermore, data frames can also be custom-designed, proprietary data frames.
[0058] As an example and not a limitation, the wireless mesh network is a Thread protocol network, where the first network node is the leader node in the Thread protocol network. For example, the leader node in the Thread protocol network periodically sends data frames, in which the time synchronization sequence number in the time header information element increments with each period.
[0059] As an example and not a limitation, the wireless mesh network is a ZigBee protocol network, and the first network node is the coordinator node in the ZigBee protocol network. For example, the coordinator node in the ZigBee protocol network periodically sends data frames, in which the time synchronization sequence number in the time header information element increments with each period.
[0060] Example 1 – Time synchronization between adjacent nodes
[0061] According to one example of this application, there are at least two network nodes in a wireless mesh network. The first network node and the second network node are adjacent nodes.
[0062] The first network node initiates time synchronization with its neighboring nodes in the sending direction. The specific process is as follows:
[0063] The first network node sends a data frame, the frame format of which is as follows: Figure 1 As shown. Specifically, after sending the Start Frame Initial Delimiter (SFD), an SFD interrupt (send_sfd_done) is triggered.
[0064] In this SFD interrupt service routine, the first network node sets the current network time field in the time header information element of the data frame to either the first network node's local time or network time. As an example, and not a limitation, after the SFD interrupt is triggered, the first network node's hardware continues to send packets in parallel; however, calculations show that the software, driven by the CPU, will update the current network time field in the time header information element of the data frame before the hardware sends the MAC header (MHR) field of the data frame.
[0065] The second network node, acting as the receiver, receives data frames for time synchronization from the first network node. The specific process is as follows:
[0066] The second network node receives data frames from the first network node. During the reception process, when it receives the Start Frame Initial Delimiter (SFD) in the data frame, it triggers an SFD interrupt (recv_sfd_done) and the second network node records the current timestamp as T1.
[0067] The second network node continues to receive data until it receives a complete data frame, and parses the data frame to obtain the current network time T0 in the MAC frame header field. At the same time, it records the timestamp when the parsing is completed as T2.
[0068] The second network node parses and obtains the time synchronization sequence number in the MAC frame header field of the data frame, and determines whether the time synchronization sequence number in the data frame is greater than the local time synchronization sequence number.
[0069] If the time synchronization sequence number in the data frame is determined to be greater than the local time synchronization sequence number, the second network node updates its local time according to the current network time in the data frame. The second network node updates its local time to T0+|T2-T1|.
[0070] As an example rather than a limitation, if a second network node has other high-priority tasks after receiving a complete data frame, it may not parse the data frame immediately after receiving it, but wait for the other tasks to finish executing before parsing the data frame.
[0071] Example 2 – Network-wide Time Synchronization
[0072] like Figure 4 The diagram shows a schematic of a Thread wireless mesh network. This Thread wireless mesh network includes Leader nodes, Router nodes, and Child nodes. The Leader nodes are capable of supporting multiple protocols simultaneously, such as IEEE 802.15.4 and IEEE 802.11.
[0073] For example, the Leader node connects to an external network via NTP over Wi-Fi or other means to obtain network time for time synchronization across all nodes in the network. Alternatively, the Leader node uses its own time source for time synchronization across all nodes in the network.
[0074] The leader node can periodically send data frames for time synchronization. The time synchronization sequence number in the time header element of the data frame increments with each period, and the leader node sets the current network time in the time header element of the data frame to either the local time or the network time.
[0075] As an example, and not a limitation, the leader node sends data frames for time synchronization, which can be beacon frames from the Thread protocol. The leader node can also send data frames, response frames, or command frames from the Thread protocol, or custom-defined data frames. Specifically, as an example, existing data frames from the Thread protocol, such as the Advertisement data frame, can be used. The leader node initiates time synchronization every 30 seconds. The crystal oscillator frequency stability used by the nodes in the network is 50ppm. According to the time synchronization method of this application, time synchronization of all nodes in the network can be achieved, with a time difference of less than 2ms between nodes.
[0076] As an example, and not a limitation, the Leader node sends data frames for time synchronization to other network nodes via unicast or broadcast. If sent via broadcast, all nodes in the network that receive the data frame will perform time synchronization to update their local time.
[0077] like Figure 5 The diagram illustrates the process of time synchronization in a Thread wireless mesh network. In this example, Figure 5 (a) shows the initial local time of each node in the network. Here, Global represents the time source used for network-wide time synchronization. Figure 5 In (b), the Leader node first obtains the Global time and updates it to its local time. Then, the Leader node broadcasts a data frame for time synchronization, setting the TimeSyncSeq value in the data frame's time header to the latest time synchronization sequence number and setting the current network time (Time) in the data frame's time header to the Leader node's local time. Figure 4 The nodes adjacent to the Leader node, including Router1, Router2, and Child1, all receive data frames for time synchronization sent by the Leader node. These three nodes then execute the time synchronization method according to this application, updating their local time to be synchronized with the Global time source and the Leader node, as follows: Figure 5As shown in (c). The global time source can be network time. As an example, and not a limitation, nodes that have already achieved synchronization, namely Router1 and Router2, can act as senders, initiating time synchronization with neighboring nodes. Thus, time synchronization is ultimately achieved across all nodes in the network.
[0078] Alternatively, a wireless mesh network could be a ZigBee mesh network, where a Coordinator node in the ZigBee network is responsible for periodically initiating time synchronization.
[0079] The time synchronization method of this application can support any node device based on the IEEE 802.15.4 protocol to achieve accurate network-wide time synchronization in a low-power, low-cost network through the SFD hardware interrupt mechanism. Furthermore, the method of this disclosure utilizes software (i.e., interrupt service routines) to execute the time synchronization scheme, making subsequent maintenance, adjustment, and upgrades more flexible. Specifically, this method achieves network-wide time synchronization by adding a Time Header Information Element to the MAC frame header field of the data frame. It can be applied to existing data frames such as beacon frames, data frames, response frames, or command frames without generating additional packet data. Moreover, this method does not require pre-constructing data frames. Through the SFD interrupt, the local time is added to the Time Header Information Element of the data frame used for time synchronization during data frame transmission, ensuring application flexibility and eliminating the need for pre-construction or initiating time synchronization at fixed times. Furthermore, this application designs an addition of a time header information element to the MAC frame header field (MHR), thus eliminating the need to rely on dedicated data packets or reserve space in the data packets. Instead, the method of this application can be applied to various existing data frame types, resulting in high packet transmission efficiency and wide applicability.
[0080] Example 2
[0081] According to a second aspect of this disclosure, a wireless device is provided, configured to communicate with other wireless devices in a wireless mesh network based on the IEEE 802.15.4 protocol. The wireless device includes processing circuitry configured to:
[0082] Send a data frame, which includes a Start Frame Initial Delimiter (SFD) and a MAC header field (MHR). The MAC header field includes a Time Header Information Element, which includes a Time Synchronization Sequence Number (TimeSyncSeq) and the current network time (Time).
[0083] During the transmission of data frames, an SFD interrupt is triggered after the initial start frame delimiter (SFD) is transmitted to set the current network time (Time) in the time header information element to the local time or network time of the wireless device.
[0084] Preferably, the wireless device sends data frames to other wireless devices in the wireless mesh network via unicast or broadcast.
[0085] Preferably, the data frame is a beacon frame, a data frame, a response frame, or a command frame.
[0086] Preferably, the data frame is a custom-defined dedicated data frame.
[0087] Preferably, the wireless mesh network is a Thread protocol network, and the wireless device is the leader node in the Thread protocol network.
[0088] Preferably, the wireless mesh network is a ZigBee protocol network, and the wireless device is a coordinator node in the ZigBee protocol network.
[0089] More preferably, the wireless device periodically transmits data frames, wherein the time synchronization sequence number in the time header information element increments with each cycle.
[0090] Example 3
[0091] According to a third aspect of this disclosure, a wireless device is provided, configured to communicate with other wireless devices in a wireless mesh network based on the IEEE 802.15.4 protocol. The wireless device includes processing circuitry configured to:
[0092] Data frames are received from the wireless mesh network. The data frames include a Start Frame Initial Delimiter (SFD) and a MAC header field (MHR). The MAC header field includes a Time Header Information Element, which includes a Time Synchronization Sequence Number (TimeSyncSeq) and the current network time (Time).
[0093] The system determines whether the time synchronization sequence number in the data frame is greater than the local time synchronization sequence number; and when it is determined that the time synchronization sequence number in the data frame is greater than the local time synchronization sequence number, the wireless device updates the local time according to the current network time in the data frame.
[0094] Preferably, when the wireless device receives the Start Frame Initial Delimiter (SFD) in the data frame, it triggers an SFD interrupt and records the timestamp as T1; it continues to receive until the complete data frame is received, and parses the data frame to obtain the current network time T0 in the MAC frame header field, records the timestamp when the parsing is completed as T2; and updates the local time to T0+|T2-T1|.
[0095] Example 4
[0096] According to a fourth aspect of this disclosure, a wireless mesh network is provided, comprising multiple network nodes communicating based on the IEEE 802.15.4 protocol, wherein:
[0097] The first network node among multiple network nodes sends a data frame, which includes a Start Frame Delimiter (SFD) and a MAC header field (MHR). The MAC header field includes a Time Header Information Element, which includes a Time Synchronization Sequence Number (TimeSyncSeq) and the current network time (Time).
[0098] During the transmission of a data frame, the first network node among multiple network nodes triggers an SFD interrupt after sending the Start Frame Initial Delimiter (SFD) to set the current network time (Time) in the time header information element to the local time or network time of the wireless device.
[0099] At least one second network node among multiple network nodes receives a data frame from the wireless mesh network; determines whether the time synchronization sequence number in the data frame is greater than the local time synchronization sequence number; and when it is determined that the time synchronization sequence number in the data frame is greater than the local time synchronization sequence number, at least one second network node updates its local time according to the current network time in the data frame.
[0100] Preferably, when at least one second network node receives the Start Frame Initial Delimiter (SFD) in a data frame, it triggers an SFD interrupt and records a timestamp as T1; it continues to receive data until a complete data frame is received, and parses the data frame to obtain the current network time T0 in the MAC frame header field, records the timestamp when parsing is completed as T2; and updates the local time to T0+|T2-T1|.
[0101] Example 5
[0102] According to a fifth aspect of this disclosure, a network node in a wireless mesh network is provided, comprising a microcontroller and a transceiver operatively coupled to the microcontroller, the network node being configured to perform a method according to any one of the above claims.
[0103] Example 6
[0104] According to a sixth aspect of this disclosure, a computer-readable storage medium is provided, including computer instructions, wherein when the computer instructions are executed on an electronic device, the method described above is provided.
[0105] According to this disclosure, accurate network-wide time synchronization can be achieved in low-power, low-cost networks through the SFD hardware interrupt mechanism. Specifically, this method adds a Time Header Information Element to the MAC frame header field of the data frame, thus eliminating the need for dedicated data packets or reserving space within them. Time synchronization can be achieved using existing data frames such as beacon frames, data frames, response frames, or command frames without generating additional packet data. Furthermore, this method does not require pre-constructing data frames. Through the SFD interrupt, the local time is added to the Time Header Information Element of the data frame used for time synchronization during data frame transmission, ensuring application flexibility and eliminating the need for pre-construction or initiation of time synchronization at fixed times.
[0106] It should be understood that the naming of modules and the selection of interactive modules in this disclosure are for illustrative purposes only, and nodes suitable for performing any of the methods described above can be configured in a variety of alternative ways to enable the performance of the suggested process actions.
[0107] It should also be noted that the units described in this disclosure are to be regarded as logical entities and do not necessarily have to be regarded as separate physical entities.
[0108] Certain aspects of the inventive concept have been described above with reference to several embodiments. However, as will be readily apparent to those skilled in the art, embodiments different from those disclosed above are also possible and within the scope of the inventive concept. Similarly, while many different combinations have been discussed, not all possible combinations have been disclosed. Those skilled in the art will recognize that other combinations exist and are within the scope of the inventive concept. Furthermore, as will be understood by those skilled in the art, the embodiments disclosed herein are also applicable to other standards and communication systems, and any feature disclosed from a particular drawing in combination with other features may be applied to any other drawing and / or in combination with different features.
Claims
1. A method for synchronizing time in a wireless mesh network comprising a plurality of network nodes communicating based on the IEEE 802.15.4 protocol, characterized in that, The method comprises: The network node sends a data frame including a start frame delimiter (SFD) and a MAC header field (MHR), wherein the MAC header field includes a Time Header Information Element, and the Time Header Information Element includes a Time Sync Seq and a Time; The network node performs time synchronization based on the SFD interrupt triggered by the start frame delimiter and the Time Header Information Element.
2. The method of claim 1, wherein, Further comprising: A first network node in the plurality of network nodes sends the data frame, and a Time in the Time Header Information Element is set as a local time or a network time of the first network node; A second network node in the plurality of network nodes receives and parses the data frame, and determines whether a Time Sync Seq in the data frame is greater than a local Time Sync Seq; And When it is determined that the Time Sync Seq in the data frame is greater than the local Time Sync Seq, the second network node updates the local time according to a Time in the data frame.
3. The method of claim 2, wherein, Further comprising: The second network node triggers the SFD interrupt when receiving the start frame delimiter SFD in the data frame and records a timestamp T1; Continues to receive until the complete data frame is received, and parses the data frame to obtain a Time in the MAC header field, and records a timestamp T2 when the parsing is completed; Updates the local time as T0+|T2-T1|.
4. The method of claim 2, wherein, Further comprising: The first network node in the plurality of network nodes triggers the SFD interrupt after sending the start frame delimiter SFD in the process of sending the data frame, so as to set a Time in the Time Header Information Element as a local time or a network time of the first network node.
5. The method of claim 1, wherein: The data frame further comprises a Preamble, a PHY header field (PHR), a MAC payload field, and a MAC frame trailer field (MFR).
6. The method of claim 2, wherein: The first network node in the plurality of network nodes sends the data frame to other network nodes in a unicast or broadcast manner.
7. The method of claim 2, wherein: The Time in the data frame is 64 bits.
8. The method of claim 2, wherein: The data frame is a beacon frame, a response frame, or a command frame.
9. The method of claim 2, wherein: The data frame is a self-defined special-purpose data frame.
10. The method of claim 2, wherein: The wireless mesh network is a Thread protocol network, and the first network node is a leader node in the Thread protocol network.
11. The method of claim 2, wherein: The wireless mesh network is a ZigBee protocol network, and the first network node is a Coordinator node in the ZigBee protocol network.
12. The method of claim 10 or 11, wherein: The first network node periodically transmits the data frame, wherein a time synchronization sequence number in the time header information element is incremented with each period.
13. A wireless device configured to communicate with other wireless devices in a wireless mesh network based on an IEEE 802.15.4 protocol, the wireless device comprising processing circuitry, characterized in that, The processing circuitry is configured to: transmit a data frame, wherein the data frame includes a start of frame delimiter (SFD) and a MAC header field (MHR) including a time header information element (Time Header Information Element) including a time synchronization sequence number (TimeSyncSeq) and a current network time (Time); during transmission of the data frame, trigger a SFD interrupt after transmission of the start of frame delimiter (SFD) to set the current network time (Time) in the time header information element to a local time or a network time of the wireless device.
14. The wireless device of claim 13, wherein: The wireless device transmits the data frame to other wireless devices in the wireless mesh network via unicast or broadcast.
15. The wireless device of claim 13, wherein: The data frame is a beacon frame, a response frame, or a command frame.
16. The wireless device of claim 13, wherein: The data frame is a custom, dedicated data frame.
17. The wireless device of claim 13, wherein: The wireless mesh network is a Thread protocol network, and the wireless device is a Leader node in the Thread protocol network.
18. The wireless device of claim 13, wherein: The wireless mesh network is a ZigBee protocol network, and the wireless device is a Coordinator node in the ZigBee protocol network.
19. The wireless device of claim 17 or 18, wherein: The wireless device periodically transmits the data frame, wherein a time synchronization sequence number in the time header information element is incremented with each period.
20. A wireless device configured to communicate with other wireless devices in a wireless mesh network based on an IEEE 802.15.4 protocol, the wireless device comprising processing circuitry, characterized in that, The processing circuitry is configured to: receive a data frame from the wireless mesh network, wherein the data frame includes a start of frame delimiter (SFD) and a MAC header field (MHR) including a time header information element (Time Header Information Element) including a time synchronization sequence number (TimeSyncSeq) and a current network time (Time); determine whether the time synchronization sequence number in the data frame is greater than a local time synchronization sequence number; and if the time synchronization sequence number in the data frame is greater than the local time synchronization sequence number, synchronize the local time synchronization sequence number with the time synchronization sequence number in the data frame. When it is determined that the time synchronization sequence number in the data frame is greater than the local time synchronization sequence number, then the wireless device updates the local time according to the current network time in the data frame.
21. The wireless device of claim 20, wherein, Further comprising: The wireless device triggers a start of frame delimiter (SFD) interrupt and records a time stamp T1 when receiving the SFD in the start frame in the data frame; Continues to receive until the complete data frame is received, and parses the data frame to obtain the current network time T0 in the MAC header field, and records a time stamp T2 when the parsing is completed; Updates the local time as T0+|T2-T1|.
22. A wireless mesh network comprising a plurality of network nodes that communicate based on the IEEE 802.15.4 protocol, characterized in that, Wherein: A first network node of the plurality of network nodes sends a data frame, wherein the data frame includes a start frame delimiter (SFD) and a MAC header field (MHR), the MAC header field includes a time header information element (Time Header Information Element), and the time header information element includes a time synchronization sequence number (TimeSyncSeq) and a current network time (Time); The first network node of the plurality of network nodes triggers an SFD interrupt after sending the SFD in the process of sending the data frame, so as to set the current network time (Time) in the time header information element as the local time or network time of the first network node; At least one second network node of the plurality of network nodes receives the data frame from the wireless mesh network; and determines whether the time synchronization sequence number in the data frame is greater than the local time synchronization sequence number; And When it is determined that the time synchronization sequence number in the data frame is greater than the local time synchronization sequence number, then the at least one second network node updates the local time according to the current network time in the data frame.
23. The wireless mesh network of claim 22, wherein, Further comprising: The at least one second network node triggers the SFD interrupt and records a time stamp T1 when receiving the SFD in the start frame in the data frame; Continues to receive until the complete data frame is received, and parses the data frame to obtain the current network time T0 in the MAC header field, and records a time stamp T2 when the parsing is completed; Updates the local time as T0+|T2-T1|.
24. A network node in a wireless mesh network comprising a microcontroller and a transceiver operatively coupled to the microcontroller, characterized by, The network node is configured to perform the method according to any one of claims 1 to 12.
25. A computer readable storage medium, comprising computer instructions, when the computer instructions are executed on an electronic device, the electronic device is caused to perform the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Method for packaging data packet based on Thread protocol to obtain IEEE 802.11 physical frame
CN114338852A
Wireless sensor networks with data reception acknowledgement
WO2010100445A1