1. Technical Field
The disclosure relates to an electronic device and, more particularly, to an electronic device for unlocking an electronic lock and an unlocking electronic lock method adapted for the electronic device.
2. Description of Related Art
A lot of locks need a physical key to open, however, carrying the physical key is very inconvenient, and if the user loses the key, he will have to go through troubles in getting the lock unlocked.
Use of electronic locks can avoid problems of carrying a physical key. Therefore, what is needed is an electronic device for unlocking electronic lock.
The receiver 30 is connected with an electronic lock 2 via wire. The receiver 30 includes a second storage unit 31, a second communication unit 32, and a second control unit 33. The second storage unit 31 stores data, for example, the second storage unit 31 stores images. The second communication unit 32 sends and receives wireless signals to and from the transmitter 10. The second control unit 33 controls the receiver 30.
The electronic device 1 defines a setting mode and an open mode. In the setting mode, a user can set a key for unlocking the electronic lock 2. In the open mode, the user can unlock the electronic lock 2 by the key. The detecting module 151 detects that the electronic device 1 enters the setting mode or the open mode in response to user inputs from the input unit 12. For example, the input unit 12 is a keyboard, when the user presses a first key in the keyboard, the detecting module 151 detects that the electronic device 1 enters the setting mode; when the user presses a second key in the keyboard, the detecting module 151 detects that the electronic device 1 enters the open mode. When the electronic device 1 is utilized for the first time or the user wants to change an electronic key of the electronic lock 2, the electronic device 1 enters the setting mode. When the electronic device 1 is in use, the electronic device 1 enters the open mode.
When the detecting module 151 detects that the electronic device 1 enters the setting mode, the capturing control module 152 captures a first image and the dividing module 153 divides the first image into a first number of blocks in response to user inputs from the input unit 12, for example, the first image is divided into nine blocks, wherein each block is associated with a sub-image. The selecting module 154 selects one of the first number of blocks in response to user inputs, for example, a third block from the nine blocks is selected. The sending control module 155 acquires the selected block of the first image and controls the first communication unit 14 to send the selected block of the first image and a first control signal.
The second communication unit 32 receives the selected block of the first image and the first control signal. The storage control module 331 stores the selected block of the first image in the second storage unit 31 and sets the selected block of the first image as the electronic key of the electronic lock 2 in response to the first control signal.
When the detecting module 151 detects that the electronic device 1 enters the open mode, the capturing control module 152 captures a second image and the dividing module 153 divides the second image into a second number of blocks in response to inputs from a user on the input unit 12. The selecting module 154 selects one of the second number of blocks in response to the inputs from a user on the input unit 12. The sending control module 155 acquires the selected block of the second image and controls the first communication unit 14 to send the selected block of the second image and a second control signal.
The second communication unit 32 receives the selected block of the second image and the second control signal. The determination module 332 determines whether the selected block of the second image is similar to the selected block of the first image. For example, the determination module 332 determines whether a similarity between the selected block of the second image and the selected block of the first image is greater than 90%. When the similarity is greater than 90%, that means that the selected block of the second image is similar to the selected block of the first image; and when the similarity is less than 90%, that means that the selected block of the second image is not similar to the selected block of the first image.
When the determination module 332 determines that the selected block of the second image is similar to the selected block of the first image, that means that the user is a legal one, the lock control module 333 unlocks the electronic lock 2 in response to the second control signal. When the determination module 332 determines that the selected block of the second image is not similar to the selected block of the first image, that means that the user is an illegal one, the lock control module 333 generates a fail prompt and the display control module 334 controls the display unit 16 to display the fail prompt.
In another embodiment, the storage control module 331 is embedded into the first control unit 15 and both the first image and the selected block of the first image is stored in the first storage unit 13. The first control unit 15 determines whether the selected block of the second image is similar to the selected block of the first image. When the selected block of the second image is similar to the selected block of the first image, the first control unit 15 sends the second control signal to control the receiver 30 to unlock the electronic lock 2.
In step S2, when the detecting module 151 detects that the electronic device 1 enters the setting mode, the capturing control module 152 captures a first image and the dividing module 153 divides the first image into a first number of blocks in response to user inputs from the input unit 12.
In step S3, the sending control module 155 acquires the selected block of the first image and controls the first communication unit 14 to send the selected block of the first image and a first control signal.
In step S4, the second communication unit 32 receives the selected block of the first image and the first control signal, the storage control module 331 stores the selected block of the first image in the second storage unit 31 and sets the selected block of the first image as the electronic key of the electronic lock 2 in response to the first control signal.
In step S6, when the detecting module 151 detects that the electronic device 1 enters the open mode, the capturing control module 152 captures a second image and the dividing module 153 divides the second image into a second number of blocks in response to user inputs from the input unit 12.
In step S7, the selecting module 154 selects one of the second number of blocks in response to user inputs.
In step S8, the sending control module 155 acquires the selected block of the second image and controls the first communication unit 14 to send the selected block of the second image and a second control signal.
In step S9, the second communication unit 32 receives the selected block of the second image and the second control signal.
In step S10, the determination module 332 determines whether the selected block of the second image is similar to the selected block of the first image.
In step S11, when the determination module 332 determines that the selected block of the second image is similar to the selected block of the first image, the lock control module 333 unlocks the electronic lock in response to the second control signal.
In step S12, when the determination module 332 determines that the selected block of the second image is not similar to the selected block of the first image, the lock control module 333 generates a fail prompt and the display control module 334 controls the display unit 16 to display the fail prompt.
Although the present disclosure has been specifically described on the basis of the exemplary embodiment thereof, the disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the embodiment without departing from the scope and spirit of the disclosure.
Number | Date | Country | Kind |
---|---|---|---|
2012101579493 | May 2012 | CN | national |