Clock synchronization system and method
By using a global synchronization module and a local synchronization module architecture, high-precision clock synchronization of the vehicle computing system is achieved using square wave signals, solving the clock synchronization problem without gateway support and achieving sub-millisecond synchronization accuracy and system stability.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2026-03-05
AI Technical Summary
In in-vehicle computing systems, existing technologies struggle to achieve high-precision clock synchronization without gateway support, and network clock protocols cannot guarantee the accuracy of clock synchronization.
The system adopts an architecture with global and local synchronization modules. Clock synchronization is achieved by transmitting square wave signals through a single signal line. The clock signal of the navigation device is used to realize the synchronization of the global computing device. The system also sets the corresponding data acquisition method according to the sensor type to ensure that different computing devices process the sensor data at the same time.
It achieves sub-millisecond clock synchronization without the need for gateway support, avoiding expensive gateway licensing fees and clock jitter caused by network fluctuations, reducing system complexity, and improving practicality and accuracy.
Smart Images

Figure CN2025107155_05032026_PF_FP_ABST
Abstract
Description
A clock synchronization system and method
[0001] Cross-reference to related applications
[0002] This application claims priority to Chinese Patent Application No. 202411187907.3, filed on August 28, 2024, entitled "A Clock Synchronization System and Method", the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of autonomous driving technology, and in particular to a clock synchronization system and method. Background Technology
[0004] The computing power requirements of in-vehicle computing systems reach approximately 100 trillion operations per second. Currently, edge computing devices and single devices struggle to achieve such high computing power, thus requiring multi-device collaborative operation. Simultaneously, the number of sensors required to perceive more information has increased dramatically. Multiple computing devices collaboratively processing signals from multiple different sensors necessitates a common clock reference to ensure that different computing devices are processing sensor signals from the same time at the same moment, preventing inconsistent output results. Traditional clock synchronization solutions require gateway support, are susceptible to network conditions, and gateways supporting precise time protocols require expensive licensing fees. While synchronization solutions using network clock protocols can save costs, they cannot guarantee clock synchronization accuracy.
[0005] It is evident that achieving high-precision clock synchronization without gateway support is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0006] The purpose of this application is to provide a clock synchronization system and method that can achieve high-precision clock synchronization without the need for gateway support.
[0007] To address the aforementioned technical problems, embodiments of this application provide a clock synchronization system, including a global synchronization module and a local synchronization module; the global synchronization module includes a global computing device; the local synchronization module includes a first local computing device that communicates with trigger-type sensors and a second local computing device that communicates with non-trigger-type sensors;
[0008] The global synchronization module is connected to both the navigation device and the local synchronization module. It is used to synchronize the clock of the global computing device based on the clock signal of the navigation device, and to send a square wave signal containing a timestamp to the local synchronization module.
[0009] The local synchronization module is used to receive the square wave signal sent by the global synchronization module; based on the timestamp contained in the square wave signal, it resets the system clock of the local synchronization module.
[0010] The first local computing device is used to send a trigger signal to the trigger-type sensor and start timing according to a set pulse width when the rising edge pulse signal of the square wave signal is captured, so that the trigger-type sensor can start collecting data according to the trigger signal and transmit data to the first local computing device connected to it; when the timing time reaches a set threshold, the sending of the trigger signal stops.
[0011] The second local computing device is used to use its own system clock as the clock source for the non-triggering sensors connected to it, so as to receive data transmitted by the non-triggering sensors at their own frequency.
[0012] In some embodiments of this application, a local synchronization module is used to receive a square wave signal sent by a global synchronization module; when the rising edge pulse signal of the square wave signal is captured, the system clock is cleared to zero; the square wave signal is calculated to obtain a timestamp; and the system clock of the local synchronization module is reset based on the timestamp and the calculation time of the square wave signal.
[0013] In some embodiments of this application, a local synchronization module is used to use the sum of the timestamp and the solution time of the square wave signal as the system clock of the local synchronization module.
[0014] In some embodiments of this application, the global synchronization module is used to construct a square wave signal corresponding to the next time stamp after the clock synchronization of the global computing device is achieved; and to send the square wave signal to the local synchronization module when the current time reaches the next time.
[0015] In some embodiments of this application, the global synchronization module is used to record the square wave signal corresponding to the constructed next time-stamp into a set buffer area; when the current time reaches the next time, the square wave signal is read from the buffer area and sent to the local synchronization module.
[0016] In some embodiments of this application, the global synchronization module is used to calculate the verification signal corresponding to the next time stamp according to the set verification method; and to encapsulate the next time stamp and the verification signal into a square wave signal according to the set square wave signal format.
[0017] In some embodiments of this application, the local synchronization module is used to calculate the actual verification signal corresponding to the timestamp after solving the square wave signal to obtain the timestamp, according to a set verification method; determine whether the actual verification signal is consistent with the verification signal carried by the square wave signal; if the actual verification signal is consistent with the verification signal carried by the square wave signal, perform the step of resetting the system clock of the local synchronization module based on the timestamp and the solution time of solving the square wave signal; if the actual verification signal is inconsistent with the verification signal carried by the square wave signal, obtain a new square wave signal from the global synchronization module.
[0018] In some embodiments of this application, the local synchronization module is used to switch its own state to a synchronization state when it captures the rising edge pulse signal of a square wave signal so that it no longer responds to other square wave signals; after completing the system clock reset, it switches its own state to a standby state so that it can respond to square wave signals.
[0019] In some embodiments of this application, the first local computing device is configured to switch its own state to a transmitting state when it captures the rising edge pulse signal of a square wave signal, so as to send a trigger signal to a trigger-type sensor according to a set pulse width; and to switch its own state to a standby state when the timing time reaches a set threshold, so as to stop sending the trigger signal.
[0020] In some embodiments of this application, the first local computing device is configured to switch its own state to a transmitting state when it captures the rising edge pulse signal of a square wave signal; and to switch its own state to a standby state when the difference between the time of sending the trigger signal closest to the current time and the time of receiving the square wave signal is greater than a set threshold.
[0021] In some embodiments of this application, a local synchronization module is used to determine whether the data transmitted by various sensors carries a timestamp when the data is received from various sensors.
[0022] If the data transmitted by the target sensor does not carry a timestamp, the current system time of the local computing device communicating with the target sensor will be used as the timestamp of the data.
[0023] In some embodiments of this application, a local synchronization module is used to correct the timestamps carried by the data transmitted by various types of sensors using a sensor transmission delay database; wherein, the sensor transmission delay database records the transmission delay corresponding to each type of sensor.
[0024] In some embodiments of this application, a local synchronization module is used to determine whether the timestamp carried by the data transmitted by various sensors belongs to the signal acquisition time; if the timestamp carried by the data transmitted by the target sensor does not belong to the signal acquisition time, the module queries the target transmission delay database to find the target transmission delay that matches the target sensor; and corrects the timestamp carried by the data transmitted by the target sensor according to the target transmission delay.
[0025] In some embodiments of this application, a local synchronization module is used to use the difference between the timestamp carried by the data transmitted by the target sensor and the target transmission delay as the corrected timestamp.
[0026] In some embodiments of this application, the local synchronization module includes multiple local computing devices, each of which has its corresponding message queue;
[0027] Local computing devices are used to put data transmitted from connected sensors into their corresponding message queues.
[0028] In some embodiments of this application, a local synchronization module is used to perform a rolling search on the data in each message queue according to a set time window, so as to select data from all sensors that are within the time window and send them to the application software.
[0029] In some embodiments of this application, the trigger-type sensor includes a camera; a first local computing device is connected to the camera via a deserializer and a serializer.
[0030] In some embodiments of this application, the non-trigger sensor includes a lidar; the second local computing device is connected to the lidar via an Ethernet interface.
[0031] In some embodiments of this application, the global synchronization module includes a signal receiving interface, a global computing device, and a signal transmitting interface; wherein, the signal receiving interface includes a GPRMC interface and a second pulse signal interface for time synchronization; the signal transmitting interface includes a square wave signal transmitting interface.
[0032] This application also provides a clock synchronization method, applicable to a local synchronization module, the method including:
[0033] Receives square wave signals sent by the global synchronization module; wherein, the square wave signal is a square wave signal containing a timestamp generated by the global synchronization module after realizing the clock synchronization of the global computing device based on the clock signal of the navigation device;
[0034] The system clock is reset based on the timestamp contained in the square wave signal;
[0035] Upon capturing the rising edge pulse signal of a square wave signal, a trigger signal is sent to the trigger-type sensor according to the set pulse width, and timing begins, so that the trigger-type sensor can start collecting data according to the trigger signal and transmit the data to the local computing device connected to it.
[0036] When the timeout period reaches the set threshold, the trigger signal will stop being sent.
[0037] The system clock is used as the clock source for the non-triggering sensors connected to it, so as to receive data transmitted by the non-triggering sensors at their own frequency.
[0038] As can be seen from the above technical solution, the clock synchronization system includes a global synchronization module and a local synchronization module. The local synchronization module includes a first local computing device that communicates with trigger-type sensors and a second local computing device that communicates with non-trigger-type sensors. The global synchronization module is connected to both the navigation device and the local synchronization module, and is used to synchronize the clock of the global computing device based on the clock signal of the navigation device. To achieve time synchronization with each device in the local synchronization module, the global synchronization module sends a square wave signal containing a timestamp to the local synchronization module. The local synchronization module receives the square wave signal sent by the global synchronization module and resets the system clock of the local synchronization module based on the timestamp contained in the square wave signal. The local synchronization module contains multiple local computing devices, and the types of sensors connected to different local computing devices vary. To ensure that different local computing devices process sensor data from the same time at the same moment, the first local computing device, upon capturing the rising edge pulse signal of the square wave signal, sends a trigger signal to the trigger-type sensor according to a set pulse width and starts timing, so that the trigger-type sensor can start collecting data according to the trigger signal and transmit data to the first local computing device connected to it; when the timing reaches a set threshold, the sending of the trigger signal stops. The second local computing device uses its own system clock as the clock source for connected non-triggering sensors, enabling it to receive data transmitted by these sensors at their own frequencies. The advantages of this application are that the global synchronization module can achieve clock synchronization between the global and local synchronization modules by sending square wave signals to them. Different local computing devices can set appropriate data acquisition methods based on the types of sensors they are connected to, acquiring sensor data at the same time. Using a single signal line to transmit square wave signals for multi-device synchronization avoids expensive gateway licensing fees and clock jitter caused by network fluctuations. Sub-millisecond clock synchronization can be achieved without gateway involvement. Hardware and software collaboration ensures clock synchronization, guaranteeing clock synchronization within the domain even if the global synchronization module fails to communicate properly with the navigation device. The square wave signal uses a fixed rising edge frame header, balancing triggering and signal transmission, allowing it to be used simultaneously for clock synchronization of computing devices and sensor triggering, significantly reducing system complexity and improving practicality. Attached Figure Description
[0039] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 is a schematic diagram of a clock synchronization system provided in an embodiment of this application;
[0041] Figure 2 is a schematic diagram of a square wave signal provided in an embodiment of this application;
[0042] Figure 3 is a schematic diagram of the hardware architecture of a clock synchronization system provided in an embodiment of this application;
[0043] Figure 4 is a flowchart of a clock synchronization method provided in an embodiment of this application. Detailed Implementation
[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0045] The terms "comprising" and "having," and any variations thereof, in the specification and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may include steps or units not listed.
[0046] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0047] Autonomous driving is a technology that uses computers and sensors to enable cars or other types of vehicles to drive independently on roads and perform driving tasks. With the increasing computing power requirements of autonomous driving technology, multiple devices generally need to work together, and the number of sensors required to perceive more information is also increasing dramatically. To ensure that different devices are processing sensor signals from the same time, a common clock reference is needed. Currently, there are two ways to achieve clock synchronization: one is based on the Precision Time Protocol (PTP), and the other is based on the Network Time Protocol (NTP). However, automotive-grade gateways supporting PTP typically require expensive licensing fees, posing a certain economic barrier. NTP, on the other hand, is affected by network fluctuations and is not accurate enough.
[0048] Therefore, this application provides a clock synchronization system and method that uses a single signal line to transmit a square wave signal for multi-device synchronization. This avoids expensive gateway licensing fees and clock jitter caused by network fluctuations. Sub-millisecond clock synchronization can be achieved without the need for a gateway.
[0049] Both the global synchronization module and the local synchronization module contain various computing devices that need to achieve clock synchronization. For ease of distinction, the computing devices contained in the global synchronization module can be called global computing devices, and the computing devices contained in the local synchronization module can be called local computing devices.
[0050] Different local computing devices are connected to different types of sensors. In this embodiment, sensors that require a trigger signal to collect data can be classified as trigger-type sensors. Sensors that can automatically collect data without a trigger signal can be classified as non-trigger-type sensors. For ease of distinction, the local computing device connected to a trigger-type sensor can be referred to as a first local computing device, and the local computing device connected to a non-trigger-type sensor can be referred to as a second local computing device.
[0051] Next, a clock synchronization system provided by an embodiment of this application will be described in detail. Figure 1 is a schematic diagram of the structure of a clock synchronization system provided by an embodiment of this application. The system includes a global synchronization module 11 and a local synchronization module 12. The local synchronization module 12 includes a first local computing device 121 that communicates with trigger-type sensors and a second local computing device 122 that communicates with non-trigger-type sensors.
[0052] In this embodiment, the global synchronization module 11 may include a signal receiving interface, a global computing device, and a signal sending interface.
[0053] Navigation devices can employ integrated navigation. Integrated navigation refers to a navigation system that combines various navigation devices and is controlled by a monitor and computer. The satellite signals generated by integrated navigation can include Pulse Per Second (PPS) signals based on the Global Positioning System (GPS) and Global Positioning System Recommended Minimum Navigation Information (GPRMC).
[0054] Depending on the form of satellite signals transmitted by the navigation device, the signal receiving interface may include a GPRMC interface and a PPS interface.
[0055] Global computing devices refer to devices with processing and computing capabilities, such as central processing units (CPUs).
[0056] The timestamp is transmitted using a square wave signal, therefore the signal transmission interface can include a square wave signal transmission interface.
[0057] The global synchronization module 11 is connected to both the navigation device and the local synchronization module 12. It is used to synchronize the clock of the global computing device based on the clock signal of the navigation device and to send a square wave signal containing a timestamp to the local synchronization module 12.
[0058] The local synchronization module 12 is used to receive the square wave signal sent by the global synchronization module 11; and to reset the system clock of the local synchronization module 12 according to the timestamp contained in the square wave signal.
[0059] The starting position of the square wave signal is fixed at the rising edge of the pulse. Therefore, when the local synchronization module 12 captures the rising edge pulse signal of the square wave signal, it clears the system clock to zero; it calculates the square wave signal to obtain the timestamp; and based on the timestamp and the calculation time of the square wave signal, it resets the system clock of the local synchronization module 12.
[0060] The timestamp can be a Coordinated Universal Time (UTC) binary timestamp accurate to the second.
[0061] In practical applications, the local synchronization module 12 can use the sum of the timestamp and the solution time of the square wave signal as the system clock of the local synchronization module 12.
[0062] The square wave signal carries a timestamp. By decoding the square wave signal, the timestamp can be obtained and denoted as tu. The decoding time of the square wave signal is denoted as t0. Then, the system clock is reset to tu+t0.
[0063] In this embodiment of the application, all computing devices included in the local synchronization module 12 are collectively referred to as local computing devices. There can be multiple local computing devices. There can be various types of local computing devices. For example, Field-Programmable Gate Array (FPGA), Complex Programmable Logic Device (CPLD), and Microcontroller Unit (MCU) can all be used as local computing devices.
[0064] The first local computing device 121 is used to send a trigger signal to a trigger-type sensor and start timing according to a set pulse width when the rising edge pulse signal of a square wave signal is captured, so that the trigger-type sensor can start collecting data according to the trigger signal and transmit data to the first local computing device 121 connected thereto; when the timing time reaches a set threshold, the sending of the trigger signal is stopped.
[0065] In this embodiment, the computing devices connected to the trigger-type sensors are collectively referred to as the first local computing devices 121. Considering that there are various types of trigger-type sensors, a corresponding first local computing device 121 can be set for each type of trigger-type sensor, so there can be multiple first local computing devices 121.
[0066] Different types of trigger sensors perform different functions, and their triggering methods may also differ. The first local computing device 121 connected to different types of trigger sensors requires different functions. Based on the different functions required, the first local computing device 121 can be of various types.
[0067] In practical applications, different first local computing devices 121 can connect to different types of trigger-type sensors. The same first local computing device 121 can simultaneously connect to multiple trigger-type sensors of the same type. If the first local computing device 121 can simultaneously control multiple types of trigger-type sensors, then the first local computing device 121 can simultaneously connect to multiple trigger-type sensors of different types.
[0068] The second local computing device 122 is used to use its own system clock as the clock source for the non-triggering type sensor connected to it, so as to receive the data transmitted by the non-triggering type sensor according to its own frequency.
[0069] For non-triggering sensors that do not require a trigger signal, in order to enable multiple non-triggering sensors to collect data at the same time, the second local computing device 122 can use its own system clock as the clock source for the non-triggering sensors connected to it, thereby ensuring clock synchronization of multiple non-triggering sensors.
[0070] The first local computing device 121 and the second local computing device 122 can be different local computing devices. It should be noted that if a local computing device can simultaneously control both triggered sensors and non-triggered sensors, then the local computing device can serve as either the first local computing device 121 or the second local computing device 122; that is, the first local computing device 121 and the second local computing device 122 can also be the same local computing device.
[0071] The global synchronization module 11 achieves clock synchronization with the local synchronization module 12 by transmitting square wave signals to the local synchronization module 12. In practical applications, after achieving clock synchronization of the global computing device, the global synchronization module 11 can construct a square wave signal corresponding to the next time stamp; when the current time reaches the next time stamp, it can send a square wave signal to the local synchronization module 12.
[0072] Considering that after the square wave signal is constructed, it needs to be sent to the local synchronization module 12 only when the current time reaches the next moment, the global synchronization module 11 can first record the square wave signal corresponding to the constructed next moment timestamp into the set buffer area after constructing the square wave signal; when the current time reaches the next moment, it reads the square wave signal from the buffer area and sends the square wave signal to the local synchronization module 12.
[0073] For example, the global computing device can calculate the square wave waveform corresponding to the next full second (t1) timestamp at the current moment, encapsulate the square wave waveform into a square wave signal, and place it in the transmission buffer for transmission. When the waiting time reaches t1, the square wave signal is transmitted. If t1 has passed when the square wave signal is encapsulated, the square wave waveform corresponding to the next full second timestamp is recalculated until the square wave signal can be transmitted. The global computing device can simultaneously transmit this square wave signal to all local computing devices in the local synchronization module 12.
[0074] In this embodiment, to ensure the reliability of data transmission, verify the integrity of data during transmission, and provide error detection and correction mechanisms where possible, a check segment can be set for the square wave waveform corresponding to the timestamp when constructing the square wave signal.
[0075] The global synchronization module 11 can calculate the verification signal corresponding to the next time stamp according to the set verification method; and encapsulate the next time stamp and the verification signal into a square wave signal according to the set square wave signal format.
[0076] The square wave signal format includes four fields: trigger segment, content segment, check segment, and end segment. The trigger segment is the frame header of the square wave signal, and the end segment is the frame trailer. The content of the frame header and trailer is fixed and can each occupy 1 byte. The content segment records the UTC binary timestamp and occupies 4 bytes. The check segment records the bytecode of the check signal and occupies 1 byte.
[0077] In practical applications, the verification formula can be:
[0078] Where C represents the bytecode of the check signal, P n This represents the content segment of the nth byte, 0XFF indicates taking the lower 8 bits, and & represents the AND operator.
[0079] Considering that the maximum bandwidth of the I / O (Input / Output) pins of the global computing device is 13MHz (Megahertz), a square wave signal can be transmitted at a frequency of 1MHz.
[0080] Figure 2 is a schematic diagram of a square wave signal provided in an embodiment of this application. The square wave signal includes four parts: a frame header, a content segment, a check segment, and a frame tail. The pulse widths of the frame header and frame tail are the same. The content segment carries timestamp information, which may cause its pulse width to be inconsistent with the pulse widths of the frame header and frame tail. Figure 2 is only an illustration and does not limit the specific pulse width of the square wave signal.
[0081] After the local synchronization module 12 obtains the timestamp by solving the square wave signal, it can calculate the actual verification signal corresponding to the timestamp according to the set verification method; and determine whether the actual verification signal is consistent with the verification signal carried by the square wave signal.
[0082] If the actual verification signal is consistent with the verification signal carried by the square wave signal, it indicates that the square wave signal has not been tampered with. At this time, the system clock of the local synchronization module 12 can be reset based on the timestamp and the calculation time of the square wave signal.
[0083] If the actual verification signal is inconsistent with the verification signal carried by the square wave signal, it indicates that the square wave signal may have been maliciously tampered with. If clock synchronization is performed according to the calculated timestamp, there will be an error. At this time, a new square wave signal can be obtained from the global synchronization module 11.
[0084] In this embodiment, by setting a check segment in the square wave signal, the local synchronization module can verify the correctness of the timestamp carried by the received square wave signal, thereby ensuring that the correct timestamp can be obtained and completing the clock synchronization setup, thus guaranteeing the stability and accuracy of the communication system. If the timestamp fails the verification, a new square wave signal can be obtained again, avoiding the misleading effect of an incorrect timestamp on the system clock synchronization.
[0085] In this embodiment, each local computing device in the local synchronization module 12 can function as a state machine during the synchronization process, corresponding to two working states: a synchronization state and a standby state. In the synchronization state, the local computing device only responds to the currently received square wave signal and no longer responds to other square wave signals. In the standby state, the system clock is not reset.
[0086] In practical applications, when the local synchronization module 12 captures the rising edge pulse signal of the square wave signal, it can switch its own state to the synchronization state so that it will no longer respond to other square wave signals; after completing the system clock reset, it can switch its own state to the standby state so that it can respond to the square wave signal.
[0087] After the local computing devices in the local synchronization module 12 have completed the system clock reset, they can synchronize the clocks of the sensors connected to the controller.
[0088] To facilitate the differentiation of different types of local computing devices, the local computing device connected to the trigger-type sensor can be referred to as the first local computing device 121, and the local computing device connected to the non-trigger-type sensor can be referred to as the second local computing device 122.
[0089] When the first local computing device 121 captures the rising edge pulse signal of a square wave signal, it can switch its own state to a transmitting state so as to send a trigger signal to a trigger-type sensor according to a set pulse width; when the timing time reaches a set threshold, it can switch its own state to a standby state so as to stop sending the trigger signal.
[0090] In practical applications, the pulse width can be set for different types of trigger-type sensors.
[0091] When the first local computing device 121 is in the transmitting state, it can send a trigger signal to the trigger sensor according to the pulse width corresponding to the trigger sensor.
[0092] In this embodiment, the first local computing device 121 switches to a standby state not only when the timing reaches a set threshold, but also when the difference between the time of sending the trigger signal closest to the current time and the time of receiving the square wave signal is greater than a set threshold.
[0093] In practical applications, the system can enter a standby state when the following formula is satisfied.
[0094] Among them, t p t represents the time when the trigger signal was sent most recently. s This indicates the arrival time of the square wave signal, where t represents the set threshold. c t represents the time when the last trigger signal was sent. c+1 Indicates the time when the trigger signal will be sent next, t n This indicates the moment the square wave signal is received. The threshold value should be less than the square wave signal transmission interval; it can be set to half the trigger signal period.
[0095] Considering that in practical applications, some types of sensors transmit data without timestamps, such as camera data, timestamps can be added to the data that does not carry timestamps to ensure that the local synchronization module 12 can acquire data from different sensors at the same time.
[0096] When the local synchronization module 12 receives data transmitted from various sensors, it can determine whether the data transmitted from various sensors carries a timestamp.
[0097] If the data transmitted by the target sensor does not carry a timestamp, the current system time of the local computing device communicating with the target sensor can be used as the timestamp of the data.
[0098] The timestamps carried in the data transmitted by sensors are generally the time of data acquisition. Since timestamps are added to data that does not have their own timestamps, and these added timestamps often represent the time the data arrives at the local computing device, timestamp correction can be performed to ensure that the timestamps corresponding to various types of sensor data accurately reflect the data acquisition time.
[0099] In this embodiment, a sensor transmission delay database can be established in advance, which can record the transmission delay of each type of sensor. Transmission delay represents the time it takes for data to travel from the sensor to the local computing device.
[0100] The local synchronization module 12 can use the sensor transmission delay database to correct the timestamps carried in the data transmitted by various sensors.
[0101] In a specific implementation, the local synchronization module 12 can determine whether the timestamp carried by the data transmitted by various sensors belongs to the signal acquisition time.
[0102] If the timestamp carried by the data transmitted by the target sensor does not belong to the signal acquisition time, it indicates that the timestamp may be a supplementary timestamp. This timestamp is often the time when the data arrives at the local computing device. In order to correct this timestamp, the target transmission delay matching the target sensor can be queried from the sensor transmission delay database. Based on the target transmission delay, the timestamp carried by the data transmitted by the target sensor can be corrected.
[0103] A specific correction method could be to use the difference between the timestamp carried by the data transmitted by the target sensor and the target transmission delay as the corrected timestamp.
[0104] For example, suppose the timestamp carried in the data transmitted by the target sensor is the time it arrives at the local computing device, using t o The transmission delay corresponding to the target sensor is t.d The corrected timestamp is t. o -t d .
[0105] In this embodiment, the timestamps of various sensors are corrected at the software level using a sensor transmission delay database, which further improves the quality of clock synchronization.
[0106] The local synchronization module 12 includes multiple local computing devices, each with its own corresponding message queue; the local computing device can put the data transmitted by the sensors connected to it into its corresponding message queue.
[0107] The local synchronization module 12 can perform a rolling search of the data in each message queue according to a set time window, so as to select the data of all sensors that are within the time window and send them to the application software.
[0108] In practical applications, rolling data searches can be performed by each local computing device according to a set time window, which searches the data in its corresponding message queue to select the data within the time window and send it to the application software so that the application software can perform subsequent analysis and processing on the synchronized data.
[0109] By synchronously filtering and selecting the data collected by the sensors at the software level, only the synchronized data is retained, which greatly reduces the amount of invalid signals transmitted and improves communication efficiency.
[0110] In practical applications, trigger-type sensors may include cameras; the first local computing device 121 is connected to the camera via a deserializer and a serializer.
[0111] Non-trigger sensors include lidar; the second local computing device 122 is connected to the lidar via an Ethernet interface. Besides lidar, common non-trigger sensors also include millimeter-wave radar. The second local computing device 122 can connect to the millimeter-wave radar via a Controller Area Network (CAN) interface.
[0112] Figure 3 is a schematic diagram of the hardware architecture of a clock synchronization system provided in an embodiment of this application. The controller contains multiple computing devices that can communicate with each other via Ethernet. Based on the different functions required, the computing devices connected to the navigation device can be classified as global computing devices, and the remaining computing devices as local computing devices. Figure 3 uses four local computing devices as an example; in practical applications, the number of local computing devices can be more or less, and is not limited here.
[0113] There are various types of sensors, which can be divided into two main categories: triggered sensors and non-triggered sensors. Common triggered sensors include cameras, while common non-triggered sensors include LiDAR. For cameras, there can be multiple cameras; Figure 3 uses two cameras as an example. A computing device can connect to the cameras via a deserializer and a serializer. One deserializer can connect to multiple serializers simultaneously, with each serializer connected to one camera. The computing device can send a trigger signal to the deserializer, which, after processing by the deserializer and serializer, ultimately triggers the cameras to start acquiring data. Besides cameras, other triggered sensors exist, but they are not limited here. For non-triggered sensors, the computing device can connect to them through corresponding interfaces. For example, one computing device in a local synchronization module can connect to the LiDAR via an Ethernet interface, while another computing device can connect to other sensors through other interfaces.
[0114] As can be seen from the above technical solution, the clock synchronization system includes a global synchronization module and a local synchronization module. The local synchronization module includes a first local computing device that communicates with trigger-type sensors and a second local computing device that communicates with non-trigger-type sensors. The global synchronization module is connected to both the navigation device and the local synchronization module, and is used to synchronize the clock of the global computing device based on the clock signal of the navigation device. To achieve time synchronization with each device in the local synchronization module, the global synchronization module sends a square wave signal containing a timestamp to the local synchronization module. The local synchronization module receives the square wave signal sent by the global synchronization module and resets the system clock of the local synchronization module based on the timestamp contained in the square wave signal. The local synchronization module contains multiple local computing devices, and the types of sensors connected to different local computing devices vary. To ensure that different local computing devices process sensor data from the same time at the same moment, the first local computing device, upon capturing the rising edge pulse signal of the square wave signal, sends a trigger signal to the trigger-type sensor according to a set pulse width and starts timing, so that the trigger-type sensor can start collecting data according to the trigger signal and transmit data to the first local computing device connected to it; when the timing reaches a set threshold, the sending of the trigger signal stops. The second local computing device uses its own system clock as the clock source for connected non-triggering sensors, enabling it to receive data transmitted by these sensors at their own frequencies. The advantages of this application are that the global synchronization module can achieve clock synchronization between the global and local synchronization modules by sending square wave signals to them. Different local computing devices can set appropriate data acquisition methods based on the types of sensors they are connected to, acquiring sensor data at the same time. Using a single signal line to transmit square wave signals for multi-device synchronization avoids expensive gateway licensing fees and clock jitter caused by network fluctuations. Sub-millisecond clock synchronization can be achieved without gateway involvement. Hardware and software collaboration ensures clock synchronization, guaranteeing clock synchronization within the domain even if the global synchronization module fails to communicate properly with the navigation device. The square wave signal uses a fixed rising edge frame header, balancing triggering and signal transmission, allowing it to be used simultaneously for clock synchronization of computing devices and sensor triggering, significantly reducing system complexity and improving practicality.
[0115] Figure 4 is a flowchart of a clock synchronization method provided in an embodiment of this application. The method includes:
[0116] S401: Receives square wave signals sent by the global synchronization module.
[0117] Among them, the square wave signal is a square wave signal containing a timestamp generated by the global synchronization module after the clock of the global computing device is synchronized based on the clock signal of the navigation device.
[0118] S402: Reset the system clock based on the timestamp contained in the square wave signal.
[0119] S403: Upon capturing the rising edge pulse signal of a square wave signal, a trigger signal is sent to the trigger-type sensor according to the set pulse width, and timing is started, so that the trigger-type sensor can start collecting data according to the trigger signal and transmit data to the local computing device connected to it.
[0120] S404: Stop sending trigger signals when the timing reaches the set threshold.
[0121] S405: Uses its own system clock as the clock source for the non-triggering sensors connected to it, so as to receive data transmitted by the non-triggering sensors at its own frequency.
[0122] In some embodiments, resetting the system clock based on the timestamp contained in the square wave signal includes:
[0123] If the rising edge pulse of the square wave signal is captured, the system clock is cleared to zero;
[0124] Solve the square wave signal to obtain the timestamp;
[0125] The system clock of the local synchronization module is reset based on the timestamp and the calculation time of the square wave signal.
[0126] In some embodiments, after solving the square wave signal to obtain the timestamp, the method further includes:
[0127] Calculate the actual verification signal corresponding to the timestamp according to the set verification method;
[0128] Determine whether the actual verification signal is consistent with the verification signal carried by the square wave signal;
[0129] If the actual verification signal is consistent with the verification signal carried by the square wave signal, the system clock of the local synchronization module is reset based on the timestamp and the calculation time of the square wave signal.
[0130] If the actual verification signal is inconsistent with the verification signal carried by the square wave signal, a new square wave signal is obtained from the global synchronization module.
[0131] In some embodiments, after receiving the square wave signal sent by the global synchronization module, the method further includes:
[0132] Upon capturing the rising edge pulse signal of a square wave signal, it switches its own state to a synchronization state so that it no longer responds to other square wave signals.
[0133] After resetting the system clock, it switches to standby mode to respond to square wave signals.
[0134] In some embodiments, after resetting the system clock based on the timestamp contained in the square wave signal, the method further includes:
[0135] Upon capturing the rising edge pulse signal of a square wave signal, it switches its own state to the transmitting state so as to send a trigger signal to the trigger-type sensor according to the set pulse width.
[0136] When the timeout reaches the set threshold, it switches to standby mode to stop sending trigger signals.
[0137] In some embodiments, it also includes:
[0138] Upon receiving data transmitted from various sensors, determine whether the data transmitted from each sensor carries a timestamp;
[0139] If the data transmitted by the target sensor does not carry a timestamp, the current system time of the local computing device communicating with the target sensor will be used as the timestamp of the data.
[0140] In some embodiments, after using the system current time of the local computing device communicating with the target sensor as the timestamp of the data, the method further includes:
[0141] The timestamps carried by the data transmitted by various sensors are corrected using a sensor transmission delay database; the sensor transmission delay database records the transmission delay of each type of sensor.
[0142] In some embodiments, correcting the timestamps carried in the data transmitted by various sensors using a sensor transmission delay database includes:
[0143] Determine whether the timestamps carried in the data transmitted by various sensors belong to the signal acquisition time;
[0144] If the timestamp carried by the data transmitted by the target sensor does not belong to the signal acquisition time, query the target transmission delay matching the target sensor from the sensor transmission delay database;
[0145] The timestamps carried in the data transmitted by the target sensor are corrected based on the target transmission delay.
[0146] In some embodiments, correcting the timestamp carried in the data transmitted by the target sensor according to the target transmission delay includes:
[0147] The difference between the timestamp carried by the data transmitted by the target sensor and the target transmission delay is used as the corrected timestamp.
[0148] In some embodiments, it also includes:
[0149] The data transmitted by the connected sensors is placed into their corresponding message queue.
[0150] In some embodiments, after placing the data transmitted by the connected sensor into its corresponding message queue, the method further includes:
[0151] The system performs a rolling search of the data in each message queue according to the set time window to select data from all sensors that are within the time window and send them to the application software.
[0152] The description of the features in the embodiment corresponding to Figure 4 can be found in the description of the embodiment corresponding to Figure 1, and will not be repeated here.
[0153] As can be seen from the above technical solution, the system receives a square wave signal sent by the global synchronization module. This square wave signal is generated by the global synchronization module after synchronizing the clock of the global computing device based on the clock signal of the navigation device. The system clock is reset based on the timestamp contained in the square wave signal. Upon capturing the rising edge pulse of the square wave signal, a trigger signal is sent to the trigger-type sensor according to the set pulse width, and timing begins. This allows the trigger-type sensor to start collecting data based on the trigger signal and transmitting data to the local computing device connected to it. When the timing reaches a set threshold, the sending of the trigger signal stops. The system clock is used as the clock source for the non-trigger-type sensors connected to it, so as to receive data transmitted by the non-trigger-type sensors according to its own frequency. The beneficial effect of this application is that using a single signal line to transmit square wave signals for multi-device synchronization avoids expensive gateway licensing fees and clock jitter caused by network fluctuations. Sub-millisecond clock synchronization can be achieved without gateway involvement. The use of hardware and software collaboration ensures clock synchronization, guaranteeing clock synchronization within the domain even if the global synchronization module fails to communicate normally with the navigation device. The square wave signal uses a fixed rising edge frame header, which takes into account both triggering and signal transmission. This allows the signal to be used simultaneously for clock synchronization of computing devices and triggering of sensors, greatly reducing system complexity and improving practicality.
[0154] The foregoing has provided a detailed description of a clock synchronization system and method provided by the embodiments of this application. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. Regarding the methods disclosed in the embodiments, since they correspond to the systems disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to in the method section.
[0155] Those skilled in the art will further 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, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. 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.
[0156] The clock synchronization system and method provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. A clock synchronization system, characterized in that, It includes a global synchronization module and a local synchronization module; the global synchronization module includes a global computing device; the local synchronization module includes a first local computing device that communicates with trigger-type sensors and a second local computing device that communicates with non-trigger sensors; The global synchronization module is connected to both the navigation device and the local synchronization module, and is configured to synchronize the clock of the global computing device based on the clock signal of the navigation device; and send a square wave signal containing a timestamp to the local synchronization module. The local synchronization module is configured to receive a square wave signal sent by the global synchronization module; and to reset the system clock of the local synchronization module based on the timestamp contained in the square wave signal. The first local computing device is configured to, upon capturing the rising edge pulse signal of a square wave signal, send a trigger signal to a trigger-type sensor according to a set pulse width and start timing, so that the trigger-type sensor can start collecting data according to the trigger signal and transmit the data to the first local computing device connected thereto; when the timing time reaches a set threshold, the sending of the trigger signal is stopped. The second local computing device is configured to use its own system clock as the clock source for the non-triggering sensors connected to it, so as to receive data transmitted by the non-triggering sensors at their own frequencies.
2. The clock synchronization system according to claim 1, characterized in that, The local synchronization module is configured to receive a square wave signal sent by the global synchronization module; upon capturing the rising edge pulse signal of the square wave signal, to reset the system clock to zero; and to decode the square wave signal to obtain the timestamp. Based on the timestamp and the calculation time for the square wave signal, the system clock of the local synchronization module is reset.
3. The clock synchronization system according to claim 2, characterized in that, The local synchronization module is configured to use the sum of the timestamp and the solution time for the square wave signal as the system clock of the local synchronization module.
4. The clock synchronization system according to claim 2, characterized in that, The global synchronization module is configured to construct a square wave signal corresponding to the next time stamp after achieving clock synchronization of the global computing device; and to send the square wave signal to the local synchronization module when the current time reaches the next time.
5. The clock synchronization system according to claim 4, characterized in that, The global synchronization module is configured to record the square wave signal corresponding to the constructed next time-stamp into a set buffer area; when the current time reaches the next time, it reads the square wave signal from the buffer area and sends the square wave signal to the local synchronization module.
6. The clock synchronization system according to claim 4, characterized in that, The global synchronization module is configured to calculate the verification signal corresponding to the next time stamp according to the set verification method; and to encapsulate the next time stamp and the verification signal into a square wave signal according to the set square wave signal format.
7. The clock synchronization system according to claim 6, characterized in that, The local synchronization module is configured to, after processing the square wave signal to obtain the timestamp, calculate the actual verification signal corresponding to the timestamp according to a set verification method; determine whether the actual verification signal is consistent with the verification signal carried by the square wave signal; if the actual verification signal is consistent with the verification signal carried by the square wave signal, perform the step of resetting the system clock of the local synchronization module based on the timestamp and the processing time of processing the square wave signal; if the actual verification signal is inconsistent with the verification signal carried by the square wave signal, obtain a new square wave signal from the global synchronization module.
8. The clock synchronization system according to claim 1, characterized in that, The local synchronization module is configured to switch its state to synchronization state when it captures the rising edge pulse signal of a square wave signal so that it no longer responds to other square wave signals; and to switch its state to standby state after resetting the system clock so that it can respond to square wave signals.
9. The clock synchronization system according to claim 8, characterized in that, The first local computing device is configured to switch its state to a transmitting state when it captures the rising edge pulse signal of a square wave signal, so as to send a trigger signal to a trigger-type sensor according to a set pulse width; and to switch its state to a standby state when the timing reaches a set threshold, so as to stop sending the trigger signal.
10. The clock synchronization system according to claim 8, characterized in that, The first local computing device is configured to switch its state to a transmitting state when it captures the rising edge pulse signal of a square wave signal; and to switch its state to a standby state when the difference between the time of sending the trigger signal closest to the current time and the time of receiving the square wave signal is greater than a set threshold.
11. The clock synchronization system according to claim 1, characterized in that, The local synchronization module is configured to determine whether the data transmitted by various sensors carries a timestamp when it receives data from various sensors. If the data transmitted by the target sensor does not carry a timestamp, the current system time of the local computing device communicating with the target sensor is used as the timestamp of the data.
12. The clock synchronization system according to claim 11, characterized in that, The local synchronization module is configured to use a sensor transmission delay database to correct the timestamps carried in the data transmitted by various sensors; wherein, the sensor transmission delay database records the transmission delay corresponding to each type of sensor.
13. The clock synchronization system according to claim 12, characterized in that, The local synchronization module is configured to determine whether the timestamps carried by the data transmitted by various sensors belong to the signal acquisition time; if the timestamps carried by the data transmitted by the target sensor do not belong to the signal acquisition time, it queries the target transmission delay matching the target sensor from the sensor transmission delay database; and corrects the timestamps carried by the data transmitted by the target sensor according to the target transmission delay.
14. The clock synchronization system according to claim 13, characterized in that, The local synchronization module is configured to use the difference between the timestamp carried by the data transmitted by the target sensor and the target transmission delay as the corrected timestamp.
15. The clock synchronization system according to claim 1, characterized in that, The local synchronization module includes multiple local computing devices, and each local computing device has its corresponding message queue. The local computing device is configured to place data transmitted from sensors connected to it into its corresponding message queue.
16. The clock synchronization system according to claim 15, characterized in that, The local synchronization module is configured to perform a rolling search of data in each message queue according to a set time window, so as to select data from all sensors that are within the time window and send them to the application software.
17. The clock synchronization system according to claim 1, characterized in that, The trigger-type sensor includes a camera; the first local computing device is connected to the camera via a deserializer and a serializer.
18. The clock synchronization system according to claim 1, characterized in that, The non-trigger type sensor includes a lidar; the second local computing device is connected to the lidar via an Ethernet interface.
19. The clock synchronization system according to any one of claims 1 to 18, characterized in that, The global synchronization module includes a signal receiving interface, a global computing device, and a signal transmitting interface; wherein, the signal receiving interface includes a GPRMC interface and a second pulse signal interface configured for time synchronization; the signal transmitting interface includes a square wave signal transmitting interface.
20. A clock synchronization method, characterized in that, Applicable to local synchronization modules, the method includes: Receive a square wave signal sent by the global synchronization module; wherein, the square wave signal is a square wave signal containing a timestamp generated by the global synchronization module after realizing the clock synchronization of the global computing device based on the clock signal of the navigation device; The system clock is reset based on the timestamp contained in the square wave signal; Upon capturing the rising edge pulse signal of a square wave signal, a trigger signal is sent to the trigger-type sensor according to the set pulse width, and timing begins, so that the trigger-type sensor can start collecting data according to the trigger signal and transmit the data to the local computing device connected to it. When the timeout period reaches the set threshold, the trigger signal will stop being sent. The system clock is used as the clock source for the non-triggering sensors connected to it, so as to receive data transmitted by the non-triggering sensors at their own frequency.
Citation Information
Patent Citations
Time scale synchronization system, time scale synchronization method and satellite-borne navigation receiver
CN112367139A
Multi-sensor time synchronization method, device and system, electronic device and medium
CN112672415A
Clock synchronization system and method
CN118713786A
Hardware-based time synchronization for heterogeneous sensors in autonomous vehicles
US20220182213A1
Flexible lidar camera synchronization for driverless vehicle
US20240241261A1
Cited By
Time synchronization method of heterogeneous sensor and related device
CN122062741A