Time Synchronization Method for GNSS and IMU

By obtaining the signals of the navigation module and sensor units, calculating the time interval to dynamically correct the time synchronization algorithm, the problems of low time synchronization accuracy and low adaptability between GNSS and IMU are solved, and higher navigation accuracy is achieved.

CN119011108BActive Publication Date: 2025-06-17HUNAN QIANXING TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411103591.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2025-06-17
Estimated Expiration
2044-08-12

AI Technical Summary

Technical Problem

The prior art has problems of low accuracy, low system adaptability and robustness in time synchronization between GNSS and IMU, especially in the case where the IMU lacks a pulse signal interface.

Method used

By obtaining the pulse signal of the navigation module and the functional synchronization signal of the sensor unit, the first time and count value of the positioning data are determined, the time interval is calculated to dynamically correct the time synchronization algorithm, and the accuracy of time synchronization and the adaptability and robustness of the system are improved.

Benefits of technology

It improves the time synchronization accuracy between GNSS and IMU, enhances the adaptability and robustness of the system, and ensures the improvement of navigation accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119011108B_ABST
    Figure CN119011108B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses a time synchronization method for GNSS and IMU, which includes obtaining a pulse signal corresponding to a navigation module and a function synchronization signal corresponding to a sensor unit; determining a first time corresponding to positioning data according to the pulse signal; respectively determining a first count value and a second count value corresponding to each according to the pulse signal and the function synchronization signal; obtaining a first time interval according to the first count value; obtaining a second time interval according to the first count value and the second count value; obtaining a third time interval according to the second count value; determining a second time according to the first time, the first time interval, the second time interval, and the third time interval; and synchronizing the time of inertial measurement data according to the second time. Thus, a dynamic correction algorithm is determined through the pulse signal and the function synchronization information to improve the accuracy of time synchronization and the adaptability and robustness of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data synchronization, and in particular to a time synchronization method for GNSS and IMU. Background Art

[0002] In a combined navigation system, GNSS (Global Navigation Satellite System) and INS (Inertial Navigation System), as core subsystems, operate independently and often have different time bases. This difference is particularly significant during the data fusion process. Without time synchronization, it will directly lead to a decrease in navigation accuracy. Traditionally, the PPS (Pulse Per Second) signal output by a GNSS receiver is connected to an IMU (Inertial Measurement Unit) to achieve time synchronization at the hardware level. Generally, through the PPS signal output by the GNSS receiver, it is connected into the IMU, and the IMU uses this pulse signal as the synchronization trigger reference for data output, thereby achieving time synchronization between GNSS and IMU. However, some IMUs do not provide an interface to support pulse signal input, resulting in the inability to achieve time synchronization between GNSS and IMU. Existing technologies use methods such as pulse signal subdivision time marking or based on an FPGA (Field-Programmable Gate Array) clock module, which can solve the time synchronization problem to a certain extent, but there are still problems such as low accuracy of time synchronization, and low adaptability and robustness of the system. Summary of the Invention

[0003] In view of this, an embodiment of the present invention provides a time synchronization method for GNSS and IMU, which can improve the accuracy of time synchronization and the adaptability and robustness of the system.

[0004] In a first aspect, an embodiment of the present invention provides a time synchronization method, the method comprising:

[0005] Obtain a pulse signal corresponding to a navigation module and a function synchronization signal corresponding to a sensor unit;

[0006] Determine a first time corresponding to positioning data according to the pulse signal;

[0007] Determine a first count value and a second count value corresponding to each according to the pulse signal and the function synchronization signal respectively;

[0008] Obtain a first time interval according to the first count value;

[0009] Obtain a second time interval according to the first count value and the second count value;

[0010] Obtain a third time interval according to the second count value;

[0011] Determine a second time according to the first time, the first time interval, the second time interval, and the third time interval;

[0012] Synchronize the time of the inertial measurement data according to the second time.

[0013] In a second aspect, an embodiment of the present invention provides a time synchronization device, and the device includes:

[0014] A signal acquisition module, configured to acquire a pulse signal corresponding to a navigation module and a function synchronization signal corresponding to a sensor unit;

[0015] A first time acquisition module, configured to determine a first time corresponding to positioning data according to the pulse signal;

[0016] A count value determination module, configured to respectively determine a first count value and a second count value corresponding to each according to the pulse signal and the function synchronization signal;

[0017] A first time interval acquisition module, configured to acquire a first time interval according to the first count value;

[0018] A second time interval acquisition module, configured to acquire a second time interval according to the first count value and the second count value;

[0019] A third time interval acquisition module, configured to acquire a third time interval according to the second count value;

[0020] A second time acquisition and determination module, configured to determine a second time according to the first time, the first time interval, the second time interval, and the third time interval;

[0021] A synchronization module, configured to synchronize the time of the inertial measurement data according to the second time.

[0022] The technical solution of the embodiment of the present invention obtains a pulse signal corresponding to a navigation module and a function synchronization signal corresponding to a sensor unit; determines a first time corresponding to positioning data according to the pulse signal; determines a first count value and a second count value corresponding to each of them according to the pulse signal and the function synchronization signal; obtains a first time interval according to the first count value; obtains a second time interval according to the first count value and the second count value; obtains a third time interval according to the second count value; determines a second time according to the first time, the first time interval, the second time interval, and the third time interval; and synchronizes the time of inertial measurement data according to the second time. Thus, a dynamic correction algorithm is determined through the pulse signal and the function synchronization information to improve the accuracy of time synchronization and the adaptability and robustness of the system. Description of the Drawings

[0023] Through the following description of the embodiments of the present invention with reference to the drawings, the above and other objects, features, and advantages of the present invention will become clearer. In the drawings:

[0024] Figure 1 is a schematic diagram of a GNSS and IMU time synchronization system according to an embodiment of the present invention;

[0025] Figure 2 is a flowchart of a GNSS and IMU time synchronization method according to an embodiment of the present invention;

[0026] Figure 3 is a flowchart of obtaining a first time according to an embodiment of the present invention;

[0027] Figure 4 is a schematic diagram of the change of the second time interval with time according to an embodiment of the present invention;

[0028] Figure 5 is a flowchart of obtaining a second time according to an embodiment of the present invention;

[0029] Figure 6 is a schematic diagram of dynamic correction algorithm variables according to an embodiment of the present invention;

[0030] Figure 7 is a flowchart of another GNSS and IMU time synchronization method according to an embodiment of the present invention;

[0031] Figure 8 is a schematic diagram of a GNSS and IMU time synchronization device according to an embodiment of the present invention;

[0032] Figure 9 is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Embodiments

[0033] The present application will be described based on embodiments, but the present application is not limited to these embodiments. In the following detailed description of the present application, some specific details are described in detail. Those skilled in the art can fully understand the present application without the description of these details. In order to avoid obscuring the essence of the present application, well-known methods, processes, procedures, components and circuits are not described in detail.

[0034] In addition, those of ordinary skill in the art should understand that the accompanying drawings provided herein are for illustrative purposes only and are not necessarily drawn to scale.

[0035] Unless the context clearly requires otherwise, words such as "including" and "comprising" in the entire application document should be construed in an inclusive sense rather than an exclusive or exhaustive sense; that is, it is the meaning of "including but not limited to".

[0036] In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be construed as indicating or implying relative importance. In addition, in the description of the present application, unless otherwise specified, the meaning of "plurality" is two or more.

[0037] GNSS (Global Navigation Satellite System) is a space-based radio navigation and positioning system that can provide users with all-weather three-dimensional coordinates, speed, and time information at any location on the Earth's surface or in near-Earth space. GNSS satellites operate in space orbits and continuously transmit navigation signals containing information such as satellite position, speed, and time to the ground. A GPS receiver receives navigation signals from multiple satellites. A GPS (Global Positioning System) receiver processes the received signals, determines the distance differences between the satellites and the user equipment by calculation, and uses the geometric relationships of multiple satellites to determine the position, speed, and time information of the user equipment.

[0038] INS (Inertial Navigation System) is a system that uses the measurement data of an IMU (Inertial Measurement Unit) for navigation. Specifically, INS uses the acceleration and angular velocity information measured by the IMU to calculate the position, velocity, and direction of an object. An IMU is a device that measures the three-axis attitude angle or angular rate of an object, as well as its acceleration. It typically includes three single-axis accelerometers and three single-axis gyroscopes, which are used to measure the angular velocity and acceleration of an object in three-dimensional space. The accelerometers in the IMU detect the acceleration signals of the object along the three independent axes of the carrier coordinate system, while the gyroscopes detect the angular velocity signals of the carrier relative to the navigation coordinate system. By measuring these signals, information such as the attitude, velocity, and position of the object can be calculated.

[0039] Figure 1 is a schematic diagram of the time synchronization system of GNSS and IMU according to an embodiment of the present invention. In Figure 1 the illustrated embodiment, the time synchronization system of GNSS and IMU includes three levels: a hardware platform layer, a system layer, and an application layer. The hardware platform includes all physical devices and interfaces, providing the necessary physical support and data sources for the system layer and the application layer. The system layer, as a bridge between the hardware platform and the application layer, includes a series of services and drivers for managing hardware resources, providing interfaces for upper-layer applications, processing data from the hardware platform, and providing standardized interfaces to the upper layer. The application layer needs to use the services provided by the system layer and the data collected by the hardware platform to perform complex calculations or logical processing.

[0040] Specifically, the hardware platform layer includes a navigation module 11 and a sensor unit 12. The navigation module is equivalent to a GNSS receiver and is used to output positioning data and pulse signals. The positioning data is GNSS data, and the pulse signal is a PPS (Pulse Per Second) signal. The sensor unit is equivalent to an IMU and is used to output inertial measurement data and a function synchronization signal. The inertial measurement data is IMU data, and the function synchronization signal is an IMU_SYNC signal.

[0041] The system layer includes a serial port driver module 22, a GPIO (General Purpose Input / Output) interrupt service module 23, and a hardware timer module 24. Among them, the serial port driver module is used to create two threads respectively for obtaining and parsing positioning data and inertial measurement data. The GPIO interrupt service module is used to register a first interrupt callback and a second interrupt callback. The hardware timer module is used to count in the first interrupt callback and the second interrupt callback to determine the time intervals between pulse signals, between pulse signals and function synchronization signals. That is, at the system level, the serial port driver supports the input of serial port data of the navigation module and the sensor unit, and uses two GPIO ports to receive pulse signals and function synchronization signals respectively to trigger interrupts and transmit them to the application layer, and uses the timer timing as the time measurement scale.

[0042] The application layer includes a data acquisition and parsing module 31, an interrupt callback module 32, a dynamic correction time synchronization algorithm module 33, a GNSS time maintenance module 34, and a start timer and timing module 35. Among them, the data acquisition and parsing module is used to receive and parse positioning data, pulse signals, inertial measurement data, and function synchronization signals obtained from the serial port driver module of the system layer. The GNSS time maintenance module is used to parse the time from the thread bound to the navigation module to obtain the initialization time, and update the initialization time after receiving the first interrupt callback. The start timer and timing module is used to control the timer to start and count at the first interrupt callback and the second interrupt callback. The interrupt callback module is used to open and close the first interrupt callback and the second interrupt callback. The dynamic correction time synchronization algorithm module is used to obtain a first count value and a second count value, and determine a second time according to the first time, the first count value, and the second count value, and mark the second time for each frame of inertial measurement data according to the second time to achieve the time synchronization of the inertial measurement data.

[0043] Among them, the system can also use the system timer instead of the hardware timer to obtain the first count value of the pulse signal and the second count value of the function synchronization signal. In this embodiment, using the hardware counter for counting has higher accuracy to improve the accuracy of time synchronization.

[0044] In an embodiment of the present invention, a pulse signal corresponding to a navigation module and a function synchronization signal corresponding to a sensor unit are obtained; a first time corresponding to positioning data is determined according to the pulse signal; a first count value and a second count value corresponding to each of them are determined according to the pulse signal and the function synchronization signal respectively; a first time interval is obtained according to the first count value; a second time interval is obtained according to the first count value and the second count value; a third time interval is obtained according to the second count value; a second time is determined according to the first time, the first time interval, the second time interval, and the third time interval; and the time of inertial measurement data is synchronized according to the second time. Thus, a dynamic correction algorithm is determined through the pulse signal and the function synchronization information to improve the accuracy of time synchronization and the adaptability and robustness of the system.

[0045] Figure 2 It is a flowchart of a time synchronization method for GNSS and IMU according to an embodiment of the present invention. Figure 2 The time synchronization method for GNSS and IMU shown specifically includes the following steps:

[0046] Step S101, create a thread and start the program.

[0047] Specifically, the application layer creates a first thread and a second thread through the serial port driver module of the system layer and starts the program. The first thread is used to obtain positioning data corresponding to the navigation module, and the second thread is used to obtain inertial measurement data corresponding to the sensor unit.

[0048] Step S102, open each sub-function module for time synchronization.

[0049] Specifically, the sub-function modules include a navigation module, a sensor unit, a serial port driver module, a GPIO interrupt service module, a hardware timer module, a data acquisition and parsing module, an interrupt callback module, a dynamic correction time synchronization algorithm module, a GNSS time maintenance module, and a start timer and timing module. In response to the program start, a first interrupt is registered and a first interrupt callback is opened, a second interrupt is registered, a timer is started for counting, an initialization time is obtained based on the first thread, the first interrupt callback is configured to be triggered and executed at the rising edge of the pulse signal, and the second interrupt callback is configured to be opened during the execution of the first interrupt callback.

[0050] Specifically, when the application layer program starts, it loads the components and configuration files of the application layer. Meanwhile, during the program startup process, hardware resources such as serial ports, GPIO pins, and timers are initialized and configured into appropriate modes. An interrupt callback function is registered for the pulse signal interrupt through the interrupt callback module. When the rising edge of the pulse signal is detected, this callback function will be automatically executed. Meanwhile, an interrupt callback function is registered for the function synchronization signal interrupt in the first interrupt callback function. When the first interrupt callback is executed, the second interrupt callback is enabled, and the second interrupt callback is disabled when the nearest function synchronization signal after the pulse signal is obtained.

[0051] Meanwhile, the timer in the system layer is started, so that the timer starts timing from when the rising edge of the pulse signal is detected. In the first thread, the program continuously reads data from the serial port of the GNSS receiver, and parses these data to obtain time information, parses out the valid time information from the GNSS data, and saves this information as the initialization time, that is, saves the initialization in the form of weeks and seconds respectively.

[0052] Among them, the interrupt callback is two concepts, interrupt and callback. An interrupt means that during the execution of a program by a computer, due to the occurrence of a certain special situation, the CPU (Central Processing Unit) pauses the currently executing program and turns to execute a program for handling this special situation. After the processing is completed, it returns to the original program and continues to execute. A callback is a programming pattern that allows a function to be passed as a parameter to another function and be executed by this function at a certain specific moment or condition.

[0053] During program initialization or a certain specific stage, the callback function required for interrupt handling is registered with the interrupt handling system. This callback function usually contains the specific logic for handling interrupt events. When an external device or an internal condition of the program triggers an interrupt, the CPU will pause the currently executing program and jump to the entry point of the interrupt handler. The interrupt handler will check the type and number of the interrupt to determine which interrupt source triggered the interrupt. Then, it will call the corresponding callback function according to the registered information to handle the interrupt event. In the interrupt handler, the specific processing logic of the interrupt event is executed by calling the callback function. The callback function can access interrupt-related data, perform necessary operations, and may update the system state. After the callback function is executed, the interrupt handler will complete some cleanup work and return to the interrupted program to continue execution. Interrupt callbacks are used to handle various hardware events to ensure that the system can respond to requests from external devices in a timely manner.

[0054] Step S103: Determine whether the first interrupt callback is received.

[0055] Specifically, the rising edge of the pulse signal is used to trigger the execution of the first interrupt callback. That is, the pulse signal corresponding to the navigation module is obtained through the GPIO interface, and when the rising edge of the pulse signal is detected, the execution of the first interrupt callback is triggered.

[0056] If the first interrupt callback is received, step S104 is executed. If the first interrupt callback is not received, step S103 is executed again to determine whether it is received now.

[0057] Step S104: Obtain the first time and the first time interval, and enable the second interrupt callback.

[0058] In response to the execution of the first interrupt callback, obtain the first time and the first time interval, and enable the second interrupt callback.

[0059] Among them, during the execution of the first interrupt callback, the first count value of the pulse signal is read through the timer, the initialization time is updated to obtain the first time, and the second interrupt callback is enabled to obtain the second count value of the timer of the function synchronization signal closest to the pulse signal, and the first time interval is obtained according to the first count value. The process of obtaining the first time can be as Figure 3 shown, specifically including the following steps:

[0060] Step S201: The program starts.

[0061] Among them, the specific implementation method of step S210 can refer to the above step S101, and the embodiments of the present invention will not be elaborated here.

[0062] Step S202: Read the GNSS receiver serial port data.

[0063] Specifically, the serial port driver module at the system layer obtains the serial port data of the navigation module through the first thread. The navigation module is a GNSS receiver, and the serial port data is positioning data.

[0064] Step S203: Parse out the positioning data time, and initialize the positioning data time to obtain the initialization time.

[0065] Specifically, the data acquisition and parsing module at the application layer obtains the positioning data and the pulse signal sent by the serial port driver module at the system layer, obtains the positioning data time by parsing the positioning data and the pulse signal, and initializes the positioning data time to obtain the initialization time.

[0066] Step S204: Determine whether the first interrupt callback is received.

[0067] Specifically, a pulse signal is received through the GPIO interface. When the rising edge of the pulse signal is detected, a first interrupt is triggered, and then a first interrupt callback is executed. If the rising edge of the pulse signal is not detected, step S220 is executed to read the pulse signal again until the rising edge of the first pulse signal is detected. If the rising edge of the pulse signal is detected, step S250 is executed.

[0068] Step S205: Update the initialization time in the first interrupt callback.

[0069] Specifically, in response to the execution of the first interrupt callback, the first second-level time of the initialization time is incremented by 1. If the value of the first second-level time is greater than the maximum second value within the first week-level time, the first second-level time is set to 0, and the first week-level time is incremented by 1 to update the initialization time, thereby obtaining the first time.

[0070] That is, the initialization time is obtained based on the first thread. In response to the execution of the first interrupt callback, the first count value of the pulse signal at the time of the first interrupt callback execution is obtained, and the initialization time is updated to obtain the first time. That is, the time is parsed from the first thread to initialize the time, and the initialization time is saved in variables the first week-level time and the first second-level time in the week-second manner. In the first interrupt callback, the initialization time is updated to obtain the first time. Specifically, first, the first second-level time is incremented by 1. If the first second-level time is greater than the second value within the week, the first second-level time is set to 0, and the first week-level time is incremented by 1. Due to the existence of serial port transmission delay, the time synchronization of positioning data will be inconsistent. Therefore, to ensure the real-time nature of the positioning data time, the positioning data time is maintained in the pulse signal acquisition service.

[0071] Among them, the calculation formula for the first time interval is:

[0072]

[0073] Among them, when pps_in = last c1 - current c1 , pps_in is the first time interval between every two pulse signals, last c1 is the first count value at the previous pulse signal interrupt callback, and current c1 is the first count value at the current pulse signal interrupt callback. When pps_in = 2 32 - current c1 + last c1 , pps_in is the first time interval between two pulse signals when the count value of the timer is decremented to zero and then set to the maximum value 2 32 ; 2 32 is the maximum timer count value, and lastc1 is the first count value of the pulse signal when the timer count value is set to the maximum value 2 32 and current c1 is the first count value of the pulse signal when the timer count value decreases to zero.

[0074] Specifically, in response to the current pulse signal being the first pulse signal, the first time interval pps_in is a preset value. Among them, the preset value can be 66000000.

[0075] In response to the general situation, the value of the first time interval pps_in is the first count value of the previous pulse signal minus the first count value of the current pulse signal. The general situation is that the current interrupt callback is not the interrupt callback of the first pulse signal, and at the same time it is not the situation when the count value of the timer decreases to zero and then is set to the maximum value.

[0076] In response to the count value of the timer decreasing to zero and then being set to the maximum value, the value of the first time interval pps_in is the maximum value of the timer count minus the first count value of the pulse signal when the timer count value decreases to zero, plus the first count value of the pulse signal when the timer count value is set to the maximum value.

[0077] Among them, the timer is a periodic timer, and the count value is stored in a register. Its value is a 32-bit unsigned integer value, and the maximum value is 2 32 , and it decrements periodically until it reaches 0 and then returns to the maximum value 2 32 . The larger the timer crystal oscillator frequency, the smaller the timing time granularity, and it can be known that the higher the timing resolution. For example, using a 66MHz timing crystal oscillator frequency, that is, a timing decrement is performed every 1 / 66M seconds, and the timing accuracy can reach the nanosecond level. Therefore, using it to measure the time length will be much better than using the system time accuracy. In the upper-layer application program, by directly reading the count value and dividing the difference between the two consecutive count values by the time period, the time difference length can be obtained. For example, to measure the interval time length between two adjacent pulse signals, only need to read the count value when each pulse signal arrives, subtract it from the count value saved last time, and finally divide by 66M to get the pulse time difference with extremely high resolution, that is, the first time interval.

[0078] Among them, the calculation formula for the second time interval is:

[0079] Step S105, determine whether a second interrupt callback is received.

[0080] Specifically, the function synchronization signal corresponding to the sensor unit can be obtained through the GPIO interface. When the nearest function synchronization signal after detecting the pulse signal is detected, the second interrupt is triggered, and then the second interrupt callback is executed.

[0081] If a second interrupt callback is received, step S106 is executed. If the second interrupt callback is not received, step S105 is executed again to determine whether it is received now.

[0082] Step S106: Turn off the second interrupt callback, update the second time interval and the third time interval to obtain the second time.

[0083] Specifically, in response to receiving the second interrupt callback, that is, the nearest function synchronization signal after detecting the pulse signal, trigger the second interrupt callback to read the current count value of the timer and turn off the second interrupt callback. Obtain the second time interval according to the first count value of different pulse signals and the second count value of the nearest function synchronization signal after the pulse signal, that is, the time interval between the pulse signal and the nearest function synchronization signal after the pulse signal. Then obtain the third time interval according to the time interval between different pulse signals and the nearest function synchronization signal after the pulse signal, that is, the time interval between two second time intervals. Finally, obtain the second time according to the obtained first time, first time interval, second time interval and third time interval.

[0084] Among them, the calculation formula for the second time interval is:

[0085]

[0086] Among them, when ΔT1 = pps c2 - current c2 ΔT1 is the second time interval when the second time interval rolls back. pps c2 is the first count value at the nearest pulse signal interrupt callback when the second time interval rolls back. current c2 is the first count value at the nearest function synchronization signal interrupt callback to the pulse signal. When ΔT1 = (1 - ratio) * ΔT1 last + ratio * ΔT1 ′ ΔT1 is the adjusted second time interval. ΔT1 ′ is the difference between the count value at the current pulse signal interrupt callback and the count value at the nearest function synchronization signal interrupt callback after the pulse signal. ΔT1 last is the second time interval of the previous pulse signal. ratio is the proportionality coefficient.

[0087] Among them, the proportionality coefficient is obtained through the following formula:

[0088]

[0089] ΔT1 diff = ΔT1 last - ΔT1

[0090] where ratio is the proportionality coefficient for adjusting the second time interval data of the anomaly, ΔT1 diff is the difference between the second time interval in the previous normal case and the value when the second time interval rolls back, and the ΔT1 last is the second time interval of the previous pulse signal, ΔT1 is the value when the second time interval rolls back, and Scal factor is a preset parameter, abs is the absolute value calculation symbol, and the value of the proportionality coefficient is between 0 and 1.

[0091] Specifically, set the initial value of the second time interval ΔT1 to 0.

[0092] In response to the rollback of the second time interval, the value of the second time interval ΔT1 is the first count value of the pulse signal closest to the time when the second time interval rolls back minus the second count value of the function synchronization signal closest to the pulse signal.

[0093] In response to the normal case, the second time interval ΔT1 is adjusted by the proportionality coefficient. The adjusted value of the second time interval is 1 minus the value of the proportionality coefficient multiplied by the value of the previous second time interval, plus the proportionality coefficient multiplied by the value of the second time interval between the current pulse signal and the nearest function synchronization signal after this pulse signal. Among them, the normal case is except for the initial value and the case when the second time interval rolls back. Figure 4 is a schematic diagram of the change of the second time interval of the embodiment of the present invention over time. As Figure 4 shown, the initial time interval is the time interval when there is no time interval between the pulse signal and the function synchronization signal, that is, the initial second time interval is 0. The normal case 41 is the second time interval between the initial time interval and the rollback 42 of the second time interval or the second time interval between two rollbacks 42 of the second time interval. Among them, when the second time interval rolls back, it will be a very small count value, and the minimum count value will not be 0.

[0094] Among them, calculating the time interval between the pulse signal and the nearest function synchronization signal to the pulse signal is to subtract the count value when the nearest function synchronization signal to the pulse signal interrupts and returns from the count value when the pulse signal interrupts and returns. However, due to problems such as timer overflow or wrap-around, and interrupt processing delay, the count value may roll back. Therefore, the proportionality coefficient is used to continuously adjust the count value to obtain the second time interval in the normal case.

[0095] Among them, the calculation formula for the third time interval is:

[0096]

[0097] Wherein, when ΔT1_in = last c3 - current c3 , the T1_in is the third time interval between every two function synchronization signals under normal circumstances, and the last c3 is the third function count value when the previous function synchronization signal interrupts and calls back, and current c3 is the fourth function count value when the current function synchronization signal interrupts and calls back. When ΔT1_in = 2 32 - current c3 + last c3 , ΔT1_in is the first time interval between the current two pulse signals when the timer count value decreases to zero and then is set to the maximum value 2 32 , 2 32 is the maximum value of the timer count, and last c3 is the second count value when the function synchronization signal interrupts and calls back when the timer count value is set to the maximum value 2 32 , and current c3 is the second count value when the function synchronization signal interrupts and calls back when the timer count value decreases to zero.

[0098] Specifically, in response to the current function synchronization signal being the first function synchronization signal, the third time interval is a preset value, and the preset value can be 66000000.

[0099] In response to normal circumstances, the value of the third time interval is the second count value of the previous function synchronization signal minus the second count value of the current function synchronization signal. The normal circumstances mean that the current function synchronization signal is not the first function synchronization signal, and the timer is in the normal decreasing timing process without the situation of decreasing to zero and then being set to the maximum value.

[0100] In response to the timer count value decreasing to zero and then being set to the maximum value, the value of the third time interval is the maximum value of the timer count minus the second count value of the function synchronization signal when the timer count value decreases to zero, and then plus the second count value of the function synchronization signal when the timer count value is set to the maximum value 2 32 .

[0101] Determine the second time according to the first time, the first time interval, the second time interval, and the third time interval.

[0102] Specifically, obtain the first synchronization ratio according to the ratio between the second time interval and the first time interval, obtain the second synchronization ratio according to the ratio between the third time interval and the first time interval, and obtain the second time according to the first time, the first synchronization ratio, and the second synchronization ratio. The second time includes the second - level data of St and the second - level - week data is W t . The process of obtaining the second time can be as follows Figure 5 shown, specifically including the following steps:

[0103] Step S301: Obtain a first synchronization ratio according to the first time interval and the second time interval, and the first synchronization ratio is obtained through the following formula:

[0104]

[0105] where f1 is the time synchronization ratio value of the second time interval, ΔT1 is the second time interval, and pps_in is the first time interval.

[0106] Step S302: Obtain a second synchronization ratio according to the third time interval and the first time interval, and the second synchronization ratio is obtained through the following formula:

[0107]

[0108] where f2 is the time synchronization ratio value of the pulse signal and the function synchronization signal, ΔT1_in is the third time interval, and pps_in is the first time interval.

[0109] Step S303: Obtain the second time according to the first synchronization ratio, the second synchronization ratio, and the first time.

[0110] The second time includes second - second - level data and second - week - level data, and the second time is obtained through the following formula:

[0111] S t = S p + f1 + f2 * T imu * CNT imu

[0112] W t = W p

[0113] where S t is the second - second - level data of the second time, W t is the second - week - level data of the second time, W p is the first - week - level data of the first time of the pulse signal, S p is the first - second - level data of the first time of the pulse signal, f1 is the first synchronization ratio value of the second time interval, f2 is the second synchronization ratio value of the pulse signal and the function synchronization signal, T imu is the output period of the inertial measurement data, CNT imu is the reference count of the inertial measurement data, and the reference count is an increasing value.

[0114] Among them, the T imu can be obtained according to the sampling rate or output period of the sensor clearly listed in the specification of the IMU hardware. For example, if the specification indicates that the sampling rate of the IMU is 100 Hz, then T imu is 1 / 100 second, that is, 0.01 second. The CNT imu When the program starts to process IMU data, CNT imu can be initialized to 0. When reading or processing a new inertial measurement data point, CNT imu increases, that is, the CNT imu is used to track the number of inertial measurement data.

[0115] Figure 6 is a schematic diagram of the dynamic correction algorithm variables of the embodiments of the present invention. As Figure 6 shown, the pulse signals include PPS0, PPS1, PPS2, and PPSn. Functional synchronization signals IMU_SYNC0, IMU_SYNC1, IMU_SYNC2, and IMU_SYNC n are defined between every two pulse signals. Among them, the time interval between PPS0 and PPS1 is the first time interval pps_in; the time intervals between each pulse signal and the functional synchronization signals IMU_SYNC0, IMU_SYNC1, IMU_SYNC2, and IMU_SYNC n are ΔT1, ΔT2, ΔT3...ΔTn+1; the time interval between the second time intervals corresponding to two adjacent pulse signals is the third time interval ΔT1_in.

[0116] For example, the time interval between PPS0 and PPS1 is the first time interval pps_in, the time interval between PPS0 and IMU_SYNC0 is ΔT1, the time interval between PPS0 and IMU_SYNC1 is ΔT2, the time interval between PPS0 and IMU_SYNC n is ΔTN+1, the time interval between PPS1 and IMU_SYNC0' is ΔT1', the time interval between PPS1 and IMU_SYNC1' is ΔT2', and the time interval between PPS1 and IMU_SYNC n' is ΔTN+1'. The time interval between the second time interval ΔT1 of PPS0 and the second time interval ΔT1' of PPS1 is the third time interval ΔT1_in.

[0117] Since the interrupt callback involves a mode switch from the mode when the CPU executes the core code of the operating system to the mode when the CPU executes the user application code, when the frequency of the function synchronization signal is very high, it will inevitably affect the CPU working efficiency. At the same time, from the test results, it can be seen that the second interrupt callback may be lost. Therefore, to reduce the impact on the CPU working efficiency and obtain a reliable function synchronization signal, the function synchronization signal closest to the pulse signal is selected.

[0118] Step S107: Mark the second time on the inertial measurement data and update the value of CNT. imu Value.

[0119] Specifically, mark the second week-level time and the second second-level time of the obtained second time on the inertial measurement data, and the CNT imu When the program starts to process the inertial measurement data, CNT imu Can be initialized to 0. When reading or processing a new inertial measurement data point, CNT imu Increments, that is, the CNT imu Is used to track the number of times of inertial measurement data.

[0120] Step S108: Determine whether the value of CNT imu Is 100.

[0121] Specifically, the value of CNT imu Being 100 means that the program has successfully received and processed 100 data updates output by the sensor unit. If the value of CNT imu Is 100, then execute step S109. If the value of CNT imu Has not reached 100, then execute step S107 until the value of CNT imu Reaches 100.

[0122] Step S109: Set CNT imu To 0.

[0123] Specifically, make a judgment on setting CNT imu To 0. For example, when the output frequency of the inertial measurement data is 100 Hz and 100 frames of inertial measurement data are received at the same time, set CNT imu To 0. Among them, the output frequency of the inertial measurement data being 100 Hz means that the IMU sensor can generate and output 100 new data frames per second, and receiving 100 frames of inertial measurement data means that the program has successfully received and processed 100 data updates output by the IMU sensor.

[0124] Step S110: Determine whether the second thread is still outputting inertial measurement data.

[0125] Specifically, if the second thread no longer outputs inertial measurement data, step S111 is executed. If the second thread is still outputting inertial measurement data, steps S103 - S110 are executed again until the second thread no longer outputs inertial measurement data.

[0126] Step S111: Synchronize the positioning data with the inertial measurement data in terms of time.

[0127] Specifically, if the second thread no longer outputs inertial measurement data, it means that the second time has been marked on each frame of inertial measurement data, thus achieving the time synchronization between the positioning data and the inertial measurement data.

[0128] In an embodiment of the present invention, a pulse signal corresponding to a navigation module and a function synchronization signal corresponding to a sensor unit are obtained; a first time corresponding to positioning data is determined according to the pulse signal; a first count value and a second count value corresponding to each of them are respectively determined according to the pulse signal and the function synchronization signal; a first time interval is obtained according to the first count value; a second time interval is obtained according to the first count value and the second count value; a third time interval is obtained according to the second count value; a second time is determined according to the first time, the first time interval, the second time interval, and the third time interval; the time of the inertial measurement data is synchronized according to the second time. Thus, a dynamic correction algorithm is determined through the pulse signal and the function synchronization information to improve the accuracy of time synchronization and the adaptability and robustness of the system.

[0129] Figure 7 It is a flowchart of another GNSS and IMU time synchronization method according to an embodiment of the present invention. Figure 7 The GNSS and IMU time synchronization method shown specifically includes the following steps:

[0130] Step S401: Obtain a pulse signal corresponding to a navigation module and a function synchronization signal corresponding to a sensor unit.

[0131] Step S402: Determine a first time corresponding to positioning data according to the pulse signal.

[0132] Step S403: Respectively determine a first count value and a second count value corresponding to each of them according to the pulse signal and the function synchronization signal.

[0133] Step S404: Obtain a first time interval according to the first count value.

[0134] Step S405: Obtain a second time interval according to the first count value and the second count value.

[0135] Step S406: Obtain a third time interval according to the second count value.

[0136] Step S407: Determine the second time according to the first time, the first time interval, the second time interval, and the third time interval.

[0137] Step S408: Synchronize the time of the inertial measurement data according to the second time.

[0138] In some embodiments, the method further includes:

[0139] In response to the program startup, register the first interrupt and open the first interrupt callback, register the second interrupt, start the timer for counting, obtain the initialization time corresponding to the positioning data based on the first thread, where the first interrupt callback is configured to be triggered and executed at the rising edge of the pulse signal, and the second interrupt callback is configured to be enabled during the execution of the first interrupt callback.

[0140] In some embodiments, determining the first time, the first count value, and the second count value includes:

[0141] In response to the execution of the first interrupt callback, obtain the first count value of the pulse signal when the first interrupt callback is executed, update the initialization time to obtain the first time, and execute the second interrupt callback to obtain the second count value of the function synchronization signal closest to the pulse signal.

[0142] In some embodiments, obtaining the first time interval according to the first count value includes:

[0143] In response to the current pulse signal being the first pulse signal, the first time interval is a preset value;

[0144] In response to the general situation, the value of the first time interval is the first count value of the previous pulse signal minus the first count value of the current pulse signal;

[0145] In response to the count value of the timer decreasing to zero and then being set to the maximum value, the value of the first time interval is the maximum value of the timer count minus the first count value of the pulse signal when the timer count decreases to zero, plus the first count value of the pulse signal when the timer count is set to the maximum value.

[0146] In some embodiments, obtaining the second time interval according to the first count value and the second count value includes:

[0147] Set the initial value of the second time interval to 0;

[0148] In response to the rollback of the second time interval, the value of the second time interval is the first count value of the pulse signal closest to the time of the second time interval rollback minus the second count value of the function synchronization signal closest to the pulse signal;

[0149] In response to a general situation, the second time interval is adjusted by a proportionality coefficient, and the value of the adjusted second time interval is 1 minus the value of the proportionality coefficient multiplied by the value of the previous second time interval, plus the proportionality coefficient multiplied by the value of the second time interval between the current pulse signal and the nearest function synchronization signal after this pulse signal;

[0150] Wherein, the proportionality coefficient is obtained through the following formula:

[0151]

[0152] ΔT1 diff = ΔT1 last -ΔT1

[0153] Wherein, ratio is the proportionality coefficient for adjusting the second time interval data for anomalies, ΔT1 diff is the difference between the second time interval of the previous pulse signal and the value when the second time interval rolls back, and the ΔT1 last is the second time interval of the previous pulse signal, ΔT1 is the value when the second time interval rolls back, Scal factor is a preset parameter, and the value of the proportionality coefficient is between 0 and 1.

[0154] In some embodiments, the obtaining of the third time interval according to the second count value includes:

[0155] In response to the current function synchronization signal being the first function synchronization signal, the third time interval is a preset value;

[0156] In response to a general situation, the value of the third time interval is the second count value of the previous function synchronization signal minus the second count value of the current function synchronization signal;

[0157] In response to the timer count value decreasing to zero and then being set to the maximum value, the value of the third time interval is the maximum value of the timer count minus the second count value of the function synchronization signal when the timer count value decreases to zero, plus the second count value of the function synchronization signal when the timer count value is set to the maximum value 2 32 when the timer count value is set to the maximum value.

[0158] In some embodiments, the determining of the second time according to the first time, the first time interval, the second time interval, and the third time interval includes:

[0159] Obtaining a first synchronization ratio according to the first time interval and the second time interval, and the first synchronization ratio is obtained through the following formula:

[0160]

[0161] Among them, f1 is the time synchronization ratio value of the second time interval, ΔT1 is the second time interval, and pps_in is the first time interval;

[0162] Obtain a second synchronization ratio according to the third time interval and the first time interval, and the second synchronization ratio is obtained through the following formula:

[0163]

[0164] Among them, f2 is the time synchronization ratio value of the pulse signal and the function synchronization signal, ΔT1_in is the third time interval, and pps_in is the first time interval;

[0165] Obtain a second time according to the first synchronization ratio, the second synchronization ratio and the first time.

[0166] In some embodiments, the second time includes second second-level data and second week-level data, and the second time is obtained through the following formula:

[0167] S t = S p + f1 + f2 * T imu * CNT imu

[0168] W t = W p

[0169] Among them, S t is the second second-level data of the second time, W t is the second week-level data of the second time, W p is the first week-level data of the first time of the pulse signal, S p is the first second-level data of the first time of the pulse signal, f1 is the first synchronization ratio value of the second time interval, f2 is the second synchronization ratio value of the pulse signal and the function synchronization signal, T imu is the output period of the inertial measurement data, CNT imu is the reference count of the inertial measurement data, and the reference count is an increasing value.

[0170] In an embodiment of the present invention, a pulse signal corresponding to a navigation module and a function synchronization signal corresponding to a sensor unit are obtained; a first time corresponding to positioning data is determined according to the pulse signal; a first count value and a second count value corresponding to each of them are respectively determined according to the pulse signal and the function synchronization signal; a first time interval is obtained according to the first count value; a second time interval is obtained according to the first count value and the second count value; a third time interval is obtained according to the second count value; a second time is determined according to the first time, the first time interval, the second time interval, and the third time interval; and the time of inertial measurement data is synchronized according to the second time. Thus, a dynamic correction algorithm is determined through the pulse signal and the function synchronization information to improve the accuracy of time synchronization and the adaptability and robustness of the system.

[0171] Figure 8 is a schematic diagram of a time synchronization device for GNSS and IMU according to an embodiment of the present invention. As Figure 8 shown, the time synchronization device for GNSS and IMU according to an embodiment of the present invention includes a signal acquisition module 81, configured to obtain a pulse signal corresponding to a navigation module and a function synchronization signal corresponding to a sensor unit; a first time acquisition module 82, configured to determine a first time corresponding to positioning data according to the pulse signal; a count value determination module 83, configured to respectively determine a first count value and a second count value corresponding to each of them according to the pulse signal and the function synchronization signal; a first time interval acquisition module 84, configured to obtain a first time interval according to the first count value; a second time interval acquisition module 85, configured to obtain a second time interval according to the first count value and the second count value; a third time interval acquisition module 86, configured to obtain a third time interval according to the second count value; a second time acquisition and determination module 87, configured to determine a second time according to the first time, the first time interval, the second time interval, and the third time interval; and a synchronization module 88, configured to synchronize the time of inertial measurement data according to the second time.

[0172] In some embodiments, the time synchronization device for GNSS and IMU further includes:

[0173] a program startup module, configured to, in response to program startup, register a first interrupt and open a first interrupt callback, register a second interrupt, start a timer for counting, obtain an initialization time based on the first thread, where the first interrupt callback is configured to be triggered and executed at the rising edge of the pulse signal, and the second interrupt callback is configured to be opened during the execution of the first interrupt callback.

[0174] In some embodiments, the program startup module further includes:

[0175] An interrupt callback execution module, configured to, in response to a first interrupt callback execution, obtain a first count value of a pulse signal when the first interrupt callback is executed, update the initialization time to obtain a first time, and execute a second interrupt callback to obtain a second count value of a function synchronization signal closest to the pulse signal.

[0176] In some embodiments, the first time interval obtaining module includes:

[0177] A first sub-module, configured to, in response to the current pulse signal being the first pulse signal, set the first time interval to a preset value;

[0178] A second sub-module, configured to, in response to a general situation, set the value of the first time interval to the first count value of the previous pulse signal minus the first count value of the current pulse signal;

[0179] A third sub-module, configured to, in response to the count value of the timer being set to the maximum value after decreasing to zero, set the value of the first time interval to the maximum value of the timer count minus the first count value of the pulse signal when the timer count decreases to zero, and then add the first count value of the pulse signal when the timer count is set to the maximum value.

[0180] In some embodiments, the second time interval obtaining module includes:

[0181] A fourth sub-module, configured to, in response to a second time interval rollback, set the value of the second time interval to the first count value of the pulse signal closest to the time of the second time interval rollback minus the second count value of the function synchronization signal closest to the pulse signal;

[0182] A fifth sub-module, configured to, in response to a general situation, adjust the second time interval by a proportionality coefficient, and the adjusted value of the second time interval is 1 minus the value of the proportionality coefficient multiplied by the value of the previous second time interval, plus the proportionality coefficient multiplied by the value of the second time interval between the current pulse signal and the closest function synchronization signal after this pulse signal;

[0183] Wherein, the proportionality coefficient is obtained through the following formula:

[0184]

[0185] ΔT1 diff =ΔT1 last -ΔT1

[0186] Wherein, ratio is the proportionality coefficient for adjusting abnormal second time interval data, ΔT1 diff is the difference between the second time interval of the previous pulse signal and the value at the time of the second time interval rollback, and the ΔT1 lastis the second time interval of the previous pulse signal, ΔT1 is the value when the second time interval rolls back, and Scal factor is a preset parameter, abs is the absolute value calculation symbol, and the value of the proportionality coefficient is between 0 and 1.

[0187] In some embodiments, the third time interval obtaining module includes:

[0188] The sixth sub-module is used to respond that the current function synchronization signal is the first function synchronization signal, and the third time interval is a preset value;

[0189] The seventh sub-module is used to respond to the general situation, and the value of the third time interval is the second count value of the previous function synchronization signal minus the second count value of the current function synchronization signal;

[0190] The eighth sub-module is used to respond that after the timer count value decreases to zero and is then set to the maximum value, the value of the third time interval is the maximum timer count value minus the second count value of the function synchronization signal when the timer count value decreases to zero, plus the second count value of the function synchronization signal when the timer count value is set to the maximum value 2 32 when the second count value of the function synchronization signal.

[0191] In some embodiments, the second time obtaining sub-module includes:

[0192] The ninth sub-module is used to obtain a first synchronization ratio according to the first time interval and the second time interval, and the first synchronization ratio is obtained through the following formula:

[0193]

[0194] where f1 is the time synchronization ratio value of the second time interval, ΔT1 is the second time interval, and pps_in is the first time interval;

[0195] The tenth sub-module is used to obtain a second synchronization ratio according to the third time interval and the first time interval, and the second synchronization ratio is obtained through the following formula:

[0196]

[0197] where f2 is the time synchronization ratio value of the pulse signal and the function synchronization signal, ΔT1_in is the third time interval, and pps_in is the first time interval;

[0198] The eleventh sub-module is used to obtain a second time according to the first synchronization ratio, the second synchronization ratio and the first time, and the second time is obtained through the following formula:

[0199] S t = Sp +f1 + f2*T imu *CNT imu

[0200] W t = W p

[0201] Wherein, S t is the second - second - level data at the second time, W t is the second - week - level data at the second time, W p is the first - week - level data at the first time of the pulse signal, S p is the first - second - level data at the first time of the pulse signal, f1 is the first synchronization ratio value of the second time interval, f2 is the second synchronization ratio value of the pulse signal and the function synchronization signal, T imu is the output period of the inertial measurement data, CNT imu is the reference count of the inertial measurement data, and the reference count is an increasing value.

[0202] In the embodiment of the present invention, by obtaining the pulse signal corresponding to the navigation module and the function synchronization signal corresponding to the sensor unit; respectively determining the corresponding first count value and second count value according to the pulse signal and the function synchronization signal; obtaining the first time interval according to the first count value; obtaining the second time interval according to the first count value and the second count value; obtaining the third time interval according to the second count value; determining the second time according to the first time, the first time interval, the second time interval, and the third time interval; synchronizing the time of the inertial measurement data according to the second time. Thus, a dynamic correction algorithm is determined through the pulse signal and the function synchronization information to improve the accuracy of time synchronization and the adaptability and robustness of the system.

[0203] Figure 9 is a schematic diagram of the electronic device in the embodiment of the present invention. As Figure 9 shown, Figure 9The electronic device shown is a general address query device, which includes a general computer hardware structure, and at least includes a processor 91 and a memory 92. The processor 91 and the memory 92 are connected by a bus 93. The memory 92 is adapted to store instructions or programs executable by the processor 91. The processor 91 can be an independent microprocessor or a set of one or more microprocessors. Thus, by executing the instructions stored in the memory 92, the processor 91 executes the method flow of the embodiment of the present invention as described above to implement data processing and control of other devices. The bus 93 connects the above-mentioned multiple components together, and at the same time connects the above-mentioned components to a display controller 94, a display device, and an input / output (I / O) device 95. The input / output (I / O) device 95 can be a mouse, a keyboard, a modem, a network interface, a touch input device, a body sensing input device, a printer, and other devices well known in the art. Typically, the input / output device 95 is connected to the system through an input / output (I / O) controller 96.

[0204] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a device (equipment), or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can be implemented as a computer program product on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0205] The present application is described with reference to the flowcharts of methods, devices (equipment), and computer program products according to the embodiments of the present application. It should be understood that each process in the flowchart can be implemented by computer program instructions.

[0206] These computer program instructions can be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, and the instruction device implements the process Figure 1 the functions specified in one process or multiple processes.

[0207] These computer program instructions can also be provided to the processor of a general computer, a special computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices produce a device for implementing the functions specified in Figure 1 one process or multiple processes.

[0208] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, which is used for a computer to execute the above-mentioned partial or all method embodiments.

[0209] That is, those skilled in the art can understand that all or part of the steps in implementing the above-mentioned embodiment methods can be completed by specifying relevant hardware through a program. This program is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.

[0210] The foregoing are only the preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.

Claims

1. A time synchronization method for GNSS and IMU, characterized in that: The method comprises: Acquire a pulse signal corresponding to the navigation module and a functional synchronization signal corresponding to the sensor unit; Determine a first time corresponding to the positioning data according to the pulse signal; Determine the first count value and the second count value corresponding to each other according to the pulse signal and the functional synchronization signal; Acquire a first time interval according to the first count value; Acquire a second time interval according to the first count value and the second count value; Acquire a third time interval according to the second count value; Determine a second time according to the first time, the first time interval, the second time interval, and the third time interval; The time of the inertial measurement data is synchronized according to the second time.

2. The method according to claim 1, characterized in that The method further comprises: In response to program startup, a first interrupt is registered and a first interrupt callback is enabled, a second interrupt is registered, a timer is enabled for counting, and an initialization time corresponding to the positioning data is obtained based on the first thread. The first interrupt callback is configured to be triggered to execute on the rising edge of the pulse signal, and the second interrupt callback is configured to be enabled during the execution of the first interrupt callback.

3. The method according to claim 2, characterized in that Determining the first time, the first count value, and the second count value includes: In response to the execution of the first interrupt callback, a first count value of the pulse signal when the first interrupt callback is executed is obtained, the initialization time is updated to obtain the first time, and a second interrupt callback is executed to obtain a second count value of the functional synchronization signal closest to the pulse signal.

4. The method according to claim 1, characterized in that The acquiring the first time interval according to the first count value comprises: In response to the current pulse signal being the first pulse signal, the first time interval is a preset value; In response to a general situation, the value of the first time interval is the first count value of the previous pulse signal minus the first count value of the current pulse signal; In response to the timer count value being set to the maximum value after being decremented to zero, the value of the first time interval is the maximum value of the timer count minus the first count value of the pulse signal when the timer count value is decremented to zero, plus the first count value of the pulse signal when the timer count value is set to the maximum value.

5. The method according to claim 1, characterized in that The acquiring the second time interval according to the first count value and the second count value comprises: Set the initial value of the second time interval to 0; In response to the second time interval rolling back, the value of the second time interval is the first count value of the pulse signal closest to the time when the second time interval rolls back minus the second count value of the functional synchronization signal closest to the pulse signal; In response to a general situation, the second time interval is adjusted by a proportional coefficient, wherein the value of the adjusted second time interval is 1 minus the value of the proportional coefficient multiplied by the value of the previous second time interval, plus the proportional coefficient multiplied by the value of the second time interval between the current pulse signal and the nearest functional synchronization signal after the pulse signal; The proportionality coefficient is obtained by the following formula: ΔT1 diff =ΔT1 last -ΔT1 Where ratio is the proportional coefficient used to adjust the abnormal second time interval data, ΔT1 diff is the difference between the second time interval of the previous pulse signal and the value when the second time interval rolls back, the ΔT1 last is the second time interval of the previous pulse signal, ΔT1 is the value when the second time interval rolls back, Scal factor is a preset parameter, abs is the absolute value budget symbol, and the value of the proportional coefficient is between 0 and 1.

6. The method according to claim 1, characterized in that The acquiring a third time interval according to the second count value comprises: In response to the current function synchronization signal being the first function synchronization signal, the third time interval is a preset value; In response to a general situation, the value of the third time interval is the second count value of the previous function synchronization signal minus the second count value of the current function synchronization signal; In response to the timer count value being set to the maximum value after being decremented to zero, the value of the third time interval is the maximum value of the timer count minus the second count value of the function synchronization signal when the timer count value is decremented to zero, plus the value of the time when the timer count value is set to the maximum value 2 32 The second count value of the timing function synchronization signal.

7. The method according to claim 1, characterized in that Determining the second time according to the first time, the first time interval, the second time interval, and the third time interval includes: A first synchronization ratio is acquired according to the first time interval and the second time interval, and the first synchronization ratio is acquired by the following formula: Wherein, f1 is the time synchronization ratio value of the second time interval, ΔT1 is the second time interval, and pps_in is the first time interval; A second synchronization ratio is acquired according to the third time interval and the first time interval, and the second synchronization ratio is acquired by the following formula: Wherein, f2 is the time synchronization ratio value of the pulse signal and the function synchronization signal, ΔT1_in is the third time interval, and pps_in is the first time interval; A second time is acquired according to the first synchronization ratio, the second synchronization ratio and the first time.

8. The method according to claim 7, characterized in that The second time includes second second-level data and second week-level data, and the second time is obtained by the following formula: S t =S p +f1*1s+f2*T imu *CNT imu IN t =In p Among them, S t is the second second data of the second time, W t is the second week data of the second time period, W p is the first cycle data of the first time of the pulse signal, S p is the first second data of the first time of the pulse signal, f1 is the first synchronization ratio value of the second time interval, 1s is 1 second, f2 is the second synchronization ratio value of the pulse signal and the functional synchronization signal, T imu is the output period of inertial measurement data, CNT umu is the reference count of the inertial measurement data, and the reference count is an increasing value.

9. A time synchronization device for GNSS and IMU, characterized in that: The device comprises: A signal acquisition module, used to acquire a pulse signal corresponding to the navigation module and a functional synchronization signal corresponding to the sensor unit; A first time acquisition module, used to determine a first time corresponding to the positioning data according to the pulse signal; A count value determination module, used to determine a count value according to the pulse signal and the functional synchronization signal, wherein the count value includes a first count value and a second count value; A first time interval acquisition module, used to acquire a first time interval according to the first count value; A second time interval acquisition module, configured to acquire a second time interval according to the first count value and the second count value; A third time interval acquisition module, used to acquire a third time interval according to the second count value; A second time acquisition and determination module, used to determine a second time according to the first time, the first time interval, the second time interval, and the third time interval; A synchronization module is used to synchronize the time of the inertial measurement data according to the second time.

10. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • IMU and GNSS data synchronous method based on standard time scale

    CN109752738A

  • Dual inertial measurement units for inertial navigation system

    US20210341631A1