[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2021134418A1 - Data checking method and apparatus - Google Patents

Data checking method and apparatus Download PDF

Info

Publication number
WO2021134418A1
WO2021134418A1 PCT/CN2019/130369 CN2019130369W WO2021134418A1 WO 2021134418 A1 WO2021134418 A1 WO 2021134418A1 CN 2019130369 W CN2019130369 W CN 2019130369W WO 2021134418 A1 WO2021134418 A1 WO 2021134418A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
message
syndrome
rtps protocol
check code
Prior art date
Application number
PCT/CN2019/130369
Other languages
French (fr)
Chinese (zh)
Inventor
邓文彬
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201980102869.8A priority Critical patent/CN114788199A/en
Priority to PCT/CN2019/130369 priority patent/WO2021134418A1/en
Publication of WO2021134418A1 publication Critical patent/WO2021134418A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received

Definitions

  • the embodiments of the present application relate to the field of communication technologies, and in particular, to a data verification method and device.
  • Intelligent driving systems rely on data from many sensors, such as data generated by lidar, millimeter wave radar, and ultrasonic radar. These sensors act as the "eyes” and “nose” of the car, perceiving changes in the outside world. External data needs to pass through the transmission line to reach the central control system of the intelligent driving system (equivalent to the human brain). With the improvement of sensor performance, more and more data are acquired by sensors. During the process of data transmission to the central control system, due to the unreliability of both software and hardware, the data may be tampered with. The central control system will give wrong auto-driving instructions based on the wrong data, which will endanger the lives of passengers.
  • the check code is usually calculated by software, and the calculation of the check code will slow down if the check code calculation method is more complicated.
  • the calculation of the check code by the software method requires the computing resources of a central processing unit (CPU). Due to the limited computing resources of the CPU, the data length corresponding to the check code calculated by the software is limited to a certain extent.
  • the embodiments of the present application provide a data verification method and device, which are used to improve the data verification capability and solve the end-to-end ultra-long data packet data verification problem.
  • an embodiment of the present application provides a data verification method, including: a first device obtains a first verification code corresponding to the first data, where the first verification code is the first verification code in the first device.
  • the hardware module calculates that the first data is data collected by the first device; the first device generates a syndrome message according to the first check code; the first device sends a syndrome message of the first data to the second device.
  • the first device sends the syndrome message of the first data to the second device through the physical link.
  • the use of hardware modules to calculate the check code can increase the speed of the check code calculation, and the hardware calculation of the check code will not be limited by the data length, which can improve the data check ability and realize the Effective verification of data packets, thereby solving the problem of data verification of ultra-long packets.
  • the foregoing method further includes: the first device generates at least one real-time publish-subscribe (RTPS) protocol message according to the first data;
  • the syndrome message of one data is inserted into each of the at least one RTPS protocol message; at this time, the first device sends the syndrome message of the first data to the second device may be: the first device sends at least one syndrome message to the second device Each message in the RTPS protocol message is sent to the second device in turn.
  • extending the syndrome message to the RTPS protocol can enhance the standard RTPS protocol capability and improve the data verification capability of the RTPS protocol.
  • the first device generating at least one RTPS protocol packet according to the first data may include: if the data length of the first data is greater than or equal to the first threshold, the first device generates the at least one RTPS protocol packet according to the first data One piece of data generates multiple RTPS protocol packets, where multiple RTPS protocol packets are fragmented packets; if the data length of the first data is less than the first threshold, the first device generates one RTPS protocol packet according to the first data The RTPS protocol message is a non-fragmented message. In this implementation manner, when the data length exceeds the first threshold, the first data may be transmitted in fragments.
  • obtaining the first check code by the first device may include: if the data length of the first data is greater than or equal to the second threshold, the first device controls the first hardware module to A data is calculated to obtain the first check code.
  • the syndrome message of the first data may further include at least one of a data length, a timeout parameter, and a data sequence number.
  • the first device is a vehicle-mounted sensor
  • the second device is a vehicle-mounted master control device.
  • an embodiment of the present application provides a data transmission method, including: a second device receives a syndrome message of first data sent by a first device, where the first data is data collected by the first device; The second device extracts the first check code from the syndrome message of the first data; the second device obtains the second check code, where the second check code is the first check code calculated by the second hardware module in the second device The check code corresponding to the second data, the second data is the data received by the second device from the first device; the second device performs data check according to the first check code and the second check code.
  • the hardware module is used to calculate the check code and perform data check, which can increase the speed of check code calculation, and the hardware calculation of check code does not receive the limitation of the data length, which can improve the data check Ability to achieve effective verification of ultra-long data packets, thus end-to-end data verification of ultra-long data packets.
  • the second device receiving the syndrome message of the first data sent by the first device includes: the second device receives a real-time publish and subscribe RTPS protocol message sent by the first device; The second device extracts the syndrome message of the first data from the RTPS protocol message.
  • the second device extracts the syndrome message of the first data from the RTPS protocol message, including: the second device judges the RTPS according to the syndrome message in the RTPS protocol message Whether the protocol message is a fragmented message; if the RTPS protocol message is a fragmented message, the second device determines multiple fragmented messages corresponding to the first data; the second device extracts any one of the multiple fragmented messages The syndrome message in the message obtains the syndrome message of the first data.
  • the above method further includes: if the RTPS protocol message is a non-fragmented message, the second device determines an RTPS protocol message corresponding to the first data; the second device extracts the first data A syndrome message in an RTPS protocol message corresponding to one data obtains a syndrome message of the first data.
  • the second device judges whether the RTPS protocol message is a fragmented message according to the syndrome message in the RTPS protocol message, including: if the checksum in the RTPS protocol message The sub-message and the syndrome message in the upper and lower messages of the RTPS protocol message are different, and the second device determines that the RTPS protocol message is a non-fragmented message; if the syndrome message in the RTPS protocol message is the same as the RTPS protocol Any one of the syndrome messages in the upper and lower messages of the message is the same, and the second device determines that the RTPS protocol message is a fragmented message.
  • the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
  • the second device performs data verification according to the first check code and the second check code, including: if the first check code is equal to the second check code, the second The device determines that the data verification is successful; otherwise, the second device determines that the data verification fails.
  • the first device is a vehicle-mounted sensor
  • the second device is a vehicle-mounted main control device.
  • an embodiment of the present application provides a verification device, including: a first hardware module, configured to calculate a first verification code corresponding to the first data, where the first data is collected by the first device Processing module, used to obtain the first check code and generate the syndrome message of the first data according to the first check code; sending module, used to send the syndrome message of the first data to the second device, Wherein, the syndrome message of the first data is used for the second device to perform data verification.
  • the processing module is further configured to: generate at least one real-time publish and subscribe RTPS protocol message according to the first data; insert the syndrome message of the first data into the at least one RTPS protocol message
  • the sending module is specifically configured to: send each of the at least one RTPS protocol message to the second device in turn.
  • the processing module is specifically configured to: if the data length of the first data is greater than or equal to the first threshold, generate multiple RTPS protocol messages according to the first data, wherein multiple RTPS The protocol message is a fragmented message; if the data length of the first data is less than the first threshold, the first device generates an RTPS protocol message according to the first data, where the RTPS protocol message is a non-fragmented message.
  • the processing module is specifically configured to: if the data length of the first data is greater than or equal to the second threshold, control the first hardware module to calculate the first check code.
  • the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
  • the verification device is a vehicle-mounted sensor
  • the second device is a vehicle-mounted master control device.
  • an embodiment of the present application provides a verification device, including: a second hardware module for calculating a verification code corresponding to the second data, wherein the second data is received by the second device from the first device Received data; receiving module, used to receive the syndrome message of the first data sent by the first device, where the first data is data collected by the first device; processing module, used to obtain the syndrome from the first data Extract the first check code from the message, obtain the second check code, and perform data check according to the first check code and the second check code, where the second check code is the second hardware in the second device Module.
  • the processing module is further configured to: generate at least one real-time publish and subscribe RTPS protocol message according to the first data; insert the syndrome message of the first data into the at least one RTPS protocol message
  • the sending module is specifically configured to: send each of the at least one RTPS protocol message to the second device in turn.
  • the processing module is specifically configured to: if the data length of the first data is greater than or equal to the first threshold, generate multiple RTPS protocol messages according to the first data, wherein multiple RTPS The protocol message is a fragmented message; if the data length of the first data is less than the first threshold, the first device generates an RTPS protocol message according to the first data, where the RTPS protocol message is a non-fragmented message.
  • the processing module is specifically configured to: if the data length of the first data is greater than or equal to the second threshold, control the first hardware module to calculate the first check code.
  • the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
  • the verification device is a vehicle-mounted sensor
  • the second device is a vehicle-mounted master control device.
  • an embodiment of the present application provides a verification device, including: a processor, the processor is coupled with a memory, the memory is used to store operation instructions; the processor is used to call the operation instructions , To perform the method described in any one of the above-mentioned first aspects.
  • the verification device further includes: a first hardware module configured to calculate a first verification code corresponding to the first data.
  • an embodiment of the present application provides a verification device, including: a processor, the processor is coupled with a memory, the memory is used to store operation instructions; the processor is used to call the operation instructions , To perform the method described in any one of the above-mentioned second aspects.
  • the verification device further includes: a second hardware module configured to calculate a second verification code corresponding to the second data.
  • an embodiment of the present application provides a computer storage medium that stores operating instructions in the computer storage medium, and when it runs on a computer, the computer executes the method described in the first aspect.
  • an embodiment of the present application provides a computer storage medium.
  • the computer storage medium stores operating instructions, which when run on a computer, cause the computer to execute the method described in the second aspect.
  • the embodiments of the present application provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method described in the first aspect.
  • the embodiments of the present application provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method described in the second aspect.
  • FIG. 1 is a schematic diagram of a system framework structure provided in an embodiment of this application.
  • Figure 2(a) is a schematic diagram of an embodiment of a data verification method provided in an embodiment of the application
  • FIG. 2(b) is a schematic diagram of a structure of a hardware module in the first device provided in an embodiment of the application;
  • FIG. 3 is a schematic diagram of a structure of a verification device in an embodiment of the application.
  • FIG. 4 is another schematic diagram of the structure of the verification device in an embodiment of the application.
  • FIG. 5 is another schematic diagram of the structure of the verification device in an embodiment of the application.
  • FIG. 6 is a schematic diagram of another structure of the verification device in an embodiment of the application.
  • the embodiments of the present application provide a data verification method and device, which are used to improve the data verification capability and solve the end-to-end ultra-long data packet data verification problem.
  • the technical solutions in the embodiments of the present application are applicable to various communication systems, and are especially applicable to data verification scenarios of an automatic driving system.
  • Autonomous driving systems rely on many sensors to obtain external data, such as lidar, millimeter wave radar, and ultrasonic radar.
  • a message verification mechanism is required to ensure the accuracy of external data verification.
  • This application can be free from the data size limitation during the data verification process and enhance the end-to-end End data verification and verification capabilities.
  • Fig. 1 is a schematic diagram of a system framework structure provided in an embodiment of the application.
  • the system framework of the embodiment of the present application includes: a first device 101 and a second device 102, wherein data verification is performed between the first device 101 and the second device.
  • the first device 101 may be a sensor-end device, such as lidar, etc.
  • the second device 102 may be a vehicle-mounted master control device of the automatic driving system, such as a vehicle-mounted central control computer, a mobile data center ( mobile data center, MDC), etc.
  • Figure 2(a) is a schematic diagram of an embodiment of a data verification method provided in an embodiment of the application.
  • the data verification method in the embodiment of the present application includes:
  • a first device obtains a first check code corresponding to the first data, where the first check code is calculated by a first hardware device in the first device.
  • the first check code is a check code corresponding to the first data calculated by the first hardware module in the first device, and the first data refers to data sent by the first device to the second device. It should be understood that, compared with the calculation of the check code by the software module, the calculation of the check code by the hardware module has the advantages of fast calculation speed and large amount of calculation data. Among them, the first data is data collected by the first device; the first hardware module in the first device may be set in a built-in manner or may be set in an external manner.
  • Figure 2(b) is a schematic structural diagram of the first hardware module in the first device.
  • the hardware module structure shown in FIG. 2 may specifically be the first hardware module in the first device or the second hardware module in the second device below.
  • the hardware module 20 includes an input unit 207, a logic calculation unit 208, an output unit 209, and a timeout monitoring unit 210.
  • the input unit 207 is used to obtain the content of the message and the corresponding message parameters. Specifically, the data address and length of the message are input to the hardware module 20, and the input unit 207 can read the specified length from the corresponding data address.
  • the logic calculation unit 208 is configured to preset multiple check code calculation methods, such as a hash function, and can select a corresponding hash function for calculation according to the data length of the message to generate a hash value, that is, a check code.
  • the timeout monitoring unit 210 is used to monitor whether the time length for calculating the check code in the logic calculation unit 208 exceeds a preset time length.
  • the output unit 209 is used to output the check code generated by the logic calculation unit 208. It should also be noted that the hardware module 20 also needs to support the functions of automatic data analysis and calculation.
  • the composition structure of the above-mentioned hardware module 20 supports pipelines and has good performance.
  • the first device is a sensor such as a lidar.
  • the first data is data collected by the lidar and transmitted to the second device, such as a vehicle-mounted central control computer.
  • the first device to obtain the first check code may be: when the data length of the first data is greater than or equal to the second threshold, the first device controls the first hardware module to calculate the first check code corresponding to the first data .
  • the second threshold may be 4M.
  • CRC cyclic redundancy check
  • the calculation method for the first hardware module to calculate the first check code includes: hash value calculation algorithms such as CRC16, CRC32, CRC64, AES128, and SHA256.
  • the first device generates a syndrome message of the first data according to the first check code.
  • the first device generates a real-time publish and subscribe RTPS protocol message according to the first data, and inserts a syndrome message of the first data in the RTPS protocol message.
  • the syndrome message can be inserted into the header of the RTPS protocol message.
  • the first device generates at least one real-time publish and subscribe RTPS protocol message according to the first data, and further, the first device inserts the syndrome message of the first data into each of the at least one RTPS protocol message.
  • the first device sequentially sends each of the at least one RTPS protocol packet to the second device.
  • the first device generating at least one RTPS protocol message according to the first data may specifically include: the first device may determine whether the RTPS protocol message needs to be fragmented according to the data length of the first data. Specifically, if the data length of the first data is greater than or equal to the first threshold, the first device generates multiple (for example, N) RTPS protocol messages corresponding to the first data, and the N RTPS protocol messages carry the complete first One data, each RTPS protocol message carries part of the first data, each RTPS protocol message is inserted with the first check code, and N is an integer greater than or equal to 2. If the data length of the first data is less than the first threshold, the first device generates an RTPS protocol message corresponding to the first data, and the RTPS protocol message includes all the first data and inserts the first check code.
  • the first device may determine whether the RTPS protocol message needs to be fragmented according to the data length of the first data. Specifically, if the data length of the first data is greater than or equal to the first
  • the syndrome message of the first data may further include the data length corresponding to the first data, the timeout parameter, and the data sequence number.
  • the data length is the data length of the first data or the data length corresponding to a fragment of the RTPS protocol message, which is used for data integrity verification and verification of the reliability of the data.
  • the data sequence number is used to determine whether the RTPS protocol message is in an orderly receiving state.
  • the timeout parameter is used to determine the timeliness of the data.
  • a message format of the syndrome sub-message includes: a sub-message identification field, a hash function option field, a position offset field, a check code field, and an extension field.
  • the sub-message identification field is 8 bits, used to indicate the data sequence number
  • the hash function option field is used to indicate the calculation method of the check code, for example, the sequence number 0 indicates the AES128 algorithm, 1 indicates the SHA256 algorithm, and 2 indicates the CRC64 algorithm , 3 means CRC32 algorithm, 4 means CRC16 algorithm
  • the position offset field is used to indicate the offset of the next syndrome message position
  • the check code field is used to indicate the value of the first check code and the length of the check code field It can be between 64 bits and 256 bits
  • the extended field can store other extended data such as sensor type and sensor location.
  • the first device sends a syndrome message of the first data to the second device.
  • the first device sending the syndrome message of the first data to the second device may be: the first device sends an RTPS protocol message to the second device through a physical link, and the RTPS protocol message includes: the first data and the checksum Sub-message.
  • the physical link is used to transmit end-to-end data transmission and verification.
  • the physical link may be a CAN bus or an Ethernet interface for interconnection between the first device and the second device.
  • the second device extracts the first check code from the syndrome message of the first data.
  • the second device can obtain the syndrome message from any one of the multiple (such as the above-mentioned N) RTPS protocol messages, and then the second device receives the syndrome message Extract the first check code from.
  • the second device extracts the syndrome message of the first data from the RTPS protocol message, and then the second device extracts the first checksum from the syndrome message of the first data code.
  • the second device may determine whether the RTPS protocol message is a fragmented message. If the syndrome message in the RTPS protocol message and the syndrome message in the upper and lower messages of the RTPS protocol message are both If it is not the same, the second device determines that the RTPS protocol message is a non-fragmented message; if the syndrome message in the RTPS protocol message is the same as any one of the syndrome messages in the upper and lower messages of the RTPS protocol message, the second The device determines that the RTPS protocol packet is a fragmented packet.
  • the second device obtains the second check code.
  • the second device extracts the data in the N RTPS protocol messages and reorganizes the extracted data to obtain the second data.
  • the second device controls the second hardware module to calculate the second data corresponding to the second data. Two check code.
  • the second device extracts the second data from the RTPS protocol message, and the second device controls the second hardware module to calculate the second check code corresponding to the second data.
  • the second device performs data verification according to the first verification code and the second verification code.
  • the second device determines that the data verification is successful; otherwise, the second device determines that the data verification fails.
  • the second device may send a data retransmission request to the first device, and the data verification succeeds.
  • the hardware module is used to calculate the check code, which can increase the speed of the check code calculation, and the hardware calculation of the check code does not receive the limitation of the data length, which can improve the data check ability and realize the detection of ultra-long data packets. Effective verification, thus solving the data verification problem of ultra-long packets.
  • the calculation of the check code by the hardware module may not occupy the computing resources of the processor and save computing resources.
  • the verification device 300 includes: a processing module 301, a sending module 302, and a first hardware module 303.
  • the first hardware module 303 It is used to calculate the first check code corresponding to the first data, where the first data is the data collected by the check device 300; the processing module 301 is configured to perform the following operations: obtain the first check code and according to the first check code The check code generates a syndrome message, the first check code is the check code corresponding to the first data calculated by the first hardware module, and the first data is sent by the first device to the second device Data; sending module 302, used to send the syndrome message of the first data to the second device.
  • the processing module 301 is further configured to: generate at least one real-time publish and subscribe RTPS protocol message according to the first data; insert the syndrome message of the first data into the at least In each message in one RTPS protocol message; the sending module is specifically configured to: send each message in the at least one RTPS protocol message to the second device in turn.
  • the processing module 301 is specifically configured to: if the data length of the first data is greater than or equal to a first threshold, generate multiple RTPS protocol messages according to the first data, where: The multiple RTPS protocol messages are fragmented messages; if the data length of the first data is less than the first threshold, the first device generates an RTPS protocol message according to the first data, where: The RTPS protocol message is a non-fragmented message.
  • the processing module 301 is specifically configured to: if the data length of the first data is greater than or equal to a second threshold, control the first hardware module to calculate the first check code .
  • the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
  • the verification device 300 is a vehicle-mounted sensor, and the second device is a vehicle-mounted master control device.
  • the verification apparatus 300 may specifically be the aforementioned first device, and its respective component modules (processing module 301, sending module 302, and first hardware module 303) can be used to execute the first device in the foregoing method embodiment. All operations.
  • the verification device 400 includes: a receiving module 401, a processing module 402, and a second hardware module 403.
  • the second hardware module 403 is used to calculate a verification code corresponding to the second data, where the second data is the The data received by the second device from the first device;
  • the receiving module 401 is configured to receive the syndrome message of the first data sent by the first device, where the first data is collected by the first device Data;
  • processing module 402 used to extract the first check code from the syndrome message of the first data, obtain the second check code, and according to the first check code and the second check Code for data verification, where the second verification code is a second hardware module in the second device.
  • the receiving module 401 is specifically configured to: receive a real-time publish and subscribe RTPS protocol message sent by the first device; and extract the correction of the first data from the RTPS protocol message. Test child news.
  • the processing module 402 is specifically configured to: determine whether the RTPS protocol message is a fragmented message according to the syndrome message in the RTPS protocol message; if the RTPS protocol message The message is a fragmented message, and multiple fragmented messages corresponding to the first data are determined; the syndrome message in any one of the multiple fragmented messages is extracted to obtain the first data The syndrome message.
  • the processing module 402 is further configured to: if the RTPS protocol message is a non-fragmented message, determine an RTPS protocol message corresponding to the first data; and extract the first data A syndrome message in an RTPS protocol message corresponding to one piece of data obtains the syndrome message of the first data.
  • the processing module 402 is specifically configured to: if the syndrome message in the RTPS protocol message is different from the syndrome message in the upper and lower messages of the RTPS protocol message. Same, it is determined that the RTPS protocol message is a non-fragmented message; if the syndrome message in the RTPS protocol message is the same as any syndrome message in the upper and lower messages of the RTPS protocol message, It is determined that the RTPS protocol message is a fragmented message.
  • the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
  • the processing module 402 is specifically configured to: if the first check code is equal to the second check code, determine that the data check is successful; otherwise, the second device determines the data The verification failed.
  • the first device is a vehicle-mounted sensor
  • the verification device 400 is a vehicle-mounted master control device.
  • the verification apparatus 400 may specifically be the above-mentioned second device, and its respective component modules (receiving module 401, processing module 402, and second hardware module 403) may be used to execute the second device in the above method embodiment. All operations.
  • An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a program, and the program executes some or all of the steps recorded in the above method embodiments.
  • the verification device 500 may specifically be the above-mentioned first device.
  • the verification device 500 includes a processor 501, wherein the verification device 500 includes a processor 501.
  • the number of processors in the test apparatus 500 may be one or more, and one processor is taken as an example in FIG. 5.
  • the verification apparatus 500 further includes: a memory 502, a transceiver 503, and a first hardware module 504.
  • the processor 501, the memory 502, the transceiver 503, and the first hardware module 504 may be connected by a bus or other methods. In FIG. 5, the connection by a bus is taken as an example.
  • the memory 502 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1103. A part of the memory 502 may also include a non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the memory 502 stores an operating system and operating instructions, executable modules or data structures, or a subset of them, or an extended set of them.
  • the operating instructions may include various operating instructions for implementing various operations.
  • the operating system may include various system programs for implementing various basic services and processing hardware-based tasks.
  • the processor 501 controls the operation of the first device 500, and the processor 501 may also be referred to as a central processing unit (CPU).
  • the various components of the verification device 500 are coupled together through a bus system.
  • the bus system may also include a power bus, a control bus, and a status signal bus.
  • various buses are referred to as bus systems in the figure.
  • the method disclosed in the foregoing embodiment of the present application may be applied to the processor 501 or implemented by the processor 501.
  • the processor 501 may be an integrated circuit chip with signal processing capability. In the implementation process, the steps of the foregoing method can be completed by an integrated logic circuit of hardware in the processor 501 or instructions in the form of software.
  • the aforementioned processor 501 may be a general-purpose processor, a digital signal processing (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or Other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP digital signal processing
  • ASIC application specific integrated circuit
  • FPGA field-programmable gate array
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502, and completes the steps of the foregoing method in combination with its hardware.
  • the transceiver 503 can be used to receive input digital or character information, and to generate signal input related to the relevant settings and function control of the verification device 500, and can be used to output digital or character information through an external interface.
  • the processor 501 is configured to execute the aforementioned data verification method executed by the first device.
  • the verification device 600 includes a processor 601, wherein the verification device 600 includes a processor 601.
  • the number of processors in the apparatus 600 may be one or more, and one processor is taken as an example in FIG. 6.
  • the verification apparatus 600 further includes: a memory 602, a transceiver 603, and a second hardware module 604.
  • the processor 601, the memory 502, the transceiver 503, and the second hardware module 504 may be connected by a bus or other methods. In FIG. 6, the connection by a bus is taken as an example.
  • the memory 602 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1103. A part of the memory 602 may also include a non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the memory 602 stores an operating system and operating instructions, executable modules or data structures, or a subset of them, or an extended set of them.
  • the operating instructions may include various operating instructions for implementing various operations.
  • the operating system may include various system programs for implementing various basic services and processing hardware-based tasks.
  • the processor 601 controls the operation of the second device 600, and the processor 601 may also be referred to as a central processing unit (CPU).
  • the various components of the verification device 600 are coupled together through a bus system, where the bus system may include a power bus, a control bus, a status signal bus, etc., in addition to a data bus.
  • bus system may include a power bus, a control bus, a status signal bus, etc., in addition to a data bus.
  • various buses are referred to as bus systems in the figure.
  • the method disclosed in the foregoing embodiment of the present application may be applied to the processor 601 or implemented by the processor 601.
  • the processor 601 may be an integrated circuit chip with signal processing capability. In the implementation process, the steps of the foregoing method can be completed by an integrated logic circuit of hardware in the processor 601 or instructions in the form of software.
  • the aforementioned processor 601 may be a general-purpose processor, a digital signal processing (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or Other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP digital signal processing
  • ASIC application specific integrated circuit
  • FPGA field-programmable gate array
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602, and completes the steps of the foregoing method in combination with its hardware.
  • the transceiver 603 can be used to receive input digital or character information, and to generate signal input related to the relevant settings and function control of the verification device 600, and can be used to output digital or character information through an external interface.
  • the processor 601 is configured to execute the aforementioned data verification method executed by the second device.
  • processor mentioned in any of the foregoing may be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the program of the method in the first aspect.
  • the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physically separate.
  • the physical unit can be located in one place or distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the connection relationship between the modules indicates that they have a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
  • this application can be implemented by means of software plus necessary general hardware.
  • it can also be implemented by dedicated hardware including dedicated integrated circuits, dedicated CPUs, dedicated memory, Dedicated components and so on to achieve.
  • all functions completed by computer programs can be easily implemented with corresponding hardware.
  • the specific hardware structures used to achieve the same function can also be diverse, such as analog circuits, digital circuits or special-purpose circuits. Circuit etc.
  • software program implementation is a better implementation in more cases.
  • the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a readable storage medium, such as a computer floppy disk. , U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., including several instructions to make a computer device (which can be a personal computer, server, or network device, etc.) execute the methods described in each embodiment of this application .
  • a computer device which can be a personal computer, server, or network device, etc.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website, computer, server or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.).
  • wired such as coaxial cable, optical fiber, digital subscriber line (DSL)
  • wireless such as infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

Disclosed are a data checking method and apparatus, wherein same are used to improve the data checking capability, and to solve the problem of end-to-end data checking of an ultra-long data packet. The data checking method comprises: a first device acquiring a first check code corresponding to first data, wherein the first check code is a check code corresponding to the first data obtained by means of calculation of a first hardware module in the first device, and the first data is data collected by the first device; the first device generating a check sub-message of the first data according to the first check code; and the first device sending the check sub-message of the first data to a second device, wherein the check sub-message of the first data is used by the second device to perform data checking.

Description

一种数据校验方法及装置Data verification method and device 技术领域Technical field
本申请实施例涉及通信技术领域,尤其涉及一种数据校验方法及装置。The embodiments of the present application relate to the field of communication technologies, and in particular, to a data verification method and device.
背景技术Background technique
智能驾驶系统依赖诸多传感器数据,如激光雷达、毫米波雷达和超声波雷达等产生的数据。这些传感器充当着车的“眼睛”和“鼻子”,感知外界世界的变化。外界的数据需要经过传输线路到达智能驾驶系统的中控系统(相当于人的大脑)。随着传感器性能的提高,传感器获取的数据越来越多,在数据传输到中控系统的过程中,由于软件和硬件两方面的不可靠,数据会存在被篡改的可能。中控系统根据错误的数据会给出错误的自动驾驶指令,从而给乘客带来生命危险。Intelligent driving systems rely on data from many sensors, such as data generated by lidar, millimeter wave radar, and ultrasonic radar. These sensors act as the "eyes" and "nose" of the car, perceiving changes in the outside world. External data needs to pass through the transmission line to reach the central control system of the intelligent driving system (equivalent to the human brain). With the improvement of sensor performance, more and more data are acquired by sensors. During the process of data transmission to the central control system, due to the unreliability of both software and hardware, the data may be tampered with. The central control system will give wrong auto-driving instructions based on the wrong data, which will endanger the lives of passengers.
为了提高数据传输的安全性,传感器获取的数据传输到中控系统需要一个强大的端到端的数据校验机制以避免数据被篡改,其中,数据校验是指为了保证数据的完整性、正确性和安全性对输入数据进行校验的技术。In order to improve the security of data transmission, the transmission of data obtained by sensors to the central control system requires a powerful end-to-end data verification mechanism to avoid data tampering. Among them, data verification means to ensure the integrity and correctness of the data. And security technology to verify the input data.
在现有端到端的数据校验机制中,校验码通常采用软件方式进行计算,其校验码计算方式较为复杂的情况下会导致校验码计算速度变慢。同时,软件方式计算校验码需要占用中央处理器(central processing unit,CPU)的计算资源,由于CPU计算资源有限导致软件方式计算的校验码对应的数据长度受到一定程度上的限制。In the existing end-to-end data verification mechanism, the check code is usually calculated by software, and the calculation of the check code will slow down if the check code calculation method is more complicated. At the same time, the calculation of the check code by the software method requires the computing resources of a central processing unit (CPU). Due to the limited computing resources of the CPU, the data length corresponding to the check code calculated by the software is limited to a certain extent.
发明内容Summary of the invention
为了解决上述技术问题,本申请实施例中提供了一种数据校验方法及装置,用于提高数据校验能力,解决端到端的超长数据包数据校验问题。In order to solve the above technical problems, the embodiments of the present application provide a data verification method and device, which are used to improve the data verification capability and solve the end-to-end ultra-long data packet data verification problem.
第一方面,本申请实施例中提供了一种数据校验方法,包括:第一设备获取第一数据对应的第一校验码,其中,第一校验码是第一设备中的第一硬件模块计算得到的,第一数据是第一设备采集的数据;第一设备根据第一校验码生成校验子消息;第一设备向第二设备发送第一数据的校验子消息。可选地,在一些可能的应用场景中,第一设备通过物理链路向第二设备发送第一数据的校验子消息。In the first aspect, an embodiment of the present application provides a data verification method, including: a first device obtains a first verification code corresponding to the first data, where the first verification code is the first verification code in the first device. The hardware module calculates that the first data is data collected by the first device; the first device generates a syndrome message according to the first check code; the first device sends a syndrome message of the first data to the second device. Optionally, in some possible application scenarios, the first device sends the syndrome message of the first data to the second device through the physical link.
在第一方面的技术方案中,采用硬件模块计算校验码,可以提高校验码计算速度,并且硬件计算校验码不会受到数据长度的限制,可以提高数据校验能力,实现对超长数据包的有效校验,从而解决超长数据包数据校验问题。In the first aspect of the technical solution, the use of hardware modules to calculate the check code can increase the speed of the check code calculation, and the hardware calculation of the check code will not be limited by the data length, which can improve the data check ability and realize the Effective verification of data packets, thereby solving the problem of data verification of ultra-long packets.
在第一方面的一种可能的实现方式中,上述方法还包括:第一设备根据第一数据生成至少一个实时发布订阅(real-Time publish-subscribe,RTPS)协议报文;第一设备将第一数据的校验子消息插入至少一个RTPS协议报文中的每一个报文中;此时,第一设备向第二设备发送第一数据的校验子消息可以是:第一设备将至少一个RTPS协议报文中的每一个报文依次发送至第二设备。在该种可能的实现方式中,将校验子消息扩展RTPS协议中可以增强标准RTPS协议能力,提升RTPS协议的数据校验能力。In a possible implementation of the first aspect, the foregoing method further includes: the first device generates at least one real-time publish-subscribe (RTPS) protocol message according to the first data; The syndrome message of one data is inserted into each of the at least one RTPS protocol message; at this time, the first device sends the syndrome message of the first data to the second device may be: the first device sends at least one syndrome message to the second device Each message in the RTPS protocol message is sent to the second device in turn. In this possible implementation manner, extending the syndrome message to the RTPS protocol can enhance the standard RTPS protocol capability and improve the data verification capability of the RTPS protocol.
在第一方面的一种可能的实现方式中,第一设备根据第一数据生成至少一个RTPS协议报文,可以包括:若第一数据的数据长度大于或等于第一阈值,第一设备根据第一数据生 成多个RTPS协议报文,其中,多个RTPS协议报文为分片报文;若第一数据的数据长度小于第一阈值,第一设备根据所述第一数据生成一个RTPS协议报文,其中,RTPS协议报文为非分片报文。在该种实现方式中,当数据长度超出第一阈值时,可以分片传输第一数据。In a possible implementation manner of the first aspect, the first device generating at least one RTPS protocol packet according to the first data may include: if the data length of the first data is greater than or equal to the first threshold, the first device generates the at least one RTPS protocol packet according to the first data One piece of data generates multiple RTPS protocol packets, where multiple RTPS protocol packets are fragmented packets; if the data length of the first data is less than the first threshold, the first device generates one RTPS protocol packet according to the first data The RTPS protocol message is a non-fragmented message. In this implementation manner, when the data length exceeds the first threshold, the first data may be transmitted in fragments.
在第一方面的一种可能的实现方式中,第一设备获取第一校验码,可以包括:若第一数据的数据长度大于或等于第二阈值,第一设备控制第一硬件模块对第一数据进行计算得到第一校验码。In a possible implementation of the first aspect, obtaining the first check code by the first device may include: if the data length of the first data is greater than or equal to the second threshold, the first device controls the first hardware module to A data is calculated to obtain the first check code.
在第一方面的一种可能的实现方式中,上述第一数据的校验子消息中还可以包括:数据长度、超时参数、数据序列号中的至少一项。In a possible implementation of the first aspect, the syndrome message of the first data may further include at least one of a data length, a timeout parameter, and a data sequence number.
在第一方面的一种可能的实现方式中,第一设备为车载传感器,第二设备为车载主控设备。In a possible implementation of the first aspect, the first device is a vehicle-mounted sensor, and the second device is a vehicle-mounted master control device.
第二方面,本申请实施例提供了一种数据传输方法,包括:第二设备接收第一设备发送的第一数据的校验子消息,其中,第一数据为第一设备采集的数据;第二设备从第一数据的校验子消息中提取第一校验码;第二设备获取第二校验码,其中,第二校验码事第二设备中的第二硬件模块计算得到的第二数据对应的校验码,第二数据为第二设备从第一设备接收到的数据;第二设备根据第一校验码和第二校验码进行数据校验。In a second aspect, an embodiment of the present application provides a data transmission method, including: a second device receives a syndrome message of first data sent by a first device, where the first data is data collected by the first device; The second device extracts the first check code from the syndrome message of the first data; the second device obtains the second check code, where the second check code is the first check code calculated by the second hardware module in the second device The check code corresponding to the second data, the second data is the data received by the second device from the first device; the second device performs data check according to the first check code and the second check code.
在第二方面的技术方案中,采用硬件模块计算校验码并执行数据校验,可以提高校验码计算速度,并且硬件计算校验码不会收到数据长度的限制,可以提高数据校验能力,实现对超长数据包的有效校验,从而端到端的超长数据包数据校验问题。In the technical solution of the second aspect, the hardware module is used to calculate the check code and perform data check, which can increase the speed of check code calculation, and the hardware calculation of check code does not receive the limitation of the data length, which can improve the data check Ability to achieve effective verification of ultra-long data packets, thus end-to-end data verification of ultra-long data packets.
在第二方面的一种可能的实现方式中,第二设备接收第一设备发送的第一数据的校验子消息,包括:第二设备接收第一设备发送的实时发布订阅RTPS协议报文;第二设备从RTPS协议报文中提取第一数据的校验子消息。In a possible implementation of the second aspect, the second device receiving the syndrome message of the first data sent by the first device includes: the second device receives a real-time publish and subscribe RTPS protocol message sent by the first device; The second device extracts the syndrome message of the first data from the RTPS protocol message.
在第二方面的一种可能的实现方式中,第二设备从RTPS协议报文中提取第一数据的校验子消息,包括:第二设备根据RTPS协议报文中的校验子消息判断RTPS协议报文是否为分片报文;若RTPS协议报文为分片报文,第二设备确定第一数据对应的多个分片报文;第二设备提取多个分片报文中任意一个报文中的校验子消息,得到第一数据的校验子消息。In a possible implementation manner of the second aspect, the second device extracts the syndrome message of the first data from the RTPS protocol message, including: the second device judges the RTPS according to the syndrome message in the RTPS protocol message Whether the protocol message is a fragmented message; if the RTPS protocol message is a fragmented message, the second device determines multiple fragmented messages corresponding to the first data; the second device extracts any one of the multiple fragmented messages The syndrome message in the message obtains the syndrome message of the first data.
在第二方面的一种可能的实现方式中,上述方法还包括:若RTPS协议报文为非分片报文,第二设备确定第一数据对应的一个RTPS协议报文;第二设备提取第一数据对应的一个RTPS协议报文中的校验子消息,得到第一数据的校验子消息。In a possible implementation of the second aspect, the above method further includes: if the RTPS protocol message is a non-fragmented message, the second device determines an RTPS protocol message corresponding to the first data; the second device extracts the first data A syndrome message in an RTPS protocol message corresponding to one data obtains a syndrome message of the first data.
在第二方面的一种可能的实现方式中,第二设备根据RTPS协议报文中的校验子消息判断RTPS协议报文是否为分片报文,包括:若RTPS协议报文中的校验子消息与RTPS协议报文的上下报文中的校验子消息均不相同,第二设备确定RTPS协议报文为非分片报文;若RTPS协议报文中的校验子消息与RTPS协议报文的上下报文中的任意一个校验子消息相同,第二设备确定RTPS协议报文为分片报文。In a possible implementation of the second aspect, the second device judges whether the RTPS protocol message is a fragmented message according to the syndrome message in the RTPS protocol message, including: if the checksum in the RTPS protocol message The sub-message and the syndrome message in the upper and lower messages of the RTPS protocol message are different, and the second device determines that the RTPS protocol message is a non-fragmented message; if the syndrome message in the RTPS protocol message is the same as the RTPS protocol Any one of the syndrome messages in the upper and lower messages of the message is the same, and the second device determines that the RTPS protocol message is a fragmented message.
在第二方面的一种可能的实现方式中,第一数据的校验子消息中还包括以下至少一项参数:数据长度、超时参数、数据序列号。In a possible implementation of the second aspect, the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
在第二方面的一种可能的实现方式中,第二设备根据第一校验码和第二校验码进行数据校验,包括:若第一校验码等于第二校验码,第二设备确定数据校验成功;否则,第二 设备确定数据校验失败。In a possible implementation manner of the second aspect, the second device performs data verification according to the first check code and the second check code, including: if the first check code is equal to the second check code, the second The device determines that the data verification is successful; otherwise, the second device determines that the data verification fails.
在第二方面的一种可能的实现方式中,第一设备为车载传感器,第二设备为车载的主控设备。In a possible implementation of the second aspect, the first device is a vehicle-mounted sensor, and the second device is a vehicle-mounted main control device.
第三方面,本申请实施例中提供了一种校验装置,包括:第一硬件模块,用于计算得到的第一数据对应的第一校验码,其中,第一数据为第一设备采集的数据;处理模块,用于获取第一校验码和根据第一校验码生成第一数据的校验子消息;发送模块,用于向第二设备发送第一数据的校验子消息,其中,第一数据的校验子消息用于第二设备进行数据校验。In a third aspect, an embodiment of the present application provides a verification device, including: a first hardware module, configured to calculate a first verification code corresponding to the first data, where the first data is collected by the first device Processing module, used to obtain the first check code and generate the syndrome message of the first data according to the first check code; sending module, used to send the syndrome message of the first data to the second device, Wherein, the syndrome message of the first data is used for the second device to perform data verification.
在第三方面的一种可能的实现方式中,处理模块还用于:根据第一数据生成至少一个实时发布订阅RTPS协议报文;将第一数据的校验子消息插入至少一个RTPS协议报文中的每一个报文中;发送模块具体用于:将至少一个RTPS协议报文中的每一个报文依次发送至第二设备。In a possible implementation of the third aspect, the processing module is further configured to: generate at least one real-time publish and subscribe RTPS protocol message according to the first data; insert the syndrome message of the first data into the at least one RTPS protocol message The sending module is specifically configured to: send each of the at least one RTPS protocol message to the second device in turn.
在第三方面的一种可能的实现方式中,处理模块具体用于:若第一数据的数据长度大于或等于第一阈值,根据第一数据生成多个RTPS协议报文,其中,多个RTPS协议报文为分片报文;若第一数据的数据长度小于第一阈值,第一设备根据第一数据生成一个RTPS协议报文,其中,RTPS协议报文为非分片报文。In a possible implementation manner of the third aspect, the processing module is specifically configured to: if the data length of the first data is greater than or equal to the first threshold, generate multiple RTPS protocol messages according to the first data, wherein multiple RTPS The protocol message is a fragmented message; if the data length of the first data is less than the first threshold, the first device generates an RTPS protocol message according to the first data, where the RTPS protocol message is a non-fragmented message.
在第三方面的一种可能的实现方式中,处理模块具体用于:若第一数据的数据长度大于或等于第二阈值,控制第一硬件模块计算得到第一校验码。In a possible implementation of the third aspect, the processing module is specifically configured to: if the data length of the first data is greater than or equal to the second threshold, control the first hardware module to calculate the first check code.
在第三方面的一种可能的实现方式中,第一数据的校验子消息中还包括以下至少一项参数:数据长度、超时参数、数据序列号。In a possible implementation manner of the third aspect, the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
在第三方面的一种可能的实现方式中,校验装置为车载传感器,第二设备为车载主控设备。In a possible implementation of the third aspect, the verification device is a vehicle-mounted sensor, and the second device is a vehicle-mounted master control device.
第四方面,本申请实施例中提供了一种校验装置,包括:第二硬件模块,用于计算第二数据对应的校验码,其中,第二数据为第二设备从第一设备接收到的数据;接收模块,用于接收第一设备发送的第一数据的校验子消息,其中,第一数据为第一设备采集的数据;处理模块,用于从第一数据的校验子消息中提取第一校验码、获取第二校验码、和根据第一校验码和第二校验码进行数据校验,其中,第二校验码是第二设备中的第二硬件模块。In a fourth aspect, an embodiment of the present application provides a verification device, including: a second hardware module for calculating a verification code corresponding to the second data, wherein the second data is received by the second device from the first device Received data; receiving module, used to receive the syndrome message of the first data sent by the first device, where the first data is data collected by the first device; processing module, used to obtain the syndrome from the first data Extract the first check code from the message, obtain the second check code, and perform data check according to the first check code and the second check code, where the second check code is the second hardware in the second device Module.
在第四方面的一种可能的实现方式中,处理模块还用于:根据第一数据生成至少一个实时发布订阅RTPS协议报文;将第一数据的校验子消息插入至少一个RTPS协议报文中的每一个报文中;发送模块具体用于:将至少一个RTPS协议报文中的每一个报文依次发送至第二设备。In a possible implementation manner of the fourth aspect, the processing module is further configured to: generate at least one real-time publish and subscribe RTPS protocol message according to the first data; insert the syndrome message of the first data into the at least one RTPS protocol message The sending module is specifically configured to: send each of the at least one RTPS protocol message to the second device in turn.
在第四方面的一种可能的实现方式中,处理模块具体用于:若第一数据的数据长度大于或等于第一阈值,根据第一数据生成多个RTPS协议报文,其中,多个RTPS协议报文为分片报文;若第一数据的数据长度小于第一阈值,第一设备根据第一数据生成一个RTPS协议报文,其中,RTPS协议报文为非分片报文。In a possible implementation manner of the fourth aspect, the processing module is specifically configured to: if the data length of the first data is greater than or equal to the first threshold, generate multiple RTPS protocol messages according to the first data, wherein multiple RTPS The protocol message is a fragmented message; if the data length of the first data is less than the first threshold, the first device generates an RTPS protocol message according to the first data, where the RTPS protocol message is a non-fragmented message.
在第四方面的一种可能的实现方式中,处理模块具体用于:若第一数据的数据长度大于或等于第二阈值,控制第一硬件模块计算得到第一校验码。In a possible implementation manner of the fourth aspect, the processing module is specifically configured to: if the data length of the first data is greater than or equal to the second threshold, control the first hardware module to calculate the first check code.
在第四方面的一种可能的实现方式中,第一数据的校验子消息中还包括以下至少一项参数:数据长度、超时参数、数据序列号。In a possible implementation manner of the fourth aspect, the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
在第四方面的一种可能的实现方式中,校验装置为车载传感器,第二设备为车载主控设备。In a possible implementation manner of the fourth aspect, the verification device is a vehicle-mounted sensor, and the second device is a vehicle-mounted master control device.
第五方面,本申请实施例中提供了一种校验装置,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储操作指令;所述处理器用于通过调用所述操作指令,以执行上述第一方面中任一项中所述的方法。In a fifth aspect, an embodiment of the present application provides a verification device, including: a processor, the processor is coupled with a memory, the memory is used to store operation instructions; the processor is used to call the operation instructions , To perform the method described in any one of the above-mentioned first aspects.
在第五方面的一种可能的实现方式中,所述校验装置还包括:第一硬件模块,用于计算第一数据对应的第一校验码。In a possible implementation of the fifth aspect, the verification device further includes: a first hardware module configured to calculate a first verification code corresponding to the first data.
第六方面,本申请实施例中提供了一种校验装置,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储操作指令;所述处理器用于通过调用所述操作指令,以执行上述第二方面中任一项中所述的方法。In a sixth aspect, an embodiment of the present application provides a verification device, including: a processor, the processor is coupled with a memory, the memory is used to store operation instructions; the processor is used to call the operation instructions , To perform the method described in any one of the above-mentioned second aspects.
在第六方面的一种可能的实现方式中,所述校验装置还包括:第二硬件模块,用于计算第二数据对应的第二校验码。In a possible implementation manner of the sixth aspect, the verification device further includes: a second hardware module configured to calculate a second verification code corresponding to the second data.
第七方面,本申请实施例中提供了一种计算机存储介质,所述计算机存储介质中存储有操作指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的方法。In a seventh aspect, an embodiment of the present application provides a computer storage medium that stores operating instructions in the computer storage medium, and when it runs on a computer, the computer executes the method described in the first aspect.
第八方面,本申请实施例中提供了一种计算机存储介质,所述计算机存储介质中存储有操作指令,当其在计算机上运行时,使得计算机执行上述第二方面所述的方法。In an eighth aspect, an embodiment of the present application provides a computer storage medium. The computer storage medium stores operating instructions, which when run on a computer, cause the computer to execute the method described in the second aspect.
第九方面,本申请实施例中提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的方法。In a ninth aspect, the embodiments of the present application provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method described in the first aspect.
第十方面,本申请实施例中提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第二方面所述的方法。In a tenth aspect, the embodiments of the present application provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method described in the second aspect.
附图说明Description of the drawings
图1为本申请实施例中提供的一种系统框架结构示意图;FIG. 1 is a schematic diagram of a system framework structure provided in an embodiment of this application;
图2(a)为本申请实施例中提供的数据校验方法的一个实施例示意图;Figure 2(a) is a schematic diagram of an embodiment of a data verification method provided in an embodiment of the application;
图2(b)为本申请实施例中提供的第一设备中的硬件模块的一个组成结构示意图;FIG. 2(b) is a schematic diagram of a structure of a hardware module in the first device provided in an embodiment of the application;
图3为本申请实施例中校验装置的一个结构示意图;FIG. 3 is a schematic diagram of a structure of a verification device in an embodiment of the application;
图4为本申请实施例中校验装置的另一个结构示意图;FIG. 4 is another schematic diagram of the structure of the verification device in an embodiment of the application;
图5为本申请实施例中校验装置的另一个结构示意图;FIG. 5 is another schematic diagram of the structure of the verification device in an embodiment of the application;
图6为本申请实施例中校验装置的另一个结构示意图。FIG. 6 is a schematic diagram of another structure of the verification device in an embodiment of the application.
具体实施方式Detailed ways
本申请实施例提供了一种数据校验方法及装置,用于提高数据校验能力,解决端到端的超长数据包数据校验问题。The embodiments of the present application provide a data verification method and device, which are used to improve the data verification capability and solve the end-to-end ultra-long data packet data verification problem.
下面结合附图,对本申请的实施例进行描述。The embodiments of the present application will be described below in conjunction with the drawings.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分 方式。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、系统、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。The terms "first", "second", etc. in the description and claims of the application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, and this is merely a way of distinguishing objects with the same attributes in the description of the embodiments of the present application. In addition, the terms "including" and "having" and any variations of them are intended to cover non-exclusive inclusion, so that a process, method, system, product, or device that includes a series of units is not necessarily limited to those units, but may include Listed or inherent to these processes, methods, products, or equipment.
本申请实施例中的技术方案适用于各种通信系统中,尤其适用于自动驾驶系统的数据校验场景中。自动驾驶系统依赖诸多传感器获取外界数据,如激光雷达,毫米波雷达,超声波雷达等采集的大量外界数据。外界数据校验至自动驾驶系统的中控电脑过程中,需要一种消息校验机制以确保外界数据校验的准确性,本申请可以在数据校验过程中不受数据大小限制,增强端到端数据校验校验能力。The technical solutions in the embodiments of the present application are applicable to various communication systems, and are especially applicable to data verification scenarios of an automatic driving system. Autonomous driving systems rely on many sensors to obtain external data, such as lidar, millimeter wave radar, and ultrasonic radar. In the process of verifying external data to the central control computer of the automatic driving system, a message verification mechanism is required to ensure the accuracy of external data verification. This application can be free from the data size limitation during the data verification process and enhance the end-to-end End data verification and verification capabilities.
本申请实施例描述的系统架构以及业务场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着网络架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。The system architecture and business scenarios described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. Those of ordinary skill in the art will know that with the network With the evolution of architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.
图1为本申请实施例中提供的一种系统框架结构示意图。Fig. 1 is a schematic diagram of a system framework structure provided in an embodiment of the application.
如图1所示,本申请实施例的系统框架中包括:第一设备101和第二设备102,其中第一设备101和第二设备之间进行数据校验。可选地,在自动驾驶场景中,第一设备101可以是传感器端设备,例如激光雷达等,第二设备102可以是自动驾驶系统的车载主控设备,例如车载中控电脑、移动数据中心(mobile data center,MDC)等。As shown in FIG. 1, the system framework of the embodiment of the present application includes: a first device 101 and a second device 102, wherein data verification is performed between the first device 101 and the second device. Optionally, in an autonomous driving scenario, the first device 101 may be a sensor-end device, such as lidar, etc., and the second device 102 may be a vehicle-mounted master control device of the automatic driving system, such as a vehicle-mounted central control computer, a mobile data center ( mobile data center, MDC), etc.
为了便于了解本申请实施例的技术方案,下面结合具体的实施例对本申请技术方案进行详细说明。In order to facilitate the understanding of the technical solutions of the embodiments of the present application, the technical solutions of the present application will be described in detail below in conjunction with specific embodiments.
图2(a)为本申请实施例中提供的数据校验方法的一个实施例示意图。Figure 2(a) is a schematic diagram of an embodiment of a data verification method provided in an embodiment of the application.
如图2(a)所示,本申请实施例中的数据校验方法,包括:As shown in Figure 2(a), the data verification method in the embodiment of the present application includes:
201、第一设备获取第一数据对应的第一校验码,第一校验码是由第一设备中的第一硬件设备计算得到的。201. A first device obtains a first check code corresponding to the first data, where the first check code is calculated by a first hardware device in the first device.
第一校验码是由第一设备中的第一硬件模块计算得到的第一数据对应的校验码,第一数据是指第一备向第二设备发送的数据。应理解,与软件模块计算校验码相比,硬件模块计算校验码具有计算速度快、计算数据量大等优点。其中,第一数据是第一设备采集到的数据;第一设备中的第一硬件模块可以采用内置方式设置,也可以采用外置方式设置。The first check code is a check code corresponding to the first data calculated by the first hardware module in the first device, and the first data refers to data sent by the first device to the second device. It should be understood that, compared with the calculation of the check code by the software module, the calculation of the check code by the hardware module has the advantages of fast calculation speed and large amount of calculation data. Among them, the first data is data collected by the first device; the first hardware module in the first device may be set in a built-in manner or may be set in an external manner.
图2(b)为第一设备中第一硬件模块的一个结构示意图。图2所示的硬件模块结构具体可以第一设备中的第一硬件模块,也可以是下文中第二设备中的第二硬件模块。Figure 2(b) is a schematic structural diagram of the first hardware module in the first device. The hardware module structure shown in FIG. 2 may specifically be the first hardware module in the first device or the second hardware module in the second device below.
如图2(b)所示,硬件模块20包括输入单元207、逻辑计算单元208、输出单元209和超时监控单元210。其中,输入单元207用于获取报文内容以及相应的报文参数,具体来说,给硬件模块20输入报文的数据地址和长度,输入单元207可以从相应的数据地址中读取指定长度的报文。逻辑计算单元208用于预置多种校验码计算方法例如散列函数,并且可以根据报文的数据长度选择相应的散列函数进行计算生成散列值即校验码。超时监控单元210用于监控逻辑计算单元208中计算校验码的时长是否超出预设时长。输出单元209用于输出逻辑计算单元208生成的校验码。还需要说明的是,硬件模块20还需要支持数据自动解析和计算的功能。上述硬件模块20的组成结构支持流水线,性能较好。As shown in FIG. 2(b), the hardware module 20 includes an input unit 207, a logic calculation unit 208, an output unit 209, and a timeout monitoring unit 210. The input unit 207 is used to obtain the content of the message and the corresponding message parameters. Specifically, the data address and length of the message are input to the hardware module 20, and the input unit 207 can read the specified length from the corresponding data address. Message. The logic calculation unit 208 is configured to preset multiple check code calculation methods, such as a hash function, and can select a corresponding hash function for calculation according to the data length of the message to generate a hash value, that is, a check code. The timeout monitoring unit 210 is used to monitor whether the time length for calculating the check code in the logic calculation unit 208 exceeds a preset time length. The output unit 209 is used to output the check code generated by the logic calculation unit 208. It should also be noted that the hardware module 20 also needs to support the functions of automatic data analysis and calculation. The composition structure of the above-mentioned hardware module 20 supports pipelines and has good performance.
举例说明,在自动驾驶场景中第一设备为激光雷达等传感器,此时,第一数据是激光雷达采集得到并传输至第二设备如车载中控电脑的数据。For example, in an autonomous driving scenario, the first device is a sensor such as a lidar. At this time, the first data is data collected by the lidar and transmitted to the second device, such as a vehicle-mounted central control computer.
可选地,第一设备获取第一校验码可以是:当第一数据的数据长度大于或等于第二阈值时,第一设备控制第一硬件模块计算第一数据对应的第一校验码。其中第二阈值可以为4M,应理解,循环冗余校验(cyclic redundancy check,CRC)是常见的校验计算方式,其中CRC64算法可计算最大长度为4M的数据对应的校验码。Optionally, the first device to obtain the first check code may be: when the data length of the first data is greater than or equal to the second threshold, the first device controls the first hardware module to calculate the first check code corresponding to the first data . The second threshold may be 4M. It should be understood that cyclic redundancy check (CRC) is a common check calculation method, and the CRC64 algorithm can calculate the check code corresponding to data with a maximum length of 4M.
可选地,第一硬件模块计算第一校验码的计算方式包括:CRC16、CRC32、CRC64、AES128和SHA256等散列值计算算法。Optionally, the calculation method for the first hardware module to calculate the first check code includes: hash value calculation algorithms such as CRC16, CRC32, CRC64, AES128, and SHA256.
202、第一设备根据第一校验码生成第一数据的校验子消息。202. The first device generates a syndrome message of the first data according to the first check code.
第一设备根据第一数据生成实时发布订阅RTPS协议报文,并且在RTPS协议报文中插入第一数据的校验子消息。可选地,校验子消息可以插入RTPS协议报文的头部中。The first device generates a real-time publish and subscribe RTPS protocol message according to the first data, and inserts a syndrome message of the first data in the RTPS protocol message. Optionally, the syndrome message can be inserted into the header of the RTPS protocol message.
具体地,第一设备根据第一数据生成至少一个实时发布订阅RTPS协议报文,进而,第一设备将第一数据地校验子消息插入至少一个RTPS协议报文中的每一个报文中。第一设备将至少一个RTPS协议报文中的每一个报文依次发送至第二设备。Specifically, the first device generates at least one real-time publish and subscribe RTPS protocol message according to the first data, and further, the first device inserts the syndrome message of the first data into each of the at least one RTPS protocol message. The first device sequentially sends each of the at least one RTPS protocol packet to the second device.
可选地,第一设备根据第一数据生成至少一个RTPS协议报文,具体可以包括:第一设备可以根据第一数据的数据长度确定是否需要对RTPS协议报文进行分片。具体来说,若第一数据的数据长度大于或等于第一阈值,第一设备生成第一数据对应的多个(如N个)RTPS协议报文,N个RTPS协议报文中携带完整的第一数据,每一个RTPS协议报文携带部分的第一数据,每一个RTPS协议报文中均插入第一校验码,N为大于或等于2的整数。若第一数据的数据长度小于第一阈值,第一设备生成第一数据对应的一个RTPS协议报文,该RTPS协议报文中包括全部的第一数据并被插入第一校验码。Optionally, the first device generating at least one RTPS protocol message according to the first data may specifically include: the first device may determine whether the RTPS protocol message needs to be fragmented according to the data length of the first data. Specifically, if the data length of the first data is greater than or equal to the first threshold, the first device generates multiple (for example, N) RTPS protocol messages corresponding to the first data, and the N RTPS protocol messages carry the complete first One data, each RTPS protocol message carries part of the first data, each RTPS protocol message is inserted with the first check code, and N is an integer greater than or equal to 2. If the data length of the first data is less than the first threshold, the first device generates an RTPS protocol message corresponding to the first data, and the RTPS protocol message includes all the first data and inserts the first check code.
可选地,第一数据的校验子消息中还可以包括第一数据对应的数据长度、超时参数和数据序列号。其中,数据长度为第一数据的数据长度或RTPS协议报文的一个分片对应的数据长度,用于数据完整性校验,验证数据的可靠性。数据序列号用于确定RTPS协议报文是否处在有序接收状态。超时参数用于确定数据的时效性。Optionally, the syndrome message of the first data may further include the data length corresponding to the first data, the timeout parameter, and the data sequence number. Wherein, the data length is the data length of the first data or the data length corresponding to a fragment of the RTPS protocol message, which is used for data integrity verification and verification of the reliability of the data. The data sequence number is used to determine whether the RTPS protocol message is in an orderly receiving state. The timeout parameter is used to determine the timeliness of the data.
可选地,校验子消息的一种消息格式,包括:子消息标识字段、散列函数选项字段、位置偏移字段、校验码字段和扩展字段。其中,子消息标识字段为8个比特位,用于指示数据序列号;散列函数选项字段用于指示校验码的计算方式,例如序号0指示AES128算法、1表示SHA256算法、2表示CRC64算法、3表示CRC32算法、4表示CRC16算法;位置偏移字段用于指示下个校验子消息位置的偏移;校验码字段用于指示第一校验码的值,校验码字段的长度可以是64比特至256比特之间;扩展字段可以存放传感器类型,传感器位置等其他扩展数据。Optionally, a message format of the syndrome sub-message includes: a sub-message identification field, a hash function option field, a position offset field, a check code field, and an extension field. Among them, the sub-message identification field is 8 bits, used to indicate the data sequence number; the hash function option field is used to indicate the calculation method of the check code, for example, the sequence number 0 indicates the AES128 algorithm, 1 indicates the SHA256 algorithm, and 2 indicates the CRC64 algorithm , 3 means CRC32 algorithm, 4 means CRC16 algorithm; the position offset field is used to indicate the offset of the next syndrome message position; the check code field is used to indicate the value of the first check code and the length of the check code field It can be between 64 bits and 256 bits; the extended field can store other extended data such as sensor type and sensor location.
203、第一设备向第二设备发送第一数据的校验子消息。203. The first device sends a syndrome message of the first data to the second device.
第一设备向第二设备发送第一数据的校验子消息可以是:第一设备通过物理链路向第二设备发送RTPS协议报文,该RTPS协议报文中包括:第一数据和校验子消息。物理链路用于传输端到端数据传输及校验。可选地,物理链路可以是第一设备和第二设备之间互联的CAN总线或以太网接口。The first device sending the syndrome message of the first data to the second device may be: the first device sends an RTPS protocol message to the second device through a physical link, and the RTPS protocol message includes: the first data and the checksum Sub-message. The physical link is used to transmit end-to-end data transmission and verification. Optionally, the physical link may be a CAN bus or an Ethernet interface for interconnection between the first device and the second device.
204、第二设备从第一数据的校验子消息中提取第一校验码。204. The second device extracts the first check code from the syndrome message of the first data.
若RTPS协议报文是分片报文,第二设备可以从多个(如上述的N个)RTPS协议报文中任意一个报文中的校验子消息,进而第二设备从校验子消息中提取第一校验码。If the RTPS protocol message is a fragmented message, the second device can obtain the syndrome message from any one of the multiple (such as the above-mentioned N) RTPS protocol messages, and then the second device receives the syndrome message Extract the first check code from.
若RTPS协议报文为非分片报文,第二设备从RTPS协议报文中提取第一数据的校验子消息,进而第二设备从第一数据的校验子消息中提取第一校验码。If the RTPS protocol message is a non-fragmented message, the second device extracts the syndrome message of the first data from the RTPS protocol message, and then the second device extracts the first checksum from the syndrome message of the first data code.
可选地,第二设备判断RTPS协议报文是否为分片报文的方式可以是,若RTPS协议报文中的校验子消息与RTPS协议报文的上下报文中的校验子消息均不相同,第二设备确定RTPS协议报文为非分片报文;若RTPS协议报文中的校验子消息与RTPS协议报文的上下报文中的任意一个校验子消息相同,第二设备确定RTPS协议报文为分片报文。Optionally, the second device may determine whether the RTPS protocol message is a fragmented message. If the syndrome message in the RTPS protocol message and the syndrome message in the upper and lower messages of the RTPS protocol message are both If it is not the same, the second device determines that the RTPS protocol message is a non-fragmented message; if the syndrome message in the RTPS protocol message is the same as any one of the syndrome messages in the upper and lower messages of the RTPS protocol message, the second The device determines that the RTPS protocol packet is a fragmented packet.
205、第二设备获取第二校验码。205. The second device obtains the second check code.
若RTPS协议报文是分片报文,第二设备提取N个RTPS协议报文中数据,并重组提取到的数据得到第二数据,第二设备控制第二硬件模块计算第二数据对应的第二校验码。If the RTPS protocol message is a fragmented message, the second device extracts the data in the N RTPS protocol messages and reorganizes the extracted data to obtain the second data. The second device controls the second hardware module to calculate the second data corresponding to the second data. Two check code.
若RTPS协议报文不是分片报文,第二设备从RTPS协议报文中提取第二数据,第二设备控制第二硬件模块计算第二数据对应的第二校验码。If the RTPS protocol message is not a fragmented message, the second device extracts the second data from the RTPS protocol message, and the second device controls the second hardware module to calculate the second check code corresponding to the second data.
206、第二设备根据第一校验码和第二校验码进行数据校验。206. The second device performs data verification according to the first verification code and the second verification code.
若第一校验码与第二校验码相等,则第二设备确定数据校验成功,否则,第二设备确定数据校验失败。可选地,若数据校验失败,第二设备可以向第一设备发送数据重传请求,直达数据校验成功。If the first check code is equal to the second check code, the second device determines that the data verification is successful; otherwise, the second device determines that the data verification fails. Optionally, if the data verification fails, the second device may send a data retransmission request to the first device, and the data verification succeeds.
本申请实施例中,采用硬件模块计算校验码,可以提高校验码计算速度,并且硬件计算校验码不会收到数据长度的限制,可以提高数据校验能力,实现对超长数据包的有效校验,从而解决超长数据包数据校验问题。同时,与软件模块计算校验码相比,硬件模块计算校验码可以不占用处理器计算资源,节约计算资源。In the embodiment of the application, the hardware module is used to calculate the check code, which can increase the speed of the check code calculation, and the hardware calculation of the check code does not receive the limitation of the data length, which can improve the data check ability and realize the detection of ultra-long data packets. Effective verification, thus solving the data verification problem of ultra-long packets. At the same time, compared with the calculation of the check code by the software module, the calculation of the check code by the hardware module may not occupy the computing resources of the processor and save computing resources.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于本申请技术方案对应的部分实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that this application is not limited by the described sequence of actions. Because according to this application, some steps can be performed in other order or at the same time. Secondly, those skilled in the art should also know that the embodiments described in the specification all belong to some embodiments corresponding to the technical solutions of this application, and the involved actions and modules are not necessarily required by this application.
为便于更好的实施本申请实施例的上述方案,下面还提供用于实施上述方案的相关装置。To facilitate better implementation of the above-mentioned solutions in the embodiments of the present application, related devices for implementing the above-mentioned solutions are also provided below.
请参阅如图3所示,为本申请实施例中校验装置的一个结构示意图,校验装置300包括:处理模块301、发送模块302和第一硬件模块303,其中,第一硬件模块303,用于计算第一数据对应的第一校验码,其中,第一数据为校验装置300采集的数据;处理模块301,用于执行以下操作:获取第一校验码和根据所述第一校验码生成校验子消息,所述第一校验码是第一硬件模块计算得到的第一数据对应的校验码,所述第一数据为所述第一设备向第二设备发送的数据;发送模块302,用于向所述第二设备发送所述第一数据的校验子消息。Please refer to FIG. 3, which is a schematic structural diagram of the verification device in this embodiment of the application. The verification device 300 includes: a processing module 301, a sending module 302, and a first hardware module 303. The first hardware module 303, It is used to calculate the first check code corresponding to the first data, where the first data is the data collected by the check device 300; the processing module 301 is configured to perform the following operations: obtain the first check code and according to the first check code The check code generates a syndrome message, the first check code is the check code corresponding to the first data calculated by the first hardware module, and the first data is sent by the first device to the second device Data; sending module 302, used to send the syndrome message of the first data to the second device.
在本申请的一些实施例中,所述处理模块301还用于:根据所述第一数据生成至少一个实时发布订阅RTPS协议报文;将所述第一数据的校验子消息插入所述至少一个RTPS协议报文中的每一个报文中;所述发送模块具体用于:将所述至少一个RTPS协议报文中的每一个报文依次发送至所述第二设备。In some embodiments of the present application, the processing module 301 is further configured to: generate at least one real-time publish and subscribe RTPS protocol message according to the first data; insert the syndrome message of the first data into the at least In each message in one RTPS protocol message; the sending module is specifically configured to: send each message in the at least one RTPS protocol message to the second device in turn.
在本申请的一些实施例中,所述处理模块301具体用于:若所述第一数据的数据长度大于或等于第一阈值,根据所述第一数据生成多个RTPS协议报文,其中,所述多个RTPS协议报文为分片报文;若所述第一数据的数据长度小于所述第一阈值,所述第一设备根据所述第一数据生成一个RTPS协议报文,其中,所述RTPS协议报文为非分片报文。In some embodiments of the present application, the processing module 301 is specifically configured to: if the data length of the first data is greater than or equal to a first threshold, generate multiple RTPS protocol messages according to the first data, where: The multiple RTPS protocol messages are fragmented messages; if the data length of the first data is less than the first threshold, the first device generates an RTPS protocol message according to the first data, where: The RTPS protocol message is a non-fragmented message.
在本申请的一些实施例中,所述处理模块301具体用于:若所述第一数据的数据长度大于或等于第二阈值,控制所述第一硬件模块计算得到所述第一校验码。In some embodiments of the present application, the processing module 301 is specifically configured to: if the data length of the first data is greater than or equal to a second threshold, control the first hardware module to calculate the first check code .
在本申请的一些实施例中,所述第一数据的校验子消息中还包括以下至少一项参数:数据长度、超时参数、数据序列号。In some embodiments of the present application, the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
在本申请的一些实施例中,所述校验装置300为车载传感器,所述第二设备为车载主控设备。In some embodiments of the present application, the verification device 300 is a vehicle-mounted sensor, and the second device is a vehicle-mounted master control device.
在本申请实施例中,校验装置300具体可以为上述的第一设备,其各个组成模块(处理模块301、发送模块302和第一硬件模块303)可用于执行上述方法实施例中第一设备的所有操作。In the embodiment of the present application, the verification apparatus 300 may specifically be the aforementioned first device, and its respective component modules (processing module 301, sending module 302, and first hardware module 303) can be used to execute the first device in the foregoing method embodiment. All operations.
请参阅图4所示,为本申请实施例中校验装置的一个结构示意图。校验装置400包括:接收模块401、处理模块402和第二硬件模块403,其中,第二硬件模块403,用于计算第二数据对应的校验码,其中,所述第二数据为所述第二设备从所述第一设备接收到的数据;接收模块401,用于接收第一设备发送的第一数据的校验子消息,其中,所述第一数据为所述第一设备采集的数据;处理模块402,用于从所述第一数据的校验子消息中提取第一校验码、获取第二校验码、和根据所述第一校验码和所述第二校验码进行数据校验,其中,所述第二校验码是所述第二设备中的第二硬件模块。Please refer to FIG. 4, which is a schematic structural diagram of the verification device in an embodiment of this application. The verification device 400 includes: a receiving module 401, a processing module 402, and a second hardware module 403. The second hardware module 403 is used to calculate a verification code corresponding to the second data, where the second data is the The data received by the second device from the first device; the receiving module 401 is configured to receive the syndrome message of the first data sent by the first device, where the first data is collected by the first device Data; processing module 402, used to extract the first check code from the syndrome message of the first data, obtain the second check code, and according to the first check code and the second check Code for data verification, where the second verification code is a second hardware module in the second device.
在本申请的一些实施例中,所述接收模块401具体用于:接收所述第一设备发送的实时发布订阅RTPS协议报文;从所述RTPS协议报文中提取所述第一数据的校验子消息。In some embodiments of the present application, the receiving module 401 is specifically configured to: receive a real-time publish and subscribe RTPS protocol message sent by the first device; and extract the correction of the first data from the RTPS protocol message. Test child news.
在本申请的一些实施例中,所述处理模块402具体用于:根据所述RTPS协议报文中的校验子消息判断所述RTPS协议报文是否为分片报文;若所述RTPS协议报文为分片报文,确定所述第一数据对应的多个分片报文;提取所述多个分片报文中任意一个报文中的校验子消息,得到所述第一数据的校验子消息。In some embodiments of the present application, the processing module 402 is specifically configured to: determine whether the RTPS protocol message is a fragmented message according to the syndrome message in the RTPS protocol message; if the RTPS protocol message The message is a fragmented message, and multiple fragmented messages corresponding to the first data are determined; the syndrome message in any one of the multiple fragmented messages is extracted to obtain the first data The syndrome message.
在本申请的一些实施例中,所述处理模块402还用于:若所述RTPS协议报文为非分片报文,确定所述第一数据对应的一个RTPS协议报文;提取所述第一数据对应的一个RTPS协议报文中的校验子消息,得到所述第一数据的校验子消息。In some embodiments of the present application, the processing module 402 is further configured to: if the RTPS protocol message is a non-fragmented message, determine an RTPS protocol message corresponding to the first data; and extract the first data A syndrome message in an RTPS protocol message corresponding to one piece of data obtains the syndrome message of the first data.
在本申请的一些实施例中,所述处理模块402具体用于:若所述RTPS协议报文中的校验子消息与所述RTPS协议报文的上下报文中的校验子消息均不相同,确定所述RTPS协议报文为非分片报文;若所述RTPS协议报文中的校验子消息与所述RTPS协议报文的上下报文中的任意一个校验子消息相同,确定所述RTPS协议报文为分片报文。In some embodiments of the present application, the processing module 402 is specifically configured to: if the syndrome message in the RTPS protocol message is different from the syndrome message in the upper and lower messages of the RTPS protocol message. Same, it is determined that the RTPS protocol message is a non-fragmented message; if the syndrome message in the RTPS protocol message is the same as any syndrome message in the upper and lower messages of the RTPS protocol message, It is determined that the RTPS protocol message is a fragmented message.
在本申请的一些实施例中,所述第一数据的校验子消息中还包括以下至少一项参数:数据长度、超时参数、数据序列号。In some embodiments of the present application, the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
在本申请的一些实施例中,所述处理模块402具体用于:若所述第一校验码等于所述第二校验码,确定数据校验成功;否则,所述第二设备确定数据校验失败。In some embodiments of the present application, the processing module 402 is specifically configured to: if the first check code is equal to the second check code, determine that the data check is successful; otherwise, the second device determines the data The verification failed.
在本申请的一些实施例中,所述第一设备为车载传感器,所述校验装置400为车载主控设备。In some embodiments of the present application, the first device is a vehicle-mounted sensor, and the verification device 400 is a vehicle-mounted master control device.
在本申请实施例中,校验装置400具体可以为上述的第二备,其各个组成模块(接收模块401、处理模块402和第二硬件模块403)可用于执行上述方法实施例中第二设备的所有操作。In the embodiment of the present application, the verification apparatus 400 may specifically be the above-mentioned second device, and its respective component modules (receiving module 401, processing module 402, and second hardware module 403) may be used to execute the second device in the above method embodiment. All operations.
需要说明的是,上述装置各模块/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其带来的技术效果与本申请方法实施例相同,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。It should be noted that the information interaction and execution process among the various modules/units of the above-mentioned device are based on the same concept as the method embodiment of the present application, and the technical effects brought by it are the same as those of the method embodiment of the present application, and the specific content may be Please refer to the description in the method embodiment shown above in this application, which will not be repeated here.
本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质存储有程序,该程序执行包括上述方法实施例中记载的部分或全部步骤。An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a program, and the program executes some or all of the steps recorded in the above method embodiments.
接下来介绍本申请实施例中提供的另一种校验装置,其中该校验装置具体可以为上述的第一设备,请参阅图5所示,校验装置500包括:处理器501,其中校验装置500中中处理器数量可以是一个或多个,图5中以一个处理器为例。可选地,校验装置500还包括包括:存储器502、收发器503和第一硬件模块504。其中处理器501、存储器502、收发器503和第一硬件模块504可通过总线或其它方式连接,其中,图5中以通过总线连接为例。Next, another verification device provided in an embodiment of the present application will be introduced. The verification device may specifically be the above-mentioned first device. As shown in FIG. 5, the verification device 500 includes a processor 501, wherein the verification device 500 includes a processor 501. The number of processors in the test apparatus 500 may be one or more, and one processor is taken as an example in FIG. 5. Optionally, the verification apparatus 500 further includes: a memory 502, a transceiver 503, and a first hardware module 504. The processor 501, the memory 502, the transceiver 503, and the first hardware module 504 may be connected by a bus or other methods. In FIG. 5, the connection by a bus is taken as an example.
存储器502可以包括只读存储器和随机存取存储器,并向处理器1103提供指令和数据。存储器502的一部分还可以包括非易失性随机存取存储器(non-volatile random access memory,NVRAM)。存储器502存储有操作系统和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。操作系统可包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。The memory 502 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1103. A part of the memory 502 may also include a non-volatile random access memory (NVRAM). The memory 502 stores an operating system and operating instructions, executable modules or data structures, or a subset of them, or an extended set of them. The operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks.
处理器501控制第一设备500的操作,处理器501还可以称为中央处理单元(central processing unit,CPU)。具体的应用中,校验装置500的各个组件通过总线系统耦合在一起,其中总线系统除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都称为总线系统。The processor 501 controls the operation of the first device 500, and the processor 501 may also be referred to as a central processing unit (CPU). In a specific application, the various components of the verification device 500 are coupled together through a bus system. In addition to the data bus, the bus system may also include a power bus, a control bus, and a status signal bus. However, for the sake of clear description, various buses are referred to as bus systems in the figure.
上述本申请实施例揭示的方法可以应用于处理器501中,或者由处理器501实现。处理器501可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器501中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器501可以是通用处理器、数字信号处理器(digital signal processing,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本 申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器502,处理器501读取存储器502中的信息,结合其硬件完成上述方法的步骤。The method disclosed in the foregoing embodiment of the present application may be applied to the processor 501 or implemented by the processor 501. The processor 501 may be an integrated circuit chip with signal processing capability. In the implementation process, the steps of the foregoing method can be completed by an integrated logic circuit of hardware in the processor 501 or instructions in the form of software. The aforementioned processor 501 may be a general-purpose processor, a digital signal processing (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or Other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers. The storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502, and completes the steps of the foregoing method in combination with its hardware.
收发器503,可用于接收输入的数字或字符信息,以及产生与校验装置500的相关设置以及功能控制有关的信号输入,以及可用于通过外接接口输出数字或字符信息。The transceiver 503 can be used to receive input digital or character information, and to generate signal input related to the relevant settings and function control of the verification device 500, and can be used to output digital or character information through an external interface.
本申请实施例中,处理器501,用于执行前述的第一设备执行的数据校验方法。In this embodiment of the present application, the processor 501 is configured to execute the aforementioned data verification method executed by the first device.
接下来介绍本申请实施例中提供的另一种校验装置,该校验装置具体可以是上述的第二设备,请参阅图6所示,校验装置600包括:处理器601,其中校验装置600中处理器数量可以是一个或多个,图6中以一个处理器为例。可选地,校验装置600还包括包括:存储器602、收发器603和第二硬件模块604。其中处理器601、存储器502、收发器503和第二硬件模块504可通过总线或其它方式连接,其中,图6中以通过总线连接为例。Next, another verification device provided in the embodiment of the present application is introduced. The verification device may specifically be the above-mentioned second device. Please refer to FIG. 6. The verification device 600 includes a processor 601, wherein the verification device 600 includes a processor 601. The number of processors in the apparatus 600 may be one or more, and one processor is taken as an example in FIG. 6. Optionally, the verification apparatus 600 further includes: a memory 602, a transceiver 603, and a second hardware module 604. The processor 601, the memory 502, the transceiver 503, and the second hardware module 504 may be connected by a bus or other methods. In FIG. 6, the connection by a bus is taken as an example.
存储器602可以包括只读存储器和随机存取存储器,并向处理器1103提供指令和数据。存储器602的一部分还可以包括非易失性随机存取存储器(non-volatile random access memory,NVRAM)。存储器602存储有操作系统和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。操作系统可包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。The memory 602 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1103. A part of the memory 602 may also include a non-volatile random access memory (NVRAM). The memory 602 stores an operating system and operating instructions, executable modules or data structures, or a subset of them, or an extended set of them. The operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks.
处理器601控制第二设备600的操作,处理器601还可以称为中央处理单元(central processing unit,CPU)。具体的应用中,校验装置600的各个组件通过总线系统耦合在一起,其中总线系统除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都称为总线系统。The processor 601 controls the operation of the second device 600, and the processor 601 may also be referred to as a central processing unit (CPU). In a specific application, the various components of the verification device 600 are coupled together through a bus system, where the bus system may include a power bus, a control bus, a status signal bus, etc., in addition to a data bus. However, for the sake of clear description, various buses are referred to as bus systems in the figure.
上述本申请实施例揭示的方法可以应用于处理器601中,或者由处理器601实现。处理器601可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器601中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器601可以是通用处理器、数字信号处理器(digital signal processing,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器602,处理器601读取存储器602中的信息,结合其硬件完成上述方法的步骤。The method disclosed in the foregoing embodiment of the present application may be applied to the processor 601 or implemented by the processor 601. The processor 601 may be an integrated circuit chip with signal processing capability. In the implementation process, the steps of the foregoing method can be completed by an integrated logic circuit of hardware in the processor 601 or instructions in the form of software. The aforementioned processor 601 may be a general-purpose processor, a digital signal processing (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or Other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602, and completes the steps of the foregoing method in combination with its hardware.
收发器603,可用于接收输入的数字或字符信息,以及产生与校验装置600的相关设 置以及功能控制有关的信号输入,以及可用于通过外接接口输出数字或字符信息。The transceiver 603 can be used to receive input digital or character information, and to generate signal input related to the relevant settings and function control of the verification device 600, and can be used to output digital or character information through an external interface.
本申请实施例中,处理器601,用于执行前述的第二设备执行的数据校验方法。In this embodiment of the present application, the processor 601 is configured to execute the aforementioned data verification method executed by the second device.
其中,上述任一处提到的处理器,可以是一个通用中央处理器,微处理器,ASIC,或一个或多个用于控制上述第一方面方法的程序执行的集成电路。Wherein, the processor mentioned in any of the foregoing may be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the program of the method in the first aspect.
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。In addition, it should be noted that the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physically separate. The physical unit can be located in one place or distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments. In addition, in the drawings of the device embodiments provided in the present application, the connection relationship between the modules indicates that they have a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、ROM、RAM、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including dedicated integrated circuits, dedicated CPUs, dedicated memory, Dedicated components and so on to achieve. Under normal circumstances, all functions completed by computer programs can be easily implemented with corresponding hardware. Moreover, the specific hardware structures used to achieve the same function can also be diverse, such as analog circuits, digital circuits or special-purpose circuits. Circuit etc. However, for this application, software program implementation is a better implementation in more cases. Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a readable storage medium, such as a computer floppy disk. , U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., including several instructions to make a computer device (which can be a personal computer, server, or network device, etc.) execute the methods described in each embodiment of this application .
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part.
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website, computer, server or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a server or a data center integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).

Claims (32)

  1. 一种数据校验方法,其特征在于,包括:A data verification method, which is characterized in that it comprises:
    第一设备获取第一数据对应的第一校验码,其中,所述第一校验码是所述第一设备中的第一硬件模块计算得到的,所述第一数据为所述第一设备采集的数据;The first device obtains a first check code corresponding to the first data, where the first check code is calculated by a first hardware module in the first device, and the first data is the first Data collected by the equipment;
    所述第一设备根据所述第一校验码生成所述第一数据的校验子消息;Generating, by the first device, a syndrome message of the first data according to the first check code;
    所述第一设备向第二设备发送所述第一数据的校验子消息,其中,所述第一数据的校验子消息用于所述第二设备进行数据校验。The first device sends the syndrome message of the first data to the second device, where the syndrome message of the first data is used by the second device to perform data verification.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    所述第一设备根据所述第一数据生成至少一个实时发布订阅RTPS协议报文;Generating, by the first device, at least one real-time publish and subscribe RTPS protocol message according to the first data;
    所述第一设备将所述第一数据的校验子消息插入所述至少一个RTPS协议报文中的每一个报文中;Inserting the syndrome message of the first data into each of the at least one RTPS protocol message by the first device;
    所述第一设备向所述第二设备发送所述第一数据的校验子消息,包括:The first device sending the syndrome message of the first data to the second device includes:
    所述第一设备将所述至少一个RTPS协议报文中的每一个报文依次发送至所述第二设备。The first device sequentially sends each of the at least one RTPS protocol packet to the second device.
  3. 根据权利要求2所述的方法,其特征在于,所述第一设备根据所述第一数据生成至少一个实时发布订阅RTPS协议报文,包括:The method according to claim 2, wherein the first device generating at least one real-time publish and subscribe RTPS protocol message according to the first data comprises:
    若所述第一数据的数据长度大于或等于第一阈值,所述第一设备根据所述第一数据生成多个RTPS协议报文,其中,所述多个RTPS协议报文为分片报文;If the data length of the first data is greater than or equal to the first threshold, the first device generates multiple RTPS protocol packets according to the first data, where the multiple RTPS protocol packets are fragmented packets ;
    若所述第一数据的数据长度小于所述第一阈值,所述第一设备根据所述第一数据生成一个RTPS协议报文,其中,所述RTPS协议报文为非分片报文。If the data length of the first data is less than the first threshold, the first device generates an RTPS protocol message according to the first data, where the RTPS protocol message is a non-fragmented message.
  4. 根据权利要求1-3任一所述的方法,其特征在于,所述第一设备获取第一校验码,包括:The method according to any one of claims 1 to 3, wherein the obtaining of the first check code by the first device comprises:
    若所述第一数据的数据长度大于或等于第二阈值,所述第一设备控制所述第一硬件模块计算得到所述第一校验码。If the data length of the first data is greater than or equal to the second threshold, the first device controls the first hardware module to calculate the first check code.
  5. 根据权利要求1-4任一所述的方法,其特征在于,所述第一数据的校验子消息中还包括以下至少一项参数:数据长度、超时参数、数据序列号。The method according to any one of claims 1 to 4, wherein the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
  6. 根据权利要求1-5任一所述的方法,其特征在于,所述第一设备为车载传感器,所述第二设备为车载主控设备。The method according to any one of claims 1 to 5, wherein the first device is a vehicle-mounted sensor, and the second device is a vehicle-mounted main control device.
  7. 一种数据校验方法,其特征在于,包括:A data verification method, which is characterized in that it comprises:
    第二设备接收第一设备发送的第一数据的校验子消息,其中,所述第一数据为所述第一设备采集的数据;The second device receives the syndrome message of the first data sent by the first device, where the first data is data collected by the first device;
    所述第二设备从所述第一数据的校验子消息中提取第一校验码;The second device extracts the first check code from the syndrome message of the first data;
    所述第二设备获取第二校验码,其中,所述第二校验码是所述第二设备中的第二硬件模块计算得到的第二数据对应的校验码,所述第二数据为所述第二设备从所述第一设备接收到的数据;The second device obtains a second check code, where the second check code is a check code corresponding to the second data calculated by a second hardware module in the second device, and the second data Is the data received by the second device from the first device;
    所述第二设备根据所述第一校验码和所述第二校验码进行数据校验。The second device performs data verification according to the first verification code and the second verification code.
  8. 根据权利要求7所述的方法,其特征在于,所述第二设备接收第一设备发送的第一 数据的校验子消息,包括:The method according to claim 7, wherein the second device receiving the syndrome message of the first data sent by the first device comprises:
    所述第二设备接收所述第一设备发送的实时发布订阅RTPS协议报文;所述第二设备从所述RTPS协议报文中提取所述第一数据的校验子消息。The second device receives the real-time publish and subscribe RTPS protocol message sent by the first device; the second device extracts the syndrome message of the first data from the RTPS protocol message.
  9. 根据权利要求8所述的方法,其特征在于,所述第二设备从所述RTPS协议报文中提取所述第一数据的校验子消息,包括:The method according to claim 8, wherein the second device extracting the syndrome message of the first data from the RTPS protocol message comprises:
    所述第二设备根据所述RTPS协议报文中的校验子消息判断所述RTPS协议报文是否为分片报文;The second device judges whether the RTPS protocol message is a fragmented message according to the syndrome message in the RTPS protocol message;
    若所述RTPS协议报文为分片报文,所述第二设备确定所述第一数据对应的多个分片报文;If the RTPS protocol message is a fragmented message, the second device determines multiple fragmented messages corresponding to the first data;
    所述第二设备提取所述多个分片报文中任意一个报文中的校验子消息,得到所述第一数据的校验子消息。The second device extracts the syndrome message in any one of the multiple fragmented messages to obtain the syndrome message of the first data.
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method according to claim 9, wherein the method further comprises:
    若所述RTPS协议报文为非分片报文,所述第二设备确定所述第一数据对应的一个RTPS协议报文;If the RTPS protocol message is a non-fragmented message, the second device determines an RTPS protocol message corresponding to the first data;
    所述第二设备提取所述第一数据对应的一个RTPS协议报文中的校验子消息,得到所述第一数据的校验子消息。The second device extracts the syndrome message in an RTPS protocol message corresponding to the first data to obtain the syndrome message of the first data.
  11. 根据权利要求9或10所述的方法,其特征在于,所述第二设备根据所述RTPS协议报文中的校验子消息判断所述RTPS协议报文是否为分片报文,包括:The method according to claim 9 or 10, wherein the second device judging whether the RTPS protocol message is a fragmented message according to the syndrome message in the RTPS protocol message comprises:
    若所述RTPS协议报文中的校验子消息与所述RTPS协议报文的上下报文中的校验子消息均不相同,所述第二设备确定所述RTPS协议报文为非分片报文;If the syndrome message in the RTPS protocol message is different from the syndrome message in the upper and lower messages of the RTPS protocol message, the second device determines that the RTPS protocol message is non-fragmented Message
    若所述RTPS协议报文中的校验子消息与所述RTPS协议报文的上下报文中的任意一个校验子消息相同,所述第二设备确定所述RTPS协议报文为分片报文。If the syndrome message in the RTPS protocol message is the same as any syndrome message in the upper and lower messages of the RTPS protocol message, the second device determines that the RTPS protocol message is a fragmented message Text.
  12. 根据权利要求7-11任一所述的方法,其特征在于,所述第一数据的校验子消息中还包括以下至少一项参数:数据长度、超时参数、数据序列号。The method according to any one of claims 7-11, wherein the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
  13. 根据权利要求7-12任一所述的方法,其特征在于,所述第二设备根据所述第一校验码和所述第二校验码进行数据校验,包括:The method according to any one of claims 7-12, wherein the second device performs data verification according to the first check code and the second check code, comprising:
    若所述第一校验码等于所述第二校验码,所述第二设备确定数据校验成功;If the first check code is equal to the second check code, the second device determines that the data check succeeds;
    否则,所述第二设备确定数据校验失败。Otherwise, the second device determines that the data verification fails.
  14. 根据权利要求7-13任一所述的方法,其特征在于,所述第一设备为车载传感器,所述第二设备为车载的主控设备。The method according to any one of claims 7-13, wherein the first device is a vehicle-mounted sensor, and the second device is a vehicle-mounted main control device.
  15. 一种校验装置,其特征在于,包括:A verification device, characterized in that it comprises:
    第一硬件模块,用于计算第一数据对应的第一校验码,其中,所述第一数据为所述校验装置采集的数据;The first hardware module is configured to calculate a first check code corresponding to the first data, where the first data is data collected by the check device;
    处理模块,用于获取所述第一校验码和根据所述第一校验码生成所述第一数据的校验子消息;A processing module, configured to obtain the first check code and generate a syndrome message of the first data according to the first check code;
    发送模块,用于向第二设备发送所述第一数据的校验子消息,其中,所述第一数据的校验子消息用于所述第二设备进行数据校验。The sending module is configured to send a syndrome message of the first data to a second device, where the syndrome message of the first data is used by the second device to perform data verification.
  16. 根据权利要求15所述的装置,其特征在于,所述处理模块还用于:The device according to claim 15, wherein the processing module is further configured to:
    根据所述第一数据生成至少一个实时发布订阅RTPS协议报文;Generating at least one real-time publish and subscribe RTPS protocol message according to the first data;
    将所述第一数据的校验子消息插入所述至少一个RTPS协议报文中的每一个报文中;Inserting the syndrome message of the first data into each of the at least one RTPS protocol message;
    所述发送模块具体用于:将所述至少一个RTPS协议报文中的每一个报文依次发送至所述第二设备。The sending module is specifically configured to send each of the at least one RTPS protocol message to the second device in sequence.
  17. 根据权利要求16所述的装置,其特征在于,所述处理模块具体用于:The device according to claim 16, wherein the processing module is specifically configured to:
    若所述第一数据的数据长度大于或等于第一阈值,根据所述第一数据生成多个RTPS协议报文,其中,所述多个RTPS协议报文为分片报文;If the data length of the first data is greater than or equal to the first threshold, generate multiple RTPS protocol messages according to the first data, where the multiple RTPS protocol messages are fragmented messages;
    若所述第一数据的数据长度小于所述第一阈值,所述第一设备根据所述第一数据生成一个RTPS协议报文,其中,所述RTPS协议报文为非分片报文。If the data length of the first data is less than the first threshold, the first device generates an RTPS protocol message according to the first data, where the RTPS protocol message is a non-fragmented message.
  18. 根据权利要求15-17任一所述的装置,其特征在于,所述处理模块具体用于:The device according to any one of claims 15-17, wherein the processing module is specifically configured to:
    若所述第一数据的数据长度大于或等于第二阈值,控制所述第一硬件模块计算得到所述第一校验码。If the data length of the first data is greater than or equal to the second threshold, controlling the first hardware module to calculate the first check code.
  19. 根据权利要求15-18任一所述的装置,其特征在于,所述第一数据的校验子消息中还包括以下至少一项参数:数据长度、超时参数、数据序列号。The device according to any one of claims 15-18, wherein the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
  20. 根据权利要求15-19任一所述的装置,其特征在于,所述校验装置为车载传感器,所述第二设备为车载主控设备。The device according to any one of claims 15-19, wherein the verification device is a vehicle-mounted sensor, and the second device is a vehicle-mounted master control device.
  21. 一种校验装置,其特征在于,包括:A verification device, characterized in that it comprises:
    第二硬件模块,用于计算第二数据对应的校验码,其中,所述第二数据为所述第二设备从所述第一设备接收到的数据;The second hardware module is configured to calculate the check code corresponding to the second data, where the second data is the data received by the second device from the first device;
    接收模块,用于接收第一设备发送的第一数据的校验子消息,其中,所述第一数据为所述第一设备采集的数据;A receiving module, configured to receive a syndrome message of first data sent by a first device, where the first data is data collected by the first device;
    处理模块,用于从所述第一数据的校验子消息中提取第一校验码、获取第二校验码、和根据所述第一校验码和所述第二校验码进行数据校验,其中,所述第二校验码是所述第二设备中的第二硬件模块。The processing module is configured to extract a first check code from the syndrome message of the first data, obtain a second check code, and perform data according to the first check code and the second check code Verification, wherein the second verification code is a second hardware module in the second device.
  22. 根据权利要求21所述的装置,其特征在于,所述接收模块具体用于:The device according to claim 21, wherein the receiving module is specifically configured to:
    接收所述第一设备发送的实时发布订阅RTPS协议报文;Receiving a real-time publish and subscribe RTPS protocol message sent by the first device;
    从所述RTPS协议报文中提取所述第一数据的校验子消息。Extracting the syndrome message of the first data from the RTPS protocol message.
  23. 根据权利要求22所述的装置,其特征在于,所述处理模块具体用于:The device according to claim 22, wherein the processing module is specifically configured to:
    根据所述RTPS协议报文中的校验子消息判断所述RTPS协议报文是否为分片报文;Judging whether the RTPS protocol message is a fragmented message according to the syndrome message in the RTPS protocol message;
    若所述RTPS协议报文为分片报文,确定所述第一数据对应的多个分片报文;If the RTPS protocol message is a fragmented message, determine multiple fragmented messages corresponding to the first data;
    提取所述多个分片报文中任意一个报文中的校验子消息,得到所述第一数据的校验子消息。Extract the syndrome message in any one of the multiple fragmented messages to obtain the syndrome message of the first data.
  24. 根据权利要求23所述的装置,其特征在于,所述处理模块还用于:The device according to claim 23, wherein the processing module is further configured to:
    若所述RTPS协议报文为非分片报文,确定所述第一数据对应的一个RTPS协议报文;If the RTPS protocol message is a non-fragmented message, determine an RTPS protocol message corresponding to the first data;
    提取所述第一数据对应的一个RTPS协议报文中的校验子消息,得到所述第一数据的校验子消息。The syndrome message in an RTPS protocol message corresponding to the first data is extracted to obtain the syndrome message of the first data.
  25. 根据权利要求23或24所述的装置,其特征在于,所述处理模块具体用于:The device according to claim 23 or 24, wherein the processing module is specifically configured to:
    若所述RTPS协议报文中的校验子消息与所述RTPS协议报文的上下报文中的校验子消息均不相同,确定所述RTPS协议报文为非分片报文;If the syndrome message in the RTPS protocol message is different from the syndrome message in the upper and lower messages of the RTPS protocol message, determining that the RTPS protocol message is a non-fragmented message;
    若所述RTPS协议报文中的校验子消息与所述RTPS协议报文的上下报文中的任意一个校验子消息相同,确定所述RTPS协议报文为分片报文。If the syndrome message in the RTPS protocol message is the same as any syndrome message in the upper and lower messages of the RTPS protocol message, it is determined that the RTPS protocol message is a fragmented message.
  26. 根据权利要求21-25任一所述的装置,其特征在于,所述第一数据的校验子消息中还包括以下至少一项参数:数据长度、超时参数、数据序列号。The device according to any one of claims 21-25, wherein the syndrome message of the first data further includes at least one of the following parameters: data length, timeout parameter, and data sequence number.
  27. 根据权利要求21-26任一所述的装置,其特征在于,所述处理模块具体用于:The device according to any one of claims 21-26, wherein the processing module is specifically configured to:
    若所述第一校验码等于所述第二校验码,确定数据校验成功;否则,所述第二设备确定数据校验失败。If the first check code is equal to the second check code, it is determined that the data check succeeds; otherwise, the second device determines that the data check fails.
  28. 根据权利要求21-26任一所述的装置,其特征在于,所述第一设备为车载传感器,所述校验装置为车载主控设备。The device according to any one of claims 21-26, wherein the first device is a vehicle-mounted sensor, and the verification device is a vehicle-mounted master control device.
  29. 一种校验装置,其特征在于,包括:A verification device, characterized in that it comprises:
    处理器,所述处理器与存储器耦合,所述存储器用于存储操作指令;A processor, the processor is coupled with a memory, and the memory is used to store operation instructions;
    所述处理器用于通过调用所述操作指令,以执行上述权利要求1-6中任一项中所述的方法。The processor is configured to execute the method described in any one of claims 1 to 6 by calling the operation instruction.
  30. 根据权利要求29所述的装置,其特征在于,所述校验装置还包括:第一硬件模块,用于计算第一数据对应的第一校验码。The device according to claim 29, wherein the verification device further comprises: a first hardware module, configured to calculate a first verification code corresponding to the first data.
  31. 一种校验装置,其特征在于,包括:A verification device, characterized in that it comprises:
    处理器,所述处理器与存储器耦合,所述存储器用于存储操作指令;A processor, the processor is coupled with a memory, and the memory is used to store operation instructions;
    所述处理器用于通过调用所述操作指令,以执行上述权利要求7-14中任一项中所述的方法。The processor is configured to execute the method described in any one of the above claims 7-14 by invoking the operation instruction.
  32. 根据权利要求31所述的装置,其特征在于,所述校验装置还包括:第二硬件模块,用于计算第二数据对应的第二校验码。The device according to claim 31, wherein the verification device further comprises: a second hardware module for calculating a second verification code corresponding to the second data.
PCT/CN2019/130369 2019-12-31 2019-12-31 Data checking method and apparatus WO2021134418A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980102869.8A CN114788199A (en) 2019-12-31 2019-12-31 Data verification method and device
PCT/CN2019/130369 WO2021134418A1 (en) 2019-12-31 2019-12-31 Data checking method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/130369 WO2021134418A1 (en) 2019-12-31 2019-12-31 Data checking method and apparatus

Publications (1)

Publication Number Publication Date
WO2021134418A1 true WO2021134418A1 (en) 2021-07-08

Family

ID=76685815

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/130369 WO2021134418A1 (en) 2019-12-31 2019-12-31 Data checking method and apparatus

Country Status (2)

Country Link
CN (1) CN114788199A (en)
WO (1) WO2021134418A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113609532A (en) * 2021-08-13 2021-11-05 阳光电源股份有限公司 Data integrity checking method and device, computer equipment and storage medium
CN114024576A (en) * 2021-09-29 2022-02-08 广东电网有限责任公司电力调度控制中心 Low-voltage power line carrier operation and maintenance control method and system
CN116781756A (en) * 2023-08-21 2023-09-19 成都骁博锐电子科技有限责任公司 Automobile whole control system and automobile wireless communication control method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050047590A1 (en) * 2003-08-28 2005-03-03 Sunplus Technology Co., Ltd. System and method of applying parity bits to protect transmitting and receiving data
CN106209982A (en) * 2016-06-24 2016-12-07 成都之达科技有限公司 Tire pressure monitoring method based on wireless senser
CN110086891A (en) * 2019-06-25 2019-08-02 奥特酷智能科技(南京)有限公司 The method of distributed communication is realized in automatic Pilot based on DDS agreement
CN110351015A (en) * 2019-08-21 2019-10-18 上海云丁微电子有限公司 A kind of data transmission method for uplink, method of reseptance and equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102281121B (en) * 2010-06-13 2014-10-29 中兴通讯股份有限公司 Method, equipment and system for transmitting and verifying data file
CN104579948A (en) * 2013-10-29 2015-04-29 国家计算机网络与信息安全管理中心 Method and device for fragmenting message
JP6657690B2 (en) * 2015-09-10 2020-03-04 富士ゼロックス株式会社 Decoding device, program, and information transmission system
CN111174805A (en) * 2019-04-30 2020-05-19 奥特酷智能科技(南京)有限公司 Distributed centralized automatic driving system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050047590A1 (en) * 2003-08-28 2005-03-03 Sunplus Technology Co., Ltd. System and method of applying parity bits to protect transmitting and receiving data
CN106209982A (en) * 2016-06-24 2016-12-07 成都之达科技有限公司 Tire pressure monitoring method based on wireless senser
CN110086891A (en) * 2019-06-25 2019-08-02 奥特酷智能科技(南京)有限公司 The method of distributed communication is realized in automatic Pilot based on DDS agreement
CN110351015A (en) * 2019-08-21 2019-10-18 上海云丁微电子有限公司 A kind of data transmission method for uplink, method of reseptance and equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
KAI BECKMANN , MARCUS THOSS: "A wireless sensor network protocol for the OMG Data Distribution Service", PROCEEDINGS OF THE 10TH INTERNATIONAL WORKSHOP ON INTELLIGENT SOLUTIONS IN EMBEDDED SYSTEMS, 1 July 2012 (2012-07-01), pages 45 - 50, XP055826423 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113609532A (en) * 2021-08-13 2021-11-05 阳光电源股份有限公司 Data integrity checking method and device, computer equipment and storage medium
CN113609532B (en) * 2021-08-13 2024-04-12 阳光电源股份有限公司 Data integrity checking method and device, computer equipment and storage medium
CN114024576A (en) * 2021-09-29 2022-02-08 广东电网有限责任公司电力调度控制中心 Low-voltage power line carrier operation and maintenance control method and system
CN114024576B (en) * 2021-09-29 2022-12-23 广东电网有限责任公司电力调度控制中心 Low-voltage power line carrier operation and maintenance control method
CN116781756A (en) * 2023-08-21 2023-09-19 成都骁博锐电子科技有限责任公司 Automobile whole control system and automobile wireless communication control method

Also Published As

Publication number Publication date
CN114788199A (en) 2022-07-22

Similar Documents

Publication Publication Date Title
CN111512603B (en) Data transmission method and first equipment
US10868767B2 (en) Data transmission method and apparatus in optoelectronic hybrid network
US10346344B2 (en) Method, client device and data forwarding device for transmitting data through serial port
WO2021134418A1 (en) Data checking method and apparatus
CN111327603B (en) Data transmission method, device and system
CN110061896B (en) MODBUS-RTU bus address conflict detection method
JP2008131640A (en) Network testing apparatus and method
CN110830460B (en) Connection establishing method and device, electronic equipment and storage medium
WO2020042884A1 (en) Data transmission method and system between internet-of-things devices, and electronic device
CN104348578B (en) The method and device of data processing
CN105610730B (en) Message interaction method and system between CPU and network equipment
CN110870286B (en) Fault tolerance processing method and device and server
US11892955B2 (en) System and method for bypass memory read request detection
CN106815128A (en) Log-output method and device, electronic equipment
CN112713964B (en) Data verification acceleration method and device, computer equipment and storage medium
CN110134419B (en) System upgrading method, device, equipment and storage medium for double-sided cabinet
US20120066305A1 (en) Transmitting system and method thereof
CN113259490A (en) Multi-level node network data transmission method based on UDP transmission protocol
CN115633044B (en) Message processing method and device, electronic equipment and storage medium
CN115604052B (en) Vehicle communication interaction method and system and electronic equipment
CN113746647A (en) Data transmission method, node, electronic device and readable storage medium
RU2715016C1 (en) Transmitting device, method, program and recording medium
CN117294400A (en) Data transmission method and device and electronic equipment
CN113472878B (en) Method and device for realizing file dragging transmission in VNC by using browser plug-in
JP2015216450A (en) Information processing apparatus, information processing system and relay program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19958165

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19958165

Country of ref document: EP

Kind code of ref document: A1