Type identification, driving method, system and device of electronic lock
Through an electronic lock type recognition method, the electronic lock type is identified by using the sampling voltage difference value to construct a feature vector to identify the electronic lock type, which solves the problem of lock status error in the mixed use scenarios of traditional driving solutions, and achieves higher reliability of the charging process.
Patent Information
- Application Number
- CN202510174672.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-02-18
AI Technical Summary
When facing the scene of mixed use of multiple models of electronic locks, traditional electronic lock driving schemes are prone to overlocking or incomplete unlocking due to abnormal lock control time, and the electronic lock status of different models cannot be effectively identified, resulting in charging failure.
Through an electronic lock type recognition method, the sampling voltage of the electronic lock to be identified in the unlocked state is obtained, the electronic lock is controlled to perform locking motion, and the sampling voltage difference value after multiple drive signals is recorded, a feature vector is constructed to identify the electronic lock type, and the corresponding driving scheme is used to drive the electronic lock.
It realizes automatic detection of multiple types of electronic locks, reducing software maintenance costs, and avoiding the inability to lock and unlock the electronic locks normally due to driver errors, thereby improving the reliability of the charging process.
Smart Images

Figure CN119672842B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent control technology, and in particular to a type identification, driving method, system and device for an electronic lock. Background Art
[0002] In order to ensure the connection safety between the charging gun and the charging socket in the European electric vehicle charging standard CCS, it is necessary to prevent the accidental disconnection of the charging gun or the manual pulling of the charging gun during the charging process, which may cause the vehicle to plug and unplug the charging gun during high-voltage charging, causing arcing and even causing the vehicle to burn. According to the requirements of the CCS standard, all CCS vehicle charging sockets must be equipped with electronic locks. When charging, lock the charging gun on one side, or directly lock it on the lock on the front panel. The electronic lock bolt can withstand a large pull-out force, so it can prevent the charging gun from being pulled out during the charging process.
[0003] According to CCS standards, electronic locks should have a status indication function, be able to display status information such as locked and unlocked, and be able to effectively exchange information with charging piles and electric vehicles to ensure a smooth charging process.
[0004] The electronic locks currently used by CCS electric vehicle manufacturers are different in type, and are distinguished by the signal feedback type: resistance type, switch type, etc. The same signal feedback type electronic locks are also divided into four-wire type, three-wire type, etc. due to different internal circuits. Among these electronic lock models, the more mainstream is the four-wire switch type electronic lock, which uses two power lines to connect the motor and two signal lines to connect the switch. When unlocking and locking, the switch is in different states for status indication. The program in the ECU (electronic control unit) drives the electronic lock to complete the action according to the state of the electronic lock.
[0005] The current CCS system electronic lock driving method generally uses powering the motor for a period of time to check whether the signal line is in normal state. If so, the charging process is carried out normally, otherwise an error is reported and error processing is performed. This CCS system electronic lock driving method is prone to over-locking or incomplete unlocking due to abnormal lock control time. In addition, when multiple models of electronic locks are used together, there will be a situation where the lock state is wrong and charging cannot be performed due to different locks. Summary of the invention
[0006] In view of this, the present application provides an electronic lock type identification, driving method, system and device to solve the problem that when a traditional electronic lock driving solution is faced with a scenario where multiple models of electronic locks are mixed, the lock state is incorrect and cannot be charged due to different locks.
[0007] The present application provides a method for identifying the type of an electronic lock, comprising:
[0008] S110, obtaining a first sampled voltage between the P pin and the D pin of the electronic lock to be identified in the unlocked state ;
[0009] S120, controlling the electronic lock to be identified to perform locking movement, outputting a driving signal of a preset time to the R pin and the F pin of the electronic lock to be identified multiple times, and obtaining a second sampling voltage between the P pin and the D pin of the electronic lock to be identified after each driving signal output ends , and record the second sampling voltage each time The number of times;
[0010] S130, at the first sampling voltage and the second sampling voltage When the difference between the two is greater than the preset first filtering limit, the second sampling voltage acquired this time is recorded. and the second sampling voltage is obtained The number of times ;
[0011] S140, obtaining the second sampling voltage The number of times , the first sampling voltage and the second sampling voltage Determine the first vector [ , , ];
[0012] S150, expanding the first vector [ , , ], obtaining a second vector with a length consistent with a preset feature vector length, wherein the feature vector is used to characterize the type of the electronic lock;
[0013] S160, sequentially calculating divergences between the second vector and the plurality of feature vectors, the divergences being used to describe the similarity between two vectors;
[0014] S170, determining the type of the electronic lock to be identified according to the type of the electronic lock represented by the feature vector corresponding to the minimum divergence.
[0015] Optionally, the process of determining the feature vector includes:
[0016] S210, obtaining a third sampled voltage V0 between the P pin and the D pin of the reference electronic lock in an unlocked state;
[0017] S220, controlling the digital controlled DC regulated power supply to output DC power for multiple times within the preset time, obtaining a fourth sampled voltage Vc between the P pin and the D pin of the reference electronic lock after each DC power output, and recording a number of times the fourth sampled voltage Vc is obtained each time;
[0018] S230, when the difference between the third sampling voltage V0 and the fourth sampling voltage Vc is greater than a preset second filtering limit, recording the fourth sampling voltage V1 obtained this time and the number K of times the fourth sampling voltage V1 is obtained this time;
[0019] S240, repeating steps S210 to S230, obtaining multiple groups of third vectors formed by the order number K corresponding to the fourth sampling voltage V1, the third sampling voltage V0 and the fourth sampling voltage V1, and determining the fourth vector according to each group of the third vectors, so as to determine the characteristic vector corresponding to the reference electronic lock according to the fourth vector.
[0020] Optionally, after step S240, the process of determining the characteristic vector includes: normalizing the fourth vector, and determining the normalized fourth vector as the characteristic vector corresponding to the reference electronic lock; step S160 includes: normalizing the second vector, and sequentially calculating the divergence between the normalized second vector and multiple characteristic vectors.
[0021] Optionally, the process of determining the divergence includes:
[0022] KL = ,
[0023] In the formula, represents the second vector or the normalized second vector, represents the fourth vector or the normalized fourth vector, KL express and The divergence between represents the xth element in the second vector, Represents the xth element in the fourth vector.
[0024] Optionally, the fourth vector includes three third vectors connected in sequence.
[0025] Optionally, the process of determining the second filtering limit value includes: leaving the circuit of the reference electronic lock stationary after power-on, obtaining the voltage between the P pin and the D pin of the reference electronic lock for a preset number of consecutive times, and determining the difference between the maximum value and the minimum value of the obtained voltage as the second filtering limit value.
[0026] The present application also provides a driving method for an electronic lock, the driving method for an electronic lock comprising:
[0027] Using any of the above electronic lock type identification methods to identify the type of the electronic lock to be driven;
[0028] The electronic lock to be driven is driven using an electronic lock driving solution corresponding to the electronic lock type.
[0029] The present application also provides a type identification system for an electronic lock, the type identification system for an electronic lock comprising:
[0030] The acquisition module is used to obtain the first sampled voltage between the P pin and the D pin of the electronic lock to be identified in the unlocked state. ;
[0031] A control module is used to control the electronic lock to be identified to perform locking movement, output a driving signal of a preset time to the R pin and the F pin of the electronic lock to be identified multiple times, and obtain a second sampling voltage between the P pin and the D pin of the electronic lock to be identified after each driving signal output ends. , and record the second sampling voltage each time The number of times;
[0032] A recording module is used to sample the voltage at the first and the second sampling voltage When the difference between the two is greater than the preset first filtering limit, the second sampling voltage acquired this time is recorded. and the second sampling voltage is obtained The number of times ;
[0033] The first determining module is used to obtain the second sampling voltage The number of times , the first sampling voltage and the second sampling voltage Determine the first vector [ , , ];
[0034] An extension module, for extending the first vector [ , , ], obtaining a second vector with a length consistent with a preset feature vector length, wherein the feature vector is used to characterize the type of the electronic lock;
[0035] A calculation module, used for sequentially calculating divergences between the second vector and the plurality of feature vectors, wherein the divergences are used to describe the similarity between two vectors;
[0036] The second determination module is used to determine the type of the electronic lock to be identified according to the type of the electronic lock represented by the feature vector corresponding to the minimum divergence.
[0037] The present application also provides a type identification device for an electronic lock, the type identification device for an electronic lock comprising a control chip, a drive circuit and a sampling circuit;
[0038] The driving circuit is connected to the R pin and the F pin of the electronic lock to be identified, so as to output a driving signal to the R pin and the F pin of the electronic lock to be identified;
[0039] The sampling circuit is connected to the P pin and the D pin of the electronic lock to be identified, so as to obtain a sampling voltage corresponding to the resistance between the P pin and the D pin of the electronic lock to be identified in an unlocked state;
[0040] The control chip is connected to the driving circuit and the sampling circuit respectively, and is used to execute any of the above-mentioned electronic lock type identification methods to identify the type of the electronic lock to be identified.
[0041] Optionally, the electronic lock type identification device also includes a digitally controlled DC regulated power supply and a reference electronic lock; the digitally controlled DC regulated power supply is connected to the R pin and the F pin of the reference electronic lock to output DC power to the R pin and the F pin of the reference electronic lock; the control chip is also connected to the digitally controlled DC regulated power supply to determine the characteristic vector corresponding to the reference electronic lock.
[0042] The type identification, driving method, system and device of the electronic lock described in the present application are obtained by obtaining a first sampled voltage between the P pin and the D pin of the electronic lock to be identified in the unlocked state. , control the electronic lock to be identified to lock, output the driving signal of preset time to the R pin and F pin of the electronic lock to be identified multiple times, and obtain the second sampling voltage between the P pin and the D pin of the electronic lock to be identified after each driving signal output ends , and record the second sampling voltage each time The number of times, in the first sampling voltage and the second sampling voltage When the difference between the two is greater than the preset first filtering limit, the second sampling voltage acquired this time is recorded. And the second sampling voltage is obtained The number of times , according to the second sampling voltage The number of times , the first sampling voltage and the second sampling voltage Determine the first vector [ , , ], expand the first vector [ , , ], obtain a second vector whose length is consistent with the length of the preset feature vector, calculate the divergence between the second vector and multiple feature vectors in turn, and determine the type of the electronic lock to be identified according to the type of electronic lock represented by the feature vector corresponding to the minimum divergence. It can automatically detect the types of multiple electronic locks. In the scenario where multiple electronic locks are mixed, it effectively reduces the software maintenance cost, can avoid the situation where the electronic lock cannot be locked and unlocked normally due to driving errors, thereby causing charging failure, and can improve the reliability of the corresponding charging process. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 It is a simplified structural diagram of an electronic lock;
[0045] Figure 2 This is a schematic diagram of a method for identifying the type of an electronic lock according to an embodiment of the present application;
[0046] Figure 3 is a schematic diagram of a driver chip according to an embodiment of the present application;
[0047] Figure 4 This is a schematic diagram of a resistor voltage-dividing sampling circuit according to an embodiment of the present application;
[0048] Figure 5 This is a schematic diagram of a driving method of an electronic lock according to an embodiment of the present application;
[0049] Figure 6 1 is a block diagram of a type identification system of an electronic lock according to an embodiment of the present application. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application are clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application. In the absence of conflict, the following embodiments and their technical features can be combined with each other.
[0051] In a first aspect, the present application provides a method for identifying the type of an electronic lock, which can be executed by a control chip, a control main board and / or related drive devices of the electronic lock. Optionally, the electronic lock to be identified can be a four-wire switch-type electronic lock. The four-wire switch-type electronic lock has a status indication function. To meet the CCS standard, the electronic lock lead-out circuit is generally divided into: a motor drive circuit and a signal feedback circuit; the motor drive circuit may include a drive chip (or a drive circuit); the signal feedback circuit may include a sampling circuit (such as a resistor voltage divider sampling circuit). The motor drive circuit is responsible for controlling the locking and unlocking of the electronic lock, and the signal feedback circuit is used to indicate whether the electronic lock is currently locked or unlocked. The simplified circuit of the electronic lock can be referenced. Figure 1 As shown in the figure, the four pins of the four-wire switch type electronic lock are: R pin (reset pin), F pin (function pin), P pin (power pin), and D pin (data pin). Among them, R pin and F pin correspond to the electronic lock motor drive circuit, which is responsible for controlling the movement of the electronic lock. P pin and D pin can correspond to the signal feedback circuit, which is responsible for indicating the locking / unlocking status of the electronic lock. The signal feedback method is: when the electronic lock is unlocked, the resistance R = x Ω, and when the electronic lock is locked, the resistance R = y Ω (x ≠y); for example, for a certain type of electronic lock, the resistance between the P and D pins is 1 KΩ when locked, and the resistance between the P and D pins is 10 KΩ when unlocked.
[0052] refer to Figure 2 As shown, the electronic lock type identification method includes steps S110 to S170.
[0053] S110, powering on the electronic lock to be identified to run an initialization program, and obtaining a first sampled voltage between the P pin and the D pin of the electronic lock to be identified in an unlocked state .
[0054] Specifically, before the above step S110, a driving circuit or a driving chip may be connected to the R pin and the F pin of the electronic lock to be identified, and the above driving circuit or driving chip may be arranged on a control chip or a control mainboard. Figure 3 The solution of the driver chip (such as the driver chip of model DRV8872DDARQ1) shown in FIG. Figure 3As shown, the driver chip is an 8-Pin automotive H-bridge motor controller chip. The working principle is to use the two pins IN1 and IN2 as signal lines to control the current output direction of the two pins OUT1 and OUT2. The relative voltage of OUT1 and OUT2 is the input voltage corresponding to the VM pin. Specifically, the two pins IN1 and IN2 can use GPIO (general purpose input and output) output signals to control the current output direction, thereby controlling the forward and reverse rotation of the motor to lock / unlock. The VM pin can use the onboard voltage, and the two pins OUT1 and OUT2 can be connected to the R pin and F pin of the electronic lock. The ISEN pin can abandon the grounding, GND grounding, and the nFAULT pin can be connected to the GPIO input of the relevant control chip (such as ECU, etc.) to detect faults.
[0055] Specifically, before the above step S110, a signal feedback circuit can be connected to the P pin and the D pin of the electronic lock to be identified, referring to Figure 4 As shown, the signal feedback circuit adopts a resistor voltage-dividing sampling circuit, and uses a parallel circuit of Rc and R, Rx, and Rv for series voltage division, where R is the resistor in the electronic lock, and Rx is the sampling resistor. When the state of the electronic lock changes, the resistance value of R changes, the total resistance value of the parallel circuit of R, Rx, and Rv changes, the total voltage at both ends changes, and the voltage Ux at both ends of Rx also changes accordingly. The voltage Ux can be read using an ADC (analog-to-digital converter), and this voltage Ux is used as a mark for judging the state of the electronic lock. Therefore, the controller (such as ECU, etc.) in the resistor voltage-dividing sampling circuit can read the sampling voltage corresponding to the resistor R in the electronic lock through its ADC pin or module. The Ux calculation formula may include: , where R represents the resistance of resistor R, Rx represents the resistance of resistor Rx, Rv represents the resistance of resistor Rv, Rc represents the resistance of resistor Rc, and VCCA represents the voltage connected to one end of resistor Rc.
[0056] Optionally, the initial state of the electronic lock to be identified may be an unlocked state. In the above step S110, when the control chip does not output a driving signal, the ADC of the resistor voltage-dividing sampling circuit in the signal feedback circuit connected to the P pin and the D pin reads a voltage value once to obtain a first sampling voltage. .
[0057] S120, controlling the electronic lock to be identified to perform locking movement, outputting a driving signal of a preset time to the R pin and the F pin of the electronic lock to be identified multiple times, and obtaining a second sampling voltage between the P pin and the D pin of the electronic lock to be identified after each driving signal output ends , and record the second sampling voltage each time The number of times.
[0058] Optionally, the preset time can be a time value such as 10ms. In the above step S120, the control chip controls the electronic lock to be identified to perform locking movement through GPIO, and the output time of each driving signal is 10ms. After the signal output is completed, the ADC of the resistor voltage sampling circuit in the signal feedback circuit is used to read the voltage value and count to obtain the second sampling voltage. and the corresponding sequence number.
[0059] S130, at the first sampling voltage and the second sampling voltage When the difference between the two is greater than the preset first filtering limit, the second sampling voltage acquired this time is recorded. and the second sampling voltage is obtained The number of times .
[0060] The above steps can be performed by testing and analyzing the electronic lock to be identified or by other means to preset the first filtering limit. and the second sampling voltage When the difference between the two is greater than the first filtering limit, the second sampling voltage acquired this time is recorded. , which enables the recorded second sampling voltage It is more effective to avoid being affected by voltage jitter of the control chip.
[0061] Specifically, the process of determining the first filtering limit value includes: after powering on, the circuit of the electronic lock to be identified is left to stand still, the voltage between the P pin and the D pin of the electronic lock to be identified is obtained for a preset number of times in a row, and the difference between the maximum value and the minimum value of the obtained voltage is determined as the first filtering limit value. The preset number of times may include 2000 times or the like.
[0062] S140, obtaining the second sampling voltage The number of times , the first sampling voltage and the second sampling voltage Determine the first vector [ , , ].
[0063] S150, expanding the first vector [ , , ], and obtain a second vector whose length is consistent with the preset feature vector length, and the feature vector is used to characterize the type of electronic lock, that is, one feature vector is used to characterize one type of electronic lock or one model of electronic lock in one brand, and the feature vector can be obtained in advance by testing and analyzing the corresponding type of electronic lock.
[0064] Optionally, the above extension method includes a copy and fill method, that is, the above step S150 may copy the first vector multiple times [ , , ] to obtain a second vector with the same length as the feature vector, for example, the first vector [ , , ] is a 1×3 one-dimensional vector, and the eigenvector is a 1×9 one-dimensional vector, then the first vector [ , , ] is copied 3 times to get the second vector [ , , , , , , , ].
[0065] S160, sequentially calculating divergences between the second vector and the plurality of feature vectors, wherein the divergence is used to describe the similarity between two vectors, and the smaller the divergence value, the more similar the two vectors are.
[0066] S170, determining the type of the electronic lock to be identified according to the type of the electronic lock represented by the eigenvector corresponding to the minimum divergence, so as to drive, lock and / or unlock the electronic lock to be identified using a driving scheme of the corresponding type of electronic lock, so as to accurately drive, lock and / or unlock the electronic lock to be identified.
[0067] Optionally, after step S170, the electronic lock type identification method further includes: recording the type of the electronic lock to be identified, unlocking the electronic lock (ie, the electronic lock to be identified), and ending the electronic lock power-on initialization procedure.
[0068] The above-mentioned electronic lock type identification method obtains the first sampled voltage between the P pin and the D pin of the electronic lock to be identified in the unlocked state. , control the electronic lock to be identified to lock, output the driving signal of preset time to the R pin and F pin of the electronic lock to be identified multiple times, and obtain the second sampling voltage between the P pin and the D pin of the electronic lock to be identified after each driving signal output ends , and record the second sampling voltage each time The number of times, in the first sampling voltage and the second sampling voltage When the difference between the two is greater than the preset first filtering limit, the second sampling voltage acquired this time is recorded. And the second sampling voltage is obtained The number of times , according to the second sampling voltage The number of times , the first sampling voltage and the second sampling voltage Determine the first vector [ , , ], expand the first vector [ , , ], obtain a second vector whose length is consistent with the length of the preset feature vector, calculate the divergence between the second vector and multiple feature vectors in turn, and determine the type of the electronic lock to be identified according to the type of electronic lock represented by the feature vector corresponding to the minimum divergence. It can automatically detect the types of multiple electronic locks. In the scenario where multiple electronic locks are mixed, it effectively reduces the software maintenance cost, can avoid the situation where the electronic lock cannot be locked and unlocked normally due to driving errors, thereby causing charging failure, and can improve the reliability of the corresponding charging process.
[0069] In some embodiments, the process of determining the feature vector includes steps S210 to S240.
[0070] S210, obtaining a third sampled voltage V0 between the P pin and the D pin of a reference electronic lock in an unlocked state, wherein the reference electronic lock is at least one electronic lock in a class of electronic locks for which a feature vector needs to be obtained.
[0071] Specifically, before the above step S210, a digitally controlled DC regulated power supply can be connected to the R pin and the F pin of the reference electronic lock to output a stable DC signal to the R pin and the F pin of the reference electronic lock, and a resistance voltage divider sampling circuit is used to connect the P pin and the D pin of the reference electronic lock to obtain a sampling voltage corresponding to the resistance inside the reference electronic lock.
[0072] Optionally, the reference electronic lock initial state is the unlocked state. In step S210, when the digital controlled DC regulated power supply does not output a DC signal, the ADC of the resistor voltage divider sampling circuit (or signal feedback circuit) connected to the P pin and the D pin reads a voltage value to obtain a third sampling voltage V0.
[0073] S220, controlling the digital controlled DC regulated power supply to output DC power for multiple times within the preset time, obtaining a fourth sampling voltage Vc between the P pin and the D pin of the reference electronic lock after each DC power output, and recording the number of times the fourth sampling voltage Vc is obtained each time.
[0074] Optionally, the preset time may be a time value such as 10ms. In the above step S220, a 10ms DC output is set using a digitally controlled DC regulated power supply, and the voltage of the DC signal may be determined according to the type of electronic lock, and the voltage may be 12V or 24V. After the current output is completed, the ADC of the resistor voltage divider sampling circuit is used to read the voltage value Vc.
[0075] S230, when the difference between the third sampling voltage V0 and the fourth sampling voltage Vc is greater than a preset second filtering limit, record the fourth sampling voltage V1 obtained this time and the number K of times the fourth sampling voltage V1 is obtained this time.
[0076] Specifically, the process of determining the second filtering limit value includes: after powering on, the circuit of the reference electronic lock is left stationary, the voltage between the P pin and the D pin of the reference electronic lock is obtained for a preset number of times, and the difference between the maximum value and the minimum value of the obtained voltage is determined as the second filtering limit value. The preset number of times may include 2000 times or the like.
[0077] S240, repeatedly executing steps S210 to S230, obtaining multiple groups (for example, 3 groups) of the number of times K corresponding to the fourth sampling voltage V1, the third vector formed by the third sampling voltage V0 and the fourth sampling voltage V1 (i.e., multiple third vectors), determining a fourth vector according to each group of the third vectors, so as to determine a characteristic vector corresponding to the reference electronic lock according to the fourth vector. Optionally, the fourth vector includes multiple third vectors connected in sequence.
[0078] Specifically, the fourth vector includes three sequentially connected third vectors. For example, if the first third vector is [ , the second third vector is [ , the third third vector is [ , then the fourth vector is [ , ].
[0079] Furthermore, by performing the above steps S210 to S240 for each type of reference electronic lock, the feature vector corresponding to each type of electronic lock can be obtained respectively, and the index and / or flag information of the feature vector can be set according to the electronic lock type, and the corresponding electronic lock type can be determined according to the index and / or flag information.
[0080] In some examples, after step S240, the process of determining the feature vector includes: normalizing the fourth vector (for example, performing a Softmax operation, etc.), and determining the normalized fourth vector as the feature vector corresponding to the reference electronic lock to make the feature vector more standardized.
[0081] Correspondingly, step S160 includes: performing normalization processing on the second vector, and sequentially calculating divergences between the second vector after the normalization processing and the plurality of feature vectors, so that the obtained divergences are in the same numerical range.
[0082] In some examples, the divergence determination process includes: KL = , where represents the second vector or the normalized second vector, represents the fourth vector or the normalized fourth vector, KL express and The divergence between represents the xth element in the second vector, Represents the xth element in the fourth vector.
[0083] The above electronic lock type identification method obtains the first sampled voltage between the P pin and the D pin of the electronic lock to be identified in the unlocked state. , control the electronic lock to be identified to lock, output the driving signal of preset time to the R pin and F pin of the electronic lock to be identified multiple times, and obtain the second sampling voltage between the P pin and the D pin of the electronic lock to be identified after each driving signal output ends , and record the second sampling voltage each time The number of times, in the first sampling voltage and the second sampling voltage When the difference between the two is greater than the preset first filtering limit, the second sampling voltage acquired this time is recorded. And the second sampling voltage is obtained The number of times , according to the second sampling voltage The number of times , the first sampling voltage and the second sampling voltage Determine the first vector [ , , ], expand the first vector [ , , ], obtain a second vector whose length is consistent with the length of the preset feature vector, calculate the divergence between the second vector and multiple feature vectors in turn, and determine the type of the electronic lock to be identified according to the type of electronic lock represented by the feature vector corresponding to the minimum divergence. It can automatically detect the types of multiple electronic locks. In the scenario where multiple electronic locks are mixed, it effectively reduces the software maintenance cost, can avoid the situation where the electronic lock cannot be locked and unlocked normally due to driving errors, thereby causing charging failure, and can improve the reliability of the corresponding charging process.
[0084] The second aspect of the present application provides a driving method for an electronic lock, which can be executed by a control chip, a control mainboard and / or a related driving device of the electronic lock. Figure 5 As shown, the driving method of the electronic lock includes steps S310 to S320.
[0085] S310: using the electronic lock type identification method described in any of the above embodiments to identify the type of the electronic lock to be driven.
[0086] S320: Drive the electronic lock to be driven by adopting an electronic lock driving solution corresponding to the electronic lock type.
[0087] In one embodiment, the control chip can pre-program n driving schemes for n different types of electronic locks, respectively, and the locking / unlocking voltage value of each driving scheme corresponds to the locking / unlocking voltage value of the corresponding type of electronic lock.
[0088] Optionally, the driving scheme adopts different locking / unlocking strategies according to the type of electronic lock (the locking / unlocking strategies of different types of electronic locks can refer to the electronic lock specification); for example: fixed time locking and unlocking: when locked, the fixed locking signal output is 600ms, and when unlocked, the fixed unlocking signal output is 800ms; polling state locking and unlocking: when locked, the locking signal is output for 150ms, and the corresponding ADC reads the voltage. If it is locked at this time, the charging process starts; on the contrary, the locking signal is output for another 100ms, and the voltage is read again. If it is not locked yet. The locking signal is output for another 50ms. If it is still not locked, an error is reported and error processing is entered. The unlocking is the same, but after the unlocking state is queried, the unlocking signal is output for an additional 50ms to prevent the inability to draw the gun due to incomplete unlocking.
[0089] Optionally, in the CCS charging process, the electronic lock driver can be entered before the CableCheck stage to complete the locking action according to the locking strategy. After charging is completed, the unlocking action is completed according to the unlocking strategy.
[0090] The above-mentioned driving method of the electronic lock can automatically detect the electronic lock models for a variety of electronic locks and match the corresponding driving schemes. It adopts the type identification method of the electronic lock described in any of the above-mentioned embodiments to identify the type of the electronic lock to be driven, and has all the beneficial effects of the type identification method of the electronic lock described in any of the above-mentioned embodiments, which will not be repeated here.
[0091] The third aspect of the present application provides a type identification system for an electronic lock, which is provided in a main device such as a control chip, a control mainboard and / or a related driving device of the electronic lock. Figure 6 As shown, the type identification system of the electronic lock includes:
[0092] The acquisition module 110 is used to acquire the first sampled voltage between the P pin and the D pin of the electronic lock to be identified in the unlocked state. ;
[0093] The control module 120 is used to control the electronic lock to be identified to perform locking movement, output a driving signal of a preset time to the R pin and the F pin of the electronic lock to be identified multiple times, and obtain a second sampling voltage between the P pin and the D pin of the electronic lock to be identified after each driving signal output ends. , and record the second sampling voltage each time The number of times;
[0094] The recording module 130 is used to record the first sampling voltage and the second sampling voltage When the difference between the two is greater than the preset first filtering limit, the second sampling voltage acquired this time is recorded. and the second sampling voltage is obtained The number of times ;
[0095] The first determining module 140 is used to obtain the second sampling voltage according to The number of times , the first sampling voltage and the second sampling voltage Determine the first vector [ , , ];
[0096] An expansion module 150 is used to expand the first vector [ , , ], obtaining a second vector with a length consistent with a preset feature vector length, wherein the feature vector is used to characterize the type of the electronic lock;
[0097] A calculation module 160, configured to sequentially calculate divergences between the second vector and the plurality of feature vectors, wherein the divergences are used to describe the similarity between two vectors;
[0098] The second determination module 170 is configured to determine the type of the electronic lock to be identified according to the type of the electronic lock represented by the feature vector corresponding to the minimum divergence.
[0099] The specific definition of the type identification system of the electronic lock can be found in the definition of the type identification method of the electronic lock mentioned above, which will not be repeated here. Each module in the above-mentioned type identification system of the electronic lock can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the computing module in the relevant computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the computing module can call and execute the operations corresponding to the above-mentioned units.
[0100] A fourth aspect of the present application provides a type identification device for an electronic lock, the type identification device for an electronic lock comprising a control chip, a drive circuit and a sampling circuit. Optionally, the drive circuit may be disposed inside the control chip.
[0101] The driving circuit is connected to the R pin and the F pin of the electronic lock to be identified, so as to output a driving signal to the R pin and the F pin of the electronic lock to be identified.
[0102] The sampling circuit is connected to the P pin and the D pin of the electronic lock to be identified to obtain a sampling voltage corresponding to the resistance between the P pin and the D pin of the electronic lock to be identified in an unlocked state.
[0103] The control chip is connected to the driving circuit and the sampling circuit respectively, and is used to execute the electronic lock type identification method described in any of the above embodiments to identify the type of the electronic lock to be identified.
[0104] Specifically, the driving circuit includes Figure 3 The driver chip shown is an 8-Pin automotive H-bridge motor controller chip. The working principle is to use the two pins IN1 and IN2 as signal lines to control the current output direction of the two pins OUT1 and OUT2. The relative voltage of OUT1 and OUT2 is the input voltage corresponding to the VM pin. Specifically, the two pins IN1 and IN2 can use GPIO (general purpose input and output) output signals to control the current output direction, thereby controlling the forward and reverse rotation of the motor to lock / unlock. The VM pin can use the onboard voltage, and the two pins OUT1 and OUT2 can be connected to the R pin and F pin of the electronic lock to output the drive signal to the connected electronic lock. The ISEN pin can abandon the grounding, GND grounding, and the nFAULT pin can be connected to the GPIO input of the relevant control chip (such as ECU, etc.) to detect faults.
[0105] The sampling circuit can be Figure 4 The resistor voltage divider sampling circuit shown in the figure is Figure 4 The resistor voltage-dividing sampling circuit shown in the figure includes a controller (such as an ECU, etc.), a resistor Rc, a resistor Rv and a resistor Rx; the first end of the resistor Rc is respectively connected to the first end of the resistor R in the electronic lock and the first end of the resistor Rv, the second end of the resistor Rc is connected to the voltage VCCA, and is connected to the VREFH pin of the controller; the second end of the resistor Rv is respectively connected to the first end of the resistor Rx and the ADC pin of the controller; the second end of the resistor Rx is respectively connected to the second end of the resistor R, the VREFH pin of the controller and the ground terminal. The resistor voltage-dividing sampling circuit uses a parallel circuit of Rc and R, Rx, and Rv for series voltage division, where R is the resistor in the electronic lock and Rx is the sampling resistor. When the state of the electronic lock changes, the resistance value of R changes, the total resistance value of the parallel circuit of R, Rx, and Rv changes, the total voltage at both ends changes, and the voltage Ux at both ends of Rx also changes accordingly. The voltage Ux can be read using ADC, and this voltage Ux is used as a judgment mark for the state of the electronic lock, so the controller in the resistor voltage-dividing sampling circuit can read the sampling voltage corresponding to the resistor R in the electronic lock through its ADC pin or module.
[0106] In some embodiments, the type identification device of the electronic lock further includes a digitally controlled DC regulated power supply and a reference electronic lock; the digitally controlled DC regulated power supply is connected to the R pin and the F pin of the reference electronic lock to output DC power to the R pin and the F pin of the reference electronic lock, so that the DC signal output to the reference electronic lock is more accurate and stable. The control chip is also connected to the digitally controlled DC regulated power supply to determine the characteristic vector corresponding to the reference electronic lock.
[0107] Optionally, the control chip may respectively perform the following steps S210 to S240 for each type of reference electronic lock to determine a feature vector corresponding to the reference electronic lock:
[0108] S210, obtaining a third sampled voltage V0 between the P pin and the D pin of the reference electronic lock in an unlocked state.
[0109] S220, controlling the digital controlled DC regulated power supply to output DC power for multiple times within the preset time, obtaining a fourth sampling voltage Vc between the P pin and the D pin of the reference electronic lock after each DC power output, and recording the number of times the fourth sampling voltage Vc is obtained each time.
[0110] S230, when the difference between the third sampling voltage V0 and the fourth sampling voltage Vc is greater than a preset second filtering limit, record the fourth sampling voltage V1 obtained this time and the number K of times the fourth sampling voltage V1 is obtained this time.
[0111] S240, repeatedly executing steps S210 to S230, obtaining multiple groups of third vectors (i.e., multiple third vectors) formed by the order number K corresponding to the fourth sampling voltage V1, the third sampling voltage V0 and the fourth sampling voltage V1, and determining the fourth vector according to each group of the third vectors, so as to determine the characteristic vector corresponding to the reference electronic lock according to the fourth vector.
[0112] In the above-mentioned electronic lock type identification device, the control chip is used to execute the electronic lock type identification method described in any of the above-mentioned embodiments, and has all the beneficial effects of the electronic lock type identification method described in any of the above-mentioned embodiments, which will not be repeated here.
[0113] Although the present application has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art based on reading and understanding this specification and the accompanying drawings. The present application includes all such modifications and variations and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the above-mentioned components, the terms used to describe such components are intended to correspond to any component (unless otherwise indicated) that performs the specified function of the component (e.g., it is functionally equivalent), even if it is not structurally equivalent to the disclosed structure that performs the function in the exemplary implementation of the present specification shown herein.
[0114] That is, the above description is only an embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of the present application, such as the mutual combination of technical features between the embodiments, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
[0115] In addition, in the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, which are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. In addition, for structural elements with the same or similar characteristics, the present application may use the same or different reference numerals for identification. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0116] In this application, the word "exemplary" is used to mean "used as an example, illustration or description". Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or more advantageous than other embodiments. In order to enable any technician in the field to implement and use the present application, the present application provides the above description. In the above description, various details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other embodiments, well-known structures and processes will not be elaborated in detail to avoid unnecessary details that make the description of the present application obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the present application.
Claims
1. A method for identifying the type of an electronic lock, characterized in that: The type identification method of the electronic lock comprises: S110, obtaining a first sampled voltage between the P pin and the D pin of the electronic lock to be identified in the unlocked state ; S120, controlling the electronic lock to be identified to perform locking movement, outputting a driving signal of a preset time to the R pin and the F pin of the electronic lock to be identified multiple times, and obtaining a second sampling voltage between the P pin and the D pin of the electronic lock to be identified after each driving signal output ends , and record the second sampling voltage each time The number of times; S130, at the first sampling voltage and the second sampling voltage When the difference between the two is greater than the preset first filtering limit, the second sampling voltage acquired this time is recorded. and the second sampling voltage is obtained The number of times ; S140, obtaining the second sampling voltage The number of times , the first sampling voltage and the second sampling voltage Determine the first vector [ , , ]; S150, expanding the first vector [ , , ], obtaining a second vector with a length consistent with a preset feature vector length, wherein the feature vector is used to characterize the type of the electronic lock; S160, sequentially calculating divergences between the second vector and the plurality of feature vectors, the divergences being used to describe the similarity between two vectors; S170, determining the type of the electronic lock to be identified according to the type of the electronic lock represented by the feature vector corresponding to the minimum divergence.
2. The method for identifying the type of electronic lock according to claim 1, characterized in that: The process of determining the feature vector includes: S210, obtaining a third sampled voltage V0 between the P pin and the D pin of the reference electronic lock in an unlocked state; S220, controlling the digital controlled DC regulated power supply to output DC power for multiple times within the preset time, obtaining a fourth sampled voltage Vc between the P pin and the D pin of the reference electronic lock after each DC power output, and recording a number of times the fourth sampled voltage Vc is obtained each time; S230, when the difference between the third sampling voltage V0 and the fourth sampling voltage Vc is greater than a preset second filtering limit, recording the fourth sampling voltage V1 obtained this time and the number K of times the fourth sampling voltage V1 is obtained this time; S240, repeating steps S210 to S230, obtaining multiple groups of third vectors formed by the order number K corresponding to the fourth sampling voltage V1, the third sampling voltage V0 and the fourth sampling voltage V1, and determining the fourth vector according to each group of the third vectors, so as to determine the characteristic vector corresponding to the reference electronic lock according to the fourth vector.
3. The method for identifying the type of electronic lock according to claim 2, characterized in that: After step S240, the process of determining the characteristic vector includes: normalizing the fourth vector, and determining the fourth vector after the normalization as the characteristic vector corresponding to the reference electronic lock; Step S160 includes: performing normalization processing on the second vector, and sequentially calculating divergences between the normalized second vector and a plurality of the feature vectors.
4. The method for identifying the type of electronic lock according to claim 3, characterized in that: The process of determining the divergence includes: CL = , In the formula, represents the second vector or the normalized second vector, represents the fourth vector or the normalized fourth vector, KL express and The divergence between represents the xth element in the second vector, Represents the xth element in the fourth vector.
5. The method for identifying the type of electronic lock according to claim 3, characterized in that: The fourth vector includes three third vectors connected in sequence.
6. The method for identifying the type of electronic lock according to claim 2, characterized in that: The process of determining the second filtering limit value includes: After power-on, the circuit of the reference electronic lock is left stationary, the voltage between the P pin and the D pin of the reference electronic lock is obtained for a preset number of consecutive times, and the difference between the maximum value and the minimum value of the obtained voltage is determined as the second filtering limit value.
7. A method for driving an electronic lock, characterized in that: The driving method of the electronic lock comprises: Using the electronic lock type identification method according to any one of claims 1 to 6 to identify the type of the electronic lock to be driven; The electronic lock to be driven is driven using an electronic lock driving solution corresponding to the electronic lock type.
8. A type identification system for an electronic lock, characterized in that: The type identification system of the electronic lock comprises: The acquisition module is used to obtain the first sampled voltage between the P pin and the D pin of the electronic lock to be identified in the unlocked state. ; A control module is used to control the electronic lock to be identified to perform locking movement, output a driving signal of a preset time to the R pin and the F pin of the electronic lock to be identified multiple times, and obtain a second sampling voltage between the P pin and the D pin of the electronic lock to be identified after each driving signal output ends. , and record the second sampling voltage each time The number of times; A recording module is used to sample the voltage at the first and the second sampling voltage When the difference between the two is greater than the preset first filtering limit, the second sampling voltage acquired this time is recorded. and the second sampling voltage is obtained The number of times ; The first determining module is used to obtain the second sampling voltage The number of times , the first sampling voltage and the second sampling voltage Determine the first vector [ , , ]; An extension module, for extending the first vector [ , , ], obtaining a second vector with a length consistent with a preset feature vector length, wherein the feature vector is used to characterize the type of the electronic lock; A calculation module, used for sequentially calculating divergences between the second vector and the plurality of feature vectors, wherein the divergences are used to describe the similarity between two vectors; The second determination module is used to determine the type of the electronic lock to be identified according to the type of the electronic lock represented by the feature vector corresponding to the minimum divergence.
9. A type identification device for an electronic lock, characterized in that: The type identification device of the electronic lock includes a control chip, a driving circuit and a sampling circuit; The driving circuit is connected to the R pin and the F pin of the electronic lock to be identified, so as to output a driving signal to the R pin and the F pin of the electronic lock to be identified; The sampling circuit is connected to the P pin and the D pin of the electronic lock to be identified, so as to obtain a sampling voltage corresponding to the resistance between the P pin and the D pin of the electronic lock to be identified in an unlocked state; The control chip is connected to the driving circuit and the sampling circuit respectively, and is used to execute the type identification method of the electronic lock according to any one of claims 1 to 6 to identify the type of the electronic lock to be identified.
10. The type identification device of the electronic lock according to claim 9, characterized in that: The electronic lock type identification device also includes a digitally controlled DC regulated power supply and a reference electronic lock; The digitally controlled DC regulated power supply is connected to the R pin and the F pin of the reference electronic lock to output DC power to the R pin and the F pin of the reference electronic lock; The control chip is also connected to the digitally controlled DC regulated power supply to determine the characteristic vector corresponding to the reference electronic lock.
Citation Information
Patent Citations
Electronic lock and digital authentication method of electronic lock
CN108240140A
New energy electronic lock, feedback control circuit and control method thereof and new energy automobile
CN114132193A