Natural driving multi-source heterogeneous data synchronous processing method

Multi-threading and ring buffer technology are used to synchronize multi-sensor data in natural driving, solving the problem of sensor data synchronization at different frequencies, achieving efficient and accurate data processing, and ensuring the accuracy and integrity of algorithm results.

CN118590499APending Publication Date: 2024-09-03JILIN UNIVERSITY
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410653253.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

Synchronous processing of multi-sensor and different frequency sensor data in natural driving has problems of data loss and calculation inaccuracy, especially during the time synchronization process between high-frequency sensors and low-frequency sensors, resulting in inaccurate subsequent algorithm results.

Method used

It adopts multi-threaded data acquisition module and ring buffer technology to add time stamps to sensors through a unified clock source, and uses efficient ring buffers and smart pointers to perform soft synchronization processing of high-frequency and low-frequency sensor data to ensure real-time and accurate data sex.

Benefits of technology

It achieves efficient and real-time synchronization of multi-sensor data without significantly reducing the acquisition frequency, maximizing the use of system performance, ensuring the integrity and accuracy of data, and providing more complete data support for subsequent algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118590499A
    Figure CN118590499A
Patent Text Reader

Abstract

The invention relates to a natural driving multi-source heterogeneous data synchronous processing method, which comprises the following steps that: a multi-thread data acquisition module continuously pre-acquires different sensor signals and stores the different sensor signals into an acquired data buffer module, and high-frequency and low-frequency sensor data synchronous modules take pre-acquired data from the acquired data buffer module; and the multi-source heterogeneous data synchronization module performs time soft synchronization on the high-frequency sensor data buffer module and the low-frequency sensor data buffer module respectively, the synchronized results are stored in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module respectively, and the multi-source heterogeneous data synchronization module performs secondary synchronization on the data in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module to obtain a final synchronization processing result and stores the final synchronization processing result in the synchronous data storage module. According to the method, the problems of soft synchronization and subsequent data processing among different-frequency sensor data of multiple sensors in natural driving data acquisition are solved, and finally, low-frequency sensor synchronization data of the Tth frame and high-frequency sensor synchronization data from the (T-1) th frame to the Tth frame are obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a method for synchronously processing multi-source heterogeneous data of natural driving. Background Art

[0002] Natural driving data is the basis of intelligent vehicle algorithm models. Multi-source heterogeneous data integrates the signal input of multiple sensor information and has higher application value in the field of multi-sensor fusion. Different from a single sensor, multi-sensor data needs to be processed synchronously to obtain data collected by different sensors at the same time to be used in subsequent fusion algorithms. However, due to the different acquisition frequencies and operating efficiencies of various sensors, the synchronization problem of multi-source heterogeneous data is brought about. In the previous time synchronization task, only high-frequency and low-frequency sensors at the same time T can be synchronized, ignoring all high-frequency sensor synchronization data between the T-1 frame and the T frame. For multi-sensor fusion algorithms that use high-frequency sensor data, the results will be inaccurate due to the loss of a large amount of data. In addition, since the different sensor data after time synchronization are saved separately, it is not convenient to obtain all the required synchronization data at one time, which also brings inconvenience to subsequent research. For example, in the odometer estimation problem of smart cars, the multi-frame IMU and wheel speed meter signals between two frames of the camera are integrated to correctly estimate the vehicle odometer results within the same time period. Therefore, it is necessary to synchronize the time of multiple sensors and perform data processing, and treat the synchronized data as a group, which is more convenient for subsequent algorithm research.

[0003] Time synchronization mainly includes hard synchronization and soft synchronization. This study mainly focuses on soft synchronization technology and data processing, that is, on the basis of providing the same clock source for different sensors, different sensor data at the same time are obtained from the software level, and high-frequency sensor data that cannot be synchronized with low-frequency sensor data is retained. At present, the main problem of this part of the research is that the data collected by sensors of different frequencies are not distinguished, resulting in only one data being retained for one sensor at the same time after time synchronization. For example, for sensors such as IMU with a frequency of more than 100hz, a large amount of data is sacrificed because of the need to synchronize with a camera with a frequency of 30hz. The frequency of the synchronized data obtained in the end may be only 24hz, and the significant loss of high-frequency sensor data will seriously affect the accuracy of subsequent calculation results. In addition, in soft synchronization, the processing of a large amount of data from different sensors is involved. If it cannot be processed in real time, it will not only affect the efficiency of subsequent data collection, but also have a certain impact on the real-time performance of subsequent algorithms. Therefore, there is an urgent need for a synchronous processing method for real-time processing of high-frequency and low-frequency sensor data, which can maximize the use of system performance while ensuring less data loss, so as to ensure the accuracy and reliability of the entire synchronization processing process. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides a method for synchronously processing multi-source heterogeneous data of natural driving, comprising the following steps:

[0005] (1) The multi-threaded data acquisition module pre-collects high-frequency sensor data and low-frequency sensor data in real time, and temporarily stores the collected sensor data in the memory of the vehicle computing device; each type of sensor data has a corresponding thread to collect and process; a unified clock source is used to provide the same reference time to each sensor, and a timestamp is added to the collected data according to the time information to obtain time calibration data; the time calibration data is encapsulated into a smart pointer to obtain pointer data of different sensor signals, and finally the pointer data of different sensors are sent to the data acquisition buffer module;

[0006] (2) The high-frequency sensor data synchronization module receives the pointer data in several high-frequency sensor buffers in the data acquisition buffer module, and then performs time soft synchronization on all the high-frequency sensor pointer data, that is, stores the high-frequency sensor data collected at the same time together to obtain the high-frequency sensor synchronization pointer data; the low-frequency sensor data synchronization module receives the pointer data in several low-frequency sensor buffers in the data acquisition buffer module, and then performs time soft synchronization on all the low-frequency sensor pointer data, that is, stores the low-frequency sensor data collected at the same time together to obtain the low-frequency sensor synchronization pointer data;

[0007] (3) The high-frequency sensor synchronization pointer data and the low-frequency sensor synchronization pointer data are sent to the high-frequency sensor data buffer module and the low-frequency sensor data buffer module respectively; the high-frequency sensor data buffer module receives the high-frequency sensor synchronization pointer data in the high-frequency sensor data synchronization module, builds a thread-safe and efficient circular buffer, sequentially stores the high-frequency sensor synchronization pointer data to the tail of the corresponding circular buffer, and sends the high-frequency sensor synchronization pointer data to the multi-source heterogeneous data synchronization module from the head of the circular buffer; the low-frequency sensor data buffer module receives the low-frequency sensor synchronization pointer data in the low-frequency sensor data synchronization module, builds a thread-safe and efficient circular buffer, sequentially stores the low-frequency sensor synchronization pointer data to the tail of the corresponding circular buffer, and sends the low-frequency sensor synchronization pointer data to the multi-source heterogeneous data synchronization module from the head of the circular buffer;

[0008] (4) The multi-source heterogeneous data synchronization module performs secondary synchronization on the data in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module: The multi-source heterogeneous data synchronization module receives the high-frequency sensor synchronization pointer data and the low-frequency sensor synchronization pointer data in the high-frequency and low-frequency sensor data buffer modules, performs initial time alignment on the high-frequency and low-frequency sensor synchronization pointer data, and then performs time soft synchronization on the pointer data. Based on the timestamp of the low-frequency sensor synchronization pointer data, the synchronization pointer data of the low-frequency sensor at the Tth frame is found, and the high-frequency sensor pointer data at the same timestamp is obtained by the difference method. Then, the high-frequency sensor synchronization pointer data between the T-1 frame and the Tth frame is found, and these data are stored together to obtain a frame of multi-source heterogeneous synchronization pointer data. Finally, the multi-source heterogeneous synchronization pointer data is sent to the synchronization data storage module.

[0009] The high-frequency sensor and low-frequency sensor described in the present invention are not limited to a certain frequency. The method of the present invention can be used only when the acquisition frequency of one sensor is more than twice that of the other, and it is necessary to obtain a synchronized frame of low-frequency sensor data and corresponding multiple frames of high-frequency sensor data.

[0010] In addition, the present method is not limited to secondary synchronization. The secondary synchronization method can be viewed as a whole. If data synchronization processing is required for sensors of three frequency levels, secondary synchronization processing can be performed on the data of two relatively higher-frequency sensors first, and the obtained results can be synchronized with the lowest-frequency sensor for secondary processing. That is, the synchronization processing of sensor data of three frequency levels can be achieved through three synchronizations, and sensors of more frequency levels can be processed in this way by analogy.

[0011] Furthermore, the high-frequency sensor refers to a sensor with a collection frequency higher than a preset frequency, including but not limited to: a GNSS receiver, an inertial measurement unit, etc.; the high-frequency sensor data includes but is not limited to the latitude and longitude, altitude data collected by the GNSS receiver and the angular velocity and acceleration data collected by the inertial measurement unit;

[0012] The low-frequency sensor refers to a sensor whose acquisition frequency is lower than a preset frequency, including but not limited to: binocular camera, laser radar, etc.; the low-frequency sensor data includes but is not limited to image data collected by binocular camera and point cloud data collected by laser radar.

[0013] Furthermore, the data acquisition buffer module is used to cache the data collected in the multi-threaded data acquisition module, and transmit the data to the high-frequency sensor data synchronization module and the low-frequency sensor data synchronization module; the data acquisition buffer module receives pointer data of different sensor signals, constructs a separate, thread-safe and efficient circular buffer for the pointer data of different sensor signals, and stores the pointer data sequentially at the end of the corresponding circular buffer; outputs the high-frequency sensor pointer data from the head of the circular buffer to the high-frequency sensor data synchronization module, and outputs the low-frequency sensor pointer data to the low-frequency sensor data synchronization module; according to the type of data collected in the multi-threaded data acquisition module, several circular buffers are correspondingly arranged in the data acquisition buffer module.

[0014] Furthermore, the workflow of the high-frequency sensor data synchronization module described in step (2) is as follows:

[0015] A loop is executed in the high-frequency sensor data synchronization module, and the loop mainly includes three steps: loop start, time synchronization and high-frequency sensor synchronization pointer data output;

[0016] The loop start step: at the beginning of each execution loop, determine whether the sensor data buffers are not empty, and execute the following steps only if the buffers are not empty, otherwise the thread waits for a certain period of time and then repeats the loop;

[0017] The time synchronization step: first, use the search interface in the data acquisition buffer module to take the oldest frame of data at the head of the high-frequency sensor data buffer as a group to obtain the data group to be synchronized, and then determine whether the maximum difference △t of all data timestamps in the data group to be synchronized exceeds a certain threshold T; when △t>T, delete the data with the smallest timestamp in the data group to be synchronized from its buffer, and repeat the cycle; when △t≤T, find the smallest timestamp in the data group to be synchronized to obtain the high-frequency sensor synchronization timestamp, and encapsulate the data group to be synchronized and the high-frequency sensor synchronization timestamp into a smart pointer to obtain the high-frequency sensor synchronization pointer data;

[0018] The high-frequency sensor synchronization pointer data output step: finally, a frame of high-frequency sensor synchronization pointer data obtained by synchronization is sent to the high-frequency sensor data buffer module, and the cycle is repeated.

[0019] Furthermore, the workflow of the low-frequency sensor data synchronization module described in step (3) is as follows:

[0020] A loop is executed in the low-frequency sensor data synchronization module, and the loop mainly includes three steps: loop start, time synchronization and low-frequency sensor synchronization pointer data output;

[0021] The loop start step: at the start of each execution loop, determine whether the low-frequency sensor data buffer is not empty, and execute the following steps only if the buffer is not empty, otherwise the thread waits for a certain period of time and then repeats the loop;

[0022] The time synchronization step: first, use the search interface in the data acquisition buffer module to take the oldest frame of data at the head of the low-frequency sensor data buffer as a group to obtain the data group to be synchronized, and then determine whether the maximum difference △t of all data timestamps in the data group to be synchronized exceeds a certain threshold T; when △t>T, delete the data with the smallest timestamp in the data group to be synchronized from its buffer, and repeat the cycle; when △t≤T, calculate the average value of all data timestamps in the data group to be synchronized to obtain the low-frequency sensor synchronization timestamp, encapsulate the data group to be synchronized and the low-frequency sensor synchronization timestamp into a smart pointer, and obtain the low-frequency sensor synchronization pointer data;

[0023] The low-frequency sensor synchronization pointer data output step: finally, a frame of low-frequency sensor synchronization pointer data obtained by synchronization is sent to the low-frequency sensor data buffer module, and the cycle is repeated.

[0024] Furthermore, the workflow of the multi-source heterogeneous data synchronization module described in step (4) is as follows:

[0025] A loop is executed in the multi-source heterogeneous data synchronization module to repeatedly read the data in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module; the loop mainly includes: loop start, initial synchronization, high-frequency sensor data interpolation, high- and low-frequency sensor data synchronization, and multi-source heterogeneous synchronization pointer data output;

[0026] (4.1) The loop start step: At the start of each execution loop, determine whether there is data in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module. If and only if there is data in both, execute the following steps. Otherwise, the thread waits for a certain period of time and then repeats the loop.

[0027] (4.2) The initial synchronization step: when the data performs multi-source heterogeneous data synchronization for the first time, the high-frequency sensor synchronization pointer data and the low-frequency sensor synchronization pointer data are initially timestamped. This step is only performed once when the multi-source heterogeneous data synchronization operation is performed for the first time;

[0028] (4.3) The high-frequency sensor data interpolation step: aligning the high-frequency and low-frequency sensor data each time the multi-source heterogeneous data is synchronized; storing the current frame of the low-frequency sensor synchronization data and the high-frequency sensor synchronization data between the previous frame and the current frame in a container in sequence according to the timestamp; using the interpolation method to obtain the high-frequency sensor synchronization data at the timestamp of the low-frequency sensor synchronization data, and also storing it in the container; obtaining a set of high-frequency sensor synchronization data with aligned timestamps stored in the container;

[0029] (4.4) The high-frequency and low-frequency sensor data synchronization step: after completing the high-frequency sensor data interpolation step, encapsulating the set of high-frequency sensor synchronization data with aligned timestamps and the oldest frame of data at the head of the low-frequency sensor data buffer together to obtain a set of multi-source heterogeneous synchronization data;

[0030] (4.5) The multi-source heterogeneous synchronous pointer data output step: encapsulate a set of multi-source heterogeneous synchronous data into a smart pointer to obtain multi-source heterogeneous synchronous pointer data, and finally send the multi-source heterogeneous synchronous pointer data to the synchronous data storage module, and remove this set of pointer data from the high-frequency and low-frequency sensor data buffer modules, and then repeat the loop step.

[0031] Furthermore, the initial synchronization step of step (4.2) is as follows:

[0032] The multi-source heterogeneous data synchronization module needs to record a frame of low-frequency sensor synchronization pointer data and a set of corresponding high-frequency sensor synchronization pointer data up to the previous frame of low-frequency sensor synchronization pointer data; firstly, in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module, it is determined that the timestamp t of the oldest frame of high-frequency sensor synchronization pointer data at the head of the buffer is 高旧 The time stamp t of the pointer data synchronized with the low-frequency sensor 低旧 Condition;

[0033] When t 低旧 <t 高旧 When , delete the oldest frame of data at the head of the low-frequency sensor data buffer module, and execute the loop again;

[0034] When t 低旧 >t 高旧 When the oldest frame of data in the low-frequency sensor data buffer is deleted, 低旧 , and the timestamp in the high-frequency sensor data buffer is less than or equal to t 低旧 All data sets {d 高}; At this point, the high-frequency and low-frequency sensor data have achieved timestamp alignment, and the initial synchronization has been completed.

[0035] Furthermore, the high-frequency sensor data interpolation step in step (4.3) is as follows:

[0036] First, it is necessary to ensure that both the high-frequency and low-frequency sensor data buffer modules have data, and the timestamp of the latest frame of data at the end of the high-frequency sensor data buffer is t 高新 Greater than the timestamp t of the low-frequency sensor synchronization pointer data 低旧 Otherwise, the thread waits for a certain period of time and then repeats the cycle; if the conditions are met, the timestamp is less than t 低旧 All high-frequency sensor synchronization pointer data in the high-frequency sensor data buffer are stored in a container in ascending order of timestamps. When the container is not empty and has no connection with t 低旧 When the high-frequency sensor synchronization pointer data with equal timestamps is used, the interpolation operation is performed, otherwise the oldest frame of data in the low-frequency sensor data buffer is deleted and the cycle is repeated; the interpolation can adopt the linear interpolation method, which is to use the position at t 低旧 The two high-frequency sensor data d1 and d2 on both sides of the timestamp are linearly interpolated with the corresponding timestamps t1 and t2 to obtain t 低旧 The high-frequency sensor interpolation data d at the timestamp is expressed as:

[0037]

[0038] In the formula, t 低旧 Indicates the timestamp of the oldest frame of low-frequency sensor synchronization pointer data at the head of the low-frequency sensor data buffer; d indicates the interpolated t 低旧 High-frequency sensor synchronization data at the timestamp; d1 indicates that the timestamp in the high-frequency sensor data buffer is less than t 低旧 The latest frame of data; d2 indicates that the timestamp in the high-frequency sensor data buffer is greater than t 低旧 The oldest frame of data; t1 represents the timestamp corresponding to d1; t2 represents the timestamp corresponding to d2;

[0039] The high-frequency sensor synchronization data at the timestamp of the low-frequency sensor synchronization data is then recorded into the above container to obtain a group of high-frequency sensor synchronization data with aligned timestamps.

[0040] The thread-safe and efficient ring buffer in the acquisition data buffer module, the high-frequency sensor data buffer module and the low-frequency sensor data buffer module is used for data communication between two independently running threads; the thread-safe and efficient ring buffer is a data structure, which is constructed in the memory space of the data acquisition device and is used to solve the data synchronization problem in a multi-threaded environment, ensuring that no data competition or inconsistent state occurs during concurrent read and write operations; the ring buffer adopts a thread lock mechanism to provide comprehensive thread safety, and the thread lock is a synchronization mechanism used to protect shared resources in multi-threads, preventing multiple threads from accessing and modifying the same data at the same time, thereby ensuring the consistency and correctness of the data; the ring buffer mainly includes 5 key components: an input interface, a storage unit, a pointer unit, a search interface and a deletion interface;

[0041] The input interface is used for the producer thread, allowing the producer thread to perform data insertion operations at the logical tail position of the buffer. A thread lock mechanism is used to ensure the mutual exclusivity of the write operation and avoid frequent thread blocking. When the buffer is full, the input interface can implement a blocking strategy or provide a signal notification mechanism so that the producer thread can appropriately slow down the production speed.

[0042] The storage unit is used to store data and is composed of a group of continuously allocated memory blocks, and its capacity is preset. The storage units are connected end to end to form a logical ring structure, so that the data can automatically wrap back to the starting position when reaching the buffer boundary.

[0043] The pointer unit is used to determine the starting and ending positions of the buffer, and includes two independent pointer variables, namely the read pointer and the write pointer. The read pointer indicates the starting position of the data to be consumed in the buffer, while the write pointer marks the position where the next data will be written. In order to maintain the circular characteristics, the pointer will be repositioned by modulo operation when it exceeds the buffer capacity.

[0044] The search interface is used to provide efficient search functions, allowing the query of data items at specific locations or meeting certain conditions in the buffer. The search process is also thread-protected, and the thread lock mechanism is used to ensure that the search operation does not affect the ongoing write or delete actions, and supports read-only access to improve performance.

[0045] The deletion interface is designed for the consumer thread and is responsible for safely removing the consumed data from the buffer head. The deletion operation is accompanied by a corresponding synchronization mechanism, using a thread lock mechanism to ensure that the read pointer can only be updated when it has not been modified by other threads, and increment the read pointer after the data is successfully deleted.

[0046] Beneficial effects of the present invention:

[0047] The present invention aims to solve the problem of soft synchronization and subsequent data processing between multi-sensor sensor data of different frequencies in natural driving data collection, and finally obtain the low-frequency sensor synchronization data of the Tth frame and the high-frequency sensor synchronization data between the T-1th frame and the Tth frame. The obtained data can be directly used for online calculation of subsequent algorithms, or collected into a storage medium for data playback. The method of the present invention can be used regardless of whether the multi-source sensors are time synchronized at the hardware level.

[0048] The present invention solves the data synchronization problem caused by factors such as different starting acquisition times and acquisition frequencies of different sensors in multi-sensor fusion. The core advantage lies in that the sensors are divided into high-frequency and low-frequency types. From the software level, the high-frequency sensor signal between two frames of the low-frequency sensor signal is retained during the data synchronization processing, and one frame of low-frequency sensor signal and multiple frames of high-frequency sensor signal are synchronously processed to obtain a frame of synchronization signal as output, providing more complete and easier data for subsequent calculations.

[0049] The present invention is applicable to various sensors used in natural driving, such as lidar, camera, vehicle chassis sensor, millimeter wave radar and inertial navigation system, and can be used regardless of whether multiple sensors are synchronized at the hardware level.

[0050] The present invention is not only applicable to data acquisition systems, but also can be used for real-vehicle online calculations. While achieving high-precision synchronous processing, it fully considers the real-time requirements. The present invention adopts multi-threading technology to synchronously process high-frequency and low-frequency sensor data at the same time, uses thread-safe ring buffers to achieve communication between multiple threads, and uses smart pointers for data storage, which reduces the computing and communication burdens and improves the operating efficiency of the entire system. At the software level, it is efficient and real-time, and without significantly reducing the acquisition frequency, it achieves high-performance multi-sensor data synchronization processing.

[0051] Therefore, the present invention has demonstrated significant beneficial effects in achieving efficient and accurate synchronization of multi-sensor data and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 A schematic diagram of the overall architecture provided for an embodiment of the present invention;

[0053] Figure 2 This is a schematic diagram of the working process of the high-frequency sensor data synchronization module in an embodiment of the present invention;

[0054] Figure 3 Schematic diagram of the working process of the low-frequency sensor data synchronization module in an embodiment of the present invention;

[0055] Figure 4Schematic diagram of the workflow of the multi-source heterogeneous data synchronization module in an embodiment of the present invention. DETAILED DESCRIPTION

[0056] See also Figure 1 As shown, the present invention includes 8 main modules: a multi-threaded data acquisition module, an acquisition data buffer module, a high-frequency sensor data synchronization module, a low-frequency sensor data synchronization module, a high-frequency sensor data buffer module, a low-frequency sensor data buffer module, a multi-source heterogeneous data synchronization module and a synchronous data storage module. This embodiment provides a natural driving multi-source heterogeneous data synchronization processing method, including the following steps:

[0057] (1) The multi-threaded data acquisition module pre-collects high-frequency sensor data and low-frequency sensor data in real time, and temporarily stores the collected sensor data in the memory of the vehicle-mounted computing device; each type of sensor data has a corresponding thread to collect and process; a unified clock source is used to provide the same reference time to each sensor, and each sensor calibrates its own clock time according to the provided reference time, thereby determining the time information, and adding a timestamp to the collected data according to the time information to obtain the time calibration data; the time calibration data is encapsulated into a smart pointer to obtain the pointer data of different sensor signals, and finally the pointer data of different sensors are sent to the collection data buffer module;

[0058] In this embodiment, the high-frequency sensor refers to a sensor with a collection frequency higher than 50Hz, including: a GNSS receiver, a sensor for collecting real-time location data, which can receive GPS signals, provide high-precision, all-weather navigation, positioning and timing services worldwide, and can measure longitude, latitude, altitude and other signals; an inertial measurement unit, a sensor for collecting angular velocity and acceleration data during motion. The GNSS receiver and the inertial measurement unit have a collection frequency of 100Hz; the high-frequency sensor data includes the real-time location data (latitude, longitude, altitude) collected by the GNSS receiver and the data collected by the inertial measurement unit during motion (angular velocity, acceleration).

[0059] The low-frequency sensor refers to a sensor with a collection frequency lower than 50Hz, including: a binocular camera, a sensor for collecting left and right image data; a 32-line laser radar, a sensor for collecting three-dimensional point cloud data. The binocular camera and the 32-line laser radar both have a collection frequency of 10Hz, and communicate with the vehicle-mounted computing device via a 1000Mbps Ethernet protocol; the low-frequency sensor data includes image data collected by the binocular camera and point cloud data collected by the 32-line laser radar.

[0060] The smart pointer is used to efficiently transfer data and release memory space in time. Specifically, the smart pointer is the address where data is stored in the memory. The data at the address can be indirectly accessed and operated, and the life cycle of the memory can be automatically managed to ensure that resources are released at the appropriate time, thereby preventing memory leaks and other related problems. When data transfer is required, data copying can be avoided and achieved by copying the smart pointer. The smart pointer can automatically manage the memory it references. When the smart pointer is no longer referenced, it will automatically release the memory it occupies, avoiding problems such as memory leaks and dangling pointers.

[0061] The data acquisition buffer module is used to cache the data collected in the multi-threaded data acquisition module and transmit the data to the high-frequency sensor data synchronization module and the low-frequency sensor data synchronization module to prevent data loss and ensure data integrity. The specific method is that the data acquisition buffer module receives the pointer data of different sensor signals, constructs a separate, thread-safe and efficient ring buffer for the pointer data of different sensor signals, and sequentially stores the pointer data at the end of the corresponding ring buffer; outputs the high-frequency sensor pointer data from the head of the ring buffer to the high-frequency sensor data synchronization module, and outputs the low-frequency sensor pointer data to the low-frequency sensor data synchronization module;

[0062] In this embodiment, the data acquisition buffer module includes seven circular buffers: longitude and latitude, altitude, angular velocity, acceleration, image and point cloud signal circular buffers. These buffers are used to store corresponding pointer data, such as the smart pointer that stores longitude and latitude data in the longitude and latitude signal circular buffer.

[0063] (2) The high-frequency sensor data synchronization module and the low-frequency sensor data synchronization module take the pre-collected data from the acquisition data buffer module and perform time soft synchronization respectively;

[0064] The high-frequency sensor data synchronization module is used to synchronize the high-frequency sensor data in the data buffer module and runs independently in thread 1; the high-frequency sensor data synchronization module receives the pointer data in the circular buffer of the longitude and latitude, altitude, angular velocity, and acceleration signals in the data buffer module, and then performs time soft synchronization on these pointer data, that is, storing the high-frequency sensor data collected at the same time together to obtain the high-frequency sensor synchronization pointer data;

[0065] Combined with Figure 2 As shown, the workflow of the high-frequency sensor data synchronization module is as follows:

[0066] A loop is executed in the thread 1, and the loop mainly includes three steps: loop start, time synchronization and high-frequency sensor synchronization pointer data output;

[0067] The loop start step is used to determine whether the latitude and longitude, altitude, angular velocity and acceleration data buffers are all not empty at the beginning of each execution loop. If and only if the buffers are all not empty, the subsequent steps are executed, otherwise the thread waits for 200 microseconds and then repeats the loop;

[0068] The time synchronization step is used to synchronize the longitude and latitude, altitude, angular velocity and acceleration data through timestamps: first, the search interface in the acquisition data buffer module is used to take the oldest frame of data at the head of the longitude and latitude, altitude, angular velocity and acceleration data buffer as a group to obtain a data group to be synchronized, and then determine whether the maximum difference △t of all data timestamps in the data group to be synchronized exceeds a certain threshold T. In this embodiment, according to the sensor acquisition frequency of 100Hz, the threshold T is set to 5ms; when △t>T, it is considered that the data group to be synchronized is most likely not the data collected at the same time, and the data with the smallest timestamp in the data group to be synchronized needs to be deleted from its buffer, and the cycle is repeated; when △t≤T, it is considered that all data in the data group to be synchronized are synchronized, that is, they are regarded as data collected at the same time, and the smallest timestamp in the data group to be synchronized is found to obtain a high-frequency sensor synchronization timestamp, and the data group to be synchronized and the high-frequency sensor synchronization timestamp are encapsulated into a smart pointer to obtain high-frequency sensor synchronization pointer data, which contains a frame of longitude and latitude, altitude, angular velocity and acceleration signals after synchronization.

[0069] The high-frequency sensor synchronization pointer data output step is used to finally send a frame of high-frequency sensor synchronization pointer data obtained by synchronization to the high-frequency sensor data buffer module, and repeat the cycle.

[0070] The low-frequency sensor data synchronization module is used to synchronize the low-frequency sensor data in the data buffer module and runs independently in thread 2; the low-frequency sensor data synchronization module receives the pointer data in the left image, right image and point cloud signal buffer in the data buffer module, and then performs time soft synchronization on these pointer data, that is, the low-frequency sensor data collected at the same time are stored together to obtain the low-frequency sensor synchronization pointer data;

[0071] Combined with Figure 3 As shown in the figure, the workflow of the low-frequency sensor data synchronization module is as follows:

[0072] A loop is executed in the thread 2, and the loop mainly includes three steps: loop start, time synchronization and low-frequency sensor synchronization pointer data output;

[0073] The loop start step is used to determine whether the left image, right image and point cloud data buffers are all not empty at the beginning of each execution of the loop. If and only if the buffers are all not empty, the subsequent steps are executed, otherwise the thread waits for 200 microseconds and then repeats the loop;

[0074] The time synchronization step is used to synchronize the left image, the right image and the point cloud data through the timestamp: first, the search interface in the acquisition data buffer module is used to take the oldest frame of data at the head of the left image, the right image and the point cloud data buffer as a group to obtain the data group to be synchronized, and then determine whether the maximum difference △t of the timestamps of all data in the data group to be synchronized exceeds a certain threshold T. The threshold T in this embodiment is set to 5ms; when △t>T, it is considered that the data group to be synchronized is most likely not the data collected at the same time, and the data with the smallest timestamp in the data group to be synchronized needs to be deleted from its buffer, and the cycle is repeated; when △t≤T, it is considered that all data in the data group to be synchronized are synchronized, that is, they are regarded as data collected at the same time, and the average value of the timestamps of all data in the data group to be synchronized is calculated to obtain the low-frequency sensor synchronization timestamp, and the data group to be synchronized and the low-frequency sensor synchronization timestamp are encapsulated into a smart pointer to obtain low-frequency sensor synchronization pointer data, which contains a frame of left image, right image and point cloud signal after synchronization;

[0075] The low-frequency sensor synchronization pointer data output step is used to finally send a frame of low-frequency sensor synchronization pointer data obtained by synchronization to the low-frequency sensor data buffer module and repeat the cycle.

[0076] (3) sending the high-frequency sensor synchronization pointer data and the low-frequency sensor synchronization pointer data to the high-frequency sensor data buffer module and the low-frequency sensor data buffer module respectively;

[0077] The high-frequency sensor data buffer module is used to cache the synchronized pointer data in the high-frequency sensor data synchronization module and transmit the data to the multi-source heterogeneous data synchronization module to prevent data loss and ensure data integrity. The specific method is to receive the high-frequency sensor synchronization pointer data in the high-frequency sensor data synchronization module; build a thread-safe and efficient ring buffer, and sequentially store the high-frequency sensor synchronization pointer data to the tail of the corresponding ring buffer; send the high-frequency sensor synchronization pointer data from the head of the ring buffer to the multi-source heterogeneous data synchronization module;

[0078] The low-frequency sensor data buffer module is used to cache the synchronized pointer data in the low-frequency sensor data synchronization module and transmit the data to the multi-source heterogeneous data synchronization module to prevent data loss and ensure data integrity. The specific method is to receive the low-frequency sensor synchronization pointer data in the low-frequency sensor data synchronization module; build a thread-safe and efficient ring buffer, and sequentially store the low-frequency sensor synchronization pointer data to the tail of the corresponding ring buffer; send the low-frequency sensor synchronization pointer data from the head of the ring buffer to the multi-source heterogeneous data synchronization module;

[0079] (4) The multi-source heterogeneous data synchronization module performs secondary synchronization on the data in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module to obtain the final synchronization processing result and store it in the synchronization data storage module.

[0080] The multi-source heterogeneous data synchronization module is a key module, which runs independently in thread 3 and is used to synchronize the data in the high-frequency and low-frequency sensor data buffer modules; the multi-source heterogeneous data synchronization module receives the high-frequency sensor synchronization pointer data and the low-frequency sensor synchronization pointer data in the high-frequency and low-frequency sensor data buffer modules, performs initial time alignment on the high-frequency and low-frequency sensor synchronization pointer data, and then performs time soft synchronization on the pointer data; specifically, based on the timestamp of the low-frequency sensor synchronization pointer data, find the synchronization pointer data of the low-frequency sensor at the Tth frame, and obtain the high-frequency sensor pointer data at the same timestamp by the difference method, and then find the high-frequency sensor synchronization pointer data between the T-1 frame and the Tth frame, store these data together, obtain a frame of multi-source heterogeneous synchronization pointer data, and finally send the multi-source heterogeneous synchronization pointer data to the synchronization data storage module;

[0081] Combined with Figure 4 As shown in the figure, the workflow of the multi-source heterogeneous data synchronization module is as follows:

[0082] A loop is executed in the thread 3 for repeatedly reading data in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module; the loop mainly includes the following steps: loop start, initial synchronization, high-frequency sensor data interpolation, high- and low-frequency sensor data synchronization, and multi-source heterogeneous synchronization pointer data output;

[0083] The loop start step is used to determine whether there is data stored in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module at the beginning of each execution loop. If and only if both have data, the following steps are executed, otherwise the thread waits for 200 microseconds and then repeats the loop;

[0084] The initial synchronization step is used to align the initial timestamps of the high-frequency sensor synchronization pointer data and the low-frequency sensor synchronization pointer data when the multi-source heterogeneous data synchronization is performed for the first time. This step is performed only once when the multi-source heterogeneous data synchronization operation is performed for the first time. Specifically, the multi-source heterogeneous data synchronization module needs to record a frame of low-frequency sensor synchronization pointer data and a set of corresponding high-frequency sensor synchronization pointer data up to the previous frame of low-frequency sensor synchronization pointer data. However, due to the asynchronous initial time of different pointer data acquisition in the multi-threaded data acquisition module, there may always be problems during the first synchronization, that is, in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module, the timestamp t of the oldest frame of high-frequency sensor synchronization pointer data at the head of the buffer 高旧 The time stamp t of the pointer data synchronized with the low-frequency sensor 低旧 There is no alignment problem, that is, there may be two situations: t 低旧 <t 高旧 or 低旧 >t 高旧 ;

[0085] First, judge the first case, when t 低旧 <t 高旧 When , it indicates that the high-frequency sensor synchronization pointer data used for multi-source heterogeneous data synchronization is missing, that is, there is redundant low-frequency sensor synchronization pointer data in the low-frequency sensor data buffer module, so the oldest frame data at the head of the low-frequency sensor data buffer module is deleted, and the loop is executed again;

[0086] After judging the first case, judge the second case. If t 低旧 >t 高旧 At this time, the high-frequency and low-frequency sensor data cannot be aligned, because the oldest frame of high-frequency sensor signal may not actually have a timestamp greater than the timestamp of the previous frame of low-frequency sensor data. At this time, the oldest frame of data in the low-frequency sensor data buffer needs to be deleted. 低旧 , and the timestamp in the high-frequency sensor data buffer is less than or equal to t 低旧 All data sets {d 高}; At this point, the high-frequency and low-frequency sensor data have achieved timestamp alignment, that is, the initial synchronization is completed;

[0087] The high-frequency sensor data interpolation step is used to align the data of the high-frequency and low-frequency sensors each time the multi-source heterogeneous data is synchronized; due to the great difference in sensor acquisition rates, the high-frequency sensor synchronization data cannot be directly synchronized with the low-frequency sensor synchronization data, and since the real-time position data collected by the GNSS receiver and the angular velocity and acceleration data collected during the movement by the inertial measurement unit are both floating-point numbers, linear interpolation can be used to obtain the high-frequency sensor synchronization data at the timestamp of the low-frequency sensor synchronization data, thereby solving this synchronization problem.

[0088] Specifically, first, it is necessary to ensure that both the high-frequency and low-frequency sensor data buffer modules have data, and the timestamp of the latest frame of data at the end of the high-frequency sensor data buffer is t 高新 >t 低旧 Otherwise, the thread waits for 200 microseconds and then repeats the loop; if the condition is met, the timestamp is less than t 低旧 The high-frequency sensor synchronization pointer data in all high-frequency sensor data buffers are stored in a container in ascending order of timestamps. Because there may be abnormal situations such as data loss, when the container is not empty and has no connection with t 低旧 The interpolation operation is performed when the high-frequency sensor synchronization pointer data with equal timestamps is used, otherwise the oldest frame of data in the low-frequency sensor data buffer is deleted and the cycle is repeated; the linear interpolation is performed using the data at t 低旧 The two high-frequency sensor data d1 and d2 on both sides of the timestamp are linearly interpolated with the corresponding timestamps t1 and t2 to obtain t 低旧 The high-frequency sensor interpolation data d at the timestamp is expressed as:

[0089]

[0090] In the formula, t 低旧 Indicates the timestamp of the oldest frame of low-frequency sensor synchronization pointer data at the head of the low-frequency sensor data buffer; d indicates the interpolated t 低旧 High-frequency sensor synchronization data at the timestamp; d1 indicates that the timestamp in the high-frequency sensor data buffer is less than t 低旧 The latest frame of data; d2 indicates that the timestamp in the high-frequency sensor data buffer is greater than t 低旧 The oldest frame of data; t1 represents the timestamp corresponding to d1; t2 represents the timestamp corresponding to d2;

[0091] Then the high-frequency sensor synchronization data at the timestamp of the low-frequency sensor synchronization data is recorded into the above container to obtain a set of high-frequency sensor synchronization data with aligned timestamps;

[0092] The high- and low-frequency sensor data synchronization step encapsulates the set of high-frequency sensor synchronization data with timestamp alignment and the oldest frame of data at the head of the low-frequency sensor data buffer to obtain a set of multi-source heterogeneous synchronization data. In this example, the set of multi-source heterogeneous synchronization data includes a left image, a right image and point cloud data after one frame of synchronization, and latitude and longitude, altitude, angular velocity, and acceleration data after multiple frames of synchronization.

[0093] The multi-source heterogeneous synchronization pointer data output step encapsulates the group of multi-source heterogeneous synchronization data into a smart pointer to obtain multi-source heterogeneous synchronization pointer data, and finally sends the multi-source heterogeneous synchronization pointer data to the synchronization data storage module, and removes this group of pointer data from the high-frequency and low-frequency sensor data buffer modules, and then repeats the loop step.

[0094] The synchronous data storage module is used to receive the multi-source heterogeneous synchronous pointer data in the multi-source heterogeneous data synchronization module and store the multi-source heterogeneous synchronous pointer data, which can be directly used for online calculation of subsequent algorithms or collected into a storage medium for data playback.

[0095] The thread-safe and efficient ring buffer in the acquisition data buffer module, the high-frequency sensor data buffer module and the low-frequency sensor data buffer module is used for data communication between two independently running threads; the thread-safe and efficient ring buffer is a data structure, which is constructed in the memory space of the data acquisition device and is used to solve the data synchronization problem in a multi-threaded environment, ensuring that no data competition or inconsistent state occurs during concurrent read and write operations; the ring buffer adopts a thread lock mechanism to provide comprehensive thread safety, and the thread lock is a synchronization mechanism used to protect shared resources in multi-threads, preventing multiple threads from accessing and modifying the same data at the same time, thereby ensuring the consistency and correctness of the data; the ring buffer mainly includes 5 key components: an input interface, a storage unit, a pointer unit, a search interface and a deletion interface;

[0096] The input interface is used for the producer thread, allowing the producer thread to perform data insertion operations at the logical tail position of the buffer. A thread lock mechanism is used to ensure the mutual exclusivity of the write operation and avoid frequent thread blocking. When the buffer is full, the input interface can implement a blocking strategy or provide a signal notification mechanism so that the producer thread can appropriately slow down the production speed.

[0097] The storage unit is used to store data and is composed of a group of continuously allocated memory blocks, and its capacity is preset. The storage units are connected end to end to form a logical ring structure, so that the data can automatically wrap back to the starting position when reaching the buffer boundary.

[0098] The pointer unit is used to determine the starting and ending positions of the buffer, and includes two independent pointer variables, namely the read pointer and the write pointer. The read pointer indicates the starting position of the data to be consumed in the buffer, while the write pointer marks the position where the next data will be written. In order to maintain the circular characteristics, the pointer will be repositioned by modulo operation when it exceeds the buffer capacity.

[0099] The search interface is used to provide efficient search functions, allowing the query of data items at specific locations or meeting certain conditions in the buffer. The search process is also thread-protected, and the thread lock mechanism is used to ensure that the search operation does not affect the ongoing write or delete actions, and supports read-only access to improve performance.

[0100] The deletion interface is designed for the consumer thread and is responsible for safely removing the consumed data from the buffer head. The deletion operation is accompanied by a corresponding synchronization mechanism, using a thread lock mechanism to ensure that the read pointer can only be updated when it has not been modified by other threads, and increment the read pointer after the data is successfully deleted.

[0101] In summary, the embodiment of the present invention provides a method for synchronously processing multi-source heterogeneous data of natural driving, which uses multi-threading and buffer technology to efficiently, accurately and stably synchronize and collect multi-source heterogeneous data of natural driving in a low-cost manner from the software level, and is stable and reliable after testing. Moreover, there are no excessive restrictions on the model and function of the sensor, and it is applicable to various sensors, providing technical guarantee for realizing the synchronous collection of vehicle environment status data and vehicle status data.

[0102] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A method for synchronously processing multi-source heterogeneous data of natural driving, characterized by: The following steps are involved: (1) The multi-threaded data acquisition module pre-collects high-frequency sensor data and low-frequency sensor data in real time, and temporarily stores the collected sensor data in the memory of the vehicle computing device; each type of sensor data has a corresponding thread to collect and process; a unified clock source is used to provide the same reference time to each sensor, and a timestamp is added to the collected data according to the time information to obtain time calibration data; the time calibration data is encapsulated into a smart pointer to obtain pointer data of different sensor signals, and finally the pointer data of different sensors are sent to the data acquisition buffer module; (2) The high-frequency sensor data synchronization module receives the pointer data in several high-frequency sensor buffers in the data acquisition buffer module, and then performs time soft synchronization on all the high-frequency sensor pointer data, that is, stores the high-frequency sensor data collected at the same time together to obtain the high-frequency sensor synchronization pointer data; the low-frequency sensor data synchronization module receives the pointer data in several low-frequency sensor buffers in the data acquisition buffer module, and then performs time soft synchronization on all the low-frequency sensor pointer data, that is, stores the low-frequency sensor data collected at the same time together to obtain the low-frequency sensor synchronization pointer data; (3) sending the high-frequency sensor synchronization pointer data and the low-frequency sensor synchronization pointer data to the high-frequency sensor data buffer module and the low-frequency sensor data buffer module respectively; the high-frequency sensor data buffer module receives the high-frequency sensor synchronization pointer data in the high-frequency sensor data synchronization module, constructs a thread-safe and efficient ring buffer, sequentially stores the high-frequency sensor synchronization pointer data to the tail of the corresponding ring buffer, and sends the high-frequency sensor synchronization pointer data to the multi-source heterogeneous data synchronization module from the head of the ring buffer; The low-frequency sensor data buffer module receives the low-frequency sensor synchronization pointer data in the low-frequency sensor data synchronization module, constructs a thread-safe and efficient ring buffer, sequentially stores the low-frequency sensor synchronization pointer data to the tail of the corresponding ring buffer, and sends the low-frequency sensor synchronization pointer data to the multi-source heterogeneous data synchronization module from the head of the ring buffer; (4) The multi-source heterogeneous data synchronization module performs secondary synchronization on the data in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module: The multi-source heterogeneous data synchronization module receives the high-frequency sensor synchronization pointer data and the low-frequency sensor synchronization pointer data in the high-frequency and low-frequency sensor data buffer modules, performs initial time alignment on the high-frequency and low-frequency sensor synchronization pointer data, and then performs time soft synchronization on the pointer data. Based on the timestamp of the low-frequency sensor synchronization pointer data, the synchronization pointer data of the low-frequency sensor at the Tth frame is found, and the high-frequency sensor pointer data at the same timestamp is obtained by interpolation. Then, the high-frequency sensor synchronization pointer data between the T-1 frame and the Tth frame is found, and these data are stored together to obtain a frame of multi-source heterogeneous synchronization pointer data. Finally, the multi-source heterogeneous synchronization pointer data is sent to the synchronization data storage module.

2. The method for synchronously processing multi-source heterogeneous data of natural driving according to claim 1, characterized in that: The high-frequency sensor refers to a sensor whose acquisition frequency is higher than a preset frequency; the low-frequency sensor refers to a sensor whose acquisition frequency is lower than a preset frequency.

3. The method for synchronously processing multi-source heterogeneous data of natural driving according to claim 1, characterized in that: The data acquisition buffer module is used to cache the data collected in the multi-threaded data acquisition module and transmit the data to the high-frequency sensor data synchronization module and the low-frequency sensor data synchronization module; the data acquisition buffer module receives the pointer data of different sensor signals, constructs a separate, thread-safe and efficient ring buffer for the pointer data of different sensor signals, and stores the pointer data sequentially at the end of the corresponding ring buffer; outputs the high-frequency sensor pointer data from the head of the ring buffer to the high-frequency sensor data synchronization module, and outputs the low-frequency sensor pointer data to the low-frequency sensor data synchronization module; according to the type of data collected in the multi-threaded data acquisition module, a number of ring buffers are correspondingly provided in the data acquisition buffer module.

4. The method for synchronously processing multi-source heterogeneous data of natural driving according to claim 1, characterized in that: The workflow of the high-frequency sensor data synchronization module described in step (2) is as follows: A loop is executed in the high-frequency sensor data synchronization module, and the loop mainly includes three steps: loop start, time synchronization and high-frequency sensor synchronization pointer data output; The loop start step: at the beginning of each execution loop, determine whether the sensor data buffers are not empty, and execute the following steps only if the buffers are not empty, otherwise the thread waits for a certain period of time and then repeats the loop; The time synchronization step: first, use the search interface in the data acquisition buffer module to take the oldest frame of data at the head of the high-frequency sensor data buffer as a group to obtain the data group to be synchronized, and then determine whether the maximum difference △t of all data timestamps in the data group to be synchronized exceeds a certain threshold T; when △t>T, delete the data with the smallest timestamp in the data group to be synchronized from its buffer, and repeat the cycle; when △t≤T, find the smallest timestamp in the data group to be synchronized to obtain the high-frequency sensor synchronization timestamp, and encapsulate the data group to be synchronized and the high-frequency sensor synchronization timestamp into a smart pointer to obtain the high-frequency sensor synchronization pointer data; The high-frequency sensor synchronization pointer data output step: finally, a frame of high-frequency sensor synchronization pointer data obtained by synchronization is sent to the high-frequency sensor data buffer module, and the cycle is repeated.

5. The method for synchronously processing multi-source heterogeneous data of natural driving according to claim 1, characterized in that: The workflow of the low-frequency sensor data synchronization module described in step (2) is as follows: A loop is executed in the low-frequency sensor data synchronization module, and the loop mainly includes three steps: loop start, time synchronization and low-frequency sensor synchronization pointer data output; The loop start step: at the start of each execution loop, determine whether the low-frequency sensor data buffer is not empty, and execute the following steps only if the buffer is not empty, otherwise the thread waits for a certain period of time and then repeats the loop; The time synchronization step: first, use the search interface in the data acquisition buffer module to take the oldest frame of data at the head of the low-frequency sensor data buffer as a group to obtain the data group to be synchronized, and then determine whether the maximum difference △t of all data timestamps in the data group to be synchronized exceeds a certain threshold T; when △t>T, delete the data with the smallest timestamp in the data group to be synchronized from its buffer, and repeat the cycle; when △t≤T, calculate the average value of all data timestamps in the data group to be synchronized to obtain the low-frequency sensor synchronization timestamp, encapsulate the data group to be synchronized and the low-frequency sensor synchronization timestamp into a smart pointer, and obtain the low-frequency sensor synchronization pointer data; The low-frequency sensor synchronization pointer data output step: finally, a frame of low-frequency sensor synchronization pointer data obtained by synchronization is sent to the low-frequency sensor data buffer module, and the cycle is repeated.

6. The method for synchronously processing multi-source heterogeneous data of natural driving according to claim 1, characterized in that: The workflow of the multi-source heterogeneous data synchronization module described in step (4) is as follows: A loop is executed in the multi-source heterogeneous data synchronization module to repeatedly read the data in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module; the loop mainly includes: loop start, initial synchronization, high-frequency sensor data interpolation, high- and low-frequency sensor data synchronization, and multi-source heterogeneous synchronization pointer data output; (4.1) The loop start step: At the start of each execution loop, determine whether there is data in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module. If and only if there is data in both, execute the following steps. Otherwise, the thread waits for a certain period of time and then repeats the loop. (4.2) The initial synchronization step: when the data performs multi-source heterogeneous data synchronization for the first time, the high-frequency sensor synchronization pointer data and the low-frequency sensor synchronization pointer data are initially timestamped. This step is only performed once when the multi-source heterogeneous data synchronization operation is performed for the first time; (4.3) The high-frequency sensor data interpolation step: aligning the high-frequency and low-frequency sensor data each time the multi-source heterogeneous data is synchronized; storing the current frame of the low-frequency sensor synchronization data and the high-frequency sensor synchronization data between the previous frame and the current frame in a container in sequence according to the timestamp; using the interpolation method to obtain the high-frequency sensor synchronization data at the timestamp of the low-frequency sensor synchronization data, and also storing it in the container; obtaining a set of high-frequency sensor synchronization data with aligned timestamps stored in the container; (4.4) The high-frequency and low-frequency sensor data synchronization step: after completing the high-frequency sensor data interpolation step, encapsulating the set of high-frequency sensor synchronization data with aligned timestamps and the oldest frame of data at the head of the low-frequency sensor data buffer together to obtain a set of multi-source heterogeneous synchronization data; (4.5) The multi-source heterogeneous synchronous pointer data output step: encapsulate a set of multi-source heterogeneous synchronous data into a smart pointer to obtain multi-source heterogeneous synchronous pointer data, and finally send the multi-source heterogeneous synchronous pointer data to the synchronous data storage module, and remove this set of pointer data from the high-frequency and low-frequency sensor data buffer modules, and then repeat the loop step.

7. The method for synchronously processing multi-source heterogeneous data of natural driving according to claim 6, characterized in that: The initial synchronization steps in step (4.2) are as follows: The multi-source heterogeneous data synchronization module needs to record a frame of low-frequency sensor synchronization pointer data and a set of corresponding high-frequency sensor synchronization pointer data up to the previous frame of low-frequency sensor synchronization pointer data; firstly, in the high-frequency sensor data buffer module and the low-frequency sensor data buffer module, it is determined that the timestamp t of the oldest frame of high-frequency sensor synchronization pointer data at the head of the buffer is 高旧 The time stamp t of the pointer data synchronized with the low-frequency sensor 低旧 Condition; When t 低旧 <t 高旧 When , delete the oldest frame of data at the head of the low-frequency sensor data buffer module, and execute the loop again; When t 低旧 >t 高旧 When the oldest frame of data in the low-frequency sensor data buffer is deleted, 低旧 , and the timestamp in the high-frequency sensor data buffer is less than or equal to t 低旧 All data sets {d 高 }; At this point, the high-frequency and low-frequency sensor data have achieved timestamp alignment, and the initial synchronization has been completed.

8. The method for synchronously processing multi-source heterogeneous data of natural driving according to claim 6, characterized in that: The steps of interpolating high-frequency sensor data in step (4.3) are as follows: First, it is necessary to ensure that both the high-frequency and low-frequency sensor data buffer modules have data, and the timestamp of the latest frame of data at the end of the high-frequency sensor data buffer is t 高新 Greater than the timestamp t of the low-frequency sensor synchronization pointer data 低旧 Otherwise, the thread waits for a certain period of time and then repeats the cycle; if the conditions are met, the timestamp is less than t 低旧 All high-frequency sensor synchronization pointer data in the high-frequency sensor data buffer are stored in a container in ascending order of timestamps. When the container is not empty and has no connection with t 低旧 When the high-frequency sensor synchronization pointer data with equal timestamps is interpolated, otherwise the oldest frame of data in the low-frequency sensor data buffer is deleted and the cycle is repeated; using the interpolation method, the data at t 低旧 The two high-frequency sensor data d1 and d2 on both sides of the timestamp are interpolated with the corresponding timestamps t1 and t2 to obtain t 低旧 High-frequency sensor interpolation data d at timestamp; The high-frequency sensor synchronization data at the timestamp of the low-frequency sensor synchronization data is then recorded into the above container to obtain a group of high-frequency sensor synchronization data with aligned timestamps.

9. The method for synchronously processing multi-source heterogeneous data of natural driving according to claim 8, characterized in that: The interpolation method is linear interpolation, which is to use the 低旧 The two high-frequency sensor data d1 and d2 on both sides of the timestamp are linearly interpolated with the corresponding timestamps t1 and t2 to obtain t 低旧 The high-frequency sensor interpolation data d at the timestamp is expressed as: Where, t 低旧 Indicates the timestamp of the oldest frame of low-frequency sensor synchronization pointer data at the head of the low-frequency sensor data buffer; d indicates the interpolated t 低旧 High-frequency sensor synchronization data at the timestamp; d1 indicates that the timestamp in the high-frequency sensor data buffer is less than t 低旧 The latest frame of data; d2 indicates that the timestamp in the high-frequency sensor data buffer is greater than t 低旧 The oldest frame of data; t1 represents the timestamp corresponding to d1; t2 represents the timestamp corresponding to d2.

10. The method for synchronously processing multi-source heterogeneous data of natural driving according to claim 1, characterized in that: The thread-safe and efficient ring buffers in the acquisition data buffer module, the high-frequency sensor data buffer module and the low-frequency sensor data buffer module are used for data communication between two independently running threads; The thread-safe and efficient ring buffer is a data structure; The ring buffer adopts a thread lock mechanism to provide comprehensive thread security; the ring buffer mainly includes: an input interface, a storage unit, a pointer unit, a search interface and a deletion interface; The input interface is used for the producer thread, allowing the producer thread to perform data insertion operations at the logical tail position of the buffer; a thread lock mechanism is used to ensure the mutual exclusivity of the write operation; when the buffer is full, the input interface implements a blocking strategy or provides a signal notification mechanism to enable the producer thread to appropriately slow down the production speed; The storage unit is used to store data and is a ring array consisting of a group of continuously allocated memory blocks, and its capacity is preset; the storage units are connected end to end to form a logical ring structure, so that the data can automatically wrap back to the starting position when reaching the buffer boundary; The pointer unit is used to determine the starting and ending positions of the buffer, and includes two independent pointer variables, namely a read pointer and a write pointer; the read pointer indicates the starting position of the data to be consumed in the buffer, and the write pointer marks the position where the next data will be written; when the pointer exceeds the buffer capacity, a modulo operation is performed to reposition it; The search interface is used to provide an efficient search function, allowing the query of a specific location in the buffer or a data item that meets certain conditions; the search process is also thread-protected, and a thread lock mechanism is used to ensure that the search operation does not affect the ongoing write or delete action, and supports read-only access; The deletion interface is designed for the consumer thread and is responsible for safely removing the consumed data from the buffer head; the deletion operation is accompanied by a corresponding synchronization mechanism, using a thread lock mechanism, and can only be updated when the read pointer has not been modified by other threads, and the read pointer is incremented after the data is successfully deleted.

Citation Information

Cited By

  • Multi-source sensing data fusion semi-trailer intelligent backing decision and control system

    CN120621375A

  • Intelligent reversing decision and control system for semi-trailer trucks based on multi-source sensor data fusion

    CN120621375B

  • Method and system for measuring carbon emission factor of fixed combustion source

    CN121027461A