Time synchronization method and system based on mesh topology ad hoc network
By adopting the self-networking method of mesh topology in indoor positioning systems, multi-level time synchronization and redundant information transmission are realized, solving the problems of poor stability and insufficient robustness in the existing technology, and improving the accuracy of time synchronization and reliability, suitable for complex network environments.
Patent Information
- Application Number
- CN202410967899.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-11-05
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing time synchronization technology has problems such as poor stability, insufficient robustness and low synchronization accuracy in indoor positioning systems. Especially in complex network environments, the tree topology is prone to system crash due to node failure and it is difficult to achieve sub-milliseconds. High-precision time synchronization at the level.
Administrative networking method based on mesh topology is adopted, and nodes are divided into root master, secondary master and slave stations to realize multi-level time synchronization mechanism, secondary master stations verify each other and reduce errors, and automatically when the root master station fails Upgrade, the slave station broadcasts synchronization information of all devices, combines single-line, ring and mesh time information transmission methods, and uses adjustment algorithms to improve synchronization accuracy.
It improves the resilience and robustness of the system, ensures the redundant transmission and efficiency of time synchronization information, and can maintain high-precision time synchronization when network topology changes, enhancing the stability and synchronization reliability of the device.
Smart Images

Figure CN118900455A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to but is not limited to the field of time synchronization technology, and in particular relates to a time synchronization method and system based on a mesh topology ad hoc network. Background Art
[0002] At present, there are two main methods for achieving time synchronization: wired time synchronization and wireless synchronization. First, in wired time synchronization, devices are physically connected and time information is transmitted through electrical signals. In commercial applications, wired time synchronization not only requires the laying of a large number of cables, but also requires special equipment to control the transmission of time synchronization signals. The construction cost is high, and a large amount of wiring is not beautiful, so the application scenarios of wired time synchronization are limited. On the other hand, wireless time synchronization transmits time information through the interaction of wireless signals. However, wireless signals are not as stable as those transmitted in wired physical media, and problems such as packet loss and garbled characters need to be dealt with. In addition, some studies have conducted experiments on different synchronization frequencies, and 95% of the plane position errors are about 1.25m. When a longer synchronization period is used, the error will increase significantly.
[0003] In indoor positioning systems, random errors generated during time synchronization mainly include signal multipath transmission errors and device processing delay errors, which will be transmitted to the final positioning results. In addition, low-cost crystal oscillators lead to poor stability of the time system between devices, and the time synchronization can be maintained for a short time.
[0004] It is most common to construct a time system with a tree topology in the field of indoor positioning. The tree topology of time synchronization refers to the way that time synchronization is transmitted between base stations in the entire indoor positioning system, just like a tree. Or to be more precise, it is an inverted tree, with the root of the entire tree first, and then the root branches out to produce many branches. A typical tree topology of time synchronization. All the small circles represent nodes one by one, that is, base stations. The lines connecting these nodes are directional, representing the direction of time synchronization transmission. The nodes of the entire tree topology are divided into three types, namely the root master station, the secondary master station and the slave station. As the name suggests, the root master station represents the root of the entire tree and is the most important node. Its time system is transmitted throughout the synchronization process. Its main task is to continuously and periodically propagate the timestamp of its own time system, and does not listen to the information of any other base stations. Next is the secondary master station. The secondary master station is also a type of master station, but its level is lower than that of the root master station. Its task is to first listen to the timestamp of the root master station or other secondary master stations, then calibrate its own local time system, broadcast its own calibrated time system, and then calibrate the time systems of other base station devices. The last type is a slave station. Such a node can only follow the time information given by other master stations. Its task is to constantly listen to the information of the surrounding master stations and only accept the time information of a specific master station.
[0005] The tree topology of time synchronization has the advantage that the system uses the least resources for time synchronization, and the time synchronization information only needs to be periodically guaranteed to flow throughout the entire system. For a single device, at most it listens and receives, and absolutely only accepts the synchronization information of a single target. The logic is simple and the amount of calculation is small. However, this topology also has obvious disadvantages. First, it requires high stability of the device. It can be seen that the flow of all time synchronization information is unidirectional, which means that if any master station device fails and cannot transmit time system information normally, the subsequent branches will not be able to obtain stable time synchronization information. If there is a direct power outage or crash, part of the base station equipment will not work at all. Even if there is a problem with the root master station, the entire system will not be able to operate. Another disadvantage of the tree topology of time synchronization is that because the time system of the root master station will inevitably have transmission errors during the transmission process, as the depth of the branch becomes deeper and deeper, the error will continue to accumulate. Summary of the invention
[0006] In view of the problems existing in the prior art, the present invention provides a time synchronization method based on a mesh topology ad hoc network.
[0007] The present invention is implemented in this way: a time synchronization method based on a mesh topology ad hoc network, the method comprising:
[0008] The mesh topology of time synchronization is the way that time synchronization is transmitted between base stations in the indoor positioning system, just like a network. Each small circle represents a base station, and the arrows connecting the nodes represent the direction of time synchronization transmission;
[0009] The nodes of the mesh topology are divided into three types: root master station, secondary master station and slave station;
[0010] The main task of the root master station is to continuously and periodically transmit its time system and not to accept synchronization information from other base stations;
[0011] The secondary master station not only listens to the time synchronization data packets of the previous level, but also refers to the synchronization information of all the sub-master stations that can be heard, and verifies each other to minimize the error of time synchronization. In addition, in order to prevent the entire system from crashing after the root master station equipment fails, the secondary master stations are also divided into levels. When they cannot obtain the synchronization information of the master station with a higher level than themselves for a long time, they can act as the root master station and continue to transmit the previously obtained time system information according to the local time.
[0012] The slave station listens to the synchronization information of all devices and broadcasts the synchronization information again.
[0013] Furthermore, the resilience of the time-synchronized mesh topology system is greatly improved, and the time synchronization information is continuously transmitted throughout the entire topology. No single node appears to be critical, and if a problem occurs, the mesh topology can be quickly repaired. This does not require high stability of the equipment, and the appearance of a few bad points in the topology does not interfere with the normal operation of other devices, and the robustness of the entire system is greatly improved. At the same time, the time synchronization information obtained by each node is redundant, and the time synchronization accuracy can be improved through algorithms.
[0014] Furthermore, the mesh topology of the self-organizing network time synchronization may be affected by factors such as the physical environment, channel environment, and device specificity in a local area, and various synchronization transmission situations may occur, as follows:
[0015] (1) Single-line time information transmission;
[0016] (2) Circular time information transmission;
[0017] (3) Network time information transmission.
[0018] Furthermore, the single-line time information transmission specifically includes:
[0019] Since only sub-millisecond time synchronization is required, the time required for propagation in the air can be basically ignored at the propagation speed of Bluetooth signals. In addition, the crystal oscillator hardware devices currently on the market can ensure that the error is far below the sub-millisecond level for a long time, so the scale difference between the time systems of the sending and receiving devices can also be basically ignored. In general, sub-millisecond time synchronization in self-organizing networks needs to consider the delay and stability of the processing of the devices at both ends.
[0020] Such a single-line time information transmission is difficult to correct the delay of each device processing. At most, it can only improve its stability through multiple time synchronizations, and then weaken the processing delay according to calibration. The estimated i-th synchronization timestamp It can be expressed as
[0021]
[0022] Among them, T i represents the synchronization timestamp collected for the i-th time, P sync Indicates the time synchronization period, D c represents the nominal terminal processing delay, and N represents the window size of the synchronization timestamp used to improve stability.
[0023] Furthermore, the annular time information transmission specifically includes:
[0024] When the synchronization timestamp starts from a device and returns to the device after a certain number of cycles, the real-time processing delay D r It can be estimated as
[0025] D r =T e -T s -C loop ·P sync (Formula 2)
[0026] Where T s and T e The time when the ring node starts broadcasting and the time when the ring is captured, C loop It represents the number of edges forming a ring, that is, the number of cycles experienced by the ring; however, if there is only a small amount of time synchronization information, it can be combined with (Formula 1) to improve the stability of delay estimation.
[0027] Furthermore, the mesh time information transmission specifically includes:
[0028] Ideally, time synchronization transmission should be meshed, and even if it is not completely smooth, there should be a lot of redundant synchronization information; in this case, the time synchronization stamp of each base station can be estimated by a simple adjustment method;
[0029] Assume that the linear function model and random model of adjustment are:
[0030]
[0031]
[0032] Where l is the observation vector, B is the coefficient matrix with full column rank, x is the unknown parameter vector, Δ is the error vector, D is the diagonal variance-covariance matrix, σ0 is the unit weighted error, Q is the diagonal cofactor matrix, and P is the diagonal weight matrix;
[0033] The estimation criterion for independent observations is:
[0034]
[0035] Among them, b i =[b i1 b i2 … b it ],l i represents the i-th observation value, then the corresponding error equation is:
[0036]
[0037] Derivative x in the above formula, record We can get:
[0038]
[0039] make but:
[0040] or
[0041] In the formula, is the equivalent weight matrix, is the equivalent weight element, w i is the weight factor;
[0042] Substituting (Formula 6) into (Formula 8), we get the normal equation:
[0043]
[0044] Solving the above equation, we get:
[0045]
[0046] In the formula, for The cofactor matrix of Substituting (Formula 10) into (Formula 6), we can get the correction value v of the observed value;
[0047] The new weight factor of each observation value is determined according to the residual v, and then the next round of adjustment is carried out, and it is iterated repeatedly until the change between the two estimated values is less than the limit error.
[0048] Another object of the present invention is to provide a time synchronization system based on a mesh topology ad hoc network, the system comprising:
[0049] The data preprocessing module is used to capture the network traffic data in the original pcap format, aggregate the data into five-tuples to form a data stream, and extract statistical features including the total data volume, packet count, and average packet size;
[0050] The traffic feature learning module is configured with LSTM and GRU networks, where GRU is used as the main network to integrate high-level features from the LSTM auxiliary network to jointly learn the feature representation of traffic data;
[0051] The detection and classification module receives the feature representation from the traffic feature learning module and classifies it through the Softmax classifier to identify abnormal traffic.
[0052] Furthermore, the time synchronization mesh topology in the system includes three types of nodes: root master station, secondary master station and slave station, wherein:
[0053] The main task of the root master station is to continuously and periodically transmit its time system and does not accept synchronization information from other base stations;
[0054] The secondary master station not only listens to the time synchronization data packets of the previous level, but also refers to the synchronization information of all audible secondary master stations, and verifies each other to reduce the time synchronization error. When it is unable to obtain the synchronization information of a higher-level master station for a long time, it can act as a root master station and continue to propagate the time system information according to the local time;
[0055] The slave station receives synchronization information from all devices and broadcasts the synchronization information again.
[0056] Furthermore, the resilience of the time synchronization system is greatly improved, and the time synchronization information is continuously transmitted in the entire topology. When a problem occurs at any node, the mesh topology can be quickly repaired without interfering with the normal operation of other devices, thereby improving the robustness of the system; the time synchronization information obtained by each node is redundant, and the time synchronization accuracy can be improved through algorithms.
[0057] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:
[0058] First, the mesh topology of time synchronization provided by the present invention has obvious advantages, and the system resilience is greatly improved. Time synchronization information is continuously transmitted throughout the topology. No node is critical, and if there is a problem, the mesh topology can be repaired quickly, which does not require the stability of the device to be so high, and the appearance of a few bad points in the topology does not interfere with the normal operation of other devices, and the robustness of the entire system is greatly improved. At the same time, the time synchronization information obtained by each node is redundant, and the accuracy of time synchronization can be improved through algorithms.
[0059] Second, the present invention aims at the limitations of the time synchronization method in the prior art in a complex network environment, and proposes a time synchronization method based on a mesh topology self-organizing network. The tree topology structure in the prior art is prone to cause the collapse of the entire system when a node fails, and has poor robustness and stability. By adopting a mesh topology structure, the present invention realizes redundant transmission of time synchronization information on multiple paths, greatly improving the resilience and robustness of the system. Even if some nodes have problems, the entire system can still operate normally and quickly repair the topology structure.
[0060] Secondly, the present invention realizes a multi-level time synchronization mechanism by dividing the nodes into three types: root master station, secondary master station and slave station. The root master station is responsible for uninterrupted transmission of time synchronization information, while the secondary master station not only monitors the time synchronization data of the previous level, but also mutually references and verifies the synchronization information of multiple secondary master stations to reduce the time synchronization error, and has the ability to automatically upgrade to the root master station when the root master station fails. The slave station receives and broadcasts the synchronization information of all devices to ensure that the time synchronization information of the entire network is fully transmitted and shared. This design effectively prevents single point failures and improves the accuracy and reliability of time synchronization.
[0061] In addition, the present invention proposes three time information transmission modes: single-line, ring and mesh, in view of the time synchronization transmission under different environments and conditions, and optimizes them in combination with factors such as physical environment, channel environment, and device specificity. Through multiple synchronization and calibration processes, the stability of processing delays and the accuracy of time synchronization are improved. In the ring and mesh time information transmission, the accuracy and stability of the synchronization timestamp are further improved through real-time processing delay estimation and adjustment methods, ensuring the efficiency and accuracy of time synchronization in complex network environments.
[0062] The present invention has made significant technical progress in time synchronization algorithms and mathematical models. By adopting a composite topology structure, multi-level node design, and multiple time information transmission methods, the present invention effectively solves the problems of poor stability, insufficient robustness, and low synchronization accuracy faced by time synchronization in complex network environments in the prior art, and provides a more reliable and efficient time synchronization solution for applications such as indoor positioning systems.
[0063] Third, the existing tree topology time synchronization method solved by the present invention has the following technical problems:
[0064] 1. Insufficient synchronization accuracy: It is difficult to achieve high-precision time synchronization at the sub-millisecond level, especially when the device processing delay is large or unstable.
[0065] 2. Inaccurate delay estimation: It is difficult to accurately estimate the processing delay between devices, resulting in large time synchronization errors.
[0066] 3. Insufficient information redundancy and reliability: Due to the lack of redundant synchronization information, the reliability of time synchronization is poor when the network topology changes.
[0067] Significant technological advancements:
[0068] Through the above technical solution, the present invention has achieved significant technical progress, which is specifically reflected in the following aspects:
[0069] 1. Improve time synchronization accuracy:
[0070] Through multiple time synchronization and calibration processing delays, the stability and accuracy of time synchronization are improved, and sub-millisecond time synchronization can be achieved.
[0071] 2. Accurately estimate processing delays:
[0072] Combining the single-line and ring-shaped time information transmission methods can more accurately estimate processing delays and reduce time synchronization errors.
[0073] 3. Enhanced synchronization reliability:
[0074] The reliability of time synchronization is improved through mesh time information transmission and redundant synchronization information, and high-precision time synchronization can be maintained when the network topology changes.
[0075] 4. Advanced adjustment algorithm:
[0076] The adjustment algorithm is used to estimate the time synchronization stamp, which further improves the accuracy and stability of time synchronization and adapts to the time synchronization requirements under different network conditions.
[0077] 5. Comprehensively improve system performance:
[0078] The technical solution of the present invention significantly improves the overall performance of the mesh topology self-organizing network time synchronization system through the combination of multiple methods, and is suitable for a wide range of application scenarios.
[0079] In summary, the present invention solves several key problems in the prior art through innovative technical solutions and advanced mathematical models, achieves significant technological progress, and has important practical application value and promotion prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 It is a typical time-synchronized mesh topology provided by an embodiment of the present invention;
[0081] Figure 2 It is a single-line time information transmission provided by an embodiment of the present invention;
[0082] Figure 3 It is the ring-shaped time information transmission provided by the embodiment of the present invention;
[0083] Figure 4 It is the mesh time information transmission provided by the embodiment of the present invention;
[0084] Figure 5 Schematic diagram of audio base station time synchronization provided by an embodiment of the present invention
[0085] Figure 6 1 is a comparison of the audio base station self-organizing network time synchronization algorithm provided by the embodiment of the present invention: (a) the distance difference between base station A and base station B; (b) the distance difference between base station A and base station C; (c) the distance difference between base station A and base station D; (d) the synchronization delay of each round estimated by indirect adjustment;
[0086] Figure 7 It is an office scene map provided by an embodiment of the present invention;
[0087] Figure 8 is the difference between epochs of the Bluetooth timestamp scanned by the mobile phone provided in the embodiment of the present invention;
[0088] Fig. 9 These are the distance estimation results from a mobile phone to a base station at two static points provided by an embodiment of the present invention: (a) the test result at point one; and (b) the test result at point two. DETAILED DESCRIPTION
[0089] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0090] like Figure 1 As shown, an embodiment of the present invention provides a time synchronization method based on a mesh topology ad hoc network, the method comprising:
[0091] The mesh topology of time synchronization is the way that time synchronization is transmitted between base stations in the indoor positioning system, just like a network. Like the tree topology, each small circle represents a base station, and the arrows connecting the nodes represent the direction of time synchronization transmission;
[0092] The nodes of the mesh topology are also divided into three types: root master station, secondary master station and slave station;
[0093] The main task of the root master station is still to continuously and periodically transmit its time system, and it does not accept synchronization information from other base stations, which is the same as the root master station in the tree topology;
[0094] The secondary master station not only listens to the time synchronization data packets of the previous level, but also refers to the synchronization information of all the sub-master stations that can be heard, and verifies each other to minimize the error of time synchronization. In addition, in order to prevent the entire system from crashing after the root master station equipment fails, the secondary master stations are also divided into levels. When they cannot obtain the synchronization information of the master station with a higher level than themselves for a long time, they can act as the root master station and continue to transmit the previously obtained time system information according to the local time.
[0095] The slave station no longer only listens to the information of a single master station, but the synchronization information of all devices, and will also broadcast the synchronization information.
[0096] The resilience of the time-synchronized mesh topology system is greatly improved, and the time synchronization information is continuously transmitted throughout the entire topology. No single node appears to be critical, and if a problem occurs, the mesh topology can quickly repair it. This does not require high stability of the equipment, and the appearance of a few bad points in the topology does not interfere with the normal operation of other devices, and the robustness of the entire system is greatly improved. At the same time, the time synchronization information obtained by each node is redundant, and the time synchronization accuracy can be improved through algorithms.
[0097] The mesh topology of the self-organizing network time synchronization is affected by factors such as the physical environment, channel environment, and device specificity in a local area, and various synchronization transmission situations may occur, as follows:
[0098] (1) Single-line time information transmission;
[0099] (2) Circular time information transmission;
[0100] (3) Network time information transmission.
[0101] like Figure 2 As shown, the single-line time information transmission specifically includes:
[0102] Since only sub-millisecond time synchronization is required, the time required for propagation in the air can be basically ignored at the propagation speed of Bluetooth signals. In addition, the crystal oscillator hardware devices currently on the market can ensure that the error is far below the sub-millisecond level for a long time, so the scale difference between the time systems of the sending and receiving devices can also be basically ignored. In general, sub-millisecond time synchronization in self-organizing networks needs to consider the delay and stability of the processing of the devices at both ends.
[0103] Such a single-line time information transmission is difficult to correct the delay of each device processing. At most, it can only improve its stability through multiple time synchronizations, and then weaken the processing delay according to calibration. The estimated i-th synchronization timestamp It can be expressed as
[0104]
[0105] Among them, T i represents the synchronization timestamp collected for the i-th time, P sync Indicates the time synchronization period, D c represents the nominal terminal processing delay, and N represents the window size of the synchronization timestamp used to improve stability.
[0106] like Figure 3 As shown, the annular time information transmission specifically includes:
[0107] When the synchronization timestamp starts from a device and returns to the device after a certain number of cycles, the real-time processing delay D r It can be estimated as
[0108] D r =T e -T s -C loop ·P sync (Formula 2)
[0109] Where T s and T e The time when the ring node starts broadcasting and the time when the ring is captured, C loop It represents the number of edges forming a ring, that is, the number of cycles experienced by the ring; however, if there is only a small amount of time synchronization information, it can be combined with (Formula 1) to improve the stability of delay estimation.
[0110] like Figure 4 As shown, the mesh time information transmission specifically includes:
[0111] Ideally, time synchronization transmission should be meshed, and even if it is not completely smooth, there should be a lot of redundant synchronization information; in this case, the time synchronization stamp of each base station can be estimated by a simple adjustment method;
[0112] Assume that the linear function model and random model of adjustment are:
[0113]
[0114] Where l is the observation vector, B is the coefficient matrix with full column rank, x is the unknown parameter vector, Δ is the error vector, D is the diagonal variance-covariance matrix, σ0 is the unit weighted error, Q is the diagonal cofactor matrix, and P is the diagonal weight matrix;
[0115] The estimation criterion for independent observations is:
[0116]
[0117] Among them, b i =[b i1 b i2 … b it ],l i represents the i-th observation value, then the corresponding error equation is:
[0118]
[0119] Derivative x in the above formula, record We can get:
[0120]
[0121] make but:
[0122] or
[0123] In the formula, is the equivalent weight matrix, is the equivalent weight element, w i is the weight factor;
[0124] Substituting (Formula 6) into (Formula 8), we get the normal equation:
[0125]
[0126] Solving the above equation, we get:
[0127]
[0128] In the formula, for The cofactor matrix of Substituting (Formula 10) into (Formula 6), we can get the correction value v of the observed value;
[0129] The new weight factor of each observation value is determined according to the residual v, and then the next round of adjustment is carried out, and it is iterated repeatedly until the change between the two estimated values is less than the limit error.
[0130] Example: Time synchronization verification between audio base stations
[0131] (1) Experimental description
[0132] This experiment simplifies the time synchronization mesh topology of the ad hoc network, only selects four base stations for the experiment, and places the four audio base stations close together, such as Figure 5 As shown. By burning different base station programs, the experiment is divided into 3 groups. In the first group of experiments, one of the base stations A broadcasts Bluetooth signals to directly synchronize the other three base stations; in the second group of experiments, the Bluetooth time synchronization information is transmitted among the four base stations ABCD in turn, and base station A scans the Bluetooth package broadcasted by base station D last, and corrects the time synchronization through the ring synchronization information; the third group of experiments is consistent with the propagation logic of the second group, but the four base stations continuously scan the Bluetooth synchronization packages of the other three base stations, and each epoch is corrected for time synchronization through indirect adjustment. In each group of experiments, each base station records the timestamp of the Bluetooth broadcast and the timestamp of other Bluetooth synchronization packages scanned, and outputs them to the notebook through the data line.
[0133] (2) Experimental results and analysis
[0134] The timestamps of the Bluetooth synchronization packets broadcast by different base stations and the timestamps of other Bluetooth synchronization packets scanned during the experiment are processed, and the synchronization error between base stations is estimated using different information and methods. The results of the experimental processing are shown in Figure 2. Figure 6 As shown. In order to more intuitively compare the synchronization errors processed by different methods, this paper assumes that a terminal is at the same distance from the four base stations in the experiment and has no bias in detecting sound signals. Therefore, Figure 6 The estimated distance difference between base stations is only related to the synchronization error of the base stations. In single-line transmission, the processing delay of Bluetooth signal transmission cannot be estimated. In order to make the results more beautiful, this experiment also compensates for the constant 20ms according to the consistent processing in actual applications.
[0135] Figure 6 (a) Figure 6 (b) and Figure 6(c) is the distance difference between different base stations and base station A. Generally speaking, the results of the three base station devices are not very different, indicating that the synchronization scheme is not sensitive to hardware differences. From the perspective of single-line transmission, the synchronization of base station B is the most stable. After 20ms constant compensation, the distance difference is stable at 0.35m, while the results of the other two base stations fluctuate between 0.3m and 0.4m. Relatively speaking, although the results of ring transmission and mesh transmission have a much larger amplitude, the accuracy is greatly improved. The processing delay of Bluetooth signal transmission can be estimated and compensated without prior calibration and other operations. From the results, the uncertainty of the processing delay is within 1ms.
[0136] Time synchronization verification between audio base station and smartphone terminal
[0137] (1) Experimental description
[0138] In order to verify the time synchronization between the audio base station and the mobile terminal, this experiment selected Figure 7 The office scene shown. The length and width of the scene are about 13m×8m, and there are many tables and chairs and many lockers in the room. Four audio base stations are placed in the four corners of this relatively square office area, approximately where the triangle block is located in the figure, and they are synchronized with each other through Bluetooth signals. The smartphone terminal used in this experiment is Huawei Nova8Pro, which continuously collects the timestamps of the audio signals broadcast by the base station and the Bluetooth synchronization signals at the selected static points, that is, the positions of the two small circles in the figure. In the process of solving the positioning, the base station's voice timestamp is continuously fused and filtered to achieve time synchronization between the audio and the smartphone, and obtain the distance between the base station and the mobile phone.
[0139] (2) Experimental results and analysis
[0140] After the four audio base stations deployed in the office environment are synchronized with each other, the Bluetooth synchronization package is scanned by Huawei Nova8Pro. After scanning for a long time, the difference between the collected timestamps is calculated, and the result is as follows: Figure 8 As shown. The synchronization period set between base stations is 200ms, but the period of mobile phone scanning synchronization package reporting is not stable at 200ms. This is also due to the reporting delay caused by the task scheduling of the mobile phone operating system. From the results, the difference between adjacent timestamps is mostly between 170ms and 230ms, which shows that it is impossible to directly use this timestamp for sub-millisecond time synchronization between the audio base station and the smartphone, which also makes it difficult to use this timestamp to estimate the sound signal.
[0141] Through the terminal fusion filter time synchronization technology proposed in this invention, the timestamp of the scanned Bluetooth synchronization packet is fused with the estimated sound time of the positioning result, and the sound time is estimated with the epoch. The experimental results of this paper are as follows: Fig. 9 As shown. Fig. 9 (a) is the result of point 1, where all the dotted lines represent the true distance from the mobile phone to each audio base station, which is obtained by a laser rangefinder. The circled curve in the figure is the distance between the mobile phone and the base station at each epoch converted from the result of the estimated sound time. In the first few epochs, the estimated distance is shorter, mainly because the scanned Bluetooth timestamp has a certain delay. The experimental environment is ideal, and it is a static test, so the estimation accuracy of the arrival time of the sound signal is high. Therefore, the filtering results estimated in 3 to 4 epochs are basically converged. Fig. 9 (b) is the test result of point 2, which is basically the same as point 1, but more stable. Point 1 has some fluctuations around the 25th epoch.
[0142] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. A person of ordinary skill in the art will appreciate that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVDROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0143] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A time synchronization method based on a mesh topology ad hoc network, characterized in that: The method includes: The mesh topology of time synchronization is the way that time synchronization is transmitted between base stations in the indoor positioning system, just like a network. Each small circle represents a base station, and the arrows connecting the nodes represent the direction of time synchronization transmission; The nodes of the mesh topology are divided into three types: root master station, secondary master station and slave station; The main task of the root master station is to continuously and periodically transmit its time system and not to accept synchronization information from other base stations; The secondary master station not only listens to the time synchronization data packets of the previous level, but also refers to the synchronization information of all the sub-master stations that can be heard, and verifies each other to minimize the error of time synchronization. In addition, in order to prevent the entire system from crashing after the root master station equipment fails, the secondary master stations are also divided into levels. When they cannot obtain the synchronization information of the master station with a higher level than themselves for a long time, they can act as the root master station and continue to transmit the previously obtained time system information according to the local time. The slave station listens to the synchronization information of all devices and broadcasts the synchronization information again.
2. The time synchronization method based on mesh topology ad hoc network according to claim 1, characterized in that: The mesh topology of the self-organizing network time synchronization is affected by factors such as the physical environment, channel environment, and device specificity in a local area, and various synchronization transmission situations may occur, including: Single-line time information transmission; ring-shaped time information transmission; mesh-shaped time information transmission.
3. The time synchronization method based on mesh topology ad hoc network according to claim 2, characterized in that: The single-line time information transmission includes: Since only sub-millisecond time synchronization is required, the propagation speed of Bluetooth signals can basically ignore the time required for propagation in the air; Sub-millisecond time synchronization in ad hoc networks requires consideration of the processing delay and stability of devices at both ends; Its stability is improved through multiple time synchronizations, and then the processing delay is weakened according to the calibration to estimate the i-th synchronization timestamp.
4. The time synchronization method based on mesh topology ad hoc network according to claim 2, characterized in that: The annular time information transmission includes: When the synchronization timestamp starts from a device and returns to the device after a certain number of cycles, the real-time processing delay can be estimated; The stability of delay estimation is improved by combining the single-line time information transmission method.
5. The time synchronization method based on mesh topology ad hoc network according to claim 4, characterized in that: When the synchronization timestamp starts from a device and returns to the device after a certain number of cycles, the real-time processing delay D r It can be estimated as D r =T e -T s -C loop ·P sync (Formula 2) Where T s and T e The time when the ring node starts broadcasting and the time when the ring is captured, C loop It represents the number of edges forming a ring, that is, the number of cycles experienced by the ring; however, if there is only a small amount of time synchronization information, it can be combined with (Formula 1) to improve the stability of delay estimation.
6. The time synchronization method based on mesh topology ad hoc network according to claim 2, characterized in that: The mesh time information transmission specifically includes: Time synchronization transmission should be meshed. Even if it is not completely smooth, there should be a lot of redundant synchronization information. In this case, the time synchronization stamp of each base station can be estimated by a simple adjustment method. Assume that the linear function model and random model of adjustment are: Where l is the observation vector, B is the coefficient matrix with full column rank, x is the unknown parameter vector, Δ is the error vector, D is the diagonal variance-covariance matrix, σ0 is the unit weighted error, Q is the diagonal cofactor matrix, and P is the diagonal weight matrix; The estimation criterion for independent observations is: Among them, b i =[b i1 b i2 … b it ],l i represents the i-th observation value, then the corresponding error equation is: Derivative x in the above formula, record We can get: make but: In the formula, is the equivalent weight matrix, is the equivalent weight element, w i is the weight factor; Substituting (Formula 6) into (Formula 8), we get the normal equation: Solving the above equation, we get: In the formula, for The cofactor matrix of Substituting (Formula 10) into (Formula 6), we can get the correction value v of the observed value; The new weight factor of each observation value is determined according to the residual v, and then the next round of adjustment is carried out, and it is iterated repeatedly until the change between the two estimated values is less than the limit error.
7. A time synchronization system based on a mesh topology ad hoc network, characterized in that: The system includes: The data preprocessing module is used to capture the network traffic data in the original pcap format, aggregate the data into five-tuples to form a data stream, and extract statistical features including the total data volume, packet count, and average packet size; The traffic feature learning module is configured with LSTM and GRU networks, where GRU is used as the main network to integrate high-level features from the LSTM auxiliary network to jointly learn the feature representation of traffic data; The detection and classification module receives the feature representation from the traffic feature learning module and classifies it through the Softmax classifier to identify abnormal traffic.
8. The time synchronization system based on mesh topology ad hoc network according to claim 7, characterized in that: The time synchronization mesh topology in the system includes three types of nodes: root master station, secondary master station and slave station, where: The main task of the root master station is to continuously and periodically transmit its time system and does not accept synchronization information from other base stations; The secondary master station not only listens to the time synchronization data packets of the previous level, but also refers to the synchronization information of all audible secondary master stations, and verifies each other to reduce the time synchronization error. When it is unable to obtain the synchronization information of a higher-level master station for a long time, it can act as a root master station and continue to propagate the time system information according to the local time; The slave station receives synchronization information from all devices and broadcasts the synchronization information again.
9. The time synchronization system based on mesh topology ad hoc network according to claim 7, characterized in that: The resilience of the time synchronization system is greatly improved, and the time synchronization information is continuously transmitted in the entire topology. When a problem occurs at any node, the mesh topology can be quickly repaired without interfering with the normal operation of other devices, thereby improving the robustness of the system; the time synchronization information obtained by each node is redundant, and the time synchronization accuracy can be improved through algorithms.
Citation Information
Patent Citations
Clock synchronizing method for wireless sensor network
CN101588628A
Time synchronization method applicable to wireless sensor network
CN102118849A
Dynamic distributed ad hoc network scheduling method and system based on UWB
CN111818614A
Low-overhead robust time synchronization method for industrial wireless sensor network
CN115915381A
Method for constructing synchronous network, shelf label system, and computer device
US20230344721A1
