CN113450482A - Electronic lock control method and device, server and electronic lock - Google Patents

Electronic lock control method and device, server and electronic lock Download PDF

Info

Publication number
CN113450482A
CN113450482A CN202111024497.7A CN202111024497A CN113450482A CN 113450482 A CN113450482 A CN 113450482A CN 202111024497 A CN202111024497 A CN 202111024497A CN 113450482 A CN113450482 A CN 113450482A
Authority
CN
China
Prior art keywords
electronic lock
key information
information
instruction
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111024497.7A
Other languages
Chinese (zh)
Other versions
CN113450482B (en
Inventor
俞光宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Wiregate Technology Co ltd
Original Assignee
Wuhan Wiregate Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Wiregate Technology Co ltd filed Critical Wuhan Wiregate Technology Co ltd
Priority to CN202111024497.7A priority Critical patent/CN113450482B/en
Publication of CN113450482A publication Critical patent/CN113450482A/en
Application granted granted Critical
Publication of CN113450482B publication Critical patent/CN113450482B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00309Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with bidirectional data transmission between data carrier and locks
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00571Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated by interacting with a central unit

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Lock And Its Accessories (AREA)

Abstract

The embodiment of the invention discloses an electronic lock control method, an electronic lock control device, a server and an electronic lock, wherein the method comprises the following steps: the method comprises the steps that when the electronic lock is in a locked state, first key information is updated regularly, and the first key information is sent to a server regularly; receiving second key information input by a user through a user interface, and matching the second key information with the first key information; under the condition that the second key information is matched and consistent with the first key information, generating a first instruction, controlling the electronic lock to be switched to an unlocking state based on the first instruction, and receiving a second instruction input by a user through the user interface; the second instruction is used for indicating the electronic lock to regularly update or not update the first key information within a first preset time length in a locking state. The electronic lock does not need to be additionally provided with or carry a corresponding key assembly, and the operation convenience is further improved while the safety is ensured.

Description

Electronic lock control method and device, server and electronic lock
Technical Field
The invention relates to the technical field of information of the Internet of things, in particular to an electronic lock control method, an electronic lock control device, a server and an electronic lock.
Background
The electronic coded lock is an electronic product which controls a circuit or chip to work (access control system) through code input so as to control the closing of a mechanical switch and complete unlocking and locking tasks.
At present, the electronic lock control scheme that the off-line was used is more, and the electronic lock that has the networking function is less, and adopts wireless communication modes such as zigBee, WIFI, 433M to network mostly, and communication reliability is poor, the off-line appears easily, the circumstances such as disconnected antithetical couplet, especially the electronic lock based on networking of WIFI mode, the consumption is higher, still faces the problem that can't long-time operation, operation cost are high.
In the aspect of electronic lock management, devices adopting non-standard protocols cannot expand application scenarios, for example, ZigBee, 433M and other protocols need to communicate through a gateway, and the gateway cannot be used for accessing other devices, which is not beneficial to unifying and expanding the application scenarios of the electronic lock.
In terms of the electronic lock structure, the existing electronic lock structure is complex, and generally requires a key with Near Field Communication (NFC) or Radio Frequency Identification (RFID) functions, which results in high hardware cost.
Disclosure of Invention
In order to solve the existing technical problem, embodiments of the present invention provide an electronic lock control method, an electronic lock control device, a server, and an electronic lock.
In order to achieve the above purpose, the technical solution of the embodiment of the present invention is realized as follows:
in a first aspect, an embodiment of the present invention provides an electronic lock control method, including:
the method comprises the steps that when the electronic lock is in a locked state, first key information is updated regularly, and the first key information is sent to a server regularly;
receiving second key information input by a user through a user interface, and matching the second key information with the first key information;
under the condition that the second key information is matched and consistent with the first key information, generating a first instruction, controlling the electronic lock to be switched to an unlocking state based on the first instruction, and receiving a second instruction input by a user through the user interface; the second instruction is used for indicating the electronic lock to regularly update or not update the first key information within a first preset time length in a locking state.
In some optional embodiments of the invention, the timing sending the first key information to the server includes:
the electronic lock is communicated with the server through an Internet of things platform through a Low Power Wide Area Network (LPWAN, Low-Power Wide-Area Network), and the first secret key information is sent to the server at regular time based on a Class A mode of a LoRaWAN communication protocol.
In some optional embodiments of the invention, the method further comprises:
under the condition that the second key information is inconsistent with the first key information in matching, unlocking confirmation information is sent to the server;
receiving a third instruction sent by the server, and controlling the electronic lock to be switched to an unlocking state based on the third instruction; and the third instruction is generated and sent by the server according to the current first key information of the electronic lock under the condition that a first preset condition is met.
In some optional embodiments of the invention, after the controlling the electronic lock to switch to the unlocked state based on the first instruction, the method further includes:
and sending the on-off state of the electronic lock to the server.
In some optional embodiments of the invention, in a case that the second instruction is used to instruct the electronic lock not to update the first key information within a first preset time period in the locked state, the method further includes:
and after the electronic lock is in a first preset time length of a locked state, receiving a fourth instruction from the server, and updating the first key information when the electronic lock is controlled to be locked according to the fourth instruction.
In some optional embodiments of the invention, the method further comprises:
and under the condition that the second key information is inconsistent with the first key information in matching, outputting prompt information indicating that unlocking is invalid.
In a second aspect, an embodiment of the present invention further provides an electronic lock control method, including:
the server receives first key information sent by the electronic lock at regular time;
the method comprises the steps of sending the use state of an electronic lock to a terminal, and receiving reservation information sent by the terminal, wherein the reservation information comprises information of a target electronic lock; the target electronic lock is currently in an unused state;
determining a target electronic lock based on the information of the target electronic lock, updating the use state of the target electronic lock from an unused state to a use state, and sending reservation success information to the terminal;
and receiving key request information of the terminal, and sending first key information of the target electronic lock to the terminal under the condition that the key request information meets a second preset condition.
In some optional embodiments of the present invention, the timing, by the server, of receiving the first key information sent by the electronic lock includes:
the server carries out LPWAN communication with the electronic lock through the Internet of things platform, and regularly receives first key information sent by the electronic lock based on a LoRaWAN communication protocol.
In some optional embodiments of the invention, the method further comprises:
receiving unlocking confirmation information sent by the target electronic lock;
and under the condition that a first preset condition is met, generating a third instruction according to the first key information of the target electronic lock, and sending the third instruction to the target electronic lock, wherein the third instruction is used for controlling the target electronic lock to be switched to an unlocking state.
In some optional embodiments of the invention, the method further comprises:
receiving a switch state from the target electronic lock.
In some optional embodiments of the invention, after the sending the reservation success information to the terminal, the method further includes:
recording the use start time of the target electronic lock;
receiving use ending information sent by the terminal, and determining use ending time of the target electronic lock based on the use ending information;
and calculating cost information according to the use starting time and the use ending time, and sending the cost information to the terminal.
In some optional embodiments of the present invention, after receiving the end-of-use information sent by the terminal, the method further includes:
and sending a fourth instruction to the target electronic lock, wherein the fourth instruction is used for controlling the target electronic lock to update the first key information.
In a third aspect, an embodiment of the present invention further provides an electronic lock control device, which is applied to an electronic lock, where the electronic lock control device includes:
the first processing module is used for updating the first key information at regular time when the lock is in a locked state;
a first communication module for sending the first key information to the server at regular time
The second processing module is used for receiving second key information input by a user through a user interface and matching the second key information with the first key information; under the condition that the second key information is matched and consistent with the first key information, generating a first instruction, controlling to switch to an unlocking state based on the first instruction, and receiving a second instruction input by a user through the user interface; the second instruction is used for instructing the first processing module to update or not update the first key information at regular time within a first preset time length in a locking state.
In some optional embodiments of the present invention, the first communication module is configured to perform LPWAN communication with the server through an internet of things platform, and periodically send the first key information to the server based on a Class a mode of a LoRaWAN communication protocol.
In some optional embodiments of the present invention, the first communication module is further configured to send unlocking confirmation information to the server if the second key information is inconsistent with the first key information; receiving a third instruction sent by the server;
the second processing module is further configured to control switching to an unlocking state based on the third instruction; and the third instruction is generated and sent by the server according to the current first key information of the electronic lock under the condition that a first preset condition is met.
In some optional embodiments of the invention, the first communication module is further configured to send the switch status of the electronic lock to the server.
In some optional embodiments of the invention, the first communication module is further configured to receive a fourth instruction from the server after the first preset duration in the off-lock state, where the second instruction is used to instruct the first processing module not to update the first key information within the first preset duration in the off-lock state;
the second processing module is further configured to control the first processing module to update the first key information according to the fourth instruction.
In some optional embodiments of the invention, the apparatus further comprises:
and the output module is used for outputting prompt information indicating that unlocking is invalid under the condition that the second processing module determines that the second key information is inconsistent with the first key information in a matching manner.
In a fourth aspect, an embodiment of the present invention further provides a control apparatus, which is applied to a server, where the apparatus includes:
the second communication module is used for receiving the first key information sent by the electronic lock at regular time;
the third communication module is used for sending the use state of the electronic lock to a terminal and receiving reservation information sent by the terminal, wherein the reservation information comprises information of a target electronic lock; the target electronic lock is currently in an unused state;
the third processing module is used for determining a target electronic lock based on the information of the target electronic lock and updating the use state of the target electronic lock from the unused state to the use state;
the third communication module is further configured to send reservation success information to the terminal; and receiving key request information of the terminal, and sending first key information of the target electronic lock to the terminal under the condition that the key request information meets a second preset condition.
In some optional embodiments of the present invention, the second communication module is configured to perform LPWAN communication with the electronic lock through the internet of things platform, and periodically receive the first key information sent by the electronic lock based on the LoRaWAN communication protocol.
In some optional embodiments of the invention, the apparatus further comprises: a fourth processing module;
the second communication module is further used for receiving unlocking confirmation information sent by the target electronic lock;
the fourth processing module is configured to generate a third instruction according to the first key information of the target electronic lock when a first preset condition is met, where the third instruction is used to control the target electronic lock to switch to an unlocking state;
the second communication module is further configured to send the third instruction to the target electronic lock.
In some optional embodiments of the invention, the second communication module is further configured to receive a switch status from the target electronic lock.
In some optional embodiments of the invention, the apparatus further comprises:
the fifth processing module is used for recording the use starting time of the target electronic lock; receiving use ending information sent by the terminal through the third communication module, and determining use ending time of the target electronic lock based on the use ending information; calculating cost information according to the use start time and the use end time;
the third communication module is further configured to send the cost information to the terminal.
In some optional embodiments of the present invention, the second communication module is further configured to send a fourth instruction to the target electronic lock, where the fourth instruction is used to control updating of the first key information when the target electronic lock is locked.
In a fifth aspect, an embodiment of the present invention further provides an electronic lock, which includes a controller, and a communication component, an operation component, and an electronic lock body connected to the controller; the controller comprises a processor and a memory for storing a computer program operable on the processor; wherein the communication component is used for communicating with a server;
the operation component is used for receiving second key information input by a user through a user interface, and the second key information is used for being matched with the current first key information of the electronic lock so as to control the electronic lock body to be opened or closed; the electronic lock is also used for receiving a second instruction input by a user through the user interface, wherein the second instruction is used for indicating that the electronic lock regularly updates or does not update the first key information within a first preset time length after being in a locked state;
the processor is configured to execute the steps of the electronic lock control method executed by the electronic lock when running the computer program.
In some optional embodiments of the invention, the communication component comprises an LPWAN communication component; the LPWAN communication component is communicated with the server based on a Class A mode of a LoRaWAN communication protocol.
In some optional embodiments of the present invention, the electronic lock further comprises a display component for outputting a prompt message.
In a sixth aspect, an embodiment of the present invention further provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the electronic lock control method executed by the server.
In a seventh aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is configured to, when executed by a processor, implement the steps of the electronic lock control method executed by an electronic lock or the steps of the electronic lock control method executed by a server.
The embodiment of the invention provides an electronic lock control method, an electronic lock control device, a server and an electronic lock.
Drawings
Fig. 1 is a schematic structural diagram of an electronic lock management system according to an embodiment of the present invention;
FIG. 2 is a first flowchart illustrating a control method of an electronic lock according to an embodiment of the present invention;
FIG. 3 is a second flowchart illustrating a method for controlling an electronic lock according to an embodiment of the present invention;
FIG. 4A is a schematic diagram of the operation of a LoRaWAN device in Class A mode;
FIG. 4B is a schematic diagram of the LoRaWAN device operating in Class B mode;
FIG. 4C is a schematic diagram of the LoRaWAN device operating in Class C mode;
FIG. 5 is a third schematic flow chart of a control method of an electronic lock according to an embodiment of the present invention;
FIG. 6 is a fourth schematic flowchart of a control method of an electronic lock according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating a hardware configuration of an electronic lock according to an embodiment of the present invention;
FIG. 8 is a schematic view of the operative components of an electronic lock in accordance with an embodiment of the present invention;
FIG. 9 is a schematic interaction flow diagram illustrating a control method of an electronic lock applied to a locker scenario according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic lock control device according to an embodiment of the present invention;
FIG. 11 is a first schematic structural diagram of a control device according to an embodiment of the present invention;
FIG. 12 is a second schematic structural diagram of a control device according to an embodiment of the present invention;
FIG. 13 is a third schematic structural diagram of a control device according to an embodiment of the present invention;
fig. 14 is a schematic diagram of a hardware structure of a server according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
At least based on the electronic lock management system shown in fig. 1, the following embodiments of the present invention are provided, and it should be noted that fig. 1 is only an example of an electronic lock management system to which the embodiments of the present invention are applicable, and the embodiments of the present invention are not limited to the system structure shown in fig. 1, and other system structures may also be within the scope of the embodiments of the present invention.
As shown in fig. 1, the electronic lock management system includes a terminal, a server, an internet of things platform, a LoRaWAN gateway, and one or more electronic locks, where the one or more electronic locks perform data communication with the LoRaWAN gateway based on a LoRaWAN wireless communication protocol, and the LoRaWAN technology is a set of communication protocol and system architecture designed for Long distance Radio (LoRa) Long distance communication network. And the LoRaWAN gateway is in data communication with the Internet of things platform through a 4G/Ethernet network and forwards the message between the electronic lock and the Internet of things platform.
The server can be called a cabinet lock management platform, is a platform for realizing the business logic of the electronic lock management system, and can realize related businesses such as electronic lock renting, order generation, electronic lock remote control, alarm information pushing, key information pushing, electronic lock renting information issuing and the like. The terminal is used for the user to rent the electronic lock, obtain services such as the password, the remote control electronic lock switch, the bill payment of renting the successful electronic lock, the terminal can be intelligent terminal, also can be Application program (APP, Application) or (pay treasured/little letter etc.) applet among the intelligent terminal etc..
It should be noted that, the internet of things platform may be connected to other internet of things devices with an information sensing function to expand or implement other system services, such as a smoke detector, an environment temperature and humidity detector, and the like, besides being connected to the electronic lock through the LoRaWAN gateway; the internet of things platform is used as a communication and management platform of each internet of things device, and is used for uniformly managing each internet of things device (for the electronic lock management system shown in fig. 1, an electronic lock) and a corresponding gateway or base station, for example, remotely monitoring the communication quality of the internet of things device and the internet of things platform, the product stability of the device, and the like, and providing data and service support for an upper application platform (i.e., a server in fig. 1) through a uniform data protocol and an interface.
The embodiment of the invention provides an electronic lock control method. Fig. 2 is a first schematic flow chart of an electronic lock control method according to an embodiment of the present invention, as shown in fig. 2, the method includes:
step 101, updating first key information at regular time when the electronic lock is in a locked state, and sending the first key information to a server at regular time;
102, receiving second key information input by a user through a user interface, and matching the second key information with the first key information;
103, under the condition that the second key information is matched and consistent with the first key information, generating a first instruction, controlling the electronic lock to be switched to an unlocking state based on the first instruction, and receiving a second instruction input by a user through the user interface; the second instruction is used for indicating the electronic lock to regularly update or not update the first key information within a first preset time length in a locking state.
In this embodiment, the electronic lock updates the first key information at regular time when in the lock closing state, where the first key information is used to control the electronic lock to switch from the lock closing state to the lock opening state, and an interval duration of updating the first key information by the electronic lock can be used to improve the security of the electronic lock, but it should be ensured that the user has enough time to open the electronic lock.
For example, the electronic locking generates a random number with a fixed number of bits as an unlocking key, for example, a time-dependent and unpredictable random number combination is generated every 5 minutes according to a preset algorithm as the unlocking key. It should be noted that the first key information is not limited to numbers, may also be numbers, letters, special symbols, or a combination thereof, and may also be information with encryption and decryption functions, such as pictures, two-dimensional codes, and the like.
As shown in fig. 1, the electronic lock in this embodiment may establish a communication connection with an internet of things platform through a LoRaWAN gateway, and periodically send the first key information to a server through the internet of things platform, so that a user may obtain an unlocking key of the electronic lock through a terminal.
In step 102, the electronic lock receives second key information input by a user through a user interface, and matches the second key information with the first key information. Under the condition that a user normally rents or uses the electronic lock, the user can acquire first key information received by the server through interaction between the terminal and the server, namely the current unlocking key of the electronic lock, so that the electronic lock is normally unlocked.
It should be noted that the first key information and the second key information may be the same type of data or different types of data. If the second key information is data of a different type from the first key information, after receiving the second key information, the electronic lock should be able to decrypt the second key information into data of the same type as the first key information, and perform matching based on the decrypted data.
As an optional implementation manner, the second key information is a two-dimensional code. The method comprises the steps that a server receives first key information currently sent by an electronic lock and acquires an unlocking request sent by a user through a terminal, wherein the unlocking request can comprise user information and/or terminal information, the server determines that the unlocking request meets conditions under the condition that the user information and/or the terminal information included in the unlocking request is consistent with user information and/or terminal information corresponding to the electronic lock stored in advance, second key information is generated through a preset two-dimensional code generation mode based on the first key information and is sent to the terminal, and the user inputs the second key information through a code scanning mode after receiving the second key information. And after receiving the second key information, the electronic lock obtains data of the same type as the first key information based on a decoding mode corresponding to a preset two-dimensional code generation mode in the server, and performs matching according to the decoded data.
In step 103, under the condition that the second key information is matched with the first key information, the electronic lock generates a first instruction, controls the electronic lock to be switched to an unlocking state based on the first instruction, and simultaneously receives a second instruction input by a user through a user interface, where the second instruction is used to instruct the electronic lock to update or not update the first key information at regular time within a first preset time period when the electronic lock is in a locking state.
In this embodiment, after the user opens the electronic lock through the second key information, the user may select whether to update the unlocking key of the electronic lock at regular time within a first preset time after locking, if the user selects to update at regular time, the electronic lock still keeps updating the first key information at regular time after locking, and the user needs to obtain the unlocking key of the electronic lock at the unlocking time through the terminal when unlocking next time; if not, the electronic lock does not update the first key information within the first preset time after the electronic lock is closed, that is, the unlocking key of the electronic lock within the first preset time after the electronic lock is closed is still the unlocking key of the current electronic lock, and at this time, the user may remember the current first key information, and consider that the terminal for obtaining the first key information is placed in a locker or a room locked by the electronic lock, and so on.
It should be noted that, if the electronic lock does not receive the second instruction, the electronic lock should be able to continue to execute the timing updating of the first key information in step 101 according to the normal program and to periodically send the first key information to the server, and meanwhile, it should be noted that, no matter the electronic lock in this embodiment updates the first key information periodically or does not update the first key information, it does not affect sending the current first key information of the electronic lock to the server when the electronic lock is sending the electronic lock.
The first preset time length may be preset time length information, for example, a preset time length after the electronic lock rented by the user is overtime; or the time length information can be input by a user through a user interface, or the time length information can be input through a terminal and sent to a server, and the first preset time length is configured according to the time length information in the communication process of the server and the electronic lock.
In an optional embodiment of the present invention, in step 103, after the controlling the electronic lock to switch to the unlocked state based on the first instruction, the method further includes: and sending the on-off state of the electronic lock to the server.
In this embodiment, the on-off state of the electronic lock includes an unlocking state and an off-locking state of the electronic lock, and the on-off state may be used by the server to obtain a use state of the electronic lock, where the use state of the electronic lock includes a use state and an unused state of the electronic lock. For example, when the electronic lock is used to lock a specific public product, such as when the electronic lock is used to share a bicycle, share a charger, and the like, switching the electronic lock from the off state to the on state may indicate that the electronic lock is in the use state from the unused state to the use state, and switching the electronic lock from the on state to the off state may indicate that the electronic lock is in the use state to the unused state. It should be noted that, when the electronic lock is used to lock the locker, the electronic lock is in the use state indicating that the locker is currently leased, and in the non-use state indicating that the locker is not currently leased, in this case, the on-off state of the electronic lock is not directly associated with the use state, and the server may obtain the use state of the electronic lock according to the lease request sent by the terminal and the end lease request.
In an embodiment, in a case that the second instruction is used to instruct the electronic lock not to update the first key information within a first preset time period in the locked state, the method further includes:
and after the electronic lock is in a first preset time length of a locked state, receiving a fourth instruction from the server, and updating the first key information when the electronic lock is controlled to be locked according to the fourth instruction.
If the user chooses not to update the first key information, in order to ensure the security of the electronic lock, the electronic lock should be able to resume updating the first key information at regular time after the first preset time period for locking. In this embodiment, after the electronic lock is in the first preset duration of the locked state, the electronic lock receives a fourth instruction from the server, and controls to update the first key information at regular time according to the fourth instruction.
By adopting the technical scheme of the embodiment of the invention, based on the communication between the electronic lock and the server, a user can obtain the unlocking key through the terminal without additionally configuring or carrying a corresponding key component, and the electronic lock adopts the design of dynamic key updating, so that the user is supported to use or not use the terminal for unlocking, the safety is ensured, and the operation convenience is further improved.
Based on the foregoing embodiment, the embodiment of the present invention further provides an electronic lock control method. In this embodiment, for a situation that a user cannot obtain an unlocking key or the user desires to perform remote unlocking, for example, the user places a terminal in a locker or a room locked by an electronic lock and selects not to update the first key information but forgets the unlocking key, or the user selects to update the first key information but cannot obtain the unlocking key through the terminal, the user may obtain the key information of the electronic lock through contact with a server, and the method further includes:
104, sending unlocking confirmation information to the server under the condition that the second key information is inconsistent with the first key information in matching;
step 105, receiving a third instruction sent by the server, and controlling the electronic lock to be switched to an unlocking state based on the third instruction; and the third instruction is generated and sent by the server according to the current first key information of the electronic lock under the condition that a first preset condition is met.
The first preset condition may be set by an administrator according to a permission, and is used for issuing the third instruction after verifying the identity information of the user. Illustratively, the user desires to remotely unlock the lock through the terminal, and may contact the server customer service center or log in the server official platform, and send the third instruction directly or through the terminal control server after verifying the identity information.
In this embodiment, whether the server sends the third instruction is not related to whether the unlocking confirmation information sent by the electronic lock is received, but is related to whether the first preset condition is met, it can be understood that the server can send the third instruction as long as the first preset condition is met before the server does not receive the unlocking confirmation information, and the electronic lock needs to receive the third instruction from the server after sending the unlocking confirmation information to the server, and controls unlocking based on the third instruction. On the contrary, if the server does not meet the first preset condition, the server does not send the third instruction to the electronic lock, and at this time, the electronic lock cannot be controlled to be switched to the unlocking state by the server regardless of whether the electronic lock sends the unlocking confirmation information or not.
As an optional implementation, the method further comprises:
and under the condition that the second key information is inconsistent with the first key information in matching, outputting prompt information indicating that unlocking is invalid, so that a user can know whether the currently input second key information is correct or not according to the prompt information.
By adopting the technical scheme of the embodiment of the invention, the electronic lock can be controlled to be unlocked through the server under the condition that the user forgets the unlocking key of the electronic lock or cannot obtain the unlocking key through the terminal.
The embodiment of the present invention further provides an electronic lock control method, and fig. 3 is a second flowchart of the electronic lock control method according to the embodiment of the present invention, and as shown in fig. 3, the method includes:
step 201, regularly updating first key information when the electronic lock is in a locked state, carrying out LPWAN communication with a server through an Internet of things platform, and regularly sending the first key information to the server based on a Class A mode of a LoRaWAN communication protocol;
step 202, receiving second key information input by a user through a user interface, and matching the second key information with the first key information;
step 203, generating a first instruction under the condition that the second key information is matched and consistent with the first key information, controlling the electronic lock to be switched to an unlocking state based on the first instruction, and receiving a second instruction input by a user through the user interface; the second instruction is used for indicating the electronic lock to regularly update or not update the first key information within a first preset time length in a locked state;
step 204, under the condition that the second key information is inconsistent with the first key information in matching, sending unlocking confirmation information to the server based on a Class A mode of a LoRaWAN communication protocol, receiving a third instruction sent by the server, and controlling the electronic lock to be switched to an unlocking state based on the third instruction; and the third instruction is generated and sent by the server according to the current first key information of the electronic lock under the condition that a first preset condition is met.
The relevant descriptions of steps 201 to 204 in this embodiment may specifically refer to the relevant descriptions of steps 101 to 105 in the foregoing embodiment, and are not repeated herein for brevity.
In this embodiment, as shown in fig. 1, the electronic lock may communicate with the internet of things platform through the LoRaWAN gateway, and perform LPWAN communication with the server based on the internet of things platform. The LPWAN technology is an Internet of things connection technology oriented to low power consumption and wide-coverage application scenes, and LoRaWAN is an important component of the LPWAN technology, has the characteristics of low power consumption, long distance and data safety, and is widely used at home and abroad.
In the technical standard of LoRaWAN, the operation mode of LoRaWAN device can be classified into Class a, Class B, and Class C, which have different tendencies in power consumption and real-time performance. As shown in fig. 4A, the LoRaWAN device operating in the Class a mode is mostly in a sleep state, and only after actively sending data, the receive window is temporarily opened.
As shown in fig. 4C, the LoRaWAN device operating in the Class C mode is in a receiving state at other times except for the time of closing the receiving channel when sending data, and the server can send downlink data to the LoRaWAN device almost at any time.
The power consumption and real-time performance of the Class B mode are between those of the Class a mode and the Class C mode, as shown in fig. 4B, after sending uplink data, the LoRaWAN device operating in the Class B mode may open several receiving windows for receiving downlink data, where the number of the receiving windows is controllable. The number of the receiving windows determines the balance relation between the real-time performance and the power consumption of the Class B mode, the power consumption and the real-time performance can be dynamically adjusted, and the purpose of reducing the power consumption is achieved while certain real-time performance is guaranteed.
In this embodiment, the electronic lock operates in the Class a mode, so that the electronic lock can receive data issued by the server only when actively sending data to the server. In step 201, when the electronic lock sends the first key information to the server at regular time, the electronic lock can receive response information and instruction information from the server, where the instruction information may include an instruction for the server to remotely control the electronic lock, an instruction for the server to update the first key information when controlling the electronic lock to recover, and so on.
It should be noted that, in step 204, whether the server sends the third instruction is only related to whether the first preset condition is met, it can be understood that the server may send the third instruction after determining that the first preset condition is met, but the third instruction may be received by the electronic lock only when the electronic lock sends data to the server. Therefore, if the electronic lock operating in the Class a mode is not in the set timed sending state, the user needs to confirm unlocking through the user interface so that the electronic lock sends the unlocking confirmation information to the server, and therefore the third instruction from the server is triggered to be received, and unlocking is controlled based on the third instruction. And if the user does not trigger the electronic lock to send the unlocking confirmation information, waiting for the electronic lock to send information to the server next time to receive a third instruction from the server.
By adopting the technical scheme of the embodiment of the invention, the downlink real-time problem of the Class A mode is optimized by actively updating and reporting the key at regular time by the electronic lock instead of sending the control key by the server, so that the Class A mode with low power consumption can be applied to a scene with high response requirement, and the response timeliness of the electronic lock is ensured on the basis of reducing the power consumption of the electronic lock.
The embodiment of the invention also provides another electronic lock control method, and the execution main body of the method is the server in the figure 1. Fig. 5 is a third schematic flowchart of a control method of an electronic lock according to an embodiment of the present invention, and as shown in fig. 5, the method includes:
301, the server receives first key information sent by the electronic lock at regular time;
step 302, sending the use state of the electronic lock to a terminal, and receiving reservation information sent by the terminal, wherein the reservation information comprises information of a target electronic lock; the target electronic lock is currently in an unused state;
step 303, determining a target electronic lock based on the information of the target electronic lock, updating the use state of the target electronic lock from the unused state to the use state, and sending reservation success information to the terminal;
step 304, receiving key request information of the terminal, and sending first key information of the target electronic lock to the terminal under the condition that the key request information meets a second preset condition.
In this embodiment, the server may communicate with one or more electronic locks, for example, communicate based on an NB-IoT communication protocol or a LoRaWAN communication protocol, and periodically receive the first key information sent by each electronic lock. Optionally, as shown in fig. 1, the step 301 includes: the server carries out LPWAN communication with the electronic lock through the Internet of things platform, and regularly receives first key information sent by the electronic lock based on a LoRaWAN communication protocol.
The server and the electronic lock adopt a standard LoRaWAN communication protocol, access of other devices adopting the same communication protocol is supported, expandability is strong, such as a smoke detector, an environment temperature and humidity detector and the like, and meanwhile, the LoRaWAN technology supports private network deployment, deep coverage in a small range can be supported, such as concurrent control of a plurality of door locks in the small range.
In step 302, the server sends the usage status of the electronic lock to the terminal, and the user can browse the electronic lock currently in the non-usage status through the terminal, select a target electronic lock which is leased or fixedly used, and send reservation information to the server, wherein the reservation information includes information of the target electronic lock. Then, the server determines a target electronic lock based on the information of the target electronic lock, updates the use state of the target electronic lock from the non-use state to the use state, and sends reservation success information to the terminal.
It should be noted that the reservation information is not limited to information generated by a user performing a lease operation when the electronic lock is a public device, nor is it limited to lease success information sent by the server when the electronic lock is a public device, it should be understood that the reservation information and the reservation success information are used for establishing an association relationship between the terminal and the target electronic lock, for example, when the electronic lock is a private electronic lock, the reservation information may be information that the user binds the target electronic lock and is sent by the terminal, and the reservation success information may be information that the server sends to the terminal to indicate that the binding is successful.
In step 304, the second preset condition is used to determine whether the key request information and the terminal sending the key request information are legal, for example, the key request information has verification information and identity information of the terminal, after receiving the key request information, the server detects the verification information and the identity information, determines that the key request information meets the second preset condition under the condition that the key request information is legal and that the terminal and the user information corresponding to the target electronic lock are matched, and sends the first key information of the target electronic lock to the terminal.
In an embodiment, after the server sends the reservation success information to the terminal, the method further includes: and the server sends the first key information of the target electronic lock to the terminal at regular time. In this embodiment, after determining the association information between the terminal and the target electronic lock, the server may update the first key information from the electronic lock to the user terminal synchronously.
Based on the foregoing embodiment, the embodiment of the present invention further provides an electronic lock control method. In this embodiment, for a situation that a user forgets a key of an electronic lock and cannot obtain the key or desires to perform remote unlocking, the user may directly control the electronic lock to perform remote unlocking through communication between the server or the terminal and the server, and the method further includes:
step 305, receiving unlocking confirmation information sent by the target electronic lock;
and 306, under the condition that a first preset condition is met, generating a third instruction according to the first key information of the target electronic lock, and sending the third instruction to the target electronic lock, wherein the third instruction is used for controlling the target electronic lock to be switched to an unlocking state.
Optionally, the step 306 may further include: receiving an unlocking request from a terminal, generating a third instruction according to the first key information of the target electronic lock and sending the third instruction to the target electronic lock under the condition that the unlocking request meets a third preset condition, wherein the third instruction is used for controlling the target electronic lock to be switched to an unlocking state.
Illustratively, the unlocking request includes identity information of a terminal and information of a target electronic lock, and the third preset condition is used for verifying the identity information based on the information of the target electronic lock.
In an embodiment, the target electronic lock operates in a Class a mode, and the server may generate a third instruction according to the first key information sent by the target electronic lock when the server meets a first preset condition, at this time, if the target electronic lock is in a sleep state of the Class a mode, the user may trigger the target electronic lock to report data by operating the target electronic lock so that the electronic lock receives the third instruction, and if the target electronic lock is in a sending state of the Class a mode, the target electronic lock may report data by itself and receive the third instruction.
The embodiment of the present invention further provides an electronic lock control method, and fig. 6 is a fourth flowchart of the electronic lock control method according to the embodiment of the present invention, as shown in fig. 6, including:
step 401, the server receives first key information sent by the electronic lock at regular time;
step 402, sending the use state of the electronic lock to a terminal, and receiving reservation information sent by the terminal, wherein the reservation information comprises information of a target electronic lock; the target electronic lock is currently in an unused state;
step 403, determining a target electronic lock based on the information of the target electronic lock, updating the use state of the target electronic lock from an unused state to a use state, sending reservation success information to the terminal, and recording the use start time of the target electronic lock;
step 404, receiving key request information of the terminal, and sending first key information of the target electronic lock to the terminal under the condition that the key request information meets a second preset condition;
step 405, receiving the use ending information sent by the terminal, and determining the use ending time of the target electronic lock based on the use ending information;
step 406, calculating cost information according to the use start time and the use end time, and sending the cost information to the terminal.
The specific process from step 401 to step 404 can refer to step 301 to step 304. In step 403, after the reservation success information is sent to the terminal, the server records the use start time of the target electronic lock.
The electronic lock can be installed in equipment such as an intelligent locker, a public charging port, a shared bicycle and the like, and the use fee of the electronic lock or a product locked by the electronic lock is determined by recording the use starting time and the use ending time of the electronic lock.
For an application scenario in which the on-off state of an electronic lock such as an intelligent locker, an access control, and the like is not directly associated with the use state of a product corresponding to the electronic lock, since the on-off state of the electronic lock may not directly reflect the lease duration of the locker, in step 405, a user needs to send the use ending information to the server through the terminal, so that the server determines the use ending time of the electronic lock; for application scenarios such as shared bicycles, public charging ports and the like, the electronic lock can be switched on and off once to indicate a rental period, and the server can determine the use end time by receiving the switching state from the target electronic lock.
In an embodiment, the method further comprises: receiving a switch state from the target electronic lock.
And the user receives the first key information of the target electronic lock through the terminal and unlocks the target electronic lock, and simultaneously sends the use ending information through the terminal after the use is ended, if the user does not close the electronic lock at the moment, the server can remotely control the target electronic lock to be switched to a locking state according to the switching state of the target electronic lock.
Illustratively, the target electronic lock operates in a Class a mode, and the method further includes:
receiving the switch state sent by the target electronic lock at fixed time; and after receiving the use ending information sent by the terminal, sending a fifth instruction to the target electronic lock, wherein the fifth instruction is used for controlling the target electronic lock to be switched to a locking state.
When the target electronic lock reports the on-off state of the target electronic lock to the server at regular time, the receiving channel in the Class A mode can be triggered, so that the fifth instruction from the server is received, and the target electronic lock is switched to the off-lock state.
Based on the foregoing embodiment, after the target electronic lock is switched to the unlock state, a second instruction may be obtained, where the second instruction is used to instruct the target electronic lock to update or not update the first key information within a first preset time length when the target electronic lock is in the lock close state, and in this embodiment, after receiving the end-of-use information sent by the terminal, the method further includes:
and sending a fourth instruction to the target electronic lock, wherein the fourth instruction is used for controlling the target electronic lock to update the first key information.
The first preset time length can be determined according to the expected renting time length of the target electronic lock sent by the user through the terminal, optionally, when the electronic lock is applied to the intelligent locker, the user can preset the renting time length of the target electronic lock in advance, and the server can determine the first preset time length based on the expected renting time length after acquiring the on-off state of the target electronic lock each time, so that a fourth instruction is sent to the target electronic lock; the first preset time period may also be a preset fixed time period, for example, the server is configured to send the fourth instruction within 5min after receiving the end-of-use information sent by the terminal.
It should be noted that, when the target electronic lock operates in the Class a mode, the target electronic lock can receive the fourth instruction and control to recover the timing update key only when the target electronic lock sends data to the server, for example, the first key information is sent at regular time, the switch status is sent, and the like.
The embodiment of the invention also provides the electronic lock. Fig. 7 is a first hardware structure diagram of the electronic lock according to the embodiment of the present invention, as shown in fig. 7, the electronic lock 10 includes a controller 20, and a communication component 30, an operation component 40, and an electronic lock body 50 connected to the controller 20; the controller 20 comprises a processor 21 and a memory 22 for storing a computer program operable on the processor; wherein, the communication component 30 is used for communicating with a server;
the operating component 40 is configured to receive second key information input by a user through a user interface, where the second key information is used to match with current first key information of the electronic lock 10 to control the electronic lock body 50 to open or close; the electronic lock is further configured to receive a second instruction input by the user through the user interface, where the second instruction is used to instruct the electronic lock 10 to update or not update the first key information within a first preset time after the electronic lock is in the locked state;
the processor 21 is configured to execute the steps of the electronic lock control method with the electronic lock as the main body in the foregoing embodiments when the computer program is executed.
In this embodiment, the controller 20 may include a key cylinder controller, and the controller 20 is connected to the electronic lock body 50 through the key cylinder controller, and is configured to control the electronic lock body 50 to execute an unlocking and locking instruction.
The specific structure of the operating component 40 may be determined according to the data type of the second key information, and optionally, the operating component 40 may include a camera for acquiring the second key information in a code scanning manner; alternatively, the operating assembly 40 may include a password input panel including password input keys and control keys. The password input key is used for a user to input second key information, the control key is used for confirming unlocking, triggering the electronic lock 10 to report data to the server and receive downlink data from the server, and the password input key is also used for acquiring a second instruction to indicate whether to update or not to update the first key information at regular time. The password input panel is not limited to physical keys.
Illustratively, as shown in fig. 8, the keys 0 to 9 are used to input second key information, the key "#" is used to trigger the electronic lock to send unlocking confirmation information, and actively report data and obtain downlink data, and the key "#" is used to trigger the electronic lock to perform timing update or not to update the first key information. Wherein, in order to prevent malicious operation, the key "#" can be set to be effective when the electronic lock is in an unlocking state.
In an alternative embodiment of the present invention, the communication component 30 comprises an LPWAN communication component; the LPWAN communication component is communicated with the server based on a Class A mode of a LoRaWAN communication protocol.
In this embodiment, the electronic lock 10 operates in a low power consumption mode, and is in a Class a sleep state most of the time during operation, and cannot receive downlink data actively issued by a server, and only after reporting data to the server, a receiving channel can be briefly opened to obtain the downlink data.
In an alternative embodiment of the present invention, the electronic lock 10 further includes a display component for outputting a prompt message.
Optionally, the display component may include an LED lamp, a buzzer, a speaker, or the like, and performs user operation feedback and prompts the current state of the electronic lock in a light or sound manner. The display component may further include a display screen, and if the display screen is a touch display screen, an application interface as shown in fig. 8 may be further displayed to serve as the operation component 40.
The operation of the electronic lock of the present embodiment is described below with reference to a specific example. Fig. 9 is an interaction flowchart of a control method of an electronic lock in a locker application scenario according to an embodiment of the present invention, where the electronic lock in the embodiment operates in a Class a mode, as shown in fig. 9, the control method applied to the electronic lock, a server, and a terminal includes:
s501, establishing contact between the electronic locks corresponding to the storage cabinets and a server based on a LoRaWAN gateway. S502, when each electronic lock is in a locking state, dynamic key updating is carried out, and updated keys are reported to a server; for example, every 5 minutes, the key is generated based on the time rule and reported to the server. S503, the server sends the current use state of each locker to the terminal. S504, the terminal sends reservation information of the target locker to the server, the reservation information comprises electronic lock information corresponding to the target locker, and the use state of the target locker is idle. And S505, the server sends reservation success information to the terminal and records the use starting time, and the server updates the use state of the target locker to be in use. S506, the server synchronously updates the current key of the electronic lock corresponding to the target locker to the terminal.
At the moment, a user obtains a current key of the electronic lock corresponding to the locker to be rented through the terminal and inputs the current key into the electronic lock through the user panel, and the electronic lock is switched to an unlocking state when the key input by the user is determined to be consistent with the currently generated key, so that the cabinet door of the locker is opened; otherwise, unlocking is invalid and prompt is carried out.
And S507, sending the unlocking state to the server when the electronic lock is unlocked.
After the user unlocks the locker, the user inputs an instruction through the user panel to control whether the electronic lock continues to execute the dynamic key updating after the electronic lock is locked, if the user selects to continue execution, the electronic lock recovers the dynamic key updating after the user locks the locker again, the user needs to use the electronic lock key at the next unlocking time to unlock the locker next time, and under the condition, the user cannot place the terminal in the locker; if the user chooses not to execute the dynamic key updating, the unlocking key of the electronic lock is kept unchanged in the user use period until the user finishes using the locker or uses the locker overtime, and in this case, the user can place the terminal in the locker but needs to remember the current key.
And S508, after the user finishes using, the electronic lock sends a locking state to the server when being locked, and the server obtains the use end information of the locker based on the locking state, or the terminal sends the use end information to the server. S509, the server sends the expense information to the terminal. The user settles and pays at the terminal, and the electronic lock key corresponding to the locker is not updated to the terminal synchronously any more.
S510, when the user sends the use end information through the terminal but does not close the cabinet door of the locker, the server sends a lock closing instruction and a dynamic key updating recovery instruction to the electronic lock, and the electronic lock triggers a receiving instruction when sending the key to the server at regular time so as to close the cabinet door of the locker and update the dynamic key.
And S511, when the user cannot open the cabinet, if the user forgets the secret key or cannot obtain the dynamic secret key, the server can remotely issue an unlocking instruction to the electronic lock, and when the electronic lock sends data to the server at regular time or the user triggers the electronic lock to report the data through a user panel, the electronic lock receives the unlocking instruction and controls to immediately open the cabinet door of the locker.
The embodiment optimizes the leasing business process of the locker, can ensure good use experience of users under the condition that the locker lock adopts the Class A mode with the lowest power consumption, can greatly reduce the operation power consumption of the locker lock, realizes long endurance under the power supply of a battery, and reduces the operation and maintenance cost of the whole locker system. Meanwhile, the locker lock adopts a dynamic key updating mode, a key does not need to be equipped, a user is supported to unlock by adopting a terminal or not adopting the terminal, and the locker lock has advantages for scenes such as body building and the like.
Fig. 10 is a first schematic structural diagram of an electronic lock control device according to an embodiment of the present invention, and as shown in fig. 10, an electronic lock control device 600 is applied to an electronic lock, where the electronic lock control device 600 includes:
a first processing module 601, configured to update first key information at regular time when the lock is in an off-lock state;
a first communication module 602, configured to send the first key information to the server at regular time
The second processing module 603 is configured to receive second key information input by a user through a user interface, and match the second key information with the first key information; under the condition that the second key information is matched and consistent with the first key information, generating a first instruction, controlling to switch to an unlocking state based on the first instruction, and receiving a second instruction input by a user through the user interface; the second instruction is used to instruct the first processing module 601 to update or not update the first key information at regular time within a first preset time length in the locked state.
In an optional embodiment of the present invention, the first communication module 602 is configured to perform LPWAN communication with the server through an internet of things platform, and periodically send the first key information to the server based on a Class a mode of a LoRaWAN communication protocol.
In an optional embodiment of the present invention, the first communication module 602 is further configured to send unlocking confirmation information to the server if the second key information is not matched with the first key information; receiving a third instruction sent by the server;
the second processing module 603 is further configured to control to switch to an unlocking state based on the third instruction; and the third instruction is generated and sent by the server according to the current first key information of the electronic lock under the condition that a first preset condition is met.
In an optional embodiment of the present invention, the first communication module 602 is further configured to send the switch status of the electronic lock to the server.
In an optional embodiment of the present invention, the first communication module 602 is further configured to receive a fourth instruction from the server after the first preset duration in the off-lock state, where the second instruction is used to instruct the first processing module 601 not to update the first key information within the first preset duration in the off-lock state;
the second processing module 603 is further configured to control the first processing module 601 to update the first key information according to the fourth instruction.
In an optional embodiment of the present invention, the apparatus 600 further comprises:
and an output module, configured to output prompt information indicating that unlocking is invalid when the second processing module 603 determines that the second key information is inconsistent with the first key information in a matching manner.
In the embodiment of the present invention, the first Processing module 601 and the second Processing module 603 in the apparatus 600 may be implemented by a Central Processing Unit (CPU), a Digital Signal Processor (DSP), a Micro Control Unit (MCU), or a Programmable Gate Array (FPGA) in the terminal in practical application; the first communication module 602 in the electronic lock can be implemented in practical applications by a communication module (including a basic communication suite, an operating system, a communication module, a standardized interface, a standardized protocol, and the like) and a transceiver antenna.
It should be noted that: in the electronic lock provided in the foregoing embodiment, when the steps of the method for controlling an electronic lock whose execution main body is the electronic lock in the foregoing embodiment are executed, only the division of the program modules is described as an example, and in practical applications, the above processing may be distributed to different program modules according to needs, that is, the internal structure of the electronic lock may be divided into different program modules to complete all or part of the above-described processing. In addition, the electronic lock provided by the above embodiment and the embodiment of the electronic lock control method in which the execution main body is the electronic lock belong to the same concept, and specific implementation processes thereof are described in the embodiment of the method for details, and are not described herein again.
Fig. 11 is a first structural diagram of a control device according to an embodiment of the present invention, as shown in fig. 11, the control device 700 is applied to a server, and the device 700 includes:
the second communication module 701 is configured to receive first key information sent by the electronic lock at regular time;
a third communication module 702, configured to send a use state of an electronic lock to a terminal, and receive reservation information sent by the terminal, where the reservation information includes information of a target electronic lock; the target electronic lock is currently in an unused state;
the third processing module 703 is configured to determine a target electronic lock based on the information of the target electronic lock, and update the use state of the target electronic lock from an unused state to a use state;
the third communication module 702 is further configured to send a reservation success message to the terminal; and receiving key request information of the terminal, and sending first key information of the target electronic lock to the terminal under the condition that the key request information meets a second preset condition.
In an optional embodiment of the present invention, the second communication module 701 is configured to perform LPWAN communication with the electronic lock through an internet of things platform, and periodically receive first key information sent by the electronic lock based on a LoRaWAN communication protocol.
In an alternative embodiment of the present invention, as shown in fig. 12, the apparatus 700 further comprises: a fourth processing module 704;
the second communication module 701 is further configured to receive unlocking confirmation information sent by the target electronic lock;
the fourth processing module 704 is configured to generate a third instruction according to the first key information of the target electronic lock when a first preset condition is met, where the third instruction is used to control the target electronic lock to switch to an unlocking state;
the second communication module 701 is further configured to send the third instruction to the target electronic lock.
In an optional embodiment of the present invention, the second communication module 701 is further configured to receive a switch status from the target electronic lock.
In an alternative embodiment of the present invention, as shown in fig. 13, the apparatus 700 further comprises:
a fifth processing module 705, configured to record a start time of use of the target electronic lock; receiving, by the third communication module 702, usage ending information sent by the terminal, and determining a usage ending time of the target electronic lock based on the usage ending information; calculating cost information according to the use start time and the use end time;
the third communication module 702 is further configured to send the cost information to the terminal.
In an optional embodiment of the present invention, the second communication module 701 is further configured to send a fourth instruction to the target electronic lock, where the fourth instruction is used to control the target electronic lock to update the first key information.
In the embodiment of the present invention, the third processing module 703, the fourth processing module 704, and the fifth processing module 705 of the apparatus 700 can be implemented by, for example, a CPU, a DSP, an MCU, and an FPGA in practical application; the second communication module 701 and the third communication module 702 of the apparatus 700 can be implemented by a communication module (including a basic communication suite, an operating system, a communication module, a standardized interface, a standardized protocol, and the like) and a transceiver antenna in practical application.
It should be noted that: in the server provided in the foregoing embodiment, when the steps of the electronic lock control method whose main body is the server are executed in the foregoing embodiment, only the division of the program modules is described as an example, and in practical applications, the above processing may be distributed to different program modules according to needs, that is, the internal structure of the server may be divided into different program modules to complete all or part of the processing described above. In addition, the server and the embodiment of the electronic lock control method in which the execution main body is the server provided by the above embodiment belong to the same concept, and specific implementation processes thereof are described in the embodiment of the method for the embodiment and are not described herein again.
Fig. 14 is a schematic diagram of a hardware structure of a server according to an embodiment of the present invention, and as shown in fig. 14, the server 800 includes: at least one processor 801, memory 802, at least one network interface 804. The various components in the server 800 are coupled together by a bus system 803. It is understood that the bus system 803 is used to enable communications among the components. The bus system 803 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration the various buses are labeled as bus system 803 in figure 14.
It will be appreciated that the memory 802 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 802 described in connection with the embodiments of the invention is intended to comprise, without being limited to, these and any other suitable types of memory.
The memory 802 in embodiments of the present invention is used to store various types of data to support the operation of the server 800. Examples of such data include: any computer program for operating on server 800.
The methods disclosed in the embodiments of the present invention described above may be implemented in the processor 801 or implemented by the processor 801. The processor 801 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 801. The processor 801 described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Processor 801 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed by the embodiment of the invention can be directly implemented by a hardware decoding processor, or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium that is located in the memory 802, and the processor 801 reads the information in the memory 802 to perform the steps of the aforementioned methods in conjunction with its hardware.
In an exemplary embodiment, the server 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), FPGAs, general purpose processors, controllers, MCUs, microprocessors (microprocessors), or other electronic components for performing the aforementioned methods.
In an exemplary embodiment, the embodiment of the present invention further provides a computer readable storage medium, for example, a memory including a computer program, the computer program being executable by a processor of a server or a processor of an electronic lock to perform the steps of the foregoing method. The computer readable storage medium can be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
The methods disclosed in the several method embodiments provided in the present application may be combined arbitrarily without conflict to obtain new method embodiments.
Features disclosed in several of the product embodiments provided in the present application may be combined in any combination to yield new product embodiments without conflict.
The features disclosed in the several method or apparatus embodiments provided in the present application may be combined arbitrarily, without conflict, to arrive at new method embodiments or apparatus embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a mobile storage device, 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.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (29)

1. An electronic lock control method, characterized in that the method comprises:
the method comprises the steps that when the electronic lock is in a locked state, first key information is updated regularly, and the first key information is sent to a server regularly;
receiving second key information input by a user through a user interface, and matching the second key information with the first key information;
under the condition that the second key information is matched and consistent with the first key information, generating a first instruction, controlling the electronic lock to be switched to an unlocking state based on the first instruction, and receiving a second instruction input by a user through the user interface; the second instruction is used for indicating the electronic lock to regularly update or not update the first key information within a first preset time length in a locking state.
2. The method of claim 1, wherein the timing the sending of the first key information to a server comprises:
the electronic lock is communicated with the server through an Internet of things platform through a low-power wide area network (LPWAN), and the first secret key information is sent to the server at regular time based on a Class A mode of a LoRaWAN communication protocol.
3. The method of claim 1, further comprising:
under the condition that the second key information is inconsistent with the first key information in matching, unlocking confirmation information is sent to the server;
receiving a third instruction sent by the server, and controlling the electronic lock to be switched to an unlocking state based on the third instruction; and the third instruction is generated and sent by the server according to the current first key information of the electronic lock under the condition that a first preset condition is met.
4. The method according to claim 1, wherein after the controlling the electronic lock to switch to the unlocked state based on the first instruction, the method further comprises:
and sending the on-off state of the electronic lock to the server.
5. The method according to any one of claims 1 to 4, wherein in the case that the second instruction is used to instruct the electronic lock not to update the first key information within a first preset time period in the locked state, the method further comprises:
and after the electronic lock is in a first preset time length of a locked state, receiving a fourth instruction from the server, and updating the first key information when the electronic lock is controlled to be locked according to the fourth instruction.
6. The method of claim 1, further comprising:
and under the condition that the second key information is inconsistent with the first key information in matching, outputting prompt information indicating that unlocking is invalid.
7. An electronic lock control method, characterized in that the method comprises:
the server receives first key information sent by the electronic lock at regular time;
the method comprises the steps of sending the use state of an electronic lock to a terminal, and receiving reservation information sent by the terminal, wherein the reservation information comprises information of a target electronic lock; the target electronic lock is currently in an unused state;
determining a target electronic lock based on the information of the target electronic lock, updating the use state of the target electronic lock from an unused state to a use state, and sending reservation success information to the terminal;
and receiving key request information of the terminal, and sending first key information of the target electronic lock to the terminal under the condition that the key request information meets a second preset condition.
8. The method according to claim 7, wherein the server periodically receives the first key information sent by the electronic lock, and comprises:
the server carries out LPWAN communication with the electronic lock through the Internet of things platform, and regularly receives first key information sent by the electronic lock based on a LoRaWAN communication protocol.
9. The method of claim 7, further comprising:
receiving unlocking confirmation information sent by the target electronic lock;
and under the condition that a first preset condition is met, generating a third instruction according to the first key information of the target electronic lock, and sending the third instruction to the target electronic lock, wherein the third instruction is used for controlling the target electronic lock to be switched to an unlocking state.
10. The method of claim 7, further comprising:
receiving a switch state from the target electronic lock.
11. The method according to any one of claims 7-10, wherein after sending the reservation success information to the terminal, the method further comprises:
recording the use start time of the target electronic lock;
receiving use ending information sent by the terminal, and determining use ending time of the target electronic lock based on the use ending information;
and calculating cost information according to the use starting time and the use ending time, and sending the cost information to the terminal.
12. The method according to claim 11, wherein after receiving the end-of-use information sent by the terminal, the method further comprises:
and sending a fourth instruction to the target electronic lock, wherein the fourth instruction is used for controlling the target electronic lock to update the first key information.
13. An electronic lock control device applied to an electronic lock is characterized by comprising:
the first processing module is used for updating the first key information at regular time when the lock is in a locked state;
a first communication module for sending the first key information to the server at regular time
The second processing module is used for receiving second key information input by a user through a user interface and matching the second key information with the first key information; under the condition that the second key information is matched and consistent with the first key information, generating a first instruction, controlling to switch to an unlocking state based on the first instruction, and receiving a second instruction input by a user through the user interface; the second instruction is used for instructing the first processing module to update or not update the first key information at regular time within a first preset time length in a locking state.
14. The apparatus of claim 13, wherein the first communication module is configured to perform LPWAN communication with the server through an internet of things platform, and periodically send the first key information to the server based on a Class a mode of a LoRaWAN communication protocol.
15. The apparatus of claim 13, wherein the first communication module is further configured to send unlocking confirmation information to the server if the second key information is inconsistent with the first key information; receiving a third instruction sent by the server;
the second processing module is further configured to control switching to an unlocking state based on the third instruction; and the third instruction is generated and sent by the server according to the current first key information of the electronic lock under the condition that a first preset condition is met.
16. The apparatus of claim 13, wherein the first communication module is further configured to send the switch status of the electronic lock to the server.
17. The apparatus according to any of claims 13-16, wherein the first communication module is further configured to receive a fourth instruction from the server after the first preset duration in the off-lock state, where the second instruction is configured to instruct the first processing module not to update the first key information within the first preset duration in the off-lock state;
the second processing module is further configured to control the first processing module to update the first key information according to the fourth instruction.
18. The apparatus of claim 13, further comprising:
and the output module is used for outputting prompt information indicating that unlocking is invalid under the condition that the second processing module determines that the second key information is inconsistent with the first key information in a matching manner.
19. A control device applied to a server is characterized by comprising:
the second communication module is used for receiving the first key information sent by the electronic lock at regular time;
the third communication module is used for sending the use state of the electronic lock to a terminal and receiving reservation information sent by the terminal, wherein the reservation information comprises information of a target electronic lock; the target electronic lock is currently in an unused state;
the third processing module is used for determining a target electronic lock based on the information of the target electronic lock and updating the use state of the target electronic lock from the unused state to the use state;
the third communication module is further configured to send reservation success information to the terminal; and receiving key request information of the terminal, and sending first key information of the target electronic lock to the terminal under the condition that the key request information meets a second preset condition.
20. The device of claim 19, wherein the second communication module is configured to perform LPWAN communication with the electronic lock through the internet of things platform, and periodically receive the first key information sent by the electronic lock based on a LoRaWAN communication protocol.
21. The apparatus of claim 19, further comprising: a fourth processing module;
the second communication module is further used for receiving unlocking confirmation information sent by the target electronic lock;
the fourth processing module is configured to generate a third instruction according to the first key information of the target electronic lock when a first preset condition is met, where the third instruction is used to control the target electronic lock to switch to an unlocking state;
the second communication module is further configured to send the third instruction to the target electronic lock.
22. The apparatus of claim 19, wherein the second communication module is further configured to receive a switch status from the target electronic lock.
23. The apparatus of any one of claims 19-22, further comprising:
the fifth processing module is used for recording the use starting time of the target electronic lock; receiving use ending information sent by the terminal through the third communication module, and determining use ending time of the target electronic lock based on the use ending information; calculating cost information according to the use start time and the use end time;
the third communication module is further configured to send the cost information to the terminal.
24. The apparatus of claim 19, wherein the second communication module is further configured to send a fourth instruction to the target electronic lock, and the fourth instruction is configured to control updating of the first key information when the target electronic lock is locked.
25. An electronic lock is characterized by comprising a controller, a communication assembly, an operation assembly and an electronic lock body, wherein the communication assembly, the operation assembly and the electronic lock body are connected with the controller; the controller comprises a processor and a memory for storing a computer program operable on the processor; wherein the content of the first and second substances,
the communication component is used for communicating with a server;
the operation component is used for receiving second key information input by a user through a user interface, and the second key information is used for being matched with the current first key information of the electronic lock so as to control the electronic lock body to be opened or closed; the electronic lock is also used for receiving a second instruction input by a user through the user interface, wherein the second instruction is used for indicating that the electronic lock regularly updates or does not update the first key information within a first preset time length after being in a locked state;
the processor is adapted to perform the steps of the method of any one of claims 1 to 6 when running the computer program.
26. The electronic lock of claim 25, wherein the communication component comprises an LPWAN communication component; the LPWAN communication component is communicated with the server based on a Class A mode of a LoRaWAN communication protocol.
27. The electronic lock of claim 25, further comprising a display component for outputting a prompt.
28. A server comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of any one of claims 7 to 12 are implemented when the program is executed by the processor.
29. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the steps of the method of any one of claims 1 to 6 or the steps of the method of any one of claims 7 to 12.
CN202111024497.7A 2021-09-02 2021-09-02 Electronic lock control method and device, server and electronic lock Active CN113450482B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111024497.7A CN113450482B (en) 2021-09-02 2021-09-02 Electronic lock control method and device, server and electronic lock

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111024497.7A CN113450482B (en) 2021-09-02 2021-09-02 Electronic lock control method and device, server and electronic lock

Publications (2)

Publication Number Publication Date
CN113450482A true CN113450482A (en) 2021-09-28
CN113450482B CN113450482B (en) 2021-12-31

Family

ID=77819457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111024497.7A Active CN113450482B (en) 2021-09-02 2021-09-02 Electronic lock control method and device, server and electronic lock

Country Status (1)

Country Link
CN (1) CN113450482B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101799959A (en) * 2009-02-10 2010-08-11 上海永久自行车有限公司 Bicycle leasing system with coded lock and bicycle leasing and returning method thereof
US20160036594A1 (en) * 2014-07-30 2016-02-04 Master Lock Company Wireless key management for authentication
CN105574598A (en) * 2016-03-03 2016-05-11 陈健强 Hotel reservation realization method and hotel reservation realization system based on intelligent handset door unlocking
CN205809957U (en) * 2016-07-13 2016-12-14 尹博实 A kind of door-control lock and gate control system
CN107705396A (en) * 2017-08-24 2018-02-16 北京飞图同辉科技有限公司 A kind of electronic lock system
CN108022340A (en) * 2017-11-20 2018-05-11 捷德(中国)信息科技有限公司 Vehicle method for unlocking and its device based on LPWan
CN109544747A (en) * 2018-11-20 2019-03-29 北京千丁互联科技有限公司 Encryption key update method, system and the computer storage medium of intelligent door lock
CN110247676A (en) * 2019-07-17 2019-09-17 杭州罗万信息科技有限公司 Termite detects terminal and wireless communication arrangement and method using the terminal

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101799959A (en) * 2009-02-10 2010-08-11 上海永久自行车有限公司 Bicycle leasing system with coded lock and bicycle leasing and returning method thereof
US20160036594A1 (en) * 2014-07-30 2016-02-04 Master Lock Company Wireless key management for authentication
CN105574598A (en) * 2016-03-03 2016-05-11 陈健强 Hotel reservation realization method and hotel reservation realization system based on intelligent handset door unlocking
CN205809957U (en) * 2016-07-13 2016-12-14 尹博实 A kind of door-control lock and gate control system
CN107705396A (en) * 2017-08-24 2018-02-16 北京飞图同辉科技有限公司 A kind of electronic lock system
CN108022340A (en) * 2017-11-20 2018-05-11 捷德(中国)信息科技有限公司 Vehicle method for unlocking and its device based on LPWan
CN109544747A (en) * 2018-11-20 2019-03-29 北京千丁互联科技有限公司 Encryption key update method, system and the computer storage medium of intelligent door lock
CN110247676A (en) * 2019-07-17 2019-09-17 杭州罗万信息科技有限公司 Termite detects terminal and wireless communication arrangement and method using the terminal

Also Published As

Publication number Publication date
CN113450482B (en) 2021-12-31

Similar Documents

Publication Publication Date Title
US20200329136A1 (en) Systems and Methods for Controlling a Locking Mechanism Using a Portable Electronic Device
US11657365B2 (en) Secured parcel locker system with improved security
CN104966336B (en) Intelligent lock and authorization management method and device of intelligent lock
US9779569B2 (en) Method for controlling door lock of home network system
CN102693381B (en) Method, device and system for anti-theft of portable computer equipment
CN109361642B (en) Remote authorization unlocking method and system
US10529160B2 (en) Method for controlling door lock of home network system
CN113795872A (en) System and method for dynamic delivery of access credentials for a locking system
US20100176919A1 (en) One-time access for electronic locking devices
WO2019240669A1 (en) A system and method for managing electronic locks
CN104020740A (en) Parking management system based on ground lock remotely controlled by mobile terminal
KR101963437B1 (en) System and method for doorlock
CN204759558U (en) Intelligent entrance guard , equipment and system
CN101702248A (en) Fingerprint gate lock monitored by portable mobile phone and management system thereof
CN109685946A (en) Open method, device, equipment and the storage medium of lockset
CN110570559A (en) Electronic key sharing method in access control system based on mobile terminal
CN107545619A (en) A kind of sound wave gate control system and sound wave access control method
KR101612530B1 (en) Method and apparatus for managing security
CN112200941A (en) Method, equipment and storage medium for generating temporary password by intelligent door lock
KR20180087693A (en) Door Locker System and Method for Remotely Controlling the Door Locker by Using Low Power Wide Area Network
CN111325881B (en) Lockset and two-dimension code control method thereof
CN113450482B (en) Electronic lock control method and device, server and electronic lock
KR20180052941A (en) Smart door lock and control method thereof
US20240127655A1 (en) Smart lock
CN111355680B (en) Key distribution method, key receiving method, electronic terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: An electronic lock control method, device, server and electronic lock

Effective date of registration: 20230210

Granted publication date: 20211231

Pledgee: Wuhan area branch of Hubei pilot free trade zone of Bank of China Ltd.

Pledgor: WUHAN EASYLINKIN TECHNOLOGY CO.,LTD

Registration number: Y2023420000041

PE01 Entry into force of the registration of the contract for pledge of patent right