A timestamp determination method, apparatus, system, device, medium and product
Patent Information
- Application Number
- CN202511585866.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2045-10-31
AI Technical Summary
[0003]本发明提供了一种时间戳确定方法、装置、系统、设备、介质及产品,以解决现有方法存在的无法兼顾功能安全与IMU采样时间戳精度的问题
[0028]应当理解,本部分所描述的内容并非旨在标识本发明的实施例的关键或重要特征,也不用于限制本发明的范围。本发明的其它特征将通过以下的说明书而变得容易理解。
Smart Images

Figure CN121308894B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent driving technology, and in particular to a timestamp determination method, apparatus, system, device, medium and product. Background Technology
[0002] In Advanced Driver Assistance Systems (ADAS), the accuracy of the timestamps on the data sampled by the Inertial Measurement Unit (IMU) directly affects the accuracy of subsequent control algorithms (such as attitude calculation and motion trajectory fusion). Currently, there are two main methods for determining the IMU data sampling timestamps: First, directly connecting the IMU module to a System-on-Chip (SOC). However, this cannot meet the highest functional safety requirement of ASIL-D for the IMU (SOC only meets ASIL-B level), meaning this method has functional safety compliance deficiencies. Second, connecting the IMU to a Microcontroller Unit (MCU). While this method meets safety requirements, factors such as MCU scheduling delays and data transmission delays lead to a decrease in timestamp synchronization accuracy, ultimately affecting the decision-making accuracy of the ADAS control algorithm. In summary, existing methods suffer from the inability to simultaneously achieve functional safety and IMU sampling timestamp accuracy. Summary of the Invention
[0003] This invention provides a timestamp determination method, apparatus, system, device, medium, and product to solve the problem that existing methods cannot simultaneously ensure functional safety and IMU sampling timestamp accuracy.
[0004] According to one aspect of the present invention, a timestamp determination method is provided, which is applied to a timestamp determination system including a timing synchronization source, an inertial measurement unit (IMU) module, a first processing unit, and a second processing unit, comprising:
[0005] The timing synchronization source periodically sends synchronization signals to the first processing unit and the IMU module;
[0006] The first processing unit responds to the synchronization signal and records the corresponding first timestamp;
[0007] After receiving and synchronizing the synchronization signal, the IMU module collects IMU data according to the preset sampling frequency and sends it to the first processing unit. The IMU data includes a sampling count identifier, which is used to characterize the time offset of the sampling time of the corresponding IMU data within the corresponding synchronization period.
[0008] After receiving the IMU data, the first processing unit records the corresponding second timestamp and sends the IMU data, the first timestamp, and the second timestamp to the second processing unit.
[0009] For each frame of IMU data, the second processing unit determines the sampling timestamp based on the first timestamp, the second timestamp, and the sampling count identifier corresponding to the IMU data.
[0010] According to another aspect of the present invention, a timestamp determination apparatus is provided, which is applied to a timestamp determination system including a timing synchronization source, an inertial measurement unit (IMU) module, a first processing unit, and a second processing unit, comprising:
[0011] The synchronization signal transmission module is used to periodically send synchronization signals to the first processing unit and the IMU module through a timed synchronization source;
[0012] The first timestamp recording module is used to record the corresponding first timestamp in response to the synchronization signal by the first processing unit.
[0013] The data acquisition module is used to receive and synchronize the synchronization signal through the IMU module, acquire IMU data according to a preset sampling frequency, and send it to the first processing unit. The IMU data includes a sampling count identifier, which is used to characterize the time offset of the sampling time of the corresponding IMU data within the corresponding synchronization period.
[0014] The data transmission module is used to receive IMU data through the first processing unit, record the corresponding second timestamp, and send the IMU data, the first timestamp, and the second timestamp to the second processing unit.
[0015] The timestamp determination module is used by the second processing unit to determine the sampling timestamp for each frame of IMU data based on the first timestamp, the second timestamp, and the sampling count identifier corresponding to the IMU data.
[0016] According to another aspect of the present invention, a timestamp determination system is provided, the system comprising: a timing synchronization source, an inertial measurement unit (IMU) module, a first processing unit, and a second processing unit; wherein,
[0017] A timed synchronization source is used to periodically send synchronization signals to the first processing unit and the IMU module;
[0018] The IMU module is used to receive and synchronize the synchronization signal, collect IMU data according to a preset sampling frequency and send it to the first processing unit; the IMU data includes a sampling count identifier, which is used to characterize the time offset of the sampling time of the corresponding IMU data within the corresponding synchronization period.
[0019] The first processing unit is configured to, in response to a synchronization signal, record a corresponding first timestamp; and, upon receiving IMU data, record a corresponding second timestamp and send the IMU data, the first timestamp, and the second timestamp to the second processing unit.
[0020] The second processing unit is used to determine the sampling timestamp for each frame of IMU data based on the first timestamp, the second timestamp, and the sampling count identifier corresponding to the IMU data.
[0021] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0022] At least one processor; and
[0023] A memory communicatively connected to the at least one processor; wherein,
[0024] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the timestamp determination method according to any embodiment of the present invention.
[0025] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the timestamp determination method according to any embodiment of the present invention.
[0026] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the timestamp determination method according to any embodiment of the present invention.
[0027] The timestamp determination method provided in this invention is applied to a timestamp determination system including a timing synchronization source, an inertial measurement unit (IMU) module, a first processing unit, and a second processing unit. The timing synchronization source periodically sends synchronization signals to the first processing unit and the IMU module. The first processing unit responds to the synchronization signals by recording the corresponding first timestamp. After receiving and synchronizing with the synchronization signals, the IMU module collects IMU data at a preset sampling frequency and sends it to the first processing unit. The IMU data includes a sampling count identifier, which characterizes the time offset of the sampling time of the corresponding IMU data within its synchronization period. Upon receiving the IMU data, the first processing unit records the corresponding second timestamp and sends the IMU data, the first timestamp, and the second timestamp to the second processing unit. For each frame of IMU data, the second processing unit determines the sampling timestamp based on the corresponding first timestamp, second timestamp, and sampling count identifier. This technical solution constructs a collaborative system consisting of a timing synchronization source, an IMU module, and two-level processing units. It combines the sampling count identifier maintained internally by the IMU with the synchronization signal timestamp, and then the second processing unit performs a reverse calculation. This effectively eliminates the scheduling delay of the first processing unit and the data transmission delay while ensuring that the system meets the highest functional safety level, ultimately achieving high-precision determination of the actual sampling time of the IMU data.
[0028] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is a flowchart of a timestamp determination method provided in Embodiment 1 of the present invention;
[0031] Figure 2 This is a schematic diagram of a timestamp determination system according to Embodiment 2 of the present invention;
[0032] Figure 3 This is a schematic diagram of a timestamp determination system according to Embodiment 3 of the present invention;
[0033] Figure 4 This is a flowchart of the timestamp reverse calculation process provided in Embodiment 3 of the present invention;
[0034] Figure 5 This is a schematic diagram of a timestamp determination device according to Embodiment 4 of the present invention;
[0035] Figure 6 This is a schematic diagram of the structure of an electronic device that implements the timestamp determination method of the present invention. Detailed Implementation
[0036] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0037] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0038] Example 1
[0039] Figure 1 This is a flowchart of a timestamp determination method provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where IMU sampling timestamps are determined with high precision in intelligent driving systems. The method can be executed by a timestamp determination device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown in the figure, the timestamp determination method provided in this embodiment is applied to a timestamp determination system including a timing synchronization source, an inertial measurement unit (IMU) module, a first processing unit, and a second processing unit. The method specifically includes the following steps:
[0040] S110, the timing synchronization source periodically sends synchronization signals to the first processing unit and the IMU module.
[0041] Among them, the timing synchronization source can refer to a device that can generate and output periodic synchronization signals to provide a unified time reference for multiple units within the system. For example, it may include, but is not limited to, Global Navigation Satellite System (GNSS) modules, high-precision clock chips, etc.
[0042] The first processing unit can refer to the processing module in the system that is responsible for receiving synchronization signals and recording the first timestamp, receiving IMU data and forwarding it to the second processing unit. For example, it can be a microcontroller unit (MCU) or other control chip, which has the characteristics of high real-time performance and rich interfaces, and is used to process low-level data acquisition and forwarding.
[0043] An IMU module can refer to a device used to collect inertial data such as triaxial acceleration and triaxial angular velocity of an object.
[0044] Synchronization signals can refer to periodic electrical signals (such as pulse signals) generated by a timing synchronization source. Their characteristics (such as rising edge and falling edge) are used to identify the reference time and are the basis for the IMU module to achieve time synchronization. For example, synchronization signals can include at least the pulses per second (PPS) signal output by the GNSS module.
[0045] In this embodiment of the invention, the timing synchronization source can generate a periodic synchronization signal (such as a PPS signal) according to a preset synchronization period (such as 1 second), and send the synchronization signal to the first processing unit and the IMU module at the same time.
[0046] S120, the first processing unit responds to the synchronization signal and records the corresponding first timestamp.
[0047] The first timestamp can refer to the time value frozen and recorded by the first processing unit from its local system clock when it captures the valid edge of the synchronization signal. It is the reference point for subsequent calculation of the IMU data sampling time.
[0048] In this embodiment of the invention, the first processing unit can continuously monitor the synchronization signal sent by the timing synchronization source through a preset hardware interface (such as an interrupt pin). When the reference time of the synchronization signal (such as the rising edge of the signal) is detected, a hardware interrupt is immediately triggered to minimize the delay from signal detection to subsequent actions. Then, in the hardware interrupt response process, the first processing unit will immediately read the instantaneous value of the current system clock. This instantaneous value represents the absolute time point when the synchronization signal arrives at the first processing unit. It can be recorded as the first timestamp corresponding to the current synchronization signal. At the same time, the recorded first timestamp is bound to the synchronization period (such as 1 second) to which the current synchronization signal belongs, thereby providing a reference for determining the time period to which the IMU data belongs when processing IMU data later.
[0049] S130: After receiving and synchronizing the synchronization signal, the IMU module collects IMU data according to the preset sampling frequency and sends it to the first processing unit. The IMU data includes a sampling count identifier, which is used to characterize the time offset of the sampling time of the corresponding IMU data within the corresponding synchronization period.
[0050] The preset sampling frequency can refer to the data acquisition frequency preset by the IMU module. For example, a sampling frequency of 100Hz means that 100 data are collected per second, and the sampling period is 10ms, which means that data is collected once every 10ms.
[0051] IMU data can refer to data frames containing inertial measurement data and auxiliary identifiers collected by the IMU module. These data may include inertial measurement data such as the object's three-axis acceleration and three-axis angular velocity, as well as auxiliary identifiers such as sampling count identifiers and synchronization status identifiers.
[0052] The sampling count flag is a numerical identifier that increments with the IMU sampling process. It is maintained by a counter set within the IMU module. This sampling count flag accumulates from an initial value within each synchronization cycle (the transmission cycle of the synchronization signal), with the accumulation step size matching the sampling cycle. It characterizes the time offset of the corresponding sampling time of the IMU data relative to the starting reference time of the corresponding synchronization cycle. It can also be understood as the nth frame of IMU data transmitted in a synchronization cycle, or the nth data sampling triggered within a synchronization cycle. For example, assuming the IMU module's sampling frequency is 100Hz, the sampling count flag will change from 10, 20, ..., 1000 (with a step size of 10), where a sampling count flag of 10 indicates that the sampling time of that frame of IMU data occurred in the 10th millisecond after the start of the current synchronization cycle. Furthermore, whenever the IMU module receives a synchronization signal, the sampling count flag is reset to the initial value of 10, continuously incrementing and cycling.
[0053] In this embodiment of the invention, the IMU module can receive a synchronization signal sent by a timing synchronization source and perform time synchronization operations, such as aligning its internal clock with the synchronization signal to ensure that its own timing is consistent with the time base of the entire system. After synchronization is completed, the IMU module can continuously collect inertial measurement data such as object acceleration and angular velocity at a preset sampling frequency (e.g., once every 10ms). Then, it encapsulates the currently internally maintained sampling count flag and the inertial measurement data into a frame of IMU data, and sends the encapsulated IMU data to the first processing unit. At the same time, it updates the sampling count flag according to a preset step size. For example, when data sampling is triggered (assuming the sampling frequency is 100Hz), the sampling count flag is 10, so the sampling count flag in the current frame of IMU data is 10. After updating according to the preset step size of 10, the sampling count flag becomes 20. It should be understood that whenever the IMU module receives a synchronization signal, it resets the internally maintained sampling count flag to a preset initial value.
[0054] S140. After receiving the IMU data, the first processing unit records the corresponding second timestamp and sends the IMU data, the first timestamp, and the second timestamp to the second processing unit.
[0055] The second timestamp can refer to the timestamp recorded by the first processing unit when it receives the complete IMU data frame, which reflects the specific time when the IMU data arrives at the first processing unit.
[0056] The second processing unit can refer to the processing module in the system responsible for calculating the IMU data sampling timestamp based on the received IMU data, the first timestamp, and the second timestamp. For example, it can be a computing chip with high computing power, such as a system-on-chip (SOC), which has strong data processing capabilities and can execute complex timestamp reverse calculation logic.
[0057] In this embodiment of the invention, the first processing unit can continuously receive IMU data sent by the IMU module. When a complete IMU data frame is detected, the second processing unit will immediately read the instantaneous value of the current system clock. This instantaneous value represents the absolute time point at which the IMU data arrives at the first processing unit. It can be recorded as the second timestamp corresponding to the current frame of IMU data. The current frame of IMU data, the first timestamp corresponding to the synchronization period to which the current frame of IMU data belongs, and the newly recorded second timestamp are encapsulated into a composite data frame, which is then sent to the second processing unit through a preset communication interface.
[0058] S150, the second processing unit determines the sampling timestamp for each frame of IMU data based on the first timestamp, the second timestamp, and the sampling count identifier corresponding to the IMU data.
[0059] The sampling timestamp can refer to the precise absolute time obtained by the second processing unit through reverse calculation, which represents the moment when the actual physical sampling action of the IMU module occurs.
[0060] In this embodiment of the invention, the second processing unit can receive the IMU data frame sent by the first processing unit and its associated sampling count identifier, first timestamp T1 and second timestamp T2, and simultaneously obtain the historical sampling timestamp of the previous frame of IMU data (i.e., the sampling timestamp finally deduced from the previous frame), and perform comprehensive analysis on the above data, such as analyzing the rationality of transmission delay (verifying whether there is a serious delay in the data link), the validity of sampling count identifier (verifying whether the sampling count identifier is within a preset range), and the continuity of timestamp (verifying whether the sampling timestamp has changed), and determine the sampling timestamp corresponding to the frame of IMU data based on the analysis results. For example, if the historical sampling timestamp of the previous frame is equal to 0 and the transmission delay exceeds a preset range, then the final sampling timestamp T3 is set to 0; if the historical sampling timestamp of the previous frame is not equal to 0 and the sampling count flag indicates that the current frame does not belong to the previous or subsequent frames in the current synchronization period, then the final sampling timestamp T3 is set to the historical sampling timestamp of the previous frame + preset step size; if the sampling count flag indicates that the current frame belongs to the previous frames in the current synchronization period, then the final sampling timestamp T3 is set to T1 + sampling count flag; if the sampling count flag indicates that the current frame belongs to the subsequent frames in the current synchronization period, then the final sampling timestamp T3 is set to T1 - synchronization period + sampling count flag.
[0061] The timestamp determination method provided in this invention is applied to a timestamp determination system including a timing synchronization source, an inertial measurement unit (IMU) module, a first processing unit, and a second processing unit. The timing synchronization source periodically sends synchronization signals to the first processing unit and the IMU module. The first processing unit responds to the synchronization signals by recording the corresponding first timestamp. After receiving and synchronizing with the synchronization signals, the IMU module collects IMU data at a preset sampling frequency and sends it to the first processing unit. The IMU data includes a sampling count identifier, which characterizes the time offset of the sampling time of the corresponding IMU data within its synchronization period. Upon receiving the IMU data, the first processing unit records the corresponding second timestamp and sends the IMU data, the first timestamp, and the second timestamp to the second processing unit. For each frame of IMU data, the second processing unit determines the sampling timestamp based on the corresponding first timestamp, second timestamp, and sampling count identifier. This technical solution constructs a collaborative system consisting of a timing synchronization source, an IMU module, and two-level processing units. It combines the sampling count identifier maintained internally by the IMU with the synchronization signal timestamp, and then the second processing unit performs a reverse calculation. This effectively eliminates the scheduling delay of the first processing unit and the data transmission delay while ensuring that the system meets the highest functional safety level, ultimately achieving high-precision determination of the actual sampling time of the IMU data.
[0062] Furthermore, based on the above embodiments of the invention, the timing synchronization source includes at least: a Global Navigation Satellite System (GNSS) module, and the timing synchronization source periodically sends synchronization signals to the first processing unit and the IMU module, including:
[0063] The GNSS module periodically generates a second pulse signal as a synchronization signal;
[0064] The GNSS module synchronously sends the second pulse signal to the first processing unit and the IMU module.
[0065] Among them, the GNSS module can refer to a hardware module that can receive satellite navigation signals (such as GPS, Beidou, GLONASS, etc.) and output position and time information. It can generate high-precision pulse-per-second (PPS) signals by parsing satellite signals and is a core component for providing time reference.
[0066] The pulse-per-second (PPS) signal can refer to a periodic pulse signal generated by a GNSS module with a period of 1 second. Its rising or falling edge corresponds to the whole second of the International Standard Time (UTC). It is a physical reference signal used in the system to synchronize the time of each unit.
[0067] In this embodiment of the invention, the timing synchronization source may include at least a GNSS module. The GNSS module may generate a PPS signal according to a fixed synchronization period (usually 1 second). The rising or falling edge of the signal is defined as the time reference moment (such as the whole second moment) and can be used as the system synchronization signal. Then, the GNSS module sends the generated PPS signal to the first processing unit and the IMU module at the same time.
[0068] The embodiments of the present invention provide a high-precision and high-stability global time reference for the entire timestamp determination system (first processing unit, IMU module) through the PPS signal provided by the GNSS module, which is the basis for the accuracy of subsequent IMU sampling timestamp calculation.
[0069] Furthermore, based on the above embodiments of the invention, the first processing unit, in response to the synchronization signal, records the corresponding first timestamp, including:
[0070] The first processing unit triggers a hardware interrupt when it detects the edge of the synchronization signal;
[0071] The first processing unit responds to a hardware interrupt by reading the current system clock and recording it as the first timestamp.
[0072] Hardware interrupts can refer to a processor response mechanism that is directly triggered by hardware circuits (such as interrupt controllers and GPIO interfaces). When a preset event (such as the occurrence of a synchronization signal edge) occurs, the hardware automatically sends an interrupt request to the processor, forcing the processor to suspend the current task and execute the interrupt service routine, thereby ensuring a rapid response to external events.
[0073] The system clock can refer to an independently operating, high-precision hardware timer or counter within the first processing unit. It is usually driven by a stable crystal oscillator, providing continuous, monotonically increasing time counting, and is the basis for generating local timestamps.
[0074] In this embodiment of the invention, the specific process by which the first processing unit captures and records the first timestamp of the synchronization signal is as follows: The first processing unit can monitor the synchronization signal sent by the timing synchronization source in real time through its dedicated hardware interface (such as the GPIO interrupt pin). When the edge of the synchronization signal is detected (such as the rising edge of the signal from low level to high level), the hardware circuit of the first processing unit will immediately trigger a hardware interrupt. After the hardware interrupt is triggered, the first processing unit will pause the currently executing non-urgent task and immediately run the interrupt service routine bound to the interrupt. In the interrupt service routine, the first processing unit will freeze the current value of its own system clock as soon as possible. This value contains complete time information (such as year, month, day, hour, minute, second and microsecond fractional part) and record it as the first timestamp T1 corresponding to the current synchronization signal, which is used to mark the precise time when the synchronization signal arrives at the first processing unit.
[0075] This invention utilizes a hardware interrupt mechanism to avoid scheduling delays at the software level, enabling the determined first timestamp T1 to be infinitely close to the actual time when the synchronization signal arrives. This establishes an extremely accurate absolute time reference for the entire timestamp reverse calculation system, while ensuring that the first timestamp T1 recorded each time has high consistency and reliability.
[0076] Furthermore, based on the above embodiments of the invention, after receiving and synchronizing the synchronization signal, the IMU module collects IMU data according to a preset sampling frequency and sends it to the first processing unit, including:
[0077] After receiving the synchronization signal, the IMU module performs time synchronization operation, sets the internally maintained synchronization status flag, and resets the sampling count flag.
[0078] The IMU module samples data at a preset sampling frequency to obtain inertial measurement data;
[0079] After each data sampling, the IMU module combines the current synchronization status flag, sampling count flag, and inertial measurement data into a frame of IMU data.
[0080] The IMU module sends IMU data to the first processing unit through the first preset communication interface and updates the sampling count identifier according to the preset step size.
[0081] Time synchronization operation refers to the process by which the IMU module aligns its internal clock with the external synchronization signal to ensure the uniformity of the time base.
[0082] The synchronization status flag can be a status flag bit maintained internally by the IMU module to indicate whether it has successfully established a synchronization relationship with the synchronization signal. For example, setting the bit (such as 1) indicates successful synchronization, and not setting the bit (such as 0) indicates synchronization failure or non-synchronization.
[0083] Inertial measurement data refers to the raw data collected by the IMU module through accelerometers and gyroscopes, including information such as three-axis acceleration (reflecting linear motion) and three-axis angular velocity (reflecting rotational motion), which is the basic data for subsequent motion analysis, positioning and navigation.
[0084] The first preset communication interface may refer to the data transmission interface between the IMU module and the first processing unit, and may include, but is not limited to, communication interfaces such as UART, SPI or I2C, for reliably transmitting IMU data frames to the first processing unit.
[0085] The preset step size can refer to the fixed value that the sampling count identifier increments each time. Its value can be matched with the preset sampling frequency of the IMU module. For example, if the preset sampling frequency is 100Hz, the corresponding preset step size is 10, ensuring that the value of the sampling count identifier can be directly mapped to the time offset. That is, sampling count identifier = preset step size × number of samplings triggered in this synchronization cycle.
[0086] In this embodiment of the invention, when the IMU module receives a synchronization signal from a timing synchronization source (such as a GNSS module), it will perform the following steps:
[0087] (1) When the IMU module receives the synchronization signal sent by the timing synchronization source (such as the PPS signal sent by the GNSS module), it immediately performs time synchronization operation, such as aligning its internal clock with the reference time of the synchronization signal (such as the whole second) to ensure that the subsequent sampling time is based on a unified time reference; at the same time, it sets the internally maintained synchronization status flag to the synchronized state (such as setting it to 1) to indicate that the current IMU module has completed time synchronization; in addition, it resets the sampling count flag to the preset initial value to prepare for the sampling count in the new synchronization cycle.
[0088] (2) After time synchronization is completed, the IMU module can continuously collect inertial measurement data at a preset sampling frequency (e.g., 100Hz, i.e., once every 10ms), including raw data reflecting the motion state of the object such as triaxial acceleration and triaxial angular velocity.
[0089] (3) After each data sampling (i.e., acquiring a set of inertial measurement data), the IMU module combines the current synchronization status flag, sampling count flag, and inertial measurement data into a complete data frame, and sends it to the first processing unit through a first preset communication interface such as UART. At the same time, it updates the sampling count flag incrementally according to a preset step size. Then, the process of "data sampling -> IMU data transmission -> sampling count flag update" is repeated within the current synchronization cycle until the next synchronization signal arrives.
[0090] This invention, through receiving a synchronization signal and performing a time synchronization operation, aligns the internal clock of the IMU module with the system's global time reference (such as GNSS time), avoiding sampling time deviations caused by IMU local clock drift and providing a reliable reference for subsequent timestamp calculations. Simultaneously, the synchronization status identifier maintained within the IMU module provides a clear indication of the time synchronization status, and the sampling count identifier establishes a precise location mapping of the IMU data sampling time within the synchronization period, providing crucial information for accurate reverse calculation of subsequent sampling timestamps.
[0091] Furthermore, based on the above embodiments, after receiving the IMU data, the first processing unit records the corresponding second timestamp and sends the IMU data, the first timestamp, and the second timestamp to the second processing unit, including:
[0092] After receiving the IMU data, the first processing unit reads the current system clock and records it as the second timestamp;
[0093] The first processing unit performs integrity verification on the IMU data;
[0094] After the verification is successful, the first processing unit encapsulates the IMU data, the first timestamp, and the second timestamp into a composite data frame, and sends the composite data frame to the second processing unit through the second preset communication interface.
[0095] Integrity verification can refer to the process by which the first processing unit verifies the integrity of the received IMU data frame. This can include verification methods such as data packet length verification and Cyclic Redundancy Code (CRC) verification.
[0096] A composite data frame can refer to a data frame formed by the first processing unit integrating IMU data, a first timestamp, and a second timestamp according to a preset format, so that it can be transmitted over the network and correctly parsed and used by the second processing unit.
[0097] The second preset communication interface may refer to the data transmission interface between the first processing unit and the second processing unit, and may include at least an Ethernet communication interface such as SOME / IP, for reliable transmission of composite data frames.
[0098] In this embodiment of the invention, after receiving the IMU data sent by the IMU module, the first processing unit performs the following operations:
[0099] (1) The first processing unit can receive IMU data sent by the IMU module through the first preset communication interface such as UART. When a frame of IMU data is received completely, the first processing unit will immediately freeze the current value of its own system clock. This value contains complete time information (such as year, month, day, hour, minute, second and microsecond fractional part) and record it as the second timestamp T2 corresponding to the current frame of IMU data, which is used to mark the precise time when the frame of IMU data arrives at the first processing unit.
[0100] (2) After recording the second timestamp T2, the first processing unit does not immediately forward the data. Instead, it first performs integrity checks on the received IMU data, including length checks and CRC checks. Only after the data integrity check passes will the first processing unit integrate the frame of IMU data, the first timestamp corresponding to the synchronization period to which the IMU data belongs (i.e., the reference time recorded by the first processing unit in response to the synchronization signal), and the newly recorded second timestamp into a composite data frame according to a preset data structure (such as including frame type identifier, data length field, and offset of each parameter), and send it to the second processing unit through a second preset communication interface, not limited to SOME / IP. If the integrity check of the IMU data fails, the frame of data will be discarded to prevent invalid data from entering the subsequent process.
[0101] This invention, by introducing a verification mechanism early in the data link (at the first processing unit end), can promptly identify and discard data packets that erroneous during transmission, preventing erroneous or unreliable IMU data from entering subsequent critical decision-making algorithms (such as ADAS control algorithms), thereby improving the functional safety level and robustness of the entire system. In addition, sending the recorded second timestamp along with the IMU data can provide crucial information for the subsequent second processing unit to deduce the IMU sampling timestamp.
[0102] Furthermore, based on the above embodiments of the invention, the second processing unit determines the sampling timestamp for each frame of IMU data based on the first timestamp, the second timestamp, and the sampling count identifier corresponding to the IMU data, including:
[0103] The second processing unit receives and parses the composite data frame sent by the first processing unit to obtain the IMU data of the current frame, the synchronization status identifier, the sampling count identifier, the first timestamp and the second timestamp, and the historical sampling timestamp of the previous frame of IMU data.
[0104] The second processing unit determines whether the synchronization status flag is a preset flag value;
[0105] If so, the sampling timestamp will be determined according to the preset conditions;
[0106] If not, then the sampling timestamp is determined as the first target value;
[0107] The preset conditions include at least one of the following:
[0108] The first preset condition is that the historical sampling timestamp is equal to 0;
[0109] The second preset condition is that the first timestamp equals 0;
[0110] The third preset condition is that the target timestamp difference is a non-negative number, and the target timestamp difference = first timestamp + sampling count identifier - historical sampling timestamp;
[0111] The fourth preset condition is that the difference between the second timestamp and the first timestamp is less than or equal to a preset threshold.
[0112] The fifth preset condition is that the sampling count indicator is within the first preset range;
[0113] The sixth preset condition is that the sampling count indicator is within the second preset range.
[0114] The first preset range can be used to represent the numerical range of the sampling count identifier at the end of the synchronization period. For example, within a 1-second synchronization period, 900ms to 1000ms corresponds to a sampling count identifier of 900 to 1000, which represents the last 10 frames of the synchronization period. Correspondingly, the second preset range can be used to represent the numerical range of the sampling count identifier at the beginning of the synchronization period. For example, within a 1-second synchronization period, 0ms to 100ms corresponds to a sampling count identifier of 0 to 100, which represents the first 10 frames of the synchronization period. The first and second preset ranges can be used to determine whether the current frame is located within the boundary range of a synchronization period.
[0115] In this embodiment of the invention, the intelligent decision-making process for the second processing unit to determine the precise sampling timestamp of the IMU is as follows:
[0116] (1) The second processing unit can receive the composite data frame sent by the first processing unit, parse out the synchronization status identifier, sampling count identifier, and the first timestamp T1 and the second timestamp T2 corresponding to the current frame IMU data; at the same time, it can obtain the historical sampling timestamp of the previous frame IMU data (the determined sampling time of the previous frame).
[0117] (2) Check if the synchronization status indicator is the preset indicator value. For example, 1 indicates that the IMU module has been successfully synchronized with the synchronization signal.
[0118] (3) If the synchronization status flag is not a preset flag value (such as 1), the sampling timestamp of the current frame is directly determined to be the first target value, such as 0, and the process ends here.
[0119] (4) If the synchronization status flag is a preset flag value (e.g., 1), then the final sampling timestamp is determined according to preset conditions, wherein the preset conditions include at least one of the following:
[0120] The first preset condition is that the historical sampling timestamp is equal to 0;
[0121] The second preset condition is that the first timestamp equals 0;
[0122] The third preset condition is that the target timestamp difference is a non-negative number, and the target timestamp difference = first timestamp + sampling count identifier - historical sampling timestamp;
[0123] The fourth preset condition is that the difference between the second timestamp and the first timestamp is less than or equal to a preset threshold.
[0124] The fifth preset condition is that the sampling count indicator is within the first preset range;
[0125] The sixth preset condition is that the sampling count indicator is within the second preset range.
[0126] Furthermore, based on the above embodiments of the invention, determining the sampling timestamp according to preset conditions includes:
[0127] When the first preset condition and the second preset condition are met, the sampling timestamp is determined as the first target value;
[0128] When the first preset condition is met but the second and fourth preset conditions are not met, the sampling timestamp is determined as the first target value;
[0129] If the first, fourth, and fifth preset conditions are met, but the second preset condition is not met, the sampling timestamp is determined as the second target value.
[0130] If the first, fourth, and sixth preset conditions are met, but the second and fifth preset conditions are not met, the sampling timestamp is determined as the third target value.
[0131] If the first and fourth preset conditions are met, but the second, fifth, and sixth preset conditions are not met, the sampling timestamp is determined as the first target value.
[0132] If the first and third preset conditions are not met, the sampling timestamp is determined as the fourth target value;
[0133] If the first and fourth preset conditions are not met, but the third preset condition is met, the sampling timestamp is determined as the fourth target value.
[0134] If the first preset condition is not met, but the third, fourth, and fifth preset conditions are met, the sampling timestamp is determined as the second target value.
[0135] If the first and fifth preset conditions are not met, but the third, fourth, and sixth preset conditions are met, the sampling timestamp is determined as the third target value.
[0136] If the first, fifth, and sixth preset conditions are not met, but the third and fourth preset conditions are met, the sampling timestamp is determined as the fourth target value.
[0137] In this embodiment of the invention, when the synchronization status identifier is a preset identifier value (i.e., the synchronization status is valid), the final sampling timestamp T3 is determined according to the following steps:
[0138] ① When the first preset condition (historical sampling timestamp = 0) and the second preset condition (T1 = 0) are met, that is, when the historical sampling timestamp is 0 and T1 = 0, the sampling timestamp T3 is determined to be the first target value, i.e., 0, because the reference time T1 is invalid and there is no valid historical data.
[0139] ② When the first preset condition (historical sampling timestamp = 0) is met, the second preset condition (T1 ≠ 0) is not met, and the fourth preset condition (the difference between T2 and T1 exceeds the first preset range) is not met, the sampling timestamp T3 is determined to be the first target value, i.e., 0, due to abnormal transmission delay (indicating that the data is unreliable).
[0140] ③ When the first preset condition (historical sampling timestamp = 0) is met, the second preset condition (T1 ≠ 0) is not met, the fourth preset condition (delay is normal) is met, and the fifth preset condition (sampling count identifier is in the second preset range, i.e., at the end of the synchronization period) is met, the sampling timestamp T3 is determined as the second target value; wherein, the second target value can be calculated by the first calculation formula, the first calculation formula is: second target value = first timestamp - synchronization period + sampling count identifier.
[0141] ④ When the first preset condition (historical sampling timestamp = 0) is met, the second preset condition (T1 ≠ 0) is not met, the fourth preset condition (delay is normal) is met, the fifth preset condition (sampling count identifier is not at the end of the synchronization period) is not met, and the sixth preset condition (sampling count identifier is at the beginning of the synchronization period) is met, the sampling timestamp T3 is determined as the third target value; wherein, the third target value can be calculated by the second calculation formula, the second calculation formula is: third target value = first timestamp + sampling count identifier.
[0142] ⑤ When the first preset condition is met (historical sampling timestamp = 0), the second preset condition is not met (T1 ≠ 0), the fourth preset condition is met (delay is normal), but the fifth and sixth preset conditions are not met (counting identifier range is invalid), the sampling timestamp T3 is determined to be the first target value, i.e., 0.
[0143] ⑥ When the first preset condition (historical sampling timestamp ≠ 0) and the third preset condition (the difference between the target timestamps is negative, i.e., the timestamp jumps) are not met, the sampling timestamp T3 is determined to be the fourth target value because the current target calculated value is abnormal; the fourth target value can be calculated by the third calculation formula, which is: fourth target value = historical sampling timestamp + preset step size.
[0144] ⑦ When the first preset condition (historical sampling timestamp ≠ 0) is not met, the third preset condition (difference is non-negative, timestamp has no jump) is met, but the fourth preset condition (delay is abnormal) is not met, the sampling timestamp T3 is determined to be the fourth target value because the transmission is unreliable.
[0145] ⑧ When the first preset condition (historical sampling timestamp ≠ 0) is not met, the third preset condition (no jump) is met, the fourth preset condition (normal delay) is met, and the fifth preset condition (sampling count identifier is at the end of the synchronization period) is met, the sampling timestamp T3 is determined as the second target value.
[0146] ⑨ When the first preset condition (historical sampling timestamp ≠ 0) is not met, the third preset condition (no jump) is met, the fourth preset condition (normal delay) is met, the fifth preset condition (sampling count identifier is not at the end of the synchronization period) is not met, and the sixth preset condition (sampling count identifier is at the beginning of the synchronization period) is met, the sampling timestamp T3 is determined as the third target value.
[0147] ⑩ When the first preset condition is not met (historical sampling timestamp ≠ 0), the third preset condition is met (no jump), the fourth preset condition is met (normal delay), and the fifth and sixth preset conditions are not met (invalid counting identifier range), the sampling timestamp T3 is determined as the fourth target value.
[0148] This invention, through setting up multi-layer condition checks (synchronization status, timestamp continuity, transmission delay rationality, and counting identifier range), enables the system to effectively identify and handle various abnormal situations, filter out invalid or abnormal data, and effectively improve the consistency between the sampling timestamp and the actual sampling time.
[0149] Example 2
[0150] Figure 2 This is a schematic diagram of a timestamp determination system provided in Embodiment 2 of the present invention. Figure 2 As shown, the system includes: a timing synchronization source 21, an inertial measurement unit (IMU) module 22, a timestamp determination system for a first processing unit 23 and a second processing unit 24. The functions of each system unit are described below:
[0151] The timing synchronization source 21 is used to periodically send synchronization signals to the first processing unit 23 and the IMU module 22;
[0152] IMU module 22 is used to receive and synchronize the synchronization signal, collect IMU data according to a preset sampling frequency and send it to the first processing unit 23; the IMU data includes a sampling count identifier, which is used to characterize the time offset of the sampling time of the corresponding IMU data within the corresponding synchronization period.
[0153] The first processing unit 23 is configured to record a corresponding first timestamp in response to a synchronization signal; and, after receiving IMU data, record a corresponding second timestamp and send the IMU data, the first timestamp, and the second timestamp to the second processing unit 24.
[0154] The second processing unit 24 is used to determine the sampling timestamp for each frame of IMU data based on the first timestamp, the second timestamp, and the sampling count identifier corresponding to the IMU data.
[0155] The timestamp determination system provided in the embodiments of the present invention can execute the timestamp determination method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0156] Example 3
[0157] Figure 3 This is a schematic diagram of a timestamp determination system provided in Embodiment 3 of the present invention. Based on the above embodiments, this embodiment refines the timing synchronization source 23 into a GNSS module, the first processing unit into an MCU, and the second processing unit into a SOC. For example... Figure 3 As shown, the GNSS module receives signals from satellites and uses distance calculations to provide real-time position data, and provides PPS signals to the IMU module and MCU. The SOC (System-on-a-Chip) mainly refers to a high-performance computing chip responsible for intelligent driving applications, including IMU data processing. Its primary function is to deduce the timestamp of the IMU module's sampling time for use in intelligent driving applications. The MCU, working in conjunction with the high-performance computing chip in the intelligent driving system, receives the PPS signal from the GNSS module and records the frozen system time T1; receives data from the IMU module via the UART serial port and records the received system time T2; performs integrity checks on the IMU (length check and CRC check); and combines the raw IMU data (inertial measurement data) with the recorded timestamps T1 and T2 into a complete IMU data frame, which is then sent to the SOC.
[0158] Based on the above-described timestamp determination system, Embodiment 3 of the present invention also provides a timestamp determination method, which specifically includes the following steps:
[0159] The S1 and GNSS modules synchronously send PPS signals to the MCU and IMU modules.
[0160] S2. The IMU module performs time synchronization based on the PPS signal and sends IMU data to the MCU through the UART interface. The IMU data includes inertial measurement data, frame synchronization flag (i.e., synchronization status indicator) and frame count (i.e., sampling count indicator).
[0161] S3. After receiving the PPS signal, the MCU records the corresponding first timestamp T1.
[0162] S4. After receiving the IMU data sent by the IMU module, the MCU records the corresponding second timestamp T2.
[0163] S5 and MCU perform integrity checks on the IMU data, including length and CRC information. After the check passes, they encapsulate the IMU data, the first timestamp T1, and the second timestamp T3 into a composite data frame and send it to the SOC via Ethernet protocol (SOME / IP interface).
[0164] After receiving the composite data frame, S6 and SOC deduce the sampling timestamp T3 corresponding to the current frame's IMU data and send it to the algorithm for ADAS function calculation. The specific process of deduce the sampling timestamp T3 is as follows: Figure 4 As shown, the specific process can be referred to in the above embodiments, and will not be repeated here.
[0165] The technical solution provided by this invention, by connecting the IMU module to the MCU, can meet the technical requirements of functional safety for the IMU module; at the same time, the proposed IMU sampling timestamp reverse calculation scheme can reduce the time synchronization accuracy of IMU data due to MCU system scheduling delay (runnable error) and UART serial port transmission delay, thereby providing a stable and reliable time reference for high-level intelligent driving systems.
[0166] Example 4
[0167] Figure 5 This is a schematic diagram of a timestamp determination device provided in Embodiment 4 of the present invention. Figure 5 As shown, the device is applied to a timestamp determination system including a timing synchronization source, an inertial measurement unit (IMU) module, a first processing unit, and a second processing unit, comprising:
[0168] The synchronization signal transmission module 31 is used to periodically send synchronization signals to the first processing unit and the IMU module through a timing synchronization source;
[0169] The first timestamp recording module 32 is used to record the corresponding first timestamp in response to the synchronization signal by the first processing unit.
[0170] The data acquisition module 33 is used to receive and synchronize the synchronization signal through the IMU module, acquire IMU data according to a preset sampling frequency, and send it to the first processing unit. The IMU data includes a sampling count identifier, which is used to characterize the time offset of the sampling time of the corresponding IMU data within the corresponding synchronization period.
[0171] The data transmission module 34 is used to receive IMU data through the first processing unit, record the corresponding second timestamp, and send the IMU data, the first timestamp, and the second timestamp to the second processing unit.
[0172] The timestamp determination module 35 is used by the second processing unit to determine the sampling timestamp for each frame of IMU data based on the first timestamp, the second timestamp, and the sampling count identifier corresponding to the IMU data.
[0173] Furthermore, based on the above embodiments of the invention, the timing synchronization source includes at least: a Global Navigation Satellite System (GNSS) module, and the synchronization signal transmission module 31 is specifically used for:
[0174] The GNSS module periodically generates a second pulse signal as a synchronization signal;
[0175] The GNSS module synchronously sends the second pulse signal to the first processing unit and the IMU module.
[0176] Furthermore, based on the above embodiments of the invention, the first timestamp recording module 32 is specifically used for:
[0177] The first processing unit triggers a hardware interrupt when it detects the edge of the synchronization signal;
[0178] The first processing unit responds to a hardware interrupt by reading the current system clock and recording it as the first timestamp.
[0179] Furthermore, based on the above embodiments of the invention, the data acquisition module 33 is specifically used for:
[0180] After receiving the synchronization signal, the IMU module performs time synchronization operation, sets the internally maintained synchronization status flag, and resets the sampling count flag.
[0181] The IMU module samples data at a preset sampling frequency to obtain inertial measurement data;
[0182] After each data sampling, the IMU module combines the current synchronization status flag, sampling count flag, and inertial measurement data into a frame of IMU data.
[0183] The IMU module sends IMU data to the first processing unit through the first preset communication interface and updates the sampling count identifier according to the preset step size.
[0184] Furthermore, based on the above embodiments of the invention, the data transmission module 34 is specifically used for:
[0185] After receiving the IMU data, the first processing unit reads the current system clock and records it as the second timestamp;
[0186] The first processing unit performs integrity verification on the IMU data;
[0187] After the verification is successful, the first processing unit encapsulates the IMU data, the first timestamp, and the second timestamp into a composite data frame, and sends the composite data frame to the second processing unit through the second preset communication interface.
[0188] Furthermore, based on the above embodiments of the invention, the timestamp determination module 35 is specifically used for:
[0189] The second processing unit receives and parses the composite data frame sent by the first processing unit to obtain the IMU data of the current frame, the synchronization status identifier, the sampling count identifier, the first timestamp and the second timestamp, and the historical sampling timestamp of the previous frame of IMU data.
[0190] The second processing unit determines whether the synchronization status flag is a preset flag value;
[0191] If so, the sampling timestamp will be determined according to the preset conditions;
[0192] If not, then the sampling timestamp is determined as the first target value;
[0193] The preset conditions include at least one of the following:
[0194] The first preset condition is that the historical sampling timestamp is equal to 0;
[0195] The second preset condition is that the first timestamp equals 0;
[0196] The third preset condition is that the target timestamp difference is a non-negative number, and the target timestamp difference = first timestamp + sampling count identifier - historical sampling timestamp;
[0197] The fourth preset condition is that the difference between the second timestamp and the first timestamp is less than or equal to a preset threshold.
[0198] The fifth preset condition is that the sampling count indicator is within the first preset range;
[0199] The sixth preset condition is that the sampling count indicator is within the second preset range.
[0200] Furthermore, based on the above embodiments of the invention, the timestamp determination module 35 is also used for:
[0201] When the first preset condition and the second preset condition are met, the sampling timestamp is determined as the first target value;
[0202] When the first preset condition is met but the second and fourth preset conditions are not met, the sampling timestamp is determined as the first target value;
[0203] If the first, fourth, and fifth preset conditions are met, but the second preset condition is not met, the sampling timestamp is determined as the second target value.
[0204] If the first, fourth, and sixth preset conditions are met, but the second and fifth preset conditions are not met, the sampling timestamp is determined as the third target value.
[0205] If the first and fourth preset conditions are met, but the second, fifth, and sixth preset conditions are not met, the sampling timestamp is determined as the first target value.
[0206] If the first and third preset conditions are not met, the sampling timestamp is determined as the fourth target value;
[0207] If the first and fourth preset conditions are not met, but the third preset condition is met, the sampling timestamp is determined as the fourth target value.
[0208] If the first preset condition is not met, but the third, fourth, and fifth preset conditions are met, the sampling timestamp is determined as the second target value.
[0209] If the first and fifth preset conditions are not met, but the third, fourth, and sixth preset conditions are met, the sampling timestamp is determined as the third target value.
[0210] If the first, fifth, and sixth preset conditions are not met, but the third and fourth preset conditions are met, the sampling timestamp is determined as the fourth target value.
[0211] Furthermore, based on the above-described embodiments of the invention, the first target value is 0;
[0212] The second target value is calculated using the first calculation formula, which is: Second target value = First timestamp - Synchronization period + Sampling count identifier;
[0213] The third target value is calculated using the second calculation formula, which is: Third target value = First timestamp + Sampling count identifier;
[0214] The fourth target value is calculated using the third calculation formula, which is: Fourth target value = Historical sampling timestamp + Preset step size.
[0215] The timestamp determination device provided in the embodiments of the present invention can execute the timestamp determination method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0216] Example 5
[0217] Figure 6A schematic diagram of an electronic device 40 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0218] like Figure 6 As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42 or a random access memory (RAM) 43, communicatively connected to the at least one processor 41. The memory stores computer programs executable by the at least one processor. The processor 41 can perform various appropriate actions and processes based on the computer program stored in the ROM 42 or loaded from storage unit 48 into the RAM 43. The RAM 43 may also store various programs and data required for the operation of the electronic device 40. The processor 41, ROM 42, and RAM 43 are interconnected via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0219] Multiple components in electronic device 40 are connected to I / O interface 45, including: input unit 46, such as keyboard, mouse, etc.; output unit 47, such as various types of monitors, speakers, etc.; storage unit 48, such as disk, optical disk, etc.; and communication unit 49, such as network card, modem, wireless transceiver, etc. Communication unit 49 allows electronic device 40 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0220] Processor 41 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 41 performs the various methods and processes described above, such as the timestamp determination method.
[0221] In some embodiments, the timestamp determination method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the timestamp determination method described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to perform the timestamp determination method by any other suitable means (e.g., by means of firmware).
[0222] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0223] In some embodiments, the timestamp determination method may be implemented as a computer program, which is implicitly included in a computer program product. When executed by a processor, the computer program implements the timestamp determination method of the present invention. The computer program product can be understood as a software product that primarily implements its solution through a computer program. The computer program used to implement the method of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer program causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer program may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0224] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0225] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0226] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0227] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0228] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0229] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A timestamp determination method, characterized in that, The method, applied to a timestamp determination system including a timing synchronization source, an inertial measurement unit (IMU) module, a first processing unit, and a second processing unit, comprises: The timing synchronization source periodically sends synchronization signals to the first processing unit and the IMU module; The first processing unit responds to the synchronization signal by recording the corresponding first timestamp; After receiving and synchronizing the synchronization signal, the IMU module collects IMU data according to a preset sampling frequency and sends it to the first processing unit; the IMU data includes a sampling count identifier, which is used to characterize the time offset of the sampling time of the corresponding IMU data within the corresponding synchronization period. After receiving the IMU data, the first processing unit records the corresponding second timestamp and sends the IMU data, the first timestamp, and the second timestamp to the second processing unit. The second processing unit determines the sampling timestamp for each frame of IMU data based on the first timestamp, the second timestamp, and the sampling count identifier corresponding to the IMU data; Wherein, after receiving and synchronizing the synchronization signal, the IMU module collects IMU data according to a preset sampling frequency and sends it to the first processing unit, including: After receiving the synchronization signal, the IMU module performs a time synchronization operation, sets the internally maintained synchronization status flag, and resets the sampling count flag. The IMU module samples data according to the preset sampling frequency to obtain inertial measurement data; After each data sampling, the IMU module combines the current synchronization status identifier, the sampling count identifier, and the inertial measurement data into a frame of IMU data. The IMU module sends the IMU data to the first processing unit through a first preset communication interface, and updates the sampling count identifier according to a preset step size; The second processing unit determines a sampling timestamp for each frame of IMU data based on the first timestamp, the second timestamp, and the sampling count identifier corresponding to the IMU data, including: The second processing unit receives and parses the composite data frame sent by the first processing unit to obtain the IMU data, synchronization status identifier, sampling count identifier, first timestamp and second timestamp of the current frame, and to obtain the historical sampling timestamp of the IMU data of the previous frame; The second processing unit determines whether the synchronization status identifier is a preset identifier value; If so, the sampling timestamp is determined according to preset conditions; If not, then the sampling timestamp is determined to be the first target value; The preset conditions include at least one of the following: The first preset condition is that the historical sampling timestamp is equal to 0; The second preset condition is that the first timestamp equals 0; The third preset condition is that the target timestamp difference is a non-negative number, wherein the target timestamp difference = first timestamp + sampling count identifier - historical sampling timestamp; The fourth preset condition is that the difference between the second timestamp and the first timestamp is less than or equal to a preset threshold. The fifth preset condition is that the sampling count indicator is within the first preset range; The sixth preset condition is that the sampling count identifier is within the second preset range.
2. The method according to claim 1, characterized in that, The timing synchronization source includes at least a Global Navigation Satellite System (GNSS) module, and the timing synchronization source periodically sends synchronization signals to the first processing unit and the IMU module, including: The GNSS module periodically generates a second pulse signal as the synchronization signal; The GNSS module synchronously sends the second pulse signal to the first processing unit and the IMU module.
3. The method according to claim 1, characterized in that, The first processing unit, in response to the synchronization signal, records the corresponding first timestamp, including: When the first processing unit detects the edge of the synchronization signal, it triggers a hardware interrupt; In response to the hardware interrupt, the first processing unit reads the current system clock and records it as the first timestamp.
4. The method according to claim 1, characterized in that, After receiving the IMU data, the first processing unit records the corresponding second timestamp and sends the IMU data, the first timestamp, and the second timestamp to the second processing unit, including: After receiving the IMU data, the first processing unit reads the current system clock and records it as the second timestamp; The first processing unit performs integrity verification on the IMU data; After the first processing unit passes the verification, it encapsulates the IMU data, the first timestamp, and the second timestamp into a composite data frame and sends the composite data frame to the second processing unit through the second preset communication interface.
5. The method according to claim 1, characterized in that, Determining the sampling timestamp according to preset conditions includes: When the first preset condition and the second preset condition are met, the sampling timestamp is determined to be the first target value; When the first preset condition is met but the second preset condition and the fourth preset condition are not met, the sampling timestamp is determined to be the first target value; If the first preset condition, the fourth preset condition, and the fifth preset condition are met, but the second preset condition is not met, the sampling timestamp is determined to be the second target value. When the first preset condition, the fourth preset condition, and the sixth preset condition are met, but the second preset condition and the fifth preset condition are not met, the sampling timestamp is determined to be the third target value; When the first preset condition and the fourth preset condition are met, but the second preset condition, the fifth preset condition and the sixth preset condition are not met, the sampling timestamp is determined to be the first target value; If the first preset condition and the third preset condition are not met, the sampling timestamp is determined to be the fourth target value; If the first preset condition and the fourth preset condition are not met, but the third preset condition is met, the sampling timestamp is determined to be the fourth target value; If the first preset condition is not met, but the third, fourth, and fifth preset conditions are met, the sampling timestamp is determined to be the second target value. If the first preset condition and the fifth preset condition are not met, but the third preset condition, the fourth preset condition and the sixth preset condition are met, the sampling timestamp is determined to be the third target value; If the first preset condition, the fifth preset condition, and the sixth preset condition are not met, but the third preset condition and the fourth preset condition are met, the sampling timestamp is determined to be the fourth target value.
6. The method according to claim 5, characterized in that, The first target value is 0; The second target value is calculated using the first calculation formula, which is: Second target value = First timestamp - Synchronization period + Sampling count identifier; The third target value is calculated using a second calculation formula, which is: Third target value = First timestamp + Sampling count identifier; The fourth target value is calculated using the third calculation formula, which is: Fourth target value = Historical sampling timestamp + Preset step size.
7. A timestamp determination device, characterized in that, An apparatus for determining timestamps, applicable to a time-stamping system comprising a timing synchronization source, an inertial measurement unit (IMU) module, a first processing unit, and a second processing unit, wherein the apparatus includes: A synchronization signal transmission module is used to periodically send synchronization signals to the first processing unit and the IMU module through the timing synchronization source; The first timestamp recording module is used to record the corresponding first timestamp in response to the synchronization signal by the first processing unit. The data acquisition module is used to receive and synchronize the synchronization signal through the IMU module, acquire IMU data according to a preset sampling frequency, and send it to the first processing unit; the IMU data includes a sampling count identifier, which is used to characterize the time offset of the sampling time of the corresponding IMU data within the corresponding synchronization period. The data transmission module is used to receive the IMU data through the first processing unit, record the corresponding second timestamp, and send the IMU data, the first timestamp, and the second timestamp to the second processing unit. The timestamp determination module is used by the second processing unit to determine the sampling timestamp for each frame of IMU data based on the first timestamp, the second timestamp, and the sampling count identifier corresponding to the IMU data; Specifically, the data acquisition module is used for: After receiving the synchronization signal, the IMU module performs a time synchronization operation, sets the internally maintained synchronization status flag, and resets the sampling count flag. The IMU module samples data according to the preset sampling frequency to obtain inertial measurement data; After each data sampling, the IMU module combines the current synchronization status identifier, the sampling count identifier, and the inertial measurement data into a frame of IMU data. The IMU module sends the IMU data to the first processing unit through a first preset communication interface, and updates the sampling count identifier according to a preset step size; The timestamp determination module is specifically used for: The second processing unit receives and parses the composite data frame sent by the first processing unit to obtain the IMU data, synchronization status identifier, sampling count identifier, first timestamp and second timestamp of the current frame, and to obtain the historical sampling timestamp of the IMU data of the previous frame; The second processing unit determines whether the synchronization status identifier is a preset identifier value; If so, the sampling timestamp is determined according to preset conditions; If not, then the sampling timestamp is determined to be the first target value; The preset conditions include at least one of the following: The first preset condition is that the historical sampling timestamp is equal to 0; The second preset condition is that the first timestamp equals 0; The third preset condition is that the target timestamp difference is a non-negative number, wherein the target timestamp difference = first timestamp + sampling count identifier - historical sampling timestamp; The fourth preset condition is that the difference between the second timestamp and the first timestamp is less than or equal to a preset threshold. The fifth preset condition is that the sampling count indicator is within the first preset range; The sixth preset condition is that the sampling count identifier is within the second preset range.
8. A timestamp determination system, characterized in that, The system includes: a timing synchronization source, an inertial measurement unit (IMU) module, a timestamp determination system for a first processing unit and a second processing unit; wherein... The timing synchronization source is used to periodically send synchronization signals to the first processing unit and the IMU module; The IMU module is used to receive and synchronize the synchronization signal, collect IMU data according to a preset sampling frequency, and send it to the first processing unit; the IMU data includes a sampling count identifier, which is used to characterize the time offset of the sampling time of the corresponding IMU data within the corresponding synchronization period. The first processing unit is configured to, in response to the synchronization signal, record a corresponding first timestamp; and, after receiving the IMU data, record a corresponding second timestamp, and send the IMU data, the first timestamp, and the second timestamp to the second processing unit. The second processing unit is configured to determine a sampling timestamp for each frame of IMU data based on the first timestamp, the second timestamp, and the sampling count identifier corresponding to the IMU data; Specifically, the IMU module is used for: Upon receiving the synchronization signal, a time synchronization operation is performed, and the internally maintained synchronization status flag is set, as well as the sampling count flag is reset. Data is sampled according to the preset sampling frequency to obtain inertial measurement data; After each data sampling is completed, the current synchronization status identifier, the sampling count identifier, and the inertial measurement data are combined into a frame of IMU data; The IMU data is sent to the first processing unit through the first preset communication interface, and the sampling count identifier is updated according to a preset step size; The second processing unit is specifically used for: Receive and parse the composite data frame sent by the first processing unit to obtain the IMU data, synchronization status identifier, sampling count identifier, first timestamp and second timestamp of the current frame, and obtain the historical sampling timestamp of the IMU data of the previous frame; Determine whether the synchronization status flag is a preset flag value; If so, the sampling timestamp is determined according to preset conditions; If not, then the sampling timestamp is determined to be the first target value; The preset conditions include at least one of the following: The first preset condition is that the historical sampling timestamp is equal to 0; The second preset condition is that the first timestamp equals 0; The third preset condition is that the target timestamp difference is a non-negative number, wherein the target timestamp difference = first timestamp + sampling count identifier - historical sampling timestamp; The fourth preset condition is that the difference between the second timestamp and the first timestamp is less than or equal to a preset threshold. The fifth preset condition is that the sampling count indicator is within the first preset range; The sixth preset condition is that the sampling count identifier is within the second preset range.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the timestamp determination method according to any one of claims 1-6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the timestamp determination method according to any one of claims 1-6.
11. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the timestamp determination method according to any one of claims 1-6.
Citation Information
Patent Citations
Synchronous board card and method for data acquisition of sensor equipment
CN111309094A
Multi-sensor time synchronization method and device
CN112945228A