WO2023284372A1 - Method for preventing driving data from being tampered with, and related apparatus - Google Patents

Method for preventing driving data from being tampered with, and related apparatus Download PDF

Info

Publication number
WO2023284372A1
WO2023284372A1 PCT/CN2022/090319 CN2022090319W WO2023284372A1 WO 2023284372 A1 WO2023284372 A1 WO 2023284372A1 CN 2022090319 W CN2022090319 W CN 2022090319W WO 2023284372 A1 WO2023284372 A1 WO 2023284372A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
data packet
hash value
packet header
node
Prior art date
Application number
PCT/CN2022/090319
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 华为技术有限公司
Publication of WO2023284372A1 publication Critical patent/WO2023284372A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • the present application relates to the field of data storage, in particular to a method and a related device for preventing tampering of driving data.
  • the storage of driving data is usually realized through the driving data recording system of the vehicle and the cloud database of the car factory.
  • the storage space of the vehicle's own driving data recording system is limited.
  • the storage time of driving data will be limited.
  • the car factory can theoretically modify the driving data arbitrarily, so as to cover up the technical defects of the vehicle, or shirk responsibility after the accident.
  • the embodiment of the present application provides a method for preventing tampering of driving data and a related device, which are used to ensure time authenticity and tamper resistance of driving data.
  • the embodiment of the present application provides a method for preventing tampering of driving data, which is mainly applied to a driving data verification system, and the driving data verification system includes a central node and a plurality of auxiliary nodes.
  • the central node collects driving data within a preset time period; then the central node calculates the driving data using a hash algorithm to obtain a root hash value; the central node generates the root hash value based on the root hash value and time stamp The data packet header of driving data, and use the private key to sign the data packet header; wherein, the timestamp is the system time, and the private key is randomly generated; after the central node generates the data packet header, it sends the data packet header to the auxiliary node; the auxiliary node synchronizes the data packet header; finally, both the central node and the auxiliary node can verify the driving data according to the data packet header.
  • the central node may be the vehicle itself, or a data collection device independent of the vehicle.
  • the auxiliary node includes the car factory's cloud database, the storage device used by the car owner, the verification device corresponding to the car owner, or the database corresponding to the supervision platform. It can be understood that both the central node and the auxiliary node can verify whether the driving data has been tampered with according to the data packet header and the data packet.
  • the central node calculates the original sensor data through the Merkle tree calculation logic to obtain the hash value and the root hash value, thereby constructing the data package; and in the trusted execution environment of the central node, the The root hash value and the trusted timestamp construct the data packet header, and generate a signature private key through the trusted execution environment to sign the data packet header.
  • the driving data verification system can ensure the time authenticity and tamper-proof of the driving data through the data packet header.
  • the central node can directly use the root hash value and the The timestamp generates the packet header. If the software operating environment of the central node is not a secure environment, the central node can generate a data packet header in the trusted execution environment of the central node according to the root hash value and the timestamp, and use the private key to The header of the data packet is signed, the timestamp is the system time generated in the trusted execution environment, and the private key is randomly generated in the trusted execution environment. This ensures the validity of the root hash and timestamp.
  • the software operating environment of the central node i.e. rich execution environment (REE)
  • the central node can directly use the root hash value and the The timestamp generates the packet header.
  • the software operating environment of the central node is not a secure environment, the central node can generate a data packet header in the trusted execution environment of the central node according to the root hash value and the timestamp, and use the private key to The header of the data packet is signed, the timestamp is
  • the driving data may include multiple arrays, where each array corresponds to data of a sensor of the vehicle within the preset time period.
  • the method for the central node to calculate the root hash value according to the driving data can be as follows: separately calculate the hash value corresponding to each array in the plurality of arrays; the central node calculates the hash value according to the Merkle tree The logic combines the hash values corresponding to each array in pairs to calculate the upper layer hash value until the root hash value is obtained.
  • the vehicle data collects data from 4 sensors, which are array 1, array 2, array 3, and data 4; then use the hash algorithm to calculate hash value 1, hash value 2, hash value 3, and hash value Hash value 4; then combine hash value 1 and hash value 2 to get hash value 12, combine hash value 3 and hash value 4 to get hash value 34; finally combine hash value 12 and hash value
  • the value 34 is combined to calculate the hash value 1234, which is the root hash value.
  • the central node may also add the hash value of the data packet header of the previous data packet when generating the data packet header, which specifically includes: the central node obtains the hash value of the previous data packet header, The hash value of the previous data packet header is obtained by performing hash calculation on the entire first data packet header; the central node is based on the hash value of the previous data packet header, the root hash value and the The time stamp generates the data packet header in the trusted execution environment of the central node.
  • the structure in which hash values of front and rear headers are connected is to ensure the continuity of recorded data.
  • constructing the data packet header through the root hash value and timestamp can only ensure the integrity of the current data, but if there is any other data deleted between the current data and the previous data, the hash value is needed
  • the connected structure is guaranteed. With the hash value connected structure, once a data packet header in the middle is maliciously discarded, the forward packet header hash value in the current packet header structure will not match with the previous packet header to recalculate the hash value. It can be found that the data is discarded.
  • the central node may also send all or part of the data of the data packet corresponding to the data packet header to the auxiliary node; wherein, all the data of the data packet includes the driving data in Merck All corresponding hash values and the driving data under the Merkle tree calculation logic; the partial data of the data packet includes the corresponding partial hash value and the part of the driving data of the driving data under the Merkle tree calculation logic content, and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value.
  • the data packet includes two parts: original data, and hash values of various levels in the middle. Part of the data in the data packet refers to: part of the original data+part of the hash value. In this way, the amount of data transmission between devices can be reduced while effectively ensuring data integrity.
  • At least one of the central node or the auxiliary nodes publishes the data packet header. This further enhances immutability. Because the participants in the driving data verification system are limited after all, there is still a certain probability that all nodes will be completely tampered with. Therefore, the real-time disclosure of the data packet header can be collected by any external supervisory party at any time, which is conducive to further enhancing tamper resistance.
  • the present application provides a data acquisition device, which has the function of realizing the behavior of the central node in the first aspect.
  • This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the apparatus includes a unit or a module for performing each step of the above first aspect.
  • the device can be used for: an acquisition module, used to acquire vehicle driving data within a preset time period; a processing module, used to calculate a root hash value based on the driving data; generate a root hash value based on the root hash value and a timestamp A data packet header, and use a private key to sign the data packet header, the time stamp is the system time, and the private key is randomly generated; a sending module is configured to send the data packet header to the auxiliary node.
  • a storage module is also included for storing necessary program instructions and data of the data acquisition device.
  • the device includes: a processor and a transceiver, where the processor is configured to support the data collection device to perform corresponding functions in the method provided in the first aspect above.
  • the transceiver is used to instruct the communication between the central node and the auxiliary node, and send the data packet header and data packet involved in the above method to the auxiliary node.
  • the device may also include a memory, which is used for coupling with the processor, and stores necessary program instructions and data of the data acquisition device.
  • the chip when the device is a chip in the data acquisition device, the chip includes: a processing module and a transceiver module.
  • the transceiver module can be, for example, an input/output interface, a pin or a circuit on the chip, which transmits the data generated by the vehicle sensor to other chips or modules coupled with the chip.
  • the transceiver module is used to obtain the driving data of the vehicle within a preset time period;
  • the processing module can be, for example, a processor, which is used to calculate the root hash value according to the driving data; generate A data packet header, and use a private key to sign the data packet header, the time stamp is the system time, and the private key is randomly generated; the transceiver module is also used to send the data packet header to the auxiliary node.
  • the processing module can execute the computer-executed instructions stored in the storage unit, so as to support the data collection device to execute the method provided in the first aspect above.
  • the storage unit may be a storage unit in the chip, such as a register, a cache, etc., or a storage unit located outside the chip, such as a read-only memory (read-only memory, ROM) or a Other types of static storage devices that store static information and instructions, random access memory (random access memory, RAM), etc.
  • a storage unit in the chip such as a register, a cache, etc.
  • a storage unit located outside the chip such as a read-only memory (read-only memory, ROM) or a Other types of static storage devices that store static information and instructions, random access memory (random access memory, RAM), etc.
  • ROM read-only memory
  • RAM random access memory
  • the device includes: a processor, a baseband circuit, a radio frequency circuit and an antenna.
  • the processor is used to realize the control of some functions of each circuit
  • the baseband circuit is used to generate data packet headers, which are processed by analog conversion, filtering, amplification and frequency up-conversion through the radio frequency circuit, and then sent to the auxiliary node through the antenna.
  • the device further includes a memory, which stores necessary program instructions and data of the central node.
  • the device includes a communication interface and a logic circuit
  • the communication interface is used to obtain the driving data of the vehicle within a preset time period
  • the logic circuit is used to calculate the root hash value according to the driving data
  • according to The root hash value and timestamp generate a data packet header, and use a private key to sign the data packet header, the timestamp is the system time, and the private key is randomly generated
  • the communication interface is also used to transfer the data
  • the packet header is sent to the secondary node.
  • the processor mentioned in any of the above can be a general-purpose central processing unit (Central Processing Unit, CPU), a microprocessor, a specific application integrated circuit (application-specific integrated circuit, ASIC), or one or more An integrated circuit for controlling the program execution of the method for preventing tampering of driving data in the above aspects.
  • CPU Central Processing Unit
  • ASIC application-specific integrated circuit
  • the present application provides a method for preventing tampering of driving data, which is mainly applied to a driving data verification system, and the driving data verification system includes a central node and a plurality of auxiliary nodes.
  • the central node collects driving data within a preset time period; then the central node calculates a root hash value according to the driving data; generates a data packet header according to the root hash value and a timestamp, and uses the private key to The data packet header is signed, the timestamp is the system time, and the private key is randomly generated; after the central node generates the data packet header, it sends the data packet header to the auxiliary node; the auxiliary node synchronizes the data packet header; finally the Both the central node and the auxiliary node can verify the driving data according to the data packet header.
  • the central node may be the vehicle itself, or a data acquisition device independent of the vehicle.
  • the auxiliary node includes the car factory's cloud database, the storage device used by the car owner, the verification device corresponding to the car owner, or the database corresponding to the supervision platform. It can be understood that both the central node and the auxiliary node can verify whether the driving data has been tampered with according to the data packet header and the data packet.
  • the central node calculates the original sensor data through the Merkle tree calculation logic to obtain the hash value and the root hash value, thereby constructing the data package; and in the trusted execution environment of the central node, the The root hash value and the trusted timestamp construct the data packet header, and generate a signature private key through the trusted execution environment to sign the data packet header.
  • the driving data verification system can ensure the time authenticity and tamper-proof of the driving data through the data packet header.
  • the auxiliary node receives all or part of the data of the data packet corresponding to the data packet header sent by the central node; wherein, all the data of the data packet includes the driving data in Merkel All hash values corresponding to the tree calculation logic and the driving data; the partial data of the data packet includes the corresponding partial hash values of the driving data under the Merkle tree calculation logic and part of the driving data , and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value.
  • the data packet includes two parts: original data, and hash values of various levels in the middle. Part of the data in the data packet refers to: part of the original data+part of the hash value. In this way, the amount of data transmission between devices can be reduced while effectively ensuring data integrity.
  • At least one of the central node or the auxiliary nodes publishes the data packet header. This further enhances immutability. Because the participants in the driving data verification system are limited after all, there is still a certain probability that all nodes will be completely tampered with. Therefore, the real-time disclosure of the data packet header can be collected by any external supervisory party at any time, which is conducive to further enhancing tamper resistance.
  • the plurality of auxiliary nodes can mutually verify whether the driving data has been tampered with. Specifically: the first auxiliary node obtains the data packet header of the second auxiliary node, and the first auxiliary node and the second auxiliary node are included in the plurality of auxiliary nodes; the first auxiliary node obtains the second auxiliary node The data packet header of the auxiliary node is compared with the data packet header stored by itself to determine whether the data of the second auxiliary node has been tampered with.
  • the present application provides a data verification device, which has the function of realizing the behavior of the auxiliary node in the first aspect above.
  • This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the apparatus includes a unit or a module for performing each step of the above third aspect.
  • the device can be used for: a receiving module, used to synchronize the data packet header sent by the central node, the data packet header is generated by the central node according to the root hash value and the timestamp, and the data packet header uses the private key To sign, the timestamp is the system time, the private key is randomly generated, the root hash value is calculated by the central node according to the driving data, and the driving data is collected by the central node within a preset time period Obtained; a processing module, configured to use the data packet header to verify the integrity of the driving data.
  • a storage module is also included for storing necessary program instructions and data of the data verification device.
  • the device includes: a processor and a transceiver, where the processor is configured to support the data verification device to perform corresponding functions in the method provided in the third aspect above.
  • the transceiver is used to instruct the communication between the auxiliary node and the central node, and receives the data packet header involved in the above method sent by the central node.
  • the device may also include a memory, which is used to be coupled with the processor, and stores necessary program instructions and data of the data verification device.
  • the chip when the device is a chip in the data verification device, the chip includes: a processing module and a transceiver module.
  • the transceiver module can be, for example, an input/output interface, a pin or a circuit on the chip, which transmits the data generated by the vehicle sensor to other chips or modules coupled with the chip.
  • the transceiver module is used to synchronize the data packet header sent by the central node, the data packet header is generated by the central node according to the root hash value and the timestamp, and the data packet header is signed with a private key, and the timestamp is System time, the private key is randomly generated, the root hash value is calculated by the central node according to the driving data, and the driving data is collected by the central node within a preset time period;
  • the processing module can be, for example A processor, used for verifying the integrity of the driving data by using the data packet header.
  • the processing module can execute the computer-executed instructions stored in the storage unit, so as to support the data collection device to execute the method provided in the third aspect above.
  • the storage unit may be a storage unit in the chip, such as a register, a cache, etc., or a storage unit located outside the chip, such as a read-only memory (read-only memory, ROM) or a Other types of static storage devices that store static information and instructions, random access memory (random access memory, RAM), etc.
  • a storage unit in the chip such as a register, a cache, etc.
  • a storage unit located outside the chip such as a read-only memory (read-only memory, ROM) or a Other types of static storage devices that store static information and instructions, random access memory (random access memory, RAM), etc.
  • ROM read-only memory
  • RAM random access memory
  • the device includes a communication interface and a logic circuit
  • the communication interface is used to synchronize the data packet header sent by the central node
  • the data packet header is generated by the central node according to the root hash value and the timestamp
  • the data packet header is signed with a private key
  • the timestamp is the system time
  • the private key is randomly generated
  • the root hash value is calculated by the central node according to the driving data
  • the driving data is the collected by the central node within a preset time period
  • the logic circuit is used to verify the integrity of the driving data by using the data packet header.
  • the processor mentioned in any of the above can be a general-purpose central processing unit (Central Processing Unit, CPU), a microprocessor, a specific application integrated circuit (application-specific integrated circuit, ASIC), or one or more An integrated circuit for controlling the program execution of the method for preventing tampering of driving data in the above aspects.
  • CPU Central Processing Unit
  • ASIC application-specific integrated circuit
  • the present application provides a driving data verification system.
  • the driving data verification system includes a central node and a plurality of auxiliary nodes, wherein both the central node and the plurality of auxiliary nodes can verify the integrity of the driving data.
  • the central node obtains the driving data of the vehicle within a preset time period; calculates the root hash value according to the driving data; generates a data packet header according to the root hash value and the timestamp, and uses the private key to perform signature, the timestamp is the system time, and the private key is randomly generated;
  • the auxiliary node is used to synchronize the data packet header or, the auxiliary node synchronizes the data packet header and the data packet corresponding to the data packet header.
  • the central node has all or part of the functions of the data collection device described in the second aspect above, and the auxiliary node has all or part of the functions of the data verification device described in the fourth aspect above.
  • the central node can directly use the root hash value in the REE and that timestamp to generate the packet header. If the software operating environment of the central node is not a secure environment, the central node can generate a data packet header in the trusted execution environment of the central node according to the root hash value and the timestamp, and use the private key to The header of the data packet is signed, the timestamp is the system time generated in the trusted execution environment, and the private key is randomly generated in the trusted execution environment. This ensures the validity of the root hash and timestamp.
  • the driving data may include multiple arrays, where each array corresponds to data of a sensor of the vehicle within the preset time period.
  • the method for the central node to calculate the root hash value according to the driving data can be as follows: separately calculate the hash value corresponding to each array in the plurality of arrays; the central node calculates the hash value according to the Merkle tree The logic combines the hash values corresponding to each array in pairs to calculate the upper layer hash value until the root hash value is obtained.
  • the vehicle data collects data from 4 sensors, which are array 1, array 2, array 3, and data 4; then use the hash algorithm to calculate hash value 1, hash value 2, hash value 3, and hash value Hash value 4; then combine hash value 1 and hash value 2 to get hash value 12, combine hash value 3 and hash value 4 to get hash value 34; finally combine hash value 12 and hash value
  • the value 34 is combined to calculate the hash value 1234, which is the root hash value.
  • the central node may also add the hash value of the data packet header of the previous data packet when generating the data packet header, which specifically includes: the central node obtains the hash value of the previous data packet header, The hash value of the previous data packet header is obtained by performing hash calculation on the entire first data packet header; the central node is based on the hash value of the previous data packet header, the root hash value and the The time stamp generates the data packet header in the trusted execution environment of the central node.
  • the structure in which hash values of front and rear headers are connected is to ensure the continuity of recorded data.
  • constructing the data packet header through the root hash value and timestamp can only ensure the integrity of the current data, but if there is any other data deleted between the current data and the previous data, the hash value is needed
  • the connected structure is guaranteed. With the hash value connected structure, once a data packet header in the middle is maliciously discarded, the forward packet header hash value in the current packet header structure will not match with the previous packet header to recalculate the hash value. It can be found that the data is discarded.
  • the auxiliary node receives all or part of the data of the data packet corresponding to the data packet header sent by the central node; wherein, all the data of the data packet includes the driving data in Merkel All hash values corresponding to the tree calculation logic and the driving data; the partial data of the data packet includes the corresponding partial hash values of the driving data under the Merkle tree calculation logic and part of the driving data , and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value.
  • the data packet includes two parts: original data, and hash values of various levels in the middle. Part of the data in the data packet refers to: part of the original data+part of the hash value. In this way, the amount of data transmission between devices can be reduced while effectively ensuring data integrity.
  • At least one of the central node or the auxiliary nodes publishes the data packet header. This further enhances immutability. Because the participants in the driving data verification system are limited after all, there is still a certain probability that all nodes will be completely tampered with. Therefore, the real-time disclosure of the data packet header can be collected by any external supervisory party at any time, which is conducive to further enhancing tamper resistance.
  • the plurality of auxiliary nodes can mutually verify whether the driving data has been tampered with. Specifically: the first auxiliary node obtains the data packet header of the second auxiliary node, and the first auxiliary node and the second auxiliary node are included in the plurality of auxiliary nodes; the first auxiliary node obtains the second auxiliary node The data packet header of the auxiliary node is compared with the data packet header stored by itself to determine whether the data of the second auxiliary node has been tampered with.
  • the embodiments of the present application provide a computer-readable storage medium, where the computer storage medium stores computer instructions, and the computer instructions are used to execute the method in any possible implementation mode of any one of the above-mentioned aspects.
  • the embodiments of the present application provide a computer program including instructions, which, when run on a computer, cause the computer to execute the method in any one of the above aspects.
  • the present application provides a chip system, which includes a processor, used to support the vehicle data acquisition device to implement the functions involved in the above aspect, such as generating or processing the data involved in the above method and/or information.
  • the system-on-a-chip further includes a memory, which is used to store necessary program instructions and data of the vehicle data acquisition device, so as to realize the functions in any one of the above-mentioned aspects.
  • the system-on-a-chip may consist of chips, or may include chips and other discrete devices.
  • Fig. 1 is a schematic diagram of the system architecture of the embodiment of the present application.
  • Figure 2 is a schematic diagram of the Merkle Hash tree
  • Fig. 3 is a schematic structural diagram of a data packet and a data packet header in the embodiment of the present application
  • FIG. 4 is a schematic diagram of an embodiment of a method for preventing tampering of driving data in the embodiment of the present application
  • Fig. 5 is a schematic flow chart of calculating the root hash value in the embodiment of the present application.
  • Fig. 6 is another schematic flow chart of calculating the root hash value in the embodiment of the present application.
  • Fig. 7 is a schematic diagram of the structure of the data packet header at the central node in the embodiment of the present application.
  • FIG. 8 is a schematic diagram of part of the data in the synchronization data packet in the embodiment of the present application.
  • FIG. 9 is an application scene diagram of a method for preventing tampering of driving data in the embodiment of the present application.
  • Fig. 10 is a schematic diagram of an embodiment of the data acquisition device in the embodiment of the present application.
  • FIG. 11 is a schematic diagram of another embodiment of the data acquisition device in the embodiment of the present application.
  • Fig. 12 is a schematic diagram of an embodiment of the data verification device in the embodiment of the present application.
  • Fig. 13 is a schematic diagram of another embodiment of the data verification device in the embodiment of the present application.
  • the naming or numbering of the steps in this application does not mean that the steps in the method flow must be executed in the time/logic sequence indicated by the naming or numbering.
  • the execution order of the technical purpose is changed, as long as the same or similar technical effect can be achieved.
  • the division of units presented in this application is a logical division. In actual application, there may be other division methods. For example, multiple units can be combined or integrated in another system, or some features can be ignored. , or not, in addition, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, and the indirect coupling or communication connection between units may be electrical or other similar forms, this Applications are not limited.
  • the units or subunits described as separate components may or may not be physically separated, may or may not be physical units, or may be distributed into multiple circuit units, and some or all of them may be selected according to actual needs unit to realize the purpose of the application scheme.
  • the technical solution of the embodiment of the present invention is mainly applied between the central node (the vehicle system shown in FIG. 1 ) and the auxiliary node (the user mobile phone, the supervision platform, and the car factory cloud service shown in FIG. 1 ) as shown in FIG. 1 .
  • communication scene can be applied to various communication systems suitable for vehicle communication, such as: Global System of Mobile Communication (GSM) system, Code Division Multiple Access (CDMA) system, broadband code division multiple Wideband Code Division Multiple Access (WCDMA) system, Long Term Evolution (LTE) system, LTE Frequency Division Duplex (FDD) system, LTE Time Division Duplex (TDD), general Mobile communication system (Universal Mobile Telecommunication System, UMTS), 5G communication system, and future wireless communication system, etc.
  • GSM Global System of Mobile Communication
  • CDMA Code Division Multiple Access
  • WCDMA broadband code division multiple Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • FDD Frequency Division Duplex
  • TDD Time Division Duplex
  • Universal Mobile Telecommunication System Universal Mobile
  • the central node collects the driving data within a preset time period; then the central node uses the hash algorithm to calculate the driving data to obtain the root hash value; the central node calculates the root hash value according to the root hash value and time Stamp to generate the data packet header of the driving data, and use the private key to sign the data packet header; wherein, the timestamp is the system time, and the private key is randomly generated; after the central node generates the data packet header, the data packet header Send it to the auxiliary node; the auxiliary node synchronizes the data packet header; finally, both the central node and the auxiliary node can verify the driving data according to the data packet header.
  • TEE Trusted execution environment
  • REE rich execution environment
  • Hash algorithm The input of arbitrary length original data can be transformed into a fixed-length output through the hash algorithm. Any small change in the original data will cause a huge change in the fixed-length result. Hash algorithm can be used to verify the integrity of the original data.
  • Merkle Hash tree A hash binary tree, which, like a standard binary tree, consists of a set of leaf nodes, a set of intermediate nodes, and a root node.
  • the leaf node contains stored data or its hash value
  • the middle node is the hash value of the content of its two child nodes
  • the top root node is also the hash value of the content of its two child nodes.
  • Figure 2 The data 1, data 2, data 3 and data 4 respectively obtain corresponding hash values according to the hash algorithm; then the hash values are combined in pairs to obtain the hash value of the upper layer;
  • the root hash value is obtained by combining two by two.
  • Data integrity is one of the three basic points of information security; in the process of transmitting and storing information or data, to ensure that information or data is not tampered by unauthorized or can be quickly discovered after tampering.
  • digital signatures, hash algorithms and other means are usually used to ensure data integrity.
  • Data packet a kind of data structure defined in the embodiment of this application, which is composed of driving data collected for a period of time and a merkle hash tree (ie, the hash value of each layer of merkle hash) calculated by the driving data.
  • a merkle hash tree ie, the hash value of each layer of merkle hash
  • Data packet header a data structure defined by the present invention.
  • the data packet header data structure mainly includes four parts: root hash value, timestamp, previous data packet header hash value, and TEE digital signature.
  • the specific structure of the data packet and the data packet header can be as shown in Figure 3.
  • Central node the data acquisition node containing the TEE trusted execution environment.
  • the central node is a data acquisition device that comes with the vehicle; another possible implementation is that the data acquisition device is independent of the vehicle, and the data acquisition device is connected to each sensor of the vehicle .
  • Auxiliary node The node that receives the data packet/data packet header data synchronized by the trusted central node. Usually it is the cloud service node of the car factory, the app node of the car owner's mobile phone, etc.
  • Blockchain A chained data structure that combines data blocks in a sequential manner, and a cryptographically guaranteed non-tamperable and unforgeable distributed ledger.
  • Trusted Application An application that runs in a trusted execution environment.
  • Rich execution environment (rich execution environment, REE): Compared with TEE, the general execution environment is rich in resources, but the security is lower than that of TEE environment.
  • Serialization It refers to putting the data structure in the memory into a continuous memory according to a certain format.
  • the role of serialization is to facilitate the calculation and signature of data and the communication and transmission of data. Because of the signature and data transmission, it is more convenient for a piece of continuous memory data.
  • the central node acquires driving data within a preset time period.
  • the central node obtains the driving data collected by all the sensors of the vehicle involved in the work within a preset time period.
  • the central node may also group the driving data. That is, the data of a sensor within a preset time period is an array.
  • the cylinder parameter is an array of 100 elements, which represents 100 cylinder sensor data collected within 10 seconds. Other sensor parameters are similar and will not be repeated here.
  • the central node calculates the root hash value according to the driving data.
  • the method for the central node to calculate the root hash value is as follows:
  • the central node may integrate the data of each sensor into a whole data, and then perform hash calculation on the whole data to obtain the root hash value.
  • the central node groups the driving data, that is, one array is the data collected by a sensor within the preset time period; then the central node calculates the hash value corresponding to each array; according to the default The Kerr tree calculation logic combines the hash values corresponding to each array in pairs to calculate the upper layer hash value until the root hash value is obtained. For example, if an array includes 100 data, an overall hash calculation is performed on the 100 data to obtain a unique hash value corresponding to the array. If multiple arrays are included, multiple hash values will be calculated. Then, the central node calculates multiple hash values corresponding to the multiple arrays using Merkle tree calculation logic to obtain root hash values (also called merkle root hashes) corresponding to the multiple arrays.
  • root hash values also called merkle root hashes
  • the central node combines multiple hash values corresponding to the multiple arrays to calculate a unique hash value, and the final hash value is used as the hash value corresponding to the multiple arrays. root hash.
  • the central node collects the Global Positioning System (Global Positioning System, GPS) sensor data, brake sensor data, cylinder parameters and airbag sensor data at the current moment; then the data of each sensor Perform hash calculation to obtain hash value 1, hash value 2, hash value 3, and hash value 4; under the calculation logic of the Merkle tree, combine the hash value 1 and the hash value 2 to obtain The hash value 12 of the second layer, combine the hash value 3 and the hash value 4 to obtain the hash value 34 of the second layer; finally combine the hash value 12 and the hash value 34 to obtain the root hash value.
  • Global Positioning System Global Positioning System, GPS
  • the central node collects the data of seven sensors at the current moment, they are counted as (sensor1, sensor2, sensor3, sensor4, sensor5, sensor6, sensor7); then perform hash calculation on the data of each sensor to obtain the hash value 1, Hash value 2, hash value 3, hash value 4, hash value 5, hash value 6, hash value 7; then in the second layer of the calculation logic of the Merkle tree, two pairs are combined for hashing During the calculation process, the hash value 1 and the hash value 2 are combined to calculate the hash value 12, the hash value 3 and the hash value 4 are combined to calculate the hash value 34, the hash value 5 and the hash value 6 is combined and calculated to get the hash value 56, and the hash value 7 is a single one, then the hash value 7 is kept; in the third layer of the
  • the combination of the hash values may be a random combination, and the combination order is not limited; as long as the Merkle tree calculation logic can be realized.
  • the central node generates a data packet header according to the root hash value and a time stamp, and signs it with a private key, the time stamp is system time, and the private key is randomly generated.
  • the central node can directly use the root hash value and the timestamp in the REE Generate packet headers. If the software operating environment of the central node is not a secure environment, the central node transmits the root hash value from the REE environment of the central node to the TA program in the trusted execution environment, triggering the TA program to generate a timestamp, and then according to The timestamp and the root hash generate the packet header.
  • the software operating environment i.e. rich execution environment (REE)
  • the central node can directly use the root hash value and the timestamp in the REE Generate packet headers. If the software operating environment of the central node is not a secure environment, the central node transmits the root hash value from the REE environment of the central node to the TA program in the trusted execution environment, triggering the TA program to generate a timestamp, and then according to The timestamp and the root hash generate the packet header.
  • the central node after the central node generates the data packet header, it can also generate a private key through the TA program in the trusted execution environment, which is used to sign the data packet header, so that the driving data verification system can pass the data packet header to ensure that the time of the driving data is true. Safety and tamper resistance.
  • the central node passes the root hash value (merkle root hash) to the TA program in the trusted execution environment, triggering the TA program to generate a trusted timestamp, and at the same time, the TA program obtains the cached previous data packet header Hash value (hash) (if the data packet header at the current moment is the first data packet header, then the previous data packet header hash is all 0, or any other identifier); then the central node will root the hash value in the TEE environment , timestamp, and the hash value of the previous data packet header are serialized and signed by the private key of the TA program to obtain the final data packet header.
  • the structure of the data packet header generated under the architecture shown in FIG. 7 can be specifically as follows:
  • the central node in order to ensure the continuity of data, can also add the hash value of the data packet header of the previous data packet when generating the data packet header, which specifically includes: the central node obtains the hash value of the previous data packet header Hash value, the hash value of the previous data packet header is obtained by hashing the entire first data packet header; the central node is based on the hash value of the previous data packet header, the root hash The value and the timestamp generate the data packet header in the trusted execution environment of the central node.
  • the structure in which hash values of front and rear headers are connected is to ensure the continuity of recorded data.
  • constructing the data packet header through the root hash value and timestamp can only ensure the integrity of the current data, but if there is any other data deleted between the current data and the previous data, the hash value is needed
  • the connected structure is guaranteed. With the hash value connected structure, once a data packet header in the middle is maliciously discarded, the forward packet header hash value in the current packet header structure will not match with the previous packet header to recalculate the hash value. It can be found that the data is discarded.
  • the central node sends the data packet header to the auxiliary node.
  • the central node when it sends the data packet header to the auxiliary node, it may also send all or part of the data of the data packet corresponding to the data packet header to the auxiliary node; wherein, all of the data packet
  • the data includes all the hash values corresponding to the driving data under the Merkle tree calculation logic and the driving data; the partial data of the data packet includes the corresponding partial hash values of the driving data under the Merkle tree calculation logic.
  • Hash value and partial content of the driving data, and partial data of the data packet can be calculated to obtain the root hash value.
  • the data packet includes two parts: original data, and hash values of various levels in the middle. Part of the data in the data packet refers to: part of the original data+part of the hash value. In this way, the amount of data transmission between devices can be reduced while effectively ensuring data integrity.
  • the central node may only synchronize data required by the auxiliary node to the auxiliary node. For example, if the car factory cloud service mainly cares about cylinder parameters and airbag sensor data, then the central node can send only hash12, hash34, hash3, hash4, cylinder parameters and airbag sensor data. It can be understood that, in order to ensure that the integrity of the data can be verified, the data synchronized by the central node to the auxiliary node needs to be able to calculate the root hash value.
  • the synchronization data shown in Figure 8 can meet the conditions, but if only the cylinder parameters and airbag sensor data are kept, the integrity of the data cannot be verified.
  • the auxiliary node if the auxiliary node only synchronizes part of the original data, it can only ensure that the synchronized part of the original data is complete, and it cannot guarantee that all sensor data is complete. Therefore, the auxiliary node can perform data synchronization according to its own demand strategy.
  • all original data if all original data is required, there are two implementation options: 1. Synchronize all data to the car factory cloud database to ensure that the merkle hash tree is complete; 2. Synchronize part of the data to the car factory cloud database, The rest of the data is stored in the vehicle storage system, or stored on other supervision platforms, as long as the data of each node device add up to all the original data.
  • each node can only synchronize the data it needs, while the rest of the data retains the hash value, so that the integrity of this part of the data can be verified , and verify whether the overall data has been tampered with.
  • the auxiliary node uses the data packet header to verify whether the driving data has been tampered with.
  • the auxiliary node can use the root hash value, timestamp and signature in the data packet header to verify whether the driving data is correct.
  • the car factory cloud service receives the data packet according to the relevant software, and stores the data packet in the car factory cloud database; at the same time, it receives the data packet header, performs signature verification, and stores .
  • the car factory cloud service can directly calculate the root hash value based on the data in the data packet, and compare the root hash value with the root hash value in the stored data packet header. If there is no difference, it means that the data has not been processed. Tampering, if there is a difference, it means that the data retained by the automaker's cloud service has been tampered with.
  • the user's mobile phone can obtain the data packet header from the central node in a wireless or wired manner, and at the same time obtain the data packet header stored in the automaker's cloud database downloaded from the automaker's cloud database , and then compare the two. If there is no difference, it means that the data has not been tampered with, and if there is a difference, it means that the data of at least one node has been tampered with.
  • the user's mobile phone obtains the data packet header from the central node through wireless or wired means, and downloads the data packet header and data packets stored in the automaker's cloud database from the automaker's cloud database, then the user's mobile phone obtains the data in the automaker's cloud database.
  • the user's mobile phone can also calculate the root hash value from the root hash value in the data packet header stored by itself and the data packet of the automaker's cloud database Compare with the root hash value of the data packet header of the car factory cloud database. If there is no difference, it means that the data has not been tampered with; if there is a difference, it means that the data of at least one node has been tampered with.
  • the supervision platform receives the data packet according to relevant software, and stores the data packet in the cloud database of the supervision platform; at the same time, it receives the header of the data packet, performs signature verification, and stores it.
  • the monitoring platform service can directly calculate the root hash value based on the data in the data packet, and compare the root hash value with the root hash value in the stored data packet header. If there is no difference, it means that the data has not been processed. Tampering, if there is a difference, it means that the data retained by the monitoring platform has been tampered with.
  • the supervision platform directly downloads the header of the data packet stored in the cloud database of the automobile manufacturer from the cloud database of the automobile manufacturer, and compares the header of the data packet with the header of the data stored on the supervision platform. If there is no difference, it means that the data has not been tampered with. If there is a difference, it means that the data of at least one node has been tampered with.
  • the supervision platform obtains the data packet header from the central node through wireless or wired means, and downloads the data packet header and data packets stored in the automaker's cloud database from the automaker's cloud database. Compare the root hash value obtained by packet calculation with the root hash value of the data packet header of the automaker's cloud database. If there is no difference, it means that the data packet header retained by the automaker's cloud database matches the data packet; if there is a difference, then It shows that the data packet header retained by the automaker's cloud database does not match the data packet, and the data in the automaker's cloud database may have been tampered with.
  • the supervision platform can also calculate the root hash value from the root hash value in the data packet header stored by itself and the data packet of the automaker’s cloud database Compare with the root hash value of the data packet header of the car factory cloud database. If there is no difference, it means that the data has not been tampered with; if there is a difference, it means that the data of at least one node has been tampered with.
  • each of the above-mentioned auxiliary nodes can also provide a data packet header query service or disclose the data packet header information, which can further enhance non-tampering. Because the number of participants in the entire driving data verification system is limited, there is a certain probability that the data of all nodes will be tampered with. Therefore, the real-time disclosure of data packet header information can be collected by any external supervisory party at any time, which is conducive to further enhancing tamper resistance.
  • the way each auxiliary node discloses the data packet header information includes but is not limited to website disclosure or providing a query interface for external access.
  • the vehicle sends the signature verification public key generated by the TA program in the vehicle's trusted execution environment to the cloud service of the car factory through the vehicle network connection module.
  • the car factory cloud service creates an object instance related to the vehicle, receives and saves the signature verification public key, and the signature verification public key is used for signature verification of the data packet header.
  • the vehicle When the owner's mobile phone is connected to the vehicle through Bluetooth or other means, the vehicle will send the signature verification public key of the TA program to the owner's mobile phone.
  • the owner's mobile phone obtains the public key for signature verification, the identity verification with the vehicle can be performed first, and then the public key can be obtained.
  • the owner's mobile phone saves the signature verification public key, and the signature verification public key is used for signature verification of the data packet header.
  • the vehicle collects driving data, and forms a data packet header and a data packet through the scheme shown in FIG. 4 .
  • the vehicle will cache the data packet and the data packet header.
  • the vehicle starts the network synchronization thread, and continuously synchronizes the data packet header with the car factory cloud service and the car owner's mobile phone. It can be understood that the vehicle can also synchronize all or part of the data in the data package to the car manufacturer's cloud service.
  • the car factory cloud service receives the data packet according to the relevant software, and stores the data packet; at the same time, it receives the data packet header, performs signature verification, and stores it.
  • the car factory cloud service can directly calculate the root hash value based on the data in the data packet, and compare the root hash value with the root hash value in the stored data packet header. If there is no difference, it means that the data has not been processed. Tampering, if there is a difference, it means that the data retained by the automaker's cloud service has been tampered with.
  • the owner's mobile phone can obtain the data packet header from the vehicle in a wireless or wired manner, and at the same time obtain the data packet header downloaded from the automaker's cloud service and stored in the automaker's cloud service, and then compare the two. If there is no difference, it means that the data has not been tampered with, and if there is a difference, it means that the data of at least one node has been tampered with.
  • the data acquisition device 1000 includes: an acquisition module 1001, a processing module 1002, and a sending module 1003, wherein the acquisition module 1001, the processing module 1002, and the sending module 1003 are connected through a bus.
  • the data acquisition device 1000 may be the central node in the above method embodiments, or may be configured as one or more chips in the central node.
  • the data collection device 1000 may be used to execute part or all of the functions of the central node in the above method embodiments.
  • the obtaining module 1001 is used to obtain the driving data of the vehicle within the preset time period; the processing module 1002 is used to obtain the driving data of the vehicle within the preset time period; the sending module 1003 is used to send the data to the auxiliary node Baotou.
  • the processing module 1002 is specifically configured to generate a data packet header in the trusted execution environment of the central node according to the root hash value and the timestamp, and use a private key to verify the data packet header Signing is performed, the timestamp is the system time generated in the trusted execution environment, and the private key is randomly generated in the trusted execution environment.
  • the driving data includes multiple arrays, wherein one array is data collected by a sensor within the preset time period, and the processing module 1002 is specifically configured to calculate the data of the multiple arrays respectively The hash value corresponding to each array in the above; according to the Merkle tree calculation logic, the hash value corresponding to each array is combined to calculate the upper layer hash value until the root hash value is obtained.
  • the obtaining module 1001 is further configured to obtain a hash value of a previous data packet header, and the hash value of the previous data packet header performs hash calculation on the entire first data packet header get;
  • the processing module 1002 is specifically configured to generate the data packet header according to the hash value of the previous data packet header, the root hash value and the timestamp.
  • the sending module 1003 is further configured to send all or part of the data of the data packet corresponding to the data packet header to the assistant node; wherein, all the data of the data packet includes the All the hash values corresponding to the driving data under the Merkel tree calculation logic and the driving data; the partial data of the data packet includes the corresponding part of the hash values and the corresponding part of the driving data under the Merkle tree calculation logic
  • the partial content of the driving data, and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value.
  • the data collection device 1000 further includes a storage module, which is used for buffering the data packet header and the data packet.
  • Storage The storage module is coupled with the processing module 1002, so that the processing module 1002 can execute the computer-executed instructions stored in the storage module to realize the functions of the terminal in the above method embodiments.
  • the storage module optionally included in the data acquisition device 1000 may be a storage unit in the chip, such as a register, a cache, etc., or the storage module may be a storage unit located outside the chip, such as a ROM or a storable Other types of static storage devices, RAM, etc. for static information and instructions.
  • FIG. 11 shows a schematic diagram of a possible structure of the data collection device 1100 in the above embodiment, and the data collection device 1100 may be configured as the aforementioned central node.
  • the data acquisition apparatus 1100 may include: a processor 1102 , a computer-readable storage medium/memory 1103 , a transceiver 1104 , an input device 1105 and an output device 1106 , and a bus 1101 .
  • the processor, the transceiver, the computer-readable storage medium and the like are connected through a bus.
  • the embodiment of the present application does not limit the specific connection medium between the above components.
  • the transceiver 1104 acquires the vehicle's driving data within a preset time period
  • the processor 1102 calculates the root hash value according to the driving data; generates a data packet header according to the root hash value and a time stamp, and uses a private key to sign the data packet header, the time stamp is the system time, and the The private key is randomly generated;
  • the transceiver 1104 sends the data packet header to the secondary node.
  • the processor 1102 is specifically configured to generate a data packet header in the trusted execution environment of the central node according to the root hash value and the timestamp, and use a private key to verify the data packet header Signing is performed, the timestamp is the system time generated in the trusted execution environment, and the private key is randomly generated in the trusted execution environment.
  • the driving data includes multiple arrays, wherein one array is the data collected by a sensor within the preset time period, and the processor 1102 is specifically configured to calculate the data of the multiple arrays respectively The hash value corresponding to each array in the above; according to the Merkle tree calculation logic, the hash value corresponding to each array is combined to calculate the upper layer hash value until the root hash value is obtained.
  • the transceiver 1104 is further configured to obtain a hash value of a previous data packet header, and the hash value of the previous data packet header performs hash calculation on the entire first data packet header get;
  • the processor 1102 is specifically configured to generate the data packet header according to the hash value of the previous data packet header, the root hash value, and the timestamp.
  • the transceiver 1104 is further configured to send all or part of the data of the data packet corresponding to the data packet header to the assistant node; wherein, all the data of the data packet includes the All the hash values corresponding to the driving data under the Merkel tree calculation logic and the driving data; the partial data of the data packet includes the corresponding part of the hash values and the corresponding part of the driving data under the Merkle tree calculation logic
  • the partial content of the driving data, and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value.
  • the memory 1103 caches the data packet header and the data packet.
  • the processor 1102 may run an operating system to control functions among various devices and components.
  • Transceiver 1104 may include baseband circuitry and radio frequency circuitry.
  • the transceiver 1104 and the processor 1102 can implement the corresponding steps in any one of the above-mentioned embodiments in FIG. 4 to FIG. 9 , and details are not repeated here.
  • Fig. 11 only shows the simplified design of the data acquisition device.
  • the data acquisition device may contain any number of transceivers, processors, memories, etc., and all of them can realize the XX device of the present application All within the scope of protection of this application.
  • the processor 1102 involved in the above-mentioned device 1100 can be a general-purpose processor, such as a CPU, a network processor (network processor, NP), a microprocessor, etc., or an ASIC, or one or more programs used to control the program of this application implementation of the integrated circuit. It can also be a digital signal processor (digital signal processor, DSP), field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
  • the controller/processor can also be a combination that realizes computing functions, for example, a combination of one or more microprocessors, a combination of DSP and a microprocessor, and the like. Processors typically perform logical and arithmetic operations based on program instructions stored in memory.
  • the bus 1101 mentioned above may be a peripheral component interconnect standard (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in FIG. 11 , but it does not mean that there is only one bus or one type of bus.
  • the computer-readable storage medium/memory 1103 mentioned above may also store an operating system and other application programs.
  • the program may include program code, and the program code includes computer operation instructions.
  • the aforementioned memory may be ROM, other types of static storage devices capable of storing static information and instructions, RAM, other types of dynamic storage devices capable of storing information and instructions, disk storage, and the like.
  • the storage 1103 may be a combination of the above storage types.
  • the above-mentioned computer-readable storage medium/memory may be in the processor, may also be outside the processor, or be distributed on multiple entities including processors or processing circuits.
  • the above computer-readable storage medium/memory can be embodied in a computer program product.
  • a computer program product may include a computer readable medium in packaging materials.
  • the embodiment of the present application also provides a general-purpose processing system, such as commonly referred to as a chip, the general-purpose processing system includes: one or more microprocessors providing processor functions; and an external memory providing at least a part of the storage medium , all of which are connected together with other supporting circuits through an external bus architecture.
  • the processor is made to execute some or all of the steps in the method for preventing tampering of driving data in the embodiment of the data acquisition device in FIG. 4 to FIG. Other procedures of the described techniques.
  • the steps of the methods or algorithms described in connection with the disclosure of this application can be implemented in the form of hardware, or can be implemented in the form of a processor executing software instructions.
  • the software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, mobile hard disk, CD-ROM or any other form of storage known in the art medium.
  • An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium.
  • the storage medium may also be a component of the processor.
  • the processor and storage medium can be located in the ASIC. Alternatively, the ASIC may be located in the terminal.
  • the processor and the storage medium may also exist in the first communication device as discrete components.
  • the data verification device 1200 includes: a receiving module 1201 and a processing module 1202, wherein the receiving module 1201 and the processing module 1202 are connected through a bus.
  • the data verification apparatus 1200 may be the auxiliary node in the above method embodiment, or may be configured as one or more chips in the auxiliary node.
  • the data verification apparatus 1200 may be used to execute part or all of the functions of the assistant node in the foregoing method embodiments.
  • the receiving module 1201 is used to synchronize the data packet header sent by the central node, the data packet header is generated by the central node according to the root hash value and the timestamp, and the data packet header is signed with a private key, the The time stamp is the system time, the private key is randomly generated, the root hash value is calculated by the central node according to the driving data, and the driving data is collected by the central node within a preset time period;
  • the processing module 1202 is configured to use the data packet header to verify whether the driving data has been tampered with.
  • the receiving module 1201 is further configured to receive all or part of the data of the data packet corresponding to the data packet header sent by the central node; wherein, all the data of the data packet includes the All the hash values corresponding to the driving data under the Merkel tree calculation logic and the driving data; the partial data of the data packet includes the corresponding part of the hash values and the corresponding part of the driving data under the Merkle tree calculation logic
  • the partial content of the driving data, and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value.
  • the data verification apparatus 1200 further includes a sending module 1203, configured to publish the data packet header.
  • the data verification apparatus 1200 further includes a storage module, which is used to store the data packet header.
  • Storage The storage module is coupled with the processing module 1202, so that the processing module 1202 can execute the computer-executed instructions stored in the storage module to realize the functions of the terminal in the above method embodiments.
  • the storage module optionally included in the data acquisition device 1000 may be a storage unit in the chip, such as a register, a cache, etc., or the storage module may be a storage unit located outside the chip, such as a ROM or a storable Other types of static storage devices, RAM, etc. for static information and instructions.
  • FIG. 13 shows a schematic diagram of a possible structure of the data verification device 1300 in the above embodiment, and the data collection device 1100 can be configured as the aforementioned central node.
  • the data verification apparatus 1300 may include: a processor 1302 , a computer-readable storage medium/memory 1303 , a transceiver 1304 , an input device 1305 and an output device 1306 , and a bus 1301 . Wherein, the processor, the transceiver, the computer-readable storage medium and the like are connected through a bus.
  • the embodiment of the present application does not limit the specific connection medium between the above components.
  • the transceiver 1304 synchronizes the data packet header sent by the central node, the data packet header is generated by the central node according to the root hash value and the timestamp, and the data packet header is signed with a private key, the The time stamp is the system time, the private key is randomly generated, the root hash value is calculated by the central node according to the driving data, and the driving data is collected by the central node within a preset time period;
  • the processor 1102 uses the data packet header to verify whether the driving data has been tampered with.
  • the transceiver 1304 is specifically configured to receive all or part of the data of the data packet corresponding to the data packet header sent by the central node; wherein, all the data of the data packet includes the All the hash values corresponding to the driving data under the Merkel tree calculation logic and the driving data; the partial data of the data packet includes the corresponding partial hash values and the corresponding part of the driving data under the Merkel tree calculation logic
  • the partial content of the driving data, and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value.
  • the transceiver 1304 is also used to publish the data packet header
  • the memory 1103 caches the data packet header.
  • the processor 1302 may run an operating system to control functions among various devices and components.
  • Transceiver 1304 may include baseband circuitry and radio frequency circuitry.
  • the transceiver 1304 and the processor 1302 can implement the corresponding steps in any one of the above-mentioned embodiments in FIG. 4 to FIG. 9 , and details are not described here.
  • FIG. 13 only shows a simplified design of the data verification device.
  • the data verification device may include any number of transceivers, processors, memories, etc., and all of them can realize the data verification of the present application. devices are within the scope of protection of the present application.
  • the processor 1302 involved in the above-mentioned device 1300 can be a general-purpose processor, such as a CPU, a network processor (network processor, NP), a microprocessor, etc., or an ASIC, or one or more programs used to control the program of this application implementation of the integrated circuit. It can also be a digital signal processor (digital signal processor, DSP), field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
  • the controller/processor can also be a combination that realizes computing functions, for example, a combination of one or more microprocessors, a combination of DSP and a microprocessor, and the like. Processors typically perform logical and arithmetic operations based on program instructions stored in memory.
  • the bus 1301 mentioned above may be a peripheral component interconnect standard (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in FIG. 13 , but it does not mean that there is only one bus or one type of bus.
  • the computer-readable storage medium/memory 1303 mentioned above may also store an operating system and other application programs.
  • the program may include program code, and the program code includes computer operation instructions.
  • the aforementioned memory may be ROM, other types of static storage devices capable of storing static information and instructions, RAM, other types of dynamic storage devices capable of storing information and instructions, disk storage, and the like.
  • the storage 1303 may be a combination of the above storage types.
  • the above-mentioned computer-readable storage medium/memory may be in the processor, may also be outside the processor, or be distributed on multiple entities including processors or processing circuits.
  • the above computer-readable storage medium/memory can be embodied in a computer program product.
  • a computer program product may include a computer readable medium in packaging materials.
  • the embodiment of the present application also provides a general-purpose processing system, such as commonly referred to as a chip, the general-purpose processing system includes: one or more microprocessors providing processor functions; and an external memory providing at least a part of the storage medium , all of which are connected together with other supporting circuits through an external bus architecture.
  • the processor is made to execute some or all of the steps in the method for preventing tampering of driving data in the embodiment of the data verification device in FIG. 4 to FIG. Other procedures of the described techniques.
  • the steps of the methods or algorithms described in connection with the disclosure of this application can be implemented in the form of hardware, or can be implemented in the form of a processor executing software instructions.
  • the software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, mobile hard disk, CD-ROM or any other form of storage known in the art medium.
  • An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium.
  • the storage medium may also be a component of the processor.
  • the processor and storage medium can be located in the ASIC. Alternatively, the ASIC may be located in the terminal.
  • the processor and the storage medium may also exist in the first communication device as discrete components.
  • the present application also provides a driving data verification system, including the central node and multiple auxiliary nodes described in any one of the above embodiments.
  • the disclosed system, device and method can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .

Abstract

A method for preventing driving data from being tampered with, and a related apparatus, which method and apparatus are used for ensuring the time authenticity and the tamper resistance of driving data. The method specifically comprises: a center node collecting driving data within a preset time period; then, the center node performing calculation on the driving data by using a hash algorithm, so as to obtain a root hash value; the center node generating a data packet header of the driving data according to the root hash value and a timestamp, and signing the data packet header by using a private key, wherein the timestamp is a system time, and the private key is randomly generated; after generating the data packet header, the center node sending the data packet header to an auxiliary node; the auxiliary node synchronizing the data packet header; and finally, both the center node and the auxiliary node being capable of verifying the driving data according to the data packet header.

Description

一种防止行车数据篡改的方法以及相关装置A method and related device for preventing tampering of driving data
本申请要求于2021年07月15日提交中国国家知识产权局、申请号为202110801555.6、发明名称为“一种防止行车数据篡改的方法以及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application submitted to the State Intellectual Property Office of China on July 15, 2021, with the application number 202110801555.6, and the title of the invention is "a method for preventing tampering of driving data and related devices". References are incorporated in this application.
技术领域technical field
本申请涉及数据存储领域,尤其涉及一种防止行车数据篡改的方法以及相关装置。The present application relates to the field of data storage, in particular to a method and a related device for preventing tampering of driving data.
背景技术Background technique
随着技术的发展,现在越来越多的车辆开始对于自身的行车数据进行存储,用于在出现行车事故时作为可提供证据的数据进行使用。这样就需要保证车辆的行车数据的正确,以及未篡改。With the development of technology, more and more vehicles are now beginning to store their own driving data for use as evidence-providing data in the event of a driving accident. In this way, it is necessary to ensure that the driving data of the vehicle is correct and has not been tampered with.
目前通常是通过车辆的行车数据记录系统以及车厂云端数据库来实现对行车数据的存储。而车辆自身的行车数据记录系统的存储空间有限,为保证后续行车数据的存储,会对行车数据的保存时间进行限定。而存储在车厂云端数据库的行车数据,理论上车厂可以任意修改行车数据,从而掩盖车辆的技术缺陷,或在事故发生后推卸责任。At present, the storage of driving data is usually realized through the driving data recording system of the vehicle and the cloud database of the car factory. However, the storage space of the vehicle's own driving data recording system is limited. In order to ensure the storage of subsequent driving data, the storage time of driving data will be limited. As for the driving data stored in the car factory’s cloud database, the car factory can theoretically modify the driving data arbitrarily, so as to cover up the technical defects of the vehicle, or shirk responsibility after the accident.
因此现在急需要一种可以防止行车数据篡改的方法。Therefore urgently need a kind of method that can prevent driving data tampering now.
发明内容Contents of the invention
本申请实施例提供了一种防止行车数据篡改的方法以及相关装置,用于保证行车数据时间真实性和防篡改性。The embodiment of the present application provides a method for preventing tampering of driving data and a related device, which are used to ensure time authenticity and tamper resistance of driving data.
第一方面,本申请实施例提供一种防止行车数据篡改的方法,主要应用于一种行车数据验证系统,该行车数据验证系统包括中心节点和多个辅助节点。具体包括:该中心节点采集预设时间段内的行车数据;然后该中心节点利用哈希算法对该行车数据进行计算得到根哈希值;该中心节点根据该根哈希值和时间戳生成该行车数据的数据包头,并利用私钥对该数据包头进行签名;其中,该时间戳为系统时间,该私钥为随机生成;该中心节点在生成该数据包头之后,将该数据包头发送至辅助节点;该辅助节点同步该数据包头;最后该中心节点和该辅助节点均可以根据该数据包头对该行驶数据进行验证。In the first aspect, the embodiment of the present application provides a method for preventing tampering of driving data, which is mainly applied to a driving data verification system, and the driving data verification system includes a central node and a plurality of auxiliary nodes. Specifically include: the central node collects driving data within a preset time period; then the central node calculates the driving data using a hash algorithm to obtain a root hash value; the central node generates the root hash value based on the root hash value and time stamp The data packet header of driving data, and use the private key to sign the data packet header; wherein, the timestamp is the system time, and the private key is randomly generated; after the central node generates the data packet header, it sends the data packet header to the auxiliary node; the auxiliary node synchronizes the data packet header; finally, both the central node and the auxiliary node can verify the driving data according to the data packet header.
本实施例中,该中心节点可以是车辆本身,也可以是独立于车辆之外的数据采集设备。该辅助节点包括该车厂云端数据库、车主自用的存储设备、车主对应的验证设备或者监管平台对应的数据库。可以理解的是,该中心节点和该辅助节点均可以根据该数据包头和数据包验证该行车数据是否被篡改。In this embodiment, the central node may be the vehicle itself, or a data collection device independent of the vehicle. The auxiliary node includes the car factory's cloud database, the storage device used by the car owner, the verification device corresponding to the car owner, or the database corresponding to the supervision platform. It can be understood that both the central node and the auxiliary node can verify whether the driving data has been tampered with according to the data packet header and the data packet.
本实施例提供的技术方案中,中心节点将原始传感器数据通过默克尔树计算逻辑计算得到哈希值和根哈希值,从而构造数据包;并在中心节点的可信执行环境内,以根哈希值和可信时间戳构造数据包头,并通过可信执行环境生成签名私钥,对数据包头做签名。这样行车数据验证系统可以通过数据包头,保证行车数据的时间真实性和防篡改性。In the technical solution provided by this embodiment, the central node calculates the original sensor data through the Merkle tree calculation logic to obtain the hash value and the root hash value, thereby constructing the data package; and in the trusted execution environment of the central node, the The root hash value and the trusted timestamp construct the data packet header, and generate a signature private key through the trusted execution environment to sign the data packet header. In this way, the driving data verification system can ensure the time authenticity and tamper-proof of the driving data through the data packet header.
一种可能实现方式中,若该中心节点的软件运行环境(即富执行环境(rich execution environment,REE))为安全环境,则该中心节点可以直接在该REE中根据该根哈希值和该时间戳生成数据包头。若该中心节点的软件运行环境不是安全环境,则该中心节点可以将根据所述根哈希值和时间戳在所述中心节点的可信执行环境中生成数据包头,并利用私钥 对所述数据包头进行签名,所述时间戳为在所述可信执行环境中生成的系统时间,所述私钥在所述可信执行环境中随机生成。这样可以保证该根哈希值与时间戳的有效性。In a possible implementation, if the software operating environment of the central node (i.e. rich execution environment (REE)) is a secure environment, then the central node can directly use the root hash value and the The timestamp generates the packet header. If the software operating environment of the central node is not a secure environment, the central node can generate a data packet header in the trusted execution environment of the central node according to the root hash value and the timestamp, and use the private key to The header of the data packet is signed, the timestamp is the system time generated in the trusted execution environment, and the private key is randomly generated in the trusted execution environment. This ensures the validity of the root hash and timestamp.
另一种可能实现方式中,该行车数据可以包括多个数组,其中,每一个数组对应车辆的一个传感器在该预设时间段内的数据。在此方案下,该中心节点根据该行车数据计算得到根哈希值的方法可以如下:分别计算所述多个数组中每个数组对应的哈希值;所述中心节点按照默克尔树计算逻辑将所述每个数组对应的哈希值两两结合计算得到上层哈希值,直至得到所述根哈希值。比如,该车辆数据采集到4个传感器的数据,分别为数组1、数组2、数组3和数据4;然后利用哈希算法计算得到哈希值1、哈希值2、哈希值3和哈希值4;再将哈希值1和哈希值2结合计算得到哈希值12,将哈希值3和哈希值4结合计算得到哈希值34;最后将哈希值12和哈希值34结合计算得到哈希值1234,即为根哈希值。In another possible implementation manner, the driving data may include multiple arrays, where each array corresponds to data of a sensor of the vehicle within the preset time period. Under this scheme, the method for the central node to calculate the root hash value according to the driving data can be as follows: separately calculate the hash value corresponding to each array in the plurality of arrays; the central node calculates the hash value according to the Merkle tree The logic combines the hash values corresponding to each array in pairs to calculate the upper layer hash value until the root hash value is obtained. For example, the vehicle data collects data from 4 sensors, which are array 1, array 2, array 3, and data 4; then use the hash algorithm to calculate hash value 1, hash value 2, hash value 3, and hash value Hash value 4; then combine hash value 1 and hash value 2 to get hash value 12, combine hash value 3 and hash value 4 to get hash value 34; finally combine hash value 12 and hash value The value 34 is combined to calculate the hash value 1234, which is the root hash value.
另一种可能实现方式中,该中心节点在生成该数据包头时还可以将前一数据包的数据包头的哈希值加入,具体包括:所述中心节点获取前一数据包头的哈希值,所述前一数据包头的哈希值为对所述第一数据包头整体进行哈希计算得到;所述中心节点根据所述前一数据包头的哈希值、所述根哈希值和所述时间戳在所述中心节点的可信执行环境中生成所述数据包头。本实施例中,这种前后包头哈希值相连的结构,是为了保障记录数据的连续性。本实施例中通过根哈希值以及时间戳构造数据包头只能保证当前数据的完整性,但是当前数据和前一个数据之间,是不是有别的数据被删掉了,就需要哈希值相连的结构来保证。有了哈希值相连的结构,一旦中间有个数据包头被恶意丢弃了,那当前包头结构里面的前向包头哈希值值,和前一个包头重新计算哈希值,就会对不上,从而可以发现数据被丢弃了。In another possible implementation manner, the central node may also add the hash value of the data packet header of the previous data packet when generating the data packet header, which specifically includes: the central node obtains the hash value of the previous data packet header, The hash value of the previous data packet header is obtained by performing hash calculation on the entire first data packet header; the central node is based on the hash value of the previous data packet header, the root hash value and the The time stamp generates the data packet header in the trusted execution environment of the central node. In this embodiment, the structure in which hash values of front and rear headers are connected is to ensure the continuity of recorded data. In this embodiment, constructing the data packet header through the root hash value and timestamp can only ensure the integrity of the current data, but if there is any other data deleted between the current data and the previous data, the hash value is needed The connected structure is guaranteed. With the hash value connected structure, once a data packet header in the middle is maliciously discarded, the forward packet header hash value in the current packet header structure will not match with the previous packet header to recalculate the hash value. It can be found that the data is discarded.
另一种可能实现方式中,该中心节点还可以向该辅助节点发送所述数据包头对应的数据包的全部数据或者部分数据;其中,所述数据包的全部数据包括所述行车数据在默克尔树计算逻辑下对应的全部哈希值和所述行车数据;所述数据包的部分数据包括所述行车数据在默克尔树计算逻辑下对应的部分哈希值和所述行车数据的部分内容,且所述部分哈希值和所述行车数据的部分内容可计算得到所述根哈希值。本实施例中,该数据包包括两部分:原始数据、中间各个层级的哈希值。所述数据包中的部分数据指的是:部分原始数据+部分哈希值。这样可以在有效保证数据完整性的情况下,降低各个设备之间数据传输量。In another possible implementation manner, the central node may also send all or part of the data of the data packet corresponding to the data packet header to the auxiliary node; wherein, all the data of the data packet includes the driving data in Merck All corresponding hash values and the driving data under the Merkle tree calculation logic; the partial data of the data packet includes the corresponding partial hash value and the part of the driving data of the driving data under the Merkle tree calculation logic content, and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value. In this embodiment, the data packet includes two parts: original data, and hash values of various levels in the middle. Part of the data in the data packet refers to: part of the original data+part of the hash value. In this way, the amount of data transmission between devices can be reduced while effectively ensuring data integrity.
另一种可能实现方式中,所述中心节点或所述辅助节点中的至少一个公布所述数据包头。这样可以进一步增强不可篡改性。因为行车数据验证系统中的参与方毕竟有限,还是存在一定的概率,导致所有节点被完全篡改。因此,实时对外公开数据包头,可以被外界任意监督方随时收集,有利于进一步增强防篡改性。In another possible implementation manner, at least one of the central node or the auxiliary nodes publishes the data packet header. This further enhances immutability. Because the participants in the driving data verification system are limited after all, there is still a certain probability that all nodes will be completely tampered with. Therefore, the real-time disclosure of the data packet header can be collected by any external supervisory party at any time, which is conducive to further enhancing tamper resistance.
第二方面,本申请提供一种数据采集装置,该装置具有实现上述第一方面中中心节点行为的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。In a second aspect, the present application provides a data acquisition device, which has the function of realizing the behavior of the central node in the first aspect. This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware. The hardware or software includes one or more modules corresponding to the above functions.
在一个可能的实现方式中,该装置包括用于执行以上第一方面各个步骤的单元或模块。例如,该装置可以用于:获取模块,用于获取车辆在预设时间段内行车数据;处理模块,用于根据行车数据计算得到根哈希值;根据所述根哈希值和时间戳生成数据包头,并利用 私钥对所述数据包头进行签名,所述时间戳为系统时间,所述私钥随机生成;发送模块,用于将该数据包头发送给该辅助节点。In a possible implementation manner, the apparatus includes a unit or a module for performing each step of the above first aspect. For example, the device can be used for: an acquisition module, used to acquire vehicle driving data within a preset time period; a processing module, used to calculate a root hash value based on the driving data; generate a root hash value based on the root hash value and a timestamp A data packet header, and use a private key to sign the data packet header, the time stamp is the system time, and the private key is randomly generated; a sending module is configured to send the data packet header to the auxiliary node.
可选的,还包括存储模块,用于保存数据采集装置必要的程序指令和数据。Optionally, a storage module is also included for storing necessary program instructions and data of the data acquisition device.
在一种可能的实现方式中,该装置包括:处理器和收发器,该处理器被配置为支持数据采集装置执行上述第一方面提供的方法中相应的功能。收发器用于指示中心节点和辅助节点之间的通信,向辅助节点发送上述方法中所涉及的数据包头和数据包。可选的,此装置还可以包括存储器,该存储器用于与处理器耦合,其保存数据采集装置必要的程序指令和数据。In a possible implementation manner, the device includes: a processor and a transceiver, where the processor is configured to support the data collection device to perform corresponding functions in the method provided in the first aspect above. The transceiver is used to instruct the communication between the central node and the auxiliary node, and send the data packet header and data packet involved in the above method to the auxiliary node. Optionally, the device may also include a memory, which is used for coupling with the processor, and stores necessary program instructions and data of the data acquisition device.
在一种可能的实现方式中,当该装置为数据采集装置内的芯片时,该芯片包括:处理模块和收发模块。该收发模块例如可以是该芯片上的输入/输出接口、管脚或电路等,将车辆传感器生成的数据传送给与此芯片耦合的其他芯片或模块中。该收发模块用于获取车辆在预设时间段内行车数据;该处理模块例如可以是处理器,此处理器用于根据行车数据计算得到根哈希值;根据所述根哈希值和时间戳生成数据包头,并利用私钥对所述数据包头进行签名,所述时间戳为系统时间,所述私钥随机生成;该收发模块,还用于将该数据包头发送给该辅助节点。该处理模块可执行存储单元存储的计算机执行指令,以支持数据采集装置执行上述第一方面提供的方法。可选地,该存储单元可以为该芯片内的存储单元,如寄存器、缓存等,该存储单元还可以是位于该芯片外部的存储单元,如只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)等。In a possible implementation manner, when the device is a chip in the data acquisition device, the chip includes: a processing module and a transceiver module. The transceiver module can be, for example, an input/output interface, a pin or a circuit on the chip, which transmits the data generated by the vehicle sensor to other chips or modules coupled with the chip. The transceiver module is used to obtain the driving data of the vehicle within a preset time period; the processing module can be, for example, a processor, which is used to calculate the root hash value according to the driving data; generate A data packet header, and use a private key to sign the data packet header, the time stamp is the system time, and the private key is randomly generated; the transceiver module is also used to send the data packet header to the auxiliary node. The processing module can execute the computer-executed instructions stored in the storage unit, so as to support the data collection device to execute the method provided in the first aspect above. Optionally, the storage unit may be a storage unit in the chip, such as a register, a cache, etc., or a storage unit located outside the chip, such as a read-only memory (read-only memory, ROM) or a Other types of static storage devices that store static information and instructions, random access memory (random access memory, RAM), etc.
在一种可能的实现方式中,该装置包括:处理器,基带电路,射频电路和天线。其中处理器用于实现对各个电路部分功能的控制,基带电路用于生成数据包头,经由射频电路进行模拟转换、滤波、放大和上变频等处理后,再经由天线发送给辅助节点。可选的,该装置还包括存储器,其保存中心节点必要的程序指令和数据。In a possible implementation manner, the device includes: a processor, a baseband circuit, a radio frequency circuit and an antenna. Among them, the processor is used to realize the control of some functions of each circuit, and the baseband circuit is used to generate data packet headers, which are processed by analog conversion, filtering, amplification and frequency up-conversion through the radio frequency circuit, and then sent to the auxiliary node through the antenna. Optionally, the device further includes a memory, which stores necessary program instructions and data of the central node.
在一种可能实现方式中,该装置包括通信接口和逻辑电路,该通信接口用于获取车辆在预设时间段内行车数据;该逻辑电路,用于根据行车数据计算得到根哈希值;根据所述根哈希值和时间戳生成数据包头,并利用私钥对所述数据包头进行签名,所述时间戳为系统时间,所述私钥随机生成;该通信接口,还用于将该数据包头发送给辅助节点。In a possible implementation, the device includes a communication interface and a logic circuit, the communication interface is used to obtain the driving data of the vehicle within a preset time period; the logic circuit is used to calculate the root hash value according to the driving data; according to The root hash value and timestamp generate a data packet header, and use a private key to sign the data packet header, the timestamp is the system time, and the private key is randomly generated; the communication interface is also used to transfer the data The packet header is sent to the secondary node.
其中,上述任一处提到的处理器,可以是一个通用中央处理器(Central Processing Unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制上述各方面防止行车数据篡改的方法的程序执行的集成电路。Among them, the processor mentioned in any of the above can be a general-purpose central processing unit (Central Processing Unit, CPU), a microprocessor, a specific application integrated circuit (application-specific integrated circuit, ASIC), or one or more An integrated circuit for controlling the program execution of the method for preventing tampering of driving data in the above aspects.
第三方面,本申请提供一种防止行车数据篡改的方法,主要应用于一种行车数据验证系统,该行车数据验证系统包括中心节点和多个辅助节点。具体包括:该中心节点采集预设时间段内的行车数据;然后该中心节点根据行车数据计算得到根哈希值;根据所述根哈希值和时间戳生成数据包头,并利用私钥对所述数据包头进行签名,所述时间戳为系统时间,所述私钥随机生成;该中心节点在生成该数据包头之后,将该数据包头发送至辅助节点;该辅助节点同步该数据包头;最后该中心节点和该辅助节点均可以根据该数据包头对 该行驶数据进行验证。In a third aspect, the present application provides a method for preventing tampering of driving data, which is mainly applied to a driving data verification system, and the driving data verification system includes a central node and a plurality of auxiliary nodes. Specifically include: the central node collects driving data within a preset time period; then the central node calculates a root hash value according to the driving data; generates a data packet header according to the root hash value and a timestamp, and uses the private key to The data packet header is signed, the timestamp is the system time, and the private key is randomly generated; after the central node generates the data packet header, it sends the data packet header to the auxiliary node; the auxiliary node synchronizes the data packet header; finally the Both the central node and the auxiliary node can verify the driving data according to the data packet header.
本实施例中,该中心节点可以是车辆本身,也可以是独立于车辆之外的数据采集设备。该辅助节点包括该车厂云端数据库、车主自用的存储设备、车主对应的验证设备或者监管平台对应的数据库。可以理解的是,该中心节点和该辅助节点均可以根据该数据包头和数据包验证该行车数据是否被篡改。本实施例提供的技术方案中,中心节点将原始传感器数据通过默克尔树计算逻辑计算得到哈希值和根哈希值,从而构造数据包;并在中心节点的可信执行环境内,以根哈希值和可信时间戳构造数据包头,并通过可信执行环境生成签名私钥,对数据包头做签名。这样行车数据验证系统可以通过数据包头,保证行车数据的时间真实性和防篡改性。In this embodiment, the central node may be the vehicle itself, or a data acquisition device independent of the vehicle. The auxiliary node includes the car factory's cloud database, the storage device used by the car owner, the verification device corresponding to the car owner, or the database corresponding to the supervision platform. It can be understood that both the central node and the auxiliary node can verify whether the driving data has been tampered with according to the data packet header and the data packet. In the technical solution provided by this embodiment, the central node calculates the original sensor data through the Merkle tree calculation logic to obtain the hash value and the root hash value, thereby constructing the data package; and in the trusted execution environment of the central node, the The root hash value and the trusted timestamp construct the data packet header, and generate a signature private key through the trusted execution environment to sign the data packet header. In this way, the driving data verification system can ensure the time authenticity and tamper-proof of the driving data through the data packet header.
一种可能实现方式中,该辅助节点接收所述中心节点发送的所述数据包头对应的数据包的全部数据或者部分数据;其中,所述数据包的全部数据包括所述行车数据在默克尔树计算逻辑下对应的全部哈希值和所述行车数据;所述数据包的部分数据包括所述行车数据在默克尔树计算逻辑下对应的部分哈希值和所述行车数据的部分内容,且所述部分哈希值和所述行车数据的部分内容可计算得到所述根哈希值。本实施例中,该数据包包括两部分:原始数据、中间各个层级的哈希值。所述数据包中的部分数据指的是:部分原始数据+部分哈希值。这样可以在有效保证数据完整性的情况下,降低各个设备之间数据传输量。In a possible implementation manner, the auxiliary node receives all or part of the data of the data packet corresponding to the data packet header sent by the central node; wherein, all the data of the data packet includes the driving data in Merkel All hash values corresponding to the tree calculation logic and the driving data; the partial data of the data packet includes the corresponding partial hash values of the driving data under the Merkle tree calculation logic and part of the driving data , and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value. In this embodiment, the data packet includes two parts: original data, and hash values of various levels in the middle. Part of the data in the data packet refers to: part of the original data+part of the hash value. In this way, the amount of data transmission between devices can be reduced while effectively ensuring data integrity.
另一种可能实现方式中,所述中心节点或所述辅助节点中的至少一个公布所述数据包头。这样可以进一步增强不可篡改性。因为行车数据验证系统中的参与方毕竟有限,还是存在一定的概率,导致所有节点被完全篡改。因此,实时对外公开数据包头,可以被外界任意监督方随时收集,有利于进一步增强防篡改性。In another possible implementation manner, at least one of the central node or the auxiliary nodes publishes the data packet header. This further enhances immutability. Because the participants in the driving data verification system are limited after all, there is still a certain probability that all nodes will be completely tampered with. Therefore, the real-time disclosure of the data packet header can be collected by any external supervisory party at any time, which is conducive to further enhancing tamper resistance.
另一种可能实现方式中,该多个辅助节点间可以相互验证该行车数据是否被篡改。具体来说:第一辅助节点获取第二辅助节点的数据包头,所述第一辅助节点和所述第二辅助节点包含于所述多个辅助节点;所述第一辅助节点将所述第二辅助节点的数据包头与自身存储的数据包头比对确定所述第二辅助节点的数据是否篡改。In another possible implementation manner, the plurality of auxiliary nodes can mutually verify whether the driving data has been tampered with. Specifically: the first auxiliary node obtains the data packet header of the second auxiliary node, and the first auxiliary node and the second auxiliary node are included in the plurality of auxiliary nodes; the first auxiliary node obtains the second auxiliary node The data packet header of the auxiliary node is compared with the data packet header stored by itself to determine whether the data of the second auxiliary node has been tampered with.
第四方面,本申请提供一种数据验证装置,该装置具有实现上述第一方面中辅助节点行为的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。In a fourth aspect, the present application provides a data verification device, which has the function of realizing the behavior of the auxiliary node in the first aspect above. This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware. The hardware or software includes one or more modules corresponding to the above functions.
在一个可能的实现方式中,该装置包括用于执行以上第三方面各个步骤的单元或模块。例如,该装置可以用于:接收模块,用于同步所述中心节点发送的数据包头,所述数据包头由所述中心节点根据根哈希值和时间戳生成,且所述数据包头利用私钥进行签名,所述时间戳为系统时间,所述私钥为随机生成,所述根哈希值所述中心节点根据行车数据计算得到,所述行车数据为所述中心节点预设时间段内采集得到;处理模块,用于利用所述数据包头验证所述行车数据的完整性。In a possible implementation manner, the apparatus includes a unit or a module for performing each step of the above third aspect. For example, the device can be used for: a receiving module, used to synchronize the data packet header sent by the central node, the data packet header is generated by the central node according to the root hash value and the timestamp, and the data packet header uses the private key To sign, the timestamp is the system time, the private key is randomly generated, the root hash value is calculated by the central node according to the driving data, and the driving data is collected by the central node within a preset time period Obtained; a processing module, configured to use the data packet header to verify the integrity of the driving data.
可选的,还包括存储模块,用于保存数据验证装置必要的程序指令和数据。Optionally, a storage module is also included for storing necessary program instructions and data of the data verification device.
在一种可能的实现方式中,该装置包括:处理器和收发器,该处理器被配置为支持数据验证装置执行上述第三方面提供的方法中相应的功能。收发器用于指示辅助节点和中心节点之间的通信,接收中心节点发送上述方法中所涉及的数据包头。可选的,此装置还可 以包括存储器,该存储器用于与处理器耦合,其保存数据验证装置必要的程序指令和数据。In a possible implementation manner, the device includes: a processor and a transceiver, where the processor is configured to support the data verification device to perform corresponding functions in the method provided in the third aspect above. The transceiver is used to instruct the communication between the auxiliary node and the central node, and receives the data packet header involved in the above method sent by the central node. Optionally, the device may also include a memory, which is used to be coupled with the processor, and stores necessary program instructions and data of the data verification device.
在一种可能的实现方式中,当该装置为数据验证装置内的芯片时,该芯片包括:处理模块和收发模块。该收发模块例如可以是该芯片上的输入/输出接口、管脚或电路等,将车辆传感器生成的数据传送给与此芯片耦合的其他芯片或模块中。该收发模块用于同步所述中心节点发送的数据包头,所述数据包头由所述中心节点根据根哈希值和时间戳生成,且所述数据包头利用私钥进行签名,所述时间戳为系统时间,所述私钥为随机生成,所述根哈希值所述中心节点根据行车数据计算得到,所述行车数据为所述中心节点预设时间段内采集得到;该处理模块例如可以是处理器,此处理器用于利用所述数据包头验证所述行车数据的完整性。该处理模块可执行存储单元存储的计算机执行指令,以支持数据采集装置执行上述第三方面提供的方法。可选地,该存储单元可以为该芯片内的存储单元,如寄存器、缓存等,该存储单元还可以是位于该芯片外部的存储单元,如只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)等。In a possible implementation manner, when the device is a chip in the data verification device, the chip includes: a processing module and a transceiver module. The transceiver module can be, for example, an input/output interface, a pin or a circuit on the chip, which transmits the data generated by the vehicle sensor to other chips or modules coupled with the chip. The transceiver module is used to synchronize the data packet header sent by the central node, the data packet header is generated by the central node according to the root hash value and the timestamp, and the data packet header is signed with a private key, and the timestamp is System time, the private key is randomly generated, the root hash value is calculated by the central node according to the driving data, and the driving data is collected by the central node within a preset time period; the processing module can be, for example A processor, used for verifying the integrity of the driving data by using the data packet header. The processing module can execute the computer-executed instructions stored in the storage unit, so as to support the data collection device to execute the method provided in the third aspect above. Optionally, the storage unit may be a storage unit in the chip, such as a register, a cache, etc., or a storage unit located outside the chip, such as a read-only memory (read-only memory, ROM) or a Other types of static storage devices that store static information and instructions, random access memory (random access memory, RAM), etc.
在一种可能实现方式中,该装置包括通信接口和逻辑电路,该通信接口用于同步所述中心节点发送的数据包头,所述数据包头由所述中心节点根据根哈希值和时间戳生成,且所述数据包头利用私钥进行签名,所述时间戳为系统时间,所述私钥为随机生成,所述根哈希值所述中心节点根据行车数据计算得到,所述行车数据为所述中心节点预设时间段内采集得到;该逻辑电路,用于利用所述数据包头验证所述行车数据的完整性。In a possible implementation manner, the device includes a communication interface and a logic circuit, the communication interface is used to synchronize the data packet header sent by the central node, the data packet header is generated by the central node according to the root hash value and the timestamp , and the data packet header is signed with a private key, the timestamp is the system time, the private key is randomly generated, the root hash value is calculated by the central node according to the driving data, and the driving data is the collected by the central node within a preset time period; the logic circuit is used to verify the integrity of the driving data by using the data packet header.
其中,上述任一处提到的处理器,可以是一个通用中央处理器(Central Processing Unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制上述各方面防止行车数据篡改的方法的程序执行的集成电路。Among them, the processor mentioned in any of the above can be a general-purpose central processing unit (Central Processing Unit, CPU), a microprocessor, a specific application integrated circuit (application-specific integrated circuit, ASIC), or one or more An integrated circuit for controlling the program execution of the method for preventing tampering of driving data in the above aspects.
第五方面,本申请提供一种行车数据验证系统,该行车数据验证系统包括中心节点和多个辅助节点,其中,该中心节点和该多个辅助节点均可验证该行车数据的完整性。其中,该中心节点获取车辆在预设时间段内行车数据;根据行车数据计算得到根哈希值;根据所述根哈希值和时间戳生成数据包头,并利用私钥对所述数据包头进行签名,所述时间戳为系统时间,所述私钥随机生成;In a fifth aspect, the present application provides a driving data verification system. The driving data verification system includes a central node and a plurality of auxiliary nodes, wherein both the central node and the plurality of auxiliary nodes can verify the integrity of the driving data. Wherein, the central node obtains the driving data of the vehicle within a preset time period; calculates the root hash value according to the driving data; generates a data packet header according to the root hash value and the timestamp, and uses the private key to perform signature, the timestamp is the system time, and the private key is randomly generated;
该辅助节点用于同步所述数据包头或,该辅助节点同步所述数据包头以及所述数据包头对应的数据包。The auxiliary node is used to synchronize the data packet header or, the auxiliary node synchronizes the data packet header and the data packet corresponding to the data packet header.
该中心节点具有上述第二方面所述数据采集装置的全部或者部分功能,该辅助节点具有上述第四方面所述的数据验证装置的全部或者部分功能。The central node has all or part of the functions of the data collection device described in the second aspect above, and the auxiliary node has all or part of the functions of the data verification device described in the fourth aspect above.
例如,一种可能实现方式中,若该中心节点的软件运行环境(即富执行环境(rich execution environment,REE))为安全环境,则该中心节点可以直接在该REE中根据该根哈希值和该时间戳生成数据包头。若该中心节点的软件运行环境不是安全环境,则该中心节点可以将根据所述根哈希值和时间戳在所述中心节点的可信执行环境中生成数据包头,并利用私钥对所述数据包头进行签名,所述时间戳为在所述可信执行环境中生成的系统时 间,所述私钥在所述可信执行环境中随机生成。这样可以保证该根哈希值与时间戳的有效性。For example, in one possible implementation, if the software operating environment of the central node (i.e., rich execution environment (rich execution environment, REE)) is a secure environment, then the central node can directly use the root hash value in the REE and that timestamp to generate the packet header. If the software operating environment of the central node is not a secure environment, the central node can generate a data packet header in the trusted execution environment of the central node according to the root hash value and the timestamp, and use the private key to The header of the data packet is signed, the timestamp is the system time generated in the trusted execution environment, and the private key is randomly generated in the trusted execution environment. This ensures the validity of the root hash and timestamp.
另一种可能实现方式中,该行车数据可以包括多个数组,其中,每一个数组对应车辆的一个传感器在该预设时间段内的数据。在此方案下,该中心节点根据该行车数据计算得到根哈希值的方法可以如下:分别计算所述多个数组中每个数组对应的哈希值;所述中心节点按照默克尔树计算逻辑将所述每个数组对应的哈希值两两结合计算得到上层哈希值,直至得到所述根哈希值。比如,该车辆数据采集到4个传感器的数据,分别为数组1、数组2、数组3和数据4;然后利用哈希算法计算得到哈希值1、哈希值2、哈希值3和哈希值4;再将哈希值1和哈希值2结合计算得到哈希值12,将哈希值3和哈希值4结合计算得到哈希值34;最后将哈希值12和哈希值34结合计算得到哈希值1234,即为根哈希值。In another possible implementation manner, the driving data may include multiple arrays, where each array corresponds to data of a sensor of the vehicle within the preset time period. Under this scheme, the method for the central node to calculate the root hash value according to the driving data can be as follows: separately calculate the hash value corresponding to each array in the plurality of arrays; the central node calculates the hash value according to the Merkle tree The logic combines the hash values corresponding to each array in pairs to calculate the upper layer hash value until the root hash value is obtained. For example, the vehicle data collects data from 4 sensors, which are array 1, array 2, array 3, and data 4; then use the hash algorithm to calculate hash value 1, hash value 2, hash value 3, and hash value Hash value 4; then combine hash value 1 and hash value 2 to get hash value 12, combine hash value 3 and hash value 4 to get hash value 34; finally combine hash value 12 and hash value The value 34 is combined to calculate the hash value 1234, which is the root hash value.
另一种可能实现方式中,该中心节点在生成该数据包头时还可以将前一数据包的数据包头的哈希值加入,具体包括:所述中心节点获取前一数据包头的哈希值,所述前一数据包头的哈希值为对所述第一数据包头整体进行哈希计算得到;所述中心节点根据所述前一数据包头的哈希值、所述根哈希值和所述时间戳在所述中心节点的可信执行环境中生成所述数据包头。本实施例中,这种前后包头哈希值相连的结构,是为了保障记录数据的连续性。本实施例中通过根哈希值以及时间戳构造数据包头只能保证当前数据的完整性,但是当前数据和前一个数据之间,是不是有别的数据被删掉了,就需要哈希值相连的结构来保证。有了哈希值相连的结构,一旦中间有个数据包头被恶意丢弃了,那当前包头结构里面的前向包头哈希值值,和前一个包头重新计算哈希值,就会对不上,从而可以发现数据被丢弃了。一种可能实现方式中,该辅助节点接收所述中心节点发送的所述数据包头对应的数据包的全部数据或者部分数据;其中,所述数据包的全部数据包括所述行车数据在默克尔树计算逻辑下对应的全部哈希值和所述行车数据;所述数据包的部分数据包括所述行车数据在默克尔树计算逻辑下对应的部分哈希值和所述行车数据的部分内容,且所述部分哈希值和所述行车数据的部分内容可计算得到所述根哈希值。本实施例中,该数据包包括两部分:原始数据、中间各个层级的哈希值。所述数据包中的部分数据指的是:部分原始数据+部分哈希值。这样可以在有效保证数据完整性的情况下,降低各个设备之间数据传输量。In another possible implementation manner, the central node may also add the hash value of the data packet header of the previous data packet when generating the data packet header, which specifically includes: the central node obtains the hash value of the previous data packet header, The hash value of the previous data packet header is obtained by performing hash calculation on the entire first data packet header; the central node is based on the hash value of the previous data packet header, the root hash value and the The time stamp generates the data packet header in the trusted execution environment of the central node. In this embodiment, the structure in which hash values of front and rear headers are connected is to ensure the continuity of recorded data. In this embodiment, constructing the data packet header through the root hash value and timestamp can only ensure the integrity of the current data, but if there is any other data deleted between the current data and the previous data, the hash value is needed The connected structure is guaranteed. With the hash value connected structure, once a data packet header in the middle is maliciously discarded, the forward packet header hash value in the current packet header structure will not match with the previous packet header to recalculate the hash value. It can be found that the data is discarded. In a possible implementation manner, the auxiliary node receives all or part of the data of the data packet corresponding to the data packet header sent by the central node; wherein, all the data of the data packet includes the driving data in Merkel All hash values corresponding to the tree calculation logic and the driving data; the partial data of the data packet includes the corresponding partial hash values of the driving data under the Merkle tree calculation logic and part of the driving data , and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value. In this embodiment, the data packet includes two parts: original data, and hash values of various levels in the middle. Part of the data in the data packet refers to: part of the original data+part of the hash value. In this way, the amount of data transmission between devices can be reduced while effectively ensuring data integrity.
另一种可能实现方式中,所述中心节点或所述辅助节点中的至少一个公布所述数据包头。这样可以进一步增强不可篡改性。因为行车数据验证系统中的参与方毕竟有限,还是存在一定的概率,导致所有节点被完全篡改。因此,实时对外公开数据包头,可以被外界任意监督方随时收集,有利于进一步增强防篡改性。In another possible implementation manner, at least one of the central node or the auxiliary nodes publishes the data packet header. This further enhances immutability. Because the participants in the driving data verification system are limited after all, there is still a certain probability that all nodes will be completely tampered with. Therefore, the real-time disclosure of the data packet header can be collected by any external supervisory party at any time, which is conducive to further enhancing tamper resistance.
另一种可能实现方式中,该多个辅助节点间可以相互验证该行车数据是否被篡改。具体来说:第一辅助节点获取第二辅助节点的数据包头,所述第一辅助节点和所述第二辅助节点包含于所述多个辅助节点;所述第一辅助节点将所述第二辅助节点的数据包头与自身存储的数据包头比对确定所述第二辅助节点的数据是否篡改。In another possible implementation manner, the plurality of auxiliary nodes can mutually verify whether the driving data has been tampered with. Specifically: the first auxiliary node obtains the data packet header of the second auxiliary node, and the first auxiliary node and the second auxiliary node are included in the plurality of auxiliary nodes; the first auxiliary node obtains the second auxiliary node The data packet header of the auxiliary node is compared with the data packet header stored by itself to determine whether the data of the second auxiliary node has been tampered with.
第六方面,本申请实施例提供一种计算机可读存储介质,该计算机存储介质存储有计算机指令,该计算机指令用于执行上述各方面中任意一方面任意可能的实施方式该的方法。In a sixth aspect, the embodiments of the present application provide a computer-readable storage medium, where the computer storage medium stores computer instructions, and the computer instructions are used to execute the method in any possible implementation mode of any one of the above-mentioned aspects.
第七方面,本申请实施例提供一种包含指令的计算机程序,当其在计算机上运行时, 使得计算机执行上述各方面中任意一方面该的方法。In a seventh aspect, the embodiments of the present application provide a computer program including instructions, which, when run on a computer, cause the computer to execute the method in any one of the above aspects.
第八方面,本申请提供了一种芯片系统,该芯片系统包括处理器,用于支持车辆数据采集装置实现上述方面中所涉及的功能,例如生成或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,该芯片系统还包括存储器,该存储器,用于保存车辆数据采集装置必要的程序指令和数据,以实现上述各方面中任意一方面的功能。该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。In an eighth aspect, the present application provides a chip system, which includes a processor, used to support the vehicle data acquisition device to implement the functions involved in the above aspect, such as generating or processing the data involved in the above method and/or information. In a possible design, the system-on-a-chip further includes a memory, which is used to store necessary program instructions and data of the vehicle data acquisition device, so as to realize the functions in any one of the above-mentioned aspects. The system-on-a-chip may consist of chips, or may include chips and other discrete devices.
附图说明Description of drawings
图1为本申请实施例的系统架构的一个示意图;Fig. 1 is a schematic diagram of the system architecture of the embodiment of the present application;
图2为Merkle Hash树的一个示意图;Figure 2 is a schematic diagram of the Merkle Hash tree;
图3为本申请实施例中数据包与数据包头的一个结构示意图;Fig. 3 is a schematic structural diagram of a data packet and a data packet header in the embodiment of the present application;
图4为本申请实施例中防止行车数据篡改的方法的一个实施例示意图;FIG. 4 is a schematic diagram of an embodiment of a method for preventing tampering of driving data in the embodiment of the present application;
图5为本申请实施例中计算根哈希值的一个流程示意图;Fig. 5 is a schematic flow chart of calculating the root hash value in the embodiment of the present application;
图6为本申请实施例中计算根哈希值的另一个流程示意图;Fig. 6 is another schematic flow chart of calculating the root hash value in the embodiment of the present application;
图7为本申请实施例中数据包头在中心节点构造示意图;Fig. 7 is a schematic diagram of the structure of the data packet header at the central node in the embodiment of the present application;
图8为本申请实施例中同步数据包中部分数据的一个示意图;FIG. 8 is a schematic diagram of part of the data in the synchronization data packet in the embodiment of the present application;
图9为本申请实施例中防止行车数据篡改的方法的一个应用场景图;FIG. 9 is an application scene diagram of a method for preventing tampering of driving data in the embodiment of the present application;
图10为本申请实施例中数据采集装置的一个实施例示意图;Fig. 10 is a schematic diagram of an embodiment of the data acquisition device in the embodiment of the present application;
图11为本申请实施例中数据采集装置的另一个实施例示意图;FIG. 11 is a schematic diagram of another embodiment of the data acquisition device in the embodiment of the present application;
图12为本申请实施例中数据验证装置的一个实施例示意图;Fig. 12 is a schematic diagram of an embodiment of the data verification device in the embodiment of the present application;
图13为本申请实施例中数据验证装置的另一个实施例示意图。Fig. 13 is a schematic diagram of another embodiment of the data verification device in the embodiment of the present application.
具体实施方式detailed description
为了使本申请的目的、技术方案及优点更加清楚明白,下面结合附图,对本申请的实施例进行描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。本领域普通技术人员可知,随着新应用场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be described below in conjunction with the accompanying drawings. Apparently, the described embodiments are only part of the present application, rather than all of them. . Those skilled in the art know that, with the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或模块的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或模块,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或模块。在本申请中出现的对步骤进行的命名或者编号,并不意味着必须按照命名或者编号所指示的时间/逻辑先后顺序执行方法流程中的步骤,已经命名或者编号的流程步骤可以根据要实现的技术目的变更执行次序,只要能达到相同或者相类似的技术效果即可。本申请中所出现的单元的划分,是一种逻辑上的划分,实际应用中实现时可以有另外的划分方式,例如多个单元可以结合成或集成在另一个系统中,或一些特征可以忽略,或不执行,另外,所显示的或讨论的相互之间的耦合或直接耦合或通信连接可以是通 过一些接口,单元之间的间接耦合或通信连接可以是电性或其他类似的形式,本申请中均不作限定。并且,作为分离部件说明的单元或子单元可以是也可以不是物理上的分离,可以是也可以不是物理单元,或者可以分布到多个电路单元中,可以根据实际的需要选择其中的部分或全部单元来实现本申请方案的目的。The terms "first", "second" and the like in the specification and claims of the present application and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or modules is not necessarily limited to the expressly listed Instead, other steps or modules not explicitly listed or inherent to the process, method, product or apparatus may be included. The naming or numbering of the steps in this application does not mean that the steps in the method flow must be executed in the time/logic sequence indicated by the naming or numbering. The execution order of the technical purpose is changed, as long as the same or similar technical effect can be achieved. The division of units presented in this application is a logical division. In actual application, there may be other division methods. For example, multiple units can be combined or integrated in another system, or some features can be ignored. , or not, in addition, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, and the indirect coupling or communication connection between units may be electrical or other similar forms, this Applications are not limited. Moreover, the units or subunits described as separate components may or may not be physically separated, may or may not be physical units, or may be distributed into multiple circuit units, and some or all of them may be selected according to actual needs unit to realize the purpose of the application scheme.
本发明实施例的技术方案主要应用于如图1所示的中心节点(如图1所示的车辆系统)以辅助节点(如图1所示的用户手机、监管平台以及车厂云服务)之间的通信场景。具体来说可以应用于适用于车辆通信的各种通信系统,例如:全球移动通讯(Global System of Mobile Communication,GSM)系统、码分多址(Code Division Multiple Access,CDMA)系统、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)系统、长期演进(Long Term Evolution,LTE)系统、LTE频分双工(Frequency Division Duplex,FDD)系统、LTE时分双工(Time Division Duplex,TDD)、通用移动通信系统(Universal Mobile Telecommunication System,UMTS)、5G通信系统、以及未来的无线通信系统等。在该通信场景下,该中心节点采集预设时间段内的行车数据;然后该中心节点利用哈希算法对该行车数据进行计算得到根哈希值;该中心节点根据该根哈希值和时间戳生成该行车数据的数据包头,并利用私钥对该数据包头进行签名;其中,该时间戳为系统时间,该私钥为随机生成;该中心节点在生成该数据包头之后,将该数据包头发送至辅助节点;该辅助节点同步该数据包头;最后该中心节点和该辅助节点均可以根据该数据包头对该行驶数据进行验证。The technical solution of the embodiment of the present invention is mainly applied between the central node (the vehicle system shown in FIG. 1 ) and the auxiliary node (the user mobile phone, the supervision platform, and the car factory cloud service shown in FIG. 1 ) as shown in FIG. 1 . communication scene. Specifically, it can be applied to various communication systems suitable for vehicle communication, such as: Global System of Mobile Communication (GSM) system, Code Division Multiple Access (CDMA) system, broadband code division multiple Wideband Code Division Multiple Access (WCDMA) system, Long Term Evolution (LTE) system, LTE Frequency Division Duplex (FDD) system, LTE Time Division Duplex (TDD), general Mobile communication system (Universal Mobile Telecommunication System, UMTS), 5G communication system, and future wireless communication system, etc. In this communication scenario, the central node collects the driving data within a preset time period; then the central node uses the hash algorithm to calculate the driving data to obtain the root hash value; the central node calculates the root hash value according to the root hash value and time Stamp to generate the data packet header of the driving data, and use the private key to sign the data packet header; wherein, the timestamp is the system time, and the private key is randomly generated; after the central node generates the data packet header, the data packet header Send it to the auxiliary node; the auxiliary node synchronizes the data packet header; finally, both the central node and the auxiliary node can verify the driving data according to the data packet header.
为了便于理解,下面对本申请实施例中的部分名词进行解释:For ease of understanding, some nouns in the embodiments of the present application are explained below:
可信执行环境(trusted execution environment,TEE):相对于通用执行环境(富执行环境(rich execution environment,REE)),TEE受硬件机制保护,可以加密存储数据。REE只能通过特定接口与TEE通信,且无法访问受硬件保护的TEE内存空间。Trusted execution environment (TEE): Compared with the general execution environment (rich execution environment (REE)), TEE is protected by hardware mechanism and can encrypt and store data. REE can only communicate with TEE through a specific interface, and cannot access the hardware-protected TEE memory space.
哈希(Hash)算法:把任意长度原始数据的输入通过hash算法,可以变换成固定长度的输出。原始数据任何微小的改动,都会导致固定长度的结果发生巨大的变化。Hash算法可用来验证原始数据的完整性。Hash algorithm: The input of arbitrary length original data can be transformed into a fixed-length output through the hash algorithm. Any small change in the original data will cause a huge change in the fixed-length result. Hash algorithm can be used to verify the integrity of the original data.
Merkle Hash树:一种hash二叉树,与标准二叉树一样,由一组叶节点,一组中间节点和一个根节点构成。叶节点包含存储数据或其哈希值,中间节点是其两个子节点内容的哈希值,最上层的根节点同样也是由它的两个子节点内容的哈希值。其原理图可以如图2所示,数据1、数据2、数据3以及数据4分别根据hash算法得到相应的hash值;然后hash值两两结合得到上一层的hash值;上层的hash值再两两结合计算得到根哈希值。Merkle Hash tree: A hash binary tree, which, like a standard binary tree, consists of a set of leaf nodes, a set of intermediate nodes, and a root node. The leaf node contains stored data or its hash value, the middle node is the hash value of the content of its two child nodes, and the top root node is also the hash value of the content of its two child nodes. Its schematic diagram can be shown in Figure 2. The data 1, data 2, data 3 and data 4 respectively obtain corresponding hash values according to the hash algorithm; then the hash values are combined in pairs to obtain the hash value of the upper layer; The root hash value is obtained by combining two by two.
数据完整性(Data integrity)是信息安全的三个基本要点之一;在传输、存储信息或数据的过程中,确保信息或数据不被未授权的篡改或在篡改后能够被迅速发现。在信息安全领域使用过程中,通常使用数字签名、hash算法等手段保证数据完整性。Data integrity (Data integrity) is one of the three basic points of information security; in the process of transmitting and storing information or data, to ensure that information or data is not tampered by unauthorized or can be quickly discovered after tampering. In the process of using in the field of information security, digital signatures, hash algorithms and other means are usually used to ensure data integrity.
数据包:本申请实施例中定义的一种数据结构,由一段时间采集的行车数据以及由该行车数据计算的merkle hash树(即merkle hash各层的哈希值)构成。Data packet: a kind of data structure defined in the embodiment of this application, which is composed of driving data collected for a period of time and a merkle hash tree (ie, the hash value of each layer of merkle hash) calculated by the driving data.
数据包头:本发明定义的一种数据结构,数据包头数据结构主要包含四部分:根哈希值、时间戳、前一个数据包头哈希值、TEE数字签名。本实施例中,该数据包与该数据包 头的具体结构可以如图3所示。Data packet header: a data structure defined by the present invention. The data packet header data structure mainly includes four parts: root hash value, timestamp, previous data packet header hash value, and TEE digital signature. In this embodiment, the specific structure of the data packet and the data packet header can be as shown in Figure 3.
中心节点:含有TEE可信执行环境的数据采集节点。一种可能实现方式为,该中心节点为该车辆自带的数据采集设备;另一种可能实现方式为独立于该车辆之外的数据采集设备,且该数据采集设备与该车辆的各个传感器相连。Central node: the data acquisition node containing the TEE trusted execution environment. One possible implementation is that the central node is a data acquisition device that comes with the vehicle; another possible implementation is that the data acquisition device is independent of the vehicle, and the data acquisition device is connected to each sensor of the vehicle .
辅助节点:接收可信中心节点同步的数据包/数据包头数据的节点。通常为车厂云服务节点,车主手机App节点等。Auxiliary node: The node that receives the data packet/data packet header data synchronized by the trusted central node. Usually it is the cloud service node of the car factory, the app node of the car owner's mobile phone, etc.
区块链:一种将数据区块以顺序相连的方式组合成的一种链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。Blockchain: A chained data structure that combines data blocks in a sequential manner, and a cryptographically guaranteed non-tamperable and unforgeable distributed ledger.
可信应用程序(Trusted Application,TA):在可信执行环境中运行的应用程序。Trusted Application (TA): An application that runs in a trusted execution environment.
富执行环境(rich execution environment,REE):相对于TEE来讲的通用执行环境,资源丰富,但安全性较TEE环境低。Rich execution environment (rich execution environment, REE): Compared with TEE, the general execution environment is rich in resources, but the security is lower than that of TEE environment.
序列化:是指对内存里面的数据结构,按照一定的格式,放到一块连续的内存里。序列化的作用,是方便对数据计算签名,以及对数据进行通信传输。因为签名和数据传输,对一块连续的内存数据,比较方便。Serialization: It refers to putting the data structure in the memory into a continuous memory according to a certain format. The role of serialization is to facilitate the calculation and signature of data and the communication and transmission of data. Because of the signature and data transmission, it is more convenient for a piece of continuous memory data.
下面根据图示对本申请实施例中的防止行车数据篡改的方法进行描述,具体请参阅图4所示The following is a description of the method for preventing tampering of driving data in the embodiment of the present application according to the diagram, please refer to Figure 4 for details
401、该中心节点获取预设时间段内的行车数据。401. The central node acquires driving data within a preset time period.
在车辆行驶过程中,该中心节点获取车辆全部参与工作的传感器在预设时间段内采集到的行车数据。During the driving process of the vehicle, the central node obtains the driving data collected by all the sensors of the vehicle involved in the work within a preset time period.
一种可能实现方式中,该中心节点还可以对行车数据进行分组。即一个传感器在预设时间段内的数据为一个数组。一个示例性方案中,假设有4个传感器参与工作,每个传感器0.1秒钟采集一次数据,而该中心节点每间隔10秒钟,构造一次数据包;则一个数据包中,共收集4*(10/0.1)=400个数据,而每个数组包括100个数据。例如,其中气缸参数,是一个100个元素的数组,代表10秒钟内,采集的100次气缸传感器数据,其它传感器参数类似,不再赘述。In a possible implementation manner, the central node may also group the driving data. That is, the data of a sensor within a preset time period is an array. In an exemplary scheme, assuming that there are 4 sensors participating in the work, each sensor collects data once every 0.1 second, and the central node constructs a data packet every 10 seconds; then in one data packet, a total of 4*( 10/0.1)=400 data, and each array includes 100 data. For example, the cylinder parameter is an array of 100 elements, which represents 100 cylinder sensor data collected within 10 seconds. Other sensor parameters are similar and will not be repeated here.
402.该中心节点根据该行车数据计算得到根哈希值。402. The central node calculates the root hash value according to the driving data.
本实施例中,该中心节点计算得到该根哈希值的方法如下:In this embodiment, the method for the central node to calculate the root hash value is as follows:
一种可能实现方式中,该中心节点可以根据各个传感器的数据整合为一个整体数据,然后对该整体数据进行哈希计算得到该根哈希值。In a possible implementation manner, the central node may integrate the data of each sensor into a whole data, and then perform hash calculation on the whole data to obtain the root hash value.
另一种可能实现方式中,该中心节点对该行车数据进行分组,即一个数组为所述预设时间段内一个传感器采集的数据;然后该中心节点计算各个数组对应的哈希值;按照默克尔树计算逻辑将所述每个数组对应的哈希值两两结合计算得到上层哈希值,直至得到所述根哈希值。比如,一个数组包括100个数据,则对该100个数据进行整体的哈希计算,得到该数组对应的唯一一个哈希值。若包括多个数组,则将会计算出多个哈希值。然后,该中心节点利用默克尔树计算逻辑对该多个数组对应的多个哈希值进行计算得到该多个数组对应的根哈希值(也可以称为merkle根hash)。In another possible implementation, the central node groups the driving data, that is, one array is the data collected by a sensor within the preset time period; then the central node calculates the hash value corresponding to each array; according to the default The Kerr tree calculation logic combines the hash values corresponding to each array in pairs to calculate the upper layer hash value until the root hash value is obtained. For example, if an array includes 100 data, an overall hash calculation is performed on the 100 data to obtain a unique hash value corresponding to the array. If multiple arrays are included, multiple hash values will be calculated. Then, the central node calculates multiple hash values corresponding to the multiple arrays using Merkle tree calculation logic to obtain root hash values (also called merkle root hashes) corresponding to the multiple arrays.
一种示例性方案中,该中心节点将该多个数组对应的多个哈希值两两结合进行计算真 到得到一个唯一的哈希值,该最终的哈希值作为该多个数组对应的根哈希值。In an exemplary solution, the central node combines multiple hash values corresponding to the multiple arrays to calculate a unique hash value, and the final hash value is used as the hash value corresponding to the multiple arrays. root hash.
以图5所示的方案为例,若该中心节点在当前时刻采集到该全球定位系统(Global Positioning System,GPS)传感器数据、刹车传感器数据、气缸参数以及气囊传感器数据;然后对各个传感器的数据进行哈希计算得到哈希值1、哈希值2、哈希值3和哈希值4;在该默克尔树计算逻辑下,将该哈希值1和该哈希值2结合计算得到第二层的哈希值12、将该哈希值3和哈希值4结合计算得到第二层的哈希值34;最后将该哈希值12和该哈希值34结合计算得到该根哈希值。Taking the scheme shown in Figure 5 as an example, if the central node collects the Global Positioning System (Global Positioning System, GPS) sensor data, brake sensor data, cylinder parameters and airbag sensor data at the current moment; then the data of each sensor Perform hash calculation to obtain hash value 1, hash value 2, hash value 3, and hash value 4; under the calculation logic of the Merkle tree, combine the hash value 1 and the hash value 2 to obtain The hash value 12 of the second layer, combine the hash value 3 and the hash value 4 to obtain the hash value 34 of the second layer; finally combine the hash value 12 and the hash value 34 to obtain the root hash value.
本实施例中,若该在计算过程中出现奇数的情况,则在两两结合后剩下的哈希值需要第一次进行哈希计算得到的哈希值。具体情况可以如图6所示。若该中心节点在当前时刻采集了七个传感器的数据,分别计为(sensor1、sensor2、sensor3、sensor4、sensor5、sensor6、sensor7);然后对各个传感器的数据进行哈希计算得到哈希值1、哈希值2、哈希值3、哈希值4、哈希值5、哈希值6、哈希值7;然后在该默克尔树计算逻辑的第二层,两两结合进行哈希计算的过程时,该哈希值1和哈希值2结合计算得到哈希值12,该哈希值3和哈希值4结合计算得到哈希值34,该哈希值5和哈希值6结合计算得到哈希值56,而哈希值7为单独一个,则对该哈希值7进行保持;在默克尔树计算逻辑的第三层,两两结合进行哈希计算的过程时,哈希值12和哈希值34结合计算得到哈希值1234,哈希值56和哈希值7结合计算得到哈希值567;在默克尔树计算逻辑的第四层,两两结合进行哈希计算的过程时,该哈希值1234和该哈希值567结合计算得到该七个传感器的数据的根哈希值。In this embodiment, if there is an odd number during the calculation process, the remaining hash value after the combination of pairs needs to be the hash value obtained by the first hash calculation. The specific situation can be shown in FIG. 6 . If the central node collects the data of seven sensors at the current moment, they are counted as (sensor1, sensor2, sensor3, sensor4, sensor5, sensor6, sensor7); then perform hash calculation on the data of each sensor to obtain the hash value 1, Hash value 2, hash value 3, hash value 4, hash value 5, hash value 6, hash value 7; then in the second layer of the calculation logic of the Merkle tree, two pairs are combined for hashing During the calculation process, the hash value 1 and the hash value 2 are combined to calculate the hash value 12, the hash value 3 and the hash value 4 are combined to calculate the hash value 34, the hash value 5 and the hash value 6 is combined and calculated to get the hash value 56, and the hash value 7 is a single one, then the hash value 7 is kept; in the third layer of the Merkle tree calculation logic, when the process of hash calculation is performed by combining two by two , hash value 12 and hash value 34 are combined to calculate hash value 1234, hash value 56 and hash value 7 are combined to calculate hash value 567; in the fourth layer of Merkle tree calculation logic, two-by-two combination During the hash calculation process, the hash value 1234 and the hash value 567 are combined to calculate the root hash value of the data of the seven sensors.
可以理解的是,本实施例中,该哈希值的结合可以是随机组合,并不限定结合顺序;只要可以实现默克尔树计算逻辑即可。It can be understood that, in this embodiment, the combination of the hash values may be a random combination, and the combination order is not limited; as long as the Merkle tree calculation logic can be realized.
403、该中心节点根据该根哈希值和时间戳生成数据包头,并利用私钥签名,该时间戳为系统时间,该私钥为随机生成。403. The central node generates a data packet header according to the root hash value and a time stamp, and signs it with a private key, the time stamp is system time, and the private key is randomly generated.
本实施例中,若该中心节点的软件运行环境(即富执行环境(rich execution environment,REE))为安全环境,则该中心节点可以直接在该REE中根据该根哈希值和该时间戳生成数据包头。若该中心节点的软件运行环境不是安全环境,则该中心节点将该根哈希值由该中心节点的REE环境传递给可信执行环境内的TA程序,触发该TA程序生成时间戳,然后根据该时间戳和该根哈希值生成数据包头。同时该中心节点生成该数据包头之后还可以通过该可信执行环境中的TA程序生成私钥,用于对该数据包头进行签名,这样行车数据验证系统可以通过数据包头,保证行车数据的时间真实性和防篡改性。如图7所示,该中心节点将根哈希值(merkle根hash)传递给可信执行环境内的TA程序,触发TA程序生成可信时间戳,同时,TA程序获取缓存的前一个数据包头哈希值(hash)(如果当前时刻的数据包头为第一个数据包头,则前一个数据包头hash为全0,或其他任意标识);然后该中心节点在该TEE环境下将根哈希值、时间戳以及前一个数据包头的哈希值序列化并通过TA程序的私钥进行签名,得到最终的数据包头。可以理解的是,一种示例性方案中(以C语言为例进行表示),在图7所示的架构下生成的数据包头的结构可以具体如下:In this embodiment, if the software operating environment (i.e. rich execution environment (REE)) of the central node is a secure environment, then the central node can directly use the root hash value and the timestamp in the REE Generate packet headers. If the software operating environment of the central node is not a secure environment, the central node transmits the root hash value from the REE environment of the central node to the TA program in the trusted execution environment, triggering the TA program to generate a timestamp, and then according to The timestamp and the root hash generate the packet header. At the same time, after the central node generates the data packet header, it can also generate a private key through the TA program in the trusted execution environment, which is used to sign the data packet header, so that the driving data verification system can pass the data packet header to ensure that the time of the driving data is true. Safety and tamper resistance. As shown in Figure 7, the central node passes the root hash value (merkle root hash) to the TA program in the trusted execution environment, triggering the TA program to generate a trusted timestamp, and at the same time, the TA program obtains the cached previous data packet header Hash value (hash) (if the data packet header at the current moment is the first data packet header, then the previous data packet header hash is all 0, or any other identifier); then the central node will root the hash value in the TEE environment , timestamp, and the hash value of the previous data packet header are serialized and signed by the private key of the TA program to obtain the final data packet header. It can be understood that, in an exemplary solution (expressed in C language as an example), the structure of the data packet header generated under the architecture shown in FIG. 7 can be specifically as follows:
Typedef struct{Typedef struct{
char*merkleRootHash;//本次采集的传感器数据的merkle根hashchar*merkleRootHash;//The merkle root hash of the sensor data collected this time
char*timeStamp;//本次数据采集的可信时间戳char*timeStamp;//The credible timestamp of this data collection
char*previousHash;//TEE内TA程序缓存的前一个数据包头hashchar*previousHash; //The hash of the previous packet header cached by the TA program in the TEE
}PackageHeader;}PackageHeader;
Typedef struct{Typedef struct{
PackageHeader header;//未签名的数据包头PackageHeader header;//unsigned packet header
char*signature;//TEE内TA程序的private key对数据的签名char*signature;//The private key of the TA program in the TEE signs the data
}SignedHeader}SignedHeader
通过merkleRootHash,可以保证在当前时间段内收集到的传感器数据的完整性(防篡改性);通过timeStamp保证传感器采集时间的真实性;通过previousHash,保证传感器采集数据的连续性;Through merkleRootHash, the integrity of sensor data collected in the current time period can be guaranteed (tamper-proof); through timeStamp, the authenticity of sensor collection time can be guaranteed; through previousHash, the continuity of sensor data collection can be guaranteed;
通过TA程序的签名私钥,对PackageHeader进行签名,得到签名后的SignedHeader。Sign the PackageHeader with the signature private key of the TA program to obtain the signed SignedHeader.
本实施例中,为了保证数据的连续性,该中心节点在生成该数据包头时还可以将前一数据包的数据包头的哈希值加入,具体包括:所述中心节点获取前一数据包头的哈希值,所述前一数据包头的哈希值为对所述第一数据包头整体进行哈希计算得到;所述中心节点根据所述前一数据包头的哈希值、所述根哈希值和所述时间戳在所述中心节点的可信执行环境中生成所述数据包头。本实施例中,这种前后包头哈希值相连的结构,是为了保障记录数据的连续性。本实施例中通过根哈希值以及时间戳构造数据包头只能保证当前数据的完整性,但是当前数据和前一个数据之间,是不是有别的数据被删掉了,就需要哈希值相连的结构来保证。有了哈希值相连的结构,一旦中间有个数据包头被恶意丢弃了,那当前包头结构里面的前向包头哈希值值,和前一个包头重新计算哈希值,就会对不上,从而可以发现数据被丢弃了。In this embodiment, in order to ensure the continuity of data, the central node can also add the hash value of the data packet header of the previous data packet when generating the data packet header, which specifically includes: the central node obtains the hash value of the previous data packet header Hash value, the hash value of the previous data packet header is obtained by hashing the entire first data packet header; the central node is based on the hash value of the previous data packet header, the root hash The value and the timestamp generate the data packet header in the trusted execution environment of the central node. In this embodiment, the structure in which hash values of front and rear headers are connected is to ensure the continuity of recorded data. In this embodiment, constructing the data packet header through the root hash value and timestamp can only ensure the integrity of the current data, but if there is any other data deleted between the current data and the previous data, the hash value is needed The connected structure is guaranteed. With the hash value connected structure, once a data packet header in the middle is maliciously discarded, the forward packet header hash value in the current packet header structure will not match with the previous packet header to recalculate the hash value. It can be found that the data is discarded.
404、该中心节点将该数据包头发送给辅助节点。404. The central node sends the data packet header to the auxiliary node.
本实施例中,该中心节点在将该数据包头发送给辅助节点的同时,还可以向该辅助节点发送所述数据包头对应的数据包的全部数据或者部分数据;其中,所述数据包的全部数据包括所述行车数据在默克尔树计算逻辑下对应的全部哈希值和所述行车数据;所述数据包的部分数据包括所述行车数据在默克尔树计算逻辑下对应的部分哈希值和所述行车数据的部分内容,且所述数据包的部分数据可计算得到所述根哈希值。本实施例中,该数据包包括两部分:原始数据、中间各个层级的哈希值。所述数据包中的部分数据指的是:部分原始数据+部分哈希值。这样可以在有效保证数据完整性的情况下,降低各个设备之间数据传输量。In this embodiment, when the central node sends the data packet header to the auxiliary node, it may also send all or part of the data of the data packet corresponding to the data packet header to the auxiliary node; wherein, all of the data packet The data includes all the hash values corresponding to the driving data under the Merkle tree calculation logic and the driving data; the partial data of the data packet includes the corresponding partial hash values of the driving data under the Merkle tree calculation logic. Hash value and partial content of the driving data, and partial data of the data packet can be calculated to obtain the root hash value. In this embodiment, the data packet includes two parts: original data, and hash values of various levels in the middle. Part of the data in the data packet refers to: part of the original data+part of the hash value. In this way, the amount of data transmission between devices can be reduced while effectively ensuring data integrity.
本实施例中,该中心节点可以仅向该辅助节点同步该辅助节点所需要的数据。比如,该车厂云服务主要关心的数据是气缸参数以及气囊传感器数据,则该中心节点可以如图8所示向该辅助节点发送的数据包中的可以仅包括hash12、hash34、hash3、hash4、气缸参数以及气囊传感器数据。可以理解的是,为了保证可以验证数据的完整性,该中心节点向该辅助节点同步的数据需要可以计算得到根哈希值。如图8所示的同步数据可以满足条件,若只保留气缸参数、气囊传感器数据则无法验证数据的完整性。In this embodiment, the central node may only synchronize data required by the auxiliary node to the auxiliary node. For example, if the car factory cloud service mainly cares about cylinder parameters and airbag sensor data, then the central node can send only hash12, hash34, hash3, hash4, cylinder parameters and airbag sensor data. It can be understood that, in order to ensure that the integrity of the data can be verified, the data synchronized by the central node to the auxiliary node needs to be able to calculate the root hash value. The synchronization data shown in Figure 8 can meet the conditions, but if only the cylinder parameters and airbag sensor data are kept, the integrity of the data cannot be verified.
本实施例中,若辅助节点只同步了部分原始数据,则只能保证被同步的那部分原始数据是完整的,并不能保证所有传感器数据是完整的。所以辅助节点可以按照自身的需求策略进行数据同步。一种可能实现方式中,若需要全部原始数据,则有两种实施方案:1、把所有数据都同步到车厂云数据库,保证merkle hash树是完整的;2、同步部分数据到车厂云数据库,其余数据在车辆存储系统存储,或者在其它监管平台存储,只要满足各个节点设备的数据加起来是全部原始数据即可。In this embodiment, if the auxiliary node only synchronizes part of the original data, it can only ensure that the synchronized part of the original data is complete, and it cannot guarantee that all sensor data is complete. Therefore, the auxiliary node can perform data synchronization according to its own demand strategy. In one possible implementation, if all original data is required, there are two implementation options: 1. Synchronize all data to the car factory cloud database to ensure that the merkle hash tree is complete; 2. Synchronize part of the data to the car factory cloud database, The rest of the data is stored in the vehicle storage system, or stored on other supervision platforms, as long as the data of each node device add up to all the original data.
另一种可能实现方式中,若各个节点仅需要验证部分数据的完整性,那各个节点可以仅同步自身需要的数据即可,而其余数据保留哈希值,这样就可以验证这部分数据的完整性,以及验证整体数据是否篡改。In another possible implementation, if each node only needs to verify the integrity of part of the data, each node can only synchronize the data it needs, while the rest of the data retains the hash value, so that the integrity of this part of the data can be verified , and verify whether the overall data has been tampered with.
405、该辅助节点利用该数据包头验证所述行车数据是否篡改。405. The auxiliary node uses the data packet header to verify whether the driving data has been tampered with.
该辅助节点可以利用数据包头中的根哈希值、时间戳以及签名验证行车数据是否正确。The auxiliary node can use the root hash value, timestamp and signature in the data packet header to verify whether the driving data is correct.
根据辅助节点的不同情况,其验证方式可以有不同:Depending on the situation of the auxiliary node, its verification method can be different:
一种可能实现方式中,若该辅助节点为车厂云服务,则该车厂云服务根据相关软件接收数据包,并将该数据包存储在该车厂云数据库;同时接收数据包头,进行签名验证、存储。该车厂云服务可以直接根据数据包中的数据计算根哈希值,并将该根哈希值与存储的数据包头中的根哈希值进行比对,若不存在差异,则说明数据未进行篡改,若存在差异,则说明该车厂云服务保留的数据有篡改。In a possible implementation, if the auxiliary node is a car factory cloud service, the car factory cloud service receives the data packet according to the relevant software, and stores the data packet in the car factory cloud database; at the same time, it receives the data packet header, performs signature verification, and stores . The car factory cloud service can directly calculate the root hash value based on the data in the data packet, and compare the root hash value with the root hash value in the stored data packet header. If there is no difference, it means that the data has not been processed. Tampering, if there is a difference, it means that the data retained by the automaker's cloud service has been tampered with.
一种可能实现方式中,若该辅助节点为用户手机,则该用户手机可以通过无线或有线方式从该中心节点获取该数据包头,同时获取从该车厂云数据库下载该车厂云数据库存储的数据包头,然后两者比对。若不存在差异,则说明数据未进行篡改,若存在差异,则说明至少有一个节点的数据进行了篡改。In a possible implementation, if the auxiliary node is a user's mobile phone, the user's mobile phone can obtain the data packet header from the central node in a wireless or wired manner, and at the same time obtain the data packet header stored in the automaker's cloud database downloaded from the automaker's cloud database , and then compare the two. If there is no difference, it means that the data has not been tampered with, and if there is a difference, it means that the data of at least one node has been tampered with.
或者,该用户手机通过无线或有线方式从该中心节点获取该数据包头,并获取从该车厂云数据库下载该车厂云数据库存储的数据包头和数据包,则该用户手机将该车厂云数据库的数据包计算得到根哈希值与该车厂云数据库的数据包头的根哈希值进行比对,若不存在差异,则说明该车厂云数据库保留的数据包头与数据包相匹配;若存在差异,则说明该车厂云数据库保留的数据包头与数据包不匹配,可能存在车厂云数据库的数据被篡改的情况。在确定该车厂云数据库保留的数据包头与数据包相匹配的情况下,该用户手机还可以将自身存储的数据包头中的根哈希值与该车厂云数据库的数据包计算得到根哈希值和该车厂云数据库的数据包头的根哈希值进行比对,若不存在差异,则说明数据未被篡改;若存在差异,则说明至少一个节点的数据被篡改。Or, the user's mobile phone obtains the data packet header from the central node through wireless or wired means, and downloads the data packet header and data packets stored in the automaker's cloud database from the automaker's cloud database, then the user's mobile phone obtains the data in the automaker's cloud database. Compare the root hash value obtained by packet calculation with the root hash value of the data packet header of the automaker's cloud database. If there is no difference, it means that the data packet header retained by the automaker's cloud database matches the data packet; if there is a difference, then It shows that the data packet header retained by the automaker's cloud database does not match the data packet, and the data in the automaker's cloud database may have been tampered with. When it is determined that the data packet header retained by the automaker's cloud database matches the data packet, the user's mobile phone can also calculate the root hash value from the root hash value in the data packet header stored by itself and the data packet of the automaker's cloud database Compare with the root hash value of the data packet header of the car factory cloud database. If there is no difference, it means that the data has not been tampered with; if there is a difference, it means that the data of at least one node has been tampered with.
一种可能实现方式中,若该辅助节点为监管平台,则该监管平台根据相关软件接收数据包,并将该数据包存储在该监管平台云数据库;同时接收数据包头,进行签名验证、存储。该监管平台服务可以直接根据数据包中的数据计算根哈希值,并将该根哈希值与存储的数据包头中的根哈希值进行比对,若不存在差异,则说明数据未进行篡改,若存在差异,则说明该监管平台保留的数据有篡改。或者,该监管平台直接从该车厂云数据库下载该车厂云数据库存储的数据包头,并将该数据包头与该监管平台存储的数据包头进行比对,若不存在差异,则说明数据未进行篡改,若存在差异,则说明至少有一个节点的数据进行了 篡改。In a possible implementation, if the auxiliary node is a supervision platform, the supervision platform receives the data packet according to relevant software, and stores the data packet in the cloud database of the supervision platform; at the same time, it receives the header of the data packet, performs signature verification, and stores it. The monitoring platform service can directly calculate the root hash value based on the data in the data packet, and compare the root hash value with the root hash value in the stored data packet header. If there is no difference, it means that the data has not been processed. Tampering, if there is a difference, it means that the data retained by the monitoring platform has been tampered with. Alternatively, the supervision platform directly downloads the header of the data packet stored in the cloud database of the automobile manufacturer from the cloud database of the automobile manufacturer, and compares the header of the data packet with the header of the data stored on the supervision platform. If there is no difference, it means that the data has not been tampered with. If there is a difference, it means that the data of at least one node has been tampered with.
或者,该监管平台通过无线或有线方式从该中心节点获取该数据包头,并获取从该车厂云数据库下载该车厂云数据库存储的数据包头和数据包,则该监管平台将该车厂云数据库的数据包计算得到根哈希值与该车厂云数据库的数据包头的根哈希值进行比对,若不存在差异,则说明该车厂云数据库保留的数据包头与数据包相匹配;若存在差异,则说明该车厂云数据库保留的数据包头与数据包不匹配,可能存在车厂云数据库的数据被篡改的情况。在确定该车厂云数据库保留的数据包头与数据包相匹配的情况下,该监管平台还可以将自身存储的数据包头中的根哈希值与该车厂云数据库的数据包计算得到根哈希值和该车厂云数据库的数据包头的根哈希值进行比对,若不存在差异,则说明数据未被篡改;若存在差异,则说明至少一个节点的数据被篡改。Alternatively, the supervision platform obtains the data packet header from the central node through wireless or wired means, and downloads the data packet header and data packets stored in the automaker's cloud database from the automaker's cloud database. Compare the root hash value obtained by packet calculation with the root hash value of the data packet header of the automaker's cloud database. If there is no difference, it means that the data packet header retained by the automaker's cloud database matches the data packet; if there is a difference, then It shows that the data packet header retained by the automaker's cloud database does not match the data packet, and the data in the automaker's cloud database may have been tampered with. When it is determined that the data packet header retained by the automaker’s cloud database matches the data packet, the supervision platform can also calculate the root hash value from the root hash value in the data packet header stored by itself and the data packet of the automaker’s cloud database Compare with the root hash value of the data packet header of the car factory cloud database. If there is no difference, it means that the data has not been tampered with; if there is a difference, it means that the data of at least one node has been tampered with.
本实施例中,上述各个辅助节点还可以提供数据包头查询服务或者公开该数据包头信息,这样可以进一步增强不可篡改性。因为整个行车数据验证系统的参与方数量有限,有一定概率导致所有节点的数据均被篡改。因此,实时对外公开数据包头信息,可以被外界任意监督方随时收集,有利于进一步增强防篡改性。各个辅助节点公开该数据包头信息的方式包括但不限于网站公开或者提供查询接口,供外部对接访问。In this embodiment, each of the above-mentioned auxiliary nodes can also provide a data packet header query service or disclose the data packet header information, which can further enhance non-tampering. Because the number of participants in the entire driving data verification system is limited, there is a certain probability that the data of all nodes will be tampered with. Therefore, the real-time disclosure of data packet header information can be collected by any external supervisory party at any time, which is conducive to further enhancing tamper resistance. The way each auxiliary node discloses the data packet header information includes but is not limited to website disclosure or providing a query interface for external access.
下面以一个具体应用场景对本申请实施例中防止行车数据篡改的方法进行说明,以图9所示的场景为例进行说明,该场景下包括车辆、车主手机以及车厂云服务三方。其具体流程如下:The method for preventing tampering of driving data in the embodiment of the present application is described below with a specific application scenario, taking the scenario shown in Figure 9 as an example, which includes the vehicle, the mobile phone of the owner, and the cloud service of the car manufacturer. The specific process is as follows:
车辆首次启动时,车辆将车辆可信执行环境内TA程序生成的验签公钥,通过车载网联模块,发送给车厂云服务。车厂云服务创建与该车辆相关的对象实例,接收并保存该验签公钥,该验签公钥用作数据包头签名验证。When the vehicle starts for the first time, the vehicle sends the signature verification public key generated by the TA program in the vehicle's trusted execution environment to the cloud service of the car factory through the vehicle network connection module. The car factory cloud service creates an object instance related to the vehicle, receives and saves the signature verification public key, and the signature verification public key is used for signature verification of the data packet header.
当车主手机通过蓝牙等方式与车辆连接时,车辆将TA程序的验签公钥,发送给车主手机。在该车主手机获取该验签公钥时,可以先与该车辆进行身份验证,然后才可以获取该公钥。该车主手机保存该验签公钥,该验签公钥用作数据包头签名验证。When the owner's mobile phone is connected to the vehicle through Bluetooth or other means, the vehicle will send the signature verification public key of the TA program to the owner's mobile phone. When the owner's mobile phone obtains the public key for signature verification, the identity verification with the vehicle can be performed first, and then the public key can be obtained. The owner's mobile phone saves the signature verification public key, and the signature verification public key is used for signature verification of the data packet header.
该车辆行驶过程中,该车辆采集行车数据,并通过图4所示的方案构成数据包头和数据包。同时该车辆将会缓存该数据包和该数据包头。同时,该车辆开启网络同步线程,持续的向车厂云服务和车主手机同步数据包头。可以理解的是,该车辆还可以向该车厂云服务同步数据包中的全部或者部分数据。During the driving process of the vehicle, the vehicle collects driving data, and forms a data packet header and a data packet through the scheme shown in FIG. 4 . At the same time, the vehicle will cache the data packet and the data packet header. At the same time, the vehicle starts the network synchronization thread, and continuously synchronizes the data packet header with the car factory cloud service and the car owner's mobile phone. It can be understood that the vehicle can also synchronize all or part of the data in the data package to the car manufacturer's cloud service.
数据验证时,该车厂云服务根据相关软件接收数据包,并将该数据包进行存储;同时接收数据包头,进行签名验证、存储。该车厂云服务可以直接根据数据包中的数据计算根哈希值,并将该根哈希值与存储的数据包头中的根哈希值进行比对,若不存在差异,则说明数据未进行篡改,若存在差异,则说明该车厂云服务保留的数据有篡改。During data verification, the car factory cloud service receives the data packet according to the relevant software, and stores the data packet; at the same time, it receives the data packet header, performs signature verification, and stores it. The car factory cloud service can directly calculate the root hash value based on the data in the data packet, and compare the root hash value with the root hash value in the stored data packet header. If there is no difference, it means that the data has not been processed. Tampering, if there is a difference, it means that the data retained by the automaker's cloud service has been tampered with.
车主手机可以通过无线或有线方式从该车辆获取该数据包头,同时获取从该车厂云服务下载该车厂云服务存储的数据包头,然后两者比对。若不存在差异,则说明数据未进行篡改,若存在差异,则说明至少有一个节点的数据进行了篡改。The owner's mobile phone can obtain the data packet header from the vehicle in a wireless or wired manner, and at the same time obtain the data packet header downloaded from the automaker's cloud service and stored in the automaker's cloud service, and then compare the two. If there is no difference, it means that the data has not been tampered with, and if there is a difference, it means that the data of at least one node has been tampered with.
上面对本申请实施例中的防止行车数据篡改的方法进行了描述,下面对本申请实施例 中的相关装置进行描述。The method for preventing tampering of driving data in the embodiment of the present application has been described above, and the related devices in the embodiment of the present application will be described below.
具体请参阅图10所示,本申请实施例中该数据采集装置1000包括:获取模块1001、处理模块1002、发送模块1003,其中获取模块1001、处理模块1002、发送模块1003通过总线连接。数据采集装置1000可以是上述方法实施例中的中心节点,也可以配置为中心节点内的一个或多个芯片。数据采集装置1000可以用于执行上述方法实施例中的中心节点的部分或全部功能。Please refer to FIG. 10 for details. In the embodiment of the present application, the data acquisition device 1000 includes: an acquisition module 1001, a processing module 1002, and a sending module 1003, wherein the acquisition module 1001, the processing module 1002, and the sending module 1003 are connected through a bus. The data acquisition device 1000 may be the central node in the above method embodiments, or may be configured as one or more chips in the central node. The data collection device 1000 may be used to execute part or all of the functions of the central node in the above method embodiments.
其中,该获取模块1001,用于获取车辆在预设时间段内行车数据;处理模块1002,用于获取车辆在预设时间段内行车数据;发送模块1003,用于向辅助节点发送所述数据包头。Wherein, the obtaining module 1001 is used to obtain the driving data of the vehicle within the preset time period; the processing module 1002 is used to obtain the driving data of the vehicle within the preset time period; the sending module 1003 is used to send the data to the auxiliary node Baotou.
一种可能实现方式中,所述处理模块1002,具体用于根据所述根哈希值和时间戳在所述中心节点的可信执行环境中生成数据包头,并利用私钥对所述数据包头进行签名,所述时间戳为在所述可信执行环境中生成的系统时间,所述私钥在所述可信执行环境中随机生成。In a possible implementation manner, the processing module 1002 is specifically configured to generate a data packet header in the trusted execution environment of the central node according to the root hash value and the timestamp, and use a private key to verify the data packet header Signing is performed, the timestamp is the system time generated in the trusted execution environment, and the private key is randomly generated in the trusted execution environment.
一种可能实现方式中,所述行车数据包括多个数组,其中,一个数组为所述预设时间段内一个传感器采集的数据,所述处理模块1002,具体用于分别计算所述多个数组中每个数组对应的哈希值;按照默克尔树计算逻辑将所述每个数组对应的哈希值两两结合计算得到上层哈希值,直至得到所述根哈希值。In a possible implementation manner, the driving data includes multiple arrays, wherein one array is data collected by a sensor within the preset time period, and the processing module 1002 is specifically configured to calculate the data of the multiple arrays respectively The hash value corresponding to each array in the above; according to the Merkle tree calculation logic, the hash value corresponding to each array is combined to calculate the upper layer hash value until the root hash value is obtained.
另一种可能实现方式中,所述获取模块1001,还用于获取前一数据包头的哈希值,所述前一数据包头的哈希值为对所述第一数据包头整体进行哈希计算得到;In another possible implementation manner, the obtaining module 1001 is further configured to obtain a hash value of a previous data packet header, and the hash value of the previous data packet header performs hash calculation on the entire first data packet header get;
所述处理模块1002,具体用于根据所述前一数据包头的哈希值、所述根哈希值和所述时间戳生成所述数据包头。The processing module 1002 is specifically configured to generate the data packet header according to the hash value of the previous data packet header, the root hash value and the timestamp.
另一种可能实现方式中,所述发送模块1003,还用于向所述辅助节点发送所述数据包头对应的数据包的全部数据或者部分数据;其中,所述数据包的全部数据包括所述行车数据在默克尔树计算逻辑下对应的全部哈希值和所述行车数据;所述数据包的部分数据包括所述行车数据在默克尔树计算逻辑下对应的部分哈希值和所述行车数据的部分内容,且所述部分哈希值和所述行车数据的部分内容可计算得到所述根哈希值。In another possible implementation manner, the sending module 1003 is further configured to send all or part of the data of the data packet corresponding to the data packet header to the assistant node; wherein, all the data of the data packet includes the All the hash values corresponding to the driving data under the Merkel tree calculation logic and the driving data; the partial data of the data packet includes the corresponding part of the hash values and the corresponding part of the driving data under the Merkle tree calculation logic The partial content of the driving data, and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value.
可选的,该数据采集装置1000还包括存储模块,该存储模块,用于缓存所述数据包头和所述数据包。存储此存储模块与处理模块1002耦合,使得处理模块1002可执行存储模块中存储的计算机执行指令以实现上述方法实施例中终端的功能。在一个示例中,该数据采集装置1000中可选的包括的存储模块可以为芯片内的存储单元,如寄存器、缓存等,该存储模块还可以是位于芯片外部的存储单元,如ROM或可存储静态信息和指令的其他类型的静态存储设备,RAM等。Optionally, the data collection device 1000 further includes a storage module, which is used for buffering the data packet header and the data packet. Storage The storage module is coupled with the processing module 1002, so that the processing module 1002 can execute the computer-executed instructions stored in the storage module to realize the functions of the terminal in the above method embodiments. In an example, the storage module optionally included in the data acquisition device 1000 may be a storage unit in the chip, such as a register, a cache, etc., or the storage module may be a storage unit located outside the chip, such as a ROM or a storable Other types of static storage devices, RAM, etc. for static information and instructions.
应理解,上述图10对应实施例中中心节点的各模块之间所执行的流程与前述图4至图9中对应方法实施例中的中心节点执行的流程类似,具体此处不再赘述。It should be understood that the processes executed by the modules of the central node in the above embodiment corresponding to FIG. 10 are similar to the processes executed by the central node in the corresponding method embodiments in FIGS. 4 to 9 above, and details are not repeated here.
图11示出了上述实施例中一种该数据采集装置1100可能的结构示意图,该数据采集装置1100可以配置成是前述中心节点。该数据采集装置1100可以包括:处理器1102、计算机可读存储介质/存储器1103、收发器1104、输入设备1105和输出设备1106,以及总 线1101。其中,处理器,收发器,计算机可读存储介质等通过总线连接。本申请实施例不限定上述部件之间的具体连接介质。FIG. 11 shows a schematic diagram of a possible structure of the data collection device 1100 in the above embodiment, and the data collection device 1100 may be configured as the aforementioned central node. The data acquisition apparatus 1100 may include: a processor 1102 , a computer-readable storage medium/memory 1103 , a transceiver 1104 , an input device 1105 and an output device 1106 , and a bus 1101 . Wherein, the processor, the transceiver, the computer-readable storage medium and the like are connected through a bus. The embodiment of the present application does not limit the specific connection medium between the above components.
一个示例中,该收发器1104获取车辆在预设时间段内行车数据;In one example, the transceiver 1104 acquires the vehicle's driving data within a preset time period;
该处理器1102根据行车数据计算得到根哈希值;根据所述根哈希值和时间戳生成数据包头,并利用私钥对所述数据包头进行签名,所述时间戳为系统时间,所述私钥随机生成;The processor 1102 calculates the root hash value according to the driving data; generates a data packet header according to the root hash value and a time stamp, and uses a private key to sign the data packet header, the time stamp is the system time, and the The private key is randomly generated;
该收发器1104向辅助节点发送所述数据包头。The transceiver 1104 sends the data packet header to the secondary node.
一种可能实现方式中,所述处理器1102,具体用于根据所述根哈希值和时间戳在所述中心节点的可信执行环境中生成数据包头,并利用私钥对所述数据包头进行签名,所述时间戳为在所述可信执行环境中生成的系统时间,所述私钥在所述可信执行环境中随机生成。In a possible implementation manner, the processor 1102 is specifically configured to generate a data packet header in the trusted execution environment of the central node according to the root hash value and the timestamp, and use a private key to verify the data packet header Signing is performed, the timestamp is the system time generated in the trusted execution environment, and the private key is randomly generated in the trusted execution environment.
一种可能实现方式中,所述行车数据包括多个数组,其中,一个数组为所述预设时间段内一个传感器采集的数据,所述处理器1102,具体用于分别计算所述多个数组中每个数组对应的哈希值;按照默克尔树计算逻辑将所述每个数组对应的哈希值两两结合计算得到上层哈希值,直至得到所述根哈希值。In a possible implementation manner, the driving data includes multiple arrays, wherein one array is the data collected by a sensor within the preset time period, and the processor 1102 is specifically configured to calculate the data of the multiple arrays respectively The hash value corresponding to each array in the above; according to the Merkle tree calculation logic, the hash value corresponding to each array is combined to calculate the upper layer hash value until the root hash value is obtained.
另一种可能实现方式中,所述收发器1104,还用于获取前一数据包头的哈希值,所述前一数据包头的哈希值为对所述第一数据包头整体进行哈希计算得到;In another possible implementation manner, the transceiver 1104 is further configured to obtain a hash value of a previous data packet header, and the hash value of the previous data packet header performs hash calculation on the entire first data packet header get;
所述处理器1102,具体用于根据所述前一数据包头的哈希值、所述根哈希值和所述时间戳生成所述数据包头。The processor 1102 is specifically configured to generate the data packet header according to the hash value of the previous data packet header, the root hash value, and the timestamp.
另一种可能实现方式中,所述收发器1104,还用于向所述辅助节点发送所述数据包头对应的数据包的全部数据或者部分数据;其中,所述数据包的全部数据包括所述行车数据在默克尔树计算逻辑下对应的全部哈希值和所述行车数据;所述数据包的部分数据包括所述行车数据在默克尔树计算逻辑下对应的部分哈希值和所述行车数据的部分内容,且所述部分哈希值和所述行车数据的部分内容可计算得到所述根哈希值。In another possible implementation manner, the transceiver 1104 is further configured to send all or part of the data of the data packet corresponding to the data packet header to the assistant node; wherein, all the data of the data packet includes the All the hash values corresponding to the driving data under the Merkel tree calculation logic and the driving data; the partial data of the data packet includes the corresponding part of the hash values and the corresponding part of the driving data under the Merkle tree calculation logic The partial content of the driving data, and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value.
另一种可能实现方式中,该存储器1103缓存所述数据包头和所述数据包。In another possible implementation manner, the memory 1103 caches the data packet header and the data packet.
又一个示例中,处理器1102可以运行操作系统,控制各个设备和器件之间的功能。收发器1104可以包括基带电路和射频电路。In yet another example, the processor 1102 may run an operating system to control functions among various devices and components. Transceiver 1104 may include baseband circuitry and radio frequency circuitry.
该收发器1104与该处理器1102可以实现上述图4至图9中任一实施例中相应的步骤,具体此处不做赘述。The transceiver 1104 and the processor 1102 can implement the corresponding steps in any one of the above-mentioned embodiments in FIG. 4 to FIG. 9 , and details are not repeated here.
可以理解的是,图11仅仅示出了数据采集装置的简化设计,在实际应用中,数据采集装置可以包含任意数量的收发器,处理器,存储器等,而所有的可以实现本申请的XX装置都在本申请的保护范围之内。It can be understood that Fig. 11 only shows the simplified design of the data acquisition device. In practical applications, the data acquisition device may contain any number of transceivers, processors, memories, etc., and all of them can realize the XX device of the present application All within the scope of protection of this application.
上述装置1100中涉及的处理器1102可以是通用处理器,例如CPU、网络处理器(network processor,NP)、微处理器等,也可以是ASIC,或一个或多个用于控制本申请方案程序执行的集成电路。还可以是数字信号处理器(digital signal processor,DSP)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。控制器/处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。处理器通常是基于存储器内存储的程序指令来执行逻辑和算术运算。The processor 1102 involved in the above-mentioned device 1100 can be a general-purpose processor, such as a CPU, a network processor (network processor, NP), a microprocessor, etc., or an ASIC, or one or more programs used to control the program of this application implementation of the integrated circuit. It can also be a digital signal processor (digital signal processor, DSP), field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. The controller/processor can also be a combination that realizes computing functions, for example, a combination of one or more microprocessors, a combination of DSP and a microprocessor, and the like. Processors typically perform logical and arithmetic operations based on program instructions stored in memory.
上述涉及的总线1101可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图11中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 1101 mentioned above may be a peripheral component interconnect standard (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in FIG. 11 , but it does not mean that there is only one bus or one type of bus.
上述涉及的计算机可读存储介质/存储器1103还可以保存有操作系统和其他应用程序。具体地,程序可以包括程序代码,程序代码包括计算机操作指令。更具体的,上述存储器可以是ROM、可存储静态信息和指令的其他类型的静态存储设备、RAM、可存储信息和指令的其他类型的动态存储设备、磁盘存储器等等。存储器1103可以是上述存储类型的组合。并且上述计算机可读存储介质/存储器可以在处理器中,还可以在处理器的外部,或在包括处理器或处理电路的多个实体上分布。上述计算机可读存储介质/存储器可以具体体现在计算机程序产品中。举例而言,计算机程序产品可以包括封装材料中的计算机可读介质。The computer-readable storage medium/memory 1103 mentioned above may also store an operating system and other application programs. Specifically, the program may include program code, and the program code includes computer operation instructions. More specifically, the aforementioned memory may be ROM, other types of static storage devices capable of storing static information and instructions, RAM, other types of dynamic storage devices capable of storing information and instructions, disk storage, and the like. The storage 1103 may be a combination of the above storage types. And the above-mentioned computer-readable storage medium/memory may be in the processor, may also be outside the processor, or be distributed on multiple entities including processors or processing circuits. The above computer-readable storage medium/memory can be embodied in a computer program product. By way of example, a computer program product may include a computer readable medium in packaging materials.
可以替换的,本申请实施例还提供一种通用处理系统,例如通称为芯片,该通用处理系统包括:提供处理器功能的一个或多个微处理器;以及提供存储介质的至少一部分的外部存储器,所有这些都通过外部总线体系结构与其它支持电路连接在一起。当存储器存储的指令被处理器执行时,使得处理器执行数据采集装置在图4至图9该实施例中的防止行车数据篡改的方法中的部分或全部步骤,和/或用于本申请所描述的技术的其它过程。Alternatively, the embodiment of the present application also provides a general-purpose processing system, such as commonly referred to as a chip, the general-purpose processing system includes: one or more microprocessors providing processor functions; and an external memory providing at least a part of the storage medium , all of which are connected together with other supporting circuits through an external bus architecture. When the instructions stored in the memory are executed by the processor, the processor is made to execute some or all of the steps in the method for preventing tampering of driving data in the embodiment of the data acquisition device in FIG. 4 to FIG. Other procedures of the described techniques.
结合本申请公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于RAM存储器、闪存、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于终端中。当然,处理器和存储介质也可以作为分立组件存在于第一通信装置中。The steps of the methods or algorithms described in connection with the disclosure of this application can be implemented in the form of hardware, or can be implemented in the form of a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, mobile hard disk, CD-ROM or any other form of storage known in the art medium. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be a component of the processor. The processor and storage medium can be located in the ASIC. Alternatively, the ASIC may be located in the terminal. Of course, the processor and the storage medium may also exist in the first communication device as discrete components.
具体请参阅图12所示,本申请实施例中该数据验证装置1200包括:接收模块1201、处理模块1202,其中接收模块1201、处理模块1202通过总线连接。数据验证装置1200可以是上述方法实施例中的辅助节点,也可以配置为辅助节点内的一个或多个芯片。数据验证装置1200可以用于执行上述方法实施例中的辅助节点的部分或全部功能。Please refer to FIG. 12 for details. In the embodiment of the present application, the data verification device 1200 includes: a receiving module 1201 and a processing module 1202, wherein the receiving module 1201 and the processing module 1202 are connected through a bus. The data verification apparatus 1200 may be the auxiliary node in the above method embodiment, or may be configured as one or more chips in the auxiliary node. The data verification apparatus 1200 may be used to execute part or all of the functions of the assistant node in the foregoing method embodiments.
其中,接收模块1201,用于同步所述中心节点发送的数据包头,所述数据包头由所述中心节点根据根哈希值和时间戳生成,且所述数据包头利用私钥进行签名,所述时间戳为系统时间,所述私钥为随机生成,所述根哈希值所述中心节点根据行车数据计算得到,所述行车数据为所述中心节点在预设时间段内采集得到;Wherein, the receiving module 1201 is used to synchronize the data packet header sent by the central node, the data packet header is generated by the central node according to the root hash value and the timestamp, and the data packet header is signed with a private key, the The time stamp is the system time, the private key is randomly generated, the root hash value is calculated by the central node according to the driving data, and the driving data is collected by the central node within a preset time period;
处理模块1202,用于利用所述数据包头验证所述行车数据是否篡改。The processing module 1202 is configured to use the data packet header to verify whether the driving data has been tampered with.
一种可能实现方式中,所述接收模块1201,还用于接收所述中心节点发送的所述数据包头对应的数据包的全部数据或者部分数据;其中,所述数据包的全部数据包括所述行车数据在默克尔树计算逻辑下对应的全部哈希值和所述行车数据;所述数据包的部分数据包括所述行车数据在默克尔树计算逻辑下对应的部分哈希值和所述行车数据的部分内容,且 所述部分哈希值和所述行车数据的部分内容可计算得到所述根哈希值。In a possible implementation manner, the receiving module 1201 is further configured to receive all or part of the data of the data packet corresponding to the data packet header sent by the central node; wherein, all the data of the data packet includes the All the hash values corresponding to the driving data under the Merkel tree calculation logic and the driving data; the partial data of the data packet includes the corresponding part of the hash values and the corresponding part of the driving data under the Merkle tree calculation logic The partial content of the driving data, and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value.
另一种可能实现方式中,该数据验证装置1200还包括发送模块1203,用于公布所述数据包头。In another possible implementation manner, the data verification apparatus 1200 further includes a sending module 1203, configured to publish the data packet header.
可选的,该数据验证装置1200还包括存储模块,该存储模块,用于存储所述数据包头。存储此存储模块与处理模块1202耦合,使得处理模块1202可执行存储模块中存储的计算机执行指令以实现上述方法实施例中终端的功能。在一个示例中,该数据采集装置1000中可选的包括的存储模块可以为芯片内的存储单元,如寄存器、缓存等,该存储模块还可以是位于芯片外部的存储单元,如ROM或可存储静态信息和指令的其他类型的静态存储设备,RAM等。Optionally, the data verification apparatus 1200 further includes a storage module, which is used to store the data packet header. Storage The storage module is coupled with the processing module 1202, so that the processing module 1202 can execute the computer-executed instructions stored in the storage module to realize the functions of the terminal in the above method embodiments. In an example, the storage module optionally included in the data acquisition device 1000 may be a storage unit in the chip, such as a register, a cache, etc., or the storage module may be a storage unit located outside the chip, such as a ROM or a storable Other types of static storage devices, RAM, etc. for static information and instructions.
应理解,上述图12对应实施例中辅助节点的各模块之间所执行的流程与前述图4至图9中对应方法实施例中的辅助节点执行的流程类似,具体此处不再赘述。It should be understood that the processes executed by the modules of the auxiliary node in the above-mentioned embodiment corresponding to FIG. 12 are similar to the processes executed by the auxiliary node in the corresponding method embodiments in FIGS. 4 to 9 above, and details are not repeated here.
图13示出了上述实施例中一种该数据验证装置1300可能的结构示意图,该数据采集装置1100可以配置成是前述中心节点。该数据验证装置1300可以包括:处理器1302、计算机可读存储介质/存储器1303、收发器1304、输入设备1305和输出设备1306,以及总线1301。其中,处理器,收发器,计算机可读存储介质等通过总线连接。本申请实施例不限定上述部件之间的具体连接介质。FIG. 13 shows a schematic diagram of a possible structure of the data verification device 1300 in the above embodiment, and the data collection device 1100 can be configured as the aforementioned central node. The data verification apparatus 1300 may include: a processor 1302 , a computer-readable storage medium/memory 1303 , a transceiver 1304 , an input device 1305 and an output device 1306 , and a bus 1301 . Wherein, the processor, the transceiver, the computer-readable storage medium and the like are connected through a bus. The embodiment of the present application does not limit the specific connection medium between the above components.
一个示例中,该收发器1304同步所述中心节点发送的数据包头,所述数据包头由所述中心节点根据根哈希值和时间戳生成,且所述数据包头利用私钥进行签名,所述时间戳为系统时间,所述私钥为随机生成,所述根哈希值所述中心节点根据行车数据计算得到,所述行车数据为所述中心节点在预设时间段内采集得到;In an example, the transceiver 1304 synchronizes the data packet header sent by the central node, the data packet header is generated by the central node according to the root hash value and the timestamp, and the data packet header is signed with a private key, the The time stamp is the system time, the private key is randomly generated, the root hash value is calculated by the central node according to the driving data, and the driving data is collected by the central node within a preset time period;
该处理器1102利用所述数据包头验证所述行车数据是否篡改。The processor 1102 uses the data packet header to verify whether the driving data has been tampered with.
一种可能实现方式中,所述该收发器1304,具体用于接收所述中心节点发送的所述数据包头对应的数据包的全部数据或者部分数据;其中,所述数据包的全部数据包括所述行车数据在默克尔树计算逻辑下对应的全部哈希值和所述行车数据;所述数据包的部分数据包括所述行车数据在默克尔树计算逻辑下对应的部分哈希值和所述行车数据的部分内容,且所述部分哈希值和所述行车数据的部分内容可计算得到所述根哈希值。In a possible implementation manner, the transceiver 1304 is specifically configured to receive all or part of the data of the data packet corresponding to the data packet header sent by the central node; wherein, all the data of the data packet includes the All the hash values corresponding to the driving data under the Merkel tree calculation logic and the driving data; the partial data of the data packet includes the corresponding partial hash values and the corresponding part of the driving data under the Merkel tree calculation logic The partial content of the driving data, and the partial hash value and the partial content of the driving data can be calculated to obtain the root hash value.
一种可能实现方式中,所述该收发器1304,还用于公布所述数据包头In a possible implementation manner, the transceiver 1304 is also used to publish the data packet header
另一种可能实现方式中,该存储器1103缓存所述数据包头。In another possible implementation manner, the memory 1103 caches the data packet header.
又一个示例中,处理器1302可以运行操作系统,控制各个设备和器件之间的功能。收发器1304可以包括基带电路和射频电路。In yet another example, the processor 1302 may run an operating system to control functions among various devices and components. Transceiver 1304 may include baseband circuitry and radio frequency circuitry.
该收发器1304与该处理器1302可以实现上述图4至图9中任一实施例中相应的步骤,具体此处不做赘述。The transceiver 1304 and the processor 1302 can implement the corresponding steps in any one of the above-mentioned embodiments in FIG. 4 to FIG. 9 , and details are not described here.
可以理解的是,图13仅仅示出了数据验证装置的简化设计,在实际应用中,数据验证装置可以包含任意数量的收发器,处理器,存储器等,而所有的可以实现本申请的数据验证装置都在本申请的保护范围之内。It can be understood that FIG. 13 only shows a simplified design of the data verification device. In practical applications, the data verification device may include any number of transceivers, processors, memories, etc., and all of them can realize the data verification of the present application. devices are within the scope of protection of the present application.
上述装置1300中涉及的处理器1302可以是通用处理器,例如CPU、网络处理器(network processor,NP)、微处理器等,也可以是ASIC,或一个或多个用于控制本申请方案程序执 行的集成电路。还可以是数字信号处理器(digital signal processor,DSP)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。控制器/处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。处理器通常是基于存储器内存储的程序指令来执行逻辑和算术运算。The processor 1302 involved in the above-mentioned device 1300 can be a general-purpose processor, such as a CPU, a network processor (network processor, NP), a microprocessor, etc., or an ASIC, or one or more programs used to control the program of this application implementation of the integrated circuit. It can also be a digital signal processor (digital signal processor, DSP), field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. The controller/processor can also be a combination that realizes computing functions, for example, a combination of one or more microprocessors, a combination of DSP and a microprocessor, and the like. Processors typically perform logical and arithmetic operations based on program instructions stored in memory.
上述涉及的总线1301可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图13中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 1301 mentioned above may be a peripheral component interconnect standard (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in FIG. 13 , but it does not mean that there is only one bus or one type of bus.
上述涉及的计算机可读存储介质/存储器1303还可以保存有操作系统和其他应用程序。具体地,程序可以包括程序代码,程序代码包括计算机操作指令。更具体的,上述存储器可以是ROM、可存储静态信息和指令的其他类型的静态存储设备、RAM、可存储信息和指令的其他类型的动态存储设备、磁盘存储器等等。存储器1303可以是上述存储类型的组合。并且上述计算机可读存储介质/存储器可以在处理器中,还可以在处理器的外部,或在包括处理器或处理电路的多个实体上分布。上述计算机可读存储介质/存储器可以具体体现在计算机程序产品中。举例而言,计算机程序产品可以包括封装材料中的计算机可读介质。The computer-readable storage medium/memory 1303 mentioned above may also store an operating system and other application programs. Specifically, the program may include program code, and the program code includes computer operation instructions. More specifically, the aforementioned memory may be ROM, other types of static storage devices capable of storing static information and instructions, RAM, other types of dynamic storage devices capable of storing information and instructions, disk storage, and the like. The storage 1303 may be a combination of the above storage types. And the above-mentioned computer-readable storage medium/memory may be in the processor, may also be outside the processor, or be distributed on multiple entities including processors or processing circuits. The above computer-readable storage medium/memory can be embodied in a computer program product. By way of example, a computer program product may include a computer readable medium in packaging materials.
可以替换的,本申请实施例还提供一种通用处理系统,例如通称为芯片,该通用处理系统包括:提供处理器功能的一个或多个微处理器;以及提供存储介质的至少一部分的外部存储器,所有这些都通过外部总线体系结构与其它支持电路连接在一起。当存储器存储的指令被处理器执行时,使得处理器执行数据验证装置在图4至图9该实施例中的防止行车数据篡改的方法中的部分或全部步骤,和/或用于本申请所描述的技术的其它过程。Alternatively, the embodiment of the present application also provides a general-purpose processing system, such as commonly referred to as a chip, the general-purpose processing system includes: one or more microprocessors providing processor functions; and an external memory providing at least a part of the storage medium , all of which are connected together with other supporting circuits through an external bus architecture. When the instructions stored in the memory are executed by the processor, the processor is made to execute some or all of the steps in the method for preventing tampering of driving data in the embodiment of the data verification device in FIG. 4 to FIG. Other procedures of the described techniques.
结合本申请公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于RAM存储器、闪存、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于终端中。当然,处理器和存储介质也可以作为分立组件存在于第一通信装置中。The steps of the methods or algorithms described in connection with the disclosure of this application can be implemented in the form of hardware, or can be implemented in the form of a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, mobile hard disk, CD-ROM or any other form of storage known in the art medium. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be a component of the processor. The processor and storage medium can be located in the ASIC. Alternatively, the ASIC may be located in the terminal. Of course, the processor and the storage medium may also exist in the first communication device as discrete components.
本申请还提供一种行车数据验证系统,包括上述任一实施例所述的中心节点和多个辅助节点。The present application also provides a driving data verification system, including the central node and multiple auxiliary nodes described in any one of the above embodiments.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显 示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .

Claims (24)

  1. 一种防止行车数据篡改的方法,应用于行车数据验证系统,所述系统包括中心节点和多个辅助节点,其特征在于,包括:A method for preventing tampering of driving data, applied to a driving data verification system, the system includes a central node and a plurality of auxiliary nodes, characterized in that it includes:
    所述中心节点获取车辆在预设时间段内行车数据;The central node acquires vehicle driving data within a preset time period;
    所述中心节点根据行车数据计算得到根哈希值;The central node calculates the root hash value according to the driving data;
    所述中心节点根据所述根哈希值和时间戳生成数据包头,并利用私钥对所述数据包头进行签名,所述时间戳为系统时间,所述私钥为随机生成;The central node generates a data packet header according to the root hash value and a time stamp, and uses a private key to sign the data packet header, the time stamp is system time, and the private key is randomly generated;
    所述中心节点向所述辅助节点发送所述数据包头。The central node sends the data packet header to the auxiliary node.
  2. 根据权利要求1所述的方法,其特征在于,所述中心节点根据所述根哈希值和时间戳生成数据包头包括:The method according to claim 1, wherein said central node generating a data packet header according to said root hash value and a timestamp comprises:
    所述中心节点根据所述根哈希值和时间戳在所述中心节点的可信执行环境中生成数据包头,并利用私钥对所述数据包头进行签名,所述时间戳为在所述可信执行环境中生成的系统时间,所述私钥在所述可信执行环境中随机生成。The central node generates a data packet header in the trusted execution environment of the central node according to the root hash value and a time stamp, and uses a private key to sign the data packet header. The system time generated in the trusted execution environment, and the private key is randomly generated in the trusted execution environment.
  3. 根据权利要求1或2所述的方法,其特征在于,所述行车数据包括多个数组,其中,一个数组为所述预设时间段内一个传感器采集的数据,所述中心节点根据所述行车数据计算得到根哈希值包括:The method according to claim 1 or 2, wherein the driving data includes a plurality of arrays, wherein one array is data collected by a sensor within the preset time period, and the central node The root hash value calculated from the data includes:
    所述中心节点分别计算所述多个数组中每个数组对应的哈希值;The central node respectively calculates a hash value corresponding to each array in the plurality of arrays;
    所述中心节点按照默克尔树计算逻辑将所述每个数组对应的哈希值两两结合计算得到上层哈希值,直至得到所述根哈希值。According to the Merkle tree calculation logic, the central node combines and calculates the hash values corresponding to each array in pairs to obtain the upper layer hash value until the root hash value is obtained.
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 3, wherein the method further comprises:
    所述中心节点获取前一数据包头的哈希值,所述前一数据包头的哈希值为对所述第一数据包头整体进行哈希计算得到;The central node obtains the hash value of the previous data packet header, and the hash value of the previous data packet header is obtained by performing hash calculation on the entire first data packet header;
    所述中心节点根据所述根哈希值和时间戳在所述中心节点的可信执行环境中生成数据包头包括:The central node generating a data packet header in the trusted execution environment of the central node according to the root hash value and the timestamp includes:
    所述中心节点根据所述前一数据包头的哈希值、所述根哈希值和所述时间戳生成所述数据包头。The central node generates the data packet header according to the hash value of the previous data packet header, the root hash value and the timestamp.
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 4, wherein the method further comprises:
    所述中心节点向所述辅助节点发送所述数据包头对应的数据包的全部数据或者部分数据;The central node sends all or part of the data of the data packet corresponding to the data packet header to the auxiliary node;
    其中,所述数据包的全部数据包括所述行车数据在默克尔树计算逻辑下对应的全部哈希值和所述行车数据;Wherein, all data of the data packet includes all hash values corresponding to the driving data under the Merkle tree calculation logic and the driving data;
    所述数据包的部分数据包括所述行车数据在默克尔树计算逻辑下对应的部分哈希值和所述行车数据的部分内容,且所述部分哈希值和所述行车数据的部分内容可计算得到所述 根哈希值。The partial data of the data packet includes the partial hash value corresponding to the driving data under the Merkle tree calculation logic and the partial content of the driving data, and the partial hash value and the partial content of the driving data The root hash value can be calculated.
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述中心节点缓存所述数据包头和所述数据包。The method according to any one of claims 1 to 5, wherein the central node caches the data packet header and the data packet.
  7. 一种中心节点,其特征在于,包括:A central node, characterized in that it includes:
    获取模块,用于获取车辆在预设时间段内行车数据;An acquisition module, configured to acquire vehicle driving data within a preset time period;
    处理模块,用于根据行车数据计算得到根哈希值;根据所述根哈希值和时间戳生成数据包头,并利用私钥对所述数据包头进行签名,所述时间戳为系统时间,所述私钥随机生成;The processing module is used to calculate the root hash value according to the driving data; generate a data packet header according to the root hash value and a time stamp, and use a private key to sign the data packet header, the time stamp is the system time, and the The above private key is randomly generated;
    发送模块,用于向辅助节点发送所述数据包头。A sending module, configured to send the data packet header to the auxiliary node.
  8. 根据权利要求7所述的中心节点,其特征在于,所述处理模块,具体用于根据所述根哈希值和时间戳在所述中心节点的可信执行环境中生成数据包头,并利用私钥对所述数据包头进行签名,所述时间戳为在所述可信执行环境中生成的系统时间,所述私钥在所述可信执行环境中随机生成。The central node according to claim 7, wherein the processing module is specifically configured to generate a data packet header in the trusted execution environment of the central node according to the root hash value and the timestamp, and use the private A key is used to sign the data packet header, the timestamp is a system time generated in the trusted execution environment, and the private key is randomly generated in the trusted execution environment.
  9. 根据权利要求7或8所述的中心节点,其特征在于,所述行车数据包括多个数组,其中,一个数组为所述预设时间段内一个传感器采集的数据,所述处理模块,具体用于分别计算所述多个数组中每个数组对应的哈希值;按照默克尔树计算逻辑将所述每个数组对应的哈希值两两结合计算得到上层哈希值,直至得到所述根哈希值。The central node according to claim 7 or 8, wherein the driving data includes multiple arrays, wherein one array is data collected by a sensor within the preset time period, and the processing module is specifically used Calculate the hash value corresponding to each array in the plurality of arrays separately; according to the Merkle tree calculation logic, combine the hash values corresponding to each array in pairs to calculate the upper layer hash value, until the above-mentioned root hash.
  10. 根据权利要求7至9中任一项所述的中心节点,其特征在于,所述获取模块,还用于获取前一数据包头的哈希值,所述前一数据包头的哈希值为对所述第一数据包头整体进行哈希计算得到;The central node according to any one of claims 7 to 9, wherein the obtaining module is further configured to obtain the hash value of the previous data packet header, and the hash value of the previous data packet header is pair The first data packet header is obtained by hash calculation as a whole;
    所述处理模块,具体用于根据所述前一数据包头的哈希值、所述根哈希值和所述时间戳生成所述数据包头。The processing module is specifically configured to generate the data packet header according to the hash value of the previous data packet header, the root hash value, and the timestamp.
  11. 根据权利要求7至10中任一项所述的中心节点,其特征在于,所述发送模块,还用于向所述辅助节点发送所述数据包头对应的数据包的全部数据或者部分数据;The central node according to any one of claims 7 to 10, wherein the sending module is further configured to send all or part of the data of the data packet corresponding to the data packet header to the auxiliary node;
    其中,所述数据包的全部数据包括所述行车数据在默克尔树计算逻辑下对应的全部哈希值和所述行车数据;Wherein, all data of the data packet includes all hash values corresponding to the driving data under the Merkle tree calculation logic and the driving data;
    所述数据包的部分数据包括所述行车数据在默克尔树计算逻辑下对应的部分哈希值和所述行车数据的部分内容,且所述部分哈希值和所述行车数据的部分内容可计算得到所述根哈希值。The partial data of the data packet includes the partial hash value corresponding to the driving data under the Merkle tree calculation logic and the partial content of the driving data, and the partial hash value and the partial content of the driving data The root hash value can be calculated.
  12. 根据权利要求7至11中任一项所述的中心节点,其特征在于,所述中心节点还包 括存储模块,用于缓存所述数据包头和所述数据包。The central node according to any one of claims 7 to 11, wherein the central node further comprises a storage module configured to cache the data packet header and the data packet.
  13. 一种防止行车数据篡改的方法,应用于行车数据验证系统,所述系统包括中心节点和多个辅助节点,其特征在于,包括:A method for preventing tampering of driving data, applied to a driving data verification system, the system includes a central node and a plurality of auxiliary nodes, characterized in that it includes:
    所述辅助节点同步所述中心节点发送的数据包头,所述数据包头由所述中心节点根据根哈希值和时间戳生成,且所述数据包头利用私钥进行签名,所述时间戳为系统时间,所述私钥为随机生成,所述根哈希值所述中心节点根据行车数据计算得到,所述行车数据为所述中心节点在预设时间段内采集得到;The auxiliary node synchronizes the data packet header sent by the central node, the data packet header is generated by the central node according to the root hash value and the timestamp, and the data packet header is signed with a private key, and the timestamp is the system time, the private key is randomly generated, the root hash value is calculated by the central node according to the driving data, and the driving data is collected by the central node within a preset time period;
    所述辅助节点利用所述数据包头验证所述行车数据的是否篡改。The auxiliary node verifies whether the driving data has been tampered with by using the data packet header.
  14. 根据权利要求13所述的方法,其特征在于,所述方法还包括:The method according to claim 13, further comprising:
    所述辅助节点接收所述中心节点发送的所述数据包头对应的数据包的全部数据或者部分数据;The auxiliary node receives all or part of the data of the data packet corresponding to the data packet header sent by the central node;
    其中,所述数据包的全部数据包括所述行车数据在默克尔树计算逻辑下对应的全部哈希值和所述行车数据;Wherein, all data of the data packet includes all hash values corresponding to the driving data under the Merkle tree calculation logic and the driving data;
    所述数据包的部分数据包括所述行车数据在默克尔树计算逻辑下对应的部分哈希值和所述行车数据的部分内容,且所述部分哈希值和所述行车数据的部分内容可计算得到所述根哈希值。The partial data of the data packet includes the partial hash value corresponding to the driving data under the Merkle tree calculation logic and the partial content of the driving data, and the partial hash value and the partial content of the driving data The root hash value can be calculated.
  15. 根据权利要求13至14中任一项所述的方法,其特征在于,所述方法还包括;The method according to any one of claims 13 to 14, further comprising;
    所述辅助节点公布所述数据包头。The secondary node publishes the packet header.
  16. 一种辅助节点,其特征在于,包括:An auxiliary node, characterized in that it comprises:
    接收模块,用于同步所述中心节点发送的数据包头,所述数据包头由所述中心节点根据根哈希值和时间戳生成,且所述数据包头利用私钥进行签名,所述时间戳为系统时间,所述私钥为随机生成,所述根哈希值所述中心节点根据行车数据计算得到,所述行车数据为所述中心节点在预设时间段内采集得到;The receiving module is used to synchronize the data packet header sent by the central node, the data packet header is generated by the central node according to the root hash value and the timestamp, and the data packet header is signed with a private key, and the timestamp is System time, the private key is randomly generated, the root hash value is calculated by the central node according to the driving data, and the driving data is collected by the central node within a preset time period;
    处理模块,用于利用所述数据包头验证所述行车数据是否篡改。A processing module, configured to use the data packet header to verify whether the driving data has been tampered with.
  17. 根据权利要求16所述的辅助节点,其特征在于,所述接收模块,还用于接收所述中心节点发送的所述数据包头对应的数据包的全部数据或者部分数据;The auxiliary node according to claim 16, wherein the receiving module is further configured to receive all or part of the data of the data packet corresponding to the data packet header sent by the central node;
    其中,所述数据包的全部数据包括所述行车数据在默克尔树计算逻辑下对应的全部哈希值和所述行车数据;Wherein, all data of the data packet includes all hash values corresponding to the driving data under the Merkle tree calculation logic and the driving data;
    所述数据包的部分数据包括所述行车数据在默克尔树计算逻辑下对应的部分哈希值和所述行车数据的部分内容,且所述部分哈希值和所述行车数据的部分内容可计算得到所述根哈希值。The partial data of the data packet includes the partial hash value corresponding to the driving data under the Merkle tree calculation logic and the partial content of the driving data, and the partial hash value and the partial content of the driving data The root hash value can be calculated.
  18. 根据权利要求16至17中任一项所述的辅助节点,其特征在于,所述辅助节点还包括发送模块,用于公布所述数据包头。The auxiliary node according to any one of claims 16 to 17, wherein the auxiliary node further comprises a sending module, configured to publish the data packet header.
  19. 一种行车数据验证系统,其特征在于,包括上述权利要求7至12中任一项所述的中心节点和多个如上述权利要求16至18中任一项所述的辅助节点;A driving data verification system, characterized in that it comprises a central node as claimed in any one of claims 7 to 12 and a plurality of auxiliary nodes as claimed in any one of claims 16 to 18;
    其中,所述中心节点获取车辆在预设时间段内行车数据;根据行车数据计算得到根哈希值;根据所述根哈希值和时间戳生成数据包头,并利用私钥对所述数据包头进行签名,所述时间戳为系统时间,所述私钥随机生成;Wherein, the central node obtains the driving data of the vehicle within a preset period of time; calculates the root hash value according to the driving data; generates a data packet header according to the root hash value and a timestamp, and uses the private key to encrypt the data packet header Signing, the timestamp is the system time, and the private key is randomly generated;
    所述中心节点向所述多个辅助节点同步所述数据包头;The central node synchronizes the data packet header to the plurality of auxiliary nodes;
    所述多个辅助节点根据所述数据包头验证所述行车数据是否篡改。The multiple auxiliary nodes verify whether the driving data has been tampered with according to the data packet header.
  20. 根据权利要求19所述的系统,其特征在于,所述多个辅助节点根据所述数据包头验证所述行车数据是否篡改包括:The system according to claim 19, wherein the plurality of auxiliary nodes verifying whether the driving data has been tampered with according to the data packet header comprises:
    第一辅助节点获取第二辅助节点的数据包头和数据包,所述第一辅助节点和所述第二辅助节点包含于所述多个辅助节点;The first auxiliary node obtains the data packet header and the data packet of the second auxiliary node, the first auxiliary node and the second auxiliary node are included in the plurality of auxiliary nodes;
    所述第一辅助节点根据所述第二辅助节点的数据包头和数据包确定所述第二辅助节点的数据是否篡改。The first auxiliary node determines whether the data of the second auxiliary node has been tampered with according to the data packet header and the data packet of the second auxiliary node.
  21. 根据权利要求20所述的系统,其特征在于,所述第一辅助节点根据所述第二辅助节点的数据包头和数据包确定所述第二辅助节点的数据是否篡改包括:The system according to claim 20, wherein the determining whether the data of the second auxiliary node is tampered with by the first auxiliary node according to the data packet header and the data packet of the second auxiliary node includes:
    所述第一辅助节点根据所述第二辅助节点的数据包计算得到根哈希值与所述第二辅助节点的数据包头中的根哈希值进行对比;comparing the root hash value calculated by the first auxiliary node according to the data packet of the second auxiliary node with the root hash value in the data packet header of the second auxiliary node;
    若所述第二辅助节点的数据包计算得到根哈希值与所述第二辅助节点的数据包头中的根哈希值不存在差异,则所述第二辅助节点的数据包与所述第二辅助节点的数据包头相匹配;If there is no difference between the root hash value calculated by the data packet of the second auxiliary node and the root hash value in the data packet header of the second auxiliary node, then the data packet of the second auxiliary node and the first auxiliary node The packet headers of the two secondary nodes match;
    所述第一辅助节点将所述第二辅助节点的数据包计算得到根哈希值或所述第二辅助节点的数据包头中的根哈希值与所述第一辅助节点的数据包头中的根哈希值比对;The first auxiliary node calculates the data packet of the second auxiliary node to obtain the root hash value or the root hash value in the data packet header of the second auxiliary node and the root hash value in the data packet header of the first auxiliary node Root hash value comparison;
    若所述第二辅助节点的数据包计算得到根哈希值或所述第二辅助节点的数据包头中的根哈希值与所述第一辅助节点的数据包头中的根哈希值不存在差异,则确定所述第二辅助节点的数据未被篡改。If the data packet of the second auxiliary node calculates the root hash value or the root hash value in the data packet header of the second auxiliary node and the root hash value in the data packet header of the first auxiliary node do not exist difference, it is determined that the data of the second auxiliary node has not been tampered with.
  22. 一种计算机程序,其特征在于,当所述计算机程序在计算机上运行时,使得计算机执行如权利要求1至6或者如权利要求13至15中任意一项所述的方法。A computer program, characterized in that, when the computer program is run on a computer, it causes the computer to execute the method according to any one of claims 1-6 or 13-15.
  23. 一种计算机可读存储介质,其特征在于,包括程序,当所述程序在计算机上运行时,使得计算机执行如权利要求1至6或者如权利要求13至15中任一项所述的方法。A computer-readable storage medium, characterized by comprising a program, which, when the program is run on a computer, causes the computer to execute the method according to any one of claims 1-6 or 13-15.
  24. 一种智能汽车,其特征在于,一个或多个处理器和存储器,所述存储器中存储有程序指令,当所述程序指令在所述一个或多个处理器中执行时,使得如权利要求1至6或者如权利要求13至15中任一项所述的方法被执行。A kind of intelligent car, it is characterized in that, one or more processors and memory, program instructions are stored in the memory, when the program instructions are executed in the one or more processors, so that according to claim 1 to 6 or the method according to any one of claims 13 to 15 is carried out.
PCT/CN2022/090319 2021-07-15 2022-04-29 Method for preventing driving data from being tampered with, and related apparatus WO2023284372A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110801555.6 2021-07-15
CN202110801555.6A CN115618417A (en) 2021-07-15 2021-07-15 Method for preventing driving data from being tampered and related device

Publications (1)

Publication Number Publication Date
WO2023284372A1 true WO2023284372A1 (en) 2023-01-19

Family

ID=84855458

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/090319 WO2023284372A1 (en) 2021-07-15 2022-04-29 Method for preventing driving data from being tampered with, and related apparatus

Country Status (2)

Country Link
CN (1) CN115618417A (en)
WO (1) WO2023284372A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108848062A (en) * 2018-05-23 2018-11-20 华东师范大学 The data safety sharing method of controllable anonymity in vehicle-mounted net based on block chain
CN109741039A (en) * 2019-01-07 2019-05-10 深圳市红砖坊技术有限公司 Bookkeeping methods, terminal device, digs mine node and mine pond at mine pool server
CN111159305A (en) * 2020-04-02 2020-05-15 支付宝(杭州)信息技术有限公司 Vehicle data processing method, device and system based on block chain
CN112287367A (en) * 2020-10-29 2021-01-29 合肥工业大学智能制造技术研究院 Automobile T-BOX evidence obtaining system based on trusted computing
CN112905667A (en) * 2021-03-08 2021-06-04 黑芝麻智能科技(上海)有限公司 Unmanned information storage and playback method, device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108848062A (en) * 2018-05-23 2018-11-20 华东师范大学 The data safety sharing method of controllable anonymity in vehicle-mounted net based on block chain
CN109741039A (en) * 2019-01-07 2019-05-10 深圳市红砖坊技术有限公司 Bookkeeping methods, terminal device, digs mine node and mine pond at mine pool server
CN111159305A (en) * 2020-04-02 2020-05-15 支付宝(杭州)信息技术有限公司 Vehicle data processing method, device and system based on block chain
CN112287367A (en) * 2020-10-29 2021-01-29 合肥工业大学智能制造技术研究院 Automobile T-BOX evidence obtaining system based on trusted computing
CN112905667A (en) * 2021-03-08 2021-06-04 黑芝麻智能科技(上海)有限公司 Unmanned information storage and playback method, device and storage medium

Also Published As

Publication number Publication date
CN115618417A (en) 2023-01-17

Similar Documents

Publication Publication Date Title
CN110263035B (en) Block chain-based data storage and query method and device and electronic equipment
US20220094696A1 (en) Secure compliance protocols
US10355869B2 (en) Private blockchain transaction management and termination
US20180157700A1 (en) Storing and verifying event logs in a blockchain
CN108494775B (en) Method for preventing network attack by using legal data or tampering legal data
US20170361808A1 (en) Method for handling transmission of fraudulent frames within in-vehicle network
WO2019083440A2 (en) Vehicle-mounted device upgrading method and related device
Nowdehi et al. In-vehicle CAN message authentication: An evaluation based on industrial criteria
US20180234248A1 (en) Communication system, vehicle, and monitoring method
US20180310173A1 (en) Information processing apparatus, information processing system, and information processing method
US11107079B2 (en) Methods, systems, apparatuses and devices for verifying credibility of consortium blockchain
CN111615818A (en) Block chain construction method and block chain link points
JP2022528360A (en) Cryptographically secure mechanism for remote control of autonomous vehicles
JP2017508379A (en) Provable geolocation
CN111428269A (en) Data access method and device and terminal equipment
CN112487408A (en) Safe access method and system for ECU in vehicle and storage medium
EP3955149B1 (en) Method and apparatus for securing real-time data transfer from a device
WO2023284372A1 (en) Method for preventing driving data from being tampered with, and related apparatus
EP4040720B1 (en) Secure identity card using unclonable functions
CN108965313B (en) Vehicle violation information publishing method, system and storage medium
WO2022142632A1 (en) Method and system for message communication between vehicles
EP3346638B1 (en) Method, apparatus, and computer-readable storage medium comprising instructions for vehicle-to-vehicle communication
CN114265815A (en) Traffic media data storage method, server, storage medium and system
CN110704451A (en) Ownership registration and evidence-providing method and device based on block chain
JP2019080241A (en) In-vehicle system and data transmission/reception method in in-vehicle system

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: 22841013

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE