High-precision time synchronization method, system and device for wireless environment and medium
By using broadcasting technology and hardware timestamping technology in wireless environments, combined with time-sensitive network (TSN) technology in the IEEE 802.1 standard, the efficiency reduction problem caused by the FTM time synchronization solution in large networks is solved, and the efficiency of wireless channel occupation is achieved. High precision and efficient time synchronization.
Patent Information
- Application Number
- CN202411593183.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-08
AI Technical Summary
In large network environments, the FTM-based time synchronization scheme reduces communication efficiency and data transmission rate due to wireless channel occupation.
By introducing broadcast technology and hardware timestamping technology in wireless environments, the number of messages required for time synchronization is reduced, communication efficiency is improved, and the QoS of wireless communication is improved through the time-sensitive network (TSN) technology in the IEEE 802.1 standard.
Significantly enhances the overall performance and reliability of wireless networks, improves time synchronization accuracy, reduces the time required for clock convergence, and is suitable for situations where there are a large number of slave nodes that need synchronization.
Smart Images

Figure CN119521368A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless communication technology, and in particular to a high-precision time synchronization method, system, device and medium for use in a wireless environment. Background Art
[0002] As the requirements for time synchronization accuracy in specific fields such as finance, industrial automation, and military continue to increase, the accuracy of the Network Time Protocol (NTP) can usually only reach the millisecond level, which can no longer meet the high-precision requirements of these specific fields. Based on this, the Precision Time Protocol (PTP) was proposed to provide nanosecond-level synchronization accuracy for devices in the network and is standardized by the IEEE 1588 standard. Furthermore, the IEEE 802.1AS standard further optimizes PTP, especially for wireless network environments, and proposes a time synchronization solution based on the fine time measurement (FTM) technology in the IEEE 802.11-2016 standard. Based on the FTM technology proposed in the IEEE 802.11-2016 standard, IEEE 802.1AS-2020 standardizes the time synchronization protocol in wireless networks and releases a time synchronization solution based on the FTM protocol for node positioning in IEEE 802.11 wireless networks. This technology uses measurement frames to calculate transmission delays, and uses this to correct local clocks to improve time synchronization accuracy. After the STA sends a delay measurement request, it will exchange measurement messages with the responding node and calculate the link delay through the message sending and receiving timestamps to improve the time synchronization accuracy. In addition, multiple measurements can be taken and the average value can be taken to reduce the impact of accidental errors on the time synchronization accuracy.
[0003] The above-mentioned FTM-based time synchronization solution realizes one-to-one high-precision time synchronization from the slave clock to the master clock. However, when there are a large number of nodes in the network, the master node needs to establish a synchronization relationship with each slave node one by one, which will result in a large number of time synchronization request messages, affecting the network's communication efficiency and data transmission rate. It is not suitable for large-scale network deployment when a large number of slave nodes need to be synchronized. Summary of the invention
[0004] The present invention provides a high-precision time synchronization method, system, device and medium for wireless environment, which solves the problem that the communication efficiency and data transmission rate of the FTM-based time synchronization scheme in a large network environment are reduced due to the occupation of wireless channels.
[0005] In order to achieve the above purpose, this application adopts the following technical solutions:
[0006] In a first aspect, a high-precision time synchronization method for a wireless environment is provided, comprising:
[0007] The slave node searches for and connects to the AP, and sends a Sync_Request message to the AP to request to join the time synchronization domain; the AP responds with an ACK message to confirm that the slave node joins the time synchronization domain;
[0008] The slave node sends a FTM_Request delay measurement request message to the AP, and uses a hardware timestamp technology to record the message sending time t1 and records the corresponding timestamp in the slave node;
[0009] The AP receives the FTM_Request delay measurement request message and obtains the time t2 when the message is received by using the hardware timestamp technology, marks the timestamp with the message ID and updates it in the memory;
[0010] The AP loads the timestamp data in its memory into a broadcast frame, and periodically broadcasts the frame to all STAs in the BSS. At the same time, the AP obtains the time t3 at which the broadcast frame is sent, and sends it along with the broadcast frame.
[0011] The slave node in the same time synchronization domain as the AP receives the broadcast frame, records the receiving time t4, and obtains the delivery time t2 corresponding to the delay measurement request message ID sent by itself from the broadcast frame;
[0012] Based on the timestamp data t1, t2, t3, and t4, the link delay and clock offset between the AP and the slave node are calculated, and the adjacent rate ratio is calculated to correct the time synchronization error.
[0013] In a first possible implementation manner of the first aspect, the FTM_Request delay measurement request message consists of a header field and a message ID.
[0014] In a second possible implementation manner of the first aspect, the broadcast frame carries a current master clock timestamp and timestamp data of delay measurement messages sent by all slave nodes;
[0015] The broadcast frame includes a timestamp field and a timestamp data table field, and the required timestamp information is obtained by querying the fields;
[0016] The timestamp field is the master clock time when the broadcast message is sent from the sending port of the AP, which is used to synchronize time to the slave nodes and for link delay measurement; the timestamp data table field is the frame ID information of the delay measurement request frame sent by each slave node recorded in the memory of the master node and the corresponding timestamp data arriving at the AP.
[0017] In a third possible implementation manner of the first aspect, the hardware timestamp technology includes:
[0018] The timestamp of message transmission is obtained and recorded by using MLME at the MAC layer; the MLME is a MAC layer management entity;
[0019] Each time a message arrives at or leaves the MAC layer, the MLME records the timestamp and returns data to the upper layer.
[0020] Based on the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, at a certain moment, the clocks of the AP and the slave node are T AP 、T STA ,
[0021] The link delay and clock offset of the message between the slave node and the master clock are expressed as:
[0022]
[0023] The local clock corrected by the slave node is:
[0024] T′=T STA -t offset .
[0025] Based on the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, calculating the adjacent rate ratio to correct the time synchronization error includes:
[0026] Taking the sending time t1, t3 of a message and the sending time t'1, t'3 of the previous round, the adjacent rate ratio between the AP and the slave node is calculated as:
[0027]
[0028] The corrected link delay is:
[0029] t delay =[(t4-t1)+neighborRateRatio×(t2-t3)] / 2
[0030] The corrected clock deviation value is:
[0031] t' offset =[-t1+neighborRateRatio×(t2-t3)+2t3-t4] / 2
[0032] The corrected local clock of the slave node is:
[0033] T′=T STA -t′ offset .
[0034] In a second aspect, a high-precision time synchronization system for a wireless environment is provided, comprising:
[0035] A network connection management module is used to search and connect to an AP from a node, and send a Sync_Request message to the AP to request to join a time synchronization domain; the AP responds with an ACK message to confirm that the slave node joins the time synchronization domain;
[0036] A delay measurement request module, used for the slave node to send a FTM_Request delay measurement request message to the AP, and at the same time use a hardware timestamp technology to record the message sending time t1 and record the corresponding timestamp in the slave node;
[0037] A timestamp processing and recording module, used for the AP to receive the FTM_Request delay measurement request message and obtain the time t2 of receiving the message by using hardware timestamp technology, mark the timestamp with a message ID and update it in the memory;
[0038] A broadcast frame construction and sending module, which is used for the AP to load the timestamp data in its memory into the broadcast frame, and periodically broadcast the frame to all STAs in the BSS. At the same time, the AP obtains the time t3 of the broadcast frame transmission and sends it with the broadcast frame;
[0039] A timestamp parsing module, configured to receive the broadcast frame from the slave node in the same time synchronization domain as the AP, record the receiving time t4, and obtain the delivery time t2 corresponding to the delay measurement request message ID sent by itself from the broadcast frame;
[0040] The synchronization calculation and error correction module is used to calculate the link delay and clock offset between the AP and the slave node based on the timestamp data t1, t2, t3, and t4, and calculate the adjacent rate ratio to correct the time synchronization error.
[0041] In a first possible implementation manner of the second aspect, the FTM_Request delay measurement request message consists of a header field and a message ID.
[0042] According to a third aspect, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the high-precision time synchronization method for a wireless environment as described in the first aspect.
[0043] According to a fourth aspect, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the high-precision time synchronization method for a wireless environment as described in the first aspect are implemented.
[0044] This application measures the propagation delay between AP and STA by sending a delay measurement message, accurately estimates the master-slave clock error based on the propagation delay, and then corrects the slave clock to achieve high-precision time synchronization between master and slave nodes, which can significantly enhance the overall performance and reliability of the wireless network. Compared with the broadcast timing technology, this application has higher time synchronization accuracy. Compared with the time synchronization method based on the FTM protocol proposed in the related art, this application greatly reduces the number of messages required for time synchronization and shortens the time required for clock convergence. At the same time, this application improves communication efficiency by reducing channel occupancy. When the number of slave nodes is large, this method can achieve better results. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A schematic flowchart of a wireless time synchronization method based on an IEEE 802.11 link defined in IEEE 802.1AS-2020 provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of the structure of a two-layer single AP wireless network provided in an embodiment of the present application;
[0047] Figure 3 A schematic flowchart of high-precision time synchronization for a wireless environment provided in an embodiment of the present application;
[0048] Figure 4 A schematic flow chart of message exchange between a master and a slave node provided in an embodiment of the present application;
[0049] Figure 5 A schematic flowchart of using the MAC layer to obtain a hardware timestamp in IEEE 802.11-2016 provided in an embodiment of the present application;
[0050] Figure 6 A structural block diagram of a high-precision time synchronization system for a wireless environment provided in an embodiment of the present application;
[0051] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose, the technical solutions in the embodiments of the present application are clearly described. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present application.
[0053] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0054] The description of the method flow in the specification of the present application and the steps of the flowchart in the drawings of the present specification do not have to be strictly executed according to the step numbers, and the method steps can be executed in a different order. Moreover, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0055] The following is a detailed description of the high-precision time synchronization method, system, device and medium for a wireless environment provided in the embodiments of the present application in combination with the accompanying drawings and preferred embodiments.
[0056] First, the application scenario of the high-precision time synchronization method for a wireless environment in an embodiment of the present application is described in detail.
[0057] Currently, the Network Time Protocol (NTP) is widely used in the network for network time synchronization. Computers in the network calculate and adjust the time by sending and receiving packets containing timestamps. This protocol is an application layer protocol in the TCP / IP protocol family. It adopts a layered structure and uses a reliable clock source to provide accurate clocks. Devices at each level can be synchronized to a clock source at a higher level than themselves. NTP can provide millisecond-level time synchronization accuracy and can meet the needs of most network applications. However, with the increasing demand for quality of service (QoS) in network services, NTP can no longer meet the needs of some scenarios, such as finance, industry, and military, for time synchronization accuracy.
[0058] In the time synchronization method based on the PTP protocol, nodes in the network need to run the Best Master Clock Algorithm (BMCA) to select the node with the highest clock quality as the master clock. All nodes in the same time synchronization domain will synchronize their local clocks to this clock.
[0059] FTM technology allows a station (STA) in a wireless network to accurately measure the round trip time (RTT) between it and another STA, and to receive changes in the relative position of the STA and other STAs in the network by regularly transmitting FTM measurement frames, thereby tracking the trajectory of the STA. This protocol works at the MAC layer, using hardware timestamp technology to obtain the sending and receiving timestamps of data frames, and carries the timestamps in the messages sent during the next measurement. It measures the transmission delay between STAs to estimate the distance between stations, and then calculates the relative position of the stations. On this basis, the IEEE 802.1AS-2020 standard also uses measurement frames to calculate the transmission delay for wireless networks based on IEEE 802.11 links, and uses this to correct the local clock and improve the accuracy of time synchronization. Specifically, see Figure 1 According to the wireless time synchronization scheme for IEEE 802.11 links defined in IEEE 802.1AS-2020, the delay measurement process between two nodes includes the following steps:
[0060] 1. The initial node sends an FTM initialization message to the responding node. After receiving the initialization message, the responding node replies with an ACK message to the initial node.
[0061] 2. The responding node sends an FTM message to the initial node and records the sending time t1_1 of the message;
[0062] 3. After receiving the message, the initial node records the reception time t2_1 of the message, replies with an ACK message to the response node, and records the sending time t3_1 of the message;
[0063] 4. After receiving the ACK message, the responding node records the receiving time t4_1 of the message;
[0064] 5. Repeat step 2 and carry the timestamps t1_1 and t4_1 of the last measurement message sent in subsequent FTM messages.
[0065] After obtaining the transmission delay based on the above method, the local clock of the slave node can be corrected.
[0066] In the FTM protocol, the time window allocated to the FTM session is unique. In an FTM session, the STA cannot respond to the FTM message from other STAs. Therefore, in the wireless network synchronization process, the master node can only respond to the time synchronization request from a single slave node at a time. In the time synchronization method adopted in the background technology, the master clock needs to establish a synchronization relationship with the slave clock one by one and send a measurement message to calculate the propagation delay to establish the time synchronization of the whole network under the wireless network. Therefore, although the wireless time synchronization scheme for the IEEE 802.11 link can meet the needs of high-precision wireless time synchronization, when the number of wireless nodes in the network increases, the slave node needs to send FTM messages to the master node in turn and perform time synchronization. The concurrent requests from multiple nodes will take up a lot of time originally used for data transmission, resulting in a decrease in the communication rate. At the same time, the time synchronization method in which the slave node and the master node perform delay estimation in turn is inefficient, the speed of establishing the whole network time synchronization is slow and the communication overhead is large, which is not suitable for the situation where a large number of slave nodes need to be synchronized.
[0067] In view of the above problems, in many wireless network environments, such as wireless sensor networks, wireless end nodes, as the terminal branches of the network, only need to be coordinated by the AP to synchronize the local clock to the AP's clock. Therefore, in such networks, the AP can be directly configured as the master node without running BMCA. This configuration method simplifies the synchronization process and improves synchronization efficiency.
[0068] Based on this, this application proposes a wireless high-precision time synchronization protocol based on broadcast and FTM protocol for wireless local area networks with a single AP structure, such as industrial control networks, wireless sensor networks and Internet of Things environments. Such services have more requirements for the QoS of network communications and need to provide more accurate time synchronization. In these networks, a large number of terminal nodes need to synchronize time with the central AP. Therefore, this protocol uses hardware timestamps to improve the quality of timestamps, calculates link delays by measuring messages to correct clock errors, and reduces the number of messages required for time synchronization through broadcast technology, thereby achieving efficient and high-precision wireless time synchronization.
[0069] Specifically: In wireless communication, since each communication device shares the transmission medium, the wireless channel occupancy should be reduced as much as possible to reduce communication overhead and improve communication efficiency. Therefore, based on the problem that when the number of nodes in the network increases, multiple network nodes perform time synchronization, resulting in a surge in the number of time synchronization request messages, this application proposes to introduce broadcast technology into the wireless time synchronization protocol, and use the existing management frame in the IEEE 802.11 protocol to carry timestamp information, give full play to its function, and improve the communication efficiency of the wireless time synchronization protocol, reduce the occupancy of wireless channels, and at the same time improve the time synchronization efficiency and reduce the time required to establish clock synchronization for the entire network.
[0070] At the same time, in order to achieve accurate transmission of delay measurement messages and achieve higher precision wireless time synchronization, this application also proposes to use the time-sensitive network (TSN) technology in the IEEE 802.1 standard to improve the QoS of wireless communication and improve the accuracy of time synchronization. TSN technology is a set of network protocol standards defined by the IEEE 802.1 standard, which can achieve deterministic minimum delay in non-deterministic Ethernet. This protocol family provides a set of general time-sensitive mechanisms for the data link layer of the Ethernet protocol to ensure real-time, deterministic and reliable transmission of data, improve data transmission efficiency, and provide determinism and reliability for the network. For real-time communication, end-to-end transmission delay has a time limit that is difficult to negotiate, so the clock plays an important role in TSN. All devices in TSN need to have a common time reference model, so there is a need for high-precision time synchronization between nodes. At the same time, the time-sensitive network can set the priority of the network message to ensure the reliable transmission of critical data. By dividing time slots and assigning higher priorities to time synchronization messages, the transmission reliability of time synchronization messages can be improved to ensure the normal operation of the time synchronization function. This application can provide the necessary time synchronization function for wireless TSN, and at the same time ensure the priority transmission of delay measurement frames in the network through wireless TSN technology, thereby improving the accuracy and reliability of wireless time synchronization.
[0071] See also Figure 2 , the present application is applicable to a single AP wireless network with a two-layer structure, such as Figure 2 As shown in the figure, the network is based on the IEEE 802.11 protocol and includes an AP and several STAs, where all STAs are within the hotspot coverage of the router and are connected to the AP through a wireless link to establish a wireless network connection. At this time, the router and the terminal in the environment constitute a basic service set (BSS).
[0072] In this environment, all network terminals and switching devices support the network protocols such as IEEE 802.1Qav, IEEE 802.1Qbv, and IEEE 802.1Qbu defined in TSN. After networking, these devices build a wireless TSN system, and can use the priority sorting and frame preemption mechanisms provided in the TSN standard to ensure the priority transmission of messages involved in time synchronization technology. In this network, all nodes are located in the same time synchronization domain, where the router serves as the master clock in the time synchronization domain, and the terminal serves as a slave clock and uses the wireless precise time synchronization technology proposed in the present invention to perform precise time synchronization with the master clock.
[0073] The following is a detailed description of the time synchronization protocol scheme of this application:
[0074] See also Figure 3-4 , the embodiment of the present application provides a high-precision time synchronization method for a wireless environment, such as Figure 3-4 As shown, the time synchronization method of the embodiment of the present application includes the following steps:
[0075] Step S1, the slave node searches for and connects to the AP, and sends a Sync_Request message to the AP to request to join the time synchronization domain; the AP responds with an ACK message to confirm that the slave node joins the time synchronization domain.
[0076] The slave node searches for wireless network signals, establishes a wireless network link with the AP and sends a Sync_Request message to the AP to request to join the time synchronization domain. After receiving the time synchronization request from the slave node, the AP replies with an ACK message to the slave node, and the slave node joins the time synchronization domain.
[0077] Step S2, the slave node sends an FTM_Request delay measurement request message to the AP, and at the same time uses a hardware timestamp technology to record the message sending time t1 and records the corresponding timestamp in the slave node.
[0078] After receiving the reply ACK message and clicking to join the time synchronization domain, the slave node sends a delay measurement request message FTM_Request to the AP, and uses the hardware timestamp technology to capture the high-precision timestamp t1 sent by the message from the sending port, and records the timestamp in the slave node.
[0079] Step S3, the AP receives the FTM_Request delay measurement request message and uses the hardware timestamp technology to obtain the time t2 when the message is received, marks the timestamp with the message ID and updates it in the memory.
[0080] After the AP receives the delay measurement request message FTM_Request from the slave node, it also uses the hardware timestamp technology to obtain the timestamp t2 of receiving the delay measurement request message, and uses the message ID carried in the message to mark the timestamp. Then the AP updates the data table in its memory and records the marked timestamp data in the AP's memory.
[0081] Step S4, the AP loads the timestamp data in its memory into a broadcast frame, and periodically broadcasts the frame to all STAs in the BSS. At the same time, the AP obtains the time t3 when the broadcast frame is sent, and sends it along with the broadcast frame.
[0082] The AP loads the timestamp data recorded in its memory into the broadcast frame of the Beacon message, and periodically broadcasts the frame to all STAs in the BSS. All slave nodes under the wireless network will receive the broadcast frame from the AP. At the same time, the AP obtains the time t3 when the broadcast frame is sent, records it in the broadcast frame and sends it with the frame.
[0083] Step S5, the slave node in the same time synchronization domain as the AP receives the broadcast frame, records the receiving time t4, and obtains the delivery time t2 corresponding to the delay measurement request message ID sent by itself from the broadcast frame.
[0084] After receiving the broadcast frame sent by the AP, the slave node in the same time synchronization domain as the AP obtains and records the timestamp t4 of receiving the broadcast frame, and searches for the delivery timestamp t2 corresponding to the delay measurement request message ID sent by itself in the timestamp data carried by the broadcast frame.
[0085] Step S6, based on the timestamp data t1, t2, t3, t4, the link delay and clock offset between the AP and the slave node are calculated, and the adjacent rate ratio is calculated to correct the time synchronization error.
[0086] Based on the above four sets of timestamp data, the link delay and clock offset between the AP and the slave node are calculated, and the adjacent rate ratio is calculated to correct the time synchronization error to achieve high-precision time synchronization.
[0087] The link delay measurement stage of the present application adopts a one-step method, that is, the timestamp data of the message sending time will be sent together with the message. Compared with the two-step method, the one-step method can significantly reduce the time required for link delay measurement. The specific method is that the AP will allocate appropriate time slots for delay measurement messages based on the gating mechanism provided by IEEE 802.1Qbv in the TSN standard, and record the gate opening time in the message in advance as the sending timestamp. When the gating time is reached, the node will send a delay measurement message with a timestamp. This method can avoid the shortcomings of the original IEEE 802.1AS protocol and FTM protocol in using the two-part method to transmit the sending timestamp, and improve the efficiency of time synchronization.
[0088] To meet the needs of high-precision time synchronization, this application uses the 96-bit high-precision timestamp defined by the IEEE 1588v2 standard. The timestamp message defined by this standard uses 96-bit to store time information, which has higher accuracy than the 64-bit timestamp and can reach the nanosecond level. According to the IEEE standard, the timestamp is divided into three fields with lengths of 48 bits, 32 bits, and 16 bits, respectively, where Bit[95:48] represents seconds, Bit[47:16] represents nanoseconds, and Bit[15:0] represents decimals of nanoseconds.
[0089] In some possible implementations, the FTM_Request delay measurement request message consists of a header field and a message ID.
[0090] The delay measurement request message involved in step 2 is described as follows:
[0091] The link delay measurement technology used in this application is based on the IEEE 802.11FTM protocol, so this application changes the delay measurement request message based on the delay measurement request message specified by the protocol. Since the AP is used as the master clock in this application, all data processing processes are completed in the slave node, so the delay measurement request message does not need to carry timestamp information, and only needs to send the request to the master node. In addition to the header field of the WiFi protocol, the message only needs to contain a message ID for the AP and the slave node to identify the message. Compared with the FTM message, the delay measurement request message used in this application deletes the timestamp information of sending and receiving, simplifies the message structure, and saves the communication overhead of the time synchronization process.
[0092] In some possible implementations, hardware timestamping techniques include:
[0093] MLME is used to obtain and record the timestamp of message sending at the MAC layer; MLME is the MAC layer management entity;
[0094] Each time a message arrives at or leaves the MAC layer, the MLME records the timestamp and returns the data to the upper layer.
[0095] The hardware timestamp technology involved in step 3 is described as follows:
[0096] The specific method adopted by this application is to use the MAC layer management entity (MAC Sublayer Management Entity, MLME) to obtain and record the timestamp of the message transmission at the MAC layer, and use the service primitive defined in the IEEE 802.11FTM protocol to provide timestamp information. Its specific working method is as follows Figure 5 As shown, in IEEE 802.11-2016, three groups of service primitives are defined, and their functions are shown in Table 1.
[0097]
[0098] Table 1. FTM protocol service primitives defined in IEEE 802.11-2016
[0099] Every time a message arrives and leaves the MAC layer, MLME records the timestamp and returns the data to the upper layer. Since the FTM protocol works at the MAC layer, it can obtain the hardware timestamp. This method can avoid the introduction of random errors caused by the message passing through multiple layers of the protocol stack. This method has better accuracy than the software timestamp.
[0100] In some possible implementations, the broadcast frame carries the timestamp data of the current master clock and the delay measurement messages sent by all slave nodes;
[0101] The broadcast frame includes a timestamp field and a timestamp data table field, and the required timestamp information is obtained by querying the fields;
[0102] The timestamp field is the master clock time when the broadcast message is sent from the AP's sending port, which is used to grant time to the slave nodes and for link delay measurement; the timestamp data table field is the frame ID information of the delay measurement request frame sent by each slave node recorded in the master node's memory and the corresponding timestamp data arriving at the AP.
[0103] Specifically, the broadcast frames involved in step 4 are described as follows:
[0104] This broadcast frame is rewritten based on the Beacon frame defined in the IEEE 802.11 standard. The Beacon frame is a management frame subtype defined by the IEEE802.11 standard and is broadcast periodically by the AP. The management frame carries information such as the service set identifier, network mode, and timestamp, and is periodically sent by the AP at a certain time interval to notify the outside world of the existence of the wireless network and provide relevant information about the wireless network. It plays a huge role in maintaining communication between the AP and the STA.
[0105] The rewritten broadcast frame body carries the current master clock timestamp and the timestamp data of the delay measurement messages sent by all slave nodes. The main part of the broadcast frame contains a timestamp field, which is the master clock time when the broadcast message is sent by the AP's sending port, and can be used to synchronize time with the slave nodes and for link delay measurement. The beacon frame used in this application adds a timestamp data table field to the main part, which contains the frame ID information of the delay measurement request frame sent by each slave node recorded in the master node's memory and the corresponding timestamp data arriving at the AP. After receiving the broadcast frame from the AP, the STA that supports the wireless time synchronization protocol proposed in this application can query this field to obtain the required timestamp information.
[0106] The link delay calculation method and clock synchronization description method involved in step 6 are as follows:
[0107] At a certain moment, the clocks of AP and slave nodes are TAP 、T STA , the clock offset between AP and slave node is t offset , T STA =T AP +t offset In a delay measurement, the transmission delay from AP to slave node is t MS , the transmission delay from the node to the AP is t SM , after the slave node obtains the four timestamps captured during the synchronization process, it can be expressed as:
[0108]
[0109] Since this technology uses hardware timestamp technology, the sending and arrival time of the measurement message is captured at the MAC layer through MLME, and during the time synchronization process, the sending interval between the delay measurement message and the broadcast frame is extremely short (millisecond level), so it can be considered that the uplink and downlink transmission delays of the message are approximately equal, that is, t MS =t SM Based on the above formula, the link delay of the message transmission between the AP and the slave node can be calculated, and the clock offset of the slave node can be obtained. The specific expression is as follows:
[0110]
[0111] After calculating the link delay and clock offset between the slave node and the master clock, the slave node can correct the time base.
[0112] The local clock correction method involved in step 6 is described as follows:
[0113] Since the present application can directly estimate the clock offset and calculate t offset Therefore, after the slave node measures the master clock and obtains the clock offset, the local clock is corrected by adding the offset value to achieve high-precision time synchronization in a wireless network environment. The local clock of the slave node after correction is:
[0114] T′=T STA -t offset
[0115] The error correction calculation method involved in step 6 is described as follows:
[0116] During the time synchronization process, due to the different hardware of AP and STA, the clock frequencies of the master clock and the slave clock are different, and their periods are not completely matched, which leads to clock drift. In order to reduce the impact of clock drift on the accuracy of time synchronization, it is necessary to correct the clock frequency of the slave clock. The specific method is to calculate the adjacent rate ratio of the master clock and the slave clock based on the clock deviation value obtained by two consecutive measurements, and then correct the time synchronization error of the slave clock.
[0117] Since the AP and slave nodes send Beacon frames and delay measurement request frames at a constant rate, the time interval between each transmission should be equal in theory. Therefore, taking the transmission time t1, t3 of a message and the previous transmission time t'1, t'3, the adjacent rate ratio of the AP and the slave node can be calculated as:
[0118]
[0119] After correction, the new link delay can be calculated as:
[0120] t delay =[(t4-t1)+neighborRateRatio×(t2-t3)] / 2
[0121] The corrected clock deviation value is:
[0122] t' offset =[-t1+neighborRateRatio×(t2-t3)+2t3-t4] / 2
[0123] Based on the above steps, considering the errors caused by link delay and clock offset, high-precision time synchronization between the slave node and the master node can be achieved. The corrected local clock of the slave node is:
[0124] T′=T STA -t′ offset .
[0125] Based on the above technical solution, the present application measures the propagation delay between AP and STA by sending a delay measurement message, accurately estimates the master-slave clock error based on the propagation delay, and then corrects the slave clock to achieve high-precision time synchronization between master and slave nodes, which can significantly enhance the overall performance and reliability of the wireless network. First, this method can effectively reduce the delay error in time synchronization, ensure high-precision synchronization of the clocks of nodes throughout the network, and thus improve the accuracy of data transmission. Secondly, accurate time synchronization is crucial for real-time applications and can support the efficient operation of critical tasks such as industrial automation, intelligent transportation, and video surveillance. In addition, the improved time synchronization accuracy can also be used to implement wireless deterministic networks, reduce the packet loss rate and retransmission times in the system, thereby optimizing bandwidth utilization and improving network throughput.
[0126] In the technical solution proposed in this application, a broadcast method is used to send the timestamp information to all nodes in the same synchronization domain through Beacon frames. Sending the delay measurement request message to all STAs at one time through broadcast frames can reduce the number of interactions with nodes and the number of data frames required to be sent, reduce the occupancy of wireless channels, speed up clock convergence, and significantly improve the time synchronization efficiency of the entire network. At the same time, this method can be widely used in different types of wireless networks, adapt to a variety of application scenarios, and has strong flexibility. Compared with network equipment that uses satellite timing and other methods for time synchronization, wireless networks that use time synchronization based on the IEEE802.11FTM protocol do not need to configure additional hardware for nodes to receive satellite signals, reducing the overall system construction and maintenance costs.
[0127] In a wireless network, consider a BSS containing 1 AP and n slave nodes. When the BSS performs time synchronization, all slave nodes need to initiate delay measurement requests to the master clock in turn. For wireless networks using the background technology, in each round of measurement, at least 2n messages need to be sent in total to enable all nodes to complete a delay measurement. For wireless networks using the solution proposed in the present application, since the broadcast frame simultaneously assumes the functions of the Beacon frame and the data frame, only a single message needs to be sent to send the timestamp to all slave nodes in the BSS, and regardless of whether time synchronization is performed, the AP needs to broadcast the Beacon frame, so only n messages need to be sent for time synchronization. Compared with the prior art, the number of messages required for time synchronization in the present application is significantly reduced, which is only 50% of the number of messages required by the prior art.
[0128] Assume that during the time synchronization process, the time required for each node to process and send a single data frame is t trans In this BSS, when the relevant technology is used for time synchronization, without considering the protection interval and waiting time, the time required for each round of delay measurement is 2 nt.trans When the present application is used for time synchronization, the number of messages to be sent is greatly reduced, and the time required for communication is also significantly reduced to (n+1)t trans In contrast, the time required for each round of delay measurement is reduced by (n-1)t when using the present application. trans The convergence speed of the clock is significantly improved, and the efficiency is improved more significantly when the number of slave nodes in the network increases. In addition, by reducing the number of sent messages, the present application significantly reduces the time that the management frame occupies the wireless channel, thereby improving the communication efficiency of the wireless network.
[0129] In summary, through the high-precision time synchronization technology for wireless networks proposed in this application, high-precision time synchronization of wireless networks can be achieved, the stability of wireless networks is improved, and more reliable technical support is provided for complex application scenarios. Compared with the broadcast timing technology, the present application has higher time synchronization accuracy. Compared with the time synchronization method based on the FTM protocol proposed in the related art, the present application greatly reduces the number of messages required for time synchronization and shortens the time required for clock convergence. At the same time, the present application improves communication efficiency by reducing channel occupancy. When the number of slave nodes is large, this method can achieve better results.
[0130] See also Figure 6 , corresponding to the above-mentioned high-precision time synchronization method embodiment for a wireless environment, the embodiment of the present application provides a high-precision time synchronization system for a wireless environment, the time synchronization system comprising:
[0131] The network connection management module 1001 is used for searching and connecting from a node to an AP, and sending a Sync_Request message to the AP to request to join a time synchronization domain; the AP responds with an ACK message to confirm that the slave node joins the time synchronization domain;
[0132] The delay measurement request module 1002 is used for the slave node to send a FTM_Request delay measurement request message to the AP, and at the same time use the hardware timestamp technology to record the message sending time t1 and record the corresponding timestamp in the slave node;
[0133] The timestamp processing and recording module 1003 is used for the AP to receive the FTM_Request delay measurement request message and obtain the time t2 of receiving the message by using the hardware timestamp technology, mark the timestamp with the message ID and update it in the memory;
[0134] The broadcast frame construction and sending module 1004 is used for the AP to load the timestamp data in its memory into the broadcast frame, and periodically broadcast the frame to all STAs in the BSS. At the same time, the AP obtains the time t3 of sending the broadcast frame and sends it with the broadcast frame;
[0135] The timestamp parsing module 1005 is configured to receive the broadcast frame from the slave node in the same time synchronization domain as the AP, record the receiving time t4, and obtain the delivery time t2 corresponding to the delay measurement request message ID sent by itself from the broadcast frame;
[0136] The synchronization calculation and error correction module 1006 is used to calculate the link delay and clock offset between the AP and the slave node based on the timestamp data t1, t2, t3, and t4, and calculate the adjacent rate ratio to correct the time synchronization error.
[0137] Furthermore, the FTM_Request delay measurement request message consists of a header field and a message ID.
[0138] The above-mentioned high-precision time synchronization system for wireless environment implements the steps and various processes of the above-mentioned high-precision time synchronization method embodiment for wireless environment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0139] See also Figure 7 Corresponding to the above-mentioned embodiment of the high-precision time synchronization method for a wireless environment, an embodiment of the present application provides an electronic device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps and various processes of the above-mentioned embodiment of the high-precision time synchronization method for a wireless environment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0140] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0141] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.
[0142] Corresponding to the above-mentioned embodiment of the high-precision time synchronization method for a wireless environment, the embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by the processor, the steps and various processes of the above-mentioned embodiment of the high-precision time synchronization method for a wireless environment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0143] The processor is the processor in the electronic device described in the above embodiment of the present application. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0144] It should be noted that, in this article, the term "comprises", "includes" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0146] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A high-precision time synchronization method for a wireless environment, characterized in that: include: The slave node searches and connects to the AP, and sends a Sync_Request message to the AP to request to join the time synchronization domain; The AP responds with an ACK message to confirm that the slave node joins the time synchronization domain; The slave node sends a FTM_Request delay measurement request message to the AP, and uses a hardware timestamp technology to record the message sending time t1 and records the corresponding timestamp in the slave node; The AP receives the FTM_Request delay measurement request message and obtains the time t2 when the message is received by using the hardware timestamp technology, marks the timestamp with the message ID and updates it in the memory; The AP loads the timestamp data in its memory into a broadcast frame, and periodically broadcasts the frame to all STAs in the BSS. At the same time, the AP obtains the time t3 at which the broadcast frame is sent, and sends it along with the broadcast frame. The slave node in the same time synchronization domain as the AP receives the broadcast frame, records the receiving time t4, and obtains the delivery time t2 corresponding to the delay measurement request message ID sent by itself from the broadcast frame; Based on the timestamp data t1, t2, t3, and t4, the link delay and clock offset between the AP and the slave node are calculated, and the adjacent rate ratio is calculated to correct the time synchronization error.
2. The high-precision time synchronization method for a wireless environment according to claim 1, characterized in that: The FTM_Request delay measurement request message consists of a header field and a message ID.
3. The high-precision time synchronization method for a wireless environment according to claim 1, characterized in that: The broadcast frame carries the timestamp data of the current master clock and the delay measurement messages sent by all slave nodes; The broadcast frame includes a timestamp field and a timestamp data table field, and the required timestamp information is obtained by querying the fields; The timestamp field is the master clock time when the broadcast message is sent from the sending port of the AP, which is used to synchronize time to the slave nodes and for link delay measurement; the timestamp data table field is the frame ID information of the delay measurement request frame sent by each slave node recorded in the memory of the master node and the corresponding timestamp data arriving at the AP.
4. The high-precision time synchronization method for a wireless environment according to claim 1, characterized in that: The hardware timestamp technology includes: The timestamp of message transmission is obtained and recorded by using MLME at the MAC layer; the MLME is a MAC layer management entity; Each time a message arrives at or leaves the MAC layer, the MLME records the timestamp and returns data to the upper layer.
5. The high-precision time synchronization method for a wireless environment according to claim 4, characterized in that: At a certain moment, the clocks of AP and slave nodes are T AP , T STA , The link delay and clock offset of the message between the slave node and the master clock are expressed as: The local clock corrected by the slave node is: T′=T STA -t offset 。 6. The high-precision time synchronization method for a wireless environment according to claim 5, characterized in that: Calculate the adjacent rate ratio to correct the time synchronization error, including: Taking the sending time t1, t3 of a message and the sending time t'1, t'3 of the previous round, the adjacent rate ratio between the AP and the slave node is calculated as: The corrected link delay is: t delay =[(t4-t1)+neighborRateRatio×(t2-t3)] / 2 The corrected clock deviation value is: <h2 style=";text-align:left;direction:ltr">t'<h2 style=";text-align:left;direction:ltr"> offset <h2 style=";text-align:left;direction:ltr"> =[-t1+neighborRateRatio×(t2-t3)+2t3-t4] / 2 The corrected local clock of the slave node is: T′=T STA -t′ offset 。 7. A high-precision time synchronization system for wireless environments, characterized in that: include: A network connection management module, used to search and connect to an AP from a node, and send a Sync_Request message to the AP to request to join a time synchronization domain; The AP responds with an ACK message to confirm that the slave node joins the time synchronization domain; A delay measurement request module, used for the slave node to send a FTM_Request delay measurement request message to the AP, and at the same time use a hardware timestamp technology to record the message sending time t1 and record the corresponding timestamp in the slave node; A timestamp processing and recording module, used for the AP to receive the FTM_Request delay measurement request message and obtain the time t2 of receiving the message by using hardware timestamp technology, mark the timestamp with a message ID and update it in the memory; A broadcast frame construction and sending module, used for the AP to load the timestamp data in its memory into the broadcast frame, and periodically broadcast the frame to all STAs in the BSS, and at the same time, the AP obtains the time t3 of the broadcast frame transmission and sends it with the broadcast frame; A timestamp parsing module, configured to receive the broadcast frame from the slave node in the same time synchronization domain as the AP, record the receiving time t4, and obtain the delivery time t2 corresponding to the delay measurement request message ID sent by itself from the broadcast frame; The synchronization calculation and error correction module is used to calculate the link delay and clock offset between the AP and the slave node based on the timestamp data t1, t2, t3, and t4, and calculate the adjacent rate ratio to correct the time synchronization error.
8. The high-precision time synchronization system for wireless environment according to claim 7, characterized in that: The FTM_Request delay measurement request message consists of a header field and a message ID.
9. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the high-precision time synchronization method for a wireless environment as described in any one of claims 1 to 6.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the high-precision time synchronization method for a wireless environment as claimed in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Time synchronization method and device, equipment and storage medium
CN115694704A
Clock synchronization in half-duplex communication systems
US11552775B1
System and methods for network data processing
US20240089021A1
Cited By
Time synchronization method and equipment
CN121174263A
Narrowband communication time synchronization method and system
CN121284701A