Clock synchronization method, multi-device communication system, and computing device
By using device self-organizing network technology, the first device generates pulse signals and adjusts the crystal oscillator frequency, which solves the accuracy and stability problems of clock synchronization in the existing technology, realizes high-precision and stable synchronization among multiple devices, and improves the synchronization effect of the scanning system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHINING 3D TECH CO LTD
- Filing Date
- 2026-03-20
- Publication Date
- 2026-06-05
AI Technical Summary
Existing time synchronization technologies cannot simultaneously achieve clock synchronization accuracy, low complexity, and long-term stability. Especially in large-scale, long-distance scanning scenarios, cable extension leads to signal delay and limited deployment flexibility, while wireless methods suffer from device hardware frequency deviations that cause error accumulation.
A communication connection is established through a self-organizing network of devices. The first device responds to the data packets periodically sent by the second device by generating a pulse signal, obtaining timestamp information and time interval, and adjusting the device time and crystal oscillator frequency to achieve clock synchronization with the second device and avoid dependence on routing devices.
It achieves high-precision and long-term stable clock synchronization among multiple devices, improving the synchronization accuracy and stability of the scanning system and reducing system complexity and uncertainty.
Smart Images

Figure CN122159997A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of 3D scanning technology, and in particular to a clock synchronization method, a multi-device communication system, and a computing device. Background Technology
[0002] In 3D scanning systems, scanning / tracking devices need to synchronize their clocks. Existing time synchronization technologies are mainly divided into wired and wireless methods. Wired methods transmit trigger signals via cables, which effectively control time deviations, but the increased cable length exacerbates signal delays and limits deployment flexibility, making them unsuitable for large-scale, long-distance scanning scenarios. Wireless methods fall into two categories: one relies on routing devices for time message calibration, introducing additional system complexity and instability; the other does not require routing devices and can directly communicate to align time. However, due to inherent frequency discrepancies between different device hardware, long-term operation can lead to error accumulation, making it impossible to guarantee long-term synchronization stability. Summary of the Invention
[0003] This application discloses a clock synchronization method, a multi-device communication system, and a computing device, which solves the technical problem that existing time synchronization technologies cannot simultaneously achieve clock synchronization accuracy, low complexity, and long-term stability.
[0004] This application provides a clock synchronization method applied to a first device. The method includes: when a communication connection is established between the first device and a second device in a device ad hoc network, generating a pulse signal in response to data packets periodically sent by the second device; obtaining timestamp information corresponding to the second device from the data packets; determining a time interval based on the generation time corresponding to the pulse signal and the acquisition time corresponding to the timestamp information; and adjusting the device time of the first device and the crystal oscillator frequency of the first device based on the timestamp information, the time interval, and the generation time, so that the clock of the first device is synchronized with the clock of the second device.
[0005] In some embodiments of this application, adjusting the device time of the first device and adjusting the crystal oscillator frequency of the first device based on the timestamp information, the time interval, and the generation time includes: determining the clock information of the second device based on the timestamp information and the time interval; adjusting the device time corresponding to the first device based on the clock information of the second device; and adjusting the crystal oscillator frequency of the first device based on the timestamp information and the generation time.
[0006] In some embodiments of this application, adjusting the crystal oscillator frequency of the first device based on the timestamp information and the generation time includes: responding to a data packet sent by the second device in the i-th cycle, obtaining the timestamp information corresponding to the i-th cycle; where i is a positive integer; calculating a first time difference between the timestamp information corresponding to the i-th cycle and the timestamp information corresponding to the (i-1)-th cycle; calculating the number of crystal oscillators corresponding to the first device between the generation time of the pulse signal in the i-th cycle and the generation time of the pulse signal in the (i-1)-th cycle; determining a candidate frequency based on the first time difference and the number of crystal oscillators; if the difference between the candidate frequency and a preset threshold is within a preset range, determining the crystal oscillator frequency of the first device based on the candidate frequency; wherein the preset threshold is determined based on historical candidate frequencies corresponding to multiple historical cycles; if the deviation between the candidate frequency and the preset threshold is outside the preset range, the historical crystal oscillator frequency determined in the (i-1)-th cycle is used as the crystal oscillator frequency of the first device.
[0007] In some embodiments of this application, determining the crystal oscillator frequency of the first device based on the candidate frequencies includes: obtaining a plurality of historical candidate frequencies determined before the i-th period; performing a weighted summation of the plurality of historical candidate frequencies and the candidate frequency to obtain a target frequency; wherein the weight of the candidate frequency is greater than the weight of each of the plurality of historical candidate frequencies; and using the target frequency as the crystal oscillator frequency of the first device.
[0008] In some embodiments of this application, the method further includes: calculating a second time difference between the generation time of the pulse signal in the i-th period and the generation time of the pulse signal in the (i-1)-th period; if the first time difference and / or the second time difference does not meet a preset difference condition, setting the timestamp information corresponding to the i-th period and the generation time of the pulse signal in the i-th period as invalid data; if the first time difference and the second time difference meet the preset difference condition, determining the candidate frequency based on the first time difference and the crystal oscillator count.
[0009] In some embodiments of this application, the method further includes: within the i-th period, if the time interval is greater than the median value of the period duration corresponding to the i-th period, setting the timestamp information corresponding to the i-th period and the generation time corresponding to the pulse signal in the i-th period as invalid data; if the time interval is less than or equal to the median value, determining the candidate frequency based on the first time difference and the number of crystal oscillators.
[0010] In some embodiments of this application, the timestamp information includes the timestamp field of the second device and the predicted transmission duration corresponding to the data packet, wherein the predicted transmission duration is determined based on the network configuration parameters between the first device and the second device.
[0011] In some embodiments of this application, the method further includes: if the first device does not receive any data packet from the second device within a first preset time period, issuing a first warning message, the first warning message being used to indicate that the first device and the second device have lost connection; if the first device does not receive any data packet from the second device within a second preset time period, issuing a second warning message, the second warning message being used to indicate that the second device has experienced a clock offset; wherein, the second preset time period is less than the first preset time period.
[0012] In some embodiments of this application, the method further includes: receiving operating parameters sent by a third device, the operating parameters including the data acquisition time of the first device; tracking the scanned object based on the device time and the crystal oscillator frequency to generate tracking data; if the data tracking time corresponding to the tracking data does not match the data acquisition time, setting the tracking data as invalid data; if the data tracking time matches the data acquisition time, sending the tracking data to the third device.
[0013] This application also discloses a clock synchronization method applied to a second device. The method includes: constructing a device ad hoc network; establishing a communication connection with a first device based on the device ad hoc network, and determining network configuration parameters for the communication connection with the first device; predicting the predicted transmission duration for data transmission between the first device and the second device based on the network configuration parameters; constructing a timestamp field based on the current local clock reading of the second device, and constructing a data packet based on the timestamp field and the predicted transmission duration; and sending the data packet to the first device, so that the first device achieves clock synchronization between the clock of the first device and the clock of the second device based on the data packet.
[0014] This application also discloses a multi-device communication system, comprising a first device and a second device, wherein: the first device is configured to, when a communication connection is established between the first device and the second device in a device ad hoc network, generate a pulse signal in response to data packets periodically sent by the second device; obtain timestamp information corresponding to the second device from the data packets; determine a time interval based on the generation time corresponding to the pulse signal and the acquisition time corresponding to the timestamp information; and adjust the device time and crystal oscillator frequency of the first device based on the timestamp information, the time interval, and the generation time, so that the clock of the first device is synchronized with the clock of the second device; the second device is configured to construct a device ad hoc network; establish a communication connection with the first device based on the device ad hoc network, and determine network configuration parameters for the communication connection with the first device; predict the predicted transmission duration for data transmission between the first device and the second device based on the network configuration parameters; construct a timestamp field based on the current local clock reading of the second device, and construct a data packet based on the timestamp field and the predicted transmission duration; and send the data packet to the first device, so that the first device achieves clock synchronization between the clock of the first device and the clock of the second device based on the data packet.
[0015] This application also discloses a computing device including a processor and a memory, wherein the processor is used to implement a clock synchronization method when executing a computer program stored in the memory.
[0016] In the clock synchronization method provided in this application, the first device and the second device establish a communication connection in a device ad hoc network, providing a data transmission path for subsequent clock synchronization. This eliminates the need for additional routing equipment, avoiding additional uncertainties and instabilities in multi-device communication systems involving both the first and second devices. The first device generates a pulse signal in response to periodically sent data packets from the second device, reflecting the time of data packet reception. Based on the generation time of the pulse signal and the acquisition time corresponding to the timestamp information within the data packet, a time interval is determined, thus obtaining the duration for the first device to parse the data packet. Based on the timestamp information, the time interval, and the generation time, the first device adjusts its device time and crystal oscillator frequency, avoiding inherent frequency deviations between different device hardware, achieving clock synchronization between multiple devices, and improving the accuracy and stability of clock synchronization. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the structure of the multi-device communication system provided in the embodiments of this application.
[0018] Figure 2This is a schematic diagram of the structure of the three-dimensional scanning system provided in the embodiments of this application.
[0019] Figure 3 This is a flowchart of the clock synchronization method provided in the embodiments of this application.
[0020] Figure 4 This is a schematic diagram illustrating the interaction between the first device, the second device, and the third device provided in the embodiments of this application.
[0021] Figure 5 This is a flowchart of clock synchronization adjustment provided in an embodiment of this application.
[0022] Figure 6 This is a flowchart of a clock synchronization method provided in another embodiment of this application.
[0023] Figure 7 This is a schematic diagram of the structure of the computing device provided in the embodiments of this application. Detailed Implementation
[0024] For ease of understanding, some concepts related to the embodiments of this application are illustrated and explained by way of example for reference.
[0025] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence.
[0026] In 3D scanning systems, scanning / tracking devices need to synchronize their clocks. Existing time synchronization technologies are mainly divided into wired and wireless methods. In wired time synchronization, the master device continuously sends scanning information such as camera trigger cycle, exposure time, and trigger signal to the slave device via cable, based on the device's operating mode. This ensures that the cameras of the master and slave devices can trigger within the allowable time deviation, which mainly originates from signal transmission in the cable. In this case, the master and slave devices are considered to be in a synchronized state. However, although this method can effectively control time deviation, in large-scale, large-scene scanning scenarios, multiple devices need to be arranged over long distances. The signal transmission time increases synchronously with the increase of cable length, exacerbating signal delay and limiting deployment flexibility.
[0027] To address the issues associated with wired time synchronization, one existing wireless time synchronization method requires the master device to transmit its local time to the slave device at regular intervals. The slave device then calculates the time difference between the two time data packets to perform self-calibration. While this method eliminates the inconvenience of cables, it necessitates the introduction of a routing device as the time source for the 3D scanning system, introducing additional system complexity and instability.
[0028] Another existing wireless time synchronization method, although it can achieve time alignment without relying on routing devices, ignores the inherent frequency deviation of the device hardware itself. Long-term operation will lead to error accumulation, and it also cannot ensure the long-term stability of the system.
[0029] Therefore, to address the technical problem that existing time synchronization technologies cannot simultaneously achieve clock synchronization accuracy, low complexity, and long-term stability, this application proposes a clock synchronization method, a multi-device communication system, and a computing device. This system can achieve long-term system stability among multiple devices and ensure synchronization accuracy without relying on routing devices. The structure of the multi-device communication system according to this application embodiment is described below.
[0030] Figure 1 This is a schematic diagram of the structure of a multi-device communication system provided in an embodiment of this application. For example... Figure 1 As shown, the multi-device communication system 10 includes at least one first device 110 and a second device 120 connected in communication.
[0031] The communication connection methods can include one or more of the following wireless communication connection methods: Wireless Fidelity (Wi-Fi), Bluetooth (BT), Zigbee, Z-Wave, Near Field Communication (NFC), and Infrared (IR).
[0032] In addition, depending on actual needs, such as scanning scenarios in small scenes or small areas, the above-mentioned communication connection methods may also include wired communication connections. These wired communication connections may include one or more of the following: Universal Serial Bus (USB), Controller Area Network (CAN), etc.
[0033] In some embodiments of this application, at least one first device 110 and the second device 120 may belong to the same type of computing device (the specific structure of the computing device is described below). Figure 7 (As shown). In one example, at least one first device 110 and the second device 120 can both be tracking devices. These tracking devices are measuring instruments used to acquire the spatial position and attitude of a target with high precision, and mainly include optical trackers, laser trackers, and the like. This application does not limit the specific type of tracking device.
[0034] In another example, at least one first device 110 and the second device 120 can both be scanning devices, which may include, but are not limited to, oral scanning devices, facial scanning devices, CT (Computed Tomography) scanning devices or CBCT (Cone Beam Computer Tomography) scanning devices, professional scanners, industrial scanners, etc. Among them, oral scanning devices include intraoral scanners and extraoral scanners.
[0035] The scanning device can be a handheld or stationary device, and can perform three-dimensional reconstruction of objects such as teeth, faces, bodies, industrial products, industrial equipment, cultural relics, works of art, prostheses, medical devices, and buildings. This application does not limit the specific type of scanning device.
[0036] In some embodiments of this application, at least one first device 110 and the second device 120 may belong to different types of computing devices. In one example, at least one first device 110 may be a tracking device and the second device 120 may be a scanning device. In another example, at least one first device 110 may be a scanning device and the second device 120 may be a tracking device.
[0037] The above illustration Figure 1 This is merely an example and does not constitute a structural limitation on the multi-device communication system 10. Further variations are possible. Figure 1 More or fewer parts, or combinations of certain parts, or different parts, etc.
[0038] The following is combined with Figure 2 Describe the combination of a multi-device communication system 10 constructed by at least one first device 110 and a second device 120.
[0039] Figure 2 This is a schematic diagram of the structure of the three-dimensional scanning system provided in an embodiment of this application. Figure 1 The multi-device communication system 10 shown can be as follows: Figure 2 The communication subsystem in the provided 3D scanning system 20, such as Figure 2The 3D scanning system 20 shown includes multiple scanning subsystems (such as...) Figure 2 The scanning subsystems 1 to n are shown. Each scanning subsystem includes a tracking device 210 and multiple scanning devices 220.
[0040] The communication subsystem is used to realize clock synchronization among multiple devices, and the scanning subsystem is used to execute the scanning process. The settings of the first device 110 and the second device 120 in the communication subsystem do not affect the scanning process executed by the tracking device 210 and multiple scanning devices 220 in the scanning subsystem.
[0041] Each scanning subsystem is communicatively connected to a third device 30, which may be an electronic device such as a mobile phone, tablet computer, smart wearable device, augmented reality (AR) / virtual reality (VR) device, laptop computer, netbook, etc. In other embodiments of this application, the third device 30 may be externally connected to the 3D scanning system 20 to manage the operating parameters of the 3D scanning system 20, etc.
[0042] In each scanning subsystem, tracking device 210 can simultaneously track multiple scanning devices 220. Multiple scanning subsystems can establish communication connections with each other. For example... Figure 1 The first device 110 and the second device 120 shown can be as follows: Figure 2 Any two different devices among the tracking device 210 and the plurality of scanning devices 220 shown.
[0043] In one example, assume that scanning subsystem 1 is used to perform the scanning operation, and that the tracking device 210 in scanning subsystem 1 is determined to be as follows: Figure 1 The second device 120 of the multi-device communication system 10 shown is then determined as follows: The multiple scanning devices 220 in the scanning subsystem 1 are as follows: Figure 1 The first device 110 of the multi-device communication system 10 shown.
[0044] Assuming that scanning subsystems 1 to n are used to perform the scanning operation, determine how... Figure 2 The tracking device 210 in the scanning subsystem 1 shown is as follows: Figure 1 The second device 120 of the multi-device communication system 10 shown can be used as a second device. All scanning devices 220 in scanning subsystems 1 to n, and all tracking devices 210 in scanning subsystems 2 to n, can be used as follows: Figure 1 The first device 110 of the multi-device communication system 10 shown.
[0045] In another example, suppose scanning subsystem 1 is used to perform the scanning operation, and any one of the scanning devices 220 in scanning subsystem 1 is determined to be as follows: Figure 1 The second device 120 shown refers to the other scanning devices 220 in the scanning subsystem 1 besides any one of the scanning devices 220 that is the second device 120, and the tracking device 210 in the scanning subsystem 1 is determined as follows: Figure 1 The first device 110 shown.
[0046] Assuming that scanning subsystems 1 to n are used to perform the scanning operation, determine how... Figure 2 Any one of the scanning devices 220 in the scanning subsystem 1 shown is as follows: Figure 1 The second device 120 shown can be any of the tracking devices 210 in scanning subsystems 1 to n, and the other scanning devices 220 in scanning subsystem 1 other than any one of the scanning devices 220 that is the second device 120, and all the scanning devices 220 in scanning subsystems 2 to n can be used as follows: Figure 1 The first device 110 shown.
[0047] Figure 3 This is a flowchart of a clock synchronization method provided in an embodiment of this application, applied to a first device (e.g., Figure 1 In the first device 110). Depending on different needs, the order of the steps in this flowchart can be changed, and some steps can be omitted.
[0048] In step S301, when a communication connection is established between the device self-organizing network constructed by the first device and the second device, a pulse signal is generated in response to the data packets periodically sent by the second device.
[0049] In some embodiments of this application, a device ad hoc network refers to a group of devices with communication capabilities that can automatically discover, organize, and form an interconnected network without relying on fixed infrastructure such as routers or base stations, thereby enabling direct communication and data sharing between devices.
[0050] A device ad hoc network can be built by a second device, where the first device's wireless communication chip supports the same physical layer protocol used by the second device to build the ad hoc network. For example, if the second device uses the Zigbee protocol to build the ad hoc network, the first device must also be a Zigbee device. The first device establishes a communication connection with the second device by actively searching for and joining the ad hoc network built by the second device. Alternatively, in some low-power protocols, the first device can also be triggered by a wake-up signal broadcast by the second device, subsequently establishing a communication connection with the second device to reduce the first device's standby power consumption.
[0051] In some embodiments of this application, when the first device and the second device establish a communication connection through a device ad hoc network, the first device can receive data packets periodically sent by the second device.
[0052] The period can be a Beacon period, representing the periodic interval between two consecutive Beacon frame data packets received by the first device; for example, this periodic interval could be 102.4 ms. The data packet can be a Beacon frame data packet, representing a data packet broadcast by the second device at specific time intervals.
[0053] Upon receiving a data packet from the second device, the first device can generate a pulse signal to indicate that the data packet has been received, serving as the basis for receiving the data packet.
[0054] Step S302: Obtain the timestamp information corresponding to the second device from the data packet.
[0055] In some embodiments of this application, the first device can parse the received data packet and obtain the timestamp information of the second device from the data packet. The format of the timestamp information can be xx seconds xx microseconds, and the timer starts from 0 after the second device is powered on and initialized. This application does not limit this.
[0056] To reduce clock synchronization errors, the timestamp information may include a timestamp field from the second device and the predicted transmission duration corresponding to the data packet. The timestamp field represents the local clock reading of the second device when it constructs the data packet. The predicted transmission duration can be determined based on the network configuration parameters of the first and second devices. These network configuration parameters can be one or more of the specific frequency band, channel bandwidth, modulation and coding scheme used by the first and second devices, which determine the data packet transmission rate.
[0057] In one example, let's consider the specific frequency band used as the network configuration parameter. If the network configuration parameters between the first and second devices include the 2.4GHz frequency band, the predicted transmission time for the second device to transmit data packets to the first device can be calculated based on the transmission rate in the 2.4GHz frequency band. If the network configuration parameters between the first and second devices include the 5GHz frequency band, the predicted transmission time for the second device to transmit data packets to the first device can be calculated based on the transmission rate in the 5GHz frequency band.
[0058] Step S303: Determine the time interval based on the generation time of the pulse signal and the acquisition time of the timestamp information.
[0059] In some embodiments of this application, the generation time corresponding to the pulse signal is obtained. Since the pulse signal indicates that the first device has received the data packet, the generation time can represent the time when the first device received the data packet. After the first device completes the parsing of the data packet, it obtains the timestamp information within the data packet. Upon obtaining the timestamp information, the time at which the timestamp information was obtained can be recorded as the acquisition time, which is used to characterize the time when the parsing of the data packet was completed.
[0060] The time interval is obtained by calculating the difference between the acquisition time and the generation time. This time interval represents the duration taken by the first device to parse the data packet.
[0061] Step S304: Based on the timestamp information, time interval, and generation time, adjust the device time of the first device and the crystal oscillator frequency of the first device so that the clock of the first device is synchronized with the clock of the second device.
[0062] In some embodiments of this application, clock information of the second device can be calculated based on timestamp information and time intervals. This clock information represents the current local clock reading of the second device. Based on the clock information of the second device, the current clock reading of the second device can be determined, and the current clock reading of the first device can be obtained. If the current clock reading of the first device does not match the clock reading indicated by the clock information of the second device, it indicates a clock deviation between the reading of the first device's local clock and the current local clock reading. In this case, the device time of the first device can be adjusted based on the clock information of the second device to synchronize the device time of the first device with the device time corresponding to the clock information of the second device.
[0063] Since each device hardware has its own inherent crystal oscillator frequency, to avoid frequency deviations, the crystal oscillator frequency of the first device can be adjusted based on the timestamp information and the generation time corresponding to the pulse signal. This ensures that the first device starts operating at the adjusted crystal oscillator frequency from its adjusted device time, thus synchronizing with the clock of the second device. The specific adjustment process for the device time and crystal oscillator frequency of the first device can be described in the following... Figure 5 The illustrated embodiment.
[0064] Through the above embodiments, the device ad hoc network constructed by the first and second devices establishes a communication connection, providing a data transmission path for subsequent clock synchronization without the need for additional routing equipment, thus avoiding additional uncertainties and instabilities in multi-device communication systems involving the first and second devices. The first device generates a pulse signal in response to the periodically sent data packets by the second device, reflecting the time of receiving the data packets. Based on the generation time of the pulse signal and the acquisition time corresponding to the timestamp information within the data packet, the time interval is determined, thereby obtaining the duration for the first device to parse the data packets. Based on the timestamp information, the time interval, and the generation time, the first device adjusts its device time and crystal oscillator frequency, avoiding inherent frequency deviations in the hardware of different devices, achieving clock synchronization among multiple devices, and improving the accuracy and stability of clock synchronization.
[0065] In some embodiments of this application, the first device and the second device can establish a wireless communication link through a device self-organizing network. The first device and the second device can establish a data transmission link when performing the scanning process. The wireless communication link and the data transmission link are two independent data channels that are completely decoupled in terms of protocol stack and function and can operate in parallel. That is, the clock synchronization data stream and the scanning task data stream are separate.
[0066] In one example, taking the first device as the tracking device and the second device as the scanning device, the tracking and scanning devices can establish a wireless communication link through a device self-organizing network. This wireless communication link is used to transmit data packets for clock synchronization, thereby maintaining and calibrating the system time base between the first and second devices. While this communication link remains operational, the tracking and scanning devices can independently initiate and execute the scanning process, which is determined by the operating parameters set by the 3D scanning system. In the system design, clock synchronization and scanning data transmission are achieved through logically isolated dedicated channels, decoupled in terms of protocol stack and functionality, enabling parallel operation.
[0067] To better understand the wireless communication links established through device self-organizing networks and the data transmission links established during the scanning process, the following will combine... Figure 4 Describe it.
[0068] like Figure 4 As shown, the first device establishes a wireless communication link with the second device through a device ad hoc network built by the second device, and establishes a data transmission link with the third device. The first device includes a wireless ad hoc network unit, a time synchronization unit, a device main control unit, a scanning camera unit, and an optical engine projection unit.
[0069] The first device establishes a wireless communication link with the second device through a wireless ad hoc network unit. Upon receiving a data packet broadcast by the second device, the wireless ad hoc network unit sends a pulse signal to the time synchronization unit, enabling the time synchronization unit to determine that the wireless ad hoc network unit has received the data packet. Subsequently, the wireless ad hoc network unit parses the data packet, obtains the timestamp information within it, and sends this timestamp information to the time synchronization unit. The time synchronization unit uses the timestamp information, the acquisition time corresponding to the timestamp information, and the time of receiving the pulse signal (denoted as the pulse signal generation time) to calculate the local clock reading and crystal oscillator frequency of the second device, thereby achieving clock synchronization between the first and second devices.
[0070] Meanwhile, the main control unit of the first device can receive working parameters sent by the third device through the data transmission link. To improve the transmission efficiency of the working parameters, the third device transmits the working parameters according to a specified encoding format, omitting various unnecessary fields. The main control unit can decode the working parameters according to the agreed command format, and parse and calculate the header, trailer, and CRC check fields of the corresponding data packets to determine whether the working parameter is a device parameter used in the subsequent scanning process. If it is determined that the working parameter is not a device parameter, the working parameters currently used by the first device will not be changed.
[0071] If the operating parameter is determined to be a device parameter, it can be parsed bit by bit to obtain the correct device parameter. The operating parameter is then re-encoded into specific instructions recognizable by the first device. Since the first device updates its crystal oscillator frequency each time it receives a new data packet, the operating parameter can be updated accordingly. The update of the operating parameter needs to ensure that the first device takes effect immediately, while also ensuring that the operating status of the first device within the current cycle does not become abnormal due to the update. Therefore, during the process of the device's main control unit controlling the operation of the scanning camera unit and the optomechanical projection unit based on the aforementioned specific instructions, three stages can be set: camera operating status detection, operating parameter calculation and setting, and operating parameter readback detection.
[0072] During the camera's operational status detection phase, the camera's operational status is mainly divided into three stages: exposure, data transmission, and standby (standby state). The current camera operational status can be determined based on whether a camera trigger signal is output and the camera's output data detection. For example, when the scanning camera unit and the optical engine projection unit receive a camera trigger signal, it determines that the camera has entered the exposure state; the main control unit transmits the tracking data collected by the scanning camera unit and the optical engine projection unit to a third device, determining that the camera has entered the data transmission state. After completing camera exposure and data transmission, the camera enters the standby state.
[0073] During the stage of calculating and setting working parameters, the data tracking time of the current frame and the data tracking time of the next frame are calculated based on the device time and crystal oscillator frequency of the first device determined above. Furthermore, the scanned object is tracked according to the device time and crystal oscillator frequency of the first device to generate tracking data.
[0074] The operating parameters include the data acquisition time of the first device, which represents the expected trigger time of the current frame. The data tracking time recorded in the current frame is also acquired, representing the actual time the camera acquired the tracking data. If the data acquisition time and data tracking time do not match, it indicates that the camera's trigger cycle is not met, and the tracking data is set as invalid. If the data acquisition time and data tracking time match, the tracking data is sent to the third device.
[0075] Figure 5 This is a flowchart illustrating the clock synchronization adjustment process provided in an embodiment of this application. Figure 5 As shown, clock synchronization between the first and second devices is achieved based on data packets broadcast by the second device, including the following steps.
[0076] Step S501: Determine the clock information of the second device based on the timestamp information and the time interval.
[0077] In some embodiments of this application, the timestamp information includes a timestamp field indicating when the second device constructs the data packet and a predicted transmission duration. The timestamp field represents the clock reading of the local clock when the second device constructs the data packet, and the predicted transmission duration is the predicted transmission duration for the second device to transmit the data packet to the first device. The time interval is the duration used by the first device to parse the data packet. Therefore, by calculating the sum of the timestamp information and the time interval, the clock information of the second device can be obtained, which represents the current reading of the second device's local clock.
[0078] Step S502: Adjust the device time corresponding to the first device based on the clock information of the second device.
[0079] In some embodiments of this application, the current local clock reading of the second device is determined from the clock information of the second device, and the device time of the first device is adjusted to match the current local clock reading of the second device, so that the local device times of the first device and the second device are the same. For example, the device time of the first device and the device time of the second device are both 10 seconds and 1 microsecond.
[0080] Step S503: Adjust the crystal oscillator frequency of the first device based on the timestamp information and the generation time.
[0081] In some embodiments of this application, simply aligning the device time cannot prevent clock drift on the device's own hardware. Therefore, the crystal oscillator frequency of the first device can be further adjusted.
[0082] Specifically, if the period of the currently received data packet is the i-th period, then in response to the data packet sent by the second device in the i-th period, the first device can obtain the timestamp information corresponding to the data packet sent in the i-th period. Additionally, it can obtain the timestamp information corresponding to the (i-1)-th period, and this timestamp information corresponding to the (i-1)-th period has already been recognized as valid data in the (i-1)-th period. Here, i is a positive integer.
[0083] Calculate the first time difference between the timestamp information corresponding to the i-th cycle and the timestamp information corresponding to the (i-1)-th cycle, representing the time difference between the i-th cycle and the (i-1)-th cycle. Calculate the number of crystal oscillators corresponding to the first device between the generation time of the pulse signal in the i-th cycle and the generation time of the pulse signal in the (i-1)-th cycle, representing the frequency value of the first device between the i-th cycle and the (i-1)-th cycle.
[0084] Calculate the second time difference between the generation time of the pulse signal in the i-th period and the generation time of the pulse signal in the (i-1)-th period. Both the first and second time differences reflect the periodicity of the periodic broadcast data packets. Therefore, if the first and / or second time differences do not satisfy the periodicity of the data packets sent by the second device—for example, if the period interval between two adjacent periods can be 102.4 ms—then if the first and / or second time differences are not equal to 102.4 ms, it is determined that the first and / or second time differences do not satisfy the periodicity of the data packets sent by the second device; that is, it is determined that the first and / or second time differences do not satisfy the preset difference condition. If the preset difference condition is not satisfied, the timestamp information corresponding to the i-th period and the generation time corresponding to the pulse signal in the i-th period are set to invalid data.
[0085] If the first time difference and / or the second time difference meet the preset difference conditions, the candidate frequency between the i-th period and the (i-1)-th period can be calculated based on the first time difference and the crystal oscillator count.
[0086] In other embodiments of this application, secondary verification can be performed if the first time difference and / or the second time difference meet a preset difference condition. Within the i-th cycle, if the time interval between the generation time of the pulse signal and the acquisition time of the timestamp information is greater than the median value of the cycle length corresponding to the i-th cycle, indicating that the time interval is greater than half of the Beacon cycle, packet loss may occur. In this case, the timestamp information corresponding to the i-th cycle and the generation time of the pulse signal in the i-th cycle can be set as invalid data.
[0087] If the first time difference and / or the second time difference satisfy the preset difference condition, in the i-th period, if the time interval between the generation time of the pulse signal and the acquisition time of the timestamp information is less than or equal to the median value of the period length corresponding to the i-th period, then the candidate frequency between the i-th period and the (i-1)-th period can be calculated based on the first time difference and the number of crystal oscillators.
[0088] If the difference between the candidate frequency and the preset threshold is within the preset range, the crystal oscillator frequency of the first device is determined based on the candidate frequency.
[0089] If the difference between the candidate frequency and the preset threshold is within a preset range, it indicates that the frequency value calculated in the i-th cycle meets the calibration requirements, and the candidate frequency is retained. The crystal oscillator frequency of the first device is determined based on the candidate frequency; wherein, the preset threshold is determined based on the historical candidate frequencies corresponding to multiple historical cycles, for example, the preset threshold may be the median or mean of multiple historical candidate frequencies.
[0090] Determining the crystal oscillator frequency of the first device based on candidate frequencies includes: acquiring multiple historical candidate frequencies determined before the i-th cycle; performing a weighted summation of the multiple historical candidate frequencies and the candidate frequency to obtain the target frequency. The weight of each candidate frequency is greater than the weight of each historical candidate frequency. The target frequency is then used as the crystal oscillator frequency of the first device.
[0091] If the deviation between the candidate frequency and the preset threshold is outside the preset range, it indicates that the frequency value calculated in the i-th cycle does not meet the calibration requirements, and the candidate frequency can be set as invalid data. The historical crystal oscillator frequency determined in the (i-1)-th cycle is used as the crystal oscillator frequency of the first device.
[0092] Through the above embodiments, it can be ensured that the device time and crystal oscillator frequency of the first device are synchronized with those of the second device. Furthermore, it ensures that the data packets received by the first device are based on periodic continuous broadcasts, and that the crystal oscillator frequency of the first device is calculated accordingly, thus avoiding hardware errors introduced by the first device itself. This provides a time reference for subsequent scanning procedures based on operating parameters, improving scanning efficiency and accuracy to a certain extent.
[0093] In other embodiments of this application, due to network latency or interference from other environmental factors, the first device may not be able to capture the data packets broadcast by the second device in every cycle. If the first device does not receive any data packets from the second device within a first preset time period, it can issue a first warning message, which is used to indicate that the first device and the second device may lose connection.
[0094] The timing continues. If the first device does not receive any data packets from the second device within a second preset time period, a second warning message can be issued. This second warning message is used to indicate that a clock offset has occurred in the second device. The second preset time period is shorter than the first preset time period.
[0095] In one example, the first preset duration can be 30 seconds, and the second preset duration can be 10 seconds. If the first device does not receive the data packet broadcast by the second device after 30 seconds, a first warning message is issued. The timer continues, and if the first device does not receive the data packet broadcast by the second device after 10 seconds, a second warning message is issued. The above is just an example; the first and second preset durations can be set according to actual needs.
[0096] The first device issues a first warning message, indicating that there may be a disconnection between the first device and the second device. Simultaneously, the first device can automatically reconnect. Specifically, the first device can continuously search for data packets broadcast by the second device. After the first device re-detects the data packets, it re-executes step S301 to readjust its clock and crystal oscillator frequency.
[0097] Even without finding any data packets, the first device can continue to operate based on the latest adjusted (calibrated) clock and the latest adjusted (calibrated) crystal oscillator frequency, avoiding the problem of free drift caused by the first device relying entirely on its own crystal oscillator. It can also prevent the clock of the first device from jumping, thus maintaining the continuity and availability of the system and keeping the synchronization error within a predictable range.
[0098] Figure 6 This is a flowchart of a clock synchronization method provided in another embodiment of this application, applied to a second device (e.g., Figure 1 In the second device 120). Depending on different requirements, the order of steps in this flowchart can be changed, and some steps can be omitted.
[0099] Step S601: Build a self-organizing network for devices.
[0100] In some embodiments of this application, the second device serves as the sole and fixed time source for the wireless communication system, and its stability determines the clock synchronization accuracy and scanning accuracy of the 3D scanning system. Therefore, the second device can be configured before the 3D scanning system begins its scanning operation. To enable all devices in the 3D scanning system (e.g., tracking devices and scanning devices) to connect to the same local area network, the wireless ad-hoc networking unit of the second device can be used to construct a device ad-hoc network corresponding to the 3D scanning system. Before the 3D scanning system begins operation, a designated SSID is configured, allowing all first devices to connect to that SSID, thus achieving wireless communication connections between the second device and all first devices.
[0101] Step S602: Establish a communication connection with the first device based on the device self-organizing network, and determine the network configuration parameters for the communication connection with the first device.
[0102] In some embodiments of this application, after the second device establishes a self-organizing network, it broadcasts the configured SSID. When the first device finds this SSID, it establishes a wireless communication connection with the second device. Once the first and second devices have established a communication connection, the network configuration parameters for establishing the connection are obtained. These network configuration parameters can be one or more of the specific frequency band, channel bandwidth, modulation and coding scheme, etc., used by the first and second devices to determine the data packet transmission rate.
[0103] Step S603: Based on network configuration parameters, predict the predicted transmission time for data transmission between the first device and the second device.
[0104] In some embodiments of this application, the time required for the second device to transmit data packets to the first device can be calculated based on network configuration parameters.
[0105] Taking the specific frequency band used between the first and second devices as an example, assuming that the specific frequency band is the 2.4GHz band, the predicted transmission time can be calculated based on the transmission rate corresponding to the 2.4GHz band.
[0106] Assuming the specific frequency band is 5GHz, the predicted transmission time can be calculated based on the transmission rate corresponding to the 5GHz band. Since the transmission rate of the 5GHz band is greater than that of the 2.4GHz band, the predicted transmission time calculated based on the 5GHz band is less than the predicted transmission time calculated based on the 2.4GHz band.
[0107] The above is merely an example; the corresponding predicted transmission time can be calculated based on different network configuration parameters. When the second device is connected to multiple first devices, the predicted transmission time between the second device and each first device can be the same or different, and this application does not impose any restrictions on this.
[0108] Step S604: Construct a timestamp field based on the current local clock reading of the second device, and construct a data packet based on the timestamp field and the predicted transmission duration.
[0109] In some embodiments of this application, the current local clock reading of the second device is obtained, and a timestamp field is constructed based on the local clock reading to represent the current time of the second device's local clock. Data packets are constructed based on the timestamp field and the predicted transmission duration.
[0110] In one example, let's consider the second device as the scanning device and the first device as the tracking device. Obtain the current local clock reading of the scanning device to construct a timestamp field, denoted as S. Calculate the predicted transmission duration between the scanning device and the tracking device, denoted as L. Based on the timestamp field and the predicted transmission duration, construct a data packet, then the data packet Q = L + S.
[0111] Step S605: Send a data packet to the first device so that the first device can synchronize its clock with the clock of the second device based on the data packet.
[0112] In some embodiments of this application, in order to achieve clock synchronization between the first device and the second device, the second device can periodically send data packets to the first device. For example, if there are n periods, the second device can send data packets to the first device n times.
[0113] Through the above embodiments, a second device is determined as the master device from the 3D scanning system. The device self-organizing network built by the second device enables all devices in the 3D scanning system to be located in the same local area network. Clock synchronization and crystal oscillator frequency synchronization between devices can be achieved without the need for additional routing equipment.
[0114] In other embodiments of this application, since the roles of the first device and the second device can be interchanged—for example, the first device can be a scanning device and the second device can be a tracking device; or, the first device can be a tracking device and the second device can be a scanning device—the first device and the second device have at least partially identical structures. For example, both the second device and the first device can be configured with a wireless self-organizing network unit, a time synchronization unit, a device main control unit, a scanning camera unit, and an optical engine projection unit.
[0115] In other embodiments of this application, the clock synchronization process and scanning process of the three-dimensional scanning system are described using the first device as a tracking device, the second device as a scanning device, and the third device as an electronic device as examples.
[0116] The scanning device periodically sends data packets to the tracking device, which can synchronize its local clock with the scanning device's local clock based on these data packets. The electronic device sends operating parameters to both the scanning and tracking devices. The scanning device scans the object based on these parameters, obtaining scan data. The tracking device updates its operating parameters based on the synchronized clock and tracks the scanning device's pose, obtaining tracking data. Both the tracking and scanning devices can send scan data and tracking data to the electronic device to construct a 3D model of the scanned object.
[0117] In other embodiments, the tracking device can determine the validity of tracking data based on the data acquisition time carried in the operating parameters. If the data acquisition time does not match the corresponding tracking time, the tracking data is deemed invalid. If the data acquisition time matches the corresponding tracking time, the tracking data is deemed valid. If the tracking data is determined to be valid, it can be sent to the electronic device.
[0118] Figure 7 This is a schematic diagram of the structure of the computing device provided in the embodiments of this application. Figure 7 The computing device 70 shown can be as follows: Figure 1 The first device 110 in the middle can also be as follows: Figure 1 The second device 120 can be either the first device 110 or the processing unit within the second device 120.
[0119] The computing device 70 can be an electronic device such as a mobile phone, tablet computer, smart wearable device, augmented reality (AR) / virtual reality (VR) device, laptop computer, netbook, etc. This application embodiment does not limit the specific type of computing device 70.
[0120] like Figure 7 As shown, the computing device 70 may include a display device 710, a communication module 720, a memory 730, a processor 740, an input / output (I / O) interface 750, and a bus 760. The processor 740 is coupled to the display device 710, the communication module 720, the memory 730, and the I / O interface 750 via the bus 760.
[0121] The display device 710 can be a touch screen, specifically a touch-sensitive liquid crystal display device. Alternatively, the display device 710 can also be a non-touch screen.
[0122] The communication module 720 may include a wired communication module and / or a wireless communication module. The wired communication module may provide one or more wired communication solutions such as Universal Serial Bus (USB) and Controller Area Network (CAN). The wireless communication module may provide one or more wireless communication solutions such as Wireless Fidelity (Wi-Fi), Bluetooth (BT), mobile communication networks, Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR).
[0123] The memory 730 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM). The RAM can be directly read and written by the processor 740, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.
[0124] Random access memory can include static random-access memory (SRAM), dynamic random-access memory (DRAM), synchronous dynamic random-access memory (SDRAM), double data rate synchronous dynamic random-access memory (DDR SDRAM), etc.
[0125] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 740. Non-volatile memory can include disk storage devices and flash memory.
[0126] The memory 730 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 740. The one or more computer programs include a plurality of instructions that, when executed by the processor 740, enable a clock synchronization method to be executed on the computing device 70.
[0127] In other embodiments, the computing device 70 also includes an external memory interface for connecting to an external memory to expand the storage capacity of the computing device 70.
[0128] Processor 740 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0129] The processor 740 provides computing and control capabilities; for example, the processor 740 is used to execute computer programs stored in the memory 730 to implement the clock synchronization method described above.
[0130] I / O interface 750 is used to provide a channel for user input or output. For example, I / O interface 750 can be used to connect various input and output devices, such as mouse, keyboard, touch device, display screen, etc., so that users can enter information or visualize information.
[0131] The bus 760 is used at least to provide a channel for communication between the display device 710, communication module 720, memory 730, processor 740, and I / O interface 750 in the computing device 70.
[0132] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the computing device 70. In other embodiments of this application, the computing device 70 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0133] This application also provides a computer-readable storage medium storing a computer program, which includes program instructions. When the program instructions are executed, the method implemented can refer to the methods in the above embodiments of this application.
[0134] The computer-readable storage medium can be the internal memory of the computing device described in the above embodiments, such as the hard disk or memory of the computing device. The computer-readable storage medium can also be an external storage device of the computing device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., provided on the computing device.
[0135] In some embodiments, a computer-readable storage medium may include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, etc.; and the stored data area may store data created based on the use of the computing device, etc.
[0136] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0137] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0138] In the embodiments provided in this application, it should be understood that the disclosed apparatus / terminal devices and methods can be implemented in other ways. For example, the apparatus / terminal device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0139] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0140] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A clock synchronization method, applied to a first device, characterized in that, The method includes: When a communication connection is established between the device self-organizing network constructed by the first device and the second device, a pulse signal is generated in response to the data packets periodically sent by the second device; Obtain the timestamp information corresponding to the second device from the data packet; The time interval is determined based on the generation time of the pulse signal and the acquisition time of the timestamp information. Based on the timestamp information, the time interval, and the generation time, the device time of the first device and the crystal oscillator frequency of the first device are adjusted so that the clock of the first device is synchronized with the clock of the second device.
2. The clock synchronization method according to claim 1, characterized in that, The step of adjusting the device time and crystal oscillator frequency of the first device based on the timestamp information, the time interval, and the generation time includes: Based on the timestamp information and the time interval, the clock information of the second device is determined; Based on the clock information of the second device, adjust the device time corresponding to the first device; Based on the timestamp information and the generation time, the crystal oscillator frequency of the first device is adjusted.
3. The clock synchronization method according to claim 2, characterized in that, The step of adjusting the crystal oscillator frequency of the first device based on the timestamp information and the generation time includes: In response to the data packet sent by the second device in the i-th period, the timestamp information corresponding to the i-th period is obtained; where i is a positive integer; Calculate the first time difference between the timestamp information corresponding to the i-th period and the timestamp information corresponding to the (i-1)-th period; Calculate the number of crystal oscillators corresponding to the first device between the generation time of the pulse signal in the i-th cycle and the generation time of the pulse signal in the (i-1)-th cycle; Based on the first time difference and the number of crystal oscillators, a candidate frequency is determined; If the difference between the candidate frequency and the preset threshold is within a preset range, the crystal oscillator frequency of the first device is determined based on the candidate frequency; wherein, the preset threshold is determined based on historical candidate frequencies corresponding to multiple historical periods; If the deviation between the candidate frequency and the preset threshold is outside the preset range, the historical crystal oscillator frequency determined in the (i-1)th cycle is taken as the crystal oscillator frequency of the first device.
4. The clock synchronization method according to claim 3, characterized in that, Determining the crystal oscillator frequency of the first device based on the candidate frequencies includes: Obtain multiple historical candidate frequencies determined before the i-th period; The target frequency is obtained by weighted summation of the plurality of historical candidate frequencies and the candidate frequency; wherein the weight of the candidate frequency is greater than the weight of each historical candidate frequency in the plurality of historical candidate frequencies. The target frequency is used as the crystal oscillator frequency of the first device.
5. The clock synchronization method according to claim 3, characterized in that, The method further includes: Calculate the second time difference between the generation time of the pulse signal in the i-th period and the generation time of the pulse signal in the (i-1)-th period; If the first time difference and / or the second time difference do not meet the preset difference condition, the timestamp information corresponding to the i-th period and the generation time corresponding to the pulse signal in the i-th period are set as invalid data; If the first time difference and the second time difference satisfy the preset difference condition, the candidate frequency is determined based on the first time difference and the crystal oscillator count.
6. The clock synchronization method according to claim 3, characterized in that, The method further includes: If, within the i-th period, the time interval is greater than the median value of the period duration corresponding to the i-th period, the timestamp information corresponding to the i-th period and the generation time corresponding to the pulse signal in the i-th period are set as invalid data. If the time interval is less than or equal to the median value, the candidate frequency is determined based on the first time difference and the crystal oscillator count.
7. The clock synchronization method according to claim 1, characterized in that, The timestamp information includes the timestamp field of the second device and the predicted transmission duration corresponding to the data packet. The predicted transmission duration is determined based on the network configuration parameters between the first device and the second device.
8. The clock synchronization method according to claim 1, characterized in that, The method further includes: If the first device does not receive any data packet from the second device within a first preset time period, it issues a first warning message. The first warning message is used to indicate that the first device and the second device have lost connection. If the first device does not receive any data packet from the second device within a second preset time period, it issues a second warning message, which is used to indicate that the second device has experienced a clock offset; wherein the second preset time period is less than the first preset time period.
9. The clock synchronization method according to claim 1, characterized in that, The method further includes: Receive working parameters sent by a third device, the working parameters including the data acquisition time of the first device; Based on the device time and the crystal oscillator frequency, the scanned object is tracked, and tracking data is generated; If the tracking time corresponding to the tracking data does not match the data acquisition time, the tracking data will be set as invalid data. If the data tracking time matches the data acquisition time, the tracking data is sent to the third device.
10. A clock synchronization method, applied to a second device, characterized in that, The method includes: Build a self-organizing network for devices; Based on the self-organizing network of the device, a communication connection is established with the first device, and the network configuration parameters for the communication connection with the first device are determined; Based on the network configuration parameters, the predicted transmission time for data transmission between the first device and the second device is predicted. A timestamp field is constructed based on the current local clock reading of the second device, and a data packet is constructed based on the timestamp field and the predicted transmission duration; The data packet is sent to the first device, enabling the first device to synchronize its clock with that of the second device based on the data packet.
11. A multi-device communication system, characterized in that, The multi-device communication system includes a first device and a second device, wherein: The first device is configured to, when a communication connection is established between the device ad hoc network constructed by the first device and the second device, generate a pulse signal in response to data packets periodically sent by the second device; obtain timestamp information corresponding to the second device from the data packets; determine a time interval based on the generation time corresponding to the pulse signal and the acquisition time corresponding to the timestamp information; and adjust the device time and crystal oscillator frequency of the first device based on the timestamp information, the time interval, and the generation time, so that the clock of the first device is synchronized with the clock of the second device. The second device is configured to construct a device ad hoc network; establish a communication connection with the first device based on the device ad hoc network, and determine the network configuration parameters for the communication connection with the first device; predict the predicted transmission duration for data transmission between the first device and the second device based on the network configuration parameters; construct a timestamp field based on the current local clock reading of the second device, and construct a data packet based on the timestamp field and the predicted transmission duration; and send the data packet to the first device, so that the first device can synchronize the clocks of the first device and the second device based on the data packet.
12. A computing device, characterized in that, The computing device includes a processor and a memory, wherein the processor is configured to implement the clock synchronization method as described in any one of claims 1 to 9, or the clock synchronization method as described in claim 10, when executing a computer program stored in the memory.