The electronic lock and its unlocking control method of a kind of diamagnetic field or tesla's interference
Technical field
The present invention relates to smart lock technical fields, and in particular to the electronic lock of a kind of diamagnetic field or tesla's interference and its opens
Lock control method.
Background technique
As the experience operation of various products in the market requires increasingly to pursue simple and convenient, the especially production of a key operation
Product can more obtain user's favor, such as intelligent electronic lock, and user can be unlocked by a key and be gone out, simple and quick.
For this requirement, in intelligent electronic lock field, in order to meet the needs of client, current many smart lock production firms
All have devised the smart lock with a key unlocking function, but a key unlocking function of existing smart lock use be single-point or
Multiple spot trigger pulse formula generates touch signal to single-point or multiple point touching core by touch tablet when user presses touch tablet
Piece, key Trigger Function activation, realizes one after issuing a pulsed logic level to master board by multiple point touching chip later
Key is unlocked.
This single-point or a key unlocking function of multiple spot trigger pulse formula have security risk, when touch tablet receives high-intensity magnetic field
Or strong Tesla coil irregular interference when, what single-point or multiple spot flip chip may be touched because receiving approximating anatomy
Signal and by false triggering, cause master board to start a key and unlock, and then smart lock reliability is caused to substantially reduce, to user with
Carry out security risk.
Therefore, the existing technology needs to be improved and developed.
Summary of the invention
Place in view of above-mentioned deficiencies of the prior art, the purpose of the present invention is to provide a kind of diamagnetic fields or tesla to interfere
Electronic lock and its unlocking control method, by unlike signal port send respectively unlock instruction and receive scrambled instruction simultaneously
Its check and correction is carried out, it can the perfect anti-interference ability for improving a key unlocking function, it is ensured that because interfering auto-unlocking, protection user exists
Safety in use process.
In order to achieve the above object, this invention takes following technical schemes:
The electronic lock of a kind of diamagnetic field or tesla's interference, including lock body, switch module and control module;The switch module exists
First signal end of the output triggering enabling signal to control module, the control when detecting the starting unlock operation of user's input
Module receives the switch module output by second signal end output unlock instruction to switch module, and by the first signal end
Scrambled instruct and it proofreaded, unlocking instruction is exported when proofread successfully to lock body, control lock body unlocking.
It further include level maintenance module, the level maintains mould in the electronic lock of the diamagnetic field or tesla's interference
Block exports the first level to the first contact of switch module and the first signal end of control module, and the control module passes through second
Signal end output second electrical level is described to open when first contact and the second contact short circuit to the second contact of switch module
The the first contact output for closing module triggers enabling signal to control module.
In the electronic lock of the diamagnetic field or tesla's interference, the control module continuously exports unlock instruction several times
To switch module, and successively receive by the first signal end the scrambled several times of the first contact output of the switch module
Instruction is proofreaded the scrambled instruction received every time, and is exported when the instruction of whole scrambleds is proofreaded successfully
Unlocking instruction controls lock body and unlocks to lock body.
In the electronic lock of the diamagnetic field or tesla's interference, terminated by control module judgement by the first signal
Whether the scrambled instruction of receipts is consistent with the unlock instruction exported by second signal end, proofreads success if consistent, otherwise
Check and correction failure.
In the electronic lock of the diamagnetic field or tesla's interference, the triggering enabling signal is failing edge signal or rising
Along signal.
In the electronic lock of the diamagnetic field or tesla's interference, the switch module is touch-switch.
In the electronic lock of the diamagnetic field or tesla's interference, the level maintenance module includes pull-up resistor, described
One end of pull-up resistor connects VCC feeder ear, the other end of the pull-up resistor connect the switch module the first contact and
First signal end of control module.
A kind of unlocking control method of electronic lock as described above comprising following steps:
Switch module output in the starting unlock operation for detecting user's input triggers enabling signal to the first of control module
Signal end;
The control module is passed through described in the reception of the first signal end by second signal end output unlock instruction to switch module
The scrambled instruction of switch module output;
Scrambled instruction is proofreaded, unlocking instruction is exported when proofreading successfully to lock body, lock body is controlled and unlocks.
In the unlocking control method of the electronic lock, the switch module is in the starting unlock behaviour for detecting user's input
When making output triggering enabling signal to control module the first signal end the step of include:
Level maintenance module exports the first level to the first contact of switch module and the first signal end of control module;
Control module exports second electrical level to the second contact of switch module by second signal end;
When first contact and the second contact short circuit, the first contact output triggering enabling signal of the switch module is extremely controlled
Molding block.
In the unlocking control method of the electronic lock, it is described to the scrambled instruction proofread, when check and correction at
The step of unlocking instruction is exported when function to lock body, controls its unlocking specifically includes:
By control module judgement by the instruction of the first signal end received scrambled whether with it is defeated by second signal end
Unlock instruction out is consistent, proofreads success if consistent, otherwise check and correction failure.
Compared to the prior art, the electronic lock and its unlocking control method of diamagnetic field provided by the invention or tesla's interference
In, the electronic lock of the diamagnetic field or tesla's interference includes lock body, switch module and control module;The switch module is being examined
First signal end of the output triggering enabling signal to control module, the control mould when measuring the starting unlock operation of user's input
Block receives the switch module output by second signal end output unlock instruction to switch module, and by the first signal end
Scrambled is instructed and is proofreaded to it, and unlocking instruction is exported when proofreading successfully to lock body, lock body is controlled and unlocks.By not
It sends unlock instruction respectively with signal port and receives scrambled and instruct and carry out its check and correction, perfect can improve a key and unlock
The anti-interference ability of function, it is ensured that because interfering auto-unlocking, the safety of protection user in use.
Detailed description of the invention
Fig. 1 is the structural block diagram of the electronic lock of diamagnetic field provided by the invention or tesla's interference;
Fig. 2 is the schematic diagram of the electronic lock of diamagnetic field provided by the invention or tesla's interference;
Fig. 3 is the flow chart of the unlocking control method of electronic lock provided by the invention;
Fig. 4 is the flow chart of step S10 in the unlocking control method of electronic lock provided by the invention.
Specific embodiment
It is easy to be led to the disadvantages of opening by mistake lock, this hair by magnetic interference in view of a key unlocking function of smart lock in the prior art
The bright electronic lock and its unlocking control method for being designed to provide a kind of diamagnetic field or tesla's interference, passes through unlike signal end
Mouth, which sends unlock instruction respectively and receives scrambled, instructs and carries out its check and correction, perfect can improve the anti-of a key unlocking function
Interference performance, it is ensured that because interfering auto-unlocking, the safety of protection user in use.
To make the purpose of the present invention, technical solution and effect clearer, clear and definite, right as follows in conjunction with drawings and embodiments
The present invention is further described.It should be appreciated that described herein, specific examples are only used to explain the present invention, is not used to
Limit the present invention.
Referring to Fig. 1, the electronic lock of diamagnetic field provided by the invention or tesla's interference, including lock body 10, switch module
20 and control module 30, the lock body 10 and switch module 20 connect with control module 30, the specific control module 30 is set
At least two signal ends and an output end are equipped with, wherein the first signal end of the control module 30 is connected with second signal end
The output end of the switch module 20, the control module 30 connects lock body 10, when carrying out unlocking operation, the switch module
20 export the first signal end of triggering enabling signal to control module 30 in the starting unlock operation for detecting user's input, this
When control module 30 enter a key unlocking condition, by second signal end export unlock instruction to switch module 20, switch later
Module 20 exports a scrambled and instructs to the first receiving end of the control module 30, receives institute by first signal end
It states scrambled to instruct and proofread it, unlocking instruction is exported when proofreading successfully to lock body 10, lock body 10 is controlled and unlocks.
It is not to rely on single-point or multiple spot triggering arteries and veins in the electronic lock of diamagnetic field i.e. provided by the invention or tesla's interference
Formula unlock is rushed, i.e., single-point or multiple point touching chip then control the unlocking of lock body 10 after exporting a pulse signal, but are detecting
When having starting unlock operation, control module 30 first exports unlock instruction to switch module 20, and receives switch module 20 according to this
The scrambled instruction that unlock instruction returns, and scrambled instruction is proofreaded, only after the transmission of outside
When detecting the instruction of received scrambled and proofread successfully, just output unlocking instruction to lock body 10, the control unlocking of lock body 10 are not only saved
Fallen single-point or multiple point touching chip, at the same also solve single-point or multiple spot trigger pulse formula unlock be easy caused by magnetic interference
Accidentally the phenomenon that unlocking operation, the stability of product is effectively increased, protects the safety in user's use process.
Specifically, the electronic lock of the diamagnetic field or tesla's interference further includes level maintenance module 40, the level dimension
Module 40 to be held to connect with switch module 20 and control module 30, the specific switch module 20 has at least two contacts, wherein
The level maintenance module 40 connects the first contact of the switch module 20 and the first signal end of control module 30, described to open
The second contact for closing module 20 is connect with the second signal end of control module 30, when electronic lock does not enter a key unlocking condition,
The level maintenance module 40 exports the first level to the first contact of switch module 20 and the first signal end of control module 30,
The control module 30 exports second electrical level to the second contact of switch module 20 by second signal end, i.e., when electronic lock not into
When entering a key unlocking condition, the first contact of the switch module 20 will remain first under the control of level maintenance module 40
Second contact of level, the switch module 20 remains second electrical level under the control of the second signal end of control module 30, when
When user inputs starting unlock operation, first contact and the second contact short circuit, the first contact of switch module 20 is defeated at this time
Out triggering enabling signal to control module 30 the first signal end, i.e., when user carry out a key unlock when, first contact
It will be shorted with the second contact, therefore the level state of the first contact will switch to second electrical level from the first level, level transitions touching
It signals to be triggering enabling signal, the first signal end of synchronism output to control module 30, control module 30 is receiving
When stating triggering enabling signal, then enters a key unlocked state, be by the first contact and the second contact of detection switch module 20
No short circuit operates to detect current starting unlock, and detection mode is convenient accurate, provides detection basis for subsequent reliable unlock.
When it is implemented, first level and second electrical level can be arranged according to specific requirements, such as the first level is height
Second electrical level is low level when level, and the triggering enabling signal is failing edge signal at this time, and when the first level is low level
When second electrical level be high level, at this time the triggering enabling signal be rising edge signal.
Preferably, when the first contact of switch module 20 and the second contact short circuit, the first contact output triggering enabling signal
After making it into a key unlocked state to control module 30, the control module 30 will continuous output several times unlock instruction to opening
The second contact of module 20 is closed, and adding several times for 20 first contact of the switch module output is received by the first signal end
Code instruction, i.e., the unlock instruction of described 30 second signal end of the control module output, in the first contact and the second contact short circuit
When, the first signal end of control module 30 will be fed back to again after transmitting outside switch module 20, and to receiving every time
Scrambled instruction proofreaded, unlocking instruction is just exported when the instruction of whole scrambleds proofread successfully to lock body 10,
It controls the lock body 10 to unlock, continuous several times check and correction is carried out by the model that the first signal end receives, is received with judgement
Whether feedback signal is correct, and then just controls unlocking, further ensures the safety that a key is unlocked.
When specific check and correction, by the control module 30 judgement by the received scrambled instruction of the first signal end whether with
The unlock instruction exported by second signal end is consistent, proofreads success if consistent, otherwise check and correction failure, i.e. the first of electronic lock
After signal end detects triggering enabling signal, second signal end export immediately several times unlock instruction to the second of switch module 20
Contact, the specific unlock instruction is the coding stored previously according to design standard, can be according to different product and security performance need
It asks and is designed, such as 8/16/32/64bit length etc., while data format shuffling can also be carried out, reach and refer in same
The coding mode that multiple format is integrated in order, can more improve mistake proofing effect, reach stronger anti-interference ability, at this time due to first
Contact and the second contact short circuit, therefore the unlock instruction will be exported via the first contact to the first signal end of control module 30,
That is the first signal end detects the scrambled instruction that switch module 20 is fed back, and control module 30 detects the first signal end
The scrambled instruction arrived will carry out continuous check and correction several times, proofread the scrambled instruction that receives every time whether with output
Unlock instruction is consistent, if consistent survey shows that current crypto coded command is correct, the first contact and the second contact of switch module 20
It is reliably shorted under the starting unlock operation of user's input, control module 30 exports unlocking instruction to lock body 10 at this time, due to can
Chip is individually touched to save, also reduces cost while realizing reliable key unlocking function.
When it is implemented, referring to Figure 2 together, in the present embodiment, the switch module 20 is touch-switch, the level
Maintenance module 40 includes pull-up resistor R1, and one end of the pull-up resistor R1 connects VCC feeder ear, and the pull-up resistor R1's is another
One end connects the first contact of the switch module 20 and the first signal end of control module 30, specifically, the control module
30 the first signal end GPIO1 and second signal end GPIO2 is respectively configured as BIT_IN signal input detection and BIT_OUT
Signal output, when electronic lock does not enter a key unlocked state, BIT_IN default is pulled up by pull-up resistor R1, is constantly in
High level keeps receiving state signal;BIT_OUT always remains as low level output state, when touch-switch is pressed, this
When BIT_OUT and BIT_IN will be shorted, realization the low level signal that BIT_OUT defaults is exported by BIT_IN to control
The GPIO1 of module 30, therefore GPIO1 will obtain one and change trigger signal by high level to low level failing edge, as touch
Enabling signal is sent out, control module 30 enters a key unlocked state at this time.
GPIO2 will continuously transmit unlock instruction several times by pre-stored coding immediately, at this time due to touch-switch quilt
It is shorted, which will also export to GPIO1, i.e. GPIO1 the scrambled for detecting touch-switch output by BIT_IN
Instruction, then control module 30 carries out continuous check and correction several times to the scrambled instruction that GPIO1 is detected, judges that GPIO1 connects
Whether the signal received is signal that GPIO2 is issued, proofreads if consistent correct, and control module 30 passes through output end GPIO3
Unlocking instruction is exported to lock body 10, lock body 10 completes unlocking operation after receiving;Indicate what GPIO1 was received if inconsistent
It is illegal signals, such as is influenced by other operations or environment, does not export unlocking instruction at this time to guarantee what electronic lock used
Safety improves the jamproof ability of electronic lock, improves product quality and reliability, meets the key unlocking of client
Experience and actual use.
Based on the electronic lock that above-mentioned diamagnetic field or tesla are interfered, the present invention correspondingly provides a kind of electronics as described above
The unlocking control method of lock, as shown in figure 3, the unlocking control method of the electronic lock includes the following steps:
The output in the starting unlock operation for detecting user's input of S10, switch module triggers enabling signal to control module
First signal end;
S20, the control module are received by second signal end output unlock instruction to switch module, and by the first signal end
The scrambled instruction of the switch module output;
S30, scrambled instruction is proofreaded, unlocking instruction is exported when proofreading successfully to lock body, lock body is controlled and opens
Lock.
Specifically, referring to Figure 4 together, the step S10 comprising steps of
S101, level maintenance module export the first level to the first contact of switch module and the first signal end of control module;
S102, control module export second electrical level to the second contact of switch module by second signal end;
S103, when first contact and when the second contact short circuit, the first contact output triggering starting letter of the switch module
Number to control module.
In conclusion in the electronic lock and its unlocking control method of diamagnetic field provided by the invention or tesla's interference, institute
The electronic lock for stating diamagnetic field or tesla's interference includes lock body, switch module and control module;The switch module is detecting
The first signal end of triggering enabling signal to control module is exported when the starting unlock operation of user's input, the control module is logical
It crosses second signal end and exports unlock instruction to switch module, and the encryption that the switch module exports is received by the first signal end
Coded command simultaneously proofreads it, and unlocking instruction is exported when proofreading successfully to lock body, lock body is controlled and unlocks.Pass through different letters
Number end sends and receives unlocking signal respectively and is proofreaded, and the anti-interference ability of a key unlocking function can be improved, it is ensured that uses
The safety of family in use.
Certainly, those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method,
It is that related hardware (such as processor, controller etc.) can be instructed to complete by computer program, the program can store
In a computer-readable storage medium, which may include the process such as above-mentioned each method embodiment when being executed.Its
Described in storage medium can be for memory, magnetic disk, CD etc..
It should be understood that the application of the present invention is not limited to the above for those of ordinary skills can
With improvement or transformation based on the above description, all these modifications and variations all should belong to the guarantor of appended claims of the present invention
Protect range.