Data playback method, electronic device and readable storage medium

文档序号:1952358 发布日期:2021-12-10 浏览:14次 中文

阅读说明:本技术 数据回放方法、电子设备及可读存储介质 (Data playback method, electronic device and readable storage medium ) 是由 田小森 谢蓉 张庆余 杜志彬 余楚礼 靳志刚 王耀福 于 2021-11-11 设计创作,主要内容包括:本发明实施例公开了一种数据回放方法、电子设备及介质,涉及自动驾驶领域。其中,方法包括:在实际场景中实时采集数据,并将采集到的数据和需要回放的处理后数据实时存储在采集端共享内存中,在所述共享内存中新数据覆盖历史数据;监听到所述采集端共享内存中存储新数据时读取最新存储的数据,并将读取到的数据按照时间顺序写入目标文件;按照所述时间顺序,将所述目标文件存储的数据存储至回放端共享内存中。本实施例可以提高回放系统的实时性、稳定性和简易性。(The embodiment of the invention discloses a data playback method, electronic equipment and a medium, and relates to the field of automatic driving. The method comprises the following steps: acquiring data in real time in an actual scene, storing the acquired data and processed data to be played back in a shared memory of an acquisition end in real time, and covering historical data with new data in the shared memory; reading the latest stored data when monitoring that the acquisition end shared memory stores new data, and writing the read data into a target file according to a time sequence; and storing the data stored in the target file into a shared memory of a playback end according to the time sequence. The embodiment can improve the real-time performance, stability and simplicity of the playback system.)

1. A method of data playback, comprising:

acquiring data in real time in an actual scene, storing the acquired data and processed data to be played back in a shared memory of an acquisition end in real time, and covering historical data with new data in the shared memory, wherein the processed data is data obtained after the acquired data is processed;

reading the latest stored data when monitoring that the acquisition end shared memory stores new data, and writing the read data into a target file according to a time sequence;

and storing the data stored in the target file into a shared memory of a playback end according to the time sequence.

2. The method according to claim 1, wherein the acquiring data in real time in an actual scene and storing the acquired data and the processed data to be played back in the shared memory of the acquiring end in real time comprises:

acquiring various types of data in real time through a plurality of sensors in an actual scene;

storing the acquired data and the processed data to be played back in a corresponding memory block in a shared memory of the acquisition end in real time according to the data type;

the monitoring is that when new data are stored in the shared memory of the acquisition terminal, the latest stored data are read, and the read data are written into a target file according to a time sequence, and the method comprises the following steps:

reading an xml file for defining the data storage attribute of the target file, and determining the storage address of the target file and each storage space corresponding to different data types;

reading the latest stored data when monitoring that the acquisition end shared memory stores new data;

and writing the read data into corresponding storage spaces in the target file at the storage address according to the data type of the read data.

3. The method according to claim 2, before storing the data stored in the target file into the shared memory at the playback end according to the time sequence, further comprising:

and creating a playback end shared memory at the playback end according to the xml file.

4. The method of claim 1, wherein the number of collection ends is one;

the monitoring reading the latest stored data when the acquisition terminal shared memory stores new data, and writing the read data into a target file according to a time sequence includes:

creating a plurality of target files in a collection end, wherein each target file corresponds to different space-time conditions of an actual scene;

reading the latest stored data when monitoring that the acquisition end shared memory stores new data, and determining a time-space condition corresponding to the read data;

writing the read data and the system current timestamp of the acquisition end into a target file corresponding to the determined space-time condition;

or

The monitoring reading the latest stored data when the acquisition terminal shared memory stores new data, and writing the read data into a target file according to a time sequence includes:

creating a plurality of target files in a collection end, wherein each target file corresponds to different data types;

reading the latest stored data when monitoring that the acquisition end shared memory stores new data, and determining the data type corresponding to the read data;

and writing the read data and the system current time stamp of the acquisition end into a target file corresponding to the determined data type.

5. The method according to claim 1, wherein the number of the collecting terminals is plural, and the plural collecting terminals include a main collecting terminal and at least one sub-collecting terminal;

the monitoring reading the latest stored data when the acquisition terminal shared memory stores new data, and writing the read data into a target file according to a time sequence includes:

creating a target file in each acquisition end of a plurality of acquisition ends;

when monitoring that new data is stored in a shared memory of any one of a plurality of acquisition ends, reading the newly stored data;

if any acquisition end is a main acquisition end, writing the read data and the system current timestamp of the main acquisition end into a target file of the main acquisition end;

and if any acquisition end is a sub acquisition end, correcting the system current time stamp of the sub acquisition end according to the system time of the main acquisition end, and writing the read data and the corrected system current time stamp into the target file of the sub acquisition end.

6. The method according to claim 4 or 5, wherein the storing the data stored in the target file into the shared memory of the playback end according to the time sequence comprises:

merging the data stored in the target files according to the system time stamps finally written in the target files;

and storing the merged data into the shared memory of the playback end according to the merged time sequence.

7. The method according to claim 1, further comprising, after storing the data stored in the target file into the shared memory at the playback end according to the time sequence:

and when monitoring that the new data is stored in the shared memory of the playback end, sending a new data notification to the outside.

8. The method according to claim 7, wherein the storing the data stored in the target file into the shared memory of the playback end according to the time sequence comprises at least one of the following steps:

responding to a playback starting point designation operation of a user, and storing data stored in the target file after designated time into the playback end shared memory according to a time sequence; the designated time is any time in a time interval corresponding to the data stored in the target file;

responsive to userNMultiple speed playback operation, based on the data stored in the target fileNStoring the multiple acquisition speed in a shared memory at the playback end, whereinNGreater than 0;

and responding to the circular playback operation of the user, and circularly storing the data stored in the target file into the playback end shared memory according to the time sequence.

9. An electronic device, comprising:

one or more processors;

a memory for storing one or more programs,

when executed by the one or more processors, cause the one or more processors to implement a data playback method as recited in any of claims 1-8.

10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out a data playback method as claimed in any one of claims 1 to 8.

Technical Field

Embodiments of the present invention relate to the field of automatic driving, and in particular, to a data playback method, an electronic device, and a medium.

Background

The current popular automatic driving and sourcing project auto (the first version of integrated sourcing software for automatically driving automobiles in the world), the Baidu sourcing automatic driving platform apollo3.0 and previous versions are all realized based on ROS (Robot Operating System). The ROS is a robot-oriented software platform. In the ROS, the modules of the autopilot system communicate as communication nodes based on a network communication mechanism.

In the development process of the automatic driving algorithm, a large number of real vehicle tests need to be carried out on the algorithm, and in order to store data in the real vehicle tests and play back the data in a laboratory, topic recording and Rosbag file playing back modes are generally adopted in the ROS. However, the automatic driving system has high real-time requirements on communication among modules, the node communication mechanism of the ROS causes poor real-time performance of data acquisition and playback, the complexity of a playback algorithm is high, and the stability of the playback system is reduced due to the existence of a centralized node.

Disclosure of Invention

Embodiments of the present invention provide a data playback method, an electronic device, and a medium, so as to improve data acquisition and playback efficiency, and reduce complexity of a playback algorithm, thereby ensuring real-time performance, stability, and simplicity of a playback system.

In a first aspect, an embodiment of the present invention provides a data playback method, including:

acquiring data in real time in an actual scene, storing the acquired data and processed data to be played back in a shared memory of an acquisition end in real time, and covering historical data with new data in the shared memory, wherein the processed data is data obtained after the acquired data is processed;

reading the latest stored data when monitoring that the acquisition end shared memory stores new data, and writing the read data into a target file according to a time sequence;

and storing the data stored in the target file into a shared memory of a playback end according to the time sequence.

In a second aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:

one or more processors;

a memory for storing one or more programs,

when the one or more programs are executed by the one or more processors, the one or more processors implement the data playback method of any embodiment.

In a third aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the data playback method according to any embodiment.

The embodiment of the invention stores the data collected in the actual scene and the processed data to be played back in the shared memory of the collecting terminal in real time, and makes use of the characteristics of the shared memory to enable each module (such as each module of an automatic driving system) to realize data interaction by accessing the shared memory, thereby improving the real-time performance of data collection and playback; in the interaction process, all modules are equal main bodies, so that the decentralization of a communication mechanism is realized, and the stability of a playback system is improved; meanwhile, the change process of the data of the shared memory is recorded through the target file, the data in the target file is written into the shared memory of the playback end again according to the time sequence of data writing, the playback of the actual scene data can be realized, the playback algorithm is simple, and the requirements on a processor and an operation platform are very low.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.

Fig. 1 is a flowchart of a data playback method provided in an embodiment of the present invention;

FIG. 2 is a schematic diagram of an xml file provided by an embodiment of the present invention;

fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.

In the description of the present invention, it should also be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.

Fig. 1 is a flowchart of a data playback method provided in an embodiment of the present invention, which is suitable for a situation where data collected in an actual scene is played back at a playback end, and the embodiment is executed by an electronic device. With reference to fig. 1, the method provided in this embodiment specifically includes:

and S10, acquiring data in real time in an actual scene, storing the acquired data and the processed data needing to be played back in a shared memory of an acquisition end in real time, and covering historical data with new data in the shared memory. Wherein the processed data is obtained by processing the acquired data.

Taking an automatic driving scene as an example, wherein the actual scene is an actual road section where the automatic driving vehicle runs; the acquisition end is computer equipment deployed in the automatic driving vehicle, and the computer equipment is a data processing center of the automatic driving system and used for processing data of each module of the automatic driving system. The modules of the automatic driving system comprise: the system comprises a driving module, a sensing module, a fusion module, a detection module, a positioning module, a control module, a vehicle network module and the like. A large amount of information interaction exists among the modules, for example, after the driving module acquires the driving information, the driving information is sent to the sensing module, the fusion module or the positioning module. In order to improve the data interaction efficiency, in this embodiment, a shared memory is created in advance at the acquisition end, where the shared memory is used to store data acquired by each module in an actual scene and processed data that needs to be played back, so that a process corresponding to each module can access the data through the shared memory, thereby implementing the fastest data interaction.

And after the shared memory of the acquisition end is created, acquiring data in real time through each module in an actual scene, and storing the data in the shared memory in real time. Since data in an actual scene is continuously changed, data in the shared memory is also continuously changed, and new data of the same kind of data continuously overwrites historical data, for example, new radar data overwrites old radar data. Therefore, the data in the shared memory can be guaranteed to be the latest all the time, and the data read by other modules are the latest all the time.

And after data are acquired in real time in the actual scene, the acquired data are processed to obtain processed data, and the processed data to be played back are stored in the shared memory of the acquisition end in real time. For example, data directly collected by a GPS/IMU (Global Positioning System/Inertial Measurement Unit) sensor connected through a Positioning module includes GPS data and IMU data; after the GPS data and the IMU data are collected, the GPS data and the IMU data are fused through a positioning module to form GPS/IMU positioning data, and the data are stored in the shared memory and are used for being read by other modules when needed.

And S20, reading the latest stored data when monitoring that the acquisition end shared memory stores new data, and writing the read data into a target file according to a time sequence.

Only the latest data is stored in the shared memory of the acquisition end, and the historical data cannot be read from the shared memory after being covered. In this embodiment, a target file is created in the acquisition end outside the shared memory, and all the historical data stored in the shared memory are recorded by using the target file according to the time sequence.

Specifically, first, the shared memory at the acquisition end is monitored, so as to know when data in the shared memory changes. Optionally, a snoop bit is set in the shared memory at the acquisition end, and the snoop bit changes in response to storing new data in the shared memory. Reading the value of a monitoring bit according to a certain monitoring frequency; if the value of the monitoring bit is 1, indicating that new data is stored in the shared memory; if the value of the snoop bit is 0, it indicates that the data in the shared memory data has not changed.

And then reading the newly stored data when monitoring that the shared memory stores new data, and writing the read data into a target file according to a time sequence. Specifically, in order to record the time sequence of data writing, the current system timestamp of the acquisition end and the read data may be written into the target file at the same time each time data is written.

It should be noted that, only the latest data is recorded in the shared memory, and the capacity can be very small, so long as the current data storage requirement of the automatic driving system is met; however, the target file records all the history data stored in the shared memory, and the capacity is relatively large. In order to avoid occupying too much memory space and at the same time facilitating copy and copy, the target file is not stored in memory, but in other space, such as a disk.

And S30, storing the data stored in the target file into the shared memory of the playback end according to the time sequence.

Still taking an automatic driving scene as an example, the playback end is a computer device running in a laboratory, and a playback end shared memory is created in the computer device and used for playing back a process of data stored in the acquisition end shared memory. After data in the acquisition end shared memory is written into a target file, the target file is stored to a playback end, and the data in the target file is stored into the playback end shared memory according to the time sequence recorded during writing. Therefore, the playback of the data storage process of the acquisition end shared memory is realized in the playback end shared memory.

The technical effect of the embodiment is as follows: the embodiment of the invention stores the data collected in the actual scene and the processed data to be played back in the shared memory of the collecting terminal in real time, and makes use of the characteristics of the shared memory to enable each module (such as each module of an automatic driving system) to realize data interaction by accessing the shared memory, thereby improving the real-time performance of data collection and playback; in the interaction process, all modules are equal main bodies, so that the decentralization of a communication mechanism is realized, and the stability of a playback system is improved; meanwhile, the change process of the data of the shared memory is recorded through the target file, the data in the target file is written into the shared memory of the playback end again according to the time sequence of data writing, the playback of the actual scene data can be realized, the playback algorithm is simple, and the requirements on a processor and an operation platform are very low.

On the basis of the above-described embodiment and the following embodiments, in consideration of the fact that the data collected in the actual scene usually has different data types, the present embodiment refines the process of storing data in the shared memory of the collection end and the process of writing data in the target file. Optionally, the acquiring data in real time in the actual scene, and storing the acquired data and the processed data to be played back in the shared memory of the acquiring end in real time includes: in an actual scene, multiple types of data are acquired in real time through multiple sensors, and the acquired data and the processed data to be played back are stored in corresponding memory blocks in a shared memory of an acquisition end in real time according to data types.

Correspondingly, the monitoring that the latest stored data is read when new data is stored in the shared memory of the acquisition end, and the read data is written into a target file according to a time sequence comprises the following steps: reading an xml (Extensible Markup Language) file for defining the data storage attribute of the target file, and determining the storage address of the target file and each storage space corresponding to different data types; when monitoring that the acquisition end shared memory stores new data, reading the newly stored data; and writing the read data into corresponding storage spaces in the target file at the storage address according to the data type of the read data.

In a specific implementation manner, the data playback method provided in this embodiment includes the following steps:

the method comprises the following steps: in an actual scene, multiple types of data are acquired in real time through multiple sensors, and the acquired data and the processed data to be played back are stored in corresponding memory blocks in a shared memory of an acquisition end in real time according to data types.

The automatic driving system comprises a plurality of sensors and can acquire various types of data; accordingly, after the acquired data is processed, various types of processed data can be obtained. In order to ensure the ordering of data access, the embodiment divides the shared memory of the acquisition end into different memory blocks, and allocates an independent memory block for each data type. After data of one type acquired in real time through any sensor in an actual scene is acquired, the data is stored in a memory block corresponding to the data type in real time; and after any type of processed data is obtained, storing the data in the memory block corresponding to the data type. The collected data type set and the processed data type set may be the same or different, or may partially overlap.

For example, the acquisition side shared memory is divided into a plurality of memory blocks, and the names of the plurality of memory blocks are "image", "bus signal", and "radar data", respectively. After an image is collected by a camera, the image is stored in a memory block named as an image; when radar data acquired by a radar is passed, the data is stored in a memory block named "radar data".

For another example, around the data types that the positioning module needs to play back, the acquisition side shared memory includes three memory blocks named "GPS", "IMU", and "GPS/IMU fusion data". GPS data is acquired by a GPS sensor and then stored in a memory block GPS; IMU data acquired by an IMU sensor is stored in a memory block IMU; after GPS data and IMU data are fused into GPS/IMU positioning data through a positioning module, the data are stored in a memory block 'GPS/IMU fusion data'.

Optionally, each memory block is accessed by the name and data address of the memory block. The data address represents an address of the memory block in the acquisition-side shared memory, and may be understood as a distance between a head address of the memory block and a head address of the acquisition-side shared memory. When any memory block is accessed, the name of the memory block to be accessed is firstly acquired, the corresponding data address is acquired according to the name, and the physical address of the head address of the memory block can be acquired according to the data address and the physical address of the head address of the shared memory of the acquisition end, so that the memory block is accessed.

Optionally, each memory block may be divided into a plurality of sub memory blocks, and each sub memory block corresponds to a different module. For example, the memory block named "image" includes a plurality of sub-memory blocks, which are named "driving module image", "sensing module image", and "positioning module image", respectively. Through the division of the sub memory blocks, the data can be managed in multiple dimensions, and the ordered storage and reading of the data are facilitated.

Optionally, the storing the acquired data and the processed data to be played back in real time according to the data type in a corresponding memory block in the shared memory of the acquisition end includes: if one type of data comprises structured data, serializing the structured data through a tool library protoc of google; if one type of data comprises unstructured data, converting the unstructured data into a character array, and therefore achieving serialization; and storing the serialized data in a corresponding memory block in the shared memory of the acquisition end in real time. Serialization refers to converting data into a byte sequence for easier storage and transmission.

Step two: and reading the xml file, and determining the storage address of the target file and each storage space corresponding to different data types.

The xml file is used for defining the data storage attribute of the target file and can be written by a user according to the requirement. Fig. 2 is a schematic diagram of an xml file according to an embodiment of the present invention. As shown in fig. 2, a storage address of the target file, a file size (200 megabits) of the target file, a data type (image, bus signal, laser radar data, GPS/IMU positioning data, etc.) stored by the target file, and a storage space of each type of data in the target file are defined by an xml file. For example, images are stored in memory space 1, bus signals are stored in memory space 2, lidar data is stored in memory space 3, and GPS/IMU positioning data is stored in memory space 4. The storage space 1, the storage space 2, the storage space 3 and the storage space 4 are storage spaces in the target file.

Step three: and reading the latest stored data when monitoring that the acquisition end shared memory stores new data.

Step four: and writing the read data into corresponding storage spaces in the target file at the storage address according to the data type of the read data.

After the latest stored data are read from the shared memory of the acquisition terminal, the data type of the data is judged firstly, and then the read data are written into the corresponding storage space in the target file according to the data type and the time sequence. For example, with continued reference to fig. 2, if the read data is image data, the number is written into the storage space 1 within the target file; if the read data is bus signal data, writing the data into a storage space 2 in a target file; if the read data is GPS/IMU positioning data, the data is written into the storage space 4 in the target file. The data of various data types are written into the target file according to a uniform time reference, and the written time sequence represents the time sequence of the memory data change of the sharing end.

Step five: and storing the data stored in the target file into a shared memory of a playback end according to the time sequence.

In this embodiment, for different data types, different memory blocks are divided in the shared memory at the acquisition end, and different storage spaces are correspondingly divided in the target file. Because various types of data may correspond to different access modes, the data is accessed in a corresponding memory block or storage space corresponding to any data type by adopting the corresponding access mode, so that the data access efficiency can be improved; meanwhile, the format of the target file is defined by matching with the xml file, when the data type is changed, the formats of all the target files can be modified only by modifying the content of the xml file, and the definition simplicity and flexibility of the target files are improved.

On the basis of the above-described embodiment and the following-described embodiment, the present embodiment refines the process of performing data playback on the playback side. Optionally, before the storing the data stored in the target file into the shared memory of the playback end according to the time sequence, the method further includes: and creating a playback end shared memory at the playback end according to the xml file.

When data playback is carried out, a playback end firstly reads each data type stored in a target file defined in an xml file, a playback end shared memory is established in a playback end shared memory according to each data type, and the playback end shared memory is divided into memory blocks corresponding to each data type.

Correspondingly, the storing the data stored in the target file into the shared memory of the playback end according to the time sequence includes: and storing the data of any data type stored in the target file into a memory block of the data type and a shared memory of a playback end according to the time sequence. In the shared memory of the playback end, the history data is also overwritten by new data. The access mechanism of each process of the playback end to the shared memory is the same as that of the acquisition end. Therefore, data playback of the acquisition end shared memory is realized in the playback end shared memory.

Similar to the division of the acquisition end shared memory, different memory blocks are divided in the playback end shared memory according to different data types, and data can be accessed in any memory block by adopting a corresponding access mode, so that the data access efficiency is improved.

Optionally, after the storing the data stored in the target file into the shared memory of the playback end according to the time sequence, the method further includes: and when monitoring that the new data is stored in the shared memory of the playback end, sending a new data notification to the outside. The new data notification is used to notify that the body of the new data needs to be used to read the new data.

Optionally, after the sending the new data notification, the method further includes: and reading the new data from the memory block in the shared memory of the playback end corresponding to the data type by the main body needing to use the new data according to the data type of the new data. And if the new data is serialized data, the program performs deserialization on the read data according to the serialization rule when the new data is stored in the shared memory of the acquisition end, and restores the byte sequence into a program object.

In addition, functions such as playback start point specification, double-speed playback, loop playback, and the like can also be realized at the playback end. Optionally, the storing the data stored in the target file into the shared memory of the playback end according to the time sequence includes at least one of the following steps:

step A: responding to a playback starting point designation operation of a user, and storing data stored in the target file after designated time into the playback end shared memory according to a time sequence; the designated time is any time in a time interval corresponding to the data stored in the target file.

Through step a, the function of playback start point designation can be realized at the playback end. Optionally, the earliest system timestamp stored in the target file is used as a time reference, and the latest system timestamp is used as a time endpoint, so as to generate a progress bar (i.e. a time interval); and responding to the operation that a user drags the progress bar to the appointed time, and storing the data, which are stored in the target file and correspond to the system time stamp later than the pointing time, into the playback end shared memory according to the time sequence, so that the data playback with the appointed time as the starting point is realized.

And B: responsive to userNMultiple speed playback operation, based on the data stored in the target fileNStoring the multiple acquisition speed in a shared memory at the playback end, whereinNGreater than 0.NWhen the playback speed is more than 1, the fast playback is realized;Nand when the value is less than 1, slow playback is realized.

Through step B, a double speed playback function can be realized at the playback end. For example, the system timestamps corresponding to the data stored in the target file are 8:00, 8:01, 8:02, and 8:03 …, the inter-frame interval (the time interval between two adjacent data frames) is 1 second, and the acquisition speed is 1 frame/second. When the data of 8:00, 8:01, 8:02 and 8:03 … stored in the target file is stored in the shared memory of the playback end according to the acquisition speed, the data playback at the normal speed can be realized. In response to the 2-time playback operation of the user, the data of 8:00, 8:01, 8:02 and 8:03 … … are stored into the shared memory of the playback end at the speed of 2 frames/second, so that the 2-time playback is realized.

And C: and responding to the circular playback operation of the user, and circularly storing the data stored in the target file into the playback end shared memory according to the time sequence.

Through step C, a loop playback function can be implemented at the playback end. For example, if the user sets the number of cycles to be 2, the data stored in the target file is stored into the playback-end shared memory once in time sequence, and then the data in the target file is stored into the playback-end shared memory once in time sequence. The data stored twice are identical in time sequence, so that the loop playback function can be realized. It should be noted that, after all the data stored in the target file is stored in the shared memory of the playback end each time, the shared memory of the playback end needs to be cleared, so as to perform the next loop playback.

By realizing the functions of designation of a playback starting point, double-speed playback, repeated playback and the like at the playback end, the data playback flexibility can be enhanced, and the diversified playback requirements of users can be better met.

In the above-described embodiment and the following embodiments, the number of the acquisition ends may be at least one, and the number of the target files may also be at least one. The correspondence between the at least one target file and the at least one acquisition end may present the following situations:

the first situation is as follows: the number of the acquisition ends is one, and the number of the target files is also one. Optionally, the reading the latest stored data when monitoring that new data is stored in the shared memory of the acquisition end, and writing the read data into a target file according to a time sequence includes: creating a target file at the acquisition end; when monitoring that the acquisition end shared memory stores new data, reading the newly stored data; and writing the read data and the system current time stamp of the acquisition end into the target file.

Case two: the number of the acquisition ends is one, a plurality of target files are created in the acquisition ends, and each target file corresponds to different space-time conditions in an actual scene. Optionally, the reading the latest stored data when monitoring that new data is stored in the shared memory of the acquisition end, and writing the read data into a target file according to a time sequence includes: creating a plurality of target files in a collection end, wherein each target file corresponds to different space-time conditions of an actual scene; reading the latest stored data when monitoring that the acquisition end shared memory stores new data, and determining a time-space condition corresponding to the read data; and writing the read data and the system current time stamp of the acquisition end into a target file corresponding to the determined space-time condition.

The space-time conditions of the actual scene are various, and different target files can be created in an acquisition end to store actual scene data under different space-time conditions, so that the continuity of the data in the target files in time and space can be maintained. For example, an acquisition end is deployed on a highway section, data is acquired in a period of time in the early morning and finally stored in a target file 1, and data is acquired in a period of time in the evening and finally stored in a target file 2; then, the acquisition end is deployed in an urban road section to acquire data for a period of time, and finally the data is stored in the target file 3. And storing the current system time stamp of the acquisition end while storing the data. Since there is only one acquisition end, the time references of the system current time stamps stored in the plurality of target files are the same.

Case three: the number of the acquisition ends is one, a plurality of target files are created in the acquisition ends, and each target file corresponds to different data types. Optionally, the reading the latest stored data when monitoring that new data is stored in the shared memory of the acquisition end, and writing the read data into a target file according to a time sequence includes: creating a plurality of target files in a collection end, wherein each target file corresponds to different data types; reading the latest stored data when monitoring that the acquisition end shared memory stores new data, and determining the data type corresponding to the read data; and writing the read data and the system current time stamp of the acquisition end into a target file corresponding to the determined data type.

The information of the actual scene is very rich, and the data types of the acquired data and the processed data are various. Different target files can be created in a collection end to record data of different data types, so that the continuity of the data in the target files on the data types can be ensured. For example, at an acquisition site, the image and radar data are ultimately stored in a target file 1, and the GPS data, IMU data, and GPS/IMU positioning data are ultimately stored in a target file 2. And storing the current system time stamp of the acquisition end while storing the data. Similarly, since there is only one acquisition end, the time references of the system current time stamps stored in the plurality of target files are the same.

Case four: the number of the acquisition ends is multiple, the number of the target files is multiple, and at least one target file is created in each acquisition end.

In order to improve the data acquisition efficiency, a plurality of acquisition terminals may be deployed to acquire data simultaneously. Optionally, the plurality of collecting terminals includes a main collecting terminal and at least one sub-collecting terminal. In the multiple acquisition ends, one acquisition end is used as a main acquisition end, and the other devices are all sub-acquisition ends. The main acquisition end is used for correcting the system time stamp of the sub-acquisition end and providing a uniform time reference for all the acquisition ends. In one embodiment, if an acquisition end is connected to the GPS/IMU sensor, the acquisition end is used as the primary acquisition end. The system time stamp of the main acquisition end takes GPS/IMU time as a reference, and because the GPS/IMU is a vehicle positioning sensor, vehicle decision control in an automatic driving system is generally calculated according to positioning, the GPS/IMU time is used as the reference, so that the vehicle running error can be minimized, and the data is most reliable.

Correspondingly, the step of reading the latest stored data when monitoring that the acquisition end shares the memory to store the new data and writing the read data into the target file according to the time sequence comprises the following steps:

the method comprises the following steps: a target file is created in each of a plurality of acquisition endpoints. At least one target file is created in each acquisition end. When the number of the target files at the first acquisition end is multiple, each target file may correspond to different time-space conditions and/or different data types, which are detailed in case two and/or case three, and are not described herein again.

Step two: and reading the newly stored data when monitoring that the shared memory of any one of the plurality of acquisition ends stores new data.

Still taking the application scenario of the automatic driving system as an example, at least one module of the automatic driving system is operated on any acquisition terminal, and a shared memory is used for realizing communication between the modules. Monitoring the shared memory of each acquisition end, and reading the latest stored data when monitoring that the shared memory of any acquisition end stores new data.

Step three: and if any acquisition end is a main acquisition end, writing the read data and the system current timestamp of the main acquisition end into a target file of the main acquisition end.

When the read data come from the main acquisition end, the system current time stamp corresponding to the data is based on the system time of the main acquisition end, and the data and the time stamp are directly written into a target file of the main acquisition end.

Step four: and if any acquisition end is a sub acquisition end, correcting the system current time stamp of the sub acquisition end according to the system time of the main acquisition end, and writing the read data and the corrected system current time stamp into the target file of the sub acquisition end.

When the read data comes from a branch acquisition end, the system current time stamp corresponding to the data is based on the system time of the branch acquisition end. And the system time of the sub-acquisition end and the system time of the main acquisition end may have errors, so the current system time stamp of the sub-acquisition end needs to be corrected according to the system time of the main acquisition end to unify the time reference. And after correction, writing the data and the corrected time stamp into the target file of the sub-collection end.

Optionally, before the correcting the system current timestamp of any one of the acquisition ends according to the system time of the main acquisition end, the method further includes: and sending the system time of the main acquisition end to each sub acquisition end, and calculating the error of the difference between the system time of each sub acquisition end and the system time of the main acquisition end. Correspondingly, the correcting the system current timestamp of any acquisition end according to the system time of the main acquisition end comprises: and correcting the current system time stamps of the sub-collection ends according to the errors.

For example, still assuming that the main acquisition end is connected with a GPS/IMU sensor, the system time of the main acquisition end is a GPS/IMU clock. The main acquisition end sends GPS/IMU clocks to all the sub-acquisition ends, and after any sub-acquisition end receives the GPS/IMU clocks, the error between the system time of the sub-acquisition end and the GPS/IMU clocks is calculated. The calculation frequency was 50Hz and the mean error value was calculated every 5 error values. And within 100ms after the error average value is obtained, correcting the current system timestamp extracted each time by the sub-acquisition end by the error average value.

In an application scenario, the above situations may exist independently, or at least two of the situations two, three, and four may exist simultaneously. Specifically, when the second situation and the third situation exist simultaneously, at least one target file exists at the acquisition end, and the corresponding space-time condition and data type exist simultaneously, and the other target files correspond to different space-time conditions or different data types. Correspondingly, the monitoring reading the latest stored data when the acquisition end shared memory stores new data, and writing the read data into a target file according to a time sequence includes: a plurality of target files are created in a collection end, wherein at least one target file has corresponding time-space conditions and data types at the same time, and the other target files correspond to different time-space conditions or different data types; reading the latest stored data when monitoring that the acquisition end shared memory stores new data, and determining the time-space conditions and/or the data types corresponding to the read data; and writing the read data and the system current time stamp of the acquisition end into a target file corresponding to the determined space-time condition and/or data type.

When the case two and/or the case three and the case four exist simultaneously, each target file in at least one acquisition end corresponds to different space-time conditions and/or different data types. Correspondingly, the monitoring reading the latest stored data when the acquisition end shared memory stores new data, and writing the read data into a target file according to a time sequence includes: creating a plurality of target files in at least one acquisition end of a plurality of acquisition ends; reading newly stored data when new data are stored in a shared memory of any one of the at least one acquisition end, and determining a time-space condition and/or a data type corresponding to the read data; if any acquisition end is a main acquisition end, writing the read data and the system current timestamp of any acquisition end into a target file corresponding to the determined space-time condition and/or data type in any acquisition end; and if the any acquisition end is a first acquisition end, correcting the system current time stamp of the any acquisition end according to the system time of a main acquisition end, and writing the read data and the corrected system current time stamp into a target file corresponding to the determined space-time condition and/or data type in the any acquisition end.

In the embodiment, the system current timestamps of the branch acquisition ends are corrected, so that the reference of the timestamps of the plurality of acquisition ends is unified, the time sequence marked by the timestamps is the time sequence of data change in an actual scene, and a foundation is provided for subsequently performing data playback according to the time sequence. Meanwhile, only system time communication is carried out among the plurality of acquisition ends, and the acquired data communication is not carried out, so that the communication data volume is reduced, and the efficiency of the whole automatic driving system and the playback system is improved.

Optionally, after completing the data writing of the multiple target files, the storing the data stored in the target files into the shared memory of the playback end according to the time sequence includes: merging the data stored in the target files according to the system time stamps finally written in the target files; and storing the merged data into the shared memory of the playback end according to the merged time sequence. And arranging the system time stamps stored in the plurality of target files in sequence to obtain a combined time sequence which represents the time sequence of data change in the actual scene. And storing the merged data into the shared memory of the playback end according to the merged time sequence, so that the playback of the data storage process in the actual scene can be realized.

Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 3, the electronic device includes a processor 30, a memory 31, an input device 32, and an output device 33; the number of processors 30 in the device may be one or more, and one processor 30 is taken as an example in fig. 3; the processor 30, the memory 31, the input means 32 and the output means 33 in the device may be connected by a bus or other means, as exemplified by the bus connection in fig. 3.

The memory 31 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the data playback method in the embodiment of the present invention. The processor 30 executes various functional applications of the device and data processing, i.e., implements the above-described data playback method, by executing software programs, instructions, and modules stored in the memory 31.

The memory 31 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 31 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 31 may further include memory located remotely from the processor 30, which may be connected to the device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.

The input device 32 may be used to receive input numeric or character information and to generate key signal inputs relating to user settings and function controls of the apparatus. The output device 33 may include a display device such as a display screen.

Embodiments of the present invention also provide a computer-readable storage medium on which a computer program is stored, where the computer program is executed by a processor to implement the data playback method of any embodiment.

Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.

A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).

Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present invention.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种看门狗的屏蔽方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!