Data acquisition method and system based on multiple protocols
Through the multi-protocol data acquisition method, the problems of inconsistent sensor data timestamps and inconsistent protocols in autonomous driving are solved, efficient data transmission and unified management are realized, and the reliability and user experience of the autonomous driving system are improved.
Patent Information
- Application Number
- CN202510762248.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-07-18
AI Technical Summary
In the existing autonomous driving data acquisition technology, inconsistent sensor data timestamps and protocol inconsistencies lead to insufficient data synchronization, insufficient network bandwidth leads to low transmission efficiency, complex data management, and high risk of loss during big data acquisition.
The multi-protocol data acquisition method is adopted to achieve unified processing and management of data through protocol identification and adaptation, timestamp synchronization, unified encapsulation, encryption and integrity verification, multi-channel transmission and distributed storage.
Improve data synchronization and compatibility, simplify data storage and management, improve transmission efficiency and system flexibility, and ensure data integrity and reliability.
Smart Images

Figure CN120343059A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data collection for autonomous driving, and particularly to a data collection method and system based on multiple protocols. Background Art
[0002] In current autonomous driving, data collection is a very important link. It provides the real-world data required for training and optimizing algorithms to improve the vehicle's perception and decision-making capabilities. Secondly, data can help identify and address safety hazards to ensure the reliability of the system. In addition, by analyzing driving data, continuous performance improvement and technological innovation can be achieved, ultimately enhancing the user experience and reducing the accident risk.
[0003] In current data collection technologies, the data collection software is provided by various sensor providers or perception software service providers, and the amount of data collected is large, resulting in the following deficiencies in the current data collection method: (1) Insufficient synchronization of data collection data. Since each sensor and software provider only provides its own relevant collection software, but the data timestamp identifiers of multiple software are inconsistent, resulting in a certain time deviation in the data collected by each sensor, which brings great inconvenience to the subsequent data analysis and resynchronization.
[0004] (2) Inconsistency of protocols. In current autonomous driving, since multiple suppliers provide various software parts in a solution, the data storage protocols are different, resulting in the need to deploy multiple software for data collection during data collection, increasing the risk of data loss during transmission and storage. And the management is also more troublesome, requiring multiple files to correspond. Once a file is lost, the integrity of the data will be damaged.
[0005] (3) The large amount of data causes the network bandwidth to be unable to support the simultaneous storage of a large amount of data, low transmission efficiency, and difficult data management. For autonomous driving solutions equipped with lidar, due to the large size of point cloud and camera data, during the process of data transmission through the network, it causes network instability, resulting in problems such as data loss and system restart. Seriously affecting the efficiency of data collection work and data management. And for the collection of big data, it has to be collected by reducing the collection frame rate and losing data accuracy, which greatly affects the integrity of the original data. Even making the data unavailable in R & D and iteration.
[0006] Based on the above considerations, there is an urgent need to provide a data collection method and system based on multiple protocols to solve the above problems. Summary of the Invention
[0007] To achieve the above object, the inventor provides a multi-protocol based data acquisition method, comprising the following steps: S1, sensor data acquisition, obtains raw data from sensors in real time; S2, protocol identification and adaptation, automatically identifies the type of communication protocol used by the current data by analyzing the data frame header information, frame structure characteristics, flag bits, and key fields. After successful identification, load or call the corresponding adaptation protocol; S3, timestamp synchronization processing, unified timestamp correction or supplement for the acquired raw data; S4, unified encapsulation protocol processing, encapsulates the data after protocol adaptation and timestamp synchronization according to a unified structure, and the encapsulated data frame structure contains the fields protocol identifier, device type code, timestamp, data length, payload and extension field; S5, data encryption and integrity check: during the encapsulation process, the collected data is encrypted and compressed according to the configuration or data sensitivity level, and a checksum is calculated and added to each frame of encapsulated data; S6, data transmission, the encapsulated data is transmitted to the processing server or the local recording module; S7, data storage and management, after receiving the transmitted data, unpack, verify and classify it and save it in the local or distributed storage system.
[0008] As a preferred embodiment of the present invention, the sensor includes a lidar, a millimeter-wave radar, an inertial measurement unit, a positioning module, a camera and / or an ultrasonic sensor, and each frame of data in the sensor's data stream contains a device timestamp, original data content, and preliminary communication metadata.
[0009] As a preferred embodiment of the present invention, step S2 also includes: in the process of raw data acquisition, automatically identifying the communication protocol used by the connected sensor through a protocol detection mechanism, and automatically identifying the protocol type by dynamically scanning the protocol identifier or tag information in the data packet.
[0010] As a preferred embodiment of the present invention, in step S3, the timestamp synchronization processing includes uniformly marking all collected raw data by setting a global clock to ensure time synchronization of sensor data, and the time synchronization adopts a high-precision synchronization protocol.
[0011] As a preferred embodiment of the present invention, step S3 also includes: if the raw data of the sensor has its own timestamp, it is corrected according to the time offset with the global clock; if there is no timestamp, it is supplemented and marked with a time tag in a unified format according to the receiving time, and the timestamp is recorded with nanosecond accuracy and is accompanied by a time synchronization flag.
[0012] As a preferred embodiment of the present invention, step S4 further includes setting up a protocol adaptation layer responsible for converting and encapsulating data of different protocols. The protocol adaptation layer can convert the input protocol format into a unified custom encapsulation format according to the input protocol format. The protocol adaptation layer is designed with an interface orientation and can adapt to new protocols or updated versions of existing protocols.
[0013] As a preferred embodiment of the present invention, in step S4, the extended fields include a check algorithm identifier, an encryption identifier, a reserved field, and a check code; the bit lengths of the internal parameters occupied by each field are as follows: the protocol identifier is 4, the device type code is 2, the timestamp is 8, the data length is 4, the check algorithm identifier is 1, the encryption identifier is 1, the reserved field is 2, the payload is N, and the check code is 4 / 32.
[0014] As a preferred embodiment of the present invention, in step S6, data transmission adopts a multi-channel transmission mode of PCIE protocol, Ethernet protocol, and ZMQ protocol.
[0015] As a preferred embodiment of the present invention, in step S7, data storage and management include storing all the collected data according to a custom encapsulation protocol and managing it using a standardized data format. Among them, data storage adopts a distributed storage system. During the storage process, data is stored in a sharded manner, and each data block carries complete timestamp and check information.
[0016] To achieve the above object, the inventor also provides a multi-protocol based data acquisition system, which includes: A data acquisition module for obtaining raw data from sensors in real time; A protocol detection and adaptation module for automatically identifying the communication protocol type used by the current data by analyzing the data frame header information, frame structure characteristics, flag bits, and key fields. After successful identification, the corresponding adaptation protocol is loaded or called; A time synchronization processing module for uniformly correcting or supplementing the timestamps of the obtained raw data; A unified encapsulation protocol processing module for encapsulating the data after protocol adaptation and timestamp synchronization processing according to a unified structure. The encapsulated data frame structure includes fields such as protocol identifier, unified timestamp, payload, data length, data type identifier, and optional extended fields; A data encryption and integrity check module for encrypting and compressing the collected data according to the configuration or data sensitivity level during the encapsulation process, and calculating and attaching a check code to each frame of encapsulated data; A data transmission module for transmitting the encapsulated data to a processing server or a local recording module; The data storage and management module is used to unpack, verify, and classify the received transmission data and save it to a local or distributed storage system.
[0017] Different from the prior art, the beneficial effects achieved by the above technical solutions are as follows: (1) Improve data synchronization: By means of a unified timestamp mechanism, this method and system solve the problem of inconsistent timestamps of different sensor data, improve data synchronization, and ensure the temporal consistency of data; (2) Support multi-protocol integration: By customizing the encapsulation protocol, this method and system are compatible with multiple data protocols, simplify the protocol integration between different sensors, and enhance the compatibility and flexibility of the system; (3) Simplify data storage and management: By means of a unified data encapsulation format and a standardized storage method, this method and system simplify the complexity of data management and improve the efficiency of data processing, access, and storage; After introducing the protocol adaptive design, this method and system have significant advantages, including: Simplify system integration. Through the automatic identification and conversion of protocols, the configuration and debugging work during the integration of different sensors and systems are reduced, and the complexity of the system is lowered; Enhance system flexibility and scalability. The modular design of the protocol adaptation layer enables the system to quickly adapt to new protocol requirements without large-scale modification of the entire system, ensuring the future expansion ability of the system; Improve data transmission efficiency and reliability. Dynamic protocol switching can select the most suitable protocol according to real-time conditions, avoid bottlenecks during data transmission, and ensure the efficient transmission and low latency of large amounts of data; Ensure data compatibility and integrity. The protocol identification and compatibility verification mechanism ensure the correctness and integrity of data, avoiding data loss or transmission errors caused by inconsistent protocols; Optimize performance and user experience. Through adaptive protocol switching and optimization, the system can operate stably under different network conditions, thereby improving the reliability and user experience of applications such as autonomous driving. Description of the Drawings
[0018] Figure 1 It is a framework diagram of the method described in the specific implementation manner; Figure 2 It is a data processing flow diagram of the method described in the specific implementation manner; Figure 3 It is a schematic diagram of the format of the encapsulation protocol described in the specific implementation manner. Specific Implementation Manner
[0019] To describe in detail the technical content, structural features, achieved objectives, and effects of the technical solution, the following will be described in detail with reference to specific embodiments and in conjunction with the accompanying drawings.
[0020] Such as Figure 1 AndFigure 2 As shown in the figure, this embodiment provides a multi - protocol - based data acquisition method, including the following steps S1, Sensor data acquisition: Real - time obtain the original data from the sensors; S2, Protocol identification and adaptation: Automatically identify the communication protocol type used by the current data by analyzing the data frame header information, frame structure features, flag bits, and key fields. After successful identification, load or call the corresponding adaptation protocol; S3, Timestamp synchronization processing: Perform unified timestamp correction or supplementation on the obtained original data; S4, Unified encapsulation protocol processing: Encapsulate the data after protocol adaptation and timestamp synchronization processing according to a unified structure. The encapsulated data frame structure contains fields such as protocol identifier, device type code, timestamp, data length, payload, and optional extended fields; S5, Data encryption and integrity verification: During the encapsulation process, encrypt and compress the acquired data according to the configuration or data sensitivity level, and calculate and append a checksum to each frame of encapsulated data; S6, Data transmission: Transmit the encapsulated data to the processing server or local recording module; S7, Data storage and management: After receiving the transmitted data, unpack, verify, and classify it for storage in a local or distributed storage system.
[0021] Figure 1 This is the framework diagram of the multi - protocol data acquisition method. Programs 1 to n are each program based on the supported protocols running in the embedded system, such as programs based on their respective communication protocol frameworks like lidar, millimeter - wave programs, visual perception programs, etc. The data disk - writing program is a PC or server program, and the intermediate communication link can be Ethernet or short - distance high - speed transmission devices such as PCIE.
[0022] Figure 2 This is the data processing flow chart of this method. In the data flow, it is possible to discover the possibility of other programs in the network sending data through subscription or active discovery, save and subscribe to these topics that may send data. After other programs send data, this program will actively receive the data and further process the data, such as setting information such as length, type, data, etc., then repack the data, and encode the data frame to ensure that the encoded data can be reversely parsed when written to a file. The packed data will be transmitted through channels such as Ethernet or PCIE. On the server side, after the receiving process receives the data, it will encode according to the data frame to keep the order consistent with the data before sending. Finally, after confirming that the data is correct, it will be written into a file.
[0023] In the specific implementation process of the above embodiments, step S1: Sensor data acquisition mainly involves obtaining raw data in real time from multiple sensors. The sensors may include, but are not limited to: lidar, millimeter-wave radar, inertial measurement unit (IMU), positioning module (GNSS / RTK), camera, ultrasonic sensor, etc. The data formats and communication protocols output by each type of sensor may vary. For example, some sensors output binary data through serial ports or CAN buses, some output UDP packets through Ethernet, and some output structured messages through high-level communication protocols such as ZMQ and DDS.
[0024] To achieve effective access to data, first, the output data stream of the sensor needs to be obtained through an interface module, such as a driver library or middleware. Each frame of data should include a device timestamp, the content of the raw data, and preliminary communication meta-information, such as frame length, data header, etc. The data acquisition module needs to run stably at a high frequency, generally 10Hz - 100Hz, to ensure the integrity of the data and no frame loss.
[0025] For step S2: Protocol identification and adaptation, since the communication protocols and data formats adopted by different manufacturers and different sensors vary greatly, to ensure unified processing, this method designs a protocol identification and adaptation mechanism. The protocol identification module can automatically identify the type of communication protocol used by the current data by analyzing the data frame header information, frame structure characteristics, flag bits, key fields, etc. For example, it can identify whether the current data comes from ZMQ, DDS, CAN, or a certain manufacturer's custom protocol. Once the protocol type is identified, the corresponding "protocol adaptation module" is loaded or called. This module is designed in a plug-in structure and can parse data fields, extract key parameters for different protocol structures, and convert them into a unified intermediate data format for use by subsequent encapsulation and processing modules. Through this mechanism, the system can flexibly adapt to a multi-protocol environment and improve the scalability and versatility of the acquisition system.
[0026] To ensure the consistency of multi-source data in the time dimension, the system immediately performs unified timestamp correction on the data after data acquisition is completed. This system uses a unified global time source, such as the Network Time Protocol (NTP), the Precision Time Protocol (PTP), or GNSS timing as a reference clock to ensure that the timestamps of all data frames can be aligned to the unified time base of the system.
[0027] Step S3: Timestamp synchronization processing. If the original sensor has its own timestamp, the system will correct it according to the time offset from the global clock; if there is no timestamp, the acquisition module will directly supplement it according to the reception time and attach a time label in a unified format. This timestamp is recorded with nanosecond-level precision and is accompanied by a time synchronization flag bit to ensure the timing accuracy of subsequent data fusion and comparison.
[0028] Step S4: Unified encapsulation protocol processing. After protocol adaptation and time synchronization are completed, all data is encapsulated in a unified structure. This encapsulation protocol is custom-designed by this method, and the data frame structure contains the following fields: protocol identifier (used to mark the data source or format), device type code, timestamp, payload (i.e., the core data of the sensor), data length, optional extension fields (such as channel number, transmission sequence number, etc.).
[0029] Through the unified encapsulation format, various heterogeneous data can be uniformly processed, decoded, and recognized in the downstream module, improving the data compatibility and decoupling ability of the overall system.
[0030] Step S5: Data encryption and integrity verification. During the encapsulation process, this method encrypts and compresses the collected data according to the configuration or data sensitivity level. Symmetric encryption algorithms can be used for encryption, such as AES-128, AES-256, and algorithms such as ZIP, ZSTD, etc. can be used for compression. The encryption and compression status bits are marked in the encapsulation frame to facilitate correct decryption and decompression at the receiving end. At the same time, to ensure the integrity and anti-tampering ability of the data during transmission, this method calculates and attaches a checksum to each frame of encapsulated data. Common verification methods include CRC32, SHA256, etc. This checksum can be used at the receiving end to automatically verify data integrity and prevent errors or attacks during transmission.
[0031] Step S6: Data transmission. The encapsulated data can be sent to the processing server or local recording module through multiple high-speed channels. Common transmission channels include: ZMQ asynchronous message bus, PCIe direct connection channel, Gigabit / 10 Gigabit Ethernet UDP / TCP data stream, DDS middleware. This method can select the transmission method according to the bandwidth situation and real-time requirements. The original encapsulation structure is retained during the transmission process so that the receiving end can directly identify, unpack, and verify. This mechanism is applicable to various scenarios such as single machine, multi-machine, multi-board card, and multi-channel.
[0032] Step S7: Data storage and management. The data transmitted to the backend server will be unpacked, verified, and classified by the receiving module and saved to the local or distributed storage system. Each data file is indexed by metadata such as task number, sensor type, timestamp, etc., supporting fast positioning and batch retrieval. The storage format can be the original binary encapsulation (.bin), structured data file (.jsonl, *.rosbag2), or dedicated database storage. The system supports functions such as compressed storage, automatic archiving, data backfilling, and incremental synchronization to ensure the accessibility, traceability, and version controllability of the data during long-term use.
[0033] The method provided by the above embodiments has the following features: strong protocol compatibility and adaptability. Through protocol adaptive design, it can automatically identify and adapt to a variety of different communication protocols, such as ZMQ, DDS, ROS2, etc., and convert data of different protocols into a unified format for processing. This design greatly enhances the compatibility of the system, avoids the difficulties in system integration caused by inconsistent protocols, and can support multiple data streams from different manufacturers and devices. It improves data consistency and time synchronization. Through custom encapsulation protocols and timestamp synchronization mechanisms, it ensures the consistency of time stamps during the data acquisition process of each sensor and device. Even if different devices use different protocols, it can ensure data synchronization, avoid data deviation problems caused by inconsistent timestamps in traditional solutions, and improve the integrity and reliability of data. It has efficient data transmission and storage management. This method supports multiple transmission protocols, including Ethernet and PCIE protocols, and can efficiently transmit large-scale data, avoiding data loss or transmission delay problems caused by insufficient network bandwidth in traditional solutions. At the same time, through a unified data encapsulation format, it simplifies the storage management of data, makes the access and analysis of data more efficient, and reduces the complexity of management and maintenance. It can be seen that the above embodiments highlight the innovation and advantages of this method in aspects such as protocol adaptation, data consistency and synchronization, and big data transmission efficiency, and can significantly improve the data acquisition efficiency and data quality of the autonomous driving system.
[0034] During the implementation process of the above embodiments, the multi-protocol encapsulation mechanism adopted aims to integrate the data of different sensors or software platforms under a unified protocol framework, and achieve data consistency and integrity by means of custom data encapsulation protocols.
[0035] During the construction of the unified protocol framework, an innovative development method of underlying compatible plugins is adopted. This method is based on the full consideration of the system for the interface characteristics of various sensors and the diversity of communication protocols. Each type of sensor or software platform may have a unique data output format and communication requirements. For example, some sensors use the ZMQ communication protocol for data transmission, while others use FastDDS; some software platforms output data in JSON format, while other platforms may use the ProtoBuf format.
[0036] The underlying compatible plugins customize specific adaptation modules for each sensor or software platform according to these differences. These adaptation modules are like "interpreters" that can convert the original data output by the sensors or software platforms according to the requirements of the unified protocol framework. They are not only responsible for data format conversion, but also can handle underlying technical issues such as communication rate matching and signal level conversion. In this way, the system can seamlessly connect various different types of sensors and software platforms, greatly enhancing the compatibility and scalability of the system.
[0037] Table 1: The unified encapsulation protocol used contains the following fields. Among them, the check algorithm identifier, encryption identifier, reserved field, and checksum can be used as extended fields, and the digital code is the bit length of the internal parameter occupied:
[0038] Table 2: The definitions of each protocol name are as follows:
[0039] For example: [Protocol header]; 00000001 / / Protocol v1.0; 0001 / / Lidar type; 5F3A7B1D00000000 / / 2024-07-20 08:30:00.000 UTC; 00000400 / / 1024-byte data; 00 / / CRC32 check; 01 / / AES encryption; 0000 / / Reserved field; [Payload]; (Encrypted 1024-byte point cloud data); [Checksum]; A1B2C3D4 / / CRC32 checksum value.
[0040] This custom encapsulation protocol covers multiple key information elements, including sensor data, timestamp, protocol identifier, checksum, and encrypted data, etc.
[0041] Sensor data: This is the actual collected data from various sensors or software platforms. For example, images collected by camera sensors, point cloud data obtained by lidar sensors, configuration parameters generated by software platforms, etc.
[0042] Timestamp: Based on UTC, accurate to nanoseconds. The existence of the timestamp gives the data an identification in the time dimension, enabling clear tracing of the generation order and time correlation of the data during data processing and analysis. This is of crucial significance for application scenarios that require analyzing the trend of data over time, such as environmental monitoring, equipment operation status tracking, etc.
[0043] Protocol Identifier: Occupies a specific number of bytes and is used to clarify the protocol type followed by this data. Different types of sensors or software platforms may adopt different communication protocols or data specifications. The protocol identifier enables the system to quickly identify the data source and the corresponding processing method. For example, the identifier "0x01" may represent the ZMQ protocol of a certain type of image sensor, and "0x02" represents the FastDDS communication protocol of a specific lidar.
[0044] Checksum: Calculated through a specific checksum algorithm (such as the CRC32 algorithm) for sensor data, timestamp, protocol identifier, etc. The role of the checksum is to detect whether data has errors during data transmission and storage. After receiving the data, the receiving party will recalculate the checksum according to the same checksum algorithm and compare it with the received checksum. If the two are consistent, it indicates that the data has not had an error during transmission or storage; if they are inconsistent, it means the data may have been damaged and needs to be retrieved again.
[0045] Encrypted Data: Considering the security and privacy of data, for some sensitive data, such as data involving trade secrets or key device operating parameters, specific encryption algorithms are used for encryption processing. The encrypted data exists in the encapsulation protocol in ciphertext form and can only be restored to the original data when the corresponding decryption key is available. This effectively prevents data from being stolen or tampered with during transmission and storage, ensuring data security.
[0046] The acquisition data of each sensor is packaged through the above unified encapsulation format. During the packaging process, each information element is combined in an orderly manner strictly in accordance with the regulations of the encapsulation protocol. For example, first place the protocol identifier, then the timestamp, sensor data, then the checksum, and finally the encrypted data (if any). At the same time, clearly mark the timestamp and protocol type of the data to ensure the traceability and easy identification of the data throughout the system.
[0047] Through this multi-protocol encapsulation method, different sensor data can be stored in the same file. Since all data follows a unified protocol framework and encapsulation format, this ensures data consistency. Regardless of the type of sensor or software platform from which the data comes, during storage and processing, it can be parsed and operated according to the same rules, avoiding compatibility issues caused by differences in data formats.
[0048] Meanwhile, the existence of the checksum and encrypted data ensures the integrity and security of the data. The checksum can promptly detect errors in the data during transmission or storage, while the encrypted data prevents the data from being illegally obtained and tampered with. This multi-protocol encapsulation mechanism provides a solid data foundation for the entire multi-type sensor access system, enabling the system to operate efficiently, stably, and securely in all aspects such as data acquisition, storage, transmission, and processing.
[0049] Data synchronization mechanism: To address the issue of inconsistent timestamps for different sensors, this embodiment provides a data synchronization mechanism based on a global clock, such as a GPS clock, an NTP clock, or a synchronous clock protocol. All collected sensor data is uniformly marked with the global clock to ensure the time synchronization of multi-sensor data. The time synchronization uses a high-precision synchronization protocol, such as PTP, NTP, etc., to ensure high-precision time synchronization even in a distributed system.
[0050] Efficient data transmission: To address the problem of real-time transmission of large amounts of data, this embodiment provides a multi-channel transmission solution based on the PCIE protocol, the Ethernet protocol, and the ZMQ protocol. For large-scale data transmission, the PCIE protocol can provide high-bandwidth and low-latency data transmission capabilities to ensure that large amounts of data can be quickly transmitted to the data processing server or storage device. At the same time, using the ZMQ protocol as the standard protocol for data transmission can ensure the stability and real-time nature of data transmission in a distributed system.
[0051] Data storage and management: All collected data will be stored according to a custom encapsulation protocol and managed using a standardized data format. The data storage uses a distributed storage system, such as NAS or a distributed file system, to ensure that massive amounts of data can be efficiently stored and managed. During the storage process, the data will be stored in slices, and each data block will carry complete timestamp and check information to ensure the integrity and traceability of the data.
[0052] Protocol adaptive design: To solve the problem of protocol compatibility for multiple sensors and data sources, this embodiment introduces a "protocol adaptive design" solution, and the specific solution is as follows: Protocol automatic detection and identification: During the data acquisition process, the method of this embodiment can automatically identify the communication protocol used by the connected device or sensor through a protocol detection mechanism. By dynamically scanning the protocol identifier or marker information in the data packet, the system can automatically identify the protocol type. Through the protocol adaptive module, the system can select the most suitable data encapsulation and transmission method according to the protocol type of the sensor or software.
[0053] Protocol Adaptation Layer: The system designs a Protocol Adaptation Layer, which is responsible for converting and encapsulating data of different protocols. This adaptation layer can convert the input protocol format into a unified custom encapsulation format according to the input protocol format. The protocol adaptation layer supports common protocols such as ZMQ, DDS, ROS2, CAN, etc., and can also flexibly add new protocol support modules according to requirements.
[0054] Protocol Compatibility and Extensibility: To ensure the extensibility and long-term compatibility of the system, the protocol adaptive design of this embodiment adopts a modular architecture. Each new protocol can be added to the system through a simple plug-in mechanism without large-scale modification of the entire system. The protocol adaptation layer adopts an interface-oriented design, which can quickly adapt to new protocols or updated versions of existing protocols, maintaining the openness and flexibility of the system.
[0055] Automatic Protocol Switching and Optimization: In a multi-sensor system, the protocol adaptive design can not only identify the currently used protocol, but also dynamically adjust the used protocol according to the system load, data volume, and network environment. For example, when the sensor data volume is large, the system can automatically switch to the efficient PCIE protocol; when the network environment is unstable, the system can switch to the ZMQ protocol that is more suitable for low-bandwidth and high-latency environments. This adaptive mechanism can adjust the protocol usage strategy according to the actual situation, ensure the stable operation of the system, and optimize the data transmission performance.
[0056] Protocol Identification and Compatibility Verification: To ensure that data of different protocols can be correctly encapsulated and transmitted, this embodiment introduces a protocol identification and verification mechanism. Each data packet will carry a protocol identifier (Protocol Identifier, PID). During data transmission and storage, this identifier can help the receiving end correctly decode and parse the data. At the same time, the protocol adaptive module also has a verification function, which can verify whether the data conforms to the expected protocol format when receiving the data, avoiding data loss or errors caused by protocol mismatch.
[0057] Protocol Dynamic Update and Version Control: This embodiment supports protocol version control and dynamic update. When a certain protocol version changes or is updated, the protocol adaptation layer can adapt and optimize according to the new protocol version without large-scale modification of the entire system. The system can automatically switch to a compatible adaptation module according to the protocol version of the sensor or device to ensure the correctness of data processing.
[0058] The differences between the protocol adaptation design and the prior art, as well as the significant innovations, include: Automatic protocol recognition and conversion: The prior art usually relies on manual configuration and static protocol settings, while the present invention can automatically recognize and adapt to the protocols of different sensors during runtime, greatly reducing the configuration complexity during system integration. Flexibility and scalability of the protocol adaptation layer: Through the modular design of the protocol adaptation layer, the present invention can add support for new protocols in the future without modifying the core system, maintaining the high scalability and long-term compatibility of the system. Dynamic protocol switching: Existing systems usually use fixed protocol transmission methods, while the present invention can automatically select the best protocol according to real-time data load, transmission conditions, etc. through protocol adaptation design, improving the efficiency and stability of data transmission. Compatibility verification and protocol identification: Through the protocol identification and compatibility verification mechanism, the present invention can ensure that data of different protocols can be correctly transmitted and decoded, avoiding data loss or parsing errors caused by inconsistent protocols.
[0059] In some embodiments, a multi-protocol based data acquisition system is further provided, which includes: A data acquisition module, configured to obtain raw data from sensors in real time; A protocol detection and adaptation module, configured to automatically identify the type of communication protocol used by the current data by analyzing the data frame header information, frame structure characteristics, flag bits, and key fields, and after successful identification, load or call the corresponding adaptation protocol; A time synchronization processing module, configured to perform unified timestamp correction or supplementation on the obtained raw data; A unified encapsulation protocol processing module, configured to encapsulate the data after protocol adaptation and timestamp synchronization processing according to a unified structure, and the encapsulated data frame structure includes fields such as protocol identifier, unified timestamp, payload, data length, data type identifier, and optional extension fields; A data encryption and integrity verification module, configured to perform encryption and compression processing on the acquired data according to the configuration or data sensitivity level during the encapsulation process, and calculate and append a check code to each frame of encapsulated data; A data transmission module, configured to transmit the encapsulated data to a processing server or a local recording module; A data storage and management module, configured to unpack, verify, and classify and save the received transmission data to a local or distributed storage system.
[0060] In the specific implementation process of this system, protocol adaptation design is adopted, which mainly involves the protocol detection and adaptation module, the unified encapsulation protocol processing module, and the data storage and management module. Among them, the protocol detection and adaptation module includes a protocol detection sub-module and a protocol adaptation module.
[0061] Protocol Detection Sub-module, which is used to automatically detect and identify the communication protocol types of connected devices or sensors, such as: ZMQ, DDS, ROS2, CAN, etc. Its working principle is as follows: The protocol detection sub-module identifies the communication protocol used by the sensor by analyzing the characteristic identifiers in the transmission data packets, such as protocol headers, version numbers, or specific data formats; adopts an algorithm based on signal strength and transmission timing to automatically infer the used protocol. This algorithm can automatically select the protocol type according to the characteristic markers of the data packets based on certain rules; supports automatic identification of protocol versions to ensure that even different versions of the protocol can be correctly identified. The implementation process is as follows: Each time data is accessed, the protocol detection sub-module will first scan the transmission headers in the data stream and match them with the built-in protocol library according to the structure and characteristics of the data; if the protocol is a standard protocol, such as: ZMQ, DDS, etc., it will directly enter the next protocol adaptation; if the protocol is a custom protocol, the protocol will be automatically identified through an algorithm and corresponding adaptation rules will be generated.
[0062] Protocol Adaptation Sub-module, which is used to automatically select and call the corresponding protocol adapter according to the protocol type identified by the protocol detection module for protocol conversion and data encapsulation. Its working principle is as follows: The protocol adaptation sub-module is responsible for converting the data of different protocols into a unified format supported by the system, that is, a custom encapsulation protocol, and performing necessary time synchronization processing; for each supported protocol, such as ZMQ, DDS, ROS2, etc., there is a corresponding adapter module, and these adapter modules are responsible for handling the data conversion and encapsulation of different protocols respectively; the protocol adapter parses, converts, and repackages the received data packets to convert the original protocol format into the unified custom encapsulation format of the system to ensure protocol compatibility. The implementation process is as follows: Each protocol adapter module will implement specific interfaces to receive the original data stream and process it, specifically including parsing the data packet: parsing the data packet header and payload according to the protocol specification; timestamp synchronization: performing timestamp synchronization processing on the data to ensure the time consistency of all sensor data; each adapter module supports configuration management and can be extended, customized, or modified according to requirements.
[0063] The unified encapsulation protocol processing module includes a protocol encapsulation sub-module, which is used to perform unified encapsulation on the received data to ensure that the data of different protocols can be correctly processed in the same system. Its working principle is as follows: All data accessing the system will enter the protocol encapsulation sub-module after being adapted by the protocol adaptation module for unified data encapsulation. Through this encapsulation protocol, it can ensure that the data of different protocols is transmitted in a unified format, avoiding parsing problems caused by inconsistent data formats. The implementation process: The protocol encapsulation sub-module performs identification, encryption, and encapsulation operations on each received data packet and stores it in the file system or network. The format of the encapsulation protocol is as Figure 3As shown. After the data packet is encapsulated, it will be transferred to the data transmission module for further processing or transmission.
[0064] The data storage and management module includes a protocol management sub-module for managing all protocols supported by the system, including protocol configuration, version control, protocol update, and management. Its working principle is as follows: The protocol management sub-module is responsible for centralized management of all protocols in the system, providing protocol version control, update, and maintenance functions; The protocol management sub-module includes functions such as protocol registration, protocol version management, and protocol plugin management. Each time a new protocol or protocol version is updated, it can be managed through this module. The implementation process is as follows: The protocol management sub-module manages the detailed information of all protocols through a configuration file, including protocol identifiers, protocol versions, protocol plugins, etc.; Supports hot-plugging of protocol plugins and can dynamically load new protocol adapters or update protocol versions without affecting the system stability; This module also provides protocol status monitoring and logging functions, which can monitor the running status of the protocol adaptation layer in real time and record the operation logs of the system.
[0065] In the above embodiments, the present system is also used to run and implement the steps in the above method embodiments.
[0066] It should be noted that although the above embodiments have been described in this article, the patent protection scope of the present invention is not limited thereby. Therefore, based on the innovative concept of the present invention, changes and modifications made to the embodiments described in this article, or equivalent structural or equivalent process transformations made using the content of the specification and drawings of the present invention, directly or indirectly applying the above technical solutions to other related technical fields, are all included in the patent protection scope of the present invention.
Claims
1. A data acquisition method based on multiple protocols, characterized in that The following steps are involved: S1, sensor data acquisition, obtains raw data from sensors in real time; S2, protocol identification and adaptation, automatically identifies the type of communication protocol used by the current data by analyzing the data frame header information, frame structure characteristics, flag bits, and key fields. After successful identification, load or call the corresponding adaptation protocol; S3, timestamp synchronization processing, unified timestamp correction or supplement for the acquired raw data; S4, unified encapsulation protocol processing, encapsulates the data after protocol adaptation and timestamp synchronization according to a unified structure, and the encapsulated data frame structure contains the fields protocol identifier, device type code, timestamp, data length, payload and extension field; S5, data encryption and integrity check: during the encapsulation process, the collected data is encrypted and compressed according to the configuration or data sensitivity level, and a checksum is calculated and added to each frame of encapsulated data; S6, data transmission, the encapsulated data is transmitted to the processing server or the local recording module; S7, data storage and management, after receiving the transmitted data, unpack, verify and classify it and save it in the local or distributed storage system.
2. The data acquisition method based on multiple protocols according to claim 1, wherein: The sensor includes a laser radar, a millimeter-wave radar, an inertial measurement unit, a positioning module, a camera and / or an ultrasonic sensor. Each frame of data in the sensor's data stream contains a device timestamp, raw data content, and preliminary communication metadata.
3. The data acquisition method based on multiple protocols according to claim 1, wherein Step S2 also includes: in the process of collecting raw data, automatically identifying the communication protocol used by the connected sensor through a protocol detection mechanism, and automatically identifying the protocol type by dynamically scanning the protocol identifier or tag information in the data packet.
4. The data acquisition method based on multiple protocols according to claim 1, characterized in that: In step S3, the timestamp synchronization process includes uniformly marking all collected raw data by setting a global clock to ensure the time synchronization of sensor data. The time synchronization adopts a high-precision synchronization protocol.
5. The data acquisition method based on multiple protocols according to claim 4, wherein Step S3 also includes: if the raw data of the sensor has its own timestamp, it is corrected according to the time offset with the global clock; if there is no timestamp, a time tag in a unified format is supplemented and marked according to the receiving time. The timestamp is recorded with nanosecond accuracy and is accompanied by a time synchronization flag.
6. The data acquisition method based on multiple protocols according to claim 1, wherein: Step S4 also includes setting up a protocol adaptation layer, which is responsible for converting and encapsulating data of different protocols. The protocol adaptation layer can convert the input protocol format into a unified custom encapsulation format. The protocol adaptation layer adopts an interface-oriented design and can adapt to new protocols or updated versions of existing protocols.
7. The data acquisition method based on multiple protocols according to claim 1, wherein: In step S4, the extended field includes a verification algorithm identifier, an encryption identifier, a reserved field, and a verification code; The bit length of each field is as follows: protocol identifier is 4, device type code is 2, timestamp is 8, data length is 4, verification algorithm identifier is 1, encryption identifier is 1, reserved field is 2, payload is N, and check code is 4 / 32.
8. The data acquisition method based on multiple protocols according to claim 1, wherein: In step S6, data transmission adopts a multi-channel transmission method of PCIE protocol, Ethernet protocol and ZMQ protocol.
9. The data acquisition method based on multiple protocols according to claim 1, characterized in that: In step S7, data storage and management include storing all the collected data according to a custom encapsulation protocol and managing it in a standardized data format. The data storage uses a distributed storage system. During the storage process, the data is stored in a sharded manner, and each data block carries a complete timestamp and check information.
10. A multi-protocol-based data acquisition system, characterized in that, Including: A data acquisition module for obtaining raw data from sensors in real time; A protocol detection and adaptation module for automatically identifying the communication protocol type used by the current data by analyzing the data frame header information, frame structure characteristics, flag bits, and key fields. After successful identification, the corresponding adaptation protocol is loaded or called; A time synchronization processing module for uniformly correcting or supplementing the timestamps of the obtained raw data; A unified encapsulation protocol processing module for encapsulating the data after protocol adaptation and timestamp synchronization processing according to a unified structure. The encapsulated data frame structure includes fields such as protocol identifier, unified timestamp, payload, data length, data type identifier, and optional extension fields; A data encryption and integrity verification module for encrypting and compressing the collected data according to the configuration or data sensitivity level during the encapsulation process, and calculating and attaching a check code to each frame of encapsulated data; A data transmission module for transmitting the encapsulated data to a processing server or a local recording module; A data storage and management module for unpacking, verifying, and classifying the received transmission data and saving it to a local or distributed storage system.
Citation Information
Cited By
Universal mixed signal acquisition and access system for ships and warships
CN120825527A
A mixed signal universal acquisition access system for a ship
CN120825527B
Mine communication and security collaborative management and control system based on multi-source fusion perception
CN122227191A