Multi-key pairing method and device based on OBD communication, equipment and medium

CN118097822BActive Publication Date: 2026-08-11SUNGIANT AUTOMOTIVE ELECTRONICS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-06
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0003]上述钥匙学习配对方法通常适用于出厂汽车钥匙的学习配对,但对于钥匙已经损坏或是遗失的电动汽车,则需要将拆解钥匙以实现车辆与钥匙的连接,操作不便,不利于线下维护

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118097822B_ABST
    Figure CN118097822B_ABST
Patent Text Reader

Abstract

This invention provides a multi-key pairing method, apparatus, device, and medium based on OBD communication. The method includes: controlling the vehicle to enter a key learning process when the vehicle's environmental safety monitoring results are normal; obtaining the vehicle's VIN code and encrypting it to obtain a first SK code; generating key information messages based on the key combination operation of the key to be learned and sending them to the vehicle; when the key combination information matches the key combination information preset in the key learning process, verifying the validity of the key's IDE information; when the IDE information passes the validity verification, determining that the key to be learned has been successfully paired and updating the learning success count value of the key learning process; when the learning success count value is lower than the preset key value, controlling the vehicle to continuously receive key information messages sent by other keys to be learned until exiting the key learning process. This invention can improve the security and convenience of the key learning and pairing process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automotive electronics technology, and in particular to a multi-key pairing method, apparatus, device, and medium based on OBD communication. Background Technology

[0002] The existing electric vehicle key learning and pairing process generally requires setting up OBD interfaces on both the key and the vehicle. The key to be learned is connected to the vehicle through the OBD interface, and then a specific OBD communication protocol is used to interact with the vehicle. During the learning instruction time, pressing a specific button on the key to be learned or performing other specified operations will trigger the learning process, allowing the vehicle to record the key identification code to complete the key learning.

[0003] The key learning and pairing methods described above are generally suitable for learning and pairing factory-issued car keys. However, for electric vehicles with damaged or lost keys, the key needs to be disassembled to connect the vehicle and the key, which is inconvenient and hinders offline maintenance. Furthermore, during key learning and pairing, some criminals use hacking equipment to steal key signals and start the vehicle without the owner's authorization or launch phishing attacks, making the owner believe they are interacting with a legitimate entity in order to steal vehicle information. This poses certain security risks during the key learning and pairing process. Current key learning and pairing processes only support single-key learning. When the number of keys to be learned at once is large, multiple repetitive operations are required to learn and pair each key individually, resulting in low pairing efficiency and a high risk of errors due to the tedious and repetitive process. Summary of the Invention

[0004] The present invention aims to provide a multi-key pairing method, apparatus, device and medium based on OBD communication to solve the above-mentioned technical problems and improve the security and convenience of the key learning and pairing process.

[0005] To address the aforementioned technical problems, this invention provides a multi-key pairing method based on OBD communication, comprising:

[0006] Environmental security monitoring is performed based on the received extended session request. When the environmental security monitoring result is normal, the vehicle is controlled to enter the key learning process.

[0007] Obtain the VIN code of the vehicle and encrypt the VIN code based on a preset algorithm to obtain the first SK code;

[0008] Based on the combination key operation of the key to be learned, a key information message is generated and sent to the vehicle; wherein, the key information message includes: the IDE information of the key to be learned, the combination key information, and the key information message transmission count value;

[0009] When the key combination information matches the key combination information preset in the key learning process, the IDE information of the key to be learned is validated by combining the first SK code.

[0010] When the IDE information of the key to be learned passes the validity verification, it is determined that the key to be learned has been successfully paired and the learning success count of the key learning process is updated. When the learning success count is lower than the preset key to be learned value, the vehicle is controlled to continuously receive key information messages sent by other keys to be learned until the key learning process is exited.

[0011] The above solution differs from existing technologies that connect the key to be learned and the vehicle via the OBD interface. Instead, it establishes the connection through wireless communication via message transmission, improving the simplicity and operability of the key learning and pairing process. Simultaneously, monitoring the vehicle's current environment before entering the key learning process prevents accidental starting during pairing, reducing potential security risks. It also prevents unauthorized operation, protecting vehicle security. The vehicle's unique identification number (VIN) serves as verification information during the key pairing process, ensuring the key matches the vehicle's information and preventing the use of incorrect keys for unlocking, starting, or other operations, thus preventing theft or unauthorized use. Once one key to be learned is paired, there's no need to exit the current key learning process; the system can directly receive key input messages from other keys to be learned and re-pair, improving the efficiency of key pairing.

[0012] In one implementation, the environmental security monitoring based on the received extended session request, and controlling the vehicle to enter the key learning process when the environmental security monitoring result is normal, specifically includes:

[0013] Send an entry into extended session request message to the vehicle based on the OBD interface;

[0014] Based on the extended session request message, the vehicle is controlled to enter the extended session state and a first positive response message is sent back.

[0015] A request message to enter the first level of security is sent to the vehicle based on the first positive response message. When a second positive response message is received from the vehicle based on the request message to enter the first level of security, a first seed message is sent to the vehicle.

[0016] When the first seed message is consistent with the preset seed message of the vehicle, the vehicle is controlled to enter the first level of safety state and a third positive response message is sent back.

[0017] Based on the received third positive response message, a request message to enter the key learning process is sent to the vehicle.

[0018] In one implementation, before obtaining the vehicle's VIN code and encrypting it based on a preset algorithm, the method further includes detecting the current key slot availability of the vehicle, specifically:

[0019] When the vehicle enters the key learning process, the current key slot value of the vehicle is obtained;

[0020] When the current key availability value is greater than the preset key value to be learned in the key learning process, the learning success count value of the vehicle is initialized and the vehicle is controlled to receive the key information message sent by the key to be learned.

[0021] When the current key availability value is less than the preset key value to be learned in the key learning process, it is determined that the current vehicle key availability value is insufficient and the key learning process ends.

[0022] In one implementation, obtaining the vehicle's VIN code and encrypting the VIN code based on a preset algorithm to obtain a first SK code specifically includes:

[0023] The vehicle's VIN code is converted into a hexadecimal first array, and the first array is converted into a hash value of a first preset number of bits based on the MD5 algorithm;

[0024] The hash value is segmented and extracted to obtain SK factors with a second preset number of bits; wherein each SK factor is one byte and the second preset number of bits is less than 16;

[0025] The extracted SK factor is expanded based on the preset conversion formula to obtain the first SK code of 16 bytes.

[0026] The validity of the first SK code is verified. If the first SK code is not all 0x00 and not all 0xFF, it is determined that the first SK code is a valid value, and the vehicle is controlled to receive the key information message sent by the key to be learned.

[0027] In one implementation, when the key combination information matches the key combination information pre-set in the key learning process, the validity of the IDE information of the key to be learned is verified by combining the first SK code, specifically including:

[0028] Based on the received key information message, extract the combination key information of the key to be learned. When the combination key information is consistent with the combination key information preset in the key learning process, extract the IDE information in the key information message.

[0029] When the IDE information is consistent with the IDE information stored in the vehicle, the key to be learned is determined to be a key that has already been learned. The key verification code stored in the chip of the key to be learned is used to overwrite the key verification code stored in the vehicle's memory and the key learning process ends.

[0030] When the IDE information is inconsistent with the IDE information stored in the vehicle, the key to be learned is determined to be an unlearned key. The vehicle and the key to be learned are controlled to perform encryption operation on the first SK code based on a preset encryption algorithm to obtain the first encrypted number calculated by the key to be learned and the second encrypted number calculated by the vehicle. When the first encrypted number and the second encrypted number are consistent, the key to be learned is determined to have passed the validity verification, and the key verification code stored in the chip of the key to be learned is stored in the memory of the vehicle.

[0031] In one implementation, the multi-key pairing method based on OBD communication further includes erasing the key verification code stored in the vehicle's memory based on the received key information erasure request message, specifically:

[0032] Control the vehicle to enter a Level 1 security state and send a key information erasure request message to the vehicle;

[0033] Based on the key information erase request message, the vehicle is controlled to enter the key information erase process; wherein, the key information erase process is to reset the key verification code stored in the vehicle's memory to the initial value and recalculate the key verification code;

[0034] Write the initial value into the key to be erased.

[0035] Secondly, this application also provides a multi-key pairing device based on OBD communication, including a security monitoring module, an information encryption module, a message generation module, an information verification module, and a learning counting module;

[0036] The security monitoring module is used to perform environmental security monitoring based on the received extended session request, and when the environmental security monitoring result is normal, it controls the vehicle to enter the key learning process.

[0037] The information encryption module is used to obtain the VIN code of the vehicle and encrypt the VIN code based on a preset algorithm to obtain the first SK code;

[0038] The message generation module is used to generate key information messages based on the combination key operations of the key to be learned and send them to the vehicle; wherein, the key information message includes: the IDE information of the key to be learned, the combination key information, and the key information message transmission count value;

[0039] The information verification module is used to verify the validity of the IDE information of the key to be learned by combining the first SK code when the combination key information is consistent with the combination key information preset in the key learning process.

[0040] The learning count module is used to determine that the learning key has been successfully paired and update the learning success count value of the key learning process when the IDE information of the key to be learned passes the validity verification. When the learning success count value is lower than the preset key to be learned value, the module controls the vehicle to continuously receive key information messages sent by other keys to be learned until the key learning process is exited.

[0041] The above solution differs from existing technologies that connect the key to be learned and the vehicle via the OBD interface. Instead, it establishes the connection through wireless communication via message transmission, improving the simplicity and operability of the key learning and pairing process. Simultaneously, monitoring the vehicle's current environment before entering the key learning process prevents accidental starting during pairing, reducing potential security risks. It also prevents unauthorized operation, protecting vehicle security. The vehicle's unique identification number (VIN) serves as verification information during the key pairing process, ensuring the key matches the vehicle's information and preventing the use of incorrect keys for unlocking, starting, or other operations, thus preventing theft or unauthorized use. Once one key to be learned is paired, there's no need to exit the current key learning process; the system can directly receive key input messages from other keys to be learned and re-pair, improving the efficiency of key pairing.

[0042] In one implementation, the security monitoring module performs environmental security monitoring based on received extended session requests. When the environmental security monitoring result is normal, it controls the vehicle to enter the key learning process, specifically including:

[0043] Send an entry into extended session request message to the vehicle based on the OBD interface;

[0044] Based on the extended session request message, the vehicle is controlled to enter the extended session state and a first positive response message is sent back.

[0045] A request message to enter the first level of security is sent to the vehicle based on the first positive response message. When a second positive response message is received from the vehicle based on the request message to enter the first level of security, a first seed message is sent to the vehicle.

[0046] When the first seed message is consistent with the preset seed message of the vehicle, the vehicle is controlled to enter the first level of safety state and a third positive response message is sent back.

[0047] Based on the received third positive response message, a request message to enter the key learning process is sent to the vehicle.

[0048] In one implementation, before obtaining the vehicle's VIN code and encrypting it based on a preset algorithm, the method further includes detecting the current key slot availability of the vehicle, specifically:

[0049] When the vehicle enters the key learning process, the current key slot value of the vehicle is obtained;

[0050] When the current key availability value is greater than the preset key value to be learned in the key learning process, the learning success count value of the vehicle is initialized and the vehicle is controlled to receive the key information message sent by the key to be learned.

[0051] When the current key availability value is less than the preset key value to be learned in the key learning process, it is determined that the current vehicle key availability value is insufficient and the key learning process ends.

[0052] In one implementation, obtaining the vehicle's VIN code and encrypting the VIN code based on a preset algorithm to obtain a first SK code specifically includes:

[0053] The vehicle's VIN code is converted into a hexadecimal first array, and the first array is converted into a hash value of a first preset number of bits based on the MD5 algorithm;

[0054] The hash value is segmented and extracted to obtain SK factors with a second preset number of bits; wherein each SK factor is one byte and the second preset number of bits is less than 16;

[0055] The extracted SK factor is expanded based on the preset conversion formula to obtain the first SK code of 16 bytes.

[0056] The validity of the first SK code is verified. If the first SK code is not all 0x00 and not all 0xFF, it is determined that the first SK code is a valid value, and the vehicle is controlled to receive the key information message sent by the key to be learned.

[0057] In one implementation, when the key combination information matches the key combination information pre-set in the key learning process, the validity of the IDE information of the key to be learned is verified by combining the first SK code, specifically including:

[0058] Based on the received key information message, extract the combination key information of the key to be learned. When the combination key information is consistent with the combination key information preset in the key learning process, extract the IDE information in the key information message.

[0059] When the IDE information is consistent with the IDE information stored in the vehicle, the key to be learned is determined to be a key that has already been learned. The key verification code stored in the chip of the key to be learned is used to overwrite the key verification code stored in the vehicle's memory and the key learning process ends.

[0060] When the IDE information is inconsistent with the IDE information stored in the vehicle, the key to be learned is determined to be an unlearned key. The vehicle and the key to be learned are controlled to perform encryption operation on the first SK code based on a preset encryption algorithm to obtain the first encrypted number calculated by the key to be learned and the second encrypted number calculated by the vehicle. When the first encrypted number and the second encrypted number are consistent, the key to be learned is determined to have passed the validity verification, and the key verification code stored in the chip of the key to be learned is stored in the memory of the vehicle.

[0061] In one implementation, the OBD-based multi-key pairing device further includes erasing the key verification code stored in the vehicle's memory based on a received key information erasure request message, specifically:

[0062] Control the vehicle to enter a Level 1 security state and send a key information erasure request message to the vehicle;

[0063] Based on the key information erase request message, the vehicle is controlled to enter the key information erase process; wherein, the key information erase process is to reset the key verification code stored in the vehicle's memory to the initial value and recalculate the key verification code;

[0064] Write the initial value into the key to be erased.

[0065] Thirdly, this application also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the multi-key pairing method based on OBD communication as described above.

[0066] Fourthly, this application also provides a computer-readable storage medium, which includes a stored computer program, wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the multi-key pairing method based on OBD communication as described above. Attached Figure Description

[0067] Figure 1 This is a flowchart illustrating a multi-key pairing method based on OBD communication provided in one embodiment of the present invention;

[0068] Figure 2 This is a schematic diagram of a first SK code calculation process provided in one embodiment of the present invention;

[0069] Figure 3 This is a schematic diagram of SK factor extraction provided in one embodiment of the present invention;

[0070] Figure 4 This is a schematic diagram of a key information verification process provided in one embodiment of the present invention;

[0071] Figure 5 This is a schematic diagram of a process for validating IDE information provided in one embodiment of the present invention;

[0072] Figure 6 This is a schematic diagram of a multi-key pairing device based on OBD communication provided in one embodiment of the present invention. Detailed Implementation

[0073] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.

[0074] The terms "first" and "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.

[0075] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0076] First, some of the terms used in this application will be explained to facilitate understanding by those skilled in the art.

[0077] (1) Vehicle VIN Code: The Vehicle Identification Number (VIN) is a unique identifier consisting of 17 characters, used to uniquely identify a vehicle. Each VIN code is unique and provides important information about the vehicle manufacturer, model, year of manufacture, place of production, engine type, and serial number.

[0078] (2) MD5 algorithm: (Message Digest Algorithm 5) is a commonly used hash function used to convert data of arbitrary length into a fixed-length digest (usually 128 bits), which is usually represented as 32 hexadecimal characters.

[0079] Example 1

[0080] See Figure 1 , Figure 1 This is a flowchart illustrating a multi-key pairing method based on OBD communication according to an embodiment of the present invention. The embodiment of the present invention provides a multi-key pairing method based on OBD communication, including steps 101 to 105, each step being as follows:

[0081] Step 101: Perform environmental security monitoring based on the received extended session request. When the environmental security monitoring result is normal, control the vehicle to enter the key learning process.

[0082] In one embodiment, the step of performing environmental security monitoring based on the received extended session request, and controlling the vehicle to enter the key learning process when the environmental security monitoring result is normal, specifically includes: sending an extended session request message to the vehicle via the OBD interface; controlling the vehicle to enter the extended session state and feeding back a first positive response message according to the extended session request message; sending a request message to enter the first-level security level to the vehicle according to the first positive response message; when receiving a second positive response message fed back by the vehicle based on the request message to enter the first-level security level, sending a first seed message to the vehicle; when the first seed message is consistent with the vehicle's preset seed message, controlling the vehicle to enter the first-level security state and feeding back a third positive response message; and sending a request message to enter the key learning process to the vehicle based on the received third positive response message.

[0083] In this embodiment of the invention, a request message to enter an extended session is manually sent to the vehicle via the OBD interface. When the vehicle receives the request message, it enters the extended session state and sends a corresponding first positive response message to indicate that the vehicle has entered the extended session state. The extended session state refers to the persistence of the dialogue context and state during a conversation, allowing for seamless continuation of the dialogue in subsequent interactions, making the interaction more coherent and natural. After receiving the first positive response message from the vehicle, a request message for entry and security level is manually sent to the vehicle via the OBD interface. Upon receiving this message, the vehicle enters the first-level security level, sends a corresponding second positive response message, and begins waiting to receive a seed message. When the second positive response message from the vehicle is received, a seed message is manually sent to the vehicle for security verification. When the sent seed message matches the vehicle's preset seed message, the seed is deemed valid, the current communication is in progress, the vehicle is controlled to enter the first-level security state, and a corresponding third positive response message is sent. Upon receiving the third positive response message from the vehicle, it is determined that the environmental security monitoring is successful, and a request message for entering the key learning routine is manually sent to the vehicle. After receiving the request message for the key learning request routine, the vehicle will also send a response to indicate the current key learning process.

[0084] Step 102: Obtain the VIN code of the vehicle and encrypt the VIN code based on a preset algorithm to obtain the first SK code.

[0085] In one embodiment, before acquiring the VIN code of the vehicle and encrypting the VIN code based on a preset algorithm, the method further includes detecting the current key availability status of the vehicle. Specifically, when the vehicle enters the key learning process, the current key availability value of the vehicle is acquired; when the current key availability value is greater than the preset number of keys to be learned in the key learning process, the learning success count value of the vehicle is initialized and the vehicle is controlled to receive the key information message sent by the key to be learned; when the current key availability value is less than the preset number of keys to be learned in the key learning process, it is determined that the current key availability value of the vehicle is insufficient and the key learning process is terminated.

[0086] In this embodiment of the invention, after entering the key learning process, it is also necessary to determine whether the current key space value of the vehicle can learn the value of the key to be learned specified in this key learning process. If the current key space value is greater than the value of the key to be learned, the learning success technical value of this key learning process is initialized and the vehicle's VIN code is received. If the current key space value is less than the value of the key to be learned, the process ends and the exit reason is recorded. The process ends by overwriting the key verification code stored in the vehicle's memory with the key verification code stored in the chip of the key to be learned, controlling the vehicle to recalculate the key verification code stored in memory and store it, and the key learning process ends when the storage is completed.

[0087] In one embodiment, obtaining the vehicle's VIN code and encrypting it based on a preset algorithm to obtain a first SK code specifically includes: converting the vehicle's VIN code into a hexadecimal first array and converting the first array into a hash value of a first preset number of bits based on the MD5 algorithm; extracting segments from the hash value to obtain SK factors of a second preset number of bits; wherein each SK factor is one byte, and the second preset number of bits is less than 16; performing an expansion operation on the extracted SK factors based on a preset conversion formula to obtain a 16-byte first SK code; verifying the validity of the first SK code, and determining that the first SK code is a valid value when it is not all 0x00 and not all 0xFF, and controlling the vehicle to receive the key information message sent by the key to be learned.

[0088] See Figure 2 , Figure 2 This is a schematic diagram of a first SK code calculation process provided in one embodiment of the present invention. In this embodiment, the vehicle's VIN code is obtained and converted into a hexadecimal first array. Preferably, the vehicle's VIN code plus vehicle model platform information can also be used to convert it into a hexadecimal first array. After obtaining the VIN code, its validity needs to be verified. If the VIN code is neither all 0s nor all Fs, it is considered valid, and the vehicle VIN code is converted into a first SK code. The MD5 algorithm is used to convert the first array into a 128-bit hash value. The 128 hash values ​​are segmented and extracted, and 8 consecutive bits of hash value are selected as an SK factor. Six SK factors are selected from the 128 hash values. See also... Figure 3 , Figure 3This is a schematic diagram of SK factor extraction according to an embodiment of the present invention. In this embodiment, hash values ​​SK0, SK1, SK2, SK3, SK4, and SK5 are extracted, and each SK factor is one byte. SK0 is a hash value of 127, 126, 125, 124, 123, 122, 121, or 120 bits; SK1 is a hash value of 103, 102, 101, 100, 99, 98, 97, or 96 bits; SK2 is a hash value of 87, 86, 85, 84, 83, 82, 81, or 80 bits; SK3 is a hash value of 47, 46, 45, 44, 43, 42, 41, or 40 bits; SK4 is a hash value of 31, 30, 29, 28, 27, 26, 25, or 24 bits; and SK5 is a hash value of 11, 10, 9, 8, 7, 6, 5, or 4 bits. After the hash value is extracted, the extracted SK factor is expanded according to the preset conversion formula to obtain the 16-byte first SK code. See Table 1, which shows the conversion expressions for each byte in the first SK code.

[0089] Table 1

[0090] AESSK0 SK0 AESSK8 SK3 AESSK1 (SK1*SK4)^MaskValu AESSK9 SK2*SK5 AESSK2 SK1*SK2 AESSK10 SK1^MaskValue AESSK3 SK3^MaskValue AESSK11 (SK0*SK4)^MaskValu AESSK4 SK1*SK4 AESSK12 SK1 AESSK5 SK5 AESSK13 SK2 AESSK6 SK5^MaskValue AESSK14 SK1*SK3 AESSK7 SK0*SK4 AESSK15 SK4

[0091] MaskValue = 0x55. The final binary expression of each byte is calculated according to the above conversion formula to obtain the first SK code. The validity of the first SK code is then verified. If the first SK code is not all 0x00 and not all 0xFF, it is considered a valid value. The first SK code is then stored in the vehicle's memory, and the vehicle is controlled to receive key press information messages sent by the key to be learned. If the first SK code is not a valid value, the process ends. The specific process of ending the process has been described above and will not be repeated here.

[0092] Step 103: Generate a key information message based on the combination key operation of the key to be learned and send it to the vehicle; wherein, the key information message includes: the IDE information of the key to be learned, the combination key information, and the key information message transmission count value.

[0093] After a specific combination of keys is pressed on the key to be learned, a key information message is sent to the vehicle via a high-frequency signal. This key information message contains the key's IDE information, the pressed key combination information, and a key key information message transmission count.

[0094] Step 104: When the combination key information is consistent with the combination key information preset in the key learning process, the validity of the IDE information of the key to be learned is verified by combining the first SK code.

[0095] In one embodiment, when the combined key information matches the pre-set combined key information in the key learning process, the validity verification of the IDE information of the key to be learned is performed in conjunction with the first SK code. Specifically, this includes: extracting the combined key information of the key to be learned based on the received key information message; when the combined key information matches the pre-set combined key information in the key learning process, extracting the IDE information from the key message message; when the IDE information matches the IDE information stored in the vehicle, determining that the key to be learned is a learned key, and using the IDE information stored in the chip of the key to be learned... The key verification code overwrites the key verification code stored in the vehicle's memory and ends the key learning process; when the IDE information is inconsistent with the IDE information stored in the vehicle, the key to be learned is determined to be an unlearned key, and the vehicle and the key to be learned are controlled to perform encryption operations on the first SK code based on a preset encryption algorithm to obtain the first encrypted number calculated by the key to be learned and the second encrypted number calculated by the vehicle. When the first encrypted number and the second encrypted number are consistent, the key to be learned is determined to have passed the validity verification, and the key verification code stored in the chip of the key to be learned is stored in the vehicle's memory.

[0096] See Figure 4 , Figure 4 This is a schematic diagram of a key information verification process according to one embodiment of the present invention. In this embodiment, after the vehicle receives a message sent by the key to be learned, it extracts the key combination information from it, compares the extracted key combination information with the key combination information preset in the key learning process, and determines whether the key combination pressed by the key to be learned is consistent with the key combination preset in the key learning process. If they are consistent, the validity of the key's IDE information is further verified.

[0097] See Figure 5 , Figure 5This is a schematic diagram of an IDE information validity verification process provided in one embodiment of the present invention. If the IDE information of the key to be learned is consistent with the IDE information of the learned keys stored in the vehicle, the key is determined to be a learned key. The key verification code stored in the chip of the key is overwritten to the key verification code stored in the vehicle's memory. Then, the CRC of the key verification code stored in the vehicle is recalculated and stored. After storage, the key learning process ends. If the IDE information of the key to be learned is inconsistent with the IDE information of the learned keys stored in the vehicle, the key is determined to be an unlearned key. Then, 500ms after the key to be learned presses the combination button and releases it (the key button information message transmission count does not change), the vehicle is controlled to send the first SK code to the key to be learned via a high-frequency signal. The key to be learned is controlled to encrypt the received first SK code based on the AES encryption algorithm, and the vehicle also encrypts the first SK code based on the AES encryption algorithm. The first encrypted number obtained by the key to be learned is sent to the vehicle, and the vehicle performs a consistency judgment on the received first encrypted number and the second encrypted number obtained by its own encryption operation. If the first and second encryption numbers match, the key to be learned is deemed to have passed the validity check, and the key verification code stored in the chip of the key to be learned is stored in the vehicle's memory. If the first and second encryption numbers do not match or there is no response for an extended period, the process ends and the reason for exit is recorded. The specific process of ending the process has been described above and will not be repeated here.

[0098] Step 105: When the IDE information of the key to be learned passes the validity verification, it is determined that the key to be learned has been successfully paired and the learning success count of the key learning process is updated. When the learning success count is lower than the preset key to be learned value, the vehicle is controlled to continuously receive key information messages sent by other keys to be learned until the key learning process is exited.

[0099] Once the IDE information of the key to be learned passes validity verification and the key verification code stored in the chip of the key to be learned is stored in the vehicle's memory, the learning success count for this key learning process is incremented. When the learning success count is less than the number of keys to be learned in this key learning process, the vehicle is controlled to count and receive key information messages sent by other keys to be learned. Otherwise, the key learning process is considered to have ended and process termination processing is executed.

[0100] In one embodiment, the multi-key pairing method based on OBD communication further includes erasing the key verification code stored in the vehicle's memory based on the received key information erasure request message. Specifically, this involves: controlling the vehicle to enter a first-level security state and sending a key information erasure request message to the vehicle; controlling the vehicle to enter a key information erasure process based on the key information erasure request message; wherein the key information erasure process involves resetting the key verification code stored in the vehicle's memory to an initial value and recalculating the key verification code; and writing the recalculated key verification code into the key to be erased.

[0101] As an optimized embodiment of the present invention, the method further includes erasing the key verification code in the key. The process of controlling the vehicle to enter a Level 1 security state, including sending a message requesting entry into an extended session to the vehicle and then waiting for a feedback message from the vehicle to allow the vehicle to enter the Level 1 security state, has been described in detail above and will not be repeated here. Upon receiving the feedback message indicating that the vehicle has entered the Level 1 security state, a key information erasure request message is sent to the vehicle via the OBD interface. When the vehicle receives the key information erasure request message, it enters the key information erasure process, resetting the key verification code stored in the vehicle's memory to its initial value, recalculating the key verification code CRC, and writing the reset initial value into the chip of the key to be erased. After writing is complete, the key information erasure process ends.

[0102] In this embodiment of the invention, a multi-key pairing device based on OBD communication is also provided, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the above-described multi-key pairing method based on OBD communication.

[0103] In this embodiment of the invention, a computer-readable storage medium is also provided, which includes a stored computer program, wherein the computer program controls the device where the computer-readable storage medium is located to execute the above-described multi-key pairing method based on OBD communication when it is running.

[0104] For example, a computer program can be divided into one or more modules, one or more of which are stored in memory and executed by a processor to perform the present invention. The one or more modules can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in a multi-key pairing device based on OBD communication.

[0105] The OBD-based multi-key pairing device can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. The OBD-based multi-key pairing device may include, but is not limited to, a processor, memory, and display. Those skilled in the art will understand that the above components are merely examples of OBD-based multi-key pairing devices and do not constitute a limitation on OBD-based multi-key pairing devices. It may include more or fewer components, combinations of certain components, or different components. For example, the OBD-based multi-key pairing device may also include input / output devices, network access devices, buses, etc.

[0106] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the OBD-based multi-key pairing device, connecting all parts of the device via various interfaces and lines.

[0107] The memory can be used to store computer programs and / or modules. The processor implements various functions of the OBD-based multi-key pairing device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, at least one application program required for a function (such as sound playback function, text conversion function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, text message data, etc.). In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0108] In this invention, the multi-key pairing integration module based on OBD communication, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0109] This invention provides a multi-key pairing method based on OBD communication. Unlike existing technologies that connect the key to be learned and the vehicle via the OBD interface, this method establishes the connection between the key to be learned and the vehicle through wireless communication via message transmission, improving the simplicity and operability of the key learning and pairing process. Simultaneously, monitoring the vehicle's current environment before entering the key learning process prevents accidental vehicle start-up during key pairing, reducing potential security risks. It also prevents unauthorized personnel from operating the vehicle, protecting vehicle security. The vehicle's unique identification number (VIN) is used as verification information during the key pairing and learning process to ensure that the key being paired matches the vehicle's information, preventing the use of incorrect keys for unlocking, starting, or other operations, and preventing vehicle theft or unauthorized use. After one key to be learned is paired, there is no need to exit the current key learning process; the method can directly receive key information messages from other keys to be learned and re-enter the key learning and pairing process, improving the efficiency of key pairing.

[0110] Example 2

[0111] See Figure 6 , Figure 6 This is a schematic diagram of a multi-key pairing device based on OBD communication provided in one embodiment of the present invention. The embodiment of the present invention provides a multi-key pairing device based on OBD communication, including a security monitoring module 201, an information encryption module 202, a message generation module 203, an information verification module 204, and a learning counting module 205;

[0112] The security monitoring module 201 is used to perform environmental security monitoring based on the received extended session request, and when the environmental security monitoring result is normal, it controls the vehicle to enter the key learning process.

[0113] The information encryption module 202 is used to obtain the VIN code of the vehicle and encrypt the VIN code based on a preset algorithm to obtain the first SK code;

[0114] The message generation module 203 is used to generate a key information message based on the combination key operation of the key to be learned and send it to the vehicle; wherein, the key information message includes: the IDE information of the key to be learned, the combination key information, and the key information message transmission count value;

[0115] The information verification module 204 is used to verify the validity of the IDE information of the key to be learned by combining the first SK code when the combination key information is consistent with the combination key information preset in the key learning process.

[0116] The learning counting module 205 is used to determine that the learning pairing of the key to be learned is successful and update the learning success count value of the key learning process when the IDE information of the key to be learned passes the validity verification. When the learning success count value is lower than the preset key to be learned value, the module controls the vehicle to continuously receive key information messages sent by other keys to be learned until the key learning process is exited.

[0117] In one embodiment, the security monitoring module 201 is used to perform environmental security monitoring based on the received extended session request. When the environmental security monitoring result is normal, it controls the vehicle to enter the key learning process. Specifically, it includes: sending an extended session request message to the vehicle based on the OBD interface; controlling the vehicle to enter the extended session state and feeding back a first positive response message according to the extended session request message; sending a request message to the vehicle to enter the first-level security level according to the first positive response message; when receiving a second positive response message fed back by the vehicle based on the request message to enter the first-level security level, sending a first seed message to the vehicle; when the first seed message is consistent with the vehicle's preset seed message, controlling the vehicle to enter the first-level security state and feeding back a third positive response message; and sending a request message to the vehicle to enter the key learning process based on the received third positive response message.

[0118] In one embodiment, before acquiring the VIN code of the vehicle and encrypting the VIN code based on a preset algorithm, the method further includes detecting the current key availability status of the vehicle. Specifically, when the vehicle enters the key learning process, the current key availability value of the vehicle is acquired; when the current key availability value is greater than the preset number of keys to be learned in the key learning process, the learning success count value of the vehicle is initialized and the vehicle is controlled to receive the key information message sent by the key to be learned; when the current key availability value is less than the preset number of keys to be learned in the key learning process, it is determined that the current key availability value of the vehicle is insufficient and the key learning process is terminated.

[0119] In one embodiment, obtaining the vehicle's VIN code and encrypting it based on a preset algorithm to obtain a first SK code specifically includes: converting the vehicle's VIN code into a hexadecimal first array and converting the first array into a hash value of a first preset number of bits based on the MD5 algorithm; extracting segments from the hash value to obtain SK factors of a second preset number of bits; wherein each SK factor is one byte, and the second preset number of bits is less than 16; performing an expansion operation on the extracted SK factors based on a preset conversion formula to obtain a 16-byte first SK code; verifying the validity of the first SK code, and determining that the first SK code is a valid value when it is not all 0x00 and not all 0xFF, and controlling the vehicle to receive the key information message sent by the key to be learned.

[0120] In one embodiment, when the combined key information matches the pre-set combined key information in the key learning process, the validity verification of the IDE information of the key to be learned is performed in conjunction with the first SK code. Specifically, this includes: extracting the combined key information of the key to be learned based on the received key information message; when the combined key information matches the pre-set combined key information in the key learning process, extracting the IDE information from the key message message; when the IDE information matches the IDE information stored in the vehicle, determining that the key to be learned is a learned key, and using the IDE information stored in the chip of the key to be learned... The key verification code overwrites the key verification code stored in the vehicle's memory and ends the key learning process; when the IDE information is inconsistent with the IDE information stored in the vehicle, the key to be learned is determined to be an unlearned key, and the vehicle and the key to be learned are controlled to perform encryption operations on the first SK code based on a preset encryption algorithm to obtain the first encrypted number calculated by the key to be learned and the second encrypted number calculated by the vehicle. When the first encrypted number and the second encrypted number are consistent, the key to be learned is determined to have passed the validity verification, and the key verification code stored in the chip of the key to be learned is stored in the vehicle's memory.

[0121] In one embodiment, the multi-key pairing device based on OBD communication further includes erasing the key verification code stored in the vehicle's memory based on the received key information erasure request message. Specifically, this involves: controlling the vehicle to enter a first-level security state and sending a key information erasure request message to the vehicle; controlling the vehicle to enter a key information erasure process based on the key information erasure request message; wherein the key information erasure process involves resetting the key verification code stored in the vehicle's memory to an initial value and recalculating the key verification code; and writing the initial value into the key to be erased.

[0122] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0123] This invention provides a multi-key pairing device based on OBD communication. Unlike existing technologies that connect the key to be learned and the vehicle via the OBD interface, this device establishes the connection between the key to be learned and the vehicle through wireless communication via message transmission, improving the simplicity and operability of the key learning and pairing process. Simultaneously, monitoring the vehicle's current environment before entering the key learning process prevents accidental vehicle start-up during key pairing, reducing potential security risks. It also prevents unauthorized personnel from operating the vehicle, protecting vehicle security. The vehicle's unique identification number (VIN) is used as verification information during the key pairing and learning process to ensure that the key being paired matches the vehicle's information, preventing the use of incorrect keys for unlocking, starting, or other operations, and preventing vehicle theft or unauthorized use. After one key to be learned is paired, there is no need to exit the current key learning process; the device can directly receive key information messages from other keys to be learned and re-enter the key learning and pairing process, improving the efficiency of key pairing.

[0124] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make several improvements and substitutions without departing from the technical principles of the present invention, and these improvements and substitutions should also be considered within the scope of protection of the present invention.

Claims

1. A multi-key pairing method based on OBD communication, characterized in that, include: Environmental security monitoring is performed based on the received extended session request. When the environmental security monitoring result is normal, the vehicle is controlled to enter the key learning process. Obtain the VIN code of the vehicle and encrypt the VIN code based on a preset algorithm to obtain the first SK code; Based on the combination key operation of the key to be learned, a key information message is generated and sent to the vehicle; wherein, the key information message includes: the IDE information of the key to be learned, the combination key information, and the key information message transmission count value; When the key combination information matches the key combination information preset in the key learning process, the IDE information of the key to be learned is validated by combining the first SK code. When the IDE information of the key to be learned passes the validity verification, it is determined that the key to be learned has been successfully paired and the learning success count value of the key learning process is updated. When the learning success count value is lower than the preset key to be learned value, the vehicle is controlled to continuously receive key information messages sent by other keys to be learned until the key learning process is exited. When the key combination information matches the key combination information preset in the key learning process, the validity of the IDE information of the key to be learned is verified by combining the first SK code, specifically including: Based on the received key information message, extract the combination key information of the key to be learned. When the combination key information is consistent with the combination key information preset in the key learning process, extract the IDE information in the key information message. When the IDE information is consistent with the IDE information stored in the vehicle, the key to be learned is determined to be a key that has already been learned. The key verification code stored in the chip of the key to be learned is used to overwrite the key verification code stored in the vehicle's memory and the key learning process ends. When the IDE information is inconsistent with the IDE information stored in the vehicle, the key to be learned is determined to be an unlearned key. The vehicle and the key to be learned are controlled to perform encryption operation on the first SK code based on a preset encryption algorithm to obtain the first encrypted number calculated by the key to be learned and the second encrypted number calculated by the vehicle. When the first encrypted number and the second encrypted number are consistent, the key to be learned is determined to have passed the validity verification, and the key verification code stored in the chip of the key to be learned is stored in the memory of the vehicle.

2. The multi-key pairing method based on OBD communication as described in claim 1, characterized in that, The environmental security monitoring based on the received extended session request, and the control of the vehicle to enter the key learning process when the environmental security monitoring result is normal, specifically includes: Send an entry into extended session request message to the vehicle based on the OBD interface; Based on the extended session request message, the vehicle is controlled to enter the extended session state and a first positive response message is sent back. A request message to enter the first level of security is sent to the vehicle based on the first positive response message. When a second positive response message is received from the vehicle based on the request message to enter the first level of security, a first seed message is sent to the vehicle. When the first seed message is consistent with the preset seed message of the vehicle, the vehicle is controlled to enter the first level of safety state and a third positive response message is sent back. Based on the received third positive response message, a request message to enter the key learning process is sent to the vehicle.

3. The multi-key pairing method based on OBD communication as described in claim 1, characterized in that, Before obtaining the vehicle's VIN code and encrypting it based on a preset algorithm, the method further includes detecting the current key slot availability of the vehicle, specifically: When the vehicle enters the key learning process, the current key slot value of the vehicle is obtained; When the current key availability value is greater than the preset key value to be learned in the key learning process, the learning success count value of the vehicle is initialized and the vehicle is controlled to receive the key information message sent by the key to be learned. When the current key availability value is less than the preset key value to be learned in the key learning process, it is determined that the current vehicle key availability value is insufficient and the key learning process ends.

4. The multi-key pairing method based on OBD communication as described in claim 1, characterized in that, The step of obtaining the vehicle's VIN code and encrypting the VIN code based on a preset algorithm to obtain the first SK code specifically includes: The vehicle's VIN code is converted into a hexadecimal first array, and the first array is converted into a hash value of a first preset number of bits based on the MD5 algorithm; The hash value is segmented and extracted to obtain SK factors with a second preset number of bits; wherein each SK factor is one byte and the second preset number of bits is less than 16; The extracted SK factor is expanded based on the preset conversion formula to obtain the first SK code of 16 bytes. The validity of the first SK code is verified. If the first SK code is not all 0x00 and not all 0xFF, it is determined that the first SK code is a valid value, and the vehicle is controlled to receive the key information message sent by the key to be learned.

5. The multi-key pairing method based on OBD communication as described in claim 1, characterized in that, The OBD-based multi-key pairing method further includes erasing the key verification code stored in the vehicle's memory based on the received key information erasure request message, specifically: Control the vehicle to enter a Level 1 security state and send a key information erasure request message to the vehicle; Based on the key information erase request message, the vehicle is controlled to enter the key information erase process; wherein, the key information erase process is to reset the key verification code stored in the vehicle's memory to the initial value and recalculate the key verification code; Write the initial value into the key to be erased.

6. A multi-key pairing device based on OBD communication, characterized in that, It includes a security monitoring module, an information encryption module, a message generation module, an information verification module, and a learning counting module; The security monitoring module is used to perform environmental security monitoring based on the received extended session request, and when the environmental security monitoring result is normal, it controls the vehicle to enter the key learning process. The information encryption module is used to obtain the VIN code of the vehicle and encrypt the VIN code based on a preset algorithm to obtain the first SK code; The message generation module is used to generate key information messages based on the combination key operations of the key to be learned and send them to the vehicle; wherein, the key information message includes: the IDE information of the key to be learned, the combination key information, and the key information message transmission count value; The information verification module is used to verify the validity of the IDE information of the key to be learned by combining the first SK code when the combination key information is consistent with the combination key information preset in the key learning process. The learning count module is used to determine that the learning and pairing of the key to be learned is successful when the IDE information of the key to be learned passes the validity verification, and to update the learning success count value of the key learning process. When the learning success count value is lower than the preset key to be learned value, the module controls the vehicle to continuously receive key information messages sent by other keys to be learned until the key learning process is exited. When the key combination information matches the key combination information preset in the key learning process, the information verification module verifies the validity of the IDE information of the key to be learned by combining the first SK code, specifically including: The information verification module extracts the combination key information of the key to be learned based on the received key information message. When the combination key information is consistent with the combination key information preset in the key learning process, the IDE information in the key message message is extracted. When the IDE information is consistent with the IDE information stored in the vehicle, the key to be learned is determined to be a key that has already been learned. The key verification code stored in the chip of the key to be learned is used to overwrite the key verification code stored in the vehicle's memory and the key learning process ends. When the IDE information is inconsistent with the IDE information stored in the vehicle, the key to be learned is determined to be an unlearned key. The vehicle and the key to be learned are controlled to perform encryption operation on the first SK code based on a preset encryption algorithm to obtain the first encrypted number calculated by the key to be learned and the second encrypted number calculated by the vehicle. When the first encrypted number and the second encrypted number are consistent, the key to be learned is determined to have passed the validity verification, and the key verification code stored in the chip of the key to be learned is stored in the memory of the vehicle.

7. A multi-key pairing device based on OBD communication as described in claim 6, characterized in that, The security monitoring module is used to perform environmental security monitoring based on received extended session requests. When the environmental security monitoring result is normal, it controls the vehicle to enter the key learning process, specifically including: Send an entry into extended session request message to the vehicle based on the OBD interface; Based on the extended session request message, the vehicle is controlled to enter the extended session state and a first positive response message is sent back. A request message to enter the first level of security is sent to the vehicle based on the first positive response message. When a second positive response message is received from the vehicle based on the request message to enter the first level of security, a first seed message is sent to the vehicle. When the first seed message is consistent with the preset seed message of the vehicle, the vehicle is controlled to enter the first level of safety state and a third positive response message is sent back. Based on the received third positive response message, a request message to enter the key learning process is sent to the vehicle.

8. A terminal device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the multi-key pairing method based on OBD communication as described in any one of claims 1 to 5.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the multi-key pairing method based on OBD communication as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Vehicle remote control key learning method

    CN106447832A

  • Vehicle key learning method and system, vehicle-mounted control device and storage medium

    CN113269912A

  • Safety verification method, device and equipment based on vehicle controller and storage medium

    CN116366275A

  • System and method for pairing a key with a vehicle via a vehicle communications port by a dongle

    US20190392664A1