Key writing and reading methods, devices and vehicles
By generating and randomly storing multiple keys in the smart key, and combining them with vehicle-side controllers and server verification, the problem of existing smart keys being easily read is solved, achieving secure storage and convenient retrieval of key information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GREAT WALL MOTOR CO LTD
- Filing Date
- 2022-09-28
- Publication Date
- 2026-06-30
AI Technical Summary
Existing smart key chips lack hardware protection mechanisms, making key information easy to be read illegally, and key information cannot be obtained without specialized tools.
By generating and randomly storing the first and second target keys, encrypted communication is achieved between the key and the vehicle controller. A dedicated key is added to prevent unauthorized reading, and the key information is obtained by verifying user permissions through the server.
It effectively prevents key information from being read illegally, ensuring that only authorized users can access key information, thus improving vehicle security and the convenience of information access.
Smart Images

Figure CN117831158B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle technology, and in particular to a key writing and reading method, device and vehicle. Background Technology
[0002] With the improvement of vehicle configuration, smart keys have now become a standard feature in vehicles. Each manufacturer uses a variety of key chips, and each car manufacturer matches smart keys on its own production line, that is, writes the key used for vehicle authentication into the key through the production line.
[0003] Since the production line only writes keys related to vehicle authentication, and current chips generally lack hardware protection mechanisms, relevant personnel can read the key information stored in the key after obtaining the equipment provided by the chip manufacturer, which to some extent makes the vehicle insecure.
[0004] In addition, because specialized tools are required to read the key information, engineers without the necessary equipment cannot obtain the key information and must rely on other personnel. Summary of the Invention
[0005] To overcome the problems existing in related technologies, this application provides a key writing and reading method, apparatus and vehicle.
[0006] According to a first aspect of the embodiments of this application, a key writing method is provided, applied to a vehicle-end controller, the method comprising:
[0007] Receive a first target key sent by the diagnostic tool, wherein the first target key is generated by the diagnostic tool based on the vehicle code;
[0008] The first target key is sent to the key at a low frequency, so that the key stores the first target key in a first random location of the target memory;
[0009] The first target key returned by the key completes the storage identifier and the first random location;
[0010] Send a second target key to the key, so that the key stores the second target key in a second random location of the target memory;
[0011] The second target key returned by the key completes the storage identifier and the second random location.
[0012] Optionally, after the step of receiving the second target key storage identifier and the second random location returned by the key, the method further includes:
[0013] If the first target key and the second target key are detected to match the key respectively, a matching completion message is sent to the diagnostic instrument.
[0014] The system receives the target memory storage permission change completion identifier sent by the key and sends the target memory storage permission change completion identifier to the diagnostic instrument.
[0015] Optionally, sending matching completion information to the diagnostic instrument when the first target key and the second target key are detected to match the key includes:
[0016] The first target key and the second target key are controlled to be matched with the key respectively, so that when the key completes the matching, the read permission corresponding to the target memory is set to key read, and the state corresponding to the target memory is changed to the matching completed state;
[0017] If the matching is detected as complete, a matching completion message is sent to the diagnostic instrument.
[0018] Optionally, the first target key includes a read key and an interaction key, wherein the read key is used to encrypt the target memory being read, and the interaction key is used to encrypt the data during the interaction between the key and the diagnostic instrument.
[0019] According to a second aspect of the embodiments of this application, a key reading method is provided, applied to a diagnostic instrument, the diagnostic instrument being used to generate a first target key based on a vehicle code, the method comprising:
[0020] Upon detecting that the matching completion information has been received, user parameter information and vehicle code are obtained;
[0021] First encrypted data is obtained based on the user parameter information and the vehicle code;
[0022] The first encrypted data corresponding to the vehicle code is sent to the key in a low-frequency manner, so that the key can decrypt the first encrypted data according to the reading key in the first target key;
[0023] The key receives second encrypted data sent by the key, wherein the second encrypted data is generated by the key encrypting the decrypted first encrypted data using the interaction key in the first target key;
[0024] The second encrypted data is decrypted according to the interaction key, and the decrypted second encrypted data is then encrypted with the third target key to generate the third encrypted data.
[0025] The third encrypted data is sent to the server so that the server can determine whether the diagnostic instrument meets the reading conditions based on the third encrypted data.
[0026] Determine whether to read the target key information based on the judgment result returned by the server.
[0027] According to a third aspect of the embodiments of this application, a key writing device is provided, the device comprising:
[0028] The first receiving module is used to receive a first target key sent by the diagnostic instrument, wherein the first target key is generated by the diagnostic instrument based on the vehicle code;
[0029] The first sending module is used to send the first target key to the key in a low-frequency manner, so that the key stores the first target key in a first random location of the target memory;
[0030] The second receiving module is used to receive the first target key storage completion identifier and the first random location returned by the key;
[0031] The second sending module is used to send a second target key to the key, so that the key stores the second target key in a second random location of the target memory;
[0032] The third receiving module is used to receive the second target key completion storage identifier and the second random location returned by the key.
[0033] According to a fourth aspect of the embodiments of this application, a key reading device is provided, the device comprising:
[0034] The first acquisition module is used to acquire user parameter information and vehicle code when the matching completion information is detected;
[0035] The second acquisition module is used to acquire first encrypted data based on the user parameter information and the vehicle code;
[0036] The second sending module is used to send the first encrypted data corresponding to the vehicle code to the key in a low-frequency manner, so that the key can decrypt the first encrypted data according to the reading key in the first target key;
[0037] A receiving module is configured to receive second encrypted data sent by the key, wherein the second encrypted data is generated by the key encrypting the decrypted first encrypted data using the interaction key in the first target key;
[0038] The decryption module is used to decrypt the second encrypted data according to the interaction key, and then encrypt the decrypted second encrypted data with the third target key to generate third encrypted data.
[0039] The judgment module is used to send the third encrypted data to the server, so that the server can determine whether the diagnostic instrument meets the reading conditions based on the third encrypted data;
[0040] The determination module is used to determine whether to read the target key information based on the judgment result returned by the server.
[0041] According to a fifth aspect of the embodiments of this application, a vehicle is provided, including the key writing device described in the third aspect of this application, or the key reading device described in the fourth aspect of this application.
[0042] The technical solutions provided by the embodiments of this application may include the following beneficial effects:
[0043] This application involves receiving a first target key sent by a diagnostic tool, wherein the first target key is generated by the diagnostic tool based on the vehicle's code; transmitting the first target key to a key via a low-frequency method, causing the key to store the first target key in a first random location of the target memory; receiving a storage completion identifier and the first random location returned by the key; and sending a second target key to the key, causing the key to store the second target key in a second random location of the target memory, and receiving a storage completion identifier and the second random location returned by the key. In other words, a first target key is generated based on the unique code corresponding to the vehicle, the key randomly stores the first and second target keys sent by the vehicle, and feeds the storage result back to the vehicle controller. This application changes the original method where the key and vehicle only use a key related to vehicle authentication as a matching standard. By adding a second target key as a dedicated key, and combining the first and second target keys for random storage, it prevents anyone with a universal device from reading the information inside the key simply by reading the first target key.
[0044] In addition, by verifying user parameter information and vehicle code, and then decrypting encrypted transmission data using the first target key, the problem of needing specialized tools to read key information is solved. When engineers without the equipment need key information, they can obtain the key information by verifying whether they have the necessary permissions and the first target key through the server, without relying on other personnel.
[0045] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0046] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0047] Figure 1 This is a flowchart illustrating a key writing method according to an exemplary embodiment;
[0048] Figure 2 This is a flowchart illustrating another key writing method according to an exemplary embodiment;
[0049] Figure 3 This is a flowchart illustrating a key reading method according to an exemplary embodiment;
[0050] Figure 4 This is a flowchart illustrating another key reading method according to an exemplary embodiment;
[0051] Figure 5 This is a block diagram illustrating a key writing device according to an exemplary embodiment;
[0052] Figure 6 This is a block diagram illustrating a key reading device according to an exemplary embodiment;
[0053] Figure 7 This is a schematic diagram of a key writing and reading hardware architecture according to an exemplary embodiment. Detailed Implementation
[0054] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0055] It should be noted that the hardware architecture of the embodiments of this application is as follows: Figure 7 As shown, Figure 7 This is a schematic diagram of a key writing and reading hardware architecture according to an exemplary embodiment. The key slot is where the key is placed when the diagnostic instrument needs to directly read key information. The diagnostic instrument supports low-frequency signals, which communicate directly with the key in the key slot. The key and the vehicle controller can communicate with each other after matching. The vehicle controller and the diagnostic instrument can also communicate with each other.
[0056] The first embodiment of this application relates to a key writing method, see [link to relevant documentation]. Figure 1 , Figure 1This is a flowchart of a key writing method provided in an embodiment of this application, including the following steps:
[0057] Step 101: Receive the first target key sent by the diagnostic tool, wherein the first target key is generated by the diagnostic tool based on the vehicle code.
[0058] It should be noted that in this embodiment, the key writing part is mainly handled by the vehicle-side controller. First, it receives the first target key sent by the diagnostic tool. Specifically, during the vehicle and key matching process, the diagnostic tool generates two sets of dedicated keys based on the VIN, and marks these keys as key 1 for reading key EEPROM data and key 2 for key-diagnostic tool interaction. This key is then transmitted to the vehicle-side controller. Key 1 for reading key EEPROM data is the reading key in the first target key, and key 2 for key-diagnostic tool interaction is the interaction key in the first target key. The VIN is a unique identifier for the vehicle, i.e., the vehicle code. In the automotive field, a diagnostic tool is a specialized instrument for vehicle testing, capable of real-time vehicle performance detection and fault diagnosis. It is an essential tool for vehicle testing. In this application, the diagnostic tool primarily diagnoses whether the vehicle and smart key can be properly matched and the security of data transmission.
[0059] Furthermore, the first target key includes a reading key and an interaction key, wherein the reading key is used to encrypt the target memory being read, and the interaction key is used to encrypt the data during the interaction between the key and the diagnostic instrument.
[0060] It should be noted that the first target key includes a reading key and an interaction key. The reading key is the key 1 used for reading EEPROM data from the key, and the interaction key is the key 2 used for interaction between the key and the diagnostic instrument. The reading key is used to encrypt the target memory to be read, and the interaction key is used to read key information between the key and the diagnostic instrument, or to encrypt information when there is interaction processing.
[0061] Step 102: The first target key is sent to the key via a low-frequency method, so that the key stores the first target key in a first random location of the target memory.
[0062] It should be noted that, in this embodiment, after the vehicle controller receives the first target key, it will actively identify that the key includes a key 1 for reading key EEPROM data and a key 2 for key-diagnostic instrument interaction. When the first target key is detected to meet the requirements or preset conditions, the first target key will be sent to the key via low-frequency transmission. Low-frequency frequencies are freely used and have strong radio wave penetration. Therefore, in this application, the communication between the diagnostic instrument and the vehicle controller and the key can use low-frequency signal transmission.
[0063] After receiving the first target key, the key stores it in an EEPROM (Electrically Erasable Programmable Read-Only Memory). It's important to note that the key itself contains this target memory, and the storage location is randomly determined; it doesn't require a pre-fixed location. However, after random storage, the key records the storage location information and returns the result to the vehicle controller, simultaneously providing the controller with the specific location of the first target key within the target memory—the corresponding first random location. This random storage ensures that only the key and the vehicle controller store the specific location information of the first target key. Compared to existing technologies that store the vehicle authentication-related first target key in a fixed location, this effectively prevents unauthorized personnel from accessing the chip manufacturer's equipment and reading the key information stored in the key.
[0064] Step 103: Receive the first target key storage completion identifier and the first random location returned by the key.
[0065] Therefore, after step 102, the vehicle controller will receive the result of successful key storage and the storage location of the key, that is, receive the first target key storage completion identifier and the first random location returned by the key.
[0066] Step 104: Send a second target key to the key so that the key stores the second target key in a second random location of the target memory.
[0067] Step 105: Receive the second target key storage completion identifier and the second random location returned by the key.
[0068] In steps 104-105 above, after the vehicle controller receives the result of successful key storage and the key's storage location, it writes the remaining keys used for vehicle-key authentication to the key according to the normal key matching process. Specifically, a second target key is generated based on a pre-set key matching rule and sent to the key so that the key stores the second target key in a second random location of the target memory. When the key receives the key, it also performs the relevant storage, but this time it does not overwrite the storage location corresponding to the first target key, and feeds back the storage result to the vehicle controller. Therefore, the vehicle controller receives the second target key returned by the key to complete the storage and the second random location.
[0069] A first target key is generated based on the unique code corresponding to the vehicle. The key randomly stores the first and second target keys sent by the vehicle terminal and feeds back the storage result to the vehicle terminal controller. The vehicle terminal controller receives the storage location information of the target key and the storage completion result, thereby realizing the authentication and matching between the vehicle terminal controller and the key. This application embodiment changes the original key and vehicle matching standard which only uses the key related to vehicle authentication. By adding a second target key as a dedicated key, and combining the first and second target keys for random storage, it avoids the situation where anyone with a universal device can read the information inside the key by reading only the first target key.
[0070] This application involves receiving a first target key sent by a diagnostic tool, wherein the first target key is generated by the diagnostic tool based on the vehicle's code; transmitting the first target key to a key via a low-frequency method, causing the key to store the first target key in a first random location of the target memory; receiving a storage completion identifier and the first random location returned by the key; and sending a second target key to the key, causing the key to store the second target key in a second random location of the target memory, and receiving a storage completion identifier and the second random location returned by the key. In other words, a first target key is generated based on the unique code corresponding to the vehicle, the key randomly stores the first and second target keys sent by the vehicle, and feeds the storage result back to the vehicle controller. This application changes the original method where the key and vehicle only use a key related to vehicle authentication as a matching standard. By adding a second target key as a dedicated key, and combining the first and second target keys for random storage, it prevents anyone with a universal device from reading the information inside the key simply by reading the first target key.
[0071] The second embodiment of this application relates to a key writing method, see [link to relevant documentation]. Figure 2 , Figure 2 This is a flowchart of a key writing method provided in an embodiment of this application, including the following steps:
[0072] Step 101: Receive the first target key sent by the diagnostic tool, wherein the first target key is generated by the diagnostic tool based on the vehicle code.
[0073] Step 102: The first target key is sent to the key via a low-frequency method, so that the key stores the first target key in a first random location of the target memory.
[0074] Step 103: Receive the first target key storage completion identifier and the first random location returned by the key.
[0075] Step 104: Send a second target key to the key so that the key stores the second target key in a second random location of the target memory.
[0076] Step 105: Receive the second target key storage completion identifier and the second random location returned by the key.
[0077] The above steps are described in the preceding discussion and will not be repeated here.
[0078] Step 106: If the first target key and the second target key are detected to match the key respectively, send a matching completion message to the diagnostic instrument.
[0079] Furthermore, step 106 includes the following:
[0080] The first target key and the second target key are controlled to be matched with the key respectively, so that when the key completes the matching, the read permission corresponding to the target memory is set to key read, and the state corresponding to the target memory is changed to the matching completed state;
[0081] If the matching is detected as complete, a matching completion message is sent to the diagnostic instrument.
[0082] It should be noted that, in this embodiment of the application, when the vehicle-side controller controls the first target key and the second target key to match and authenticate with the key respectively, the key will automatically change the permissions of all keys, i.e., the storage locations corresponding to the first target key and the second target key, to be readable after authentication. Being readable after authentication means that when any person reads the data, for example, using a master key to unlock the vehicle, authentication must be performed before reading the location information corresponding to the first target key and the second target key, and the first target key and the second target key need to be obtained. At this time, the key will automatically change the original permission to read the key information to be readable only after the user enters the key, and delete the original data reading permission. Then the key will report to the vehicle-side controller that the target memory permission has been changed successfully, and at the same time modify the internal state of the memory to "matched". The vehicle-side controller will then transmit this result to the diagnostic tool.
[0083] Step 107: Receive the target memory storage permission change completion identifier sent by the key, and send the target memory storage permission change completion identifier to the diagnostic instrument.
[0084] It should be noted that after the vehicle controller receives the result of successful key storage, that is, when it receives the second target key storage completion identifier, it uses different keys to authenticate with the key. That is, the first target key and the second target key are authenticated and matched with the key respectively. When all authentications are successfully completed, the vehicle controller sends a message to the diagnostic tool that the key matching is successful, that is, the vehicle controller sends a matching completion message to the diagnostic tool.
[0085] Furthermore, if the first target key and the second target key are successfully matched with the key, the target memory storage permission change completion identifier sent by the key will be received and sent to the diagnostic instrument so that the diagnostic instrument can know that the key has been successfully matched and the permission has been set.
[0086] Through the embodiments of this application, by setting the read permission of the target memory to key read when the first target key and the second target key are detected to match the key respectively, and controlling the state of the target memory to the matching completed state, that is, authentication is required before reading the positions corresponding to the first target key and the second target key, and the first target key and the second target key need to be obtained, it can prevent the situation where relevant personnel can read the key information stored in the key after obtaining the device provided by the chip manufacturer.
[0087] This application involves receiving a first target key sent by a diagnostic tool, wherein the first target key is generated by the diagnostic tool based on the vehicle's code; transmitting the first target key to a key via a low-frequency method, causing the key to store the first target key in a first random location of the target memory; receiving a storage completion identifier and the first random location returned by the key; and sending a second target key to the key, causing the key to store the second target key in a second random location of the target memory, and receiving a storage completion identifier and the second random location returned by the key. In other words, a first target key is generated based on the unique code corresponding to the vehicle, the key randomly stores the first and second target keys sent by the vehicle, and feeds the storage result back to the vehicle controller. This application changes the original method where the key and vehicle only use a key related to vehicle authentication as a matching standard. By adding a second target key as a dedicated key, and combining the first and second target keys for random storage, it prevents anyone with a universal device from reading the information inside the key simply by reading the first target key.
[0088] The third embodiment of this application relates to another key reading method, see [link to relevant documentation]. Figure 3 , Figure 3 This is a flowchart of another key reading method provided in this application embodiment, including the following steps:
[0089] It should be noted that there are two scenarios for key reading methods: first, the key and vehicle have been matched; second, the key and vehicle have not been matched.
[0090] For the first scenario, steps 301-310 are explained in detail.
[0091] Step 301: Upon detecting that the matching completion information has been received, obtain the user parameter information and vehicle code.
[0092] It should be noted that user parameter information can be extracted facial feature parameters, fingerprints, pupils, or any other parameter information that can be used for identity authentication. For example, when an engineer or related personnel inserts the key into the fixed position of the diagnostic tool, such as the key slot, they can select the first option on the diagnostic tool interface, which is to read the matched key. Then, they can input their own facial information and vehicle code, such as the VIN, into the diagnostic tool.
[0093] At this point, the diagnostic tool will obtain user parameter information and vehicle code.
[0094] Step 302: Obtain the first encrypted data based on the user parameter information and the vehicle code.
[0095] Further, step 302 includes the following: sending the user parameter information to the server so that the server performs read permission verification based on the user parameter information; and receiving the first encrypted data corresponding to the vehicle code sent by the server if the server returns verification information that satisfies the read permission.
[0096] It should be noted that after obtaining user parameter information and vehicle code, the diagnostic tool will confirm the legality of the facial information and then request the server to read the matched key information. At the same time, it will transmit the facial information to the server. When the server receives the facial information transmitted by the diagnostic tool, it will verify the identity to confirm whether the identity is a registered identity and whether the access permissions meet the requirements (core personnel).
[0097] If the server detects that the verification information returned by the server satisfies the read permission, the server will call the key key corresponding to the vehicle model and encrypt the data, and then send the encrypted data to the diagnostic tool. In other words, the server sends the first encrypted data to the diagnostic tool and informs the diagnostic tool that it wants to access the data inside the key.
[0098] Step 303: Send the first encrypted data corresponding to the vehicle code to the key in a low-frequency manner, so that the key can decrypt the first encrypted data according to the reading key in the first target key.
[0099] After the diagnostic instrument receives the encrypted data and confirms that it is accessing the internal data of the key, it will send the first encrypted data transmitted from the server to the key in the key slot via low frequency communication. At this time, after receiving the requested encrypted data, the key decrypts the data according to the reading key in the stored first target key. It should be noted that this reading key is the key 1 used to read the key EEPROM data mentioned above.
[0100] Step 304: Receive the second encrypted data sent by the key, wherein the second encrypted data is generated by the key encrypting the decrypted first encrypted data using the interaction key in the first target key.
[0101] When the key can decrypt the first encrypted data according to the read key in the first target key, after successful decryption, the key will encrypt the decrypted first encrypted data with the interaction key in the first target key, that is, generate the second encrypted data, and send the second encrypted data to the diagnostic instrument.
[0102] Therefore, the diagnostic tool can receive the second encrypted data sent by the key.
[0103] Step 305: Decrypt the second encrypted data according to the interaction key, and encrypt the decrypted second encrypted data with the third target key to generate the third encrypted data.
[0104] After receiving the second encrypted data, the diagnostic tool, which also stores the first target key, decrypts the second encrypted data using the interaction key. The decrypted second encrypted data is then encrypted again using the third target key to generate the third encrypted data. It should be noted that the third target key is a dedicated key used by the server and diagnostic tool to encrypt the exchanged information. This key is generated by the vehicle manufacturer's server based on the unique serial number of each diagnostic tool when it is purchased.
[0105] Step 306: Send the third encrypted data to the server so that the server can determine whether the diagnostic instrument meets the reading conditions based on the third encrypted data.
[0106] Therefore, after encrypting the decrypted second encrypted data according to the third target key, the third encrypted data is generated. At this time, the diagnostic instrument will send the third encrypted data to the server. The server will determine whether the authentication is successful based on the third encrypted data and then inform the diagnostic instrument whether it can read the key information.
[0107] Step 307: Determine whether to read the target key information based on the judgment result returned by the server.
[0108] In this embodiment of the application, after receiving the information transmitted by the server, the diagnostic instrument displays the key information that can be read and selects it, and then transmits the selection result to the server, that is, determines whether to read the target key information based on the judgment result returned by the server.
[0109] Further, after step 307, as Figure 4 As shown, it also includes the following steps:
[0110] Step 308: If the reading of the target key information is detected, the reading key information is sent to the server, so that the server sends a reading request corresponding to the target key information to the key through the diagnostic instrument according to the target key information, and encrypts the target key information.
[0111] Step 309: Receive the encrypted target key information returned by the server.
[0112] Step 310: Decrypt and read the encrypted target key information.
[0113] In steps 308-310 above, when the diagnostic tool can read the target key information, the server sends a read request to the key through the diagnostic tool based on the content to be read. It should be noted that the information transmission still needs to be encrypted at this time. The key responds with relevant information based on the read request, and this response information needs to be encrypted before being sent to the vehicle manufacturer's backend via the diagnostic tool. When the key reads data from the diagnostic tool, it uses the interaction key from the first target key to encrypt the data to prevent it from being read. The server decrypts the data, re-encrypts it, and sends it to the diagnostic tool. The diagnostic tool decrypts the data and displays it to the target user. At this point, the target user can read the key information by completing verification, without needing specialized tools. This allows engineers without the necessary equipment to quickly obtain key information when needed.
[0114] In the second scenario, the engineer places the key into the fixed position on the diagnostic tool, selects "Read Unmatched Key" on the diagnostic tool interface, and then inputs their facial information and vehicle code into the diagnostic tool. After the diagnostic tool confirms the validity of the facial information, it requests the server to read the unmatched key information. At this time, the entire information interaction process will be encrypted and decrypted based on the default key to prevent information leakage. The default key can be any encryption and decryption key generated based on any encryption algorithm.
[0115] In this embodiment, by verifying user parameter information and vehicle code, and then decrypting encrypted transmission data using the first target key, the problem of needing specialized tools to read key information is solved. When engineers without the equipment need key information, they can obtain the key information by verifying whether they have the necessary permissions and the first target key through the server, without relying on other personnel.
[0116] It should be noted that all embodiments in this example are only for the purpose of enabling those skilled in the art to better understand the technical solutions in this example, and are not intended to limit the structure in this example.
[0117] The fourth embodiment of this application relates to a key writing device, such as... Figure 5 As shown, Figure 5 This is a block diagram of a key writing device according to an exemplary embodiment, the device including the following modules:
[0118] The first receiving module 401 is used to receive a first target key sent by the diagnostic instrument, wherein the first target key is generated by the diagnostic instrument based on the vehicle code;
[0119] The first sending module 402 is used to send the first target key to the key in a low-frequency manner, so that the key stores the first target key in a first random location of the target memory;
[0120] The second receiving module 403 is used to receive the first target key storage completion identifier and the first random location returned by the key;
[0121] The second sending module 404 is used to send a second target key to the key, so that the key stores the second target key in a second random location of the target memory;
[0122] The third receiving module 405 is used to receive the second target key completion storage identifier and the second random location returned by the key.
[0123] Furthermore, the device also includes:
[0124] The third sending module is used to send matching completion information to the diagnostic instrument when it is detected that the first target key and the second target key match the key respectively;
[0125] The fourth receiving module is used to receive the target memory storage permission change completion identifier sent by the key, and send the target memory storage permission change completion identifier to the diagnostic instrument.
[0126] Furthermore, the third sending module includes;
[0127] The control submodule is used to control the first target key and the second target key to perform matching processing with the key respectively, so that when the key completes the matching, it sets the read permission of the target memory to key read, and changes the state of the target memory to the matching completed state.
[0128] The sending submodule is used to send matching completion information to the diagnostic instrument when the matching is detected as complete.
[0129] The fifth embodiment of this application relates to a key reading device, such as... Figure 6 As shown, Figure 6 This is a block diagram of a key reading device according to an exemplary embodiment, the device including the following modules:
[0130] The first acquisition module 501 is used to acquire user parameter information and vehicle code when the matching completion information is detected.
[0131] The second acquisition module 502 is used to acquire first encrypted data based on the user parameter information and the vehicle code;
[0132] The second sending module 503 is used to send the first encrypted data corresponding to the vehicle code to the key in a low-frequency manner, so that the key can decrypt the first encrypted data according to the reading key in the first target key.
[0133] The receiving module 504 is used to receive the second encrypted data sent by the key, wherein the second encrypted data is generated by the key encrypting the decrypted first encrypted data using the interaction key in the first target key;
[0134] The decryption module 505 is used to decrypt the second encrypted data according to the interaction key, and then encrypt the decrypted second encrypted data with the third target key to generate third encrypted data.
[0135] The judgment module 506 is used to send the third encrypted data to the server so that the server can determine whether the diagnostic instrument meets the reading conditions based on the third encrypted data.
[0136] The determination module 507 is used to determine whether to read the target key information based on the judgment result returned by the server.
[0137] Furthermore, the second acquisition module 502 includes:
[0138] The reading submodule is used to send the user parameter information to the server so that the server can verify the reading permission based on the user parameter information;
[0139] The receiving submodule is used to receive the first encrypted data corresponding to the vehicle code sent by the server when the server returns verification information that satisfies the read permission.
[0140] Furthermore, the device also includes:
[0141] The third sending module is used to send the read key information to the server when it is detected that the target key information has been read, so that the server sends a read request corresponding to the target key information to the key through the diagnostic instrument according to the target key information, and to encrypt the target key information;
[0142] An encryption receiving module is used to receive the encrypted target key information returned by the server;
[0143] The reading module is used to decrypt and read the encrypted target key information.
[0144] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0145] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0146] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0147] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0148] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0149] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0150] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0151] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0152] The technical solution provided by the present invention has been described in detail above. Specific examples have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A key write-in method applied to a vehicle end controller, characterized by, The method includes: Receive a first target key sent by the diagnostic tool, wherein the first target key is generated by the diagnostic tool based on the vehicle code; The first target key is sent to the key at a low frequency, so that the key stores the first target key in a first random location of the target memory; The first target key returned by the key completes the storage identifier and the first random location; Send a second target key to the key, so that the key stores the second target key in a second random location of the target memory; The second target key returned by the key completes the storage identifier and the second random location.
2. The method according to claim 1, characterized in that, After the step of receiving the second target key storage identifier and the second random location returned by the key, the method further includes: If the first target key and the second target key are detected to match the key respectively, a matching completion message is sent to the diagnostic instrument. The system receives the target memory storage permission change completion identifier sent by the key and sends the target memory storage permission change completion identifier to the diagnostic instrument.
3. The method according to claim 2, characterized in that, The step of sending a matching completion message to the diagnostic instrument when the first target key and the second target key are detected to match the key includes: The first target key and the second target key are controlled to be matched with the key respectively, so that when the key completes the matching, the read permission corresponding to the target memory is set to key read, and the state corresponding to the target memory is changed to the matching completed state; If the matching is detected as complete, a matching completion message is sent to the diagnostic instrument.
4. The method according to claim 1, characterized in that, The first target key includes a read key and an interaction key, wherein the read key is used to encrypt the target memory, and the interaction key is used to encrypt the data during the interaction between the key and the diagnostic instrument.
5. A key reading method, characterized in that, Applied to a diagnostic instrument, the diagnostic instrument is used to generate a first target key based on vehicle coding, the method comprising: Upon detecting that the matching completion information has been received, user parameter information and vehicle code are obtained; First encrypted data is obtained based on the user parameter information and the vehicle code; The first encrypted data corresponding to the vehicle code is sent to the key in a low-frequency manner, so that the key can decrypt the first encrypted data according to the reading key in the first target key; The key receives second encrypted data sent by the key, wherein the second encrypted data is generated by the key encrypting the decrypted first encrypted data using the interaction key in the first target key; The second encrypted data is decrypted according to the interaction key, and the decrypted second encrypted data is then encrypted with the third target key to generate the third encrypted data. The third encrypted data is sent to the server so that the server can determine whether the diagnostic instrument meets the reading conditions based on the third encrypted data. The determination of whether to read the target key information is based on the judgment result returned by the server.
6. The method according to claim 5, characterized in that, The step of obtaining the first encrypted data based on the user parameter information and vehicle code includes: Send the user parameter information to the server so that the server can verify read permissions based on the user parameter information; If the server returns verification information that satisfies the read permission, the server receives the first encrypted data corresponding to the vehicle code.
7. The method according to claim 6, characterized in that, After the step of determining whether to read the key information based on the judgment result returned by the server, the method further includes: If the reading of the target key information is detected, the read key information is sent to the server, so that the server sends a read request corresponding to the target key information to the key through the diagnostic instrument, and encrypts the target key information; Receive the encrypted target key information returned by the server; The encrypted target key information is then decrypted and read.
8. A key writing device, characterized in that, The device includes: The first receiving module is used to receive a first target key sent by the diagnostic instrument, wherein the first target key is generated by the diagnostic instrument based on the vehicle code; The first sending module is used to send the first target key to the key in a low-frequency manner, so that the key stores the first target key in a first random location of the target memory; The second receiving module is used to receive the first target key storage completion identifier and the first random location returned by the key; The second sending module is used to send a second target key to the key, so that the key stores the second target key in a second random location of the target memory; The third receiving module is used to receive the second target key completion storage identifier and the second random location returned by the key.
9. A key reading device, characterized in that, Applied to a diagnostic instrument, the diagnostic instrument being used to generate a first target key based on vehicle coding, the device comprising: The first acquisition module is used to acquire user parameter information and vehicle code when the matching completion information is detected; The second acquisition module is used to acquire first encrypted data based on the user parameter information and the vehicle code; The second sending module is used to send the first encrypted data corresponding to the vehicle code to the key in a low-frequency manner, so that the key can decrypt the first encrypted data according to the reading key in the first target key; The receiving module is used to receive the second encrypted data sent by the key, wherein the second encrypted data is generated by the key encrypting the decrypted first encrypted data using the interaction key in the first target key; The decryption module is used to decrypt the second encrypted data according to the interaction key, and then encrypt the decrypted second encrypted data with the third target key to generate third encrypted data. The judgment module is used to send the third encrypted data to the server so that the server can determine whether the diagnostic instrument meets the reading conditions based on the third encrypted data; The determination module is used to determine whether to read the target key information based on the judgment result returned by the server.
10. A vehicle, characterized in that, It includes the key writing device as described in claim 8, or the key reading device as described in claim 9.