Data processing method and apparatus, electronic device, and medium
By dynamically updating the fingerprint identifiers of cached files and processing the dataset in parallel, the problem of low training efficiency in the dataset initialization stage is solved, enabling the training task to be resumed in seconds and improving the efficiency of model iteration and development.
Patent Information
- Application Number
- CN202611354676.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-02
- Publication Date
- 2026-11-20
AI Technical Summary
In existing technologies, the training startup efficiency is low due to the full traversal scan during the dataset initialization phase, and the computational resources are repeatedly consumed when resuming training from breakpoints, making it impossible to effectively utilize computing resources such as GPUs and NPUs.
The main process obtains the current fingerprint of the target dataset's cache file and updates it dynamically to determine the cache's validity. When the cache is invalid, multiple processing processes are started to process the full frame data in parallel, generating key-value pairs and writing them to the cache file. During training, the cache file is loaded in read-only mode, skipping the full scan.
It achieves second-level recovery of training tasks, avoids redundant calculations, improves the efficiency of model iteration and development, and reduces the time overhead of training initialization.
Smart Images

Figure CN123138201A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data processing method, apparatus, electronic device and medium. Background Technology
[0002] With the rapid development of artificial intelligence technology, large-scale multi-sensor time-series data has become a crucial foundation for training models to support core perception tasks such as object detection, semantic segmentation, trajectory tracking, and 3D spatial analysis. As industrial applications move towards large-scale deployment, sensor configurations on different hardware platforms exhibit significant differences. Furthermore, real-world engineering scenarios commonly involve the mixed use of data from multiple batches, versions, and acquisition standards, with dataset sizes continuously increasing to the millions or even tens of millions of frames, placing extremely high demands on the processing efficiency of data processing pipelines.
[0003] Currently, dataset processing solutions typically employ a full-scale initialization strategy upon startup. This involves a complete traversal of the entire dataset during the initial training phase to extract metadata and construct an index structure. For massive datasets with millions of frames, this process often takes several hours. When the training process is forced to terminate due to abnormal circumstances such as system resource contention, hardware failure, or user-initiated interruption, and breakpoint resumption is required, the lack of a persistent caching and reuse mechanism for the metadata parsing results means that previously completed parsing results cannot be reused. The full-scale scan process must be re-executed, resulting in the repeated consumption of several hours of computing resources. Consequently, expensive computing resources such as GPUs (Graphics Processing Units) and NPUs (Neural Network Processing Units) remain idle for extended periods during the training startup phase, significantly reducing the efficiency of algorithm iteration and development. Summary of the Invention
[0004] One objective of this application is to provide a data processing method to solve the problem of low training startup efficiency caused by full traversal scanning in the dataset initialization stage of related technologies; another objective is to provide a data processing device; a third objective is to provide a computer-readable storage medium; and a fourth objective is to provide an electronic device.
[0005] To achieve the above objectives, the technical solution adopted in this application is as follows: A data processing method includes: obtaining the current fingerprint identifier of a cache file of a target dataset through a main process, wherein the current fingerprint identifier is dynamically updated according to modifications to the target dataset; determining that the cache file is invalid based on the current fingerprint identifier through a main process, and processing all frame data of the target dataset through a processing process to obtain key-value pairs corresponding to the processing process, wherein the key-value pairs include frame indices and metadata corresponding to the frame indices; writing the key-value pairs into a cache file through the main process; wherein, when training is performed using the target dataset, the cache file is loaded through a training process to obtain the frame indices corresponding to the training process, and the training task is executed based on the metadata corresponding to the frame indices.
[0006] According to one embodiment of this application, a processing process processes the full frame data of a target dataset to obtain key-value pairs corresponding to the processing process. This includes: segmenting the full frame data to obtain a frame index corresponding to the processing process; retrieving the full frame data based on the frame index to obtain metadata corresponding to the processing process; and serializing the metadata corresponding to the processing process to obtain key-value pairs corresponding to the processing process.
[0007] According to one embodiment of this application, the data processing method further includes: in response to the main process determining that the cache file is valid based on the current fingerprint identifier, loading the cache file through the training process.
[0008] According to one embodiment of this application, after the key-value pairs are written to the cache file by the main process, the method further includes: obtaining the index file of the target dataset by the main process; calculating the hash value byte by byte of the index file to generate the storage fingerprint identifier of the cache file, and storing the storage fingerprint identifier in the header of the cache file.
[0009] According to one embodiment of this application, the data processing method further includes: determining that the cache file is invalid by the main process responding to the inconsistency between the current fingerprint identifier and the stored fingerprint identifier; and determining that the cache file is valid by the main process responding to the inconsistency between the current fingerprint identifier and the stored fingerprint identifier.
[0010] According to one embodiment of this application, performing a training task based on the metadata corresponding to the frame index includes: parsing the metadata corresponding to the frame index to obtain the data version identifier, vehicle model identifier, camera identifier, and sensor data path corresponding to the frame index; determining the first parsing function, radar configuration information, sensor data, and camera parameters corresponding to the frame index based on the data version identifier, vehicle model identifier, sensor data path, and camera identifier, respectively; parsing the sensor data based on the first parsing function, processing the parsed sensor data based on the radar configuration information and camera parameters, generating training data based on the processed sensor data, and performing a training task based on the training data.
[0011] According to one embodiment of this application, after generating training data based on the processed sensor data, the method further includes: determining the labeled data type corresponding to the training data according to the training task type; parsing the metadata corresponding to the frame index to obtain the labeled data path corresponding to the frame index; reading the corresponding labeled data from the labeled data path based on the labeled data type, and determining a second parsing function based on the labeled data type; parsing the labeled data based on the second parsing function to generate a labeled tensor corresponding to the training data, and executing the training task based on the training data and the labeled tensor corresponding to the training data.
[0012] A data processing apparatus includes: an acquisition module, configured to acquire the current fingerprint identifier of a cache file of a target dataset through a main process, wherein the current fingerprint identifier is dynamically updated according to modifications to the target dataset; a processing module, configured to, in response to the main process determining that the cache file is invalid based on the current fingerprint identifier, process the full frame data of the target dataset through a processing process to obtain key-value pairs corresponding to the processing process, wherein the key-value pairs include frame indices and metadata corresponding to the frame indices; and a writing module, configured to write the key-value pairs to the cache file through the main process; wherein, when training is performed using the target dataset, the cache file is loaded through a training process to obtain the frame indices corresponding to the training process, and a training task is performed based on the metadata corresponding to the frame indices.
[0013] A computer-readable storage medium having a data processing program stored thereon, which, when executed by a processor, implements the aforementioned data processing method.
[0014] An electronic device includes a memory, a processor, and a data processing program stored in the memory and capable of running on the processor, wherein when the processor executes the data processing program, it implements the aforementioned data processing method.
[0015] The beneficial effects of this application are as follows: This application obtains the current fingerprint identifier of the cache file through the main process. This fingerprint identifier is dynamically updated as the dataset is modified, and is used to quickly determine whether the cache is valid. When the cache is invalid, the main process starts multiple processing processes to process the full frame data in parallel, generating key-value pairs containing frame indices and corresponding metadata, which are then aggregated by the main process and written to the cache file in batches. During training, the training process loads the cache file in read-only mode and reads the metadata of the required frames on demand through memory mapping, without needing to scan the entire original data. When training is interrupted due to hardware failure or human error and needs to be resumed from a breakpoint, the training process directly loads the existing cache, skipping the complete initialization scan process, achieving second-level recovery. In this way, the problems of needing to fully traverse the dataset to start training and needing to repeatedly scan during breakpoint resumption, resulting in long-term idle computing resources, are solved, significantly reducing the training initialization time overhead, avoiding redundant calculations to a certain extent, and improving the efficiency of model iteration and development. Attached Figure Description
[0016] Figure 1 This is a flowchart of a data processing method according to some embodiments of this application; Figure 2 This is a flowchart of a data processing method according to other embodiments of this application; Figure 3 Here is a flowchart of a data processing method according to some embodiments of this application; Figure 4 This is a schematic diagram of the structure of a data processing system according to some embodiments of this application; Figure 5 This is a block diagram of a data processing apparatus according to some embodiments of this application; Figure 6 This is a block diagram of an electronic device according to some embodiments of this application. Detailed Implementation
[0017] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.
[0018] The data processing methods, apparatus, electronic devices, and media of embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0019] Figure 1 This is a flowchart of a data processing method according to some embodiments of this application. (Refer to...) Figure 1 The data processing method in this application embodiment may include the following steps: S110: The main process obtains the current fingerprint identifier of the cached file of the target dataset. The current fingerprint identifier is dynamically updated based on modifications to the target dataset. It should be noted that the target dataset can be an autonomous driving dataset; no specific restrictions are imposed here.
[0020] Specifically, during the training task startup phase, the main process obtains the current fingerprint identifier corresponding to the cached file of the target dataset. The target dataset contains a dataset index file in YAML (YAML Ain't Markup Language) format. This index file records metadata information such as the storage path, sensor calibration parameters, annotation information, and timestamps of each sample in the target dataset in a human-readable serialized format. The main process calculates the hash value, such as MD5 (Message Digest Algorithm 5) hash value, byte-by-byte on this YAML-formatted dataset index file to generate the current fingerprint identifier of the target dataset, which is then used as the unique identifier for the cached file.
[0021] Meanwhile, the fingerprint identifier has a dynamic update mechanism. When any substantial modification is made to the target dataset, such as adding data samples, modifying the annotation information of existing samples, adjusting sensor configuration parameters, or changing the dataset index structure, the content of the YAML index file of the target dataset will change accordingly. When the main process starts the next training round, it will recalculate the MD5 hash value byte by byte on the modified index file to obtain the current fingerprint identifier that is different from the previous one, thus realizing that the fingerprint identifier is automatically updated as the dataset is modified.
[0022] S120, in response to the main process determining that the cached file is invalid based on the current fingerprint identifier, the processing process processes the full frame data of the target dataset to obtain the corresponding key-value pairs, wherein the key-value pairs include the frame index and the metadata corresponding to the frame index.
[0023] Specifically, after the main process obtains the current fingerprint identifier corresponding to the cache file of the target dataset, it can determine whether the cache file is valid based on the current fingerprint identifier. For example, it compares the current fingerprint identifier with the historical fingerprint identifier stored in the header of the cache file. If the two are different, it means that the target dataset has been modified since the last cache was generated, causing the fingerprint identifier to change accordingly. The cache file used in the previous training task can no longer be directly reused in this training task, and a cache file update needs to be triggered.
[0024] After triggering the cache update process, the main process calls and starts one or more processing processes. These processing processes traverse and parse the full set of frame data in the target dataset to generate key-value pairs containing frame indices and their corresponding metadata. The full set of frame data refers to the collection of all frame data samples constituting the target dataset. Each frame corresponds to an independent sample and contains at least the original acquired data of that frame and its associated metadata.
[0025] For example, the entire frame data of the target dataset is traversed. For each frame data currently traversed, the processing process extracts the unique identifier of the frame data as the frame index and extracts all metadata associated with the frame index (including but not limited to one or more of the timestamp, sensor data path, calibration parameters, and annotation content). The frame index and the corresponding metadata are associated and stored in the form of key-value pairs to obtain the key-value pair corresponding to the frame data, where the frame index is the key and the metadata corresponding to the frame index is the value.
[0026] S130: The key-value pairs are written to the cache file by the main process; when training with the target dataset, the cache file is loaded by the training process to obtain the frame index corresponding to the training process, and the training task is executed based on the metadata corresponding to the frame index.
[0027] Specifically, after the processing process completes the traversal of all frame data in the target dataset and the assembly of key-value pairs, the main process summarizes the key-value pairs generated by all processing processes and writes them in batches to the cache file according to the original order of the frame index. The cache file is persistently stored on the disk in LMDB (Lightning Memory-Mapped Database) format, thus completing the construction of the cache file.
[0028] When subsequent model training is performed using the target dataset, the training process loads the cache file in read-only mode. Based on the frame index required for the current training iteration, it quickly searches and reads the corresponding metadata from the cache file. Then, based on the original data storage path recorded in the metadata, it reads the corresponding training sample data and performs training operations such as forward and backward propagation. The different frame indices required for each iteration in the training process are dynamically determined by the training scheduling logic; the cache file serves only as a read-only data source for the training process to query and load on demand. When training is interrupted due to hardware failure, resource preemption, or human error, breakpoint resumption directly loads the existing cache, skipping the entire initialization process and achieving second-level recovery.
[0029] This application obtains the current fingerprint of the cache file through the main process. This fingerprint is dynamically updated as the dataset is modified, and is used to quickly determine whether the cache is valid. When the cache is invalid, the main process starts multiple processing processes to process the full set of frame data in parallel, generating key-value pairs containing frame indices and corresponding metadata. These key-value pairs are then aggregated by the main process and written to the cache file in batches. During training, the training process loads the cache file in read-only mode and reads the metadata of the required frames on demand through memory mapping, without needing to scan the entire original data. When training is interrupted due to hardware failure or human error and needs to be resumed from a breakpoint, the training process directly loads the existing cache, skipping the complete initialization scan process, achieving recovery within seconds. In this way, the problems of needing to traverse the entire dataset to start training and needing to repeatedly scan during breakpoint resumption, resulting in long-term idle computing resources, are solved. This significantly reduces the training initialization time overhead, avoids redundant calculations to a certain extent, and improves the efficiency of model iteration and development.
[0030] In some embodiments, the processing process processes the full frame data of the target dataset to obtain the key-value pairs corresponding to the processing process, including: performing fragmentation processing on the full frame data to obtain the frame index corresponding to the processing process; retrieving the full frame data based on the frame index to obtain the metadata corresponding to the processing process; and serializing the metadata corresponding to the processing process to obtain the key-value pairs corresponding to the processing process.
[0031] Specifically, when a single process processes full frame data, it needs to read and parse metadata frame by frame. The combination of I / O-intensive and CPU (Central Processing Unit)-intensive operations leads to low processing efficiency, making it difficult to meet the need for rapid cache generation for large-scale datasets. Therefore, it is necessary to divide the full frame data into multiple slices and process them in parallel by multiple processing processes to make full use of CPU multi-core resources and improve data throughput.
[0032] Specifically, the full frame data is evenly divided into multiple slices according to the frame index, with the number of slices equal to the number of processing processes. Each processing process is responsible for one slice. Then, each processing process extracts the frame index corresponding to each frame based on the allocated slice data, and retrieves the metadata associated with each frame from the full frame data based on the frame index. The metadata includes at least one or more of the following: timestamp, sensor data path, calibration parameters, and annotation content. Finally, each processing process performs binary serialization on the acquired metadata and assembles key-value pairs with the frame index as the key and the serialized metadata as the value, for subsequent aggregation and writing to a cache file.
[0033] In this way, through the multi-process parallel processing mechanism, the full frame data is evenly divided into slices according to the index, and each processing process reads and parses the metadata in its own slice in parallel, making full use of the CPU multi-core resources and greatly reducing the cache generation time of large-scale datasets.
[0034] In some embodiments, the data processing method further includes: loading the cache file by the training process in response to the main process determining that the cache file is valid based on the current fingerprint identifier.
[0035] Specifically, after the main process obtains the current fingerprint identifier corresponding to the cache file of the target dataset, it can determine whether the cache file is valid based on the current fingerprint identifier. For example, it compares the current fingerprint identifier with the historical fingerprint identifier stored in the header of the cache file. If they are the same, it means that the target dataset has not been modified since the last cache generation, the fingerprint identifier has not changed, and the cache file used in the previous training task can be directly reused in this training task without triggering a cache file update. At this time, when the target dataset is used for model training in subsequent sessions, the training process directly loads the cache file in read-only mode for training operations.
[0036] In some embodiments, after the key-value pairs are written to the cache file by the main process, the method further includes: obtaining the index file of the target dataset by the main process; calculating the hash value byte by byte on the index file to generate the storage fingerprint identifier of the cache file, and storing the storage fingerprint identifier in the header of the cache file.
[0037] Specifically, after the main process writes all key-value pairs to the cache file, it also obtains the index file of the target dataset. The index file records the storage path and associated metadata of each frame of data in the target dataset. Then, the main process calculates a hash value, such as an MD5 hash value, byte by byte on the index file to generate a storage fingerprint identifier for the cache file. For example, after the main process opens the index file in binary read mode, it reads each byte of data sequentially from the first byte until the last byte of the file is read. The entire byte content is used as input data. Then, the main process calls a preset hash algorithm (preferably the MD5 digest algorithm) to perform a one-way hash operation on all byte data to generate a fixed-length hash value. This hash value is the digital digest of the index file and is used as the storage fingerprint identifier for the cache file. Finally, the storage fingerprint identifier is written to the header area of the cache file as the historical fingerprint identifier of the cache file. This fingerprint identifier is used to compare with the current fingerprint identifier recalculated by the main process when a subsequent training task starts to determine whether the cache file is still valid.
[0038] It should be noted that the current fingerprint identifier and the stored fingerprint identifier are generated in the same way.
[0039] In some embodiments, the data processing method further includes: determining that the cache file is invalid by the main process responding to the inconsistency between the current fingerprint identifier and the stored fingerprint identifier; and determining that the cache file is valid by the main process responding to the inconsistency between the current fingerprint identifier and the stored fingerprint identifier.
[0040] Specifically, after the main process obtains the current fingerprint identifier of the cache file of the target dataset, it reads the historical fingerprint identifier (i.e. the stored fingerprint identifier written when the cache file is generated) pre-stored in the header area of the cache file, and compares the current fingerprint identifier with the stored fingerprint identifier to determine whether the cache file is valid based on the comparison result.
[0041] For example, if the current fingerprint identifier is inconsistent with the stored fingerprint identifier, it means that the target dataset has undergone changes such as data addition, annotation modification, or configuration adjustment since the cache file was generated. The metadata parsing results and index structure persistently stored in the cache file can no longer accurately reflect the latest state of the target dataset. Therefore, the main process determines that the cache file is invalid and needs to trigger the cache update process. If the current fingerprint identifier is consistent with the stored fingerprint identifier, it means that the target dataset has not changed since the cache file was generated. The metadata and index structure carried by the cache file completely match the current state of the target dataset. Therefore, the main process determines that the cache file is valid. The training process can directly load and reuse the cache file without re-executing the full data traversal scan.
[0042] As a concrete example, refer to Figure 2 The data processing method in this application embodiment may further include the following steps: S201, Calculate the current fingerprint identifier of the target dataset.
[0043] S202: Determine whether the cache exists and is valid based on the current fingerprint identifier and the stored fingerprint identifier. If yes, proceed to S205; otherwise, proceed to S203.
[0044] The Rank0 main process checks whether the corresponding fingerprint LMDB file exists in the cache path of the target dataset. If it does not exist, it executes S203. If it does not exist, it further determines whether the cache file is valid based on the current fingerprint identifier. If the cache file is valid, it executes S205. If the cache file is invalid, it executes S203.
[0045] S203, multi-process parallel generation of key-value pairs.
[0046] S204, write the key-value pairs to the cache file.
[0047] S205, other processes load the cache.
[0048] In some embodiments, performing a training task based on the metadata corresponding to the frame index includes: parsing the metadata corresponding to the frame index to obtain the data version identifier, vehicle model identifier, camera identifier, and sensor data path corresponding to the frame index; determining the first parsing function, radar configuration information, sensor data, and camera parameters corresponding to the frame index based on the data version identifier, vehicle model identifier, sensor data path, and camera identifier, respectively; parsing the sensor data based on the first parsing function, processing the parsed sensor data based on the radar configuration information and camera parameters, generating training data based on the processed sensor data, and performing a training task based on the training data.
[0049] Specifically, after loading the cache file in read-only mode, the training process quickly searches and reads the metadata corresponding to the frame index required for the current training iteration from the cache file. It then parses the metadata corresponding to the frame index, extracting the data version identifier (e.g., pack_version), vehicle model identifier, camera identifier, and sensor data path of the data sample corresponding to the frame index. The data version identifier identifies the data acquisition version to which the frame data belongs, the vehicle model identifier identifies the vehicle platform from which the frame data originates, and the camera identifier identifies the camera model used in the frame data.
[0050] Then, the training process, based on the data version identifier, searches and determines the first parsing function matching that version identifier from the version mapping table. The version mapping table pre-registers parsing functions corresponding to each data version. The pre-registered parsing functions in the version mapping table employ a plug-in design, registering an independent parsing function for each data version. The version mapping table automatically matches the corresponding parsing function, ensuring compatibility with multiple historical data formats. When adding a new version, only the new parsing function needs to be registered; no modification to the core framework code is required. This achieves a single codebase that adapts to multiple data versions, thus solving the problems of poor compatibility between multiple versions of data and the need to maintain multiple independent parsing logics due to large batch sizes of data, which are prone to version adaptation errors.
[0051] The training process uses the parsed vehicle model identifier to search and determine the radar configuration information corresponding to that vehicle model from the sensor view mapping table. The sensor view mapping table pre-maintains the correspondence between different vehicle models and radar configuration information, covering mass-produced vehicle configurations such as dual front radar and single top radar. The radar configuration information corresponding to each vehicle model includes at least the type of radar equipped in that vehicle model (e.g., dual front radar or single top radar), the calibration extrinsic parameter matrix of each radar in the vehicle coordinate system, and the data reading priority.
[0052] The training process accesses the corresponding data files in distributed storage or the local file system based on the parsed sensor data paths, and reads the sensor data stored therein. This sensor data may include one or more of LiDAR point cloud data and camera image data. LiDAR point cloud data can be stored in binary format, recording the 3D spatial coordinates (x, y, z) and reflection intensity of each scan point. Camera image data is stored in standard image formats (such as JPEG and PNG), recording the RGB or grayscale pixel information of the scene. Simultaneously, the training process performs timestamp verification on each sensor data based on the timestamp field carried in the sensor data path, ensuring the alignment accuracy of each modality's data in the time dimension during subsequent multi-sensor fusion.
[0053] The training process is based on the camera identifier obtained from the parsing, and the intrinsic parameter matrix and distortion coefficients corresponding to the camera model are looked up and determined from the camera parameter mapping table. The camera parameter mapping table pre-stores the intrinsic parameter matrices (e.g., focal lengths fx, fy and optical centers cx, cy) and distortion coefficients (e.g., radial distortion coefficients k1, k2, k3 and tangential distortion coefficients p1, p2) corresponding to different camera models.
[0054] After the training process completes version mapping, radar configuration determination, and camera parameter loading, the read sensor data (e.g., radar data and / or camera data) is parsed using the first parsing function, converting it into structured data in a unified format. Then, the training process processes the radar point cloud data from the parsed sensor data based on the radar configuration information. For example, if the vehicle is a dual-front radar model, the training process simultaneously reads the left and right radar point clouds based on the sensor data path, transforms the left radar point cloud to the vehicle coordinate system according to the calibration extrinsic parameter matrix, and then merges it with the right radar point cloud. If the vehicle is a single-top radar model, the training process directly reads the single radar point cloud and transforms it to a unified coordinate system. If a radar data point is damaged or missing, the training process pads the point cloud within its corresponding field of view with zeros to ensure consistent output point cloud dimensions. This solves the problems of needing to redevelop parsing scripts for each new LiDAR model due to significant differences in LiDAR configurations across different vehicle models, resulting in high code redundancy and maintenance costs. It also addresses issues such as rigid multi-sensor fusion logic, inability to automatically identify missing or abnormal sensors, single-sensor data corruption leading to the failure of the entire sample, and poor training robustness.
[0055] Meanwhile, the training process processes the camera data in the parsed sensor data based on the camera parameters. For example, it performs distortion correction on the read camera image based on the distortion coefficient to obtain the corrected camera image. It also performs adaptive scaling on the intrinsic parameter matrix according to the preset image downsampling ratio in the training configuration (when downsampling to 1 / N, fx, fy, cx, and cy are divided by N simultaneously) to establish the projection mapping relationship between the corrected camera image and the three-dimensional space.
[0056] After completing the above corrections, the training process aligns the corrected sensor data (including fused target radar data and corrected camera images) with timestamps and spatial coordinates to generate multimodal fusion training data. Finally, based on the training data, the model's forward propagation, loss calculation, and backpropagation training tasks are performed to complete the current iteration of training.
[0057] In this way, a unified data loading process replaces the approach of maintaining independent datasets for each sensing task, thereby solving the problems of fragmented data processing across multiple tasks, incompatibility of data loading logic between different sensing tasks, and the inability to support joint training of multiple tasks, which limits the improvement of model performance. This reduces code redundancy and maintenance costs, avoids version compatibility errors to some extent, supports unified data loading for multiple tasks, and improves the robustness of sensor fusion and the efficiency of model iteration and development.
[0058] In some embodiments, after generating training data based on the processed sensor data, the method further includes: determining the labeled data type corresponding to the training data according to the training task type; parsing the metadata corresponding to the frame index to obtain the labeled data path corresponding to the frame index; reading the corresponding labeled data from the labeled data path based on the labeled data type, and determining a second parsing function based on the labeled data type; parsing the labeled data based on the second parsing function to generate a labeled tensor corresponding to the training data, and executing the training task based on the training data and the labeled tensor corresponding to the training data.
[0059] Specifically, the training process reads a pre-defined task list from the training configuration file. This list includes one or more perception tasks such as 3D object detection, lane segmentation, semantic segmentation, trajectory prediction, and discrete object detection. The training process uses each task in the task list as a query condition and performs a matching query in a pre-defined task-annotation type mapping table to determine the corresponding annotation data type for each task. The task-annotation type mapping table pre-configured the correspondence between each task and the annotation data type. For example, 3D object detection corresponds to 3D object annotation type, lane segmentation corresponds to vector lane annotation type, trajectory prediction corresponds to trajectory annotation type, semantic segmentation corresponds to pixel-level semantic annotation type, and discrete object detection corresponds to discrete object annotation type. This clarifies which information the current training task needs to extract from the labeled data.
[0060] Then, the training process parses the metadata corresponding to the frame index, extracts the labeled data path of the data sample corresponding to the frame index from the metadata, and the labeled data path points to the labeled file stored in distributed storage or local file system.
[0061] Then, the training process reads the corresponding labeled data from the labeled data path based on the labeled data type, and determines the second parsing function based on the labeled data type. For example, if a 3D object detection task is configured, the corresponding 3D object detection parsing function is called to parse the 3D object labels from the labeled data and filter out targets outside the detection range and targets with severe occlusion; if a lane line segmentation task is configured, the corresponding lane line segmentation parsing function is called to parse the vector lane line labels, sample a fixed number of points for each lane line, and filter out line segments that are too short; if a trajectory prediction task is configured, the corresponding trajectory prediction parsing function is called to parse the trajectory data of the vehicle and surrounding vehicles, and resample and complete the trajectory; if a semantic segmentation task or discrete object detection task is configured, the corresponding parsing function is called to perform the corresponding parsing.
[0062] Then, the training process parses the read labeled data based on the second parsing function, and converts the labeled data of each task into a standard tensor format. The labeled tensor contains at least one or more of the following: label, three-dimensional coordinates, size, orientation angle, mask and validity indicator, thereby generating the labeled tensor corresponding to the training data.
[0063] Finally, the training process performs joint training of the multi-task perception model based on the training data (multimodal fused sensor data) and the labeled tensor corresponding to the training data. This includes training operations such as forward propagation, multi-task loss calculation, and backpropagation, to complete the training of the current iteration.
[0064] Thus, this application encapsulates the annotation parsing for different tasks into independent function modules, which can be freely combined according to task configuration, solving the problem of fragmented data processing for multiple tasks. This enables different perception tasks to load data uniformly and perform end-to-end joint training, thereby improving model performance. Only the required annotation data is loaded according to the training task requirements, without loading irrelevant information, which significantly reduces memory usage and improves the efficiency of training resource utilization. By standardizing the output format, the annotations of all tasks are uniformly converted into a standard tensor format containing labels, coordinates, size, orientation angle, mask, and validity indicators, which directly connects to the general training pipeline without the need to adapt data interfaces separately for each task, simplifying the training process.
[0065] As another concrete example, refer to Figure 3 The data processing method in this application embodiment may further include the following steps: S301, multi-vehicle, multi-sensor data.
[0066] S302, Read version identifier.
[0067] Based on the frame index required for the current training iteration, quickly find and read the metadata corresponding to the frame index from the cache file, parse the metadata corresponding to the frame index, and extract the data version identifier of the data sample corresponding to the frame index from the metadata.
[0068] S303, query the version mapping table and match the corresponding version parsing function.
[0069] The training process is based on the data version identifier. It searches for and determines the first parsing function that matches the version identifier in the version mapping table. The version mapping table has pre-registered parsing functions corresponding to each data version.
[0070] S304 performs versioned parsing to read the sensor's raw data and calibration parameters.
[0071] The first parsing function parses the read sensor data (such as radar data and / or camera data) and converts it into structured data in a unified format.
[0072] The metadata corresponding to the frame index is parsed, and the camera identifier of the data sample corresponding to the frame index is extracted from the metadata. Based on the parsed camera identifier, the training process searches for and determines the calibration parameters corresponding to the camera model from the camera parameter mapping table, such as the intrinsic parameter matrix and distortion coefficients.
[0073] S305, read the vehicle model field and query the sensor mapping table.
[0074] The metadata corresponding to the frame index is parsed, and the vehicle model identifier of the data sample corresponding to the frame index is extracted from the metadata. Based on the parsed vehicle model identifier, the training process searches and determines the radar configuration information corresponding to the vehicle model from the sensor view mapping table, such as dual front radar or single top radar.
[0075] S306, LiDAR sensor data selection, coordinate transformation and fusion.
[0076] The training process processes the radar point cloud data from the parsed sensor data based on radar configuration information. For example, if the vehicle has dual front radars, the training process simultaneously reads the left and right radar point clouds based on the sensor data path, transforms the left radar point cloud to the vehicle coordinate system according to the calibration extrinsic parameter matrix, and then stitches and fuses it with the right radar point cloud. If the vehicle has a single top radar, the training process directly reads the single radar point cloud and transforms it to a unified coordinate system. If a radar data point is damaged or missing, the training process pads the point cloud within its corresponding field of view with zeros to ensure that the output point cloud dimension remains consistent. This solves the problems of needing to redevelop the parsing script, high code redundancy, and high maintenance costs for each new LiDAR configuration due to significant differences in LiDAR configurations across different vehicle models. It also addresses the issues of rigid multi-sensor fusion logic, inability to automatically identify missing or abnormal sensors, failure of the entire sample due to single sensor data corruption, and poor training robustness.
[0077] S307, Camera Data Processing and Coordinate Transformation.
[0078] The training process processes the camera data in the parsed sensor data based on the camera parameters. For example, it performs distortion correction on the read camera image based on the distortion coefficient to obtain the corrected camera image. It then performs adaptive scaling on the intrinsic parameter matrix according to the preset image downsampling ratio in the training configuration (when downsampling to 1 / N, fx, fy, cx, and cy are simultaneously divided by N) to establish the projection mapping relationship between the corrected camera image and the three-dimensional space.
[0079] S308, Standardized Multi-Sensor Data.
[0080] As yet another concrete example, refer to Figure 4 The data processing system in this application embodiment includes: a metadata caching module, a multi-model and multi-version parsing module, and a multi-task GT (Ground Truth) unified parsing module.
[0081] A unified YAML format index file is pre-configured for the target dataset. This index file includes the dataset version number and the dataset index file directory. The dataset index file defines the dataset root directory, LMDB cache storage path, sensor view mapping table path, and sensor calibration file path. The sensor view mapping table contains the number of radars and their installation locations for each vehicle model. The sensor calibration files include key parameters such as the lidar point cloud coordinate system transformation extrinsic parameter matrix and camera intrinsic and extrinsic parameters. The dataset fingerprint is generated using the MD5 hash algorithm, performing a byte-by-byte hash calculation on the YAML format index file. The LMDB cache uses a single-file storage mode with a maximum capacity of 200GB.
[0082] The metadata caching module is used when training starts. The Rank0 main process in the distributed training cluster first reads the YAML format index file and calculates the current fingerprint of the dataset. Then, the Rank0 main process checks whether the corresponding LMDB file for the fingerprint exists in the cache path of the target dataset. If it does not exist, the cache update process is triggered. For example, multiple parallel processes, such as 16 CPUs, are started, and all frame data is evenly distributed to each worker process according to the index. Each process independently reads the metadata of the corresponding frame (including timestamp, data paths of each sensor, and calibration file paths) and serializes it into binary key-value pairs. After all processes have finished processing, the Rank0 process writes all metadata to the LMDB cache in batches according to the frame index order, and writes the dataset fingerprint, generation timestamp, and total number of data frames in the file header.
[0083] If it exists, the validity of the cache file is further determined based on the current fingerprint identifier. For example, if the current fingerprint identifier is inconsistent with the stored fingerprint identifier, it means that the target dataset has undergone changes such as data addition, annotation modification, or configuration adjustment since the cache file was generated. The metadata parsing results and index structure persistently stored in the cache file can no longer accurately reflect the latest state of the target dataset. Therefore, the main process determines that the cache file is invalid and the cache update process needs to be triggered. If the current fingerprint identifier is consistent with the stored fingerprint identifier, it means that the target dataset has not changed since the cache file was generated. The metadata and index structure carried by the cache file completely match the current state of the target dataset. Therefore, the main process determines that the cache file is valid. The training process can directly load and reuse the cache file without re-executing the full data traversal scan.
[0084] Once the cache is generated, all training processes simultaneously open the LMDB file in read-only mode and load the metadata index via memory mapping. If training is interrupted due to hardware failure or resource preemption, or if the training task is actively interrupted due to training phase reasons, all processes can directly read the existing cache when resuming training from a breakpoint, significantly shortening the initialization time.
[0085] The multi-vehicle, multi-version parsing module is used when training with a target dataset. The dataset class first reads the version in the header of the current data packet and automatically matches the corresponding first parsing function through a version mapping table to parse the data from each sensor and its calibration. Since the ground truth of the vehicle data may include both dual-front LiDAR and single-top LiDAR, after version parsing, the sensor view mapping table is queried based on the vehicle model field in the data packet to automatically identify the sensor configuration of the vehicle model to be trained. For example, for a dual-front LiDAR vehicle, the point cloud data of both the left and right LiDARs are read simultaneously. The left LiDAR point cloud is transformed to the vehicle coordinate system according to a pre-calibrated extrinsic parameter matrix, and then the left and right LiDAR point clouds are stitched together. For a single-top LiDAR vehicle, the point cloud data of a single LiDAR is directly read and transformed to a unified coordinate system. If any LiDAR data is damaged or missing, the system automatically pads the point cloud within the corresponding field of view of that LiDAR with zeros to ensure that the dimensions of the output point cloud remain consistent. Subsequently, the model identifier of the camera module is read, the intrinsic parameter matrix and distortion coefficients corresponding to the resolution are loaded, and according to the image downsampling ratio in the training configuration, such as 2x downsampling, the fx, fy, cx, and cy parameters of the intrinsic parameter matrix are divided by 2 to ensure the accuracy of the projection transformation of the 3D point cloud and the 2D image.
[0086] The multi-task ground truth (GT) unified parsing module employs a pluggable GT parsing framework, encapsulating annotation parsing for different tasks into independent, loadable modules. During training, based on the task list in the configuration file, the corresponding parsing plugin is automatically loaded. For example, if a 3D object detection task is configured, the corresponding function is called to parse 3D object annotations, filtering out targets outside the detection range and those with severe occlusion. If a lane segmentation task is configured, the corresponding function is called to parse vector lane line annotations, sampling a fixed number of points for each lane line and filtering out excessively short segments. If a trajectory prediction task is configured, the corresponding function is called to parse the trajectory data of the vehicle and surrounding vehicles, resampling and completing the trajectories. All task annotation data is uniformly converted to a standard tensor format, including fields such as labels, 3D coordinates, dimensions, orientation angle, mask, and validity indicators, and directly input into the multi-task perception model for end-to-end joint training. The system only loads the necessary annotation data and does not load irrelevant information.
[0087] Corresponding to the above embodiments, this application also proposes a data processing apparatus.
[0088] Reference Figure 5 The data processing device 500 includes: an acquisition module 510, a processing module 520, and a writing module 530.
[0089] The acquisition module 510 is used to acquire the current fingerprint identifier of the cache file of the target dataset through the main process. The current fingerprint identifier is dynamically updated according to the modification of the target dataset. The processing module 520 is used to process the full frame data of the target dataset through the processing process in response to the main process determining that the cache file is invalid based on the current fingerprint identifier, so as to obtain the corresponding key-value pairs, where the key-value pairs include the frame index and the metadata corresponding to the frame index. The writing module 530 is used to write the key-value pairs to the cache file through the main process; wherein, when training is performed using the target dataset, the cache file is loaded through the training process to obtain the frame index corresponding to the training process, and the training task is performed based on the metadata corresponding to the frame index.
[0090] According to one embodiment of this application, the processing module 520 is specifically used to: perform fragmentation processing on the full frame data to obtain the frame index corresponding to the processing process; retrieve the full frame data based on the frame index to obtain the metadata corresponding to the processing process; and serialize the metadata corresponding to the processing process to obtain the key-value pairs corresponding to the processing process.
[0091] According to one embodiment of this application, the main process determines that the cache file is valid based on the current fingerprint identifier, and the training process loads the cache file.
[0092] According to one embodiment of this application, after the key-value pairs are written to the cache file by the main process, the index file of the target dataset is obtained by the main process; the hash value is calculated byte by byte on the index file to generate the storage fingerprint identifier of the cache file, and the storage fingerprint identifier is stored in the header of the cache file.
[0093] According to one embodiment of this application, the cache file is determined to be invalid if the main process responds to the current fingerprint identifier being inconsistent with the stored fingerprint identifier; and the cache file is determined to be valid if the main process responds to the current fingerprint identifier being consistent with the stored fingerprint identifier.
[0094] According to one embodiment of this application, the metadata corresponding to the frame index is parsed to obtain the data version identifier, vehicle model identifier, camera identifier, and sensor data path corresponding to the frame index; based on the data version identifier, vehicle model identifier, sensor data path, and camera identifier, the first parsing function, radar configuration information, sensor data, and camera parameters corresponding to the frame index are determined respectively; the sensor data is parsed based on the first parsing function, and the parsed sensor data is processed based on the radar configuration information and camera parameters; training data is generated based on the processed sensor data, and a training task is executed based on the training data.
[0095] According to one embodiment of this application, after generating training data based on processed sensor data, the labeled data type corresponding to the training data is determined according to the training task type; the metadata corresponding to the frame index is parsed to obtain the labeled data path corresponding to the frame index; based on the labeled data type, the corresponding labeled data is read from the labeled data path, and a second parsing function is determined based on the labeled data type; the labeled data is parsed based on the second parsing function to generate the labeled tensor corresponding to the training data, and the training task is executed based on the training data and the labeled tensor corresponding to the training data.
[0096] It should be noted that the above explanations of the embodiments and beneficial effects of the data processing method also apply to the data processing apparatus of the embodiments of this application. To avoid redundancy, they will not be elaborated in detail here.
[0097] Corresponding to the above embodiments, this application also proposes a computer-readable storage medium.
[0098] The computer-readable storage medium of this application stores a data processing program thereon, which, when executed by a processor, implements the aforementioned data processing method.
[0099] It should be noted that the above explanation of the embodiments and beneficial effects of the data processing method also applies to the computer-readable storage medium of the embodiments of this application. To avoid redundancy, it will not be elaborated in detail here.
[0100] Corresponding to the above embodiments, this application also proposes an electronic device.
[0101] See Figure 6 As shown, the electronic device 600 of this application includes a memory 610, a processor 620, and a data processing program stored in the memory 610 and capable of running on the processor 620. When the processor executes the data processing program, it implements the aforementioned data processing method.
[0102] It should be noted that the above explanation of the embodiments and beneficial effects of the data processing method also applies to the electronic devices in the embodiments of this application. To avoid redundancy, they will not be elaborated in detail here.
[0103] In this application, "multiple" refers to two or more.
[0104] In this application, unless otherwise expressly defined, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0105] The terms “first,” “second,” “third,” “fourth,” etc., in this application (if present) are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0106] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, in this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0107] Unless otherwise specified, all steps in this application may be performed sequentially or randomly. For example, if the method includes steps A and B, it means that the method may include steps A and B performed sequentially, or it may include steps B and A performed sequentially. For example, if the method may also include step C, it means that step C may be added to the method in any order. For example, the method may include steps A, B, and C, or it may include steps A, C, and B, or it may include steps C, A, and B, etc.
[0108] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A data processing method, characterized in that, include: The current fingerprint identifier of the cache file of the target dataset is obtained through the main process, wherein the current fingerprint identifier is dynamically updated according to the modification of the target dataset; In response to the main process determining that the cached file is invalid based on the current fingerprint identifier, the processing process processes the full frame data of the target dataset to obtain the corresponding key-value pairs, wherein the key-value pairs include the frame index and the metadata corresponding to the frame index; The main process writes the key-value pairs to the cache file; wherein... When training is performed using the target dataset, the cache file is loaded through the training process to obtain the frame index corresponding to the training process, and the training task is executed based on the meta-information corresponding to the frame index.
2. The data processing method according to claim 1, characterized in that, The process of processing the full frame data of the target dataset to obtain the corresponding key-value pairs includes: The full frame data is fragmented to obtain the frame index corresponding to the processing process; The full frame data is retrieved based on the frame index to obtain the metadata corresponding to the processing process; The metadata corresponding to the processing process is serialized to obtain the key-value pairs corresponding to the processing process.
3. The data processing method according to claim 1, characterized in that, Also includes: The main process determines that the cache file is valid based on the current fingerprint identifier, and then loads the cache file through the training process.
4. The data processing method according to claim 1, characterized in that, After the main process writes the key-value pairs to the cache file, the process further includes: The index file of the target dataset is obtained through the main process; The hash value is calculated byte by byte for the index file to generate the storage fingerprint identifier of the cache file, and the storage fingerprint identifier is stored in the header of the cache file.
5. The data processing method according to claim 4, characterized in that, Also includes: The main process determines that the cache file is invalid when the current fingerprint identifier is inconsistent with the stored fingerprint identifier. The main process determines that the cached file is valid by responding to the fact that the current fingerprint identifier matches the stored fingerprint identifier.
6. The data processing method according to claim 1, characterized in that, The step of performing the training task based on the metadata corresponding to the frame index includes: The metadata corresponding to the frame index is parsed to obtain the data version identifier, vehicle model identifier, camera identifier, and sensor data path corresponding to the frame index; Based on the data version identifier, the vehicle model identifier, the sensor data path, and the camera identifier, the first parsing function, radar configuration information, sensor data, and camera parameters corresponding to the frame index are determined respectively. The sensor data is parsed based on the first parsing function, and the parsed sensor data is processed based on the radar configuration information and the camera parameters. Training data is generated based on the processed sensor data, and the training task is executed based on the training data.
7. The data processing method according to claim 6, characterized in that, After generating training data based on the processed sensor data, it also includes: Based on the training task type, determine the labeled data type corresponding to the training data; The metadata corresponding to the frame index is parsed to obtain the labeled data path corresponding to the frame index; Based on the labeled data type, the corresponding labeled data is read from the labeled data path, and the second parsing function is determined based on the labeled data type; The labeled data is parsed based on the second parsing function to generate the labeled tensor corresponding to the training data, and the training task is executed based on the training data and the labeled tensor corresponding to the training data.
8. A data processing apparatus, characterized in that, include: The acquisition module is used to acquire the current fingerprint identifier of the cache file of the target dataset through the main process, wherein the current fingerprint identifier is dynamically updated according to the modification of the target dataset; The processing module is configured to, in response to the main process determining that the cached file is invalid based on the current fingerprint identifier, process the full frame data of the target dataset through the processing process to obtain the key-value pair corresponding to the processing process, wherein the key-value pair includes the frame index and the metadata corresponding to the frame index; The writing module is used to write the key-value pairs to the cache file through the main process; wherein, when training is performed using the target dataset, the cache file is loaded through the training process to obtain the frame index corresponding to the training process, and the training task is performed based on the meta-information corresponding to the frame index.
9. A computer-readable storage medium, characterized in that, It stores a data processing program, which, when executed by a processor, implements the data processing method according to any one of claims 1-7.
10. An electronic device, characterized in that, The system includes a memory, a processor, and a data processing program stored in the memory and capable of running on the processor. When the processor executes the data processing program, it implements the data processing method according to any one of claims 1-7.
