Distributed wireless network time synchronization method and device based on enhanced clock model

By building a distributed wireless network topology diagram and an enhanced clock model, combining the Kalman filtering algorithm for clock and frequency compensation, the shortcomings of wireless communication protocols in high-precision synchronization are solved, and the nanosecond time synchronization effect is achieved.

CN120018270BActive Publication Date: 2025-07-11NAT UNIV OF DEFENSE TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510483720.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-07-11
Estimated Expiration
2045-04-17

AI Technical Summary

Technical Problem

The existing time synchronization methods based on wireless communication protocols such as Bluetooth, Wi-Fi, Zigbee, etc. are difficult to achieve the ideal synchronization effect under the background of high-precision requirements, and are susceptible to external interference and device clock drift, resulting in insufficient synchronization accuracy.

Method used

Build a network connection topology diagram of a distributed wireless network, use the enhanced clock model to calculate the time difference and frequency difference between nodes, and combine iterative estimation with the Kalman filtering algorithm to achieve clock and frequency compensation, and improve synchronization accuracy.

Benefits of technology

In complex network environments, the time synchronization accuracy is significantly improved, the synchronization effect in nanoseconds can be achieved, and it has high robustness and anti-interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120018270B_ABST
    Figure CN120018270B_ABST
Patent Text Reader

Abstract

The present application relates to a distributed wireless network time synchronization method and device based on an enhanced clock model. The method includes: constructing a network connection topology graph of the distributed wireless network; calculating the time difference and frequency difference between each node and its adjacent nodes according to the enhanced clock model, performing state estimation based on the time difference and frequency difference to obtain a time difference state vector and a frequency difference state vector, obtaining a joint state vector according to the time difference state vector and the frequency difference state vector, and constructing a system state transition equation and a system state observation equation of the joint state vector; performing iteration based on the Kalman filtering algorithm according to the system state transition equation and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes, performing clock compensation and frequency compensation on the corresponding nodes according to the optimal estimated values, and iteratively updating the optimal estimated values at each moment to achieve time synchronization of the distributed wireless network. Using this method can improve the time synchronization accuracy of the distributed wireless network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of wireless communication technologies, and particularly to a distributed wireless network time synchronization method and apparatus based on an enhanced clock model. Background Art

[0002] With the rapid development of the Internet of Things (IoT) and the industrial Internet, more and more applications have put forward higher requirements for time synchronization accuracy. Accurate time synchronization plays an indispensable role in fields such as unmanned aerial vehicle (UAV) swarm flight control, vehicle-to-everything (V2X) data synchronization, wireless sensor network positioning, and distributed network communication.

[0003] Currently, IoT time synchronization technologies generally rely on methods based on wireless communication protocols, including Bluetooth, Wi-Fi, Zigbee, etc. Different protocols have their own advantages and are suitable for different scenarios. Bluetooth-based time synchronization is usually achieved through periodic broadcast signals, that is, by sending and receiving timestamps to calculate the time difference and correct the device clock. Wi-Fi time synchronization methods mainly rely on the IEEE 802.11 protocol or the timestamp transmission mechanism based on the MAC layer, and can provide higher synchronization accuracy than Bluetooth. By generating and transmitting accurate timestamp information at the MAC layer, Wi-Fi devices can improve the synchronization accuracy to 1 to 10 microseconds. Even in a local network, through accurate timestamp recording and high-frequency correction, sub-microsecond-level synchronization accuracy can be achieved.

[0004] Although the above time synchronization methods based on wireless communication protocols have wide applications, their synchronization accuracy still has certain limitations. For example: wireless communication is extremely vulnerable to external interference and channel attenuation. Especially in complex environments, interference can cause signal loss or delay, thereby reducing the time synchronization accuracy; IoT devices usually use crystal oscillators with relatively low costs, and the frequency stability of these crystal oscillators is not high, resulting in easy drift of the local clock of the device and increasing the time synchronization error; in a distributed wireless sensor network, signals need to be transmitted through multi-hop nodes, and the differences in network paths will lead to a decrease in synchronization accuracy.

[0005] Therefore, although the time synchronization methods based on wireless communication protocols such as Bluetooth, Wi-Fi, and Zigbee have certain advantages, in the context of high-precision requirements, these methods are still difficult to achieve an ideal synchronization effect. Summary of the Invention

[0006] Based on this, in view of the above technical problems such as low time synchronization accuracy and vulnerability to interference of time synchronization, it is necessary to provide a distributed wireless network time synchronization method and apparatus based on an enhanced clock model for improving the time synchronization accuracy of time synchronization methods based on wireless communication protocols such as Bluetooth, Wi-Fi, and Zigbee.

[0007] A distributed wireless network time synchronization method based on an enhanced clock model, the method comprising:

[0008] Constructing a network connection topology graph of the distributed wireless network; the network connection topology graph includes nodes and edges, the nodes are communication devices in the distributed wireless network, and the edges represent the wireless connection relationships between the nodes;

[0009] Calculating the time difference and frequency difference between each node and its adjacent nodes according to the pre-constructed enhanced clock model, performing state estimation based on the time difference and frequency difference to obtain a time difference state vector and a frequency difference state vector, obtaining a joint state vector according to the time difference state vector and the frequency difference state vector, and constructing a system state transition equation and a system state observation equation for the joint state vector;

[0010] Performing iterations based on the Kalman filtering algorithm according to the system state transition equation and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes, respectively performing clock compensation and frequency compensation on the corresponding nodes according to the optimal estimated values of the time difference and frequency difference, and iteratively updating the optimal estimated values at each moment to achieve time synchronization of the distributed wireless network.

[0011] A distributed wireless network time synchronization device based on an enhanced clock model, the device comprising:

[0012] A topology graph construction module for constructing a network connection topology graph of the distributed wireless network; the network connection topology graph includes nodes and edges, the nodes are communication devices in the distributed wireless network, and the edges represent the wireless connection relationships between the nodes;

[0013] A state estimation module for calculating the time difference and frequency difference between each node and its adjacent nodes according to the pre-constructed enhanced clock model, performing state estimation based on the time difference and frequency difference to obtain a time difference state vector and a frequency difference state vector, obtaining a joint state vector according to the time difference state vector and the frequency difference state vector, and constructing a system state transition equation and a system state observation equation for the joint state vector;

[0014] A time synchronization module for performing iterations based on the Kalman filtering algorithm according to the system state transition equation and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes, respectively performing clock compensation and frequency compensation on the corresponding nodes according to the optimal estimated values of the time difference and frequency difference, and iteratively updating the optimal estimated values at each moment to achieve time synchronization of the distributed wireless network.

[0015] A computer device, comprising a memory and a processor, the memory storing a computer program, and when the processor executes the computer program, the following steps are implemented:

[0016] Construct a network connection topology diagram of a distributed wireless network; the network connection topology diagram includes nodes and edges, where the nodes are communication devices in the distributed wireless network, and the edges represent the wireless connection relationships between the nodes;

[0017] Calculate the time difference and frequency difference between each node and its adjacent nodes according to a pre-constructed enhanced clock model, perform state estimation based on the time difference and frequency difference to obtain a time difference state vector and a frequency difference state vector, obtain a joint state vector according to the time difference state vector and the frequency difference state vector, and construct a system state transition equation and a system state observation equation for the joint state vector;

[0018] Perform iterations based on the Kalman filtering algorithm according to the system state transition equation and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes, perform clock compensation and frequency compensation on the corresponding nodes respectively according to the optimal estimated values of the time difference and frequency difference, and iteratively update the optimal estimated values at each moment to achieve time synchronization of the distributed wireless network.

[0019] A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0020] Construct a network connection topology diagram of a distributed wireless network; the network connection topology diagram includes nodes and edges, where the nodes are communication devices in the distributed wireless network, and the edges represent the wireless connection relationships between the nodes;

[0021] Calculate the time difference and frequency difference between each node and its adjacent nodes according to a pre-constructed enhanced clock model, perform state estimation based on the time difference and frequency difference to obtain a time difference state vector and a frequency difference state vector, obtain a joint state vector according to the time difference state vector and the frequency difference state vector, and construct a system state transition equation and a system state observation equation for the joint state vector;

[0022] Perform iterations based on the Kalman filtering algorithm according to the system state transition equation and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes, perform clock compensation and frequency compensation on the corresponding nodes respectively according to the optimal estimated values of the time difference and frequency difference, and iteratively update the optimal estimated values at each moment to achieve time synchronization of the distributed wireless network.

[0023] The above-mentioned distributed wireless network time synchronization method and device based on an enhanced clock model construct a network connection topology graph of the distributed wireless network. The network connection topology graph includes nodes and edges. The nodes are communication devices in the distributed wireless network, and the edges represent the wireless connection relationships between the nodes. According to the pre-constructed enhanced clock model, the time difference and frequency difference between each node and its adjacent nodes are accurately calculated. Based on the time difference and frequency difference, state estimation is performed to obtain a time difference state vector and a frequency difference state vector. A joint state vector is obtained based on the time difference state vector and the frequency difference state vector, and a system state transition equation and a system state observation equation of the joint state vector are constructed. According to the system state transition equation and the system state observation equation, iteration based on the Kalman filtering algorithm is performed to obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes. Clock compensation and frequency compensation are respectively performed on the corresponding nodes according to the optimal estimated values of the time difference and frequency difference, and the optimal estimated values at each moment are iteratively updated to achieve time synchronization of the distributed wireless network. In the embodiments of the present invention, the time synchronization accuracy of the distributed wireless network can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 FIG. is a schematic flowchart of a wireless sensor network time synchronization method based on a consistency strategy in an embodiment;

[0025] Figure 2 FIG. is a schematic diagram of the filtering operation logic in an embodiment;

[0026] Figure 3 FIG. is a schematic diagram of the filtering operation effect in a specific embodiment;

[0027] Figure 4 FIG. is a structural block diagram of a distributed wireless network time synchronization device based on an enhanced clock model in an embodiment;

[0028] Figure 5 FIG. is an internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0029] In order to make the objectives, technical solutions, and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0030] In an embodiment, as Figure 1 shown, a distributed wireless network time synchronization method based on an enhanced clock model is provided, including the following steps:

[0031] Step 102, construct a network connection topology graph of the distributed wireless network.

[0032] First, construct a distributed system topology model, including the situation of each node and the overall topology connection diagram of the system, which can comprehensively analyze the situation of each node and the overall connection situation of the system, thus ensuring the stability of the system structure. The network connection topology diagram includes nodes and edges. The nodes are communication devices in the distributed wireless network, and the edges represent the wireless connection relationships between the nodes. The distributed wireless network can be a wireless sensor network (WSN), an unmanned aerial vehicle network (UAV Networks), a vehicle-to-everything network (VANET), and a distributed industrial Internet of Things (IIoT), etc.

[0033] Step 104: Calculate the time difference and frequency difference between each node and its adjacent nodes according to the pre-constructed enhanced clock model, perform state estimation based on the time difference and frequency difference to obtain the time difference state vector and the frequency difference state vector, obtain the joint state vector based on the time difference state vector and the frequency difference state vector, and construct the system state transition equation and the system state observation equation of the joint state vector.

[0034] Considering the influence of external physical characteristics such as temperature, pressure, and vibration on the clock accuracy, by constructing an enhanced clock model, the time error caused by external factors is significantly reduced, and the time synchronization accuracy is improved.

[0035] Step 106: Perform iterations based on the Kalman filtering algorithm according to the system state transition equation and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes, perform clock compensation and frequency compensation on the corresponding nodes respectively according to the optimal estimated values of the time difference and frequency difference, and iteratively update the optimal estimated values at each moment to achieve time synchronization of the distributed wireless network.

[0036] Kalman filtering can dynamically track the changes of the clock, update the system state prediction and covariance in real time, and thus effectively eliminate the clock noise and improve the accuracy of time-frequency estimation. The automatic adjustment and real-time correction of this process improve the synchronization accuracy and system stability. The method of the present invention uses a consistency strategy to achieve multi-node collaborative synchronization, and time synchronization can be achieved when the time difference and frequency difference between the node and the surrounding broadcast nodes are zero. By compensating the optimal estimated values of the time difference and frequency difference obtained by Kalman filtering with the average values of the surrounding nodes, the time error between the nodes is gradually eliminated, ensuring the synchronization of all nodes in the distributed system. It can significantly improve the overall synchronization effect of the system, especially having high robustness and adaptability in a multi-node environment.

[0037] The method of the present invention first models the clock synchronization model, and then filters the acquired timestamp data to obtain timestamp data closer to the true value. Finally, based on the surrounding adjacent timestamp data, consistency synchronization is performed, so that the clocks of each node in the distributed system approach consistency and can achieve nanosecond-level synchronization. By enhancing the application of clock modeling and Kalman filtering, the method of the present invention effectively resists the influence of external interference and random noise, and improves the stability and anti-interference ability of clock synchronization. Therefore, this method can also maintain a high synchronization accuracy in a complex network environment and is applicable to application scenarios with environmental instability, signal interference, and large topological changes.

[0038] In the above time synchronization method for wireless sensor networks based on a consistency strategy, by constructing a network connection topology graph of a distributed wireless network, the network connection topology graph includes nodes and edges, the nodes are communication devices in the distributed wireless network, and the edges represent the wireless connection relationships between the nodes. According to the pre-constructed enhanced clock model, the time difference and frequency difference between each node and its adjacent nodes are calculated, and state estimation is performed based on the time difference and frequency difference to obtain a time difference state vector and a frequency difference state vector. A joint state vector is obtained based on the time difference state vector and the frequency difference state vector, and a system state transition equation and a system state observation equation for the joint state vector are constructed; based on the system state transition equation and the system state observation equation, iteration based on the Kalman filtering algorithm is performed to obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes, and clock compensation and frequency compensation are respectively performed on the corresponding nodes according to the optimal estimated values of the time difference and frequency difference, and the optimal estimated values at each moment are iteratively updated to achieve time synchronization of the distributed wireless network. The embodiment of the present invention can improve the time synchronization accuracy of the distributed wireless network.

[0039] In one embodiment, the enhanced clock model is:

[0040] ;

[0041] Wherein, represents the reading of the clock at moment, represents the reading of the clock at the initial moment, represents the current frequency of the clock, is the linear frequency drift, represents the random part of the time difference. In this embodiment, in order to achieve high-precision clock synchronization, the time-frequency characteristics of the clock are fully considered, including the influence of physical characteristic changes such as temperature, pressure, and vibration, as well as the influence of noise and other aspects, and the enhanced clock model as shown in the above formula is constructed according to the clock characteristics.

[0042] In one embodiment, the system state transition equation is:

[0043] ;

[0044] Among them, is the state transition matrix, is the system noise matrix, is the predicted system state vector at time is the system state at time is the system linear frequency drift difference. In this embodiment, the noise covariance is .

[0045] In one embodiment, the system state observation equation is:

[0046] ;

[0047] Among them, is the system state observation value, is the combined state vector, is the observation noise. In this embodiment, is the observation matrix, and the observation noise follows a Gaussian distribution with a mean of 0 and a covariance of .

[0048] According to the enhanced clock model, the state transition formulas for the time difference and frequency difference between two nodes can be obtained:

[0049] ;

[0050] ;

[0051] In the formula: represents the clock difference between two nodes at time, represents the frequency difference between two nodes at time. The above variables are jointly combined into the combined state vector :

[0052] .

[0053] In one embodiment, iterating based on the Kalman filter algorithm according to the system state transition equation and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes includes: obtaining the system state prediction vector at the next moment according to the system state at the current moment of each node and the system state transition equation; updating the Kalman gain coefficient according to the current state prediction covariance matrix, and correcting the system state prediction vector according to the Kalman gain coefficient and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference under the current iteration; iteratively updating the covariance matrix until the iteration stop condition is met, then stopping the iteration and outputting the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes.

[0054] In this embodiment, according to the enhanced clock model and the dynamic change of the clock, the time difference and frequency difference between nodes are also dynamically changing. To improve the estimation performance of the clock difference on time and frequency, the method of the present invention uses a Kalman filter for real-time estimation. As Figure 2 shown, a schematic diagram of the filtering operation logic is provided. The filtering method will first update the system state prediction vector, and then maintain the state prediction covariance matrix of the system and the Kalman gain coefficient . According to the above two parameters, the optimal estimated value can be obtained, that is . Finally, update the covariance of the system and wait to enter the next calculation.

[0055] In one embodiment, performing clock compensation and frequency compensation on the corresponding nodes according to the optimal estimated values of the time difference and frequency difference respectively includes: obtaining the clock compensation value according to the mean of the optimal estimated values of the time difference between the current node and its adjacent nodes, and performing clock compensation on the current node according to the clock compensation value; obtaining the frequency compensation value according to the mean of the optimal estimated values of the frequency difference between the current node and its adjacent nodes, and performing frequency compensation on the current node according to the frequency compensation value.

[0056] In this embodiment, the optimal estimated value of the clock parameter difference between two nodes can be obtained after filtering. According to the idea of average consensus, synchronization can be achieved when the time difference and frequency difference between a node and its surrounding broadcast nodes are 0. The core goal of the consensus theory is to make multiple nodes gradually tend to a consistent state through mutual interaction and information sharing. Average consensus is one of the methods, which emphasizes that through the iterative interaction of local information, the state values of all nodes gradually converge to a certain global average value. In the time synchronization problem of the present invention, the state values of the nodes correspond to the time difference and frequency difference. When the time difference and frequency difference are both 0, the clock synchronization between nodes is not only completely consistent at the instantaneous time, but also remains consistent during the subsequent passage of time. After averaging the optimal estimated values of the clock parameter differences between the node and its surrounding nodes, the compensation process is shown in the following formula:

[0057] ;

[0058] ;

[0059] Wherein: and represent the compensated local clock and frequency, and represent the current local clock and frequency of the node, represents the number of nodes around the node, and represent the optimal estimated values of the time difference and frequency difference between two nodes obtained by Kalman filtering.

[0060] In one embodiment, each node in the network connection topology diagram uses a stable clock source as the clock module. In this embodiment, the nodes use relatively stable clock sources as the clock modules of each node, which can ensure the accuracy of the node clocks and reduce the drift of the node clocks.

[0061] It should be understood that although Figure 1 the steps in the flowchart of Figure 1 are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover,

[0062] In a specific embodiment, the method of the present invention is applied to a time synchronization system with local clock noise of 10 -9 , observation error of 10 -9 . The initial range of the clock used in this clock synchronization system is [-5s, 5s], the frequency is [0.99999999, 1.00000001], and the standard deviation of the frequency is . The total number of nodes is 50 nodes, and the topology diagram between nodes is known during deployment. The single sampling period of the node is 1s, and the total experimental test duration is 500s. During the operation of the clock synchronization system, 2 nodes are randomly selected to view the filtering effect. As Figure 3 shown, it can be seen that the present invention can effectively eliminate the clock noise between 2 nodes, avoid abnormal clock values, and effectively avoid clock jitter after filtering, improving the accuracy of time-frequency estimation. After the clock synchronization system has run for 500s, the average time difference between each node and node 1 is , the average frequency difference is .

[0063] In one embodiment, as Figure 4 shown, a time synchronization device for a wireless sensor network based on a consistency strategy is provided, including:

[0064] A topology graph construction module 402 for constructing a network connection topology graph of a distributed wireless network; the network connection topology graph includes nodes and edges, the nodes are communication devices in the distributed wireless network, and the edges represent the wireless connection relationships between the nodes;

[0065] A state estimation module 404 for calculating the time difference and frequency difference between each node and its adjacent nodes according to a pre-constructed enhanced clock model, performing state estimation based on the time difference and frequency difference to obtain a time difference state vector and a frequency difference state vector, obtaining a joint state vector according to the time difference state vector and the frequency difference state vector, and constructing a system state transition equation and a system state observation equation for the joint state vector;

[0066] A time synchronization module 406 for performing iterations based on the Kalman filter algorithm according to the system state transition equation and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes, performing clock compensation and frequency compensation on the corresponding nodes respectively according to the optimal estimated values of the time difference and frequency difference, and iteratively updating the optimal estimated values at each moment to achieve time synchronization of the distributed wireless network.

[0067] In one of the embodiments, the enhanced clock model is:

[0068] ;

[0069] Wherein, represents the reading of the clock at moment, represents the reading of the clock at the initial moment, represents the current frequency of the clock, is the linear frequency drift, represents the random part of the time difference.

[0070] In one of the embodiments, the system state transition equation is:

[0071] ;

[0072] Wherein, is the state transition matrix, is the system noise matrix, is the system state prediction vector at is the system state at is the system linear frequency drift difference.

[0073] In one embodiment, the system state observation equation is:

[0074] ;

[0075] where is the system state observation value, is the joint state vector, is the observation noise.

[0076] In one embodiment, performing clock compensation and frequency compensation on corresponding nodes according to the optimal estimated values of time difference and frequency difference respectively includes: obtaining a clock compensation value according to the mean value of the optimal estimated value of the time difference between the current node and the adjacent node, and performing clock compensation on the current node according to the clock compensation value; obtaining a frequency compensation value according to the mean value of the optimal estimated value of the frequency difference between the current node and the adjacent node, and performing frequency compensation on the current node according to the frequency compensation value.

[0077] In one embodiment, performing iteration based on the Kalman filtering algorithm according to the system state transition equation and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent node includes: obtaining the system state prediction vector at the next moment according to the system state of each node at the current moment and the system state transition equation; updating the Kalman gain coefficient according to the current state prediction covariance matrix, and correcting the system state prediction vector according to the Kalman gain coefficient and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference in the current iteration; iteratively updating the covariance matrix until the iteration stop condition is met, then stopping the iteration and outputting the optimal estimated values of the time difference and frequency difference between each node and its adjacent node.

[0078] In one embodiment, each node in the network connection topology diagram uses a stable clock source as the clock module.

[0079] For the specific limitations of the wireless sensor network time synchronization device based on the consistency strategy, reference can be made to the limitations of the wireless sensor network time synchronization method based on the consistency strategy in the above text, which will not be elaborated here. Each module in the above wireless sensor network time synchronization device based on the consistency strategy can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0080] In one embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 5As shown in the figure. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a wireless sensor network time synchronization method based on a consistency policy. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the computer device housing, or an external keyboard, a touchpad, or a mouse, etc.

[0081] Those skilled in the art can understand that Figure 5 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0082] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the steps of the method in the above embodiment.

[0083] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, it implements the steps of the method in the above embodiment.

[0084] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0085] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0086] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it cannot be construed as a limitation to the scope of the invention. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A distributed wireless network time synchronization method based on an enhanced clock model, characterized in that, The method includes: Constructing a network connection topology graph of a distributed wireless network; the network connection topology graph includes nodes and edges, the nodes are communication devices in the distributed wireless network, and the edges represent the wireless connection relationships between the nodes; Calculating the time difference and frequency difference between each node and its adjacent nodes according to a pre-constructed enhanced clock model, performing state estimation based on the time difference and frequency difference to obtain a time difference state vector and a frequency difference state vector, obtaining a joint state vector according to the time difference state vector and the frequency difference state vector, and constructing a system state transition equation and a system state observation equation for the joint state vector; the enhanced clock model is used to construct the physical true clock readings of the nodes; Performing iterations based on the Kalman filtering algorithm according to the system state transition equation and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes, performing clock compensation and frequency compensation on the corresponding nodes respectively according to the optimal estimated values of the time difference and frequency difference, and iteratively updating the optimal estimated values at each moment to achieve time synchronization of the distributed wireless network; The performing clock compensation and frequency compensation on the corresponding nodes respectively according to the optimal estimated values of the time difference and frequency difference includes: Obtaining a clock compensation value according to the mean value of the optimal estimated value of the time difference between the current node and its adjacent nodes, and performing clock compensation on the current node according to the clock compensation value; Obtaining a frequency compensation value according to the mean value of the optimal estimated value of the frequency difference between the current node and its adjacent nodes, and performing frequency compensation on the current node according to the frequency compensation value; The performing iterations based on the Kalman filtering algorithm according to the system state transition equation and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes includes: Obtaining a system state prediction vector for the next moment according to the system state of each node at the current moment and the system state transition equation; Updating the Kalman gain coefficient according to the current state prediction covariance matrix, and correcting the system state prediction vector according to the Kalman gain coefficient and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference in the current iteration; Iteratively updating the covariance matrix until the iteration stop condition is met, then stopping the iteration and outputting the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes.

2. The method according to claim 1, characterized in that, The enhanced clock model is: ; Among them, represents the reading of the clock at moment, represents the reading of the clock at the initial moment, represents the current frequency of the clock, is the linear frequency drift, represents the random part of the time difference.

3. The method according to claim 1, wherein The system state transition equation is: ; Among them, is the state transition matrix, is the system noise matrix, is the predicted system state vector at time is the system state at time is the system linear frequency drift difference.

4. The method according to claim 1, characterized in that The system state observation equation is: ; wherein, is the system state observation value, is the joint state vector, is the observation noise.

5. The method according to claim 1, wherein Each node in the network connection topology graph uses a stable clock source as the clock module.

6. A time synchronization device for a wireless sensor network based on a consistency strategy, characterized in that, The device includes: A topology graph construction module, configured to construct a network connection topology graph of a distributed wireless network; the network connection topology graph includes nodes and edges, the nodes are communication devices in the distributed wireless network, and the edges represent the wireless connection relationships between the nodes; A state estimation module, configured to calculate the time difference and frequency difference between each node and its adjacent nodes according to a pre-constructed enhanced clock model, perform state estimation based on the time difference and frequency difference to obtain a time difference state vector and a frequency difference state vector, obtain a joint state vector according to the time difference state vector and the frequency difference state vector, and construct a system state transition equation and a system state observation equation for the joint state vector; A time synchronization module, which is used to perform iterations based on the Kalman filtering algorithm according to the system state transition equation and the system state observation equation, obtain the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes, perform clock compensation and frequency compensation on the corresponding nodes respectively according to the optimal estimated values of the time difference and frequency difference, iteratively update the optimal estimated values at each moment, and realize the time synchronization of the distributed wireless network; The time synchronization module is further used to obtain a clock compensation value according to the mean value of the optimal estimated value of the time difference between the current node and its adjacent nodes, and perform clock compensation on the current node according to the clock compensation value; obtain a frequency compensation value according to the mean value of the optimal estimated value of the frequency difference between the current node and its adjacent nodes, and perform frequency compensation on the current node according to the frequency compensation value; The time synchronization module is further used to obtain the predicted vector of the system state at the next moment according to the system state and the system state transition equation of each node at the current moment; update the Kalman gain coefficient according to the current state prediction covariance matrix, and correct the system state prediction vector according to the Kalman gain coefficient and the system state observation equation to obtain the optimal estimated values of the time difference and frequency difference under the current iteration; iteratively update the covariance matrix until the iteration stop condition is met, then stop the iteration and output the optimal estimated values of the time difference and frequency difference between each node and its adjacent nodes.

7. The device according to claim 6, characterized in that, The enhanced clock model is: ; Among them, represents the reading of the clock at moment, represents the reading of the clock at the initial moment, represents the current frequency of the clock, is the linear frequency drift, represents the random part of the time difference.

8. The device according to claim 6, characterized in that, The system state transition equation is: ; Among them, is the state transition matrix, is the system noise matrix, is the predicted system state vector at time is the system state at time is the system linear frequency drift difference.

Citation Information

Patent Citations

  • Method and system used for time difference estimation and multi-station clock error correction

    CN103760522A

  • Consistent clock synchronization frequency offset estimation method based on sequence least square

    CN113207167A