Time synchronization method and apparatus, electronic device, and computer-readable storage medium

By determining the conversion relationship between the processor's internal time and the external world time in the visual measurement system and using the satellite module's pulse signal and world time information for time synchronization, the problems of complex hardware synchronization circuits and low precision in the existing technology are solved, and efficient time synchronization and data acquisition are achieved.

CN116400390BActive Publication Date: 2025-10-10SHANGHAI HUACE NAVIGATION TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310391311.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-12
Publication Date
2025-10-10
Estimated Expiration
2043-04-12

AI Technical Summary

Technical Problem

The time synchronization method in the existing visual measurement system requires complex hardware synchronization circuits and high costs, resulting in low synchronization accuracy and affecting the data fusion effect.

Method used

By determining the conversion relationship between the processor's internal time and the external world time, the pulse signal of the satellite module and the world time information are used for time synchronization, reducing the dependence on hardware circuits and improving the time synchronization accuracy.

Benefits of technology

High-precision time synchronization can be achieved without additional hardware circuits, reducing processing delays and improving the effectiveness and accuracy of data acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116400390B_ABST
    Figure CN116400390B_ABST
Patent Text Reader

Abstract

The application provides a time synchronization method and device, electronic equipment and computer readable storage medium, and relates to the technical field of visual measurement. The method comprises the following steps: determining internal time information of a processor according to a pulse signal of a satellite module and world time information; determining a time conversion relationship based on the internal time information and the world time information; and performing time synchronization on the satellite module and a sensing module used for measurement based on the time conversion relationship. The application determines the internal time of the processor and the world time of the external world respectively, thereby determining the conversion relationship between the two kinds of time, and performing high-precision time synchronization processing on each module in the measurement system according to the conversion relationship. The cumulative error of the high-precision clock in the processor can be effectively reduced, and additional hardware circuits are not required for synchronization, thereby reducing the cost of time synchronization, synchronously collecting data by each module, and improving the effectiveness of the measurement data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of visual measurement technology, and in particular to a time synchronization method, device, electronic device, and computer-readable storage medium. Background Art

[0002] When performing visual measurement, in order to obtain higher data fusion accuracy, it is generally necessary to perform time synchronization processing on the data collected by satellite navigation, inertial navigation, cameras and other transmitters in the visual measurement system. For example, a time is used as a reference benchmark to obtain the data generated by satellite navigation, inertial navigation, cameras and other devices at the same time.

[0003] Current time synchronization methods typically process the timestamps generated by various data to obtain the relative time between the data, or use the processor's internal time as a reference to obtain data and add a timestamp based on the internal clock source. However, this synchronization method requires complex hardware synchronization circuits with clock signal synchronization capabilities, and there are also corresponding delays in data processing. This leads to high cost and complexity of time synchronization and low synchronization accuracy, resulting in poor time synchronization results for visual measurement. Summary of the Invention

[0004] In view of this, an object of the embodiments of the present application is to provide a time synchronization method, device, electronic device and computer-readable storage medium to improve the problem of poor time synchronization effect of visual measurement in the prior art.

[0005] In order to solve the above problems, in a first aspect, an embodiment of the present application provides a time synchronization method, the method comprising:

[0006] Determine the internal time information of the processor based on the pulse signal of the satellite module and the world time information;

[0007] Determining a time conversion relationship based on the internal time information and the world time information;

[0008] Based on the time conversion relationship, the satellite module and the sensor module used for measurement are time synchronized.

[0009] In the above implementation process, the internal processor time and the external world time are determined separately, thereby determining the conversion relationship between the two times. This conversion relationship is then used to perform high-precision time synchronization processing on each module in the measurement system. This eliminates the need for additional and complex hardware circuitry for time synchronization. While reducing time synchronization costs, it can effectively reduce the accumulated error of the processor's internal high-precision clock and shorten processing delays, thereby effectively improving the accuracy of time synchronization. This enhances the time synchronization effect in the visual measurement system, enables synchronized data acquisition across modules, and improves the validity of measurement data.

[0010] Optionally, determining a time conversion relationship based on the internal time information and the world time information includes:

[0011] Determine a first starting time and an external period of the world time information;

[0012] Determine a second starting time and an internal period of the internal time information;

[0013] determining a time difference scale between the world time information and the internal time information based on the first start time, the second start time, the external period, and the internal period;

[0014] determining the time conversion relationship between the world time information and the internal time information based on the time difference scale;

[0015] The external period is the output period of the pulse signal, and the internal period is the timing period of the processor.

[0016] In the above implementation, because data processing is cyclical, the start times and periodicities of the two times are first determined. Based on the start times and periodicities, the time difference between the two times is then determined. The time conversion relationship between the two times is then calculated based on the time difference. This calculation of the corresponding conversion relationship based on the actual conditions of the two times effectively improves the accuracy of the time conversion relationship, thereby enhancing the precision of time synchronization processing.

[0017] Optionally, the sensing module includes an inertial module;

[0018] The step of performing time synchronization on the satellite module and the sensor module based on the time conversion relationship includes:

[0019] determining a first acquisition frequency of the satellite module and a second acquisition frequency of the inertial module;

[0020] Determining a first sampling time set of the processor's internal time according to the first acquisition frequency; converting the first sampling time set based on the time conversion relationship to obtain a second sampling time set of world time;

[0021] determining a third sampling time set of the internal time of the processor according to the second acquisition frequency; converting the third sampling time set based on the time conversion relationship to obtain a fourth sampling time set of the world time;

[0022] The second sampling time set and the fourth sampling time set are time-aligned in the universal time.

[0023] In the above implementation, the sensor module may include an inertial navigation module. When time synchronization is performed between the satellite module and the inertial module, a first data acquisition frequency for the satellite module and a second data acquisition frequency for the inertial module are first determined. Based on the two acquisition frequencies, a sampling time set in the processor's internal time is determined. Then, based on a time conversion relationship, the sampling time set of the internal time is converted to a sampling time set of the universal time. This achieves time synchronization between the satellite module and the inertial module in universal time, thereby improving the validity and accuracy of the satellite and inertial data collected by the satellite and inertial modules.

[0024] Optionally, the sensing module includes a camera module;

[0025] The step of performing time synchronization on the satellite module and the sensor module based on the time conversion relationship includes:

[0026] determining a first acquisition frequency of the satellite module, a third acquisition frequency of the camera module, and an exposure time;

[0027] Determining a first sampling time set of the processor's internal time according to the first acquisition frequency; converting the first sampling time set based on the time conversion relationship to obtain a second sampling time set of world time;

[0028] determining, based on the third acquisition frequency and the exposure time, a fifth sampling time set of the internal time of the processor when the camera module completes exposure; converting the fifth sampling time set based on the time conversion relationship to obtain a sixth sampling time set of world time;

[0029] The second sampling time set and the sixth sampling time set are time-aligned in the universal time.

[0030] In the above implementation, the sensor module may also include a camera module for image acquisition. When time synchronizing the satellite module and the camera module, a first acquisition frequency for acquiring data in the satellite module and a third acquisition frequency for acquiring data in the camera module may be determined. Furthermore, since the camera module has a certain exposure time during image acquisition, the corresponding exposure time can also be obtained for time compensation. Based on the two acquisition frequencies and the corresponding exposure time, a sampling time set in the processor's internal time is determined. Then, based on a time conversion relationship, the internal time sampling time set is converted to a sampling time set in world time, thereby achieving time synchronization between the satellite module and the camera module in world time. Exposure time can also be compensated accordingly during processing to reduce the adverse effects of exposure time on time synchronization, thereby improving the validity and accuracy of the satellite data and image data acquired by the satellite and camera modules.

[0031] Optionally, the exposure time is obtained by:

[0032] Obtaining historical exposure data of the camera module;

[0033] The exposure time is obtained by analyzing the historical exposure data.

[0034] In the above implementation process, since the exposure time of the camera module is not stable, weighted, averaged and other analysis processes can be performed based on the historical exposure data of the camera module to determine the corresponding time value or time interval value as the exposure time for compensation, which effectively improves the accuracy of the exposure time and thus improves the accuracy of time synchronization between the camera module and the satellite module.

[0035] Optionally, the performing time synchronization on the satellite module and the sensor module based on the time conversion relationship includes:

[0036] determining a first internal time for the processor to acquire sensing data of the sensing module;

[0037] Based on the first internal time, the world time information, the internal time information and the time conversion relationship, a second world time of the sensing data is determined; and the second world time is used as the timestamp of the sensing data to synchronize the satellite module and the sensor module.

[0038] In the above implementation process, the present application not only provides a time synchronization method for controlling the time of acquisition, but also provides a method for setting a corresponding timestamp for the sensor data after the sensor module has acquired the data for time synchronization. The first internal time when the sensor data was acquired can be first obtained, and then a corresponding second world time can be calculated based on the first internal time, world time information, internal time information, and time conversion relationship to serve as the timestamp of the sensor data. Time synchronization processing between the sensor data and the satellite data collected by the satellite module can be achieved from the timestamp of the sensor data, effectively reducing various delays during processor processing and improving the accuracy of time synchronization.

[0039] Optionally, determining the internal time information of the processor according to the pulse signal of the satellite module and the world time information includes:

[0040] Acquiring the pulse signal of the satellite module;

[0041] determining the world time information based on the pulse signal;

[0042] The frequency of the internal clock source of the processor is adjusted based on the world time information to obtain the internal time information corresponding to the pulse signal.

[0043] In the above implementation, when processing the two time periods, considering that the satellite module has a satellite timing function, the satellite module can be used as a standard clock source to determine the world time information based on the pulse signal it emits. Furthermore, to improve the accuracy of time synchronization, the processor's internal clock source can be frequency-multiplied or frequency-divided based on the world time information to obtain higher-precision internal time information corresponding to the pulse signal. This results in corresponding internal time information and world time information, improving the correlation between the two types of information.

[0044] In a second aspect, an embodiment of the present application further provides a time synchronization device, the device comprising: a determination unit, a conversion unit, and a synchronization unit;

[0045] The determination unit is used to determine the internal time information of the processor according to the pulse signal of the satellite module and the world time information;

[0046] The conversion unit is used to determine a time conversion relationship based on the internal time information and the world time information;

[0047] The synchronization unit is used to perform time synchronization on the satellite module and the sensor module used for measurement based on the time conversion relationship.

[0048] In the above implementation process, the internal time of the processor and the world time of the external world are determined respectively by the determination unit, the conversion relationship between the two times is determined by the conversion unit, and the synchronization unit performs high-precision time synchronization processing on each module in the measurement system according to the conversion relationship.

[0049] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores program instructions, and when the processor reads and runs the program instructions, it executes the steps in any implementation of the above-mentioned time synchronization method.

[0050] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer program instructions are stored in the computer-readable storage medium. When the computer program instructions are read and executed by a processor, the steps in any implementation of the above-mentioned time synchronization method are executed.

[0051] In summary, embodiments of the present application provide a time synchronization method, apparatus, electronic device, and computer-readable storage medium capable of separately determining the internal time of a processor and the world time of the external world, thereby determining the conversion relationship between the two times, and performing high-precision time synchronization processing on each module in the measurement system based on the conversion relationship. This method eliminates the need for additional and complex hardware circuits for time synchronization processing, effectively reduces the cumulative error of the high-precision clock within the processor, and reduces processing delay time while reducing the time synchronization cost, thereby effectively improving the accuracy of time synchronization, thereby enhancing the time synchronization effect in the visual measurement system, enabling each module to perform synchronous data acquisition, and improving the validity of the measurement data. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0053] Figure 1 A block diagram of an electronic device provided in an embodiment of the present application;

[0054] Figure 2 A flowchart of a time synchronization method provided in an embodiment of the present application;

[0055] Figure 3 A schematic diagram of a process of step S300 provided in an embodiment of the present application;

[0056] Figure 4 A first flowchart of step S400 is provided for the embodiments of the present application.

[0057] Figure 5 A second flowchart of step S400 is provided for the embodiments of the present application.

[0058] Figure 6 A third flowchart of step S400 is provided for the embodiments of the present application.

[0059] Figure 7 A flowchart of step S200 is provided for the embodiments of the present application.

[0060] Figure 8 A structural diagram of a time synchronization device is provided for the embodiments of the present application.

[0061] Icon: 100-electronic device; 111-memory; 112-storage controller; 113-processor; 114-peripheral interface; 115-input output unit; 116-display unit; 500-time synchronization device; 510-determination unit; 520-conversion unit; 530-synchronization unit. DETAILED DESCRIPTION

[0062] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0063] In a visual measurement system, generally includes a processor, a satellite navigation module, and an inertial navigation module, a camera module and other sensor modules with measurement functions. Various functional modules can be connected through various serial ports or interfaces, such as USB, SPI, MIPI, etc. interface, etc. for data transmission in the form of a bus, so as to realize the visual measurement function.

[0064] In the prior art, in order to obtain higher data fusion accuracy during visual measurement, it is generally necessary to perform time synchronization processing on the data collected by each module in the visual measurement system or in the module, so as to ensure that the measurement system uses a time reference benchmark, such as GPS time, UTC time, etc. At the same time, for example: 11:11:11 on November 11, 2022, the data generated by the satellite navigation module, the inertial navigation module, and the camera module are obtained at the same time.

[0065] Current time synchronization methods typically process the timestamps generated by various data sources. For example, the satellite navigation module, inertial navigation module, and camera module each generate their own timestamps, which are then sent along with the data to a processor. The processor then processes the timestamps from each module to determine the relative time between the data. Alternatively, the processor's internal time is used as a reference to acquire data and add a timestamp based on the processor's internal clock source. For example, within the processor, software uses the processor's internal time reference to acquire data generated by the satellite navigation module, inertial navigation module, and camera module, adding a timestamp based on the processor's internal clock source.

[0066] However, the applicant found that when using the above-mentioned methods for time synchronization, complex hardware synchronization circuits are required between the processor and each peripheral hardware module, and the hardware module itself needs to have a clock signal synchronization function. The hardware module is expensive and requires high design and development capabilities. Due to the transmission delay of data from each peripheral hardware module to the processor, the processing delay and scheduling delay within the processor, etc., the time synchronization accuracy is poor, resulting in high cost and complexity and low synchronization accuracy during the current time synchronization, which leads to poor time synchronization effect of visual measurement.

[0067] To address the aforementioned issues, in a first aspect, embodiments of the present application provide a time synchronization method for electronic devices, which may be servers, personal computers (PCs), tablet computers, smartphones, personal digital assistants (PDAs), and other electronic devices with logical computing capabilities. The electronic devices can be installed within a visual measurement system and communicate with peripheral hardware modules such as satellite navigation modules, inertial navigation modules, and camera modules, thereby performing low-cost and high-precision time synchronization processing on each module.

[0068] Optionally, see Figure 1 , Figure 1 This is a block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 may include a memory 111, a storage controller 112, a processor 113, a peripheral interface 114, an input and output unit 115, and a display unit 116. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the electronic device 100. For example, the electronic device 100 may further include Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0069] The aforementioned memory 111, storage controller 112, processor 113, peripheral interface 114, input / output unit 115, and display unit 116 are electrically connected to each other, directly or indirectly, to enable data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses or signal lines. The aforementioned processor 113 is used to execute the executable modules stored in the memory.

[0070] The memory 111 may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory 111 is used to store programs, and the processor 113 executes the programs after receiving an execution instruction. The method executed by the electronic device 100 defined by the process disclosed in any embodiment of the present application may be applied to the processor 113 or implemented by the processor 113.

[0071] The processor 113 may be an integrated circuit chip with signal processing capabilities. The processor 113 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or any conventional processor.

[0072] The peripheral interface 114 couples various input / output devices to the processor 113 and the memory 111. In some embodiments, the peripheral interface 114, the processor 113, and the memory controller 112 can be implemented in a single chip. In other embodiments, they can be implemented in separate chips.

[0073] The input / output unit 115 is used to provide input data to the user. The input / output unit 115 can be, but is not limited to, a mouse and a keyboard.

[0074] The above-mentioned display unit 116 provides an interactive interface (such as a user operation interface) between the electronic device 100 and the user or is used to display image data for the user's reference. In this embodiment, the display unit can be a liquid crystal display or a touch display. If it is a touch display, it can be a capacitive touch screen or a resistive touch screen that supports single-point and multi-touch operations. Supporting single-point and multi-touch operations means that the touch display can sense touch operations generated simultaneously at one or more positions on the touch display, and hand over the sensed touch operations to the processor for calculation and processing. In an embodiment of the present application, the display unit 116 can display the acquired time information and the received satellite data or sensor data.

[0075] The electronic device in this embodiment can be used to execute each step in each time synchronization method provided in the embodiment of the present application. The implementation process of the time synchronization method is described in detail below through several embodiments.

[0076] See also Figure 2 , Figure 2 A flowchart of a time synchronization method provided in an embodiment of the present application is provided. The method may include steps S200-S400.

[0077] Step S200: determining the internal time information of the processor according to the pulse signal of the satellite module and the world time information.

[0078] The satellite module may be a satellite navigation module, such as a GNSS (Global Navigation Satellite System) module. The satellite module has a satellite timing function and can output a stable hardware pulse signal, such as a PPS (Pulse Per Second Signal). The pulse signal has a high period stability, a small repetition error, and no cumulative error. Therefore, in order to improve the accuracy of time synchronization, the internal time information of the internal clock source of the corresponding processor can be determined based on the pulse signal of the satellite module and the world time information using the satellite module as the standard clock source, i.e., the UTC time information.

[0079] Optionally, the world instant information may be recorded as T-pps-utc, and the internal time information may be recorded as T-pps-raw.

[0080] Step S300: determining a time conversion relationship based on the internal time information and the world time information.

[0081] Wherein, since the processor's internal clock source timing mode can be different from the world clock source, and the internal clock source has slight error and cumulative error, the internal time information is different from the world time information. The corresponding calculation can be performed according to the two kinds of time information to determine the time conversion relationship of the two kinds of time information at the same time.

[0082] Step S400, based on the time conversion relationship, time synchronization is performed on the satellite module and the sensor module for measurement.

[0083] Wherein, the sensor module can include various types of modules with measurement function, such as IMU (inertial navigation) module and camera module, etc., and the time synchronization processing can be performed on the time of data acquisition of the satellite module and the sensor module or the time stamp of the acquired satellite data and sensor data according to the corresponding time conversion relationship of the two kinds of time information.

[0084] In Figure 1 In the embodiment shown, the additional and complex hardware circuit for time synchronization processing is not required, the cumulative error of the high-precision clock in the processor is effectively reduced, the processing delay time is reduced, the time synchronization precision is effectively improved, the time synchronization effect in the visual measurement system is improved, the data acquisition of each module is synchronized, and the effectiveness of the measurement data is improved.

[0085] Optionally, please refer to Figure 3 , Figure 3 A flowchart of step S300 is provided for the embodiment of the application, and the step S300 can include steps S310-S340.

[0086] Step S310, determining the first start time of the world time information and the external period.

[0087] Wherein, the first start time can be the information of the whole second moment of the rising edge of the pulse signal, and the external period can be the output period of the pulse signal, such as 1 second, etc.

[0088] Step S320, determining the second start time of the internal time information and the internal period.

[0089] Wherein, the second start time can be the time when the internal clock source of the processor, such as the software timer or the hardware timer, receives the pulse signal and starts timing, and the internal period can be the timing period of the processor. Since the internal clock source is different from the external clock source, the internal period corresponding to the external period of 1 second can be 0.8-1.2 seconds.

[0090] Step S330, determining the time difference scale between the world time information and the internal time information based on the first start time, the second start time, the external period and the internal period.

[0091] The time difference scale between the world time information and the internal time information can be determined according to the first start time, the second start time, and the corresponding external period and internal period.

[0092] Optionally, to improve the accuracy of the time difference scale, the processor can also multiply the pulse signal to 100Hz or other frequencies to use the signal as the external clock input or the trigger signal of data sampling of the sensing module. For example, when the external period is 1 second and the internal period is 1.2 seconds, the time difference scale is that the world time information is equivalent to 1.2 milliseconds of the internal time information per millisecond from the first start time and the second start time.

[0093] Step S340, determining the time conversion relationship between the world time information and the internal time information based on the time difference scale.

[0094] The time conversion relationship between the world time information and the internal time information can be calculated according to the time difference scale. The time conversion relationship can be, for example, world time information = 1.2*internal time information.

[0095] In Figure 3 In the embodiments, the corresponding conversion relationship can be calculated according to the actual situation of the two times, effectively improving the accuracy of the time conversion relationship, and thus improving the accuracy of the time synchronization processing.

[0096] Optionally, referring to Figure 4 , Figure 4 The first flowchart of step S400 provided by the embodiments of the present application can include steps S410-S430.

[0097] Step S410, determining the first acquisition frequency of the satellite module and the second acquisition frequency of the inertial module.

[0098] The sensing module can include an inertial module for inertial navigation, and the first acquisition frequency of the satellite module for collecting data and the second acquisition frequency of the inertial module for collecting data can be obtained, respectively. For example, the first acquisition frequency of the satellite module can be 10Hz of data sampling interval, and the second acquisition frequency of the inertial module can be 100Hz of data sampling interval.

[0099] Step S420, determining the first sampling time set of the internal time of the processor according to the first acquisition frequency; and converting the first sampling time set based on the time conversion relationship to obtain the second sampling time set of the world time.

[0100] Wherein, a plurality of corresponding first sampling times can be determined according to the first acquisition frequency, thereby determining a first sampling time set. For example, taking the time conversion relationship of world time information = 1.2 * internal time information as an example, the corresponding first sampling time set can be (unit: seconds): T-pps-raw+0.0, T-pps-raw+0.12, T-pps-raw+0.24, T-pps-raw+0.36, T-pps-raw+0.48, T-pps-raw+0.6, T-pps-raw+0.72, T-pps-raw+0.84, T-pps-raw+0.96, T-pps-raw+1.08, etc. Then, according to the time conversion relationship, the first sampling time set is converted into a second sampling time set of universal time. Correspondingly, the converted second sampling time set can be (unit: second): T-pps-utc+0.0, T-pps-utc+0.1, T-pps-utc+0.2, T-pps-utc+0.3, T-pps-utc+0.4, T-pps-utc+0.5, T-pps-utc+0.6, T-pps-utc+0.7, T-pps-utc+0.8, T-pps-utc+0.9, etc.

[0101] Step S430 : determining a third sampling time set of the processor's internal time according to the second acquisition frequency; and converting the third sampling time set based on a time conversion relationship to obtain a fourth sampling time set of the world time.

[0102] A plurality of corresponding third sampling times can be determined according to the second acquisition frequency, thereby determining a third sampling time set. For example, taking the time conversion relationship of world time information = 1.2 * internal time information as an example, the corresponding third sampling time set can be (unit: seconds): T-pps-raw+0.0, T-pps-raw+0.012, T-pps-raw+0.024, T-pps-raw+0.036, T-pps-raw+0.048, T-pps-raw+0.06, T-pps-raw+0.072, T-pps-raw+0.084, T-pps-raw+0.096, T-pps-raw+0.108, etc. Then, according to the time conversion relationship, the third sampling time set is converted into a fourth sampling time set of universal time. Correspondingly, the converted fourth sampling time set can be (unit: second): T-pps-utc+0.01, T-pps-utc+0.02, T-pps-utc+0.03, T-pps-utc+0.04, T-pps-utc+0.05, T-pps-utc+0.06, T-pps-utc+0.07, T-pps-utc+0.08, T-pps-utc+0.09, and so on.

[0103] It should be noted that the second sampling time set and the fourth sampling time set are aligned in time in the universal time.

[0104] exist Figure 4 In the illustrated embodiment, the sampling time is limited from the perspective of the processor to achieve time unification and alignment of satellite module data and inertial module data.

[0105] Optionally, see Figure 5 , Figure 5 This is a flow chart of the second step S400 provided in an embodiment of the present application. Step S400 may include steps S440-S460.

[0106] Step S440 , determining the first acquisition frequency of the satellite module, the third acquisition frequency of the camera module, and the exposure time.

[0107] The sensor module may also include a camera module for image acquisition. When time synchronization is performed between the satellite module and the camera module, a first acquisition frequency for data acquisition in the satellite module and a third acquisition frequency for data acquisition in the camera module may be determined. Furthermore, since the camera module has a certain exposure time during image acquisition, the corresponding exposure time may be obtained for time compensation.

[0108] For example, the first acquisition frequency of the satellite module may be a data sampling interval of 10 Hz, the second acquisition frequency of the inertial module may be a data sampling interval of 20 Hz, and the exposure time may be recorded as T-exposure.

[0109] It should be noted that the exposure time is obtained by obtaining historical exposure data from the camera module and analyzing the historical exposure data to determine the exposure time. Because the exposure time of the camera module is not stable, the historical exposure data can be weighted, averaged, and processed to determine a corresponding time value or time interval value as the exposure time for compensation. This effectively improves the accuracy of the exposure time and thus the precision of time synchronization between the camera module and the satellite module.

[0110] Step S450 : determining a first sampling time set of the processor's internal time according to the first acquisition frequency; and converting the first sampling time set based on a time conversion relationship to obtain a second sampling time set of the world time.

[0111] The first sampling time set can be determined by determining the corresponding multiple first sampling times according to the first acquisition frequency. The second sampling time set is determined in the same manner as Figure 4 The same as in , no further description is given.

[0112] Step S460: determining a fifth sampling time set of the processor's internal time when the camera module completes exposure based on the third acquisition frequency and the exposure time; converting the fifth sampling time set based on a time conversion relationship to obtain a sixth sampling time set of world time;

[0113] Multiple corresponding fifth sampling times can be determined based on the third acquisition frequency, thereby determining a fifth sampling time set. For example, taking the time conversion relationship of universal time information = 1.2 * internal time information as an example, due to the influence of exposure time T-exposure, the actual fifth sampling time set can be (in seconds): T-pps-raw + 0.06 - T-exposure, T-pps-raw + 0.12 - T-exposure, T-pps-raw + 0.18 - T-exposure, T-pps-raw + 0.24 - T-exposure, etc. Then, based on the time conversion relationship, T-exposure is deleted and the fifth sampling time set is converted to a sixth sampling time set of universal time. Correspondingly, the converted fourth sampling time set can be (in seconds): T-pps-utc + 0.05, T-pps-utc + 0.1, T-pps-utc + 0.15, T-pps-utc + 0.2, etc.

[0114] It should be noted that the second sampling time set and the sixth sampling time set are time-aligned in the universal time.

[0115] exist Figure 5 In the illustrated embodiment, exposure time can be compensated accordingly during processing to reduce the adverse effects of exposure time on time synchronization, thereby improving the effectiveness and accuracy of satellite data and image data collected by the satellite module and the camera module.

[0116] Optionally, see Figure 6 , Figure 6 This is a flowchart of the third step S400 provided in an embodiment of the present application. Step S400 may include steps S470-S480.

[0117] Step S470: determining a first internal time for the processor to acquire sensing data from the sensing module.

[0118] Among them, the present application also provides a method for setting a corresponding timestamp for the sensor data after the sensor module collects the data for time synchronization. The sensor module can perform periodic sampling according to its internal clock source, and the processor reads the sensor data output by the sensor module through the bus, such as inertial data, image data, etc. Before the data is output, the sensor module will notify the processor in the form of a GPIO interrupt that the sensor data is ready. After the processor captures the GPIO interrupt signal that the sensor data is ready, it assigns a first internal time of the processor to the ready sensor data. Taking the inertial module as an example, the first internal time can be recorded as T-imu-raw.

[0119] Step S480, based on the first internal time, the world time information, the internal time information and the time conversion relationship, determine the second world time of the sensor data; and use the second world time as the timestamp of the sensor data to synchronize the satellite module and the sensor module.

[0120] Among them, the corresponding second world time is obtained by calculation based on the first internal time, world time information, internal time information and time conversion relationship. Taking the inertial module as an example, the second world time can be recorded as T-imu-utc as the timestamp of the sensor data.

[0121] Alternatively, the calculation method can be: T-imu-utc = (T-imu-raw – T-pps-raw) / time scale + T-pps-utc, thereby obtaining the universal time corresponding to the inertial data, which can achieve time unification and alignment of satellite module data and inertial module data. The processor's internal high-precision clock can be used to timestamp the data read by the processor, then subtracted from the processor's internal timestamp corresponding to the PPS signal, and then converted to the corresponding universal time. This can eliminate the accumulated errors of the processor's internal high-precision clock, etc., and the calculation is convenient, the code complexity is low, and the functional design is reliable.

[0122] exist Figure 6 In the illustrated embodiment, time synchronization processing of the sensor data and the satellite data collected in the satellite module can be achieved from the timestamp of the sensor data, effectively reducing various delays in the processor processing and improving the accuracy of time synchronization.

[0123] Optionally, see Figure 7 , Figure 7 A flowchart of step S200 is provided in an embodiment of the present application. Step S200 may include steps S210-S230.

[0124] Step S210: Acquire the pulse signal of the satellite module.

[0125] The processor can communicate with the satellite module through a physical interface such as a serial port to obtain a pulse signal output from the satellite module.

[0126] Step S220: determining world time information based on the pulse signal.

[0127] The processor can capture the rising edge of the pulse signal (i.e., the information of the whole second) through the GPIO interrupt, thereby obtaining the world time information, which can be recorded as T-pps-utc.

[0128] Step S230 , adjusting the frequency of the internal clock source of the processor based on the world time information to obtain internal time information corresponding to the pulse signal.

[0129] The processor's internal clock source can be monotonic and stable over a short period of time, typically achieving a stability of 10 parts per million (PPM). During a GPIO interrupt, the processor's internal clock source can be used to synchronize the frequency of the received pulse signal's world time information. Optionally, the frequency adjustment can be done by multiplying or dividing the frequency. For example, based on the CLOCK_MONOTONIC_RAW time in the Linux system, the pulse signal is assigned the processor's internal time information, which can be recorded as T-pps-raw.

[0130] exist Figure 7 In the embodiment shown, the frequency of the processor's internal clock source can be multiplied or divided based on the world time information to obtain internal time information with higher precision corresponding to the pulse signal, thereby obtaining internal time information and world time information with a corresponding relationship, thereby improving the correlation between the two types of information.

[0131] See also Figure 8 , Figure 8 A schematic structural diagram of a time synchronization device provided in an embodiment of the present application, wherein the time synchronization device 500 may include a determination unit 510, a conversion unit 520, and a synchronization unit 530;

[0132] The determination unit 510 is used to determine the internal time information of the processor according to the pulse signal of the satellite module and the world time information;

[0133] The conversion unit 520 is used to determine a time conversion relationship based on the internal time information and the world time information;

[0134] The synchronization unit 530 is used to perform time synchronization on the satellite module and the sensor module used for measurement based on the time conversion relationship.

[0135] In an optional embodiment, the conversion unit 520 is specifically used to: determine a first start time and an external period of the world time information; determine a second start time and an internal period of the internal time information; determine a time difference scale between the world time information and the internal time information based on the first start time, the second start time, the external period and the internal period; determine a time conversion relationship between the world time information and the internal time information based on the time difference scale; wherein the external period is the output period of the pulse signal, and the internal period is the timing period of the processor.

[0136] In an optional embodiment, the sensing module includes an inertial module; the synchronization unit 530 may include an inertial synchronization subunit, which is used to determine a first acquisition frequency of the satellite module and a second acquisition frequency of the inertial module; based on the first acquisition frequency, a first sampling time set of the internal time of the processor is determined; based on the time conversion relationship, the first sampling time set is converted to obtain a second sampling time set of the world time; based on the second acquisition frequency, a third sampling time set of the internal time of the processor is determined; based on the time conversion relationship, the third sampling time set is converted to obtain a fourth sampling time set of the world time; wherein the second sampling time set and the fourth sampling time set are time-aligned in the world time.

[0137] In an optional embodiment, the sensing module includes a camera module; the synchronization unit 530 may include a camera synchronization subunit, which is used to determine a first acquisition frequency of the satellite module, a third acquisition frequency and an exposure time of the camera module; based on the first acquisition frequency, a first sampling time set of the internal time of the processor is determined; based on the time conversion relationship, the first sampling time set is converted to obtain a second sampling time set of the world time; based on the third acquisition frequency and the exposure time, a fifth sampling time set of the internal time of the processor when the camera module completes exposure is determined; based on the time conversion relationship, the fifth sampling time set is converted to obtain a sixth sampling time set of the world time; wherein the second sampling time set and the sixth sampling time set are time-aligned in the world time.

[0138] In an optional implementation, the time synchronization device may further include an analysis module for acquiring historical exposure data of the camera module; and performing analysis based on the historical exposure data to obtain the exposure time.

[0139] In an optional embodiment, the synchronization unit 530 may include a timestamp synchronization subunit, which is used to determine the first internal time when the processor obtains the sensor data of the sensor module; determine the second world time of the sensor data based on the first internal time, the world time information, the internal time information and the time conversion relationship; and use the second world time as the timestamp of the sensor data to synchronize the satellite module and the sensor module.

[0140] In an optional embodiment, the determination unit 510 is specifically used to: obtain a pulse signal from the satellite module; determine world time information based on the pulse signal; and adjust the frequency of the internal clock source of the processor based on the world time information to obtain internal time information corresponding to the pulse signal.

[0141] Since the principle of solving the problem by the time synchronization device 500 in the embodiment of the present application is similar to that of the embodiment of the aforementioned time synchronization method, the implementation of the time synchronization device 500 in this embodiment can refer to the description in the embodiment of the aforementioned time synchronization method, and the repeated parts will not be repeated.

[0142] An embodiment of the present application further provides a computer-readable storage medium, in which computer program instructions are stored. When the computer program instructions are read and executed by a processor, the steps of any one of the time synchronization methods provided in this embodiment are executed.

[0143] In the several embodiments provided in this application, it should be understood that the disclosed devices can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices according to the multiple embodiments of the present application. In this regard, each box in the block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram, and the combination of the block diagrams, can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0144] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0145] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0146] The foregoing is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined or explained in subsequent figures.

[0147] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.

[0148] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, the elements defined by the phrase "comprising..." do not exclude the presence of other identical elements in the process, method, article, or device comprising the elements.

Claims

1. A time synchronization method, characterized in that: The method comprises: Determine the internal time information of the processor based on the pulse signal of the satellite module and the world time information; Determining a time conversion relationship based on the internal time information and the world time information; Based on the time conversion relationship, time synchronization is performed on the satellite module and the sensor module used for measurement; Determining the time conversion relationship based on the internal time information and the world time information includes: determining a first start time and an external cycle of the world time information; determining a second start time and an internal cycle of the internal time information; determining a time difference scale between the world time information and the internal time information based on the first start time, the second start time, the external cycle, and the internal cycle; and determining the time conversion relationship between the world time information and the internal time information based on the time difference scale; wherein the external cycle is an output cycle of the pulse signal, and the internal cycle is a timing cycle of the processor; The sensing module includes an inertial module; and the time synchronization of the satellite module and the sensing module based on the time conversion relationship includes: determining a first acquisition frequency of the satellite module and a second acquisition frequency of the inertial module; determining a first sampling time set of the internal time of the processor based on the first acquisition frequency; converting the first sampling time set based on the time conversion relationship to obtain a second sampling time set of world time; determining a third sampling time set of the internal time of the processor based on the second acquisition frequency; and converting the third sampling time set based on the time conversion relationship to obtain a fourth sampling time set of world time; wherein the second sampling time set and the fourth sampling time set are time-aligned in the world time; The sensing module includes a camera module; the satellite module and the sensing module are time synchronized based on the time conversion relationship, including: determining a first acquisition frequency of the satellite module, a third acquisition frequency and an exposure time of the camera module; determining a first sampling time set of the internal time of the processor based on the first acquisition frequency; converting the first sampling time set based on the time conversion relationship to obtain a second sampling time set of world time; determining a fifth sampling time set of the internal time of the processor when the camera module completes exposure based on the third acquisition frequency and the exposure time; converting the fifth sampling time set based on the time conversion relationship to obtain a sixth sampling time set of world time; wherein the second sampling time set and the sixth sampling time set are time-aligned in the world time.

2. The method according to claim 1, characterized in that: in, The exposure time is obtained by: Acquiring historical exposure data of the camera module; The exposure time is obtained by analyzing the historical exposure data.

3. The method according to claim 1, characterized in that The step of performing time synchronization on the satellite module and the sensor module based on the time conversion relationship includes: determining a first internal time for the processor to acquire sensing data of the sensing module; Based on the first internal time, the world time information, the internal time information and the time conversion relationship, a second world time of the sensing data is determined; and the second world time is used as the timestamp of the sensing data to synchronize the satellite module and the sensor module.

4. The method according to claim 1, wherein Determining the internal time information of the processor according to the pulse signal of the satellite module and the world time information includes: Acquiring the pulse signal of the satellite module; determining the world time information based on the pulse signal; The frequency of the internal clock source of the processor is adjusted based on the world time information to obtain the internal time information corresponding to the pulse signal.

5. A time synchronization device, characterized in that: The device comprises: a determination unit, a conversion unit and a synchronization unit; The determination unit is used to determine the internal time information of the processor according to the pulse signal of the satellite module and the world time information; The conversion unit is used to determine a time conversion relationship based on the internal time information and the world time information; The synchronization unit is used to perform time synchronization on the satellite module and the sensor module used for measurement based on the time conversion relationship; The conversion unit is specifically configured to: determine a first start time and an external cycle of the world time information; determine a second start time and an internal cycle of the internal time information; determine a time difference scale between the world time information and the internal time information based on the first start time, the second start time, the external cycle, and the internal cycle; and determine the time conversion relationship between the world time information and the internal time information based on the time difference scale; wherein the external cycle is an output cycle of the pulse signal, and the internal cycle is a timing cycle of the processor; The sensing module includes an inertial module; the synchronization unit includes an inertial synchronization subunit, configured to determine a first acquisition frequency of the satellite module and a second acquisition frequency of the inertial module; determine a first sampling time set of the internal time of the processor based on the first acquisition frequency; convert the first sampling time set based on the time conversion relationship to obtain a second sampling time set of world time; determine a third sampling time set of the internal time of the processor based on the second acquisition frequency; convert the third sampling time set based on the time conversion relationship to obtain a fourth sampling time set of world time; wherein the second sampling time set and the fourth sampling time set are time-aligned in the world time; The sensing module includes a camera module; the synchronization unit includes a camera synchronization subunit, which is used to determine the first acquisition frequency of the satellite module, the third acquisition frequency of the camera module, and the exposure time; determine a first sampling time set of the internal time of the processor based on the first acquisition frequency; convert the first sampling time set based on the time conversion relationship to obtain a second sampling time set of world time; determine a fifth sampling time set of the internal time of the processor when the camera module completes exposure based on the third acquisition frequency and the exposure time; convert the fifth sampling time set based on the time conversion relationship to obtain a sixth sampling time set of world time; wherein the second sampling time set and the sixth sampling time set are time-aligned in the world time.

6. An electronic device, characterized in that: The electronic device includes a memory and a processor, wherein program instructions are stored in the memory, and when the processor runs the program instructions, the steps of the method according to any one of claims 1 to 4 are executed.

7. A computer-readable storage medium, characterized in that: The readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 4 are executed.

Citation Information

Patent Citations

  • Multi-sensor time synchronization method and device

    CN112945228A

  • Robot real-time positioning and color map fusion mapping method based on multiple sensors

    CN115526914A