Encryption method and encryption device for fault code of vehicle part unit
By converting the fault code ID into binary format and encrypting the fault code with a random key, the problems of low debugging efficiency and unauthorized access in the after-sales scenario are solved, and efficient fault information reading and authorized access are achieved.
Patent Information
- Application Number
- CN202311204695.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-18
- Publication Date
- 2025-03-18
AI Technical Summary
In the after-sales scenario, it is impossible to efficiently debug the fault information, and the access to the fault information by unauthorized parties cannot be controlled.
By pre-storing the correspondence between the fault name and the fault code ID, the fault code ID is converted into a binary format to form a fault code, and the fault code is encrypted using a random key to generate the encrypted fault code.
It realizes efficient reading and authorized access to fault information, improves debugging efficiency, and prevents unauthorized access to fault information.
Smart Images

Figure CN119646834A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle control technology, and in particular to an encryption method for a vehicle component unit fault code and an encryption device for a vehicle component unit fault code. Background Art
[0002] In the prior art, faults can be automatically stored in the vehicle's electronic control unit (ECU) and the driver can be prompted with a fault code. Fault codes are also called internal trouble codes. When a vehicle fails, the fault information is stored in a special area in the form of digital codes. When diagnosing vehicle faults in after-sales scenarios, these digital codes can be retrieved from the memory manually or by connecting a dedicated diagnostic instrument.
[0003] However, there is a problem that in after-sales scenarios, it is impossible to efficiently debug fault information and it is impossible to control access to fault information by unauthorized parties. Summary of the invention
[0004] Based on the above problems in the prior art, the present invention aims to provide a method for encrypting vehicle component unit fault codes and a device for encrypting vehicle component unit fault codes that can achieve efficient reading of fault information and authorized reading of fault information.
[0005] In order to solve the above technical problems, a method for encrypting a vehicle component unit fault code according to one aspect of the present invention comprises:
[0006] Pre-storing a correspondence between a fault name of a vehicle component unit and a fault code ID, wherein the fault code ID is represented in a first prescribed format;
[0007] Converting the fault code ID into a fault code ID in a second specified format;
[0008] The fault code is formed by the fault code ID in the second prescribed format; and
[0009] The fault code is encrypted using a preset random key to generate an encrypted fault code.
[0010] Optionally, further comprising:
[0011] The encrypted fault code is converted into a fault code in a first specified format.
[0012] Optionally, the first specified format is a hexadecimal format and the second specified format is a binary format.
[0013] Optionally, the random key corresponds to a hardware number of a vehicle component unit.
[0014] The encryption device of the vehicle component unit fault code according to one aspect of the present invention is characterized by comprising:
[0015] A storage module, used for pre-storing the corresponding relationship between the fault name of the vehicle component unit and the fault code ID, wherein the fault code ID is represented by a first specified format;
[0016] A first conversion module, configured to convert the fault code ID into a fault code ID in a second specified format; and
[0017] a fault code forming module, configured to form a fault code based on the ID code in the second prescribed format; and
[0018] The encryption module is used to encrypt the fault code using a preset random key to generate an encrypted fault code.
[0019] Optionally, further comprising:
[0020] The second conversion module is used to convert the encrypted fault code into a fault code in a first specified format.
[0021] Optionally, the first specified format is a hexadecimal format and the second specified format is a binary format.
[0022] Optionally, the random key corresponds to a hardware number of a vehicle component unit.
[0023] A computer-readable medium according to one aspect of the present invention stores a computer program, which, when executed by a processor, implements the method for encrypting the fault code of a vehicle component unit.
[0024] A vehicle electronic control unit according to one aspect of the present invention comprises a storage module, a processor and a computer program stored on the storage module and executable on the processor, wherein the processor implements the encryption method of the vehicle component unit fault code when executing the computer program.
[0025] The encryption method and device for the vehicle component unit fault code according to the present invention can improve the debugging efficiency, and by using a random key for encryption, the reading of the fault information can be authorized to prevent unauthorized access to the fault information. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The above and other objects and advantages of the present application will become more fully apparent from the following detailed description in conjunction with the accompanying drawings, in which the same or similar elements are represented by the same reference numerals.
[0027] Figure 1The present invention is a flowchart of a method for encrypting a vehicle component unit fault code according to an embodiment of the present invention.
[0028] Figure 2 The present invention is a block diagram showing the structure of a device for encrypting a vehicle component unit fault code according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] Some of the various embodiments of the present invention are described below, which are intended to provide a basic understanding of the present invention, but are not intended to identify the key or decisive elements of the present invention or to limit the scope of protection.
[0030] Figure 1 The present invention is a flowchart of a method for encrypting a vehicle component unit fault code according to an embodiment of the present invention.
[0031] like Figure 1 As shown, a method for encrypting a vehicle component unit fault code according to an embodiment of the present invention comprises the following steps:
[0032] S1: Pre-store the corresponding relationship between the fault name and the fault code ID of the vehicle component unit, wherein a fault code ID is used to uniquely identify a fault. As a preferred method, Figure 1 As shown in the table on the left, column I indicates the fault code ID, which is expressed in hexadecimal format, and column II indicates the fault name;
[0033] S2: Convert the hexadecimal fault code ID into a binary fault code ID, such as Figure 1 As shown in the table on the right, column I indicates the fault code ID, which is expressed in binary format, and column II indicates the fault name;
[0034] S3: Construct a fault code from a binary ID code, and convert several binary ID codes (such as Figure 1 The "0001 1000 0101", "0000 0110 0100", "0000 0000 1010", "0000 0000 0001") shown in the figure constitute the fault code, wherein each binary ID code (12 digits) is independent of each other;
[0035] S4: The fault code is encrypted using a preset random key to generate an encrypted fault code. As an example, the encrypted fault code is obtained by using a random key for OR operation. The encrypted fault code obtained by using a random key ("1001 0011 1110") for OR operation is as follows: Figure 1"1000 10111011" "1001 0101 1010" "1001 0011 0100" "1001 0011 1111" shown;
[0036] S5: Convert the encrypted fault code represented by binary into a hexadecimal fault code, such as Figure 1 "0x8BB" "0x95A" "0x934" "0x93F" as shown;
[0037] S6: Combine multiple hexadecimal fault codes to form a string of fault codes, such as Figure 1 The "0x8BB95A93493F" shown has completed the encryption steps of the present invention.
[0038] For the fault code encrypted in this way, the fault code can be decrypted and decomposed by using the inverse operation corresponding to the encryption step to obtain the corresponding fault ID. As an example, by Figure 1 The decryption step of S7 in the embodiment can realize decryption, and the specific content of S7 includes: decrypting the fault code by using a preset random key and finding the corresponding fault name from the fault ID by querying the correspondence between the fault name of the vehicle and the fault code ID stored in advance.
[0039] Here, as the random key, a random key corresponding to the hardware code of the vehicle component unit may be used.
[0040] As described above, according to the method for encrypting the fault code of a vehicle component unit in one embodiment of the present invention, multiple fault IDs (corresponding to multiple faults) can be included in one fault code, which can improve the debugging efficiency. Moreover, by using a random key for encryption, the reading of the fault information can be authorized, and the reading of the fault information by unauthorized institutions or personnel can be avoided, thereby preventing unauthorized access to the fault information.
[0041] Figure 2 The present invention is a block diagram showing the structure of a device for encrypting a vehicle component unit fault code according to an embodiment of the present invention.
[0042] like Figure 2 As shown, a vehicle component unit fault code encryption device 100 according to one embodiment of the present invention includes:
[0043] The storage module 110 is used to pre-store the corresponding relationship between the fault name of the vehicle component unit and the fault code ID, wherein the fault code ID is represented by a first specified format;
[0044] A first conversion module 120, configured to convert the fault code ID into a fault code ID in a second specified format;
[0045] A fault code forming module 130, configured to form a fault code based on the fault code ID in the second prescribed format;
[0046] The encryption module 140 is used to encrypt the fault code using a preset random key to generate an encrypted fault code;
[0047] The second conversion module 150 is used to convert the encrypted fault code into a fault code in a first specified format.
[0048] The first specified format is a hexadecimal format, and the second specified format is a binary format.
[0049] The random key corresponds to the hardware number of the vehicle component unit.
[0050] The present invention also provides a computer-readable medium on which a computer program is stored. When the computer program is executed by a processor, the encryption method of the vehicle component unit fault code is implemented.
[0051] The present invention also provides a vehicle electronic control unit, comprising a storage module, a processor, and a computer program stored on the storage module and executable on the processor, wherein the processor implements the encryption method of the vehicle component unit fault code when executing the computer program.
[0052] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Those skilled in the art can think of other feasible changes or substitutions based on the technical scope disclosed in the present application, and such changes or substitutions are all included in the protection scope of the present application. In the absence of conflict, the implementation modes of the present application and the features in the implementation modes can also be combined with each other. The protection scope of the present application shall be subject to the description of the claims.
Claims
1. A method for encrypting a fault code of a vehicle component unit, characterized in that: include: Pre-storing a correspondence between a fault name of a vehicle component unit and a fault code ID, wherein the fault code ID is represented in a first prescribed format; Converting the fault code ID into a fault code ID in a second specified format; The fault code is formed by the fault code ID in the second prescribed format; and The fault code is encrypted using a preset random key to generate an encrypted fault code.
2. The method for encrypting the fault code of a vehicle component unit according to claim 1, characterized in that: Further including: The encrypted fault code is converted into a fault code in a first specified format.
3. The method for encrypting the fault code of a vehicle component unit according to claim 1 or 2, characterized in that: The first prescribed format is a hexadecimal format, and the second prescribed format is a binary format.
4. The method for encrypting a vehicle component unit fault code according to claim 1, characterized in that: The random key corresponds to the hardware number of the vehicle component unit.
5. A device for encrypting fault codes of vehicle component units, characterized in that: include: A storage module, used for pre-storing a correspondence between a fault name of a vehicle component unit and a fault code ID, wherein the fault code ID is represented in a first prescribed format; A first conversion module, configured to convert the fault code ID into a fault code ID in a second specified format; and a fault code forming module, configured to form a fault code based on the fault code ID in the second prescribed format; and The encryption module is used to encrypt the fault code using a preset random key to generate an encrypted fault code.
6. The encryption device for vehicle component unit fault code according to claim 5, characterized in that: Further including: The second conversion module is used to convert the encrypted fault code into a fault code in a first specified format.
7. The encryption device for vehicle component unit fault code according to claim 5 or 6, characterized in that: The first prescribed format is a hexadecimal format, and the second prescribed format is a binary format.
8. The encryption device for vehicle component unit fault code according to claim 5, characterized in that: The random key corresponds to the hardware number of the vehicle component unit.
9. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the encryption method of the vehicle component unit fault code according to any one of claims 1 to 4 is implemented.
10. A vehicle electronic control unit, comprising a storage module, a processor, and a computer program stored in the storage module and executable on the processor, characterized in that: When the processor executes the computer program, the method for encrypting the vehicle component unit fault code according to any one of claims 1 to 4 is implemented.