Ring Buffer-based Design Method, Device and Equipment for Sensor Abstraction Layer

Through the sensor abstraction layer design method based on ring buffers, the software complexity problem caused by sensor model differences is solved, the unified processing of sensor data is realized and the application design is simplified, which reduces user workload and improves debugging efficiency.

CN119962266BActive Publication Date: 2025-07-25SIENGINE TECH CO LTD

Patent Information

Application Number
CN202510447910.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-07-25
Estimated Expiration
2045-04-10

AI Technical Summary

Technical Problem

In the prior art, the direct adaptation of intelligent driving applications to different models of sensors will lead to high software design complexity, large coding workload, and data protocol differences, resulting in inconvenient debugging.

Method used

Using a sensor abstraction layer design method based on ring buffers, a sensor abstraction layer is constructed to realize the reading, storing and decoding of the sensor's original data, providing a unified data structure and operation interface, and isolating the differences between different models of sensors through plug-ins.

Benefits of technology

It simplifies the difficulty of adapting to sensors of different models of upper-level applications, provides a unified operation interface, reduces user workload, and facilitates debugging of upper-level applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119962266B_ABST
    Figure CN119962266B_ABST
Patent Text Reader

Abstract

The present invention discloses a design method, device and equipment of a sensor abstraction layer based on a circular buffer, which relates to the technical field of vehicle sensor data processing. The method includes constructing a sensor abstraction layer, where the sensor abstraction layer includes plugins corresponding to different types of sensors, which are used to read and store the original sensor data based on the circular buffer, and decode the original sensor data to obtain a unified data structure and a unified operation interface; reading the original sensor data of the corresponding sensor based on the plugins of the sensor abstraction layer, and storing the read original sensor data into the circular buffer; sequentially reading the original sensor data from the circular buffer and performing a decoding operation, and sending the decoded data to the upper-layer intelligent driving application. This application can effectively reduce the difficulty of the upper-layer application in adapting to different models of sensors and simplify the design of the upper-layer application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of vehicle sensor data processing, and particularly relates to a design method, device, and equipment of a sensor abstraction layer based on a circular buffer. Background Art

[0002] Intelligent driving applications need to access various types of sensor data. Common sensor types include Camera, LiDAR, Radar, IMU, GNSS, CAN, etc. These different types of sensor data have very different data types and operation methods, and most of them are not standardized. It will waste a lot of manpower for upper-layer applications to directly adapt to different models of sensors.

[0003] If the intelligent driving software directly adapts to different models of sensors, there will be the following disadvantages: (1) The code needs to design multiple different branches for accessing different models of sensors, increasing the complexity of software design; (2) Since different models of sensors have differences in their transport layer types and data protocols, it increases the workload of software coding; (3) Due to different data protocols, there is a lack of a unified data storage and playback format, which is inconvenient for upper-layer application debugging. Summary of the Invention

[0004] This application provides a design method, device, and equipment of a sensor abstraction layer based on a circular buffer, which can effectively reduce the difficulty of upper-layer applications adapting to different models of sensors and simplify the design of upper-layer applications.

[0005] In a first aspect, an embodiment of this application provides a design method of a sensor abstraction layer based on a circular buffer. The design method of the sensor abstraction layer based on a circular buffer includes:

[0006] Construct a sensor abstraction layer, where the sensor abstraction layer includes plugins corresponding to different types of sensors, which are used to read and store sensor raw data based on a circular buffer, and decode the sensor raw data to obtain a unified data structure and a unified operation interface;

[0007] Read the sensor raw data of the corresponding sensor based on the plugin of the sensor abstraction layer, and store the read sensor raw data in the circular buffer;

[0008] Read the sensor raw data from the circular buffer in sequence and perform a decoding operation, and send the decoded data to the upper-layer intelligent driving application.

[0009] In combination with the first aspect, in one embodiment, the plug-ins include a camera plug-in corresponding to a camera, a lidar plug-in corresponding to a lidar, a millimeter-wave radar plug-in corresponding to a millimeter-wave radar, an inertial navigation plug-in corresponding to an inertial measurement unit, a satellite navigation plug-in corresponding to a satellite navigation system, and a CAN plug-in corresponding to a controller area network.

[0010] In combination with the first aspect, in one embodiment,

[0011] The unified data structure obtained by decoding the original sensor data of each type of sensor includes an image data frame, a lidar data frame, a millimeter-wave radar data frame, an inertial unit data frame, a satellite navigation data frame, and a CAN data frame;

[0012] The image data frame includes a timestamp, a DMA BUF, and attributes, and the lidar data frame includes a timestamp, Decoded Returns, and attributes;

[0013] The millimeter-wave radar data frame includes a timestamp, Radar Scans, and attributes, and the inertial unit data frame includes a timestamp, IMU Mesurements, and attributes;

[0014] The satellite navigation data frame includes a timestamp, GNSS Mesurements, and attributes, and the CAN data frame includes a timestamp, CANFD Message, and attributes;

[0015] The unified operation interface includes sensor lifecycle management, sensor data interaction, and sensor data decoding;

[0016] The sensor lifecycle management includes GetSensorInformation, CreateSensor, StartSensor, ResetSensor, StopSensor, and ReleaseSensor;

[0017] The sensor data interaction includes GetRawData, ReturnRawData, PushRawData, RawDataReadyForDecode, SendMessage, SetFilter, and ClearFilter;

[0018] The sensor data decoding includes GetDecodeConstants, GetDecodeFrame, and ValidatePacket.

[0019] In combination with the first aspect, in one embodiment, the plug-in includes a circular buffer for storing the original sensor data read from the sensor, a decoding queue for storing the original sensor data to be decoded, and an interface for decoding the original sensor data.

[0020] In combination with the first aspect, in one embodiment, the plug-in based on the sensor abstraction layer reads the original sensor data of the corresponding sensor and stores the read original sensor data in the circular buffer. Specifically, it includes:

[0021] The plug-in corresponding to the current sensor in the sensor abstraction layer reads the original sensor data;

[0022] The plug-in stores the read original sensor data in the circular buffer.

[0023] In combination with the first aspect, in one embodiment, the original sensor data is sequentially read from the circular buffer and decoded, and the decoded data is sent to the upper-layer intelligent driving application. Specifically, it includes:

[0024] The intelligent driving application sequentially reads the original sensor data from the circular buffer and sends the read original sensor data to the decoding queue of the corresponding plug-in;

[0025] Obtain the original sensor data from the decoding queue and perform a decoding operation to obtain the decoded data and send it to the intelligent driving application;

[0026] The intelligent driving application receives the decoded data and processes the decoded data.

[0027] In combination with the first aspect, in one embodiment,

[0028] The sensor abstraction layer is further configured to copy the original sensor data read from the circular buffer to the disk storage queue to implement the sequential storage operation of the original sensor data;

[0029] The sensor abstraction layer is further configured to load the stored original sensor data into the playback queue, call the PushRawData interface to send the original sensor data in the playback queue to the decoding queue of the corresponding plug-in for decoding operation.

[0030] In combination with the first aspect, in one embodiment,

[0031] The circular buffer in the plug-in supports multiple producers to write data and multiple consumers to read data;

[0032] The producer is a thread for reading the original sensor data of the sensor;

[0033] The consumer is a thread for decoding the raw sensor data.

[0034] In a second aspect, an embodiment of the present application provides a device for designing a sensor abstraction layer based on a circular buffer. The device for designing a sensor abstraction layer based on a circular buffer includes:

[0035] A construction module, which is used to construct a sensor abstraction layer. The sensor abstraction layer includes plugins corresponding to different types of sensors, which are used to read and store raw sensor data based on a circular buffer, and decode the raw sensor data into a unified data structure and a unified operation interface;

[0036] A reading module, which is used to read the raw sensor data of the corresponding sensor based on the plugin of the sensor abstraction layer and store the read raw sensor data in the circular buffer;

[0037] A decoding module, which is used to sequentially read the raw sensor data from the circular buffer and perform a decoding operation, and send the decoded data to the upper-level intelligent driving application.

[0038] In a third aspect, an embodiment of the present application provides a device for designing a sensor abstraction layer based on a circular buffer. The device for designing a sensor abstraction layer based on a circular buffer includes a processor, a memory, and a program for designing a sensor abstraction layer based on a circular buffer stored on the memory and executable by the processor. When the program for designing a sensor abstraction layer based on a circular buffer is executed by the processor, the steps of the method for designing a sensor abstraction layer based on a circular buffer described above are implemented.

[0039] The beneficial effects brought by the technical solutions provided by the embodiments of the present application include:

[0040] The upper-layer application is isolated from the physical sensor through the sensor abstraction layer, shielding the differences of different models of sensors, providing a unified operation interface for the upper-layer application, and simplifying the design of the upper-layer application; a unified access specification is provided for the physical sensor, and the sensor vendor can encapsulate the data protocol and operation method into a plugin and provide it for the sensor abstraction layer to call, reducing the workload of users; the sensor abstraction layer provides unified data disk writing and playback functions, facilitating the debugging of the upper-layer application. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a schematic flowchart of the method for designing a sensor abstraction layer based on a circular buffer of the present application;

[0042] Figure 2 It is a schematic structural diagram of the sensor abstraction layer of the present application;

[0043] Figure 3Schematic diagram of the process for acquiring sensor raw data and performing decoding operations;

[0044] Figure 4 Design block diagram of a multi-producer multi-consumer circular buffer;

[0045] Figure 5 Schematic diagram of the functional modules of the sensor abstraction layer design device based on a circular buffer in this application;

[0046] Figure 6 Schematic diagram of the hardware structure of the device for designing the sensor abstraction layer based on a circular buffer in this application. Detailed implementation manners

[0047] In order to enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts shall fall within the protection scope of this application.

[0048] To make the purpose, technical solution, and advantages of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings.

[0049] In a first aspect, an embodiment of this application provides a method for designing a sensor abstraction layer based on a circular buffer, which is used to reduce the difficulty of upper-layer applications adapting to different types of sensors and simplify the design of upper-layer applications.

[0050] In one embodiment, refer to Figure 1 , Figure 1 which is a schematic flowchart of the method for designing the sensor abstraction layer based on a circular buffer in this application. As Figure 1 shown, the method for designing the sensor abstraction layer based on a circular buffer includes:

[0051] S1: Construct a sensor abstraction layer, where the sensor abstraction layer includes plugins corresponding to different types of sensors, which are used to read and store sensor raw data based on a circular buffer, and decode the sensor raw data to obtain a unified data structure and a unified operation interface; the sensor abstraction layer is used as a part of the intelligent driving application middleware;

[0052] S2: Read the sensor raw data of the corresponding sensor based on the plugin of the sensor abstraction layer, and store the read sensor raw data in the circular buffer;

[0053] S3: Read the sensor raw data from the circular buffer in sequence and perform decoding operations, and send the decoded data to the upper-layer intelligent driving application.

[0054] See Figure 2 As shown, it is a schematic structural diagram of the sensor abstraction layer. For the plugins therein, specifically, it includes a camera plugin corresponding to the camera, a lidar plugin corresponding to the lidar, a millimeter-wave radar plugin corresponding to the millimeter-wave radar, an inertial navigation plugin corresponding to the inertial measurement unit, a satellite navigation plugin corresponding to the satellite navigation system, and a CAN (Controller Area Network) plugin corresponding to the controller area network. Each plugin is used to read the raw sensor data of the corresponding sensor and perform a decoding operation. In actual applications, if there are other types of sensors, corresponding plugins are provided in the sensor abstraction layer.

[0055] In this application, the unified data structures corresponding to the decoded raw sensor data of each type of sensor include an image data frame, a lidar data frame, a millimeter-wave radar data frame, an inertial unit data frame, a satellite navigation data frame, and a CAN data frame. For example, the unified data structure obtained by decoding the raw sensor data of the lidar is a lidar data frame.

[0056] Specifically, the image data frame includes a timestamp, a DMA BUF, and attributes; the lidar data frame includes a timestamp, Decoded Returns, and attributes; the millimeter-wave radar data frame includes a timestamp, Radar Scans, and attributes; the inertial unit data frame includes a timestamp, IMU Mesurements, and attributes; the satellite navigation data frame includes a timestamp, GNSSMesurements, and attributes; the CAN data frame includes a timestamp, CANFD Message, and attributes.

[0057] Among them, DMA BUF is a direct memory access buffer, Decoded Returns is a decoded radar data frame, Radar Scans is a radar scan data frame, IMU Mesurements is an inertial measurement unit data frame, GNSSMesurements is a satellite navigation system data frame, and CANFD Message is a controller area network message.

[0058] For the attributes in the image data frame, they are image attributes, including width, height, format, frame rate, offset address, etc.; for the attributes in the lidar data frame, they are lidar attributes, including scanning frequency, number of points output per scan, point cloud step size, horizontal start angle, horizontal end angle, vertical start angle, vertical end angle, etc.; for the attributes in the millimeter-wave radar data frame, they are millimeter-wave radar attributes, including scanning type, number of data frames returned per scan, scanning frequency, etc.; for the attributes in the inertial unit data frame, they are inertial unit attributes, including initial alignment state, temperature state, whether to enable temperature compensation, etc.; for the attributes in the satellite navigation data frame, they are satellite navigation data attributes, including satellite navigation positioning type, satellite navigation positioning state, timestamp quality, etc.; for the attributes in the CAN data frame, they are CAN attributes, including data frame type, transmission baud rate, etc.

[0059] In this application, the unified operation interface includes sensor lifecycle management, sensor data interaction, and sensor data decoding. By decoding the original sensor data of various types of sensors into a unified data structure, a unified operation interface is formed and provided to the upper-layer application.

[0060] Specifically, the sensor lifecycle management includes GetSensorInformation, CreateSensor, StartSensor, ResetSensor, StopSensor, ReleaseSensor; the sensor data interaction includes GetRawData, ReturnRawData, PushRawData, RawDataReadyForDecode, SendMessage, SetFilter, ClearFilter; the sensor data decoding includes GetDecodeConstants, GetDecodeFrame, ValidatePacket.

[0061] Among them, GetSensorInformation represents obtaining sensor attribute information; CreateSensor represents creating a sensor object; StartSensor represents starting a sensor object; ResetSensor represents resetting a sensor object; StopSensor represents stopping a sensor object; ReleaseSensor represents releasing a sensor object; GetRawData represents obtaining raw data; ReturnRawData represents returning raw data; PushRawData represents pushing raw data; RawDataReadyForDecode represents whether the raw data is complete and can start decoding; SendMessage represents sending a message to the sensor; SetFilter represents setting a (CAN message) filter; ClearFilter represents clearing a (CAN message) filter; GetDecodeConstants represents obtaining sensor decoding attribute constants; GetDecodeFrame represents obtaining the decoded sensor data frame; ValidatePacket represents validating the sensor data frame.

[0062] For the structure of the plugin, see Figure 3 As shown, the plugin includes a circular buffer for storing the sensor raw data read from the sensor, a decoding queue for storing the sensor raw data to be decoded, and an interface for decoding the sensor raw data. That is, for the main components of the plugin, it should include a circular buffer (for storing the sensor raw data read from the sensor), a decoding queue (for storing the sensor raw data to be decoded), and a set of interfaces (for decoding the sensor raw data).

[0063] Further, in one embodiment, the plugin based on the sensor abstraction layer reads the sensor raw data of the corresponding sensor and stores the read sensor raw data in the circular buffer, specifically including:

[0064] S201: The plugin corresponding to the current sensor in the sensor abstraction layer reads the sensor raw data;

[0065] S202: The plugin stores the read sensor raw data in the circular buffer.

[0066] Further, in one embodiment, the sensor raw data is sequentially read from the circular buffer and decoded, and the decoded data is sent to the upper-layer intelligent driving application, specifically including:

[0067] S301: The intelligent driving application sequentially reads the raw sensor data from the circular buffer and sends the read raw sensor data to the decoding queue of the corresponding plugin. For example, if the read raw sensor data is the raw sensor data of a lidar, the raw sensor data is sent to the decoding queue of the lidar plugin.

[0068] S302: Obtain the raw sensor data from the decoding queue and perform decoding operations to obtain the decoded data and send it to the intelligent driving application.

[0069] S303: The intelligent driving application receives the decoded data and processes the decoded data.

[0070] Specifically, refer to Figure 3 As shown, it is a schematic diagram of the process of obtaining the raw sensor data and performing decoding operations. The plugin waits for the sensor to detect the raw sensor data and reads it, stores the read raw sensor data at the head of the circular buffer. The intelligent driving application obtains the raw sensor data from the tail of the circular buffer, and performs a push operation on the obtained raw sensor data, pushing it into the decoding queue of the plugin corresponding to the raw sensor data. Then, it obtains the raw sensor data from the decoding queue and performs decoding operations to obtain the decoded data. The intelligent driving application obtains the decoded data and processes the decoded data.

[0071] It should be noted that for the decoding of the raw sensor data in this application, taking the Robosense M1 lidar as an example, it outputs two protocol frames (i.e., the raw sensor data) through Ethernet: MSOP (Main dataStream Output Protocol) and DIFOP (Device Info Output Protocol). Among them, MSOP contains fields such as time_offset, radius, elevation, azimuth, intensity, etc. Decoding and processing it can calculate information such as the timestamp and polar coordinates of the point cloud; DIFOP contains some configuration information of the radar, such as whether it is a single echo mode or a double echo mode. Decoding and processing it can obtain the echo mode information. In actual applications, for the specific decoding logic of the raw sensor data, it can be written into the plugin by the sensor supplier or the customer themselves.

[0072] It should be noted that for the processing of the decoded data obtained by decoding the raw sensor data, the processing logic is written by the algorithm supplier or the customer themselves, generally including these operations: converting polar coordinates to Cartesian coordinates, motion compensation, filtering, converting the sensor coordinate system to the vehicle body coordinate system, point cloud perception model processing, etc.

[0073] Furthermore, the sensor abstraction layer of the present application is also used to provide unified data disk writing and playback functions to facilitate the debugging of upper-layer applications. The sensor abstraction layer copies the original sensor data read from the circular buffer to the disk writing queue to implement the sequential storage operation of the original sensor data. Specifically, when the upper-layer application is debugging, for data disk writing, the intelligent driving application copies the original sensor data read from the circular buffer to the disk writing queue, thereby implementing the disk writing of the original sensor data.

[0074] The sensor abstraction layer loads the stored original sensor data into the playback queue and calls the PushRawData interface (an interface for implementing data transmission) to send the original sensor data in the playback queue to the decoding queue of the corresponding plugin for decoding operations. Specifically, when the upper-layer application is debugging, for data playback, the intelligent driving application loads the stored original sensor data into the playback queue and then sends the original sensor data in the playback queue to the decoding queue of the corresponding plugin.

[0075] Furthermore, as shown in Figure 4 the circular buffer within the plugin supports multiple producers to write data and multiple consumers to read data, and can support lock-free operations for high-frequency reading and writing. The circular buffer also has buffer units with 4 read-write states, Figure 4 where Filled represents the full state, Reading represents the read-locked state, Writing represents the write-locked state, and Empty represents the empty state.

[0076] The producer is a thread used to read the original sensor data of the sensor, that is, the thread within the plugin responsible for reading the original sensor data from the physical interface (Ethernet / serial port) is the producer, and the producer is connected to the head of the circular buffer. The consumer is a thread used to perform decoding operations on the original sensor data, that is, the thread responsible for decoding the original sensor data into a unified data structure, and the consumer is connected to the tail of the circular buffer.

[0077] The design method of the sensor abstraction layer based on the circular buffer in the embodiment of the present application isolates the upper-layer application from the physical sensor through the sensor abstraction layer, shields the differences of different models of sensors, provides a unified operation interface for the upper-layer application, and simplifies the design of the upper-layer application; provides a unified access specification for the physical sensor, and the sensor vendor can encapsulate the data protocol and operation method into a plugin and provide it for the sensor abstraction layer to call, reducing the workload of users; the sensor abstraction layer provides unified data disk writing and playback functions to facilitate the debugging of upper-layer applications.

[0078] In a second aspect, the embodiment of the present application also provides a design device for a sensor abstraction layer based on a circular buffer.

[0079] In one embodiment, referring toFigure 5 , Figure 5 is a schematic diagram of the functional modules of the device for designing the sensor abstraction layer based on the circular buffer in this application. As Figure 5 shown, the device for designing the sensor abstraction layer based on the circular buffer includes: a construction module, a reading module, and a decoding module.

[0080] The construction module is used to construct the sensor abstraction layer. The sensor abstraction layer includes plugins corresponding to different types of sensors, which are used to read and store the original sensor data based on the circular buffer, and decode the original sensor data into a unified data structure and a unified operation interface; the reading module is used to read the original sensor data of the corresponding sensor based on the plugins of the sensor abstraction layer, and store the read original sensor data into the circular buffer; the decoding module is used to sequentially read the original sensor data from the circular buffer and perform decoding operations, and send the decoded data to the upper-layer intelligent driving application.

[0081] In a third aspect, an embodiment of this application provides a device for designing the sensor abstraction layer based on the circular buffer. The device for designing the sensor abstraction layer based on the circular buffer can be a device with data processing functions such as a personal computer (PC), a laptop computer, a server, etc.

[0082] Referring to Figure 6 , Figure 6 is a schematic diagram of the hardware structure of the device for designing the sensor abstraction layer based on the circular buffer involved in the solution of the embodiment of this application. In the embodiment of this application, the device for designing the sensor abstraction layer based on the circular buffer may include a processor, a memory, a communication interface, and a communication bus.

[0083] Among them, the communication bus can be of any type and is used to interconnect the processor, the memory, and the communication interface.

[0084] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces, etc., which are used to implement the interconnection of components inside the device for designing the sensor abstraction layer based on the circular buffer, and interfaces for implementing the interconnection of the device for designing the sensor abstraction layer based on the circular buffer with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display screen (Display), a keyboard (Keyboard), etc.

[0085] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical memory, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0086] The processor can be a general-purpose processor, which can call the program for designing the sensor abstraction layer based on the circular buffer stored in the memory and execute the method for designing the sensor abstraction layer based on the circular buffer provided in the embodiments of the present application. For example, the general-purpose processor can be a central processing unit (CPU). Among them, the method executed when the program for designing the sensor abstraction layer based on the circular buffer is called can refer to the various embodiments of the method for designing the sensor abstraction layer based on the circular buffer in the present application, which will not be elaborated here.

[0087] Those skilled in the art can understand that Figure 6 the hardware structure shown in

[0088] does not constitute a limitation to the present application, and may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. The terms "including" and "having" and any variations thereof in the description of the embodiments of the present application, as well as in the claims and the above-mentioned drawings, are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally further include steps or units not listed, or may optionally further include other steps or units inherent to these processes, methods, products or devices. The descriptions with terms such as "first", "second", and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit that "first", "second", and "third" are of different types.

[0089] In the description of the embodiments of the present application, terms such as "exemplary", "for example", or "for instance" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary", "for example", or "for instance" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of terms such as "exemplary", "for example", or "for instance" is intended to present relevant concepts in a specific manner.

[0090] In the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality of" means two or more than two.

[0091] In some of the processes described in the embodiments of the present application, there are a plurality of operations or steps that appear in a specific order. However, it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or may be executed in parallel. The serial numbers of the operations are only used to distinguish different operations, and the serial numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in order or in parallel, and these operations or steps may be combined.

[0092] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) as described above and includes several instructions for causing a terminal device to execute the methods described in the various embodiments of the present application.

[0093] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

Claims

1. A design method for a sensor abstraction layer based on a circular buffer, characterized in that, The design method of the sensor abstraction layer based on the circular buffer includes: Constructing a sensor abstraction layer, which includes plugins corresponding to different types of sensors for reading and storing sensor raw data based on a circular buffer, and decoding the sensor raw data to obtain a unified data structure and a unified operation interface; Based on the plugins of the sensor abstraction layer, reading the sensor raw data of the corresponding sensors and storing the read sensor raw data in the circular buffer; Sequentially reading the sensor raw data from the circular buffer and performing decoding operations, and sending the decoded data to the upper-layer intelligent driving application; Among them, the plugin includes a circular buffer for storing the sensor raw data read from the sensor, a decoding queue for storing the sensor raw data to be decoded, and an interface for decoding the sensor raw data; Among them, the circular buffer in the plugin supports multiple producers to write data and multiple consumers to read data; The producer is a thread for reading the sensor raw data of the sensor; The consumer is a thread for performing decoding operations on the sensor raw data.

2. The method for designing a sensor abstraction layer based on a circular buffer according to claim 1, characterized in that: The plugin includes a camera plugin corresponding to the camera, a lidar plugin corresponding to the lidar, a millimeter-wave radar plugin corresponding to the millimeter-wave radar, an inertial navigation plugin corresponding to the inertial measurement unit, a satellite navigation plugin corresponding to the satellite navigation system, and a CAN plugin corresponding to the controller area network.

3. The design method of the sensor abstraction layer based on the circular buffer according to claim 2, characterized in that: The unified data structures corresponding to the decoded sensor raw data of each type of sensor include an image data frame, a lidar data frame, a millimeter-wave radar data frame, an inertial unit data frame, a satellite navigation data frame, and a CAN data frame; The image data frame includes a timestamp, a DMA BUF, and attributes, and the lidar data frame includes a timestamp, Decoded Returns, and attributes; The millimeter-wave radar data frame includes a timestamp, Radar Scans, and attributes, and the inertial unit data frame includes a timestamp, IMU Mesurements, and attributes; The satellite navigation data frame includes a timestamp, GNSS Mesurements, and attributes, and the CAN data frame includes a timestamp, CANFD Message, and attributes; The unified operation interface includes sensor lifecycle management, sensor data interaction, and sensor data decoding; The sensor lifecycle management includes GetSensorInformation, CreateSensor, StartSensor, ResetSensor, StopSensor, ReleaseSensor; The sensor data interaction includes GetRawData, ReturnRawData, PushRawData, RawDataReadyForDecode, SendMessage, SetFilter, ClearFilter; The sensor data decoding includes GetDecodeConstants, GetDecodeFrame, and ValidatePacket.

4. A method for designing a sensor abstraction layer based on a circular buffer as claimed in claim 1, characterized in that, The plug-in based on the sensor abstraction layer reads the raw sensor data of the corresponding sensor and stores the read raw sensor data in a circular buffer. Specifically, it includes: The plug-in corresponding to the current sensor in the sensor abstraction layer reads the raw sensor data; The plug-in stores the read raw sensor data in the circular buffer.

5. A method for designing a sensor abstraction layer based on a circular buffer, as described in claim 1, wherein Sequentially read the raw sensor data from the circular buffer and perform decoding operations, and send the decoded data to the upper-layer intelligent driving application. Specifically, it includes: The intelligent driving application sequentially reads the raw sensor data from the circular buffer and sends the read raw sensor data to the decoding queue of the corresponding plug-in; Obtain the raw sensor data from the decoding queue and perform decoding operations to obtain decoded data and send it to the intelligent driving application; The intelligent driving application receives the decoded data and processes the decoded data.

6. The method for designing a sensor abstraction layer based on a circular buffer according to claim 5, wherein: The sensor abstraction layer is further used to copy the raw sensor data read from the circular buffer to a disk storage queue to implement the sequential storage operation of the raw sensor data; The sensor abstraction layer is further used to load the stored raw sensor data into a playback queue, and call the PushRawData interface to send the raw sensor data in the playback queue to the decoding queue of the corresponding plug-in for decoding operations.

7. A sensor abstraction layer design device based on a circular buffer, characterized in that, The device for designing a sensor abstraction layer based on a circular buffer includes: A construction module, which is used to construct a sensor abstraction layer. The sensor abstraction layer includes plug-ins corresponding to different types of sensors, which are used to implement the reading and storage of raw sensor data based on a circular buffer, and decode the raw sensor data into a unified data structure and a unified operation interface; A reading module, which is used to read the raw sensor data of the corresponding sensor based on the plug-in of the sensor abstraction layer and store the read raw sensor data in the circular buffer; A decoding module, which is used to sequentially read the raw sensor data from the circular buffer and perform decoding operations, and send the decoded data to the upper-layer intelligent driving application; Among them, the plug-in includes a circular buffer for storing the raw sensor data read from the sensor, a decoding queue for storing the raw sensor data to be decoded, and an interface for decoding the raw sensor data; Among them, the circular buffer in the plug-in supports multiple producers to write data and multiple consumers to read data; The producer is a thread for reading the raw sensor data of the sensor; The consumer is a thread for performing decoding operations on the raw sensor data.

8. A device for designing a sensor abstraction layer based on a circular buffer, characterized in that, The device for designing a sensor abstraction layer based on a circular buffer includes a processor, a memory, and a program for designing a sensor abstraction layer based on a circular buffer that is stored on the memory and executable by the processor. When the program for designing a sensor abstraction layer based on a circular buffer is executed by the processor, the steps of the method for designing a sensor abstraction layer based on a circular buffer according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Framework system for abstract management of sensor data and design method

    CN114840189A

Cited By

  • Intelligent cross-scene data acquisition method, system and equipment and medium

    CN122334335A