Intelligent driving data synchronization method and system and storage medium

By establishing a mapping relationship between CAN message timestamps and video timestamps in the intelligent driving data synchronization system, the problem of high dependency in existing technologies is solved, and precise synchronization of bus data and video data is achieved, which is applicable to various scenarios of intelligent driving data acquisition systems.

CN119007311APending Publication Date: 2024-11-22SHENZHEN HANGSHENG ELECTRONICS
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410950701.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-11-22

Smart Images

  • Figure CN119007311A_ABST
    Figure CN119007311A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent driving data synchronization method and system and a storage medium. The method comprises the following steps: acquiring video stream data and naming a frame image according to a preset mode; obtaining CAN message data of the vehicle and storing the CAN message data in a preset queue; reading the CAN message data into a preset array, pointing to the tail part of a preset queue by using a vernier, and recording the time point of the current system and the timestamp of the CAN message at the tail part of the queue; after a preset duration, adding the CAN message data from the vernier to the tail of the queue into a preset array; reading timestamps of a first frame of CAN message and a last frame of CAN message of a preset array, and respectively calculating time intervals between the timestamps and the timestamp of the CAN message at the tail of the array; calculating system time points of the first frame of message and the last frame of message; determining all frame images between two system time points and combining the frame images into a set; and writing the file to finish data synchronization. According to the invention, accurate synchronization of the bus data and the video data is realized, and the method does not depend on a specific system and has good transportability and universality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data synchronization technology, and more specifically, to an intelligent driving data synchronization method, system and storage medium. Background Art

[0002] Data acquisition systems in the field of intelligent driving play a vital role in the development of autonomous driving technology. It provides a large amount of real road data by collecting various sensor data (including cameras, lidar, radar, ultrasonic sensors and GPS, etc.) and vehicle status data (such as speed, acceleration, steering wheel angle and braking status). The above data is used to train and verify intelligent driving algorithm models, including tasks such as target detection, path planning and decision control. In addition, the data acquisition system also supports simulation testing in a virtual environment to verify the performance of the intelligent driving system in various complex scenarios and ensure the safety and reliability of the system. The data acquisition system also plays a key role in meeting the requirements of autonomous driving regulations, providing detailed test and operation data records to help companies deal with regulatory audits and accident investigations to ensure compliance and safety. At the same time, these systems continuously identify system defects and improvement points through continuous data analysis and feedback, form a closed-loop feedback mechanism, optimize intelligent driving algorithms and system performance, and thus promote the development and innovation of intelligent driving technology.

[0003] The Chinese invention patent with publication number CN115546926A discloses a vehicle data and video frame synchronization system and method, which can synchronize and save video data with the CAN bus. However, the system is only for driving recorders, and the synchronized data cannot be applied to scenarios such as simulation and testing in the field of intelligent driving. In addition, the method uses the same timestamp for all data, and does not take into account the dot triggering scenario of the data acquisition system, so the synchronization method is not universal. Summary of the invention

[0004] In order to overcome the defects of the prior art intelligent driving data collection, that is, the data synchronization method has high system dependence and lacks universality, the present invention provides an intelligent driving data synchronization method, system and storage medium.

[0005] The primary purpose of the present invention is to solve the above technical problems. The technical solution of the present invention is as follows:

[0006] The present invention provides a first aspect to provide a method for synchronizing intelligent driving data, comprising the following steps:

[0007] Acquire video stream data and name frame images in the video stream data in a preset manner;

[0008] Get the vehicle's CAN message data and save it in a preset queue;

[0009] Obtain a trigger recording instruction, read the CAN message data in the preset queue into a preset array, use a cursor to point to the tail of the preset queue, and record the current system time point and the timestamp of the CAN message at the tail of the queue respectively;

[0010] After a preset time, the CAN message data from the cursor to the end of the queue is added to the preset array;

[0011] Read the timestamp of the first frame of the CAN message and the timestamp of the last frame of the preset array, and calculate the time interval between the above timestamps and the timestamp of the CAN message at the end of the queue;

[0012] Calculate the system time points of the first frame message and the last frame message according to the current system time point;

[0013] All frame images between the system time points of the first frame message and the last frame message are determined respectively and combined into a set;

[0014] The frame images in the set are written into a video file, and all CAN messages of the array are written into a bus record file to complete data synchronization.

[0015] Furthermore, the naming of the frame images in the video stream data according to a preset manner is to name the frame images in the video stream data in a self-increasing manner in chronological order.

[0016] Further, the timestamp of the first frame CAN message and the timestamp of the last frame of the preset array are read, and the time interval between the above timestamps and the timestamp of the tail CAN message is calculated respectively, including:

[0017] Calculate the time interval interval1 between the timestamp of the last CAN message in the queue and the timestamp of the first CAN message in the preset array:

[0018] interval1=ts2-ts1

[0019] Among them, ts2 represents the timestamp of the CAN message at the end of the queue, and ts1 represents the timestamp of the first frame CAN message of the preset array.

[0020] The intelligent driving data synchronization method according to claim 3 is characterized in that the time interval interval2 between the timestamp of the tail CAN message and the timestamp of the last frame of the CAN message in the preset array is calculated:

[0021] interval2=ts3-ts2

[0022] Among them, ts3 represents the timestamp of the last CAN message frame in the preset array.

[0023] Further, the system time points of the first frame message and the last frame message are calculated according to the current system time point, including:

[0024] The system time point t1 of the first frame message is calculated as t2-interval1, and the system time point t3 of the last frame message is calculated as t2+interval2.

[0025] Furthermore, the preset time period is achieved by a timer.

[0026] Furthermore, the trigger instruction is issued through a UI interface button or a physical key connected to the data acquisition system.

[0027] Furthermore, the video stream data is acquired through camera collection.

[0028] The present invention provides a second aspect to provide an intelligent driving data synchronization system, characterized in that the system comprises: a memory, a processor, the memory comprises an intelligent driving data synchronization method program, and the intelligent driving data synchronization method program implements the following steps when executed by the processor:

[0029] Acquire video stream data and name frame images in the video stream data in a preset manner;

[0030] Get the vehicle's CAN message data and save it in a preset queue;

[0031] Obtain a trigger recording instruction, read the CAN message data in the preset queue into a preset array, use a cursor to point to the tail of the preset queue, and record the current system time point and the timestamp of the CAN message at the tail of the queue respectively;

[0032] After a preset time, the CAN message data from the cursor to the end of the queue is added to the preset array;

[0033] Read the timestamp of the first frame of the CAN message and the timestamp of the last frame of the preset array, and calculate the time interval between the above timestamps and the timestamp of the CAN message at the end of the queue;

[0034] Calculate the system time points of the first frame message and the last frame message according to the current system time point;

[0035] All frame images between the system time points of the first frame message and the last frame message are determined respectively and combined into a set;

[0036] The frame images in the set are written into a video file, and all CAN messages of the array are written into a bus record file to complete data synchronization.

[0037] The present invention provides a third aspect, providing a computer-readable storage medium, wherein the computer-readable storage medium includes an intelligent driving data synchronization method program, and when the intelligent driving data synchronization method program is executed by a processor, the steps of the intelligent driving data synchronization method are implemented.

[0038] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:

[0039] After obtaining the trigger recording instruction, the present invention realizes accurate synchronization of bus data and video data by establishing a mapping relationship between the CAN message timestamp and the video time. The method does not rely on a specific system and has good portability and versatility. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A flow chart of an intelligent driving data synchronization method provided in an embodiment of the present application.

[0041] Figure 2 A schematic diagram of an intelligent driving data synchronization method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0043] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0044] Example 1

[0045] like Figure 1 As shown, the present invention provides a first aspect to provide a smart driving data synchronization method, comprising the following steps:

[0046] S1: Obtain video stream data and name the frame images in the video stream data in a preset manner;

[0047] It should be noted that the present invention is applicable to an intelligent driving data acquisition system, and bus data and video data can be synchronized. During the actual driving process, if the user using the data acquisition system finds that the vehicle state meets certain conditions or scenes that need to be recorded, the data acquisition system can be triggered to record data. The trigger is usually a UI interface button in the data acquisition system or a physical button connected to the data acquisition system. After the user makes a point, the data acquisition system will save the bus data and video data of m+n (m>n) seconds before and after the point, for subsequent data analysis.

[0048] Furthermore, the frame images in the video stream data are named in a preset manner. In a specific embodiment, the data acquisition system collects the video stream data through a camera and saves it in the form of pictures on a disk. The pictures are named with numbers that are automatically incremented, such as "0.jpg, 1.jpg, 2.jpg..."

[0049] S2: Obtain the vehicle's CAN message data and save it in a preset queue;

[0050] In a specific embodiment, CAN messages on the vehicle are received through a CAN device and stored in a queue queue, and the queue length is.

[0051] S3: Obtain a trigger recording instruction, read the CAN message data in the preset queue into a preset array, use a cursor to point to the tail of the preset queue, and record the current system time point and the timestamp of the CAN message at the tail of the queue respectively;

[0052] like Figure 2 As shown, in a specific embodiment, after the recording is triggered, all CAN messages in the queue are read into the array list, and a cursor p is used to point to the current tail element of the queue, and the current system time point t2 is recorded, and the timestamp ts2 of the tail CAN message is recorded. At this time, t2 and ts2 both represent the time point when the user triggers the function, but the expression form is different. Finally, a timer of n seconds is started;

[0053] S4: After a preset time, the CAN message data from the cursor to the end of the queue is added to the preset array;

[0054] In a specific embodiment, after a preset time, such as n seconds, all CAN messages from the cursor to the end of the queue are appended to the array list;

[0055] S5: Read the timestamp of the first frame CAN message and the timestamp of the last frame of the preset array, and calculate the time interval between the above timestamps and the timestamp of the CAN message at the end of the queue;

[0056] In a specific embodiment, it includes:

[0057] Calculate the time interval interval1 between the timestamp of the last CAN message in the queue and the timestamp of the first CAN message in the preset array:

[0058] interval1=ts2-ts1

[0059] Among them, ts2 represents the timestamp of the CAN message at the end of the queue, and ts1 represents the timestamp of the first frame CAN message of the preset array.

[0060] The intelligent driving data synchronization method according to claim 3 is characterized in that the time interval interval2 between the timestamp of the tail CAN message and the timestamp of the last frame of the CAN message in the preset array is calculated:

[0061] interval2=ts3-ts2

[0062] Among them, ts3 represents the timestamp of the last CAN message frame in the preset array.

[0063] S6: Calculate the system time points of the first frame message and the last frame message according to the current system time point;

[0064] In a specific embodiment, after obtaining the time interval between messages, it is necessary to obtain the system time points of the first and last frames of messages according to the system time point t2, the system time point t1 of the first frame of message = t2-interval1, and the system time point t3 of the last frame of message = t2+interval2;

[0065] S7: respectively determine all frame images between the system time points of the first frame message and the last frame message and combine them into a set;

[0066] It should be noted that, among the frame images named in sequence, find the first image p later than t1 first and the first picture before t3 p last Since the pictures are named according to the number increment, we take out p first With p last All the pictures between constitute the set picture_list;

[0067] S8: writing the frame images in the set into a video file, and writing all CAN messages of the array into a bus record file, thereby completing data synchronization.

[0068] After obtaining the trigger recording instruction, the present invention realizes accurate matching of bus data and video data by establishing a mapping relationship between the CAN message timestamp and the video time. The method does not rely on a specific system and has good portability.

[0069] The present invention provides a second aspect to provide an intelligent driving data synchronization system, characterized in that the system comprises: a memory, a processor, the memory comprises an intelligent driving data synchronization method program, and the intelligent driving data synchronization method program implements the following steps when executed by the processor:

[0070] Acquire video stream data and name frame images in the video stream data in a preset manner;

[0071] Get the vehicle's CAN message data and save it in a preset queue;

[0072] Obtain a trigger recording instruction, read the CAN message data in the preset queue into a preset array, use a cursor to point to the tail of the preset queue, and record the current system time point and the timestamp of the CAN message at the tail of the queue respectively;

[0073] After a preset time, the CAN message data from the cursor to the end of the queue is added to the preset array;

[0074] Read the timestamp of the first frame of the CAN message and the timestamp of the last frame of the preset array, and calculate the time interval between the above timestamps and the timestamp of the CAN message at the end of the queue;

[0075] Calculate the system time points of the first frame message and the last frame message according to the current system time point;

[0076] All frame images between the system time points of the first frame message and the last frame message are determined respectively and combined into a set;

[0077] The frame images in the set are written into a video file, and all CAN messages of the array are written into a bus record file to complete data synchronization.

[0078] The present invention provides a third aspect, providing a computer-readable storage medium, wherein the computer-readable storage medium includes an intelligent driving data synchronization method program, and when the intelligent driving data synchronization method program is executed by a processor, the steps of the intelligent driving data synchronization method are implemented.

[0079] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0080] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0081] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0082] Those skilled in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.

[0083] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

Claims

1. A method for synchronizing intelligent driving data, characterized in that: The following steps are involved: Acquire video stream data and name frame images in the video stream data in a preset manner; Get the vehicle's CAN message data and save it in a preset queue; Obtain a trigger recording instruction, read the CAN message data in the preset queue into a preset array, use a cursor to point to the tail of the preset queue, and record the current system time point and the timestamp of the CAN message at the tail of the queue respectively; After a preset time, the CAN message data from the cursor to the end of the queue is added to the preset array; Read the timestamp of the first frame of the CAN message and the timestamp of the last frame of the preset array, and calculate the time interval between the above timestamps and the timestamp of the CAN message at the end of the queue; Calculate the system time points of the first frame message and the last frame message according to the current system time point; All frame images between the system time points of the first frame message and the last frame message are determined respectively and combined into a set; The frame images in the set are written into a video file, and all CAN messages of the array are written into a bus record file to complete data synchronization.

2. The intelligent driving data synchronization method according to claim 1, characterized in that: The naming of the frame images in the video stream data according to a preset method is to name the frame images in the video stream data in a time sequence in a self-increasing manner.

3. The intelligent driving data synchronization method according to claim 1, characterized in that: Read the timestamp of the first frame CAN message and the timestamp of the last frame of the preset array, and calculate the time interval between the above timestamps and the timestamp of the CAN message at the end of the queue, including: Calculate the time interval interval1 between the timestamp of the last CAN message in the queue and the timestamp of the first CAN message in the preset array: interval1=ts2-ts1 Among them, ts2 represents the timestamp of the CAN message at the end of the queue, and ts1 represents the timestamp of the first frame CAN message of the preset array.

4. The intelligent driving data synchronization method according to claim 3, characterized in that: Calculate the time interval interval2 between the timestamp of the last CAN message in the queue and the timestamp of the last CAN message in the preset array: interval2=ts3-ts2 Among them, ts3 represents the timestamp of the last CAN message frame in the preset array.

5. The intelligent driving data synchronization method according to claim 4, characterized in that: The system time points of the first frame message and the last frame message are calculated according to the current system time point, including: The system time point t1 of the first frame message is calculated as t2-interval1, and the system time point t3 of the last frame message is calculated as t2+interval2.

6. The intelligent driving data synchronization method according to claim 1, characterized in that: The preset time period is achieved by a timer.

7. The intelligent driving data synchronization method according to claim 1, characterized in that: The trigger command is issued through a UI interface button or a physical key connected to the data acquisition system.

8. The intelligent driving data synchronization method according to claim 1, characterized in that: Video stream data is acquired through camera collection.

9. An intelligent driving data synchronization system, characterized in that: The system includes: a memory and a processor, wherein the memory includes an intelligent driving data synchronization method program, and when the intelligent driving data synchronization method program is executed by the processor, the following steps are implemented: Acquire video stream data and name frame images in the video stream data in a preset manner; Get the vehicle's CAN message data and save it in a preset queue; Obtain a trigger recording instruction, read the CAN message data in the preset queue into a preset array, use a cursor to point to the tail of the preset queue, and record the current system time point and the timestamp of the CAN message at the tail of the queue respectively; After a preset time, the CAN message data from the cursor to the end of the queue is added to the preset array; Read the timestamp of the first frame of the CAN message and the timestamp of the last frame of the preset array, and calculate the time interval between the above timestamps and the timestamp of the CAN message at the end of the queue; Calculate the system time points of the first frame message and the last frame message according to the current system time point; All frame images between the system time points of the first frame message and the last frame message are determined respectively and combined into a set; The frame images in the set are written into a video file, and all CAN messages of the array are written into a bus record file to complete data synchronization.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes an intelligent driving data synchronization method program. When the intelligent driving data synchronization method program is executed by a processor, the steps of an intelligent driving data synchronization method according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Multi-camera synchronization method, device and equipment and computer readable storage medium

    CN120455610A