CN115033857A - Method, device, vehicle and storage medium for checking electronic control unit - Google Patents

Method, device, vehicle and storage medium for checking electronic control unit Download PDF

Info

Publication number
CN115033857A
CN115033857A CN202210710932.XA CN202210710932A CN115033857A CN 115033857 A CN115033857 A CN 115033857A CN 202210710932 A CN202210710932 A CN 202210710932A CN 115033857 A CN115033857 A CN 115033857A
Authority
CN
China
Prior art keywords
application code
information
data block
block
control unit
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202210710932.XA
Other languages
Chinese (zh)
Inventor
李志雄
何天翼
温承亮
李飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BDstar Intelligent and Connected Vehicle Technology Co Ltd
Original Assignee
BDstar Intelligent and Connected Vehicle Technology Co Ltd
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 BDstar Intelligent and Connected Vehicle Technology Co Ltd filed Critical BDstar Intelligent and Connected Vehicle Technology Co Ltd
Priority to CN202210710932.XA priority Critical patent/CN115033857A/en
Publication of CN115033857A publication Critical patent/CN115033857A/en
Pending legal-status Critical Current

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/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • 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/602Providing cryptographic facilities or services
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the application provides a method, a device, a vehicle and a storage medium for checking an electronic control unit, wherein the method for checking the electronic control unit comprises the steps of reading all information of an application code information block, checking by adopting a cyclic redundancy check algorithm based on all information, checking project key information corresponding to application code data based on a first preset method if the application code information block is successfully checked, checking a first data block and a last data block in a plurality of data blocks based on a second preset method when the project key information is successfully checked, and determining that the electronic control unit is successfully checked if the check is successful. The method and the device can reduce the data volume of the verified application code data, thereby improving the verification speed, and can effectively solve the problem that the first frame message sending time of the electronic control unit cannot be met when the application code data volume is large.

Description

Method, device, vehicle and storage medium for checking electronic control unit
Technical Field
The present invention relates to the field of electronics, and more particularly, to a method and apparatus for checking an electronic control unit, a vehicle, and a storage medium.
Background
With the development of automotive electronics technology, the functional safety of each ECU (Electronic Control Unit) on an automobile is higher and higher, and the safe starting of the ECU has become more and more technical requirements. However, most of the current MCU (Motor Control Unit) chip security engines may not meet the requirement of the first frame network management message sending time when the check data is large.
Disclosure of Invention
In a first aspect, the present invention provides a method of checking an electronic control unit having a memory with application code data and application code information blocks, the application code data being divided into a plurality of data blocks, the method comprising:
reading all information of the application code information block;
verifying the application code information block by adopting a cyclic redundancy check algorithm based on all the information;
if the application code information block is successfully verified, verifying the project key information corresponding to the application code data based on a first preset method;
if the project key information is verified successfully, verifying a first data block and a last data block in the plurality of data blocks based on a second preset method;
and if the first data block and the last data block are verified successfully, determining that the electronic control unit is verified successfully.
In an optional embodiment, the checking the application code information block by using a cyclic redundancy check algorithm based on all the information includes:
calculating the information except the preset cyclic redundancy check code in the application code information block by adopting a cyclic redundancy check algorithm to obtain a cyclic redundancy check code;
comparing the cyclic redundancy check code with the preset cyclic redundancy check code;
and when the cyclic redundancy check code is the same as the preset cyclic redundancy check code, determining that the application code information block is successfully checked.
In an optional implementation manner, the all information includes preset item key information, and the verifying the item key information corresponding to the application code data based on the first preset method includes:
reading the preset project key information and the project key information corresponding to the application code data;
comparing the preset project key information with the project key information;
and when the preset project key information is the same as the project key information, determining that the project key information is verified successfully.
In an optional embodiment, the checking the first data block and the last data block in the plurality of data blocks based on the second preset method includes:
calculating the first data block and the last data block through a Hash algorithm to obtain a fusion Hash value;
calculating the fused hash value based on an AES algorithm to obtain a first check value;
comparing the first check value with the preset check value;
and when the first check value is the same as the preset check value, determining that the first data block and the last data block are successfully checked.
In an alternative embodiment, the calculating the first data block and the last data block by using a hash algorithm includes:
reading first relevant information corresponding to the first data block and second relevant information corresponding to the last data block in the application code information block;
calculating the first relevant information and the second relevant information by adopting a Hash algorithm to obtain a first Hash value and a second Hash value;
and splicing the first hash value and the second hash value to obtain a fused hash value.
In an optional embodiment, the plurality of data blocks includes an intermediate data block, the application code information block includes third related information corresponding to the intermediate data block, and the method further includes:
reading the third relevant information;
checking the intermediate data block based on the second preset method;
and when the intermediate data block is verified successfully, determining that the application code data is not tampered.
In a second aspect, the present invention provides an apparatus for inspecting an electronic control unit having stored therein application code data and application code information blocks, the application code data being divided into a plurality of data blocks, the apparatus comprising:
the reading module is used for reading all information of the application code information block;
the cyclic redundancy check module is used for checking the application code information block by adopting a cyclic redundancy check algorithm based on all the information;
the key information checking module is used for checking the project key information corresponding to the application code data based on a first preset method if the application code information block is successfully checked;
the data block checking module is used for checking a first data block and a last data block in the plurality of data blocks based on a second preset method if the project key information is checked successfully;
and the safety starting module is used for determining that the electronic control unit is successfully checked if the first data block and the last data block are successfully checked.
In a third aspect, the present invention provides an in-vehicle control unit comprising:
the method for checking the electronic control unit is adopted for safety check.
In a fourth aspect, the invention provides a vehicle comprising a memory and a processor, the memory storing a computer program which, when run on the processor, performs the method of checking an electronic control unit.
In a fifth aspect, the invention provides a storage medium storing a computer program which, when run on a processor, performs the method of checking an electronic control unit.
The embodiment of the application has the following beneficial effects:
the method for checking an electronic control unit provided by the embodiment of the application checks an application code information block by reading all information of the application code information block and adopting a cyclic redundancy check algorithm based on all information, if the application code information block is successfully checked, item key information corresponding to application code data is checked based on a first preset method, if the item key information is successfully checked, a first data block and a last data block in a plurality of data blocks are checked based on a second preset method, if the first data block and the last data block are successfully checked, the electronic control unit is determined to be successfully checked, all information of the application code information block is read, the application code information block is checked by adopting the cyclic redundancy check algorithm based on all information, if the application code information block is successfully checked, the item key information corresponding to the application code data is checked based on the first preset method, and if the item key information is verified successfully, verifying a first data block and a last data block in the plurality of data blocks based on a second preset method, and if the first data block and the last data block are verified successfully, determining that the electronic control unit is verified successfully. The method and the device can reduce the data volume of the verified application code data, thereby improving the verification speed, and can effectively solve the problem that the first frame message sending time of the electronic control unit cannot be met when the application code data volume is large.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings required in the embodiments will be briefly described below, and it should be understood that the following drawings only illustrate some embodiments of the present invention, and therefore should not be considered as limiting the scope of the present invention. Like components are numbered similarly in the various figures.
FIG. 1 illustrates a first flow diagram of a method of verifying an electronic control unit in accordance with an embodiment of the present application;
FIG. 2 is a schematic flow chart illustrating a cyclic redundancy check in a method of verifying an electronic control unit according to an embodiment of the present application;
FIG. 3 is a schematic flow chart illustrating verification of key information of a project in a method for verifying an electronic control unit according to an embodiment of the application;
FIG. 4 is a flow chart illustrating a data block check in a method for checking an electronic control unit according to an embodiment of the present application;
fig. 5 is a schematic flow chart illustrating a process of calculating a fused hash value in a method of checking an electronic control unit according to an embodiment of the present application;
FIG. 6 illustrates a second flow diagram of a method of verifying an electronic control unit in accordance with an embodiment of the present application;
fig. 7 shows a schematic structural diagram of an inspection electronic control unit device according to an embodiment of the present application.
Description of the main element symbols:
10-checking the electronic control unit device; 11-a reading module; 12-a cyclic redundancy check module; 13-key information check module; 14-data block check module; 15-secure boot module.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Hereinafter, the terms "including", "having", and their derivatives, which may be used in various embodiments of the present invention, are only intended to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing, and should not be construed as first excluding the existence of, or adding to, one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing.
Furthermore, the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the present invention belong. The terms (such as those defined in commonly used dictionaries) should be interpreted as having a meaning that is consistent with their contextual meaning in the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein in various embodiments of the present invention.
Example 1
The embodiment of the application provides a method for checking an electronic control unit, wherein a memory of the electronic control unit comprises application code data and an application code information block, and the application code data is divided into a plurality of data blocks. The Electronic Control Unit (ECU) is composed of a Microcontroller Unit (MCU), a memory, an input/output interface (I/O), and a large scale integrated circuit (lsi) such as a shaping circuit and a driving circuit, and the memory may be divided into a Read Only Memory (ROM) and a Random Access Memory (RAM).
In this embodiment, the memory space of the memory of the electronic control unit will be divided into two parts, one part for storing application code data and the other part for storing application code information blocks, in other words, the memory space of the other part for storing information related to a plurality of data blocks. The application code information block is stored in front of the application code data of the electronic control unit, namely the front end of the application code data. The application code data is divided into a plurality of data blocks, and the plurality of data blocks are a first data block, a second data block, a third data block, … … and a last data block in sequence.
The application code information block includes information related to the plurality of data blocks, and may include, for example and without limitation, information including a start address of a first data block, a length of the first data block, a start address of a last data block, a length of the last data block, check values of the first data block and the last data block, a preset cyclic redundancy check code, a start address of a second data block, a length of the second data block, a check value of the second data block, and preset entry key information. The application code information block may further include a reserved space, and the reserved space may add corresponding information according to actual requirements.
After the application code data is edited and generated, the contents of all the information in the application code information block are generated through an upper computer and inserted into the application code information block in the memory. The upper computer is a computer capable of directly sending out control commands.
Referring to fig. 1, the method for checking the electronic control unit includes steps S100 to S500:
step S100: all information of the application code information block is read.
In this embodiment, after the electronic control unit is started, all information of the application code information block stored in the memory of the electronic control unit is read, as shown in table 1 below, including but not limited to the starting address of the first data block, the length of the first data block, the starting address of the last data block, the length of the last data block, the check values of the first data block and the last data block, the preset cyclic redundancy check code, and the item key information.
Figure BDA0003706853450000091
Step S200: and checking the application code information block by adopting a cyclic redundancy check algorithm based on all the information.
After reading all the information of the application code information block stored in the memory of the electronic control unit, checking all the information in the application code information block by a cyclic redundancy check algorithm, namely judging whether a cyclic redundancy check code obtained by the cyclic redundancy check algorithm is matched with a preset cyclic redundancy check code stored in the application code information block.
Cyclic Redundancy Check (CRC) is a channel coding technique for generating a short fixed-bit Check code according to data such as a network data packet or a computer file, and is mainly used to detect or Check errors that may occur after data transmission or storage, and is a commonly used Check code with error detection and correction capabilities. The cyclic redundancy check code establishes the appointed relation of data bits and check bits through some mathematical operation, and is commonly used for data check of synchronous communication between an external memory and a computer.
If the application code information block is successfully verified, step S300 is executed, and if the application code information block is unsuccessfully verified, step S600 is executed.
In one embodiment, as shown in FIG. 2, step S200 includes sub-steps S210-S230.
Substep S210: and calculating the information except the preset cyclic redundancy check code in the application code information block by adopting a cyclic redundancy check algorithm to obtain the cyclic redundancy check code.
After all the information in the application code information block is read, calculating other information except the preset cyclic redundancy check code in the application code information block through a cyclic redundancy check algorithm to obtain the corresponding cyclic redundancy check code.
Substep S220: and comparing the cyclic redundancy check code with a preset cyclic redundancy check code.
And comparing the calculated cyclic redundancy check code with a preset cyclic redundancy check code stored in the application code information block, and judging whether the cyclic redundancy check code is the same as the preset cyclic redundancy check code.
Substep S230: and when the cyclic redundancy check code is the same as the preset cyclic redundancy check code, determining that the application code information block is successfully checked.
And if the comparison result is that the calculated cyclic redundancy check code is the same as the preset cyclic redundancy check code, determining that the cyclic redundancy check of the application code information block passes. And if the comparison result is that the calculated cyclic redundancy check code is different from the preset cyclic redundancy check code, determining that the application code information block check is not passed.
Step S300: and verifying the project key information corresponding to the application code data based on a first preset method.
It can be understood that, after the application code information block is successfully verified, the preset project key information pre-stored in the application code information block is read, the project key information corresponding to the application code data is determined, the project key information is verified through a first preset method, and whether the preset project key information is matched with the project key information corresponding to the application code data is judged. The preset item key information may be a name of an item of the electronic control unit or a file name corresponding to the application code data, which is stored in the memory in advance.
If the verification of the item key information is successful, step S400 is executed, and if the verification of the item key information is failed, step S600 is executed.
In one embodiment, as shown in FIG. 3, step S300 includes sub-steps S310-S330.
Substep S310: and reading preset project key information and project key information corresponding to the application code data.
It can be understood that all the information of the application code information block includes preset item key information, and the preset item key information and the item key information corresponding to the application code data are read, where the item key information corresponding to the application code data may be an item name or a file name, etc. corresponding to the application code data of the electronic control unit. Reading the item key information in this implementation is advantageous for further identifying the authenticity of the application code data of the electronic control unit.
Substep S320: and comparing the preset project key information with the project key information.
Corresponding project key information also exists in the application code data of the electronic control unit, and the preset project key information in the application code information block is compared with the project key information corresponding to the application code data, namely whether the preset project key information is consistent with the project key information is judged.
Substep S330: and when the preset project key information is the same as the project key information, determining that the project key information is verified successfully.
And when the preset project key information is the same as the project key information of the application code data, determining that the verification of the project key information is successful, namely, preliminarily identifying the authenticity of the application code data of the electronic control unit. And when the preset project key information is different from the project key information corresponding to the application code data, determining that the verification of the project key information fails.
Step S400: and checking the first data block and the last data block in the plurality of data blocks based on a second preset method.
In this embodiment, when the item key information is successfully verified, the first data block and the last data block in the plurality of data blocks are verified by a second preset method, so as to further verify the incompletely burned application code data.
If the first data block and the last data block are successfully verified, step S500 is executed, and if the first data block and the last data block are unsuccessfully verified, step S600 is executed.
In one embodiment, as shown in fig. 4, the checking of the first data block and the last data block of the plurality of data blocks based on the second predetermined method includes sub-steps S410 to S440.
Substep S410: and calculating the first data block and the last data block through a Hash algorithm to obtain a fusion Hash value.
It can be understood that after the item key information corresponding to the application code data is successfully matched, the plurality of data blocks in the electronic control unit are further verified. During verification, determining related information of the first data block and the last data block, and calculating fusion hash values corresponding to the first data block and the last data block in sequence by adopting a hash algorithm.
The Hash algorithm (i.e. Hash algorithm) transforms an input of an arbitrary length (also called pre-mapped pre-image) into an output of a fixed length through the Hash algorithm, and the output is a Hash value. This transformation is a kind of compression mapping, i.e. the space of hash values is usually much smaller than the space of inputs, different inputs may hash to the same output, so it is not possible to determine a unique input value from a hash value. In short, it is a function of compressing a message of an arbitrary length to a message digest of a certain fixed length. In addition, hashing algorithms include MD4, MD5, SHA-1, and others.
In one embodiment, as shown in FIG. 5, substep S410 comprises substeps S411-S413.
Substep S411: and reading first related information corresponding to a first data block and second related information corresponding to a last data block in the application code information block.
Reading first related information corresponding to a first data block and second related information corresponding to a last data block stored in an application code information block, wherein the first related information comprises a starting address of the first data block and the length of the first data block, and the second related information comprises a starting address of the last data block and the length of the last data block.
Substep S412: and calculating the first relevant information and the second relevant information by adopting a Hash algorithm to obtain a first Hash value and a second Hash value.
In this embodiment, a hash algorithm may be used to calculate according to the first relevant information of the first data block to obtain a corresponding first hash value, and calculate according to the second relevant information of the second data block to obtain a second hash value.
Substep S413: and splicing the first hash value and the second hash value to obtain a fused hash value.
After the first hash value and the second hash value are obtained, the first hash value and the second hash value are spliced and combined according to a preset sequence, and a fused hash value is obtained. The first hash value is before, and the second hash value is after, and the first hash value and the second hash value are combined into a fused hash value; the second hash value may be before, and the first hash value is after, and the fusion hash value is obtained by sequentially combining the first hash value and the second hash value.
Substep S420: and calculating the fusion hash value based on an AES algorithm to obtain a first check value.
And after the fusion hash value is obtained, calculating the fusion hash value through an AES algorithm to obtain a first check value. When the encryption is carried out through the AES algorithm, the fusion hash value is calculated through the AES algorithm to generate independent ciphertext blocks, and the ciphertext blocks are spliced together to obtain a fusion AES encryption result, namely a first check value. The fused hash value is verified through an AES algorithm, so that the validity of the application code data can be ensured.
The aes (advanced Encryption standard) algorithm is also called Rijndael Encryption method, and is a block Encryption standard. AES supports keys of three lengths: 128 bits, 192 bits and 256 bits, commonly referred to as AES128, AES192, AES256, which in practice refers to the use of keys of different lengths by the AES algorithm.
Substep S430: and comparing the first check value with a preset check value.
It is understood that after the first check value is calculated, the first check value is compared with the preset check value stored in the application code information block, that is, whether the preset check value is the same as the first check value is judged, so as to determine whether the safe start of the electronic control unit is successful. The preset check value is a check value corresponding to a first data block and a last data block which are pre-stored in the application code information block.
Substep S440: and when the first check value is the same as the preset check value, determining that the first data block and the last data block are successfully checked.
If the first parity value is the same as the preset parity value, it is determined that the parity passes, in other words, it is determined that the parity for the first data block and the last data block based on the second preset method succeeds.
Step S500: and determining that the electronic control unit is successfully verified.
And when the first data block and the last data block are successfully verified based on the second preset method, determining that the electronic control unit is successfully verified. And after the electronic control unit is successfully checked, the electronic control unit is determined to be successfully started safely. The content in the application code data of the electronic control unit will be executed immediately, thereby satisfying the time requirement for network management to send the first frame message.
Step S600: determining that the electronic control unit failed the verification.
And when the verification of the application code information block or the project key information or the first data block and the last data block fails, determining that the verification of the electronic control unit fails, ending the safe starting verification of the electronic control unit and forbidding the electronic control unit to enter the application program.
In the embodiment, the verification speed can be improved, incomplete application code data which are not recorded in a burning mode can be verified, and the requirement of safe starting on the integrity of the data is met.
In one embodiment, as shown in fig. 6, the method of verifying an electronic control unit further comprises the steps of:
step S700: and reading the third relevant information.
In this embodiment, the application code information block includes third related information corresponding to the intermediate data block, where the third related information is related information of the intermediate data block, and includes a length of the intermediate data block, a start address of the intermediate data block, and a check value of the intermediate data block. The check value of the intermediate data block is a pre-stored check value, and the intermediate data block may be any one of the second data block to the second last data block in the plurality of data blocks, or all of the second data block to the second last data block in the application code data.
It will be appreciated that after the electronic control unit has been successfully verified, the intermediate data block in the application code data will continue to be verified, and that upon verification, the third relevant information in the application code information block will be read.
Step S800: and checking the intermediate data block based on a second preset method.
And calculating the length of the middle data block and the starting address of the middle data block through a Hash algorithm to obtain a third Hash value, and calculating the third Hash value through an AES algorithm to obtain a corresponding second check value.
And comparing the second check value with the check value of the intermediate data block read from the application code information block, and judging whether the second check value is the same as the check value of the intermediate data block.
Exemplarily, when the third related information in the application code information block is set as related information of the third data block, that is, when the length of the third data block, the start address of the third data block, and the verification value of the third data block are included, the intermediate data block is the third data block, and the third data block is verified by the second preset method.
Step S900: and when the intermediate data block is verified successfully, determining that the application code data is not tampered.
And when the second check value is the same as the check value of the intermediate data block, determining that the application message is not tampered, and when the second check value is different from the check value of the intermediate data block, determining that the application message is tampered.
In the embodiment of the application, the requirement of network management of the first frame of network management of the electronic control unit is met, and the requirement of verifying the authenticity and validity of data during safe starting is also met.
The method and the device can reduce the data volume of the verified application code data, thereby improving the verification speed, and can effectively solve the problem that the first frame message sending time of the electronic control unit cannot be met when the application code data volume is large.
Based on the method for checking the electronic control unit in the above embodiment, fig. 7 shows a schematic structural diagram of a device 10 for checking the electronic control unit according to an embodiment of the present application, in which the memory of the electronic control unit includes application code data and an application code information block, and the application code data is divided into a plurality of data blocks. The checking electronic control unit device 10 includes:
and the reading module 11 is used for reading all information of the application code information block.
And the cyclic redundancy check module 12 is used for checking the application code information block by adopting a cyclic redundancy check algorithm based on all the information.
And the project key information checking module 13 is configured to, if the application code information block is successfully checked, check the project key information corresponding to the application code data based on a first preset method.
And the data block checking module 14 is configured to, if the item key information is successfully checked, check a first data block and a last data block in the plurality of data blocks based on a second preset method.
And the safety starting module 15 is used for determining that the electronic control unit is successfully verified if the first data block and the last data block are successfully verified.
The implementation and beneficial effects related to the above embodiments are also applicable to this embodiment, and are not described herein again.
In addition, this application still provides a vehicle-mounted control unit, and vehicle-mounted control unit includes:
the security check is performed by performing the method of checking the electronic control unit in the above-described embodiment.
The present embodiment also proposes a vehicle comprising a memory and a processor, the memory storing a computer program which, when run on the processor, performs the method of checking an electronic control unit of the above-described embodiments.
The present embodiment also provides a storage medium storing a computer program which, when run on a processor, performs the method of checking an electronic control unit of the above-described embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, each functional module or unit in each embodiment of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention or a part thereof which contributes to the prior art in essence can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention.

Claims (10)

1. A method of verifying an electronic control unit having application code data and an application code information block stored in a memory of the electronic control unit, the application code data being divided into a plurality of data blocks, the method comprising:
reading all information of the application code information block;
verifying the application code information block by adopting a cyclic redundancy check algorithm based on all the information;
if the application code information block is successfully verified, verifying the project key information corresponding to the application code data based on a first preset method;
if the project key information is verified successfully, verifying a first data block and a last data block in the plurality of data blocks based on a second preset method;
and if the first data block and the last data block are verified successfully, determining that the electronic control unit is verified successfully.
2. The method of claim 1, wherein the all information includes a predetermined cyclic redundancy check code, and wherein the checking the application code information block using a cyclic redundancy check algorithm based on the all information includes:
calculating the information except the preset cyclic redundancy check code in the application code information block by adopting a cyclic redundancy check algorithm to obtain a cyclic redundancy check code;
comparing the cyclic redundancy check code with the preset cyclic redundancy check code;
and when the cyclic redundancy check code is the same as the preset cyclic redundancy check code, determining that the application code information block is successfully checked.
3. The method of claim 1, wherein the all information includes preset item key information, and the verifying the item key information corresponding to the application code data based on the first preset method includes:
reading the preset project key information and the project key information corresponding to the application code data;
comparing the preset project key information with the project key information;
and when the preset project key information is the same as the project key information, determining that the project key information is verified successfully.
4. The method of claim 1, wherein the all information includes a preset verification value, and the verifying the first data block and the last data block of the plurality of data blocks based on a second preset method comprises:
calculating the first data block and the last data block through a hash algorithm to obtain a fusion hash value;
calculating the fused hash value based on an AES algorithm to obtain a first check value;
comparing the first check value with the preset check value;
and when the first check value is the same as the preset check value, determining that the first data block and the last data block are checked successfully.
5. Method of checking an electronic control unit according to claim 4, characterized in that said calculation of said first and said last data block by means of a hashing algorithm comprises:
reading first relevant information corresponding to the first data block and second relevant information corresponding to the last data block in the application code information block;
calculating the first relevant information and the second relevant information by adopting a Hash algorithm to obtain a first Hash value and a second Hash value;
and splicing the first hash value and the second hash value to obtain a fused hash value.
6. The method of verifying an electronic control unit of claim 1, wherein the plurality of data blocks includes an intermediate data block, the application code information block includes third related information corresponding to the intermediate data block, the method further comprising:
reading the third relevant information;
checking the intermediate data block based on the second preset method;
and when the intermediate data block is verified successfully, determining that the application code data is not tampered.
7. An apparatus for verifying an electronic control unit having an application code data and an application code information block stored in a memory of the electronic control unit, the application code data being divided into a plurality of data blocks, the apparatus comprising:
the reading module is used for reading all information of the application code information block;
the cyclic redundancy check module is used for checking the application code information block by adopting a cyclic redundancy check algorithm based on all the information;
the key information checking module is used for checking the project key information corresponding to the application code data based on a first preset method if the application code information block is successfully checked;
the data block checking module is used for checking a first data block and a last data block in the plurality of data blocks based on a second preset method if the project key information is checked successfully;
and the safety starting module is used for determining that the electronic control unit is successfully checked if the first data block and the last data block are successfully checked.
8. An onboard control unit, characterized in that it comprises:
a security check using the method of checking an electronic control unit of any one of claims 1 to 6.
9. A vehicle, characterized by comprising a memory and a processor, the memory storing a computer program which, when run on the processor, performs the method of checking an electronic control unit of any one of claims 1 to 6.
10. A storage medium, characterized in that it stores a computer program which, when run on a processor, performs the method of checking an electronic control unit according to any one of claims 1 to 6.
CN202210710932.XA 2022-06-22 2022-06-22 Method, device, vehicle and storage medium for checking electronic control unit Pending CN115033857A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210710932.XA CN115033857A (en) 2022-06-22 2022-06-22 Method, device, vehicle and storage medium for checking electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210710932.XA CN115033857A (en) 2022-06-22 2022-06-22 Method, device, vehicle and storage medium for checking electronic control unit

Publications (1)

Publication Number Publication Date
CN115033857A true CN115033857A (en) 2022-09-09

Family

ID=83126700

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210710932.XA Pending CN115033857A (en) 2022-06-22 2022-06-22 Method, device, vehicle and storage medium for checking electronic control unit

Country Status (1)

Country Link
CN (1) CN115033857A (en)

Similar Documents

Publication Publication Date Title
US6640294B2 (en) Data integrity check method using cumulative hash function
EP2105860A2 (en) Method and apparatus for verifying integrity of redacted documents
CN108683502B (en) Digital signature verification method, medium and equipment
CN113065169B (en) File storage method, device and equipment
CN110989564B (en) Automobile data diagnosis method and device
CN107133120A (en) A kind of method of calibration of file data, device
CN111265860B (en) Game archiving processing method and device, terminal equipment and readable storage medium
CN109145651B (en) Data processing method and device
US7065680B2 (en) Method and a system for evaluating the reliability of a program in an electronic device, and an electronic device
CN114995894A (en) Starting control method of operating system, terminal equipment and readable storage medium
CN115514492A (en) BIOS firmware verification method, device, server, storage medium and program product
CN109033818B (en) Terminal, authentication method, and computer-readable storage medium
CN108196975B (en) Data verification method and device based on multiple checksums and storage medium
CN110597822A (en) Information searching method and device in block chain, storage medium and computer equipment
CN111767231B (en) Multi-platform Bootrom verification method, device and system and computer readable medium
CN115033857A (en) Method, device, vehicle and storage medium for checking electronic control unit
CN112711570A (en) Log information processing method and device, electronic equipment and storage medium
CN117371002A (en) Model encryption method, model decryption method, encryption device, and readable storage medium
CN111259413A (en) Data management method and device based on block chain
CN116149706A (en) Vehicle equipment upgrading method and device, vehicle and readable storage medium
US20080049259A1 (en) Image processing method carrying out verification of correctness of embedment data and identification of embedment data, data detection method, image processing apparatus, and recording medium recording computer program therefor
CN113688360B (en) Distributed digital signature processing method and system thereof
CN113553626A (en) Data integrity detection method, device, equipment and storage medium
CN108200060B (en) Single sign-on verification method based on web subsystem, server and storage medium
CN115481445B (en) Signature verification method, device and equipment for portable document format file and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination