A radar data processing method, electronic device and computer program product

CN122925073APending Publication Date: 2026-10-16SHANGHAI AUXILIARY IMAGING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611397875.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-08
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0003]为解决多消费业务场景下通过报文传输完整雷达采样数据会生成多份数据副本,反复内存拷贝带来内存占用过高、数据处理延迟、缓冲区数据积压的问题,本申请实施例提供一种雷达数据处理方法、电子设备及计算机程序产品,包括:

Benefits of technology

[0019]可以理解的是,上述第二方面至第四方面的具体实现方式和有益效果可以参见上述第一方面或第一方面所提供的各种实现方式中的任一项雷达数据处理方法的相关描述,在此不再赘述。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122925073A_ABST
    Figure CN122925073A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of data processing, and in particular to a radar data processing method, an electronic device and a computer program product. In the method, a radar data block to be stored is received; a target storage block for storing the radar data block is selected according to the state identifiers of a plurality of storage blocks in a shared memory ring buffer, and the radar data block is written into the target storage block; and index information is sent to a data reading unit, wherein the index information comprises a data block number of the radar data block, a timestamp of the radar data block and a block number of the target storage block, and the index information can be used by the data reading unit to read the radar data block from the target storage block. In this way, a single radar data block is stored by using a shared memory ring buffer, and only lightweight index information is issued to each data reading unit instead of copying complete data, a multiple-copy memory copy operation is eliminated, memory occupation and transmission time consumption are reduced, data flow speed is improved, and data accumulation is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a radar data processing method, electronic device, and computer program product. Background Technology

[0002] During operation, radar equipment continuously collects massive amounts of orthogonal demodulated sampling data. Existing radar data processing architectures generally employ an inter-process complete data copy interaction method. After the data writing unit acquires a complete frame of raw radar data, it needs to copy all the raw data multiple times and send them to different service data reading units to complete target detection, point cloud generation, visualization playback, and other processing tasks. In the traditional data interaction mode, when the data writing unit transmits data to each data reading unit through a message queue, the message message carries the complete radar sampling data. Each new consumption service generates a corresponding independent data copy. Multiple memory copying and data transfers easily lead to increased memory usage, increased processing latency, and data backlog. Summary of the Invention

[0003] To address the issues of high memory usage, data processing latency, and buffer backlog caused by repeatedly copying complete radar sampling data during message transmission in multi-consumption scenarios, this application provides a radar data processing method, electronic device, and computer program product, including:

[0004] In a first aspect, embodiments of this application provide a radar data processing method, comprising: receiving a radar data block to be stored; selecting a target storage block for storing the radar data block according to the status identifiers of multiple storage blocks in a shared memory circular buffer, and writing the radar data block into the target storage block; sending index information to a data reading unit, wherein the index information includes the data block number of the radar data block, the timestamp of the radar data block, and the block number of the target storage block, and the index information can be used by the data reading unit to read the radar data block from the target storage block.

[0005] In this embodiment, a shared memory ring buffer is used to store a single radar data block, and lightweight index information is sent to each data reading unit instead of copying the complete data. This eliminates the multi-copy memory copy operation, reduces memory usage and transmission time, improves data flow speed, and avoids data backlog.

[0006] In some implementations of the first aspect, the radar data processing method further includes: acquiring radar configuration parameters, which include the number of radar chips, the number of pulse clusters, the number of cyclic frames, the number of linear frequency modulated pulses, the number of receiving channels, the number of sampling points per channel, the quadrature demodulation data storage format, and the size of bytes occupied by a single sampling point; creating a shared memory ring buffer based on the radar configuration parameters; dividing the shared memory ring buffer into multiple storage blocks, each of the multiple storage blocks including a header region, the header region storing the status identifier and reference count of the storage block.

[0007] In this embodiment, by pre-calculating and allocating a shared memory circular buffer based on radar configuration parameters, memory usage can be precisely controlled, avoiding memory fragmentation issues caused by dynamic allocation. Furthermore, by dividing the shared memory into multiple storage blocks and managing them in a circular manner, only the most recent frames of data are retained, preventing unlimited memory growth.

[0008] In some implementations of the first aspect, the target storage block for storing radar data blocks is selected based on the status identifiers of multiple storage blocks in the shared memory circular buffer, including: determining a first storage block from the multiple storage blocks, wherein the first storage block is the storage block that has just been written with data; starting from the first storage block, determining the storage blocks whose status identifiers meet preset conditions as target storage blocks; wherein the preset conditions include the status identifiers being in an idle state or an expired state.

[0009] In some implementations of the first aspect, starting from the first storage block, the storage block whose status flag meets the preset conditions is determined as the target storage block, including: traversing multiple storage blocks starting from the first storage block; if there is a storage block among the multiple storage blocks whose status flag is idle, the first storage block whose status flag is idle is determined as the target storage block; if there is no storage block whose status flag is idle among the multiple storage blocks, the storage block whose status flag is expired is determined as the target storage block.

[0010] In some implementations of the first aspect, determining the target storage block based on the storage block whose status is expired during traversal includes: determining the reference count corresponding to the storage block when the storage block whose status is expired is encountered; continuing to traverse the storage block if the reference count is greater than zero; and determining the storage block as the target storage block and stopping traversal if the reference count is equal to zero.

[0011] In this embodiment, by prioritizing the use of idle storage blocks and safely reusing expired storage blocks when no idle storage blocks are available, while preventing data being read from being overwritten prematurely through reference counting checks, the recycling of storage blocks is achieved while ensuring data read security.

[0012] In some implementations of the first aspect, writing radar data blocks to target storage blocks includes: writing radar data blocks to target storage blocks and updating the status flag of the target storage blocks to a ready state.

[0013] In this embodiment, by updating the status flag from the write state to the ready state, the data writing unit can clearly inform the data reading unit that the data in the storage block is ready, thus enabling orderly data flow. Furthermore, storing only one copy of the original radar data block in shared memory eliminates multiple copy memory operations, reducing memory usage.

[0014] In some implementations of the first aspect, the index information can be used by the data reading unit to read radar data blocks from the target storage block, including: the index information can be used by the data reading unit to read the status identifier of the target storage block, and when the status identifier of the target storage block is in a ready state, an atomic increment operation is performed on the reference count of the target storage block, and then radar data is read from the target storage block.

[0015] In some implementations of the first aspect, the radar data processing method further includes: after the data reading unit reads the radar data block from the target storage block, the data reading unit is also used to perform an atomic decrement operation on the reference count of the target storage block.

[0016] In a second aspect, embodiments of this application provide an electronic device, including: a memory for storing instructions executed by one or more processors of the electronic device, and a processor, which is one of the one or more processors of the electronic device, for executing the radar data processing method provided in the first aspect and any possible implementation of the first aspect.

[0017] Thirdly, embodiments of this application provide a vehicle, including: any of the electronic devices provided in the second aspect and various implementations of the second aspect.

[0018] Fourthly, embodiments of this application provide a computer program product, which includes computer instructions. When executed by an electronic device, the electronic device performs the radar data processing method provided in the first aspect and any possible implementation of the first aspect.

[0019] It is understood that the specific implementation methods and beneficial effects of the second to fourth aspects mentioned above can be found in the relevant descriptions of the radar data processing methods in the first aspect or any of the various implementation methods provided in the first aspect, and will not be repeated here. Attached Figure Description

[0020] Figure 1 According to some embodiments of this application, a schematic diagram of an application scenario is shown;

[0021] Figure 2 According to some embodiments of this application, a schematic flowchart of a radar data processing method is shown;

[0022] Figure 3 According to some embodiments of this application, a schematic diagram of a data reading unit reading data is shown;

[0023] Figure 4 According to some embodiments of this application, a possible functional framework diagram of a vehicle is shown. Detailed Implementation

[0024] The embodiments of this application include, but are not limited to, radar data processing methods, electronic devices, and computer program products.

[0025] It is understood that the radar data processing method mentioned in the embodiments of this application can be applied to electronic devices. These electronic devices can be referred to as terminals, user equipment (UE), mobile stations (MS), or mobile terminals (MT), etc.

[0026] To facilitate understanding of the technical solution of this application, the following is an explanation of the technical terms involved in this application.

[0027] (1) Radar data block: refers to a complete frame of raw analog-to-digital converter (ADC) data generated by the radar equipment during the acquisition process, including the acquisition data of multiple radar chips.

[0028] (2) Shared memory circular buffer: refers to a shared memory area pre-allocated in the system memory. This area is divided into multiple storage blocks and managed in a circular manner. When the write position reaches the last storage block, it returns to the first storage block to continue writing, thus making circular use within the limited memory space.

[0029] (3) Data Block: A data storage unit in a shared memory ring buffer, used to store a frame of radar data. Each data block includes a header area and a data area. The header area stores the management information of the data block, and the data area stores the data acquired by the radar chip.

[0030] (4) Header Area: This refers to the area in each storage block used to store management information. The header area includes, but is not limited to, the following fields: block number (blockNum), timestamp buffer (timeStampBuffer), data block number (frameId), state identifier (state), and reference count (refCnt). Among them, the block number indicates the position number of the current storage block in the shared memory circular buffer; the timestamp buffer records the acquisition time of each radar chip in the radar data frame; the data block number indicates the frame number of the radar data block stored in the current storage block; the state identifier describes the data lifecycle state of the current storage block; and the reference count records the number of data reading units currently reading the storage block.

[0031] (5) State identifier: This refers to the identifier field used to describe the current lifecycle state of the storage block. In this embodiment, the state identifier includes the following five values:

[0032] Free state: This means that the storage block has not been written to or the previous frame of data has been completely read and released, and new data can be written to it by the data writing unit.

[0033] WRITING: This indicates that the data writing unit is writing data to the storage block, and the data reading unit should not access the storage block at this time.

[0034] Ready state: This indicates that the data writing unit has completed the data writing process, and the data in this storage block can be read by the data reading unit.

[0035] Reading status: Indicates that the storage block is being read by one or more data read units;

[0036] Expired status: This indicates that the data in this storage block is outdated, but it is still retained in shared memory. Data read units that have not yet finished reading are allowed to continue reading, but new data read units are not allowed to start reading.

[0037] (6) Reference Count (refCnt): This is an integer value used to record the number of data read units currently reading a memory block. When a data read unit begins reading data from the memory block, the reference count is atomically incremented by one; when the data read unit finishes reading the data, the reference count is atomically decremented by one. A reference count of zero indicates that no data read unit is currently reading the memory block.

[0038] (7) Data writing unit: refers to the functional module or process in the system responsible for receiving the raw data collected by the radar equipment and writing it into the shared memory ring buffer.

[0039] (8) Data reading unit: refers to the functional module or process in the system responsible for reading radar data blocks from the shared memory circular buffer and performing subsequent business processing (such as target detection, point cloud generation, visualization playback, etc.). A system may include multiple data reading units.

[0040] (9) Index information: refers to the control information carried in the lightweight notification message sent by the data writing unit to the data reading unit after completing the writing of the radar data block. The index information includes the data block number (frameId) of the radar data block, the timestamp (timeStampBuffer) of the radar data block, and the block number (blockNum) of the target storage block, but does not include the specific sampled data of the radar data block.

[0041] like Figure 1 The diagram shown illustrates an application scenario.

[0042] In this scenario, vehicles can be equipped with millimeter-wave radar, which can form a detection coverage area to detect the surrounding environment of intersections, such as oncoming vehicles, pedestrians, traffic lights, crosswalks, lanes, curbs, and other road targets and traffic facilities. During the millimeter-wave radar's detection of the surrounding environment, a large amount of raw ADC data is collected and output in real time. Furthermore, multiple consumer processes, including radar acquisition, point cloud algorithm processing, obstacle recognition, visualization host computer, and data storage modules, all need to acquire the raw ADC data. Current processing methods require copying a complete set of raw ADC data separately for each consumer process, resulting in a large number of repetitive copy operations that continuously consume CPU computing resources. Moreover, multiple complete data copies are simultaneously stored in memory, causing the device's memory usage to continuously increase, not only increasing data transmission time but also easily leading to buffer data accumulation and data flow lag.

[0043] To address the aforementioned problems, this application provides a radar data processing method. In this method, a radar data block to be stored is received; based on the status identifiers of multiple storage blocks in a shared memory circular buffer, a target storage block for storing the radar data block is selected, and the radar data block is written into the target storage block; index information is sent to a data reading unit, wherein the index information includes the data block number of the radar data block, the timestamp of the radar data block, and the block number of the target storage block, and the index information can be used by the data reading unit to read the radar data block from the target storage block.

[0044] In this way, a shared memory ring buffer is used to store a single radar data block, and lightweight index information is sent to each data reading unit instead of copying the complete data. This eliminates the multi-copy memory copy operation, reduces memory usage and transmission time, improves data flow speed, and avoids data backlog.

[0045] The radar data processing method mentioned in the embodiments of this application is described below. For example... Figure 2 The diagram illustrates a flowchart of a radar data processing method, which can be executed by an electronic device. Exemplarily, the radar data processing method may include:

[0046] S201: Received radar data block to be stored.

[0047] In some implementations, the data writing unit can receive radar data blocks to be stored. A radar data block refers to a complete frame of raw ADC data generated by the radar device during the acquisition process, including data acquired from multiple radar chips. For example, during radar device operation, the radar device continuously generates raw ADC data in the order of frame, chip, burst, loop, chirp, channel, and sampling point. The data writing unit stores all chip data acquired within one frame period as a radar data block.

[0048] In some implementations, before receiving the radar data block to be stored, the data writing unit obtains radar configuration parameters, including the number of radar chips, the number of pulse clusters, the number of cyclic frames, the number of linear frequency modulated pulses, the number of receiving channels, the number of sampling points per channel, the quadrature demodulation data storage format, and the size of each sampling point in bytes. Furthermore, the data writing unit can create a shared memory circular buffer based on the radar configuration parameters and divide the shared memory circular buffer into multiple storage blocks.

[0049] For example, the data writing unit can calculate the total number of sampling points required for a single frame of ADC data based on the radar chip count, pulse cluster count, cycle frame count, linear frequency modulated pulse count, number of receiving channels, and number of sampling points per channel in the radar configuration parameters; then, based on the quadrature demodulation data storage format and the byte size occupied by a single sampling point, it can calculate the total memory size required for a single frame of radar data block. A shared memory region is created at startup, and the shared memory is divided into a fixed number of storage blocks according to the single frame memory size and the expected number of frames to be cached. For example, a complete shared memory region can be allocated in system memory as a shared memory circular buffer. The total memory size of the shared memory circular buffer is the product of the single frame memory size and the expected number of frames to be cached, and the shared memory circular buffer can be divided into multiple storage blocks according to the single memory size.

[0050] Each storage block can be understood to include a header area and a data area. The header area stores management information such as the storage block's status identifier and reference count. The header area of ​​each storage block is uniformly defined as the Head field, followed by the data area of ​​each radar chip. The header area includes, but is not limited to, the following fields: Block Number (blockNum), indicating the position number of the current storage block in the shared memory circular buffer; Timestamp Buffer (timeStampBuffer), recording the acquisition time of each radar chip in this frame of radar data; Data Block Number (frameId), indicating the frame number of the radar data block stored in the current storage block; Status Identifier (state), describing the data lifecycle status of the current storage block; Reference Count (refCnt), recording the number of data read units still reading this storage block.

[0051] Thus, by pre-calculating and allocating the shared memory circular buffer based on radar configuration parameters, memory usage can be precisely controlled, avoiding memory fragmentation issues caused by dynamic allocation. Furthermore, by dividing the shared memory into multiple storage blocks and managing them in a circular manner, only the most recent frames of data are retained, preventing unlimited memory growth.

[0052] S202: Based on the status identifiers of multiple storage blocks in the shared memory circular buffer, select the target storage block for storing radar data blocks and write the radar data blocks into the target storage block.

[0053] It is understandable that after receiving the radar data block to be stored, the data writing unit can select a suitable target storage block from multiple storage blocks in the shared memory ring buffer to write the radar data block.

[0054] In some implementations, the data writing unit selects the target storage block for storing radar data blocks based on the status identifiers of multiple storage blocks in the shared memory ring buffer.

[0055] The status transition path can be understood as follows: Free → Writing → Ready → Reading → Expired / Free. The data writing unit only writes to storage blocks with a status of Free or Expired. Before writing data, the data writing unit updates the storage block's status to Writing; after writing, it updates the status to Ready. The data reading unit only reads storage blocks with a status of Ready or Reading. When the first data reading unit begins reading a storage block, it updates the block's status from Ready to Reading and performs an atomic increment operation on the reference count. When subsequent data reading units also read the same block, they similarly perform an atomic increment operation on the reference count. After a data reading unit completes reading data, it performs an atomic decrement operation on the reference count. If the data reading unit is the last to complete reading (i.e., the reference count reaches zero), the storage block's status is updated to Expired or Free.

[0056] In some implementations of determining the target storage block, the data writing unit can identify a first storage block from multiple storage blocks. This first storage block is the one where data was just written, i.e., the storage block corresponding to the last write operation. Subsequently, starting from the first storage block, the data writing unit identifies storage blocks whose status indicators meet preset conditions as target storage blocks. These preset conditions include whether the status indicator is "FREE" or "EXPIRED".

[0057] For example, the data writing unit traverses multiple storage blocks in the shared memory circular buffer, starting from the first storage block. During the traversal, the data writing unit checks the status flag of each storage block in turn.

[0058] If there are storage blocks with a status marked as free among multiple storage blocks, the data writing unit will determine the first storage block with a free status as the target storage block. A free status indicates that the storage block has not yet been written to or that the previous frame of data has been completely read and released, and new data can be directly written to it.

[0059] If none of the multiple memory blocks are in a free state, the data writing unit determines the target memory block based on the memory blocks whose status is expired during traversal. An expired status indicates that the data in the memory block is outdated but still remains in shared memory. In this case, the data writing unit needs to further check the reference count of the expired memory block to determine whether it is safe to overwrite the data in that block.

[0060] When encountering a storage block whose status is marked as expired, the data writing unit determines the reference count for that storage block. If the reference count is greater than zero, it means that a data reading unit is still reading data from that storage block, and the data writing unit cannot overwrite that storage block, continuing to traverse the next storage block. If the reference count is equal to zero, it means that no data reading unit is currently reading data from that storage block, and the data writing unit designates that storage block as the target storage block and stops traversing.

[0061] In this way, by prioritizing the use of idle storage blocks and safely reusing expired storage blocks when no idle storage blocks are available, while preventing data being read from being overwritten prematurely through reference counting checks, the recycling of storage blocks can be achieved while ensuring the safety of data reading.

[0062] It is understandable that after identifying the target storage block, the data writing unit can write the radar data block into the target storage block. In some implementations, the data writing unit can update the status flag of the target storage block to "WRITING," indicating that the data writing unit is writing data to the storage block, and the data reading unit should not access the storage block at this time. Subsequently, the data writing unit can write information such as the data block number and timestamp of the radar data block into the header area of ​​the target storage block, and continuously write the acquired data from each radar chip into the data area of ​​the target storage block. After writing is complete, the data writing unit clears the reference count of the target storage block to zero and updates the status flag of the target storage block to "READY," indicating that the data in the storage block has been completely written and can be read by the data reading unit.

[0063] It should be noted that during this process, the data writing unit does not need to copy the data for each data reading unit, but only stores one copy of the original radar data block in the shared memory. The data writing unit is only responsible for writing the data to the shared memory, and each subsequent data reading unit reads the required data from the shared memory itself according to the index information.

[0064] Thus, by updating the status flag from write state to ready state, the data writing unit can clearly inform the data reading unit that the data in the storage block is ready, enabling orderly data flow. Furthermore, storing only one copy of the original radar data block in shared memory eliminates multiple copy memory operations, reducing memory usage.

[0065] It is understood that the data writing unit can employ a circular overwrite strategy, writing radar data blocks into the shared memory circular buffer. For example, when the data writing unit reaches the last storage block of the shared memory circular buffer, it returns to the first storage block to continue writing, thus cyclically utilizing the limited memory space. The system retains only the most recent N frames of radar data blocks, where N is determined by the total number of storage blocks in the shared memory circular buffer.

[0066] In some implementations of writing radar data blocks, when a data writing unit is about to overwrite a storage block, it first checks the status flag and reference count of that storage block. If the storage block is still referenced by the data reading unit (i.e., the reference count is greater than zero), it chooses to wait, skip the storage block, overwrite the oldest freeable storage block, or record a data reading unit lag exception according to a preset strategy. This limits the memory limit while preventing the data being read from being overwritten prematurely.

[0067] In this way, by using a circular buffer management method, only the most recent few frames of data can be retained, avoiding unlimited memory growth. Furthermore, by checking the status flag and reference count before overwriting, it is ensured that the data being read is not overwritten prematurely, thus limiting the memory limit while ensuring the safety of data reading.

[0068] S203: Send index information to the data reading unit, wherein the index information includes the data block number of the radar data block, the timestamp of the radar data block and the block number of the target storage block, and the index information can be used by the data reading unit to read the radar data block from the target storage block.

[0069] In some implementations, after completing the writing of data to the target storage block and updating the target storage block's status flag to the ready state, the data writing unit sends index information to the data reading unit. The index information includes the radar data block's block number, the radar data block's timestamp, and the target storage block's block number. The index information can be used by the data reading unit to read the radar data block from the target storage block.

[0070] For example, the data writing unit sends a lightweight notification message to the data reading unit via an inter-process communication (IPC) message queue. This notification message is the index information. The index information only carries lightweight control information such as block number, data block number, timestamp, and status identifier, and does not contain the specific sampled data of the radar data block.

[0071] It is understandable that IPC message queues can be used to transmit new frame arrival notifications and index information of target data blocks between the data writing unit and the data reading unit. After receiving the index information, the data reading unit directly locates the target storage block in shared memory based on the block number, data block number, timestamp, and status identifier carried in the index information, and selects different data access and parsing granularities according to the current business requirements.

[0072] In scenarios requiring only rapid response, the data reading unit can access only the header area of ​​the target storage block or extract necessary feature data without reading the complete radar data block; in scenarios requiring complete computation, the data reading unit then performs a complete parsing of the original radar data; in scenarios involving status monitoring or debugging and positioning, the data reading unit can read only the field information in the header area of ​​the target storage block.

[0073] In this way, by separating large data transfer from lightweight scheduling, the system does not need to pre-generate multiple intermediate results during the shared memory write phase, thereby reducing CPU overhead, memory usage, and real-time processing latency. Furthermore, the data reading unit can flexibly select the data access granularity according to actual business needs, avoiding unnecessary full data reading and parsing, which can further reduce system resource consumption and data processing latency.

[0074] Furthermore, the data writing unit can compare the data block numbers corresponding to the data of each radar chip to determine whether there is frame loss. Specifically, when the current data block number to be aggregated should be m, if the data block numbers of chip 0 and chip 1 are m, while the data block numbers of chip 2 and chip 3 are m+1, then the system determines that the data of chip 2 and chip 3 in the frame numbered m is lost.

[0075] In the event of frame loss, the data writing unit may refrain from sending the IPC message numbered m or providing the corresponding storage block to the data reading unit. Instead, it continues to receive data from chips 0 and 1, numbered m+1, and directly overwrites the storage block originally used to buffer frame m with the data reassembled for frame m+1. This ensures that the storage blocks obtained by the data reading unit via the IPC message queue all contain complete radar data blocks.

[0076] Furthermore, in real-time processing mode, the IPC message interface prioritizes receiving the latest arriving messages and saves the storage block information corresponding to the latest few frames, so that the data reading unit can prioritize processing the latest frames of data. In offline processing mode, considering that the data reading unit may need to process each frame of data frame by frame, the system allows for customizable IPC message sending intervals to ensure that offline processing has sufficient time to complete the reading and processing of the corresponding frame data.

[0077] Thus, by using frame loss detection and data block reuse, the integrity of the radar data blocks acquired by the data reading unit can be ensured, avoiding data processing errors caused by frame loss. Furthermore, by differentiating between real-time and offline processing modes through message scheduling strategies, data processing needs in different application scenarios can be met.

[0078] After receiving the index information, the data reading unit can directly locate the target storage block in the shared memory circular buffer based on the block number carried in the index information. Then, the data reading unit can read the target storage block's status flag. If the target storage block's status flag indicates a ready or read state, it performs an atomic increment operation on the target storage block's reference count, and then reads the radar data block from the target storage block's data area. Furthermore, after reading, the data reading unit can perform an atomic decrement operation on the target storage block's reference count.

[0079] It is understandable that cross-thread or cross-process synchronization relies on atomic addition and subtraction operations on reference counts, memory barriers for updating state flags, and visibility guarantees after shared memory writes are completed, thereby ensuring that data writing units and multiple data reading units see a consistent storage block header state.

[0080] In this way, by using explicit migration rules for state identifiers and atomic operations for reference counting, lock-free synchronization between data writing units and multiple data reading units can be achieved. This avoids the performance overhead and potential deadlock risk associated with using mutex locks, and improves system throughput in scenarios with concurrent access from multiple consumers.

[0081] The following describes the reading process of the data reading unit. For example... Figure 3 The diagram illustrates a data reading process by a data reading unit. Exemplarily, this data reading process may include:

[0082] S301: The data reading unit receives the index information sent by the data writing unit and obtains the block number, data block number and timestamp carried in the index information.

[0083] S302: The data reading unit locates the target storage block in the shared memory circular buffer according to the block number.

[0084] S303: The data reading unit reads the status flag in the header area of ​​the target storage block and verifies whether the status flag is in a ready state.

[0085] It is understandable that if the status is marked as ready or read, it means that the data in the storage block is ready to be read; if the status is marked as write, it means that the data writing unit has not yet completed the data writing, and the data reading unit needs to wait or abandon this read.

[0086] S304: When the target memory block is in a ready or read state, the data read unit performs an atomic increment operation on the reference count of the target memory block.

[0087] It is understandable that performing an atomic increment operation on the reference count of the target storage block by the data reading unit can indicate that a new data reading unit is currently reading the storage block.

[0088] S305: The data reading unit reads radar data blocks directly from the data area of ​​the target storage block.

[0089] It is understandable that, since the data is stored in shared memory, the data reading unit can directly access it through the memory address without copying the data.

[0090] S306: After the data reading unit completes the data reading, it performs an atomic decrement operation on the reference count of the target memory block.

[0091] It is understandable that performing an atomic decrement operation on the reference count of the target storage block indicates that the current data reading unit has completed reading the storage block. If the reference count is reduced to zero, it means that no data reading unit is currently reading the storage block, and the system can update the status of the storage block to an idle or expired state so that the data writing unit can reuse the storage block during subsequent writing.

[0092] Thus, by updating the reference count atomically, multiple data read units can concurrently read the same memory block without locks. Furthermore, after the read is complete, the reference count is released by atomically decrementing it, allowing the data write unit to accurately determine whether the memory block can be safely overwritten, thus ensuring data integrity.

[0093] In some embodiments of this application, when offline playback is required, the file reading module can be simulated as a data writing unit, sequentially writing historical frames into a shared memory circular buffer according to the same header region and storage block structure. The display module, algorithm module, or comparison module can reuse the same reading mechanism. This offline mode is an additional embodiment; the main solution still focuses on the shared memory transmission and circular storage block management of real-time radar data streams.

[0094] In this way, by reusing the shared memory read / write mechanism in real-time processing, offline playback scenarios do not require the development of an additional independent data reading interface, which can reduce system development and maintenance costs.

[0095] In some embodiments, the radar data processing method mentioned in this application can be applied to any electronic device, such as electronic devices in devices equipped with radar (e.g., vehicles, drones, rail tools, aircraft, etc.).

[0096] For example, an electronic device that can be applied to vehicle 100 can be a computer system in the vehicle. Figure 4 This is a schematic diagram of a possible functional framework of a vehicle 100 provided in an embodiment of this application.

[0097] like Figure 4 As shown, the functional framework of vehicle 100 may include various subsystems, such as Figure 4 The sensor system 110, control system 120, one or more peripheral devices 130 (one is shown as an example), power supply 140, and computer system 150 are shown. Optionally, the vehicle 100 may also include other functional systems, such as an engine system that provides power to the vehicle 100, etc., which are not limited herein.

[0098] The sensor system 110 may include several detection devices that can sense the measured information and convert the sensed information into electrical signals or other desired forms of information output according to a certain rule. Figure 4 As shown, these detection devices may include a global positioning system (GPS), a vehicle speed sensor (112), an inertial measurement unit (IMU), etc., and this application does not limit them.

[0099] The Global Positioning System (GPS) 111 is a system that uses GPS positioning satellites to perform real-time positioning and navigation globally. In this application, the GPS 111 can be used to achieve real-time positioning of vehicle 100, providing the geographical location information of vehicle 100. The vehicle speed sensor 112 is used to detect the vehicle speed of vehicle 100. The inertial measurement unit 113 may include a combination of an accelerometer and a gyroscope, and is a device for measuring the angular rate and acceleration of vehicle 100. For example, during the movement of vehicle 100, the inertial measurement unit can measure the changes in the vehicle's position and angle based on the inertial acceleration of vehicle 100, such as measuring the acceleration and angular rate of vehicle 100.

[0100] The control system 120 may include a steering unit 121 and a braking unit 122, etc.

[0101] Steering unit 121 can represent a system for adjusting the direction of travel of vehicle 100, and may include, but is not limited to, a steering wheel or other structural device for adjusting or controlling the direction of travel of vehicle 100. Braking unit 122 can represent a system for slowing down the speed of vehicle 100, and may also be referred to as the vehicle 100 braking system. It may include, but is not limited to, a brake controller, a reducer, or other structural device for slowing down vehicle 100. In practical applications, braking unit 122 can use friction to slow down the tires of vehicle 100, thereby slowing down the speed of vehicle 100.

[0102] Peripheral device 130 may include several components, such as Figure 4 The diagram shows a communication system 131, a touchscreen 132, a user interface 133, etc. The communication system 131 is used to enable network communication between the vehicle 100 and other devices besides the vehicle 100.

[0103] In practical applications, the communication system 131 can use wireless communication technology or wired communication technology to realize network communication between the vehicle 100 and other devices. The wired communication technology can refer to communication between the vehicle 100 and other devices via network cables or optical fibers. The wireless communication technology includes, but is not limited to, Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), Wireless Local Area Networks (WLAN) (such as Wireless Fidelity (Wi-Fi) networks), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR) technology, etc.

[0104] The touchscreen 132 can be used to detect operation commands on the touchscreen 132. For example, the user can perform touch operations on the content data displayed on the touchscreen 132 according to actual needs to achieve the corresponding function, such as playing music, video, or other multimedia files. The user interface 133 can specifically be a touch panel for detecting operation commands on the touch panel. The user interface 133 can also be a physical button or a mouse. The user interface 133 can also be a display screen for outputting data and displaying images or data. Optionally, the user interface 133 can also be at least one device belonging to the category of peripheral devices, such as a touchscreen, microphone, and speaker.

[0105] Several functions of vehicle 100 are controlled and implemented by computer system 150. Computer system 150 may include multiple processors such as processor 151, chassis domain controller (CDC) 152, automated driving domain controller (MDC) 153, telematics box (T-BOX) 154, as well as memory 155 (also referred to as storage device) and gateway 156. In practical applications, memory 155 may be located inside computer system 150 or outside computer system 150, for example, as a cache in vehicle 100, etc., and this application does not limit this.

[0106] Among them, processor 151, CDC 152, MDC 153, and T-BOX 154 can be used to run relevant programs or instructions corresponding to programs stored in memory 155 to realize the corresponding functions of vehicle 100, such as the function of calling vehicle camera.

[0107] In some implementations, the processor 151 receives the radar data block to be stored; selects the target storage block for storing the radar data block according to the status identifiers of multiple storage blocks in the shared memory ring buffer, and writes the radar data block into the target storage block; sends index information to the data reading unit, wherein the index information includes the data block number of the radar data block, the timestamp of the radar data block, and the block number of the target storage block, and the index information can be used by the data reading unit to read the radar data block from the target storage block.

[0108] In this way, a shared memory ring buffer is used to store a single radar data block, and lightweight index information is sent to each data reading unit instead of copying the complete data. This eliminates the multi-copy memory copy operation, reduces memory usage and transmission time, improves data flow speed, and avoids data backlog.

[0109] Memory 155 may include volatile memory, such as RAM; it may also include non-volatile memory, such as ROM, flash memory, HDD, or SSD; or it may include a combination of the above types of memory. Memory 155 can be used to store a set of program code or instructions corresponding to program code, so that processor 151 can call the program code or instructions stored in memory 155 to implement the corresponding functions of vehicle 100. This function includes, but is not limited to, […]. Figure 4 The schematic diagram of the functional framework of vehicle 100 shown includes some or all of the functions. In this application, memory 155 can store a set of program codes for controlling vehicle 100. Processors 151, CDC 152, MDC 153, and T-BOX 154 can call this program code to control vehicle 100 to perform the radar data processing method in this application.

[0110] Optionally, in addition to storing program code or instructions, the memory 155 may also store information such as road maps, driving routes, and sensor data. The computer system 150 can be combined with other components in the functional framework diagram of the vehicle 100, such as sensors in the sensor system and GPS, to realize the relevant functions of the vehicle 100. For example, the computer system 150 can control the driving direction or speed of the vehicle 100 based on data input from the sensor system 110; this application does not impose limitations on this.

[0111] This application provides a computer program product that, when run on a device, causes the device to execute the technical solutions described in the above embodiments. Its implementation principle and technical effects are similar to those of the related embodiments described above, and will not be repeated here.

[0112] It is understood that the various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of this application can be implemented as computer programs or program code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0113] Program code can be applied to input instructions to execute the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application-specific integrated circuit (ASIC), or a microprocessor.

[0114] The program code can be implemented using a high-level procedural language or an object-oriented programming language to communicate with the processing system. Assembly language or machine language can also be used when needed. The mechanisms described in this application are not limited to any particular programming language. In either case, the language can be a compiled language or an interpreted language.

[0115] The above describes the possible hardware structures of electronic devices. It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of both.

[0116] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. Furthermore, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.

[0117] It should be noted that in the examples and description of this patent, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the aforementioned element.

[0118] Although this application has been illustrated and described with reference to certain embodiments thereof, those skilled in the art will understand that various changes in form and detail may be made thereto without departing from the scope of this application.

Claims

1. A radar data processing method, characterized in that, include: Received radar data block to be stored; Based on the status identifiers of multiple storage blocks in the shared memory circular buffer, a target storage block for storing the radar data block is selected, and the radar data block is written into the target storage block. An index information is sent to the data reading unit, wherein the index information includes the data block number of the radar data block, the timestamp of the radar data block, and the block number of the target storage block, and the index information can be used by the data reading unit to read the radar data block from the target storage block.

2. The method according to claim 1, characterized in that, The method further includes: Obtain radar configuration parameters, which include the number of radar chips, the number of pulse clusters, the number of cyclic frames, the number of linear frequency modulated pulses, the number of receiving channels, the number of sampling points per channel, the quadrature demodulation data storage format, and the size of bytes occupied by a single sampling point. Based on the radar configuration parameters, the shared memory circular buffer is created; The shared memory circular buffer is divided into multiple storage blocks, each of which includes a header region that stores the status identifier and reference count of the storage block.

3. The method according to claim 2, characterized in that, The step of selecting a target storage block for storing the radar data block based on the status identifiers of multiple storage blocks in the shared memory circular buffer includes: A first storage block is determined from the plurality of storage blocks, wherein the first storage block is the storage block on which data has just been written; Starting from the first storage block, storage blocks whose status identifiers meet preset conditions are identified as target storage blocks; wherein, the preset conditions include the status identifier being in an idle state or an expired state.

4. The method according to claim 3, characterized in that, Starting from the first storage block, determining the storage blocks whose status identifiers meet preset conditions as target storage blocks includes: Traverse the plurality of storage blocks starting from the first storage block. If any of the multiple storage blocks has a state identifier of "idle", the first storage block whose state identifier is "idle" is determined as the target storage block. If none of the multiple storage blocks are in the idle state, the storage block whose status is expired is determined as the target storage block.

5. The method according to claim 4, characterized in that, The step of determining the target storage block based on the storage block whose status is identified as expired during traversal includes: When a storage block with the status identifier of the expired state is encountered during traversal, the reference count corresponding to the storage block is determined; If the reference count is greater than zero, continue traversing the storage block; If the reference count is zero, the storage block is identified as the target storage block, and traversal stops.

6. The method according to any one of claims 1 to 5, characterized in that, The step of writing the radar data block into the target storage block includes: The radar data block is written into the target storage block, and the status flag of the target storage block is updated to the ready state.

7. The method according to claim 6, characterized in that, The index information can be used by the data reading unit to read the radar data block from the target storage block, including: The index information can be used by the data reading unit to read the status identifier of the target storage block, and when the status identifier of the target storage block is in the ready state, to perform an atomic increment operation on the reference count of the target storage block, and then read the radar data from the target storage block.

8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: After the data reading unit reads the radar data block from the target storage block, the data reading unit is also used to perform an atomic decrement operation on the reference count of the target storage block.

9. An electronic device, characterized in that, Includes: a memory for storing instructions executed by one or more processors of the electronic device. And a processor, which is one or more processors of the electronic device, for performing the radar data processing method according to any one of claims 1 to 8.

10. A computer program product, characterized in that, The computer program product includes computer instructions that, when executed by an electronic device, enable the electronic device to perform the radar data processing method as described in any one of claims 1 to 8.