Disclosure of Invention
In view of the above technical problems, an object of the present invention is to provide a user binding method and system for an NB-IoT intelligent lock, which solve the problems that the user binding process of the NB-IoT intelligent lock is complicated, the device identification information is easily obtained by an illegal user, and the security is low.
The invention adopts the following technical scheme:
a user binding method of an NB-IoT intelligent lock is applied to an intelligent lock comprising an NB-IoT module, and comprises the following steps:
after communication connection is established with a user terminal, first binding request information sent by the user terminal is received and forwarded to an NB-IoT module;
creating first token information, and sending second binding request information and binding permission information to a cloud end through an NB-IoT module, wherein the binding permission information comprises the first token information and first equipment identification information;
sending verification information to a user terminal through an NB-IoT module, so that the user terminal sends third binding request information and verification information to a cloud after receiving the verification information, the cloud verifies the verification information according to the binding permission information, and if the verification is successful, a binding relationship between an intelligent lock and a user account is established;
and receiving binding success notification information sent by the cloud after the verification is successful through the NB-IoT module.
Optionally, the creating the first token information includes randomly generating the first token information.
Optionally, the cloud checks the verification information according to the binding permission information, including:
the verification information comprises second token information and second equipment identification information, the cloud verifies the verification information after receiving third binding request information, and if the second token information in the verification information is the same as the first token information and the second equipment identification information is the same as the first equipment identification information, the verification is judged to be passed.
A user binding method of an NB-IoT intelligent lock is applied to a user terminal and comprises the following steps:
when the intelligent lock to be bound is identified, generating prompt information for prompting a user to bind the intelligent lock;
when instruction information that a user agrees to bind is acquired, establishing communication connection with the intelligent lock, sending first binding request information to the intelligent lock, so that the intelligent lock creates first token information after receiving the first binding request information, and sending second binding request information and binding permission information to a cloud end through an NB-IoT module, wherein the binding permission information comprises the first token information and first equipment identification information;
receiving authentication information sent by the intelligent lock through an NB-IoT module, wherein the authentication information comprises second token information and second equipment identification information; sending the third binding request information and the verification information to the cloud end so that the cloud end can verify the verification information according to the binding permission information, and establishing a binding relation between the intelligent lock and the user account under the condition of successful verification;
and receiving a binding success notification message sent by the cloud after the verification is successful. .
Optionally, when the to-be-bound smart lock is identified, generating a prompt message for prompting the user to bind the smart lock includes:
the intelligent lock is identified by sending a UDP broadcast packet, or Bluetooth broadcast, or a near field communication mode, or a code scanning mode to the intelligent lock, and when the intelligent lock to be bound is identified, prompt information for prompting a user to bind the intelligent lock by one key is generated.
Optionally, after the step of receiving the binding success notification information sent by the cloud, the method further includes:
the intelligent lock is controlled in a near field communication mode or remotely controlled through a cloud.
A user binding system for an NB-IoT bluetooth smart lock, comprising: the system comprises an intelligent lock, a user terminal and a cloud end;
the intelligent lock is used for receiving first binding request information sent by the user terminal after establishing communication connection with the user terminal and forwarding the first binding request information to the NB-IoT module; creating first token information, and sending second binding request information and binding permission information to a cloud terminal through an NB-IoT module, wherein the binding permission information comprises the first token information and first equipment identification information; after the cloud terminal is confirmed to receive the second binding request information, sending verification information to the user terminal through the NB-IoT module, wherein the verification information comprises second token information and second equipment identification information; the system comprises an NB-IoT module and a cloud end, wherein the NB-IoT module is used for receiving binding success notification information sent by the cloud end;
the user terminal is used for generating prompt information for prompting a user to bind the intelligent lock when the intelligent lock to be bound is identified; when instruction information that a user agrees to bind is acquired, communication connection is established with the intelligent lock, first binding request information is sent to the intelligent lock, verification information sent by the intelligent lock is received, the verification information comprises second token information and second equipment identification information, and third binding request information and the verification information are sent to a cloud end; the device comprises a server and a server, wherein the server is used for receiving binding success notification information sent by a cloud end;
the cloud end is used for receiving second binding request information and binding permission information sent by the intelligent lock, receiving third binding request information and verification information sent by the user terminal, and verifying the verification information based on the binding permission information; and after the verification is successful, sending a binding success notification message to the intelligent lock NB-IoT module and the user terminal.
Optionally, the intelligent lock includes a main control unit, an NB-IoT module, a wireless communication unit, and a lock execution mechanism;
the NB-IoT module and the wireless communication unit are electrically connected with the main control unit, the intelligent lock is in communication connection with the cloud end through the NB-IoT module, and the intelligent lock is in communication connection with the user terminal through the wireless communication unit.
An electronic device, comprising: at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the user binding method of the NB-IoT smart lock.
A computer storage medium having stored thereon a computer program that, when executed by a processor, implements the NB-IoT smart lock user binding method.
Compared with the prior art, the invention has the beneficial effects that:
when the user binding is performed on the NB-IoT intelligent lock, the NB-IoT module sends second binding request information and binding permission information to the cloud, the user terminal sends third binding request information and verification information to the cloud after receiving verification information received by the intelligent lock through the NB-IoT module, and the cloud verifies the verification information according to the binding permission information, so that bidirectional verification can be realized, the safety of the bound intelligent lock is improved, and the binding process is simple; the problem of among the prior art NB-IoT intelligence lock user bind the loaded down with trivial details flow and equipment identification information is acquireed by illegal user easily, the security is lower is solved, the user only carries out 1 ~ 2 steps of operation at user terminal APP end and can accomplish the binding of intelligence lock, has greatly promoted the experience that the user bound.
In the binding process of the NB-IoT intelligent lock, the first token information in the binding permission information is generated randomly by the intelligent lock and is subjected to bidirectional verification, so that the security of user binding can be improved to a greater extent.
Furthermore, after the intelligent lock is bound, the intelligent lock can be controlled in a near field communication mode or remotely controlled through a cloud, information reported by the intelligent lock, such as intelligent lock state information, is acquired, and the intelligent lock can be controlled in real time.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and specific embodiments, and it should be noted that, in the premise of no conflict, the following described embodiments or technical features may be arbitrarily combined to form a new embodiment:
the first embodiment is as follows:
referring to fig. 1-6, fig. 1 shows a user binding method of an NB-IoT smart lock of the present invention, which is applied to a smart lock 1 including an NB-IoT module 13, and includes the following steps:
step S1, after establishing communication connection with the user terminal 3, receiving the first binding request information sent by the user terminal 3 and forwarding the first binding request information to the NB-IoT module 13;
in this embodiment, the user terminal 3 may be a smart terminal, such as a mobile phone, a tablet computer, and the like. The smart lock 1 and the user terminal 3 may establish a bluetooth connection through the bluetooth module 14, may also establish a Communication connection after scanning the smart lock 1 through the APP of the user terminal 3, and may also establish a Communication connection with the smart lock 1 through an NFC (Near Field Communication, NFC for short).
Step S2, creating first token information, and sending second binding request information and binding permission information to the cloud 2 through the NB-IoT module 13, wherein the binding permission information comprises the first token information and the first equipment identification information;
note that Token information, i.e., Token information, represents an object of a right to perform some operation.
Optionally, the creating the first token information includes randomly generating the first token information.
In the implementation process, the first token information is randomly generated, so that the user binding safety is further improved.
In this embodiment, after receiving the first binding request message sent by the user terminal 3, the smart lock 1 randomly generates a first token message for allowing the user terminal 3 to bind the smart lock 1 in the subsequent steps.
In this embodiment, the first device identification information may include one or more of ID information of the smart lock 1, function code information of the smart lock 1, and model information of the smart lock 1. Through the first device identification information, the smart lock 1 can be identified.
Step S3, sending verification information to the user terminal 3 through the NB-IoT module 13, wherein the verification information comprises second token information and second equipment identification information, so that the user terminal 3 sends third binding request information and verification information to the cloud end 2 after receiving the verification information, so that the cloud end 2 verifies the verification information according to the binding permission information, and establishes the binding relationship between the intelligent lock 1 and the user account number under the condition of successful verification;
in this embodiment, the cloud 2 confirms that the second user binding requirement information is received from the smart lock 1, and the smart lock 1 sends the verification information to the user terminal 3 after confirming that the cloud 2 receives the second user binding requirement information.
In this embodiment, the cloud 2 checks the verification information after receiving the third binding request information, and if the second token information in the verification information is the same as the first token information and the second device identification information is the same as the first device identification information, it is determined that the check is passed.
And step S4, receiving the binding success notification information sent by the cloud end 2 after the verification information is verified successfully.
In the implementation process, the intelligent lock 1 sends second binding request information and binding permission information to the cloud end 2, the user terminal 3 sends third binding request information and verification information to the cloud end 2 after receiving the verification information, and the verification information is verified through the cloud end 2 according to the binding permission information, so that bidirectional verification can be achieved, the safety of binding the intelligent lock 1 is improved, and the binding process is simple.
As another embodiment of the present invention, please refer to fig. 2, where fig. 2 illustrates a user binding method of an NB-IoT smart lock of the present invention, applied to a user terminal 3, and includes the following steps:
step S11, generating prompt information for prompting a user to bind the intelligent lock 1 when the intelligent lock 1 to be bound is identified;
optionally, when the intelligent lock 1 to be bound is identified, generating a prompt message for prompting the user to bind the intelligent lock 1 includes:
the intelligent lock 1 is identified by sending a UDP broadcast packet, or monitoring Bluetooth broadcast, or a near field communication mode, or scanning a code for the intelligent lock 1, and when the intelligent lock 1 to be bound is identified, prompt information for prompting a user to bind the intelligent lock 1 is generated.
When the method is specifically implemented, the user terminal 3 is provided with the APP, the APP of the user terminal 3 can identify the intelligent lock 1 to be bound in a Bluetooth broadcasting mode, and prompt information for prompting the user to bind the intelligent lock 1 in one key is sent.
Step S21, when instruction information that a user agrees to one-key binding is acquired, communication connection is established with the intelligent lock 1, first binding request information is sent to the intelligent lock 1, so that the intelligent lock 1 creates first token information after receiving the first binding request information, and second binding request information and binding permission information are sent to the cloud end 2 through the NB-IoT module 13, wherein the binding permission information comprises the first token information and first equipment identification information;
in this embodiment, the binding request refers to a request for binding a user account with the smart lock 1, where the first binding request information may include user identification information, first device identification information, and the like, where the user identification information refers to user information corresponding to a user account logged in to the user terminal APP, for example, user ID information, user name information, and the like.
Specifically, the intelligent lock 1 is provided with an NB-IoT module 13, a Bluetooth module 14 and a main control unit 12, Bluetooth connection can be established between the intelligent lock 1 and the user terminal 3, and the user terminal 3 sends first binding request information to the Bluetooth module 14; after receiving the first binding request information, the bluetooth module 14 forwards the first binding request information to the NB-IoT module 13 through the main control unit 12. The NB-IoT module 13 creates a randomly generated first token information after receiving the first binding request information. The NB-IoT module 13 then sends the second binding request information and the binding permission information to the cloud 2, where the binding permission information includes the first token information and the first device identification information; after confirming that the cloud 2 receives the second binding request, the verification information is sent to the user terminal 3.
In a specific implementation, the second binding request information may include user identification information, first device identification information, first token information, and the like.
Step S31, receiving verification information sent by the intelligent lock 1, wherein the verification information comprises second token information and second equipment identification information, sending third binding request information and the verification information to the cloud end 2, so that the cloud end 2 verifies the verification information according to the binding permission information, and establishing the binding relationship between the intelligent lock 1 and the user account under the condition of successful verification;
in a specific implementation, the third binding request information may include user identification information, first device identification information, first token information, and the like.
And step S41, receiving the binding success notification information sent by the cloud 2 after the verification is successful.
In the implementation process, the user only needs to input an instruction for agreeing one-key binding at the APP terminal, so that the intelligent lock 1 can be bound, the intelligence of the binding process is increased, and the experience of the user in binding the intelligent lock 1 is greatly improved.
Optionally, after step S41, the method further includes:
and step S51, controlling the intelligent lock 1 in a near field communication mode or remotely controlling the intelligent lock 1 through the cloud 2.
Specifically, after the user account is bound with the intelligent lock 1, the APP end can be used near the intelligent lock 1 to establish Bluetooth connection with the intelligent lock 1, and the instruction is sent to the main control unit 12 through Bluetooth to realize that the APP end controls the intelligent lock 1 in the near field. After the instruction is executed, the main control unit 12 transmits the execution result of the relevant instruction to the bluetooth module 14 and the NB-IoT module 13 synchronously, the bluetooth module 14 feeds the result back to the APP end, and the NB-IoT module 13 reports the result to the cloud 2.
The user also can use the APP end to send the execution instruction to the cloud 2, and the remote control intelligent lock 1 is realized. After receiving the execution instruction, the cloud 2 issues the instruction to the NB-IoT module 13, the NB-IoT module 13 parses the instruction and transmits the parsed instruction to the main control unit 12 to execute a specific operation, the main control unit 12 returns an operation result to the NB-IoT module 13 after the execution is completed, and the operation result is fed back to the cloud 2 by the NB-IoT module 13 and then fed back to the APP end by the cloud 2.
Example two:
referring to fig. 3, fig. 3 shows a user binding system of an NB-IoT bluetooth smart lock according to the present invention, which includes: the system comprises an intelligent lock 1, a user terminal 3 and a cloud 2;
the intelligent lock 1 is configured to receive first binding request information sent by the user terminal 3 after establishing a communication connection with the user terminal 3, and forward the first binding request information to the NB-IoT module 13; creating first token information, and sending second binding request information and binding permission information to the cloud 2 through the NB-IoT module 13, wherein the binding permission information comprises the first token information and first equipment identification information; after confirming that the cloud 2 receives the second binding request information, sending verification information to the user terminal 3 through the NB-IoT module 13, where the verification information includes second token information and second device identification information, and is used to receive binding success notification information sent by the cloud 2 through the NB-IoT module 13;
the user terminal 3 is used for generating prompt information for prompting a user to bind the intelligent lock 1 when the intelligent lock 1 to be bound is identified; when instruction information that a user agrees to bind is acquired, communication connection is established with the intelligent lock 1, first binding request information is sent to the intelligent lock 1, verification information sent by the intelligent lock 1 is received, the verification information comprises second token information and second equipment identification information, and third binding request information and the verification information are sent to a cloud end 2; the system is used for receiving the binding success notification information sent by the cloud end 2;
the cloud end 2 is used for receiving second binding request information sent by the intelligent lock 1 and third binding request information and verification information sent by the user terminal 3, and verifying the verification information based on the third binding request information and the second binding request information; and after the verification is successful, sending a binding success notification message to the NB-IoT module 13 of the intelligent lock 1 and the user terminal 3.
Specifically, the intelligent lock 1 comprises a main control unit 12, an NB-IoT module 13 and a wireless communication unit, wherein the NB-IoT module 13 and the wireless communication unit are electrically connected to the main control unit 12, the intelligent lock 1 is in communication connection with the cloud 2 through the NB-IoT module 13, and the intelligent lock 1 is in communication connection with the user terminal 3 through the wireless communication unit.
In specific implementation, specific actions of the intelligent lock 1 can be controlled by the lock execution mechanism, and the main control unit 12 controls the lock execution mechanism to control the specific actions of the intelligent lock 1 and monitor the state of the intelligent lock 1; the NB-IoT module 13 is used for the interaction between the intelligent lock 1 and the cloud 2; the wireless communication unit is used for interaction between the intelligent lock 1 and the user terminal 3; the main control unit 12, the NB-IoT module 13, and the wireless communication unit communicate with each other through UART.
In this embodiment, the wireless communication unit may specifically adopt a bluetooth module 14 or an NFC communication unit, wherein the smart lock 1 interacts with the user terminal 3 through the bluetooth module 14 or other types of wireless communication units.
The invention is illustrated below in specific examples:
referring to fig. 4, fig. 4 shows a binding process of a user binding system using an NB-IoT bluetooth smart lock according to the present invention, where APP terminals all refer to user terminals 3 installed with APPs in the present application, and the specific process is as follows:
(1) the Bluetooth module 14 of the intelligent lock 1 transmits a Bluetooth broadcast packet;
(2) the APP terminal identifies the intelligent lock 1 to be bound through Bluetooth broadcasting and prompts a user to click one-key binding;
(3) the APP terminal and the intelligent lock 1 establish a pairing relation, and a first user binding request is sent to the intelligent lock 1;
(4) the bluetooth module 14 of the smart lock 1 receives the first user binding request and forwards the first binding request to the NB-IoT module 13 through the main control unit 12;
(5) after the NB-IoT module 13 receives the first user binding request, creating a randomly generated first token;
(6) the NB-IoT module 13 sends a second user binding request to the cloud 2, where the sent data includes the first token generated in the previous step, and device identification information such as device model information, device ID information, and device function code;
(7) the cloud 2 confirms to the NB-IoT module 13 that the second user binding request is received;
(8) after confirming that the cloud 2 receives the second user binding request, the NB-IoT module 13 forwards the first token generated in the foregoing step, and device identifiers such as a device model, device ID information, and device function code to the bluetooth module 14 of the smart lock 1 through the main control unit 12;
(9) after receiving the first token and the device identification information, the bluetooth module 14 of the intelligent lock 1 sends the information to the APP end;
(10) after receiving the first token and the equipment identifier, the APP terminal sends the information to the cloud terminal 2 and initiates a third user binding request;
(11) after receiving a third user binding request initiated by the APP, the cloud 2 verifies whether the tokens and the device identifiers reported by the NB-IoT module 13 and the APP on both sides are consistent, and if so, the verification is passed; after the verification is passed, establishing a binding relationship between the intelligent lock 1 and the user account;
(12) the cloud 2 sends a binding success notification to the NB-IoT module 13 and the APP side.
As another specific embodiment, please refer to fig. 5, where fig. 5 shows a schematic view of an interaction flow between terminals in the specific embodiment of the present invention, and the specific interaction flow is as follows:
(1) the intelligent lock 1 enters a to-be-bound state;
(2) the APP terminal finds the intelligent lock 1 to be bound and inquires whether the user is bound by one key;
(3) the user clicks the selected intelligent lock 1 to perform one-key binding;
(4) the APP end prompts that the binding is in progress, and a user waits;
(5) the APP end prompts that the binding is successful, and the user can execute other operations.
In the above-mentioned interaction process, the user only needs to carry out the operation of clicking the selected intelligent lock 1 at the APP terminal to carry out one-key binding, can accomplish the binding of intelligent lock 1, has increased the intelligence of binding the flow to the user experience of binding intelligent lock 1 has greatly been promoted.
Example three:
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and in this application, an electronic device 100 for implementing the user binding method of an NB-IoT smart lock according to the embodiment of the present invention may be described through the schematic diagram shown in fig. 6.
As shown in fig. 6, an electronic device 100 includes one or more processors 102, one or more memory devices 104, and the like, which are interconnected via a bus system and/or other type of connection mechanism (not shown). It should be noted that the components and structure of the electronic device 100 shown in fig. 6 are only exemplary and not limiting, and the electronic device may have some of the components shown in fig. 6 and may have other components and structures not shown in fig. 6 as needed.
The processor 102 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 100 to perform desired functions.
The storage 104 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. On which one or more computer program instructions may be stored that may be executed by processor 102 to implement the functions of the embodiments of the application (as implemented by the processor) described below and/or other desired functions. Various applications and various data, such as various data used and/or generated by the applications, may also be stored in the computer-readable storage medium.
The invention also provides a computer storage medium on which a computer program is stored, in which the method of the invention, if implemented in the form of software functional units and sold or used as a stand-alone product, can be stored. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer storage medium and used by a processor to implement the steps of the embodiments of the method. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer storage medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer storage media may include content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer storage media that does not include electrical carrier signals and telecommunications signals as subject to legislation and patent practice.
Various other modifications and changes may be made by those skilled in the art based on the above-described technical solutions and concepts, and all such modifications and changes should fall within the scope of the claims of the present invention.