Electronic lock unlocking method, device, electronic lock and readable storage medium
By monitoring the motor current to determine the state of the electronic lock and adjust the driving current, the problem of poor unlocking flexibility of the electronic lock in different states is solved, achieving a better user experience.
Patent Information
- Application Number
- CN202211410697.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-11-11
AI Technical Summary
Existing electronic lock unlocking methods have poor flexibility in stable or normal states and provide a poor user experience.
By monitoring the current signal of the motor during the unlocking process, the state of the electronic lock is judged, and the driving current of the motor is adjusted to control its operation in an abnormal state until the state is normal to ensure successful unlocking.
The flexibility and adaptability of electronic locks in different states are improved, which enhances the user experience.
Smart Images

Figure CN115713822B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart electronic locks, and in particular to an electronic lock unlocking method, device, electronic lock and readable storage medium. Background Art
[0002] With the widespread application of smart electronic lock technology, especially for electric doors and windows, the use of electronic locks can eliminate the need for keys to unlock, making unlocking more timely and avoiding safety issues caused by lost keys. Therefore, it has greatly improved people's quality of life and safety. Electronic locks are usually a mechanical structure that can be separated and merged. Currently, the control of electronic lock unlocking usually uses a fixed input current to control the rotation of the motor, thereby driving the gearbox to rotate for unlocking. However, the unlocking method in the existing technology is only applicable when the entire electronic lock is in a stable or normal state, which is less flexible and provides a poor user experience.
[0003] Therefore, how to improve the flexibility of unlocking electronic locks has become a technical problem that needs to be solved urgently. Summary of the Invention
[0004] In response to the problems existing in the prior art, the present invention provides an electronic lock unlocking method, device, electronic lock and readable storage medium, so that the electronic lock can be adaptively unlocked in different states, improving the flexibility and adaptability of electronic lock unlocking and providing a better user experience.
[0005] In order to achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:
[0006] In a first aspect, an embodiment of the present invention provides a method for unlocking an electronic lock, comprising:
[0007] In response to an unlocking instruction, controlling the motor in the electronic lock to start running and collecting a current signal of the motor during the unlocking time;
[0008] Acquiring a state of the electronic lock according to the current signal, wherein the state includes an abnormal state and a normal state;
[0009] If the electronic lock is in the abnormal state, adjusting the driving current of the motor to control the operation of the motor, and re-obtaining the state of the electronic lock;
[0010] If the electronic lock is in the normal state, the motor is controlled to run to a predetermined position so that the electronic lock is unlocked successfully.
[0011] In one embodiment, obtaining the state of the electronic lock according to the current signal includes:
[0012] monitoring whether the current signal is within a preset range during the unlocking time;
[0013] If not, obtaining the state of the electronic lock as the abnormal state;
[0014] If so, the state of the electronic lock is obtained as the normal state.
[0015] In one embodiment, the abnormal state includes a continuous abnormal state and an intermittent abnormal state. After obtaining the state of the electronic lock as the abnormal state, the method further includes:
[0016] Counting the time period of the abnormal state and determining whether the time period is equal to the unlocking time;
[0017] If they are equal, it is determined that the abnormal state is the continuous abnormal state;
[0018] If not, it is determined that the abnormal state is the intermittent abnormal state.
[0019] In one embodiment, if the electronic lock is in the abnormal state, adjusting the driving current of the motor to control the operation of the motor and re-obtaining the state of the electronic lock includes:
[0020] If the electronic lock is in the persistent abnormal state, the driving current of the motor is adjusted to increase the driving current by a first preset value to control the motor to run in the forward direction.
[0021] In one embodiment, if the electronic lock is in the abnormal state, adjusting the driving current of the motor to control the operation of the motor and re-obtaining the state of the electronic lock includes:
[0022] If the electronic lock is in the intermittent abnormal state, the driving current of the motor is adjusted to reduce the driving current by a second preset value to control the motor to run in the reverse direction.
[0023] In one embodiment, if the electronic lock is in the abnormal state, after adjusting the driving current of the motor to control the operation of the motor and re-acquiring the state of the electronic lock, the method further includes:
[0024] Count the number of times it has been retrieved;
[0025] If the number of times exceeds a preset number, the electronic lock is controlled to stop unlocking and it is determined that the electronic lock is damaged.
[0026] In one embodiment, before responding to the unlock instruction, the method further includes:
[0027] A preset number of Hall signals are set so that the motor runs to the predetermined position according to the Hall signals.
[0028] In a second aspect, an embodiment of the present invention provides an electronic lock unlocking device, comprising:
[0029] a control module, configured to respond to an unlocking instruction, control the motor in the electronic lock to start running, and collect a current signal of the motor during the unlocking time;
[0030] an acquisition module, configured to acquire a state of the electronic lock according to the current signal, wherein the state includes an abnormal state and a normal state;
[0031] an abnormality module, configured to adjust the driving current of the motor to control the operation of the motor and re-acquire the state of the electronic lock if the electronic lock is in the abnormal state;
[0032] The normal module is used to control the motor to run to a predetermined position if the electronic lock is in the normal state, so that the electronic lock is unlocked successfully.
[0033] In a third aspect, an embodiment of the present invention provides an electronic lock, comprising: a motor, a processor, and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the electronic lock unlocking method as described above.
[0034] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the electronic lock unlocking method described above is executed.
[0035] Embodiments of the present invention disclose an electronic lock unlocking method, device, electronic lock, and readable storage medium. The method includes: responding to an unlocking instruction, controlling a motor within the electronic lock to start operating and collecting a current signal from the motor within the unlocking time; obtaining a state of the electronic lock based on the current signal, wherein the state includes an abnormal state and a normal state; if the electronic lock is in the abnormal state, adjusting the drive current of the motor to control the motor operation and re-obtaining the state of the electronic lock; if the electronic lock is in the normal state, controlling the motor to operate to a predetermined position to successfully unlock the electronic lock. Compared with the prior art, this embodiment monitors the state of the electronic lock within the unlocking time and controls the electronic lock to unlock in different states, thereby enabling the electronic lock to adaptively unlock in different states, improving the flexibility and adaptability of electronic lock unlocking and providing a better user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope of protection of the present invention. In each of the drawings, similar components are numbered similarly.
[0037] Figure 1 A schematic diagram showing a flow chart of a method for unlocking an electronic lock according to an embodiment of the present invention is shown;
[0038] Figure 2 A schematic diagram of a process for obtaining the status of an electronic lock according to an embodiment of the present invention is shown;
[0039] Figure 3 A schematic diagram of a process for counting the number of re-acquisitions in an embodiment of the present invention is shown;
[0040] Figure 4 A schematic structural diagram of an electronic lock unlocking device in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0041] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0042] The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the figures is not intended to limit the scope of the claimed invention, but rather merely represents selected embodiments of the present invention. All other embodiments derived by those skilled in the art based on the embodiments of the present invention without inventive effort are intended to be within the scope of protection of the present invention.
[0043] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present invention, are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or the possibility of adding one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.
[0044] Furthermore, the terms “first,” “second,” “third,” etc., are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0045] Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by those skilled in the art to which the various embodiments of the present invention pertain. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meaning as in the context of the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning unless clearly defined in the various embodiments of the present invention.
[0046] Example 1
[0047] Please refer to Figure 1 This embodiment provides a method for unlocking an electronic lock, which specifically includes the following steps:
[0048] Step S110: In response to the unlocking instruction, the motor in the electronic lock is controlled to start running and the current signal of the motor during the unlocking time is collected.
[0049] Specifically, when the user opens the electronic lock and enters the unlock command, the electronic lock will respond to the unlock command, wherein the unlock command can be a password entered by the user or a fingerprint entered. The specific unlock command can be responded to according to the actual situation and is not limited here.
[0050] It should be understood that the electronic lock usually includes main components such as a power supply, a controller, a motor and a gearbox. The power supply provides power for the operation of the entire electronic lock. The execution process of the electronic lock is: when the controller receives an unlocking command and responds, it controls the motor to start running, thereby driving the gearbox to rotate, thereby achieving unlocking.
[0051] Furthermore, when the controller receives an unlock command, i.e., when the electronic lock responds to the unlock command, the electronic lock controls the motor via the controller to begin operating, while simultaneously collecting the motor's current signal during the unlock time. Specifically, the unlock time refers to the period between the electronic lock responding to the unlock command and the electronic lock successfully unlocking. This embodiment uses a current signal sensor to collect the motor's current signal during the entire unlock time in real time, thereby determining the electronic lock's status based on the current signal. This eliminates the need for an additional position sensor on the gearbox to monitor the electronic lock's status, reducing the burden on the gearbox.
[0052] Step S120: Acquire the state of the electronic lock according to the current signal, wherein the state includes an abnormal state and a normal state.
[0053] It should be understood that a motor typically generates an operating signal during operation. Therefore, the current signal in this embodiment refers to a signal corresponding to the operating current of the motor during operation. The electronic lock state includes an abnormal state and a normal state. When the electronic lock is in a normal state, it can be successfully unlocked after responding to an unlock command. However, when the electronic lock is in an abnormal state, it will not be successfully unlocked even after responding to an unlock command.
[0054] Therefore, by using the current signal collected in real time to determine the state of the electronic lock, the electronic lock can adapt to different states during the subsequent unlocking operation, thereby improving the efficiency and flexibility of unlocking the electronic lock.
[0055] Step S130: If the electronic lock is in the abnormal state, adjusting the driving current of the motor to control the operation of the motor, and re-acquiring the state of the electronic lock.
[0056] Specifically, when the electronic lock is in an abnormal state, it means that even if the normal unlocking process is executed, the electronic lock will not be successfully unlocked. There are two common situations in which the electronic lock is in an abnormal state. The first situation is that the motor is running but the motor's output torque is insufficient to drive the gearbox to rotate, resulting in the electronic lock failing to unlock. The second situation is that the motor is running but the motor's output torque is too high, causing the gearbox to over-rotate, resulting in the electronic lock failing to unlock.
[0057] Therefore, when the electronic lock is in an abnormal state, the driving current of the motor needs to be adjusted. When the output torque of the motor is insufficient, the output torque of the motor needs to be increased. Usually, the corresponding relationship between the driving current and the output torque can be found according to the motor specification. The output torque is usually proportional to the driving current. Therefore, when the output torque of the motor is small, the driving current is increased to increase the output torque of the motor. When the output torque of the motor is too large, the driving current is reduced to reduce the output torque of the motor.
[0058] After adjusting the driving current and controlling the motor to restart, it is necessary to re-acquire the state of the electronic lock and further determine the adjusted state of the electronic lock so as to more accurately control the subsequent unlocking of the electronic lock.
[0059] Step S140: If the electronic lock is in the normal state, controlling the motor to run to a predetermined position so that the electronic lock is unlocked successfully.
[0060] Specifically, when the electronic lock is in a normal state, that is, the motor in the electronic lock is operating normally, the gear box is disengaged when the motor reaches a predetermined position, thereby successfully unlocking the electronic lock. The predetermined position refers to the position of the motor when the electronic lock is unlocked.
[0061] It can be understood that the electronic lock can only be successfully unlocked when the electronic lock is in a normal state and the motor runs to a predetermined position. Therefore, when the electronic lock is in an abnormal state, it is necessary to first adjust the driving current of the motor and collect the state of the electronic lock at the same time. If the state of the electronic lock is always abnormal, it is necessary to keep adjusting the driving current of the motor until the state of the electronic lock is normal.
[0062] It can be understood that step S130 and step S140 are not simply executed in sequence. When the electronic lock is in different states, corresponding different steps are executed. When the electronic lock is in a normal state, step S140 is directly executed. When the electronic lock is in an abnormal state, S130 is executed first, and the normal unlocking step is not executed until the electronic lock is detected to be in a normal state. This allows the electronic lock to be unlocked in various states, thereby improving the flexibility of unlocking the electronic lock.
[0063] Therefore, this embodiment monitors the state of the electronic lock within the unlocking time and controls the unlocking of the electronic lock in different states, so that the electronic lock can be adaptively unlocked in different states, thereby improving the flexibility and adaptability of unlocking the electronic lock and providing a better user experience.
[0064] Please refer to Figure 2 In one embodiment, step S120 specifically includes:
[0065] Step S121: monitoring whether the current signal is within a preset range during the unlocking time;
[0066] Step S122: If not, obtaining the state of the electronic lock as the abnormal state;
[0067] Step S123: If yes, obtain the state of the electronic lock as the normal state.
[0068] It should be understood that during the unlocking process, the motor within the electronic lock has a preset operating voltage. Within the tolerance range of the preset operating voltage, the motor can drive the gearbox to a preset position, thereby unlocking the electronic lock. Specifically, this embodiment uses a current signal sensor to monitor the current signal in real time, which can accurately determine the status of the electronic lock.
[0069] In one embodiment, the abnormal state includes a continuous abnormal state and an intermittent abnormal state. After step S122, the following steps are specifically further performed:
[0070] Counting the time period of the abnormal state and determining whether the time period is equal to the unlocking time;
[0071] If they are equal, it is determined that the abnormal state is the continuous abnormal state;
[0072] If not, it is determined that the abnormal state is the intermittent abnormal state.
[0073] It should be understood that a continuous abnormal state in this embodiment means that the motor's drive current is not within the preset range during the entire unlocking time, resulting in the electronic lock failing to unlock successfully. During this time, the motor's load increases, making it unable to drive the gearbox. An intermittent abnormal state in this embodiment means that during the unlocking time, the motor's drive current is within the preset range for the first period but not for the second period, causing the gearbox to over-rotate. It should be understood that the entire unlocking time is the sum of the first and second periods. There is no distinction between the first and second periods in length; the order in which these periods occur differs.
[0074] In one embodiment, when the electronic lock is in the persistent abnormal state, step S130 specifically includes: adjusting the driving current of the motor so that the driving current increases to a first preset value to control the motor to run in the forward direction.
[0075] Specifically, when the electronic lock is in a persistent abnormal state, meaning the motor's drive current is outside a preset range throughout the entire unlocking period, the motor's load increases during the unlocking period, rendering it unable to drive the gearbox. In other words, when the electronic lock is in a persistent abnormal state, the motor is running but the gearbox is not. In this case, the drive current needs to be increased, thereby increasing the motor's output torque to drive the gearbox. Furthermore, because the gearbox does not rotate during the unlocking period, its position does not change. Therefore, the motor is controlled to operate in the forward direction.
[0076] It should be understood that the rotation direction of the motor during the unlocking process of the electronic lock can be set to the unlocking rotation direction. In this embodiment, the forward rotation direction of the motor is regarded as the unlocking rotation direction. The specific unlocking rotation direction can be designed according to actual conditions and is not limited here.
[0077] Furthermore, the driving current is increased by increasing PWM (pulse width modulation). Exemplarily, the PWM is output by increasing a fixed duty cycle, thereby increasing the output current, wherein the fixed duty cycle and the first preset value of the driving current have a certain proportional relationship. For example, when the electronic lock is in the persistent abnormal state, the PWM duty cycle is adjusted so that the driving current increases by the first preset value to control the forward operation of the motor, and the state of the electronic lock is re-judged. If the electronic lock is still in the persistent abnormal state, the PWM duty cycle is adjusted again so that the increased driving current increases by the first preset value again to control the forward operation of the motor, and the state of the electronic lock is re-judged.
[0078] In one embodiment, when the electronic lock is in the intermittent abnormal state, step S130 specifically includes: adjusting the driving current of the motor to reduce the driving current by a second preset value to control the motor to run in reverse.
[0079] Specifically, when the electronic lock is in an intermittent abnormal state, that is, the driving current of the motor of the electronic lock is within the preset range for some time period during the entire unlocking time, the motor runs and drives the gear box to rotate, and the gear box rotates too much. At this time, it is necessary to reduce the driving current, thereby reducing the output torque of the motor, thereby controlling the motor to run in the reverse direction, thereby driving the gear box to rotate in the reverse direction, so that the gear box returns to the initial position. It can be understood that the initial position refers to the position of the gear box when the electronic lock responds to the unlocking command.
[0080] Specifically, the driving current is reduced by reducing PWM. Exemplarily, PWM is output by reducing a fixed duty cycle, thereby reducing the output current. For example, when the electronic lock is in the intermittent abnormal state, the duty cycle of PWM is adjusted so that the driving current is reduced by a second preset value to control the motor to run in the reverse direction, and the state of the electronic lock is re-judged. If the re-judged state of the electronic lock is the continuous abnormal state, the duty cycle of PWM is adjusted so that the driving current is increased by a first preset value to control the motor to run in the forward direction, and the state of the electronic lock is re-judged, and this is repeated in sequence until the state of the electronic lock is normal. The specific adjustment method depends on the actual state of the electronic lock and is not limited here.
[0081] Please refer to Figure 3 In one embodiment, after step S130, the following steps are further included:
[0082] Step S150: Count the number of times of re-acquisition;
[0083] Step S160: If the number of times exceeds a preset number, the electronic lock is controlled to stop unlocking and the electronic lock is determined to be damaged.
[0084] It should be understood that when the state of the electronic lock is abnormal, it is necessary to re-acquire the state of the electronic lock after adjusting the driving current and controlling the operation of the motor. However, the number of re-acquisitions is limited. Therefore, by counting the number of re-acquisitions and comparing the counted number with the preset number, if the number of re-acquisitions exceeds the preset number, it means that the number of times the electronic lock has attempted to unlock has exceeded the upper limit, then the electronic lock is controlled to stop unlocking and it is determined that the electronic lock is damaged. The damage to the electronic lock may refer to damage caused by external force impact or damage caused by aging of the electronic lock structure itself. The specific cause of the damage can be analyzed according to actual conditions and is not limited here.
[0085] Specifically, the preset number of times refers to the maximum number of times the electronic lock can regain its state. If the number of times the electronic lock regains its state exceeds the preset number, the electronic lock immediately stops unlocking, determines that the electronic lock is damaged, and controls the motor to stop running. For example, in this embodiment, an indicator light or alarm can be installed on the electronic lock to alert the user of the damage when the electronic lock is determined to be damaged.
[0086] It should be noted that the execution process of this embodiment is: when the electronic lock is in the continuous abnormal state, the PWM duty cycle is adjusted to increase the driving current by a first preset value to control the forward operation of the motor, and the state of the electronic lock is re-judged. If the electronic lock is still in the continuous abnormal state, then the PWM duty cycle is adjusted again to increase the increased driving current by the first preset value again to control the forward operation of the motor, and the state of the electronic lock is re-judged until the electronic lock is in a normal state and is successfully unlocked, or the number of times the state of the electronic lock is re-acquired exceeds a preset value, and the unlocking is stopped.
[0087] Therefore, this embodiment implements specific unlocking methods according to the state of the electronic lock during the unlocking process, overcomes the influence of unlocking differences of the electronic lock in various states, improves reliability and flexibility, and makes the user's experience better.
[0088] In one embodiment, before step S110, the method further includes:
[0089] A preset number of Hall signals are set so that the motor runs to the predetermined position according to the Hall signals.
[0090] Specifically, before the electronic lock is installed, it will be debugged so that a preset number of Hall signals can be obtained, so that the motor in the electronic lock can operate according to the preset number of Hall signals, and the electronic lock can be successfully unlocked. Among them, the Hall signal in this embodiment usually refers to the position signal of the motor. If the number of Hall signals is different, the corresponding position after the motor rotates will also be different. For example, assuming that the number of motor pole pairs is P, the number of Hall signals collected within a preset time of 1ms is M, and the number of Hall signals for a single pole pair to rotate one circle is N, then the speed n=60*1000*M / P / N (the number of circles the motor rotates per minute) is calculated. The position of the motor can be estimated by the obtained speed and the running time set by the program. Through repeated testing and data collection, it is concluded that the motor can operate to the predetermined position according to the Hall signals according to the preset number of Hall signals, thereby unlocking.
[0091] Example 2
[0092] Corresponding to the above method embodiment, please refer to Figure 4 , Figure 4 The electronic lock unlocking device 100 includes a control module 110 , an acquisition module 120 , an abnormal module 130 and a normal module 140 .
[0093] The control module 110 is configured to respond to an unlocking instruction, control the motor in the electronic lock to start running, and collect a current signal of the motor during the unlocking time.
[0094] The acquisition module 120 is configured to acquire a state of the electronic lock according to the current signal, wherein the state includes an abnormal state and a normal state.
[0095] The abnormality module 130 is configured to adjust the driving current of the motor to control the operation of the motor and re-acquire the state of the electronic lock if the electronic lock is in the abnormal state.
[0096] The normal module 140 is configured to control the motor to run to a predetermined position if the electronic lock is in the normal state, so that the electronic lock is unlocked successfully.
[0097] The electronic lock unlocking device provided in the embodiment of the present application corresponds to each step of the electronic lock unlocking method in the above-mentioned embodiment 1. The optional items in the above-mentioned embodiment 1 are also applicable to this embodiment, so they are not repeated here.
[0098] An embodiment of the present invention further provides an electronic lock, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the electronic lock unlocking method as described in the above embodiment 1 is implemented.
[0099] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the electronic lock unlocking method as described in the above-mentioned embodiment 1 is implemented.
[0100] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or flowchart, and the combination of boxes in the structure diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0101] In addition, the functional modules or units in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0102] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0103] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be covered by the scope of protection of the present invention.
Claims
1. A method for unlocking an electronic lock, characterized in that: include: In response to an unlocking instruction, controlling the motor in the electronic lock to start running and collecting a current signal of the motor during the unlocking time; Acquiring a state of the electronic lock according to the current signal, wherein the state includes an abnormal state and a normal state; If the electronic lock is in the abnormal state, adjusting the driving current of the motor to control the operation of the motor, and re-obtaining the state of the electronic lock; If the electronic lock is in the normal state, controlling the motor to run to a predetermined position so that the electronic lock is unlocked successfully; The obtaining the state of the electronic lock according to the current signal includes: monitoring whether the current signal is within a preset range during the unlocking time; If not, obtaining the state of the electronic lock as the abnormal state; If so, obtaining the state of the electronic lock as the normal state; The abnormal state includes a continuous abnormal state and an intermittent abnormal state. After obtaining the state of the electronic lock as the abnormal state, the method further includes: Counting the time period of the abnormal state and determining whether the time period is equal to the unlocking time; If they are equal, it is determined that the abnormal state is the continuous abnormal state; If not equal, it is determined that the abnormal state is the intermittent abnormal state; If the electronic lock is in the abnormal state, adjusting the driving current of the motor to control the operation of the motor and re-obtaining the state of the electronic lock includes: If the electronic lock is in the persistent abnormal state, adjusting the driving current of the motor so that the driving current increases by a first preset value to control the motor to run in the forward direction; If the electronic lock is in the abnormal state, adjusting the driving current of the motor to control the operation of the motor and re-obtaining the state of the electronic lock includes: If the electronic lock is in the intermittent abnormal state, the driving current of the motor is adjusted to reduce the driving current by a second preset value to control the reverse operation of the motor; the intermittent abnormal state includes that within the unlocking time, the driving current of the motor is within the preset range in the first period of time and is not within the preset range in the second period of time.
2. The electronic lock unlocking method according to claim 1, characterized in that: If the electronic lock is in the abnormal state, the driving current of the motor is adjusted to control the operation of the motor, and the state of the electronic lock is re-acquired, the method further includes: Count the number of times it has been retrieved; If the number of times exceeds a preset number, the electronic lock is controlled to stop unlocking and it is determined that the electronic lock is damaged.
3. The electronic lock unlocking method according to claim 1, characterized in that: Before responding to the unlock instruction, the method further includes: A preset number of Hall signals are set so that the motor runs to the predetermined position according to the Hall signals.
4. An electronic lock unlocking device, characterized in that: include: a control module, configured to respond to an unlocking instruction, control the motor in the electronic lock to start running, and collect a current signal of the motor during the unlocking time; an acquisition module, configured to acquire a state of the electronic lock according to the current signal, wherein the state includes an abnormal state and a normal state; an abnormality module, configured to adjust the driving current of the motor to control the operation of the motor and re-acquire the state of the electronic lock if the electronic lock is in the abnormal state; a normal module, configured to control the motor to run to a predetermined position if the electronic lock is in the normal state, so that the electronic lock is unlocked successfully; The obtaining the state of the electronic lock according to the current signal includes: monitoring whether the current signal is within a preset range during the unlocking time; If not, obtaining the state of the electronic lock as the abnormal state; If so, obtaining the state of the electronic lock as the normal state; The abnormal state includes a continuous abnormal state and an intermittent abnormal state. After obtaining the state of the electronic lock as the abnormal state, the method further includes: Counting the time period of the abnormal state and determining whether the time period is equal to the unlocking time; If they are equal, it is determined that the abnormal state is the continuous abnormal state; If not equal, it is determined that the abnormal state is the intermittent abnormal state; If the electronic lock is in the abnormal state, adjusting the driving current of the motor to control the operation of the motor and re-obtaining the state of the electronic lock includes: If the electronic lock is in the persistent abnormal state, adjusting the driving current of the motor so that the driving current increases by a first preset value to control the motor to run in the forward direction; If the electronic lock is in the abnormal state, adjusting the driving current of the motor to control the operation of the motor and re-obtaining the state of the electronic lock includes: If the electronic lock is in the intermittent abnormal state, the driving current of the motor is adjusted to reduce the driving current by a second preset value to control the reverse operation of the motor; the intermittent abnormal state includes that within the unlocking time, the driving current of the motor is within the preset range in the first period of time and is not within the preset range in the second period of time.
5. An electronic lock, characterized in that: include: A processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the electronic lock unlocking method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the electronic lock unlocking method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Electronic lock adjusting method and electronic lock
CN110264603A
Method and device for controlling electronic lock
CN114299637A
Electronic lock control device and method, storage medium and computer equipment
CN119296211A
Electric lock system
JP2003097107A