Electronic lock, electronic lock state detection method and storage medium

文档序号:1017572 发布日期:2020-10-27 浏览:12次 中文

阅读说明:本技术 电子锁、电子锁状态检测方法和存储介质 (Electronic lock, electronic lock state detection method and storage medium ) 是由 罗霄 李亚奇 张卫东 于 2019-12-31 设计创作,主要内容包括:本发明实施例公开了一种电子锁、电子锁状态检测方法和存储介质,所述电子锁包括电机、锁舌组件、第一微动开关、第二微动开关和控制装置,通过控制装置控制电机驱动锁舌组件移动,并确定所述锁舌组件移动过程中触发所述第一微动开关和第二微动开关的情况,以获取开关信号序列,根据所述开关信号序列确定所述电子锁的属性状态。本发明实施例通过记录电子锁中两个微动开关被触发的情况判断电子锁的属性,实现准确的判断所述智能锁的不同属性状态,提高了开关锁过程中的智能化程度。(The embodiment of the invention discloses an electronic lock, an electronic lock state detection method and a storage medium, wherein the electronic lock comprises a motor, a bolt assembly, a first microswitch, a second microswitch and a control device, the control device is used for controlling the motor to drive the bolt assembly to move, the condition that the first microswitch and the second microswitch are triggered in the moving process of the bolt assembly is determined, a switch signal sequence is obtained, and the attribute state of the electronic lock is determined according to the switch signal sequence. According to the embodiment of the invention, the attribute of the electronic lock is judged by recording the condition that the two micro switches in the electronic lock are triggered, so that the different attribute states of the intelligent lock can be accurately judged, and the intelligent degree in the locking and unlocking process is improved.)

1. An electronic lock, comprising:

the motor is used for driving the lock tongue to move;

the first microswitch is used for judging a locking state;

the second microswitch is used for controlling the state of the motor;

the bolt assembly comprises a bolt, a first trigger device for triggering the first microswitch and a second trigger device for triggering the second microswitch;

a control apparatus comprising a memory and a processor, the memory for storing one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the steps of:

receiving an unlocking instruction;

starting a motor according to the unlocking instruction to control the movement of the lock tongue assembly;

recording the condition that the first microswitch and the second microswitch are triggered in the movement process of the bolt assembly so as to determine a switch signal sequence, wherein the switch signal sequence comprises a plurality of switch signal pairs which are arranged in a time sequence, and the switch signal pairs comprise a first trigger signal and a second trigger signal, wherein the first trigger signal is used for representing the state of the first microswitch, and the second trigger signal is used for representing the state of the second microswitch;

and determining the attribute state of the electronic lock according to the switching signal sequence.

2. The electronic lock of claim 1, wherein the locking bolt moves up and down under the drive of the motor;

and a first protruding part and a second protruding part are arranged on two sides of the lock tongue and respectively used as the first trigger device and the second trigger device.

3. The electronic lock of claim 2, wherein during unlocking, the locking bolt assembly is configured to move from a first locked position to a first intermediate position in a direction in which the first trigger device is away from the first microswitch, and to move from the first intermediate position to a first unlocked position in a direction in which the second trigger device is away from the second microswitch;

wherein the first locked position is a position in which the first microswitch is not triggered by the first triggering device and the second microswitch is not triggered by the second triggering device, the first intermediate position is a position in which the first microswitch is not triggered by the first triggering device and the second microswitch is triggered by the second triggering device, and the first unlocked position is a position in which the first microswitch is not triggered by the first triggering device and the second microswitch is not triggered by the second triggering device.

4. The electronic lock of claim 1,

the first trigger device is a third bulge part arranged on one side of the lock tongue;

the motor comprises a driving rod, and the second trigger device is a shifting piece which is perpendicular to the driving rod and rotates along with the driving rod;

the motor drives the lock tongue to move up and down, and the second trigger device rotates along with the driving rod.

5. The electronic lock of claim 4, wherein during unlocking, the locking bolt assembly is configured such that the locking bolt moves from the second locked position to a second intermediate position in a direction in which the first trigger device is proximate to the first microswitch and then moves to a second unlocked position in a direction in which the first trigger device is distal from the first microswitch, and the second trigger device simultaneously rotates one revolution with the drive shaft of the motor from the position in which the second microswitch is triggered;

wherein the second locked position is a position in which the first microswitch is not triggered by the first triggering device, the second intermediate position is a position in which the first microswitch is triggered by the first triggering device, and the second unlocked position is between the second locked position and the second intermediate position.

6. A method for detecting the state of an electronic lock, wherein the electronic lock comprises a motor, a bolt assembly, a first microswitch and a second microswitch, the bolt assembly comprises a bolt, a first trigger device for triggering the first microswitch and a second trigger device for triggering the second microswitch, and the method comprises the following steps:

receiving an unlocking instruction;

starting a motor according to the unlocking instruction to control the movement of the lock tongue assembly;

recording the condition that the first microswitch and the second microswitch are triggered in the movement process of the bolt assembly so as to determine a switch signal sequence, wherein the switch signal sequence comprises a plurality of switch signal pairs which are arranged in a time sequence, and the switch signal pairs comprise a first trigger signal and a second trigger signal, wherein the first trigger signal is used for representing the state of the first microswitch, and the second trigger signal is used for representing the state of the second microswitch;

and determining the attribute state of the electronic lock according to the switching signal sequence.

7. The method of claim 6, wherein the registering the first and second micro-switches as triggered during movement of the deadbolt assembly to determine a switch signal sequence comprises:

recording the conditions that the first microswitch and the second microswitch are triggered in the movement process of the bolt assembly according to a preset time sequence so as to determine a corresponding first trigger signal and a corresponding second trigger signal;

the first trigger signal and the second trigger signal determined each time are input into the switching signal sequence as a switching signal pair.

8. The method according to claim 6, wherein the determining of the attribute state of the electronic lock from the sequence of switching signals is in particular:

and querying a state table corresponding to the switching signal sequence to determine a corresponding attribute state, wherein the state table is preset according to the structure of the electronic lock.

9. The method of claim 6, further comprising:

the first trigger signal is obtained at regular time according to a preset first frequency;

and determining that the electronic lock is in fault in response to acquiring two first trigger signals for representing that the first microswitch is triggered within a time threshold smaller than a preset time threshold.

10. A computer readable storage medium storing computer program instructions, which when executed by a processor implement the method of any one of claims 6-9.

Technical Field

The present invention relates to the field of electronic devices, and in particular, to an electronic lock, a method for detecting a state of the electronic lock, and a storage medium.

Background

At present, the electronic lock is widely applied to daily life of people. The intelligent lock is simple to operate, can be directly controlled by intelligent equipment such as a mobile phone and the like, does not need to be unlocked by a key, and avoids the safety problem caused by key loss, so that the life quality and the safety degree of people are greatly improved. Meanwhile, the lock can be unlocked by binding a mobile phone and the like, and the lock is widely applied to the fields of sharing bicycles and the like. However, because the electronic lock has a complicated structure, most electronic locks in the prior art only judge the state of unlocking or locking through a mechanical structure, and it is difficult to judge which part of the structure has problems when unlocking is abnormal, and the situation that the lock is not actually unlocked by prompting or the lock cannot be locked after unlocking can also occur.

Disclosure of Invention

In view of this, the embodiment of the present invention discloses an electronic lock, an electronic lock state detection method, and a storage medium, so as to accurately determine an attribute state of the electronic lock by recording a condition that a micro switch in the electronic lock is triggered.

In a first aspect, an embodiment of the present invention discloses an electronic lock, including:

the motor is used for driving the lock tongue to move;

the first microswitch is used for judging a locking state;

the second microswitch is used for controlling the state of the motor;

the bolt assembly comprises a bolt, a first trigger device for triggering the first microswitch and a second trigger device for triggering the second microswitch;

a control apparatus comprising a memory and a processor, the memory for storing one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the steps of:

receiving an unlocking instruction;

starting a motor according to the unlocking instruction to control the movement of the lock tongue assembly;

recording the condition that the first microswitch and the second microswitch are triggered in the movement process of the bolt assembly so as to determine a switch signal sequence, wherein the switch signal sequence comprises a plurality of switch signal pairs which are arranged in a time sequence, and the switch signal pairs comprise a first trigger signal and a second trigger signal, wherein the first trigger signal is used for representing the state of the first microswitch, and the second trigger signal is used for representing the state of the second microswitch;

and determining the attribute state of the electronic lock according to the switching signal sequence.

Further, the lock tongue moves up and down under the driving of the motor;

and a first protruding part and a second protruding part are arranged on two sides of the lock tongue and respectively used as the first trigger device and the second trigger device.

Further, during unlocking, the locking bolt assembly is configured to move from a first locking position to a first intermediate position in a direction in which the first trigger device is away from the first microswitch, and then to move from the first intermediate position to a first unlocking position in a direction in which the second trigger device is away from the second microswitch;

wherein the first locked position is a position in which the first microswitch is not triggered by the first triggering device and the second microswitch is not triggered by the second triggering device, the first intermediate position is a position in which the first microswitch is not triggered by the first triggering device and the second microswitch is triggered by the second triggering device, and the first unlocked position is a position in which the first microswitch is not triggered by the first triggering device and the second microswitch is not triggered by the second triggering device.

Furthermore, the first trigger device is a third protruding part arranged on one side of the lock tongue;

the motor comprises a driving rod, and the second trigger device is a shifting piece which is perpendicular to the driving rod and rotates along with the driving rod;

the motor drives the lock tongue to move up and down, and the second trigger device rotates along with the driving rod.

Further, during unlocking, the bolt assembly is configured to move from a second locking position to a second intermediate position in a direction that the first trigger device approaches the first microswitch, and then move to a second unlocking position in a direction that the first trigger device is far away from the first microswitch, and meanwhile, the second trigger device rotates along with the driving shaft of the motor for one circle from the position that the second microswitch is triggered;

wherein the second locked position is a position in which the first microswitch is not triggered by the first triggering device, the second intermediate position is a position in which the first microswitch is triggered by the first triggering device, and the second unlocked position is between the second locked position and the second intermediate position.

In a second aspect, an embodiment of the present invention discloses a method for detecting a state of an electronic lock, where the electronic lock includes a motor, a latch bolt assembly, a first micro switch and a second micro switch, the latch bolt assembly includes a latch bolt, a first trigger device for triggering the first micro switch, and a second trigger device for triggering the second micro switch, and the method includes:

receiving an unlocking instruction;

starting a motor according to the unlocking instruction to control the movement of the lock tongue assembly;

recording the condition that the first microswitch and the second microswitch are triggered in the movement process of the bolt assembly so as to determine a switch signal sequence, wherein the switch signal sequence comprises a plurality of switch signal pairs which are arranged in a time sequence, and the switch signal pairs comprise a first trigger signal and a second trigger signal, wherein the first trigger signal is used for representing the state of the first microswitch, and the second trigger signal is used for representing the state of the second microswitch;

and determining the attribute state of the electronic lock according to the switching signal sequence.

Further, the recording the condition that the first microswitch and the second microswitch are triggered during the movement of the bolt assembly to determine a switch signal sequence comprises:

recording the conditions that the first microswitch and the second microswitch are triggered in the movement process of the bolt assembly according to a preset time sequence so as to determine a corresponding first trigger signal and a corresponding second trigger signal;

the first trigger signal and the second trigger signal determined each time are input into the switching signal sequence as a switching signal pair.

Further, the determining the attribute state of the electronic lock according to the switching signal sequence specifically includes:

and querying a state table corresponding to the switching signal sequence to determine a corresponding attribute state, wherein the state table is preset according to the structure of the electronic lock.

Further, the method further comprises:

the first trigger signal is obtained at regular time according to a preset first frequency;

and determining that the electronic lock is in fault in response to acquiring two first trigger signals for representing that the first microswitch is triggered within a time threshold smaller than a preset time threshold.

In a third aspect, an embodiment of the present invention discloses a computer-readable storage medium for storing computer program instructions, wherein the computer program instructions, when executed by a processor, implement the method according to any one of the second aspect.

According to the embodiment of the invention, the motor is controlled to drive the bolt assembly to move, the condition that the first micro switch and the second micro switch are triggered in the moving process of the bolt assembly is determined, so that a switch signal sequence is obtained, and the attribute state of the electronic lock is determined according to the switch signal sequence. The intelligent lock realizes accurate judgment of different attribute states of the intelligent lock, and improves the intelligent degree in the locking and unlocking process.

Drawings

The above and other objects, features and advantages of the present invention will become more apparent from the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:

FIG. 1 is a schematic view of an electronic lock according to an embodiment of the invention;

FIG. 2 is a block diagram of an electronic lock in an alternative implementation of an embodiment of the invention;

FIG. 3 is a block diagram of an electronic lock in accordance with another alternative implementation of an embodiment of the present invention;

FIG. 4 is a schematic diagram of a control device of an electronic lock according to an embodiment of the invention;

FIG. 5 is a flowchart of an electronic lock status detection method according to an embodiment of the invention;

fig. 6 is a schematic diagram of a state table corresponding to a switching signal sequence according to an embodiment of the present invention.

Detailed Description

The present invention will be described below based on examples, but the present invention is not limited to only these examples. In the following detailed description of the present invention, certain specific details are set forth. It will be apparent to one skilled in the art that the present invention may be practiced without these specific details. Well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the present invention.

Further, those of ordinary skill in the art will appreciate that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.

Meanwhile, it should be understood that, in the following description, a "circuit" refers to a conductive loop constituted by at least one element or sub-circuit through electrical or electromagnetic connection. When an element or circuit is referred to as being "connected to" another element or element/circuit is referred to as being "connected between" two nodes, it may be directly coupled or connected to the other element or intervening elements may be present, and the connection between the elements may be physical, logical, or a combination thereof. In contrast, when an element is referred to as being "directly coupled" or "directly connected" to another element, it is intended that there are no intervening elements present.

Unless the context clearly requires otherwise, throughout the description, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is, what is meant is "including, but not limited to".

In the description of the present invention, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified.

Fig. 1 is a schematic view of an electronic lock according to an embodiment of the present invention, and as shown in fig. 1, the electronic lock includes a motor 10, a first microswitch 11, a second microswitch 12, a bolt assembly 13 and a control device 14. Wherein the latch bolt assembly 13 comprises a latch bolt 15, a first triggering device 16 and a second triggering device 17.

Specifically, the motor 10 is connected to the latch bolt assembly 13 and the control device 14, and when the control device 14 receives an unlocking instruction, the motor 10 is started, so that the motor 10 drives the latch bolt assembly 13 to move. During the movement of the latch bolt assembly 13, the first trigger device 16 and the second trigger device 17 are respectively used for changing the trigger states of the first microswitch 11 and the second microswitch 12 so as to generate a corresponding first trigger signal and a corresponding second trigger signal. The first trigger signal and the second trigger signal are respectively used for recording the triggering conditions of the first microswitch and the second microswitch, for example, the microswitch in the triggering state is converted into the non-triggering state, or the microswitch in the non-triggering state is triggered. The first microswitch 11 and the second microswitch 12 are connected with the control device 17 and are used for uploading a switch signal pair consisting of a corresponding first trigger signal and a corresponding second trigger signal. After the whole unlocking process is completed, the control device 14 determines a switching signal sequence according to the received multiple switching signal pairs, and then determines a corresponding attribute state according to the switching signal sequence. In this embodiment, the first element in the switching signal sequence is a switching signal pair formed by initial states of the first and second micro switches.

Optionally, the first trigger signal and the second trigger signal may be obtained according to a preset time sequence, for example, the first trigger signal and the second trigger signal are obtained for the first time at a motor starting time t, the first trigger signal and the second trigger signal are obtained for the second time at a time t + n, the first trigger signal and the second trigger signal are obtained for the third time at a time t + m, and when a changed signal is not obtained at the preset time, the first trigger signal and the second trigger signal are obtained multiple times within a preset time range according to a preset second frequency. And m is greater than n, and n and m are preset constants and can be determined by historical unlocking time length. The n and m determining process may be to determine the motor starting time, the time when the trigger states of the first microswitch 11 and the second microswitch 12 change and the time when unlocking is completed in the historical normal unlocking process, and determine that the shortest time between the time when the trigger states of the first microswitch 11 and the second microswitch 12 change in the unlocking process and the time when unlocking is completed and the motor starting time is n and m.

Further, the process of acquiring the first trigger signal and the second trigger signal may also be that when the motor 10 is started, the unlocking process is completed, and the trigger state of the first micro switch 11 or the second micro switch 12 is changed, the first trigger signal and the second trigger signal are automatically sent to the control device 14, and the control device 14 combines the trigger signal corresponding to the micro switch received this time and the trigger signal corresponding to the other micro switch in the previous switch signal pair into the switch signal pair received this time. For example, in the case where the first microswitch 11 is not triggered and the second microswitch 12 is triggered, the control device 14 obtains that the initial switch signal pair of the first microswitch 11 and the second microswitch 12 is "01", when the first microswitch 11 is triggered, the first trigger signal is "1", and the control device 14 combines the first trigger signal "1" and the second trigger signal "1" in the previous switch signal pair into a new switch signal pair "11".

In an optional implementation manner of this embodiment, in the latch bolt assembly 13, a first protruding portion and a second protruding portion are provided on both sides of the latch bolt 15, and are respectively used as the first triggering device 16 and the second triggering device 17. Under the driving of the motor 10, the latch bolt 15 moves up and down, i.e. the first trigger device 16 and the second trigger device 17 also move up and down along with the latch bolt 15.

During unlocking, the locking bolt assembly is configured to move from a first locked position to a first intermediate position in a direction in which the first trigger device 16 is away from the first microswitch 11, and then to a first unlocked position in a direction in which the second trigger device 17 is away from the second microswitch 12. Wherein the first locked position is a position in which the first microswitch 11 is triggered by the first triggering device 16 and the second microswitch 12 is not triggered by the second triggering device 17, the first intermediate position is a position in which the first microswitch 11 is not triggered by the first triggering device 16 and the second microswitch 12 is triggered by the second triggering device 17, and the first unlocked position is a position in which the first microswitch 11 is not triggered by the first triggering device 16 and the second microswitch 12 is not triggered 17 by the second triggering device.

Fig. 2 is a structural diagram of an electronic lock in an optional implementation manner according to an embodiment of the present invention, as shown in fig. 2, in an optional implementation manner of this embodiment, in the latch bolt assembly, a first protruding portion and a second protruding portion are disposed on two sides of the latch bolt 21, and are respectively used as the first trigger device 24 and the second trigger device 25. Under the driving of the motor 20, the latch bolt 21 moves up and down, i.e. the first trigger device 24 and the second trigger device 25 also move up and down along with the latch bolt 21.

During unlocking, the locking bolt assembly is configured to move from a first locked position to a first intermediate position in which the first trigger 24 is spaced away from the first microswitch 22, and then to a first unlocked position in which the second trigger 25 is spaced away from the second microswitch 23. Wherein the first locked position is a position in which the first microswitch 22 is triggered by the first triggering device 24 and the second microswitch 23 is not triggered by the second triggering device 25, the first intermediate position is a position in which the first microswitch 22 is not triggered by the first triggering device 24 and the second microswitch 23 is triggered by the second triggering device 25, and the first unlocked position is a position in which the first microswitch 22 is not triggered by the first triggering device 24 and the second microswitch 23 is not triggered 25 by the second triggering device.

In this implementation, the first trigger signal and the second trigger signal corresponding to the first microswitch 22 and the second microswitch 23 can be set by changing the wiring manner. For example, when the first microswitch 22 and the second microswitch 23 are wired the same, the first trigger signal generated when the first microswitch 22 is triggered is "1", and the first trigger signal generated when the first microswitch is not triggered is "0"; when the second microswitch 23 is triggered, the second trigger signal is generated to be 1, and when the second microswitch is not triggered, the second trigger signal is generated to be 0.

When the electronic lock is in a locked state, the bolt 21 is inserted into the lock pin 27, and the first trigger 24 contacts the first microswitch 22, so that the first microswitch 22 is in a triggered state. While the second trigger means 25 is remote from the second microswitch 23, the second microswitch 23 is in an unactuated state. Therefore, in the locked state, the first trigger signal of the first microswitch is "1", and the second trigger signal of the second microswitch is "0". The first microswitch is used for judging whether the electronic lock is opened or closed, and the second microswitch is used for controlling the motor 20 to stop.

The motor 20, the first microswitch 22 and the second microswitch 23 are connected to the control device 26 by means of transmission lines 28. When the electronic lock works normally, after receiving an unlocking instruction, the control device 26 obtains a switching signal pair "10" formed by the first trigger signal and the second trigger signal, and starts the motor 20 at the same time. The motor 20 controls the latch bolt 21 to move upwards, so that the first microswitch 22 and the first trigger device 24 are separated, and the second microswitch 23 is in contact with the second trigger device 25. Therefore, the first microswitch 22 and the second microswitch 23 respectively send a switch signal pair "01" consisting of a first trigger signal "0" and a second trigger signal "1" to the control device 26 based on the trigger condition. After the second microswitch 23 is in contact with the second triggering device 25, the control device 26 turns off the motor 20 based on the received second triggering signal "1". After the motor 20 is turned off, the lock tongue 21 moves downwards for a certain distance due to the elastic force of the spring, so that the second microswitch 23 is separated from the second trigger device 25, and the first microswitch 22 is not in contact with the first trigger device 24. Therefore, the first microswitch 22 and the second microswitch 23 respectively send the switch signal pair "00" composed of the first trigger signal "0" and the second trigger signal "0" to the control device 26 based on the trigger condition. Finally, when the electronic lock is unlocked, the control device 26 obtains a switching signal sequence of "10-01-00".

Under the condition that the motor 20 is completely locked, after receiving an unlocking instruction, the control device 26 obtains a switch signal pair 10 consisting of the first trigger signal and the second trigger signal, and simultaneously starts the motor 20, the trigger conditions of the first microswitch 22 and the second microswitch 23 are not changed in the whole unlocking process due to the locking of the motor 20, and the switch signal sequence finally obtained by the control device 26 is 10-10-10.

Under the condition that the motor 20 is partially locked, after receiving an unlocking instruction, the control device 26 obtains a switch signal pair "10" consisting of the first trigger signal and the second trigger signal, and starts the motor 20 at the same time, so that the first microswitch 22 and the first trigger device 24 can be separated due to the partial locking of the motor 20 to obtain a first trigger signal "0", but the second microswitch 23 cannot be in contact with the second trigger device 25, and the second trigger signal is still "0", so that the motor cannot be stopped. Therefore, the switching signal sequence finally obtained by the control device 26 is "10-00-00".

In case of failure of the first microswitch 22, the control device 26 controls the normal movement of the locking bolt 21 to complete the whole unlocking process, but the first trigger signal is not changed in the process. The switching signal sequence finally obtained by the control device 26 is "10-11-10".

In the event of a failure of the second microswitch 23, the control device 26 controls the normal movement of the locking bolt 21 to complete the whole unlocking process, but the second trigger signal is not changed in the process. The switching signal sequence finally obtained by the control device 26 is "10-00-00".

Under the condition that the first microswitch 22 and the second microswitch 23 are in failure, the control device 26 controls the bolt 21 to normally move to complete the whole unlocking process, but the first trigger signal and the second trigger signal are not changed in the process. The switching signal sequence finally obtained by the control device 26 is "10-10-10".

Therefore, based on the switch signal sequences and the corresponding conditions, the attribute state corresponding to the switch signal sequence of 10-01-00 is normal unlocking, the attribute state corresponding to the switch signal sequence of 10-10-10 is complete jamming of the motor or failure of both the first microswitch and the second microswitch, the attribute state corresponding to the switch signal sequence of 10-00-00 is partial jamming of the motor or failure of the second microswitch, the attribute state corresponding to the switch signal sequence of 10-11-10 is failure of the first microswitch, and the state table corresponding to the electronic lock can be constructed based on the corresponding relationship.

Optionally, before determining the corresponding attribute state based on the switching signal sequence, it may be further preliminarily determined whether the electronic lock is faulty according to the first trigger signal. For example, the first trigger signal is acquired at regular time according to a preset first frequency in the unlocking process, and in response to the acquisition of two first trigger signals for indicating that the first microswitch is triggered within a time threshold value smaller than a preset time threshold value, the electronic lock is determined to be in fault. After the electronic lock is judged to have a fault, the type of the fault can be further determined according to the switching signal sequence.

Fig. 3 is a structural diagram of an electronic lock according to another alternative implementation manner of the embodiment of the present invention, as shown in fig. 3, in the latch assembly, in the alternative implementation manner of this embodiment, the first triggering device 34 is a third protruding portion disposed on one side of the latch 31, the motor 30 includes a driving rod, the second triggering device 35 is a paddle perpendicular to the driving rod and rotating with the driving rod, under the driving of the motor 30, the first triggering device 34 moves up and down with the latch 31, and the second triggering device 35 rotates with the driving rod.

During unlocking, the locking bolt assembly is configured to move the locking bolt 31 from the second locking position to a second intermediate position in a direction in which the first trigger device 34 approaches the first microswitch 32, and then to a second unlocking position in a direction in which the first trigger device 34 moves away from the first microswitch 32, and at the same time, the second trigger device 35 rotates with the driving shaft of the motor 30 by one turn from the position in which the second microswitch 33 is triggered. Wherein the second locked position is a position in which the first microswitch 32 is not triggered by the first triggering device 34, the second intermediate position is a position in which the first microswitch 32 is triggered by the first triggering device 34, and the second unlocked position is between the second locked position and the second intermediate position.

In this implementation, the first trigger signal and the second trigger signal corresponding to the first microswitch 32 and the second microswitch 33 can be set by changing the wiring manner. For example, when the wiring of the first and second micro switches 32 and 33 is opposite, the first trigger signal generated when the first micro switch 32 is triggered is "1", and the first trigger signal generated when the first micro switch is not triggered is "0"; when the second microswitch 33 is triggered, the second trigger signal is generated to be '0', and when the second microswitch is not triggered, the second trigger signal is generated to be '1'.

When the electronic lock is in a locked state, the bolt 31 is inserted into the lock pin, the first trigger device 34 does not contact the first microswitch 32, and the first microswitch 32 is in an unactuated state. Meanwhile, the second trigger device 35 contacts with the second microswitch 33, so that the second microswitch 33 is in a triggered state. Therefore, in the locked state, the first trigger signal of the first microswitch is "0", and the second trigger signal of the second microswitch is "0". The first microswitch is used for judging whether the electronic lock is opened or closed, and the second microswitch is used for controlling the motor 30 to stop.

The motor 30, the first microswitch 32 and the second microswitch 33 are connected to the control device 38 by a transmission line 3A. When the electronic lock works normally, after receiving an unlocking instruction, the control device 38 obtains a switching signal pair "00" formed by the first trigger signal and the second trigger signal, and starts the motor 30 at the same time. The driving shaft 36 of the motor 30 drives the cylindrical follower 37 to rotate around the driving shaft 36, and during the rotation of the follower 37, the driving unit 39 arranged on the left side surface of the cylinder drives the bolt 31 to move upwards, and the second trigger 35 arranged on the surface of the cylinder is disengaged from the second microswitch 33. Therefore, the first and second micro switches 32 and 33 respectively transmit a switch signal pair "01" composed of a first trigger signal "0" and a second trigger signal "1" to the control device 38 based on the trigger condition. Under the continuous driving of the motor 30, the latch tongue 31 moves upward until the first trigger device 34 contacts the first microswitch 32, and at this time, the second trigger device 35 is still separated from the second microswitch 33. Therefore, the first and second micro switches 32 and 33 respectively transmit a switch signal pair "11" composed of a first trigger signal "1" and a second trigger signal "1" to the control device 38 based on the trigger condition. After the latch tongue 31 moves upward to a position where the first trigger device 34 contacts the first microswitch 32, the motor continues to operate until the second trigger device 35 contacts the second microswitch 33 again by the driving unit 39. The first and second micro switches 32 and 33 respectively send a switch signal pair "10" composed of a first trigger signal "1" and a second trigger signal "0" to the control device 38 based on the trigger condition. At the same time, the control device 38 switches off the electric motor 30 on the basis of the received second trigger signal "0". After the motor 30 is turned off, the latch bolt 31 moves downward for a certain distance due to the elastic force of the spring, so that the first microswitch 32 is separated from the first trigger device 24. Therefore, the first and second micro switches 32 and 33 respectively transmit a switch signal pair "00" composed of a first trigger signal "0" and a second trigger signal "0" to the control device 38 based on the trigger condition. Finally, when the electronic lock is unlocked, the switching signal sequence obtained by the control device 26 is '00-01-11-10-00'.

Under the condition that the motor 30 is completely locked, the control device 38 obtains a switch signal pair '00' consisting of the first trigger signal and the second trigger signal after receiving an unlocking instruction, and simultaneously starts the motor 30, the trigger conditions of the first microswitch 32 and the second microswitch 33 are not changed in the whole unlocking process due to the locking of the motor 30, and the switch signal sequence finally obtained by the control device 38 is '00-00-00-00-00-00'.

Under the condition that the motor 30 is partially locked, the control device 38 obtains a switch signal pair '00' consisting of the first trigger signal and the second trigger signal after receiving an unlocking instruction, and simultaneously starts the motor 30, so that the lock tongue 31 can only move upwards for a little distance due to the partial locking of the motor 30, the first microswitch 32 cannot be in contact with the first trigger device 34, the first trigger signal is still '0', but the second microswitch 33 is separated from the second trigger device 35, and the second trigger signal is '1', so that the motor cannot be stopped. Therefore, the switching signal sequence finally obtained by the control device 38 is "00-01-01-01-01".

In case of failure of the first microswitch 32, the control device 38 controls the normal movement of the locking bolt 31 to complete the whole unlocking process, but the first trigger signal is not changed in the process. The switching signal sequence finally obtained by the control device 38 is "00-01-01-00-00".

In case of failure of the second microswitch 33, the control device 36 controls the normal movement of the locking bolt 31 to complete the whole unlocking process, but the second trigger signal is not changed in the process. The switching signal sequence finally obtained by the control device 36 is "00-00-10-10-00".

Under the condition that the first microswitch 32 and the second microswitch 33 are in failure, the control device 38 controls the bolt 31 to normally move to complete the whole unlocking process, but the first trigger signal and the second trigger signal are not changed in the process. The switching signal sequence finally obtained by the control device 38 is "00-00-00-00-00".

Therefore, based on the switch signal sequences and the corresponding conditions, the attribute state corresponding to the switch signal sequence 00-01-11-10-00 is normal unlocking, the attribute state corresponding to the switch signal sequence 00-00-00-00 is complete jamming of the motor or failure of both the first micro switch and the second micro switch, the attribute state corresponding to the switch signal sequence 00-01-01-01 is partial jamming of the motor, the attribute state corresponding to the switch signal sequence 00-01-01-00-00 is failure of the first micro switch, the attribute state corresponding to the switch signal sequence 00-00-10-10-00 is failure of the second micro switch, and a state table corresponding to the electronic lock can be constructed based on the corresponding relationship.

Optionally, before determining the corresponding attribute state based on the switching signal sequence, it may be further preliminarily determined whether the electronic lock is faulty according to the first trigger signal. For example, the first trigger signal is acquired at regular time according to a preset first frequency in the unlocking process, and in response to the acquisition of two first trigger signals for indicating that the first microswitch is triggered within a time threshold value smaller than a preset time threshold value, the electronic lock is determined to be in fault. After the electronic lock is judged to have a fault, the type of the fault can be further determined according to the switching signal sequence.

Fig. 4 is a schematic diagram of a Control device of an Electronic lock according to an embodiment of the present invention, and as shown in fig. 4, in this embodiment, the Control Unit 13 may be implemented by an ECU (Electronic Control Unit). The ECU is a vehicle-specific microcomputer controller, and includes a processor 41 and a memory 42. The Processor 41 may be implemented by an MCU (micro Controller Unit), a PLC (Programmable Logic Controller), an FPGA (Field-Programmable Gate Array), a DSP (digital signal Processor), or an asic (application specific integrated circuit). The processor 41 and the memory 42 are connected by a bus 43, while the bus 43 is also connected to input/output (I/O) devices 44. In the present embodiment, the input/output (I/O) devices 44 are the motor 10, the first microswitch 11 and the second microswitch 12. Typically, an input/output (I/O) device 44 is connected to the system through an input/output (I/O) controller 45.

Therefore, the control unit 13 can perform information transmission with the motor 10, the first microswitch 11 and the second microswitch 12, execute the command stored in the memory 42 through the processor 41, that is, receive an unlocking instruction, start the motor according to the unlocking instruction to control the movement of the deadbolt assembly, record the condition that the first microswitch and the second microswitch are triggered during the movement of the deadbolt assembly to determine a switch signal sequence, wherein the switch signal sequence includes a plurality of switch signal pairs arranged in time sequence, and the switch signal pairs include a first trigger signal and a second trigger signal, wherein the first trigger signal is used for representing the state of the first microswitch, and the second trigger signal is used for representing the state of the second microswitch. And determining the attribute state of the electronic lock according to the switch signal sequence so as to realize the processing of the first trigger signal and the second trigger signal uploaded by the first microswitch and the second microswitch and the control of other devices in the electronic lock in the embodiment of the invention.

The electronic lock can control the motor to drive the lock tongue assembly to move through the control device, the condition that the first micro switch and the second micro switch are triggered in the moving process of the lock tongue assembly is determined, a switch signal sequence is obtained, the attribute state of the electronic lock is determined according to the switch signal sequence, finally, the different attribute states of the intelligent lock are accurately judged, and the intelligent degree in the locking and unlocking process is improved.

Fig. 5 is a flowchart of a method for detecting a state of an electronic lock according to an embodiment of the present invention, where the electronic lock includes a motor, a latch bolt assembly, a first micro switch, and a second micro switch, and the latch bolt assembly includes a latch bolt, a first trigger device for triggering the first micro switch, and a second trigger device for triggering the second micro switch. As shown in fig. 5, the method includes:

and step S100, receiving an unlocking instruction.

Specifically, the unlocking instruction is sent by a terminal device or a server bound with the electronic lock, and is received by a control device built in the electronic lock. When the unlocking instruction is sent by the terminal equipment, the terminal equipment can send the unlocking instruction to the electronic lock in modes of scanning the two-dimensional code, triggering a display interface to send an unlocking instruction control and the like. Optionally, the unlocking instruction may also be directly input by an input unit of the electronic lock through a user, where the input unit may be, for example, a keyboard, a touch display screen, a fingerprint input device, a voice recognition device, a face recognition device, or other hardware devices capable of performing information transmission with the electronic lock.

In this embodiment, the unlocking instruction may further include an unlocking key and information such as a specified unlocking time, where the unlocking key may be a password, audio information, video information, or the like.

And S200, starting a motor according to the unlocking instruction to control the movement of the bolt assembly.

Specifically, after receiving the unlocking instruction, the control device of the electronic lock starts a motor arranged in the electronic lock according to the content of the unlocking instruction, and controls the movement of a lock tongue component of the electronic lock.

In an optional implementation manner of this embodiment, a first protruding portion and a second protruding portion are disposed on two sides of the lock tongue in the lock tongue assembly, and are respectively used as the first trigger device and the second trigger device. Under the drive of the motor, the lock tongue moves up and down, namely the first trigger device and the second trigger device move up and down along with the lock tongue.

In the unlocking process, the movement process of the bolt assembly is to move from a first locking position to a direction that the first trigger device is far away from the first microswitch to a first middle position, and then to move from the first middle position to a direction that the second trigger device is far away from the second microswitch to a first unlocking position. Wherein the first locked position is a position in which the first microswitch is not triggered by the first triggering device and the second microswitch is not triggered by the second triggering device, the first intermediate position is a position in which the first microswitch is not triggered by the first triggering device and the second microswitch is triggered by the second triggering device, and the first unlocked position is a position in which the first microswitch is not triggered by the first triggering device and the second microswitch is not triggered by the second triggering device.

In another optional implementation manner of this embodiment, the first triggering device in the lock tongue assembly is a third protruding portion disposed on one side of the lock tongue, the motor includes a driving rod, the second triggering device is a shifting piece perpendicular to the driving rod and rotating along with the driving rod, the first triggering device moves up and down along with the lock tongue under the driving of the motor, and the second triggering device rotates along with the driving rod.

In the unlocking process, the movement process of the lock bolt assembly is that the lock bolt moves from a second locking position to a direction that the first trigger device approaches the first microswitch to a second middle position, then moves to a second unlocking position to a direction that the first trigger device is far away from the first microswitch, and meanwhile, the second trigger device starts to rotate for a circle along with the driving shaft of the motor from the position triggering the second microswitch. Wherein the second locked position is a position in which the first microswitch is not triggered by the first triggering device, the second intermediate position is a position in which the first microswitch is triggered by the first triggering device, and the second unlocked position is between the second locked position and the second intermediate position.

Step S300, acquiring the condition that the first microswitch and the second microswitch are triggered in the movement process of the bolt assembly so as to determine a switch signal sequence.

Specifically, the switching signal sequence comprises a plurality of switching signal pairs arranged in a time sequence, and the switching signal pairs comprise a first trigger signal and a second trigger signal, wherein the first trigger signal is used for representing the state of the first microswitch, and the second trigger signal is used for representing the state of the second microswitch.

In this embodiment, the process of determining the switching signal sequence may include:

step S310, acquiring the condition that the first microswitch and the second microswitch are triggered in the movement process of the bolt assembly according to a preset time sequence so as to determine a corresponding first trigger signal and a corresponding second trigger signal.

Specifically, the predetermined time sequence is used for determining and acquiring the time when each of the first micro switch and the second micro switch is triggered, and may include a motor starting time t, an unlocking process time t + n, and an unlocking completion time t + m. And m is greater than n, and n and m are preset constants and can be determined by historical unlocking time length. Therefore, the control device of the electronic lock can acquire the first trigger signal and the second trigger signal for the first time at the motor starting time t, acquire the first trigger signal and the second trigger signal for the second time at the time t + n, and acquire the first trigger signal and the second trigger signal for the third time at the time t + m.

Step S320, inputting the first trigger signal and the second trigger signal obtained each time as a switch signal pair into the switch signal sequence.

Specifically, after acquiring a first trigger signal and a second trigger signal each time, the control device combines the first trigger signal and the second trigger signal into a switching signal pair, and inputs the switching signal pair into the switching signal sequence. For example, when the first trigger signal is "0", the second trigger signal is "0", and the current switching signal sequence is "10-01", the switching signal sequence is input with the "0" and "1" forming a switching signal pair of "01", and a new switching signal sequence of "10-01-00" is obtained.

Optionally, the control device may further obtain a first trigger signal and a second trigger signal once when the motor is started, and in the unlocking process, obtain the first trigger signal and the second trigger signal each time the state of the first microswitch or the second microswitch is changed until the whole unlocking process is completed.

And step S400, determining the attribute state of the electronic lock according to the switching signal sequence.

Specifically, after receiving the switching signal sequence, the control device queries a state table corresponding to the switching signal sequence to determine a corresponding attribute state, where the state table is preset according to a structure of the electronic lock. The state table may be stored in a memory in the control device or in an external storage device to which the control device is connected.

Fig. 6 is a schematic diagram of a state table corresponding to a switching signal sequence according to an embodiment of the present invention, and as shown in fig. 6, the state table describes a corresponding relationship between the switching signal sequence and an attribute state. Optionally, in the state table, each switching signal sequence may correspond to one or more attribute states.

Optionally, before determining the corresponding attribute state based on the switching signal sequence, it may be further preliminarily determined whether the electronic lock is faulty according to the first trigger signal. For example, the first trigger signal is also acquired at regular time according to a preset first frequency in the unlocking process, and in response to the acquisition of two first trigger signals for indicating that the first microswitch is triggered within a time threshold value smaller than a preset time threshold value, the electronic lock is determined to be in fault. After the electronic lock is judged to have a fault, the type of the fault can be further determined according to the switching signal sequence.

In an optional implementation manner of this embodiment, the attribute state corresponding to the switching signal sequence "10-01-00" is normal unlocking, the attribute state corresponding to the switching signal sequence "10-10-10" is complete jamming of the motor or failure of both the first micro switch and the second micro switch, the attribute state corresponding to the switching signal sequence "10-00-00" is partial jamming of the motor or failure of the second micro switch, and the attribute state corresponding to the switching signal sequence "10-11-10" is failure of the first micro switch.

In another optional implementation manner of this embodiment, the attribute state corresponding to the switching signal sequence "00-01-11-10-00" is normal unlocking, the attribute state corresponding to the switching signal sequence "00-00-00-00" is complete jamming of the motor or failure of both the first micro switch and the second micro switch, the attribute state corresponding to the switching signal sequence "00-01-01-01" is partial jamming of the motor, the attribute state corresponding to the switching signal sequence "00-01-01-00" is failure of the first micro switch, and the attribute state corresponding to the switching signal sequence "00-00-10-10-00" is failure of the second micro switch.

And after determining the attribute state corresponding to the switching signal sequence according to the state table, the control device can send the attribute state or the corresponding error code to the terminal equipment bound by the electronic lock. Or sending the attribute state to a server connected with the electronic lock so as to monitor and maintain the state of the electronic lock according to the acquired attribute state.

The method comprises the steps of controlling a motor to drive a lock tongue assembly to move, determining the condition that a first microswitch and a second microswitch are triggered in the moving process of the lock tongue assembly so as to obtain a switch signal sequence, and determining the attribute state of the electronic lock according to the switch signal sequence. The intelligent lock realizes accurate judgment of different attribute states of the intelligent lock, and improves the intelligent degree in the locking and unlocking process.

The present invention also relates to a computer-readable storage medium for storing a computer-readable program for causing a computer to perform some or all of the above-described method embodiments.

That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:具固定结构的磁力锁

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!