Nothing Special   »   [go: up one dir, main page]

CN114162080B - Anti-theft key matching method and device and computer equipment - Google Patents

Anti-theft key matching method and device and computer equipment Download PDF

Info

Publication number
CN114162080B
CN114162080B CN202111528863.2A CN202111528863A CN114162080B CN 114162080 B CN114162080 B CN 114162080B CN 202111528863 A CN202111528863 A CN 202111528863A CN 114162080 B CN114162080 B CN 114162080B
Authority
CN
China
Prior art keywords
value
key
ecu system
quotient
theft
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111528863.2A
Other languages
Chinese (zh)
Other versions
CN114162080A (en
Inventor
谭斌
谢嘉丰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Xingka Technology Co ltd
Original Assignee
Shenzhen Xingka Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Xingka Technology Co ltd filed Critical Shenzhen Xingka Technology Co ltd
Priority to CN202111528863.2A priority Critical patent/CN114162080B/en
Publication of CN114162080A publication Critical patent/CN114162080A/en
Application granted granted Critical
Publication of CN114162080B publication Critical patent/CN114162080B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B60VEHICLES IN GENERAL
    • B60RVEHICLES, VEHICLE FITTINGS, OR VEHICLE PARTS, NOT OTHERWISE PROVIDED FOR
    • B60R25/00Fittings or systems for preventing or indicating unauthorised use or theft of vehicles
    • B60R25/20Means to switch the anti-theft system on or off
    • B60R25/24Means to switch the anti-theft system on or off using electronic identifiers containing a code not memorised by the user
    • B60R25/241Means to switch the anti-theft system on or off using electronic identifiers containing a code not memorised by the user whereby access privileges are related to the identifiers
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B60VEHICLES IN GENERAL
    • B60RVEHICLES, VEHICLE FITTINGS, OR VEHICLE PARTS, NOT OTHERWISE PROVIDED FOR
    • B60R25/00Fittings or systems for preventing or indicating unauthorised use or theft of vehicles
    • B60R25/20Means to switch the anti-theft system on or off
    • B60R25/24Means to switch the anti-theft system on or off using electronic identifiers containing a code not memorised by the user
    • B60R25/248Electronic key extraction prevention
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mechanical Engineering (AREA)
  • Lock And Its Accessories (AREA)

Abstract

The application relates to the technical field of automobiles, and discloses an anti-theft key matching method, an anti-theft key matching device and computer equipment.

Description

Anti-theft key matching method and device and computer equipment
Technical Field
The application relates to the technical field of automobiles, in particular to an anti-theft key matching method, an anti-theft key matching device and computer equipment.
Background
With the continuous improvement of living standard of people, automobiles become an indispensable part of the life of people more and more, and car stealing has become one of the most common criminal behaviors in the city nowadays. The number of automobiles is increased, the number of stolen automobiles is increased year by year, which brings great unstable factors to the society, and the worry about the theft of the automobiles becomes a difficult problem which troubles each automobile user.
Along with the continuous development of modern automobile technology and the rapid progress of electronic technology, automobile anti-theft devices of original factories are installed on a plurality of automobiles, and the keys of some automobiles randomly change unlocking passwords by adding anti-theft chips, so that the aim of preventing the automobiles from being stolen is fulfilled. The existing automobile anti-theft electronic key system is provided with an ignition key with an ID password, the ID password is specified by the original factory and cannot be changed, the ID password is identified when the engine is started, the engine can be normally started after the ID password is confirmed to be correct, and otherwise, the engine can be automatically flameout after 3 seconds even if the engine is started. The system adopts an ignition key with a built-in wireless transmitting chip, when a transmitting key coil around an ignition switch receives an ID code signal transmitted from the ignition key transmitting chip, an anti-theft computer judges whether the ID code of the anti-theft computer is matched with a stored code, and if the ID code of the anti-theft computer is matched with the stored code, the engine can be started. The anti-theft electronic key system has a good anti-theft effect, but the ID code matching in the key is relatively complex, and the problems of complex operation, long time consumption and high cost exist when the key is lost or damaged and a new key is matched again.
Disclosure of Invention
The application mainly aims to provide an anti-theft key matching method, and aims to solve the technical problems that in the prior art, when a key is lost or damaged, the operation is complex, the consumed time is long, and the cost is high when a new key is matched again.
The application provides an anti-theft key matching method, is applied to diagnostic equipment, diagnostic equipment one end and the ECU system connection of vehicle, the other end and anti-theft key wireless connection include:
sending a first control signal to the ECU system to cause the diagnostic device to enter a diagnostic mode;
acquiring a first seed value of the ECU system to start the user authority of the ECU system;
calculating a first key value according to the first seed value, and transmitting the first key value to the ECU system, wherein the ECU system compares a second key value carried by the ECU system with the first key value, and transmits the comparison result to the diagnostic device;
receiving the comparison result, and detecting the learning state of the ECU system according to the comparison result, wherein the learning state comprises a learned state and an unlearned state;
if the learning state of the ECU system is detected to be an unlearned state according to the comparison result, acquiring a VIN code of the vehicle;
calculating a PIN code and an SK code according to the VIN code, and writing the PIN code and the SK code into the ECU system, wherein after the PIN code and the SK code are written, the ECU system generates a matching instruction;
and receiving the matching instruction, and sending the matching instruction to the anti-theft key so as to match the anti-theft key with the ECU system.
Preferably, after the receiving the matching instruction and sending the matching instruction to the anti-theft key so that the anti-theft key and the ECU system complete the matching step, the method further includes:
counting the number of the anti-theft keys matched by the ECU system;
judging whether the number of the anti-theft keys is larger than a first preset value or not;
if the number of the anti-theft keys is larger than a first preset value, feeding back a negative response to the ECU system, wherein the negative response is used for terminating the matching of the anti-theft keys;
and if the number of the anti-theft keys is not larger than a first preset value, returning to the step of writing the PIN code and the SK code into the ECU system to continuously match the anti-theft keys.
Preferably, after the receiving the matching instruction and sending the matching instruction to the anti-theft key so that the anti-theft key and the ECU system complete the matching step, the method further includes:
judging whether an ignition switch of the vehicle is turned on or not;
if the ignition switch of the vehicle is turned on, judging whether the function of a starting button of the vehicle is turned off;
and if the starting button function of the vehicle is closed, sending an execution instruction to the ECU system, wherein the execution instruction is used for synchronously matching an ID authentication box and a steering wheel steering lock in the ECU system so as to enable the anti-theft key to be associated with the ID authentication box and the steering wheel steering lock.
Preferably, the step of calculating a first key value from the first seed value comprises:
acquiring the length of a first seed value;
calculating the quotient of the length of the first seed value and 32 to obtain a first quotient value Na;
judging whether the first i value is smaller than or equal to the first quotient Na or not, wherein the initial value of the first i value is 0;
if the first i value is less than or equal to the first quotient Na, calculating a second key value, wherein the calculation formula is as follows:
W 2 [i 1 ]=([4*i 1 ]+[4*i 1 +1]+[4*i 1 +2]+[4*i 1 +3]);
i 1 =i 1 +1;
wherein, W 2 [i 1 ]Is a second key value, i 1 Is a first value of i;
returning to the step of judging whether the first i value is less than or equal to the first quotient Na;
if the first i value is larger than the first quotient Na, calculating the quotient of the length of the first seed value and 4 to obtain a second quotient Nb;
judging whether a second i value is smaller than a second quotient Nb, wherein the initial value of the second i value is a first quotient Na;
if the second i value is smaller than the second quotient Nb, calculating a third key value, wherein the calculation formula is:
i 2 =i 2 +1, wherein, i 2 Is the value of the second i, and is,
X=W 2 [i 2 -1]wherein X is W 2 [i 2 -1]A variable of (d);
if the value of X is not equal to 0
W 3 [i 2 ]=W 2 [i 2 -Na]^X;
Wherein, W 3 [i 2 ]For a first key value, the symbol "#" represents the difference operation;
returning to the step of judging whether the second i value is smaller than the second quotient Nb until the second i value is not smaller than the second quotient Nb;
calculating the first key value according to the second key value and the third key value, wherein the calculation formula is as follows:
W 1 [i]={W 2 [i 1 ],W 3 [i 2 ]};
wherein, the W 1 [i]Representing a first key value.
Preferably, the step of writing the PIN code and the SK code into the ECU system includes:
constructing a first authentication character string according to the PIN code and the SK code;
the first authentication character string is sent to the ECU system, wherein the ECU system compares a second authentication character string carried by the ECU system with the first authentication character string, and if the comparison is successful, an authentication success signal is sent to the diagnostic equipment;
and receiving the authentication success signal, and writing the PIN code and the SK code into the ECU system.
Preferably, after the step of feeding back the negative response to the ECU system if the number of the anti-theft keys is greater than a first preset value, the method further includes:
identifying the anti-theft key matched with the ECU system as a valid key;
acquiring a historical anti-theft key matched with the ECU system;
and setting the historical anti-theft key as a failure key.
The application still provides an anti-theft key matching device, anti-theft key matching device one end and the ECU headtotail of vehicle, the other end and anti-theft key wireless connection include:
the first sending module is used for sending a first control signal to the ECU system so as to enable the diagnostic equipment to enter a diagnostic mode;
the first acquisition module is used for acquiring a first seed value of the ECU system so as to start the user authority of the ECU system;
a first calculating module, configured to calculate a first key value according to the first seed value, and send the first key value to the ECU system, where the ECU system compares a second key value carried by itself with the first key value, and sends a comparison result to the diagnostic apparatus;
the first receiving module is used for receiving the comparison result and detecting the learning state of the ECU system according to the comparison result, wherein the learning state comprises a learned state and an unlearned state;
the second acquisition module is used for acquiring the VIN code of the vehicle if the learning state of the ECU system is detected to be an unlearned state according to the comparison result;
the write-in module is used for calculating a PIN code and an SK code according to the VIN code and writing the PIN code and the SK code into the ECU system, wherein the ECU system generates a matching instruction after the PIN code and the SK code are written in;
and the second receiving module is used for receiving the matching instruction and sending the matching instruction to the anti-theft key so as to enable the anti-theft key to be matched with the ECU system.
Preferably, the first calculation module includes:
a first obtaining unit, configured to obtain a length of a first seed value;
the first calculating module is used for calculating the quotient of the length of the first seed value and 32 to obtain a first quotient value Na;
a first judging unit, configured to judge whether the first i value is less than or equal to the first quotient Na, where an initial value of the first i value is 0;
a second calculating unit, configured to calculate a second key value if the first i value is less than or equal to the first quotient Na, where a calculation formula is:
W 2 [i 1 ]=([4*i 1 ]+[4*i 1 +1]+[4*i 1 +2]+[4*i 1 +3]);
i 1 =i 1 +1;
wherein, W 2 [i 1 ]Is a second key value, i 1 Is a first value of i;
a first returning unit configured to return to the step of determining whether the first i value is less than or equal to the first quotient Na;
a third calculating module, configured to calculate a quotient between the length of the first seed value and 4 to obtain a second quotient Nb if the first i value is greater than the first quotient Na;
a second determining unit, configured to determine whether a second i value is smaller than a second quotient Nb, where an initial value of the second i value is a first quotient Na;
a fourth calculating module, configured to calculate a third key value if the second i value is smaller than the second quotient Nb, where a calculation formula is:
i 2 =i 2 +1 wherein, i 2 Is the value of the second i, and,
X=W 2 [i 2 -1]wherein X is W 2 [i 2 -1]A variable of (d);
if the value of X is not equal to 0
W 3 [i 2 ]=W 2 [i 2 -Na]^X;
Wherein, W 3 [i 2 ]The symbol "#" represents the differential operation for the first secret key value;
a second returning unit, configured to return to the step of determining whether the second i value is smaller than a second quotient Nb until the second i value is not smaller than the second quotient Nb;
a fifth calculating module, configured to calculate the first key value according to the second key value and the third key value, where a calculation formula is:
W 1 [i]={W 2 [i 1 ],W 3 [i 2 ]};
wherein, the W 1 [i]Representing a first key value.
The application also provides computer equipment which comprises a memory and a processor, wherein the memory stores computer programs, and the processor realizes the steps of the anti-theft key matching method when executing the computer programs.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the above-mentioned anti-theft key matching method.
The beneficial effect of this application does: the diagnostic device can enter a diagnostic mode by sending a first control signal to the ECU system, the first seed value of the ECU system is obtained, the first key value is calculated according to the first seed value, the ECU system compares the second key value of the ECU system with the first key value sent by the diagnostic device, if the comparison is successful, the first key value is recognized by the ECU system, the matching of the anti-theft key is allowed to be carried out, therefore, the diagnostic device can detect the learning state of the ECU system, if the learning state of the ECU system is the non-learning state, the VIN code of the vehicle is obtained, the PIN code and the SK code are calculated according to the VIN code within the preset time, the PIN code and the SK code are written into the ECU system, and after the writing is completed, the ECU system sends a matching instruction to the anti-theft key to complete the matching of the anti-theft key. The user can be with waiting to match the key and pressing close to the start button (the antenna area in the back is close to), if the ECU system write in successfully, can control the green lamp of SSB and light 2S, if write in the failure, can control the red pilot lamp of SSB and light 2S. Like this, can be convenient for the user in time know whether current anti-theft key matches successfully with the ECU system, do not need the user to do extra operation to anti-theft key, only need press close to the start button can, easy operation, it is consuming time shorter, improved the efficiency that anti-theft key matches.
Drawings
Fig. 1 is a schematic flow chart of a security key matching method according to an embodiment of the present application.
Fig. 2 is a schematic structural diagram of an anti-theft key matching device according to an embodiment of the present application.
Fig. 3 is a schematic diagram of an internal structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
As shown in fig. 1 to 3, the present application provides an anti-theft key matching method applied to a diagnostic device, one end of which is connected to an ECU system of a vehicle, and the other end of which is wirelessly connected to an anti-theft key, including:
s1, sending a first control signal to the ECU system to enable the diagnostic equipment to enter a diagnostic mode;
s2, acquiring a first seed value of the ECU system to start the user authority of the ECU system;
s3, calculating a first key value according to the first seed value, and sending the first key value to the ECU system, wherein the ECU system compares a second key value carried by the ECU system with the first key value, and sends a comparison result to the diagnostic equipment;
s4, receiving the comparison result, and detecting the learning state of the ECU system according to the comparison result, wherein the learning state comprises a learned state and an unlearned state;
s5, if the learning state of the ECU system is detected to be an unlearned state according to the comparison result, acquiring a vehicle VIN code;
s6, calculating a PIN code and an SK code according to the VIN code, and writing the PIN code and the SK code into the ECU system, wherein after the PIN code and the SK code are written, the ECU system generates a matching instruction;
and S7, receiving the matching instruction, and sending the matching instruction to the anti-theft key so as to enable the anti-theft key to be matched with the ECU system.
As described in the above steps S1 to S7, the diagnostic device may enter the diagnostic mode by sending a first control signal to the ECU system, the first control signal may be a UDS (unified diagnostic service) command, since the control units of the ECU system all enable the UDS service, the ECU system may send a first control signal based on the UDS to the ECU system, so that the diagnostic device may control the ECU system, the ECU system may compare the second key value of the ECU system with the first key value sent by the diagnostic device by obtaining a first seed value of the ECU system and calculating the first key value according to the first seed value, if the comparison is successful, the first key value is recognized by the ECU system, and the matching of the immobilizer key is allowed, so that the diagnostic device may detect the learning state of the ECU system, if the detection result is the learned state, the ECU system may already be matched with some immobilizer keys, if the learning state of the ECU system is not learned state, the ECU may indicate that the ECU system is in the original state or the immobilizer system is in the learning state, the learning code, the VIN may be matched with the immobilizer system, and the obtained by writing the learning code, and the learning code of the immobilizer system may be selected, and the learning code may be written into the vehicle by writing the learning state, and the learning of the immobilizer system may be obtained by writing the learning code, and the learning state. Specifically, when writing in PIN code and SK code, the user can press close the key to be matched to the start button (the back antenna area is pressed close), if the ECU system writes in successfully, the SSB green light can be controlled to light 2S, and if the writing in fails, the SSB red indicator light can be controlled to light 2S. Like this, can be convenient for the user in time know whether current anti-theft key matches successfully with the ECU system, do not need the user to do extra operation to anti-theft key, only need press close to the start button can, easy operation, it is consuming time shorter, improved the efficiency that anti-theft key matches. Preferably, if the ECU system is in a learned state, it can be restored to an unlearned state by a reset function.
In one embodiment, after receiving the matching instruction and sending the matching instruction to the anti-theft key so that the anti-theft key and the ECU system complete the matching step S7, the method further includes:
s701, counting the number of the anti-theft keys matched by the ECU system;
s702, judging whether the number of the anti-theft keys is larger than a first preset value or not;
s703, if the number of the anti-theft keys is larger than a first preset value, feeding back a negative response to the ECU system, wherein the negative response is used for terminating the matching of the anti-theft keys;
and S704, if the number of the anti-theft keys is not larger than a first preset value, returning to the step of writing the PIN code and the SK code into the ECU system to continuously match the anti-theft keys.
As described in steps S701 to S704, after matching of one anti-theft key is completed, the current number of anti-theft keys may be counted, since there may be multiple users in one vehicle, multiple keys may be matched, but the ECU system may have a maximum allowable matching number, so that the maximum allowable matching number of the ECU system, that is, a first preset value, may be obtained first, and then it may be determined whether the current number of anti-theft keys exceeds the first preset value, if not, the step of writing the PIN code and the SK code into the ECU system may be returned to, and the PIN code and the SK code may be directly written into the ECU system without sending a first control signal to the ECU system, so that the step S1 of entering the diagnostic mode by the diagnostic device is started, that is, after the ECU system indicates approval to the diagnostic device, the multiple (not exceeding the first preset value) anti-theft keys may be directly matched, which may simplify the matching process of multiple anti-theft keys, reduce the matching time of multiple anti-theft keys, and save time and operation cost.
In one embodiment, after the receiving the matching instruction and sending the matching instruction to the anti-theft key so that the anti-theft key and the ECU system complete the matching step S7, the method further includes:
s705, judging whether an ignition switch of the vehicle is turned on or not;
s706, if the ignition switch of the vehicle is turned on, judging whether the function of a starting button of the vehicle is turned off;
and S707, if the starting button function of the vehicle is turned off, sending an execution instruction to the ECU system, wherein the execution instruction is used for synchronously matching an ID authentication box and a steering wheel steering lock in the ECU system, so that the anti-theft key is associated with the ID authentication box and the steering wheel steering lock.
As described in the above steps S701 to S707, the anti-theft keys of certain brands of vehicles need to be matched with an ID authentication box and a steering wheel lock in the ECU system in addition to the ECU system (matched with PEPS (passive entry passive start, keyless entry and start system)) so as to protect the security of the vehicle to a greater extent; therefore, in order to enable the diagnostic device in this embodiment to match the anti-theft keys for most of the vehicle models on the market, after the anti-theft keys are successfully matched with the ECU system, the anti-theft keys can be associated with the ID authentication box and the steering wheel lock based on the brand and model of the vehicle, so that the anti-theft keys can be approved by the ID authentication box and the steering wheel lock, and thus the matching of the anti-theft keys is completed.
In one embodiment, the step S3 of calculating a first key value from said first seed value comprises:
s301, acquiring the length of a first seed value;
s302, calculating the quotient of the length of the first seed value and 32 to obtain a first quotient value Na;
s303, judging whether the first i value is smaller than or equal to the first quotient Na or not, wherein the initial value of the first i value is 0;
s304, if the first i value is less than or equal to the first quotient Na, calculating a second key value, wherein the calculation formula is as follows:
W 2 [i 1 ]=([4*i 1 ]+[4*i 1 +1]+[4*i 1 +2]+[4*i 1 +3]);
i 1 =i 1 +1;
wherein, W 2 [i 1 ]Is a second key value, i 1 Is a first value of i;
s305, returning to the step of judging whether the first i value is less than or equal to the first quotient Na;
s306, if the first i value is larger than the first quotient Na, calculating the quotient of the length of the first seed value and 4 to obtain a second quotient Nb;
s307, judging whether a second i value is smaller than a second quotient Nb, wherein the initial value of the second i value is a first quotient Na;
s308, if the second i value is smaller than the second quotient Nb, calculating a third key value, wherein the calculation formula is as follows:
i 2 =i 2 +1, wherein, i 2 Is the value of the second i, and,
X=W 2 [i 2 -1]wherein X is W 2 [i 2 -1]A variable of (d);
s309, if the value of X is not equal to 0, then
W 3 [i 2 ]=W 2 [i 2 -Na]^X;
Wherein, W 3 [i 2 ]The symbol "#" represents the differential operation for the first secret key value;
s310, returning to the step of judging whether the second i value is smaller than the second quotient Nb until the second i value is not smaller than the second quotient Nb;
s311, calculating the first key value according to the second key value and the third key value, wherein the calculation formula is:
W 1 [i]={W 2 [i 1 ],W 3 [i 2 ]};
wherein, the W 1 [i]Representing a first key value.
As described in the above steps S301 to S311, the first key value can be accurately calculated by the above calculation formula, and for the sake of understanding, the following example is provided: for example, the first seed value is {2, 27,1,0,55 \8230;, 71}, and assuming that the first seed value has a length of 128 bits (including 128 bit values), the first quotient Na is 4, the first i value starts from 0, and the second key value W is smaller than 4 since 0 is smaller than 4 2 [0]=([4*0]+[4*0+1]+[4*0+2]+[4*0+3]) =6, thereafter, i 1 =i 1 +1, the first i value is equal to 1, at this time, it is determined again whether 1 is less than 4, if so, then W 2 [1]=([4*1]+[4*1+1]+[4*1+2]+[4*1+3]) =22, thereafter, i 1 =i 1 +1, if the first i value is equal to 1, returning to the step of judging whether the first i value is less than or equal to the first quotient Na, and calculating W in sequence 2 [2]、W 2 [3]、W 2 [4]8230until the first i value is greater than the first quotient Na; at this time, the quotient of the length of the first seed value and 4 is calculated to obtain a second quotient value Nb, the second quotient value is 32, it is determined whether the second i value is smaller than the second quotient value Nb, at this time, an initial value of the second i value is a first quotient value Na, that is, an initial value of the second i valueThe value of Na is equal to 4, whether 4 is less than 32 is judged, if so, i 2 =i 2 +1, i.e. i 2 Equal to 5, and then X = W 2 [i 2 -1]Calculating the value of X, W 2 [i 2 -1]=W 2 [5-1]=W 2 [4]Then the value of X is equal to when i 1 When it is 4, W 2 [4]Value of (1), assuming W 2 [4]Is 58, then W 3 [5]=W 2 [5-4]Λ 58, then W 3 [5]=W 2 [1]F 58=22 ^ 58, and then returning to the step of judging whether the second i value is smaller than the second quotient Nb until the second i value is not smaller than the second quotient Nb, so as to obtain W 3 [5]、W 3 [6]、W 3 [7]、W 3 [8]、W 3 [9]Then the first key value is equal to W 2 [i 1 ]And W 3 [i 2 ]Set of (1), i.e. W 1 [i]={W 2 [0],W 2 [1],W 2 [2],W 2 [3],W 2 [4],W 3 [5]、W 3 [6]、W 3 [7]、W 3 [8]、W 3 [9]…}
In one embodiment, the step S6 of writing the PIN code and the SK code to the ECU system includes:
s61, constructing a first authentication character string according to the PIN code and the SK code;
s62, the first authentication character string is sent to the ECU system, wherein the ECU system compares a second authentication character string carried by the ECU system with the first authentication character string, and if the comparison is successful, an authentication success signal is sent to the diagnostic equipment;
and S63, receiving the authentication success signal, and writing the PIN code and the SK code into the ECU system.
As described in steps S61-S63 above, the authority to write the PIN code and the SK code to the ECU system can be obtained by constructing the first authentication string, which facilitates writing the PIN code and the SK code in the ECU system. The SK (AccessKeyId) code is used for marking a user (diagnostic equipment), if the first authentication character string and the second authentication character string are successfully compared, the ECU system can consider that the diagnostic equipment has the appointed operation authority, so that the ECU system can execute corresponding steps according to instructions of the diagnostic equipment without acquiring extra authority, and for writing the PIN code, the SK code can be written to improve the matching efficiency of the anti-theft key.
In one embodiment, after the step S703 of feeding back a negative response to the ECU system if the number of the anti-theft keys is greater than a first preset value, the method further includes:
s7031, identifying the anti-theft key matched with the ECU system as a valid key;
s7032, obtaining a history anti-theft key matched with the ECU system;
s7033, the historical antitheft key is set as a revocation key.
As described in the foregoing steps S7031 to S7033, in order to prevent the matched anti-theft key from unlocking the vehicle, the user may identify the currently matched anti-theft key as a valid key and set the previously matched anti-theft key as a disabled key, so as to prevent other people from unlocking the vehicle after picking up the previous anti-theft key, and thus the lost key may be shielded; preferably, if the user finds a lost key, the user may re-register the key, i.e., repeat steps S1-S7.
The application still provides an anti-theft key matching device, anti-theft key matching device one end and the ECU headtotail of vehicle, the other end and anti-theft key wireless connection include:
the first sending module 1 is used for sending a first control signal to the ECU system so as to enable the diagnostic equipment to enter a diagnostic mode;
the first acquisition module 2 is used for acquiring a first seed value of the ECU system so as to start the user authority of the ECU system;
a first calculating module 3, configured to calculate a first key value according to the first seed value, and send the first key value to the ECU system, where the ECU system compares a second key value of the ECU with the first key value, and sends a comparison result to the diagnostic apparatus;
the first receiving module 4 is used for receiving the comparison result and detecting the learning state of the ECU system according to the comparison result, wherein the learning state comprises a learned state and an unlearned state;
the second obtaining module 5 is configured to obtain a vehicle VIN code if it is detected that the learning state of the ECU system is an unlearned state according to the comparison result; the learned state: resetting the PEPSECU to the unlearned "function restores the ECU to the unlearned state.
The writing module 6 is configured to calculate a PIN code and an SK code according to the VIN code, and write the PIN code and the SK code into the ECU system, where the ECU system generates a matching instruction after the writing of the PIN code and the SK code is completed;
and the second receiving module 7 is used for receiving the matching instruction and sending the matching instruction to the anti-theft key so as to match the anti-theft key with the ECU system.
In one embodiment, the anti-theft key matching device further includes:
the counting module is used for counting the number of the anti-theft keys matched by the ECU system;
the first judgment module is used for judging whether the number of the anti-theft keys is larger than a first preset value or not;
the feedback module is used for feeding back a negative response to the ECU system if the number of the anti-theft keys is larger than a first preset value, wherein the negative response is used for terminating the matching of the anti-theft keys;
and the return module is used for returning to the step of writing the PIN code and the SK code into the ECU system to continuously match the anti-theft keys if the number of the anti-theft keys is not larger than a first preset value.
In one embodiment, the antitheft key matching device further comprises:
the second judgment module is used for judging whether an ignition switch of the vehicle is turned on or not;
the third judgment module is used for judging whether the function of a starting button of the vehicle is closed or not if an ignition switch of the vehicle is turned on;
and the second sending module is used for sending an execution instruction to the ECU system if the starting button function of the vehicle is closed, wherein the execution instruction is used for synchronously matching the ID authentication box and the steering wheel steering lock in the ECU system so as to enable the anti-theft key to be associated with the ID authentication box and the steering wheel steering lock.
In one embodiment, the first calculation module 3 comprises:
a first obtaining unit, configured to obtain a length of a first seed value;
the first calculating module is used for calculating the quotient of the length of the first seed value and 32 to obtain a first quotient value Na;
a first judging unit, configured to judge whether the first i value is less than or equal to the first quotient Na, where an initial value of the first i value is 0;
a second calculating unit, configured to calculate a second key value if the first i value is less than or equal to the first quotient Na, where a calculation formula is:
W 2 [i 1 ]=([4*i 1 ]+[4*i 1 +1]+[4*i 1 +2]+[4*i 1 +3]);
i 1 =i 1 +1;
wherein, W 2 [i 1 ]Is a second key value, i 1 Is a first value of i;
a first returning unit configured to return to the step of determining whether the first i value is less than or equal to the first quotient Na;
a third calculating module, configured to calculate a quotient between the length of the first seed value and 4 to obtain a second quotient Nb if the first i value is greater than the first quotient Na;
a second determining unit, configured to determine whether a second i value is smaller than a second quotient Nb, where an initial value of the second i value is a first quotient Na;
a fourth calculating module, configured to calculate a third key value if the second i value is smaller than the second quotient Nb, where a calculation formula is:
i 2 =i 2 +1 wherein, i 2 Is the value of the second i, and is,
X=W 2 [i 2 -1]wherein X is W 2 [i 2 -1]The variables of (a);
if the value of X is not equal to 0
W 3 [i 2 ]=W 2 [i 2 -Na]^X;
Wherein, W 3 [i 2 ]For a first key value, the symbol "#" represents the difference operation;
a second returning unit, configured to return to the step of determining whether the second i value is smaller than a second quotient Nb until the second i value is not smaller than the second quotient Nb;
a fifth calculating module, configured to calculate the first key value according to the second key value and the third key value, where the calculation formula is:
W 1 [i]={W 2 [i 1 ],W 3 [i 2 ]};
wherein, the W 1 [i]Representing a first key value.
In one embodiment, the write module 6 includes:
the construction unit is used for constructing a first authentication character string according to the PIN code and the SK code;
the comparison unit is used for sending the first authentication character string to the ECU system, wherein the ECU system compares a second authentication character string carried by the ECU system with the first authentication character string, and if the comparison is successful, an authentication success signal is sent to the diagnostic equipment;
and the writing unit is used for receiving the authentication success signal and writing the PIN code and the SK code into the ECU system.
In one embodiment, the antitheft key matching device further comprises:
the identification module is used for identifying the anti-theft key matched with the ECU system as a valid key;
the third acquisition module is used for acquiring a historical anti-theft key matched with the ECU system;
and the setting module is used for setting the historical anti-theft key as a disabled key.
As shown in fig. 3, the present application further provides a computer device, which may be a server, and the internal structure of the computer device may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operating system and the running of computer programs in the non-volatile storage medium. The database of the computer device is used to store all data required for the process of the anti-theft key matching method. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a security key matching method.
Those skilled in the art will appreciate that the architecture shown in fig. 3 is only a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects may be applied.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements any one of the above-mentioned anti-theft key matching methods.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware related to instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct bused dynamic RAM (DRDRAM), and bused dynamic RAM (RDRAM).
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of another identical element in a process, apparatus, article, or method comprising the element.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (8)

1. An antitheft key matching method is applied to a diagnostic device, one end of the diagnostic device is connected with an ECU system of a vehicle, and the other end of the diagnostic device is wirelessly connected with an antitheft key, and the method is characterized by comprising the following steps:
sending a first control signal to the ECU system to cause the diagnostic device to enter a diagnostic mode;
acquiring a first seed value of the ECU system to start the user authority of the ECU system;
calculating a first key value according to the first seed value, and transmitting the first key value to the ECU system, wherein the ECU system compares a second key value carried by the ECU system with the first key value, and transmits the comparison result to the diagnostic device;
receiving the comparison result, and detecting the learning state of the ECU system according to the comparison result, wherein the learning state comprises a learned state and an unlearned state;
if the learning state of the ECU system is detected to be an unlearned state according to the comparison result, acquiring a VIN code of the vehicle;
calculating a PIN code and an SK code according to the VIN code, and writing the PIN code and the SK code into the ECU system, wherein after the PIN code and the SK code are written, the ECU system generates a matching instruction;
receiving the matching instruction, and sending the matching instruction to the anti-theft key so as to match the anti-theft key with the ECU system;
the step of calculating a first key value from said first seed value comprises:
acquiring the length of a first seed value;
calculating the quotient of the length of the first seed value and 32 to obtain a first quotient value Na;
judging whether a first i value is smaller than or equal to the first quotient Na or not, wherein the initial value of the first i value is 0;
if the first i value is less than or equal to the first quotient Na, calculating a second key value, wherein the calculation formula is as follows:
W 2 [i 1 ]=([4*i 1 ]+[4*i 1 +1]+[4*i 1 +2]+[4*i 1 +3]);
i 1 =i 1 +1;
wherein, W 2 [i 1 ]Is a second key value, i 1 Is a first value of i;
returning to the step of determining whether the first i value is less than or equal to the first quotient Na;
if the first i value is larger than the first quotient value Na, calculating the quotient of the length of the first seed value and 4 to obtain a second quotient value Nb;
judging whether a second i value is smaller than a second quotient Nb, wherein the initial value of the second i value is a first quotient Na;
if the second i value is smaller than a second quotient Nb, calculating a third key value, wherein the calculation formula is as follows:
i 2 =i 2 +1, wherein, i 2 Is the value of the second i, and,
X=W 2 [i 2 -1]wherein X is W 2 [i 2 -1]A variable of (d);
if the value of X is not equal to 0
W 3 [i 2 ]=W 2 [i 2 -Na]^X;
Wherein, W 3 [i 2 ]For a first key value, the symbol "#" represents the difference operation;
returning to the step of judging whether the second i value is smaller than the second quotient Nb until the second i value is not smaller than the second quotient Nb;
calculating the first key value according to the second key value and the third key value, wherein the calculation formula is as follows:
W 1 [i]={W 2 [i 1 ],W 3 [i 2 ]};
wherein, the W 1 [i]Representing a first key value.
2. The method according to claim 1, wherein after receiving the matching command and sending the matching command to the anti-theft key so that the anti-theft key and the ECU system complete the matching step, the method further comprises:
counting the number of the anti-theft keys matched by the ECU system;
judging whether the number of the anti-theft keys is larger than a first preset value or not;
if the number of the anti-theft keys is larger than a first preset value, feeding back a negative response to the ECU system, wherein the negative response is used for terminating the matching of the anti-theft keys;
and if the number of the anti-theft keys is not larger than a first preset value, returning to the step of writing the PIN code and the SK code into the ECU system to continue matching the anti-theft keys.
3. The method according to claim 1, wherein after receiving the matching command and sending the matching command to the anti-theft key so that the anti-theft key and the ECU system complete the matching step, the method further comprises:
judging whether an ignition switch of the vehicle is turned on or not;
if the ignition switch of the vehicle is turned on, judging whether the function of a starting button of the vehicle is turned off;
and if the starting button function of the vehicle is closed, sending an execution instruction to the ECU system, wherein the execution instruction is used for synchronously matching an ID authentication box and a steering wheel steering lock in the ECU system so as to enable the anti-theft key to be associated with the ID authentication box and the steering wheel steering lock.
4. The antitheft key matching method according to claim 1, wherein the step of writing the PIN code and the SK code to the ECU system includes:
constructing a first authentication character string according to the PIN code and the SK code;
the first authentication character string is sent to the ECU system, wherein the ECU system compares a second authentication character string carried by the ECU system with the first authentication character string, and if the comparison is successful, an authentication success signal is sent to the diagnostic equipment;
and receiving the authentication success signal, and writing the PIN code and the SK code into the ECU system.
5. The key matching method of claim 2, wherein the step of feeding back a negative response to the ECU system if the number of the key is greater than a first predetermined value further comprises:
identifying the anti-theft key matched with the ECU system as a valid key;
acquiring a historical anti-theft key matched with the ECU system;
and setting the historical anti-theft key as a failed key.
6. An antitheft key matching device, one end of which is connected with an ECU system of a vehicle and the other end of which is wirelessly connected with an antitheft key, characterized by comprising:
the first sending module is used for sending a first control signal to the ECU system so as to enable the diagnostic equipment to enter a diagnostic mode;
the first acquisition module is used for acquiring a first seed value of the ECU system so as to start the user authority of the ECU system;
the first calculation module is used for calculating a first key value according to the first seed value and sending the first key value to the ECU system, wherein the ECU system compares a second key value carried by the ECU system with the first key value and sends a comparison result to the diagnostic equipment;
the first receiving module is used for receiving the comparison result and detecting the learning state of the ECU system according to the comparison result, wherein the learning state comprises a learned state and an unlearned state;
the second obtaining module is used for obtaining the vehicle VIN code if the learning state of the ECU system is detected to be an unlearned state according to the comparison result;
the write-in module is used for calculating a PIN code and an SK code according to the VIN code and writing the PIN code and the SK code into the ECU system, wherein the ECU system generates a matching instruction after the PIN code and the SK code are written in;
the second receiving module is used for receiving the matching instruction and sending the matching instruction to the anti-theft key so as to enable the anti-theft key to be matched with the ECU system;
a first obtaining unit, configured to obtain a length of a first seed value;
the first calculating module is used for calculating the quotient of the length of the first seed value and 32 to obtain a first quotient value Na;
the first judgment unit is used for judging whether a first i value is smaller than or equal to the first quotient Na or not, wherein the initial value of the first i value is 0;
a second calculating unit, configured to calculate a second key value if the first i value is less than or equal to the first quotient Na, where a calculation formula is:
W 2 [i 1 ]=([4*i 1 ]+[4*i 1 +1]+[4*i 1 +2]+[4*i 1 +3]);
i 1 =i 1 +1;
wherein, W 2 [i 1 ]Is a second key value, i 1 Is a first value of i;
a first returning unit configured to return to the step of determining whether the first i value is less than or equal to the first quotient Na;
a third calculating module, configured to calculate a quotient between the length of the first seed value and 4 to obtain a second quotient Nb if the first i value is greater than the first quotient Na;
a second determining unit, configured to determine whether a second i value is smaller than a second quotient Nb, where an initial value of the second i value is a first quotient Na;
a fourth calculating module, configured to calculate a third key value if the second i value is smaller than the second quotient Nb, where a calculation formula is:
i 2 =i 2 +1 wherein, i 2 Is the value of the second i, and is,
X=W 2 [i 2 -1]wherein X is W 2 [i 2 -1]A variable of (d);
if the value of X is not equal to 0, then
W 3 [i 2 ]=W 2 [i 2 -Na]^X;
Wherein, W 3 [i 2 ]For a first key value, the symbol "#" represents the difference operation;
a second returning unit, configured to return to the step of determining whether the second i value is smaller than a second quotient Nb until the second i value is not smaller than the second quotient Nb;
a fifth calculating module, configured to calculate the first key value according to the second key value and the third key value, where a calculation formula is:
W 1 [i]={W 2 [i 1 ],W 3 [i 2 ]};
wherein, the W 1 [i]Representing a first key value.
7. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program performs the steps of the anti-theft key matching method according to any one of claims 1 to 5.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the anti-theft key matching method according to any one of claims 1 to 5.
CN202111528863.2A 2021-12-14 2021-12-14 Anti-theft key matching method and device and computer equipment Active CN114162080B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111528863.2A CN114162080B (en) 2021-12-14 2021-12-14 Anti-theft key matching method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111528863.2A CN114162080B (en) 2021-12-14 2021-12-14 Anti-theft key matching method and device and computer equipment

Publications (2)

Publication Number Publication Date
CN114162080A CN114162080A (en) 2022-03-11
CN114162080B true CN114162080B (en) 2022-10-04

Family

ID=80486517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111528863.2A Active CN114162080B (en) 2021-12-14 2021-12-14 Anti-theft key matching method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN114162080B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5635900A (en) * 1994-04-20 1997-06-03 Nissan Motor Co., Ltd. Antitheft apparatus for automotive vehicle and method of registering ID No. therein
CN101166087A (en) * 2007-09-30 2008-04-23 奇瑞汽车有限公司 A secure validation method for car diagnosis communication
JP2008132914A (en) * 2006-11-29 2008-06-12 Calsonic Kansei Corp Vehicular anti-theft device
CN102941841A (en) * 2012-11-26 2013-02-27 深圳市元征科技股份有限公司 Automobile anti-theft electronic key matching system and method
CN108394376A (en) * 2017-02-08 2018-08-14 比亚迪股份有限公司 Key matching system and method for automobile
CN108536118A (en) * 2017-03-01 2018-09-14 福特全球技术公司 End-to-end vehicle safety ECU unlocks in half offline environment
CN113269912A (en) * 2021-07-21 2021-08-17 江苏赫奕科技有限公司 Vehicle key learning method and system, vehicle-mounted control equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5635900A (en) * 1994-04-20 1997-06-03 Nissan Motor Co., Ltd. Antitheft apparatus for automotive vehicle and method of registering ID No. therein
JP2008132914A (en) * 2006-11-29 2008-06-12 Calsonic Kansei Corp Vehicular anti-theft device
CN101166087A (en) * 2007-09-30 2008-04-23 奇瑞汽车有限公司 A secure validation method for car diagnosis communication
CN102941841A (en) * 2012-11-26 2013-02-27 深圳市元征科技股份有限公司 Automobile anti-theft electronic key matching system and method
CN108394376A (en) * 2017-02-08 2018-08-14 比亚迪股份有限公司 Key matching system and method for automobile
CN108536118A (en) * 2017-03-01 2018-09-14 福特全球技术公司 End-to-end vehicle safety ECU unlocks in half offline environment
CN113269912A (en) * 2021-07-21 2021-08-17 江苏赫奕科技有限公司 Vehicle key learning method and system, vehicle-mounted control equipment and storage medium

Also Published As

Publication number Publication date
CN114162080A (en) 2022-03-11

Similar Documents

Publication Publication Date Title
EP0835790B1 (en) Anti-theft device using code type transponder
CN105313837B (en) Intelligent key matching process and system
US8299891B2 (en) Antitheft system for vehicle
EP1634782B1 (en) In-vehicle antitheft device and central authentication device
JP3073904B2 (en) Vehicle data processing device
US8487740B2 (en) Vehicle function restriction system
JP3191607B2 (en) Vehicle anti-theft device
CN103303255B (en) One enters the antitheft matching process with start up system without key
US20070188310A1 (en) Vehicle anti-theft apparatus and method
JP2008239021A (en) Vehicle control device and data rewriting system
JP2000516675A (en) Method and apparatus for performing a field program of a remote control system
EP1740419B1 (en) Antitheft apparatus for vehicle and vehicle antitheft system
JP2009262676A (en) Electronic control device
US7671724B2 (en) Vehicle anti-theft apparatus and method
JP2008084120A (en) Electronic control device
CN114162080B (en) Anti-theft key matching method and device and computer equipment
JP2002081248A (en) Cabin inside checkup device
JP4946266B2 (en) Vehicle authentication device
KR100706448B1 (en) Engine ECU starting control method for anti-theft of immobilizer system vehicle
CN110843728B (en) Automobile keyless starting method, automobile keyless starting equipment, storage medium and automobile keyless starting device
US20200231123A1 (en) Intelligent anti-theft key system and method of operating the same
CN113147668A (en) Method for unlocking vehicle by intelligent key and automatic unlocking method of vehicle
EP1860617A2 (en) Security systems
JP4723194B2 (en) Vehicle use restriction system, vehicle side communication device, and external communication device
JP5894879B2 (en) Engine start control system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 518000 2606, building 4, phase II, Tian'an Yungu Industrial Park, Gangtou community, Bantian street, Longgang District, Shenzhen, Guangdong

Applicant after: Shenzhen xingka Technology Co.,Ltd.

Address before: 518000 2606, building 4, phase II, Tian'an Yungu Industrial Park, Gangtou community, Bantian street, Longgang District, Shenzhen, Guangdong

Applicant before: Shenzhen Star Card Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant