Door lock communication system and method based on security chip
By setting up security chips in smart door locks, servers and terminal devices, and using public and private keys for encryption and decryption, the problems of low security and instability caused by the lack of security chips in smart door locks are solved, achieving high quality and high quality Secure door lock communication.
Patent Information
- Application Number
- CN201711393086.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2017-12-21
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2037-12-21
AI Technical Summary
The existing smart door locks lack security chips, which leads to the inability to secure local hardware encryption, low security, and unstable communication quality, so they need to communicate through BLE/ZigBee gateway and Wi-Fi router.
Security chips are set up in smart door locks, servers and terminal devices, and data is encrypted and decrypted through public and private keys to realize local encryption and ensure communication quality and security.
Direct access to the Internet through the wireless gateway to communicate with the server or terminal equipment, and local encryption of data is used for security chips, which improves the communication quality and security of the door lock and avoids single point of failure of the transit equipment.
Smart Images

Figure CN107945350B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart home technology, and in particular to a door lock communication system and method based on a security chip. Background Art
[0002] Currently, if Figure 1 As shown, the existing smart door locks include ZigBee modules and BLE (Bluetooth Low Energy) modules. Figure 2 As shown in the figure, ZigBee modules and BLE modules need to access the Internet through corresponding gateway devices to communicate and interact with the corresponding servers. For example, users send data to the server through terminal devices, and then send it to the BLE / ZigBee gateway through the Internet and Wi-Fi routers, and then send it to the corresponding smart door lock.
[0003] However, Figure 1 There is no security chip in the system, so local hardware security encryption cannot be performed, and the security is relatively low. Figure 2 In the communication link between the smart door lock and the server, it needs to go through the BLE / ZigBee gateway and the Wi-Fi router, which makes the communication quality of the door lock unstable. Summary of the invention
[0004] The object of the present invention is to solve one of the technical problems in the related art at least to a certain extent.
[0005] To this end, the first purpose of the present invention is to propose a door lock communication system based on a security chip, which is used to solve the problems in the prior art that smart door locks do not have security chips, cannot perform local hardware security encryption, have relatively low security, and have unstable communication quality.
[0006] The second object of the present invention is to provide a door lock communication method based on a security chip.
[0007] A third object of the present invention is to provide a computer device.
[0008] A fourth object of the present invention is to provide a non-transitory computer-readable storage medium.
[0009] To achieve the above-mentioned purpose, the first aspect of the present invention proposes a door lock communication system based on a security chip, characterized in that it includes: a smart door lock, a wireless gateway, a server, and a terminal device; wherein a first security chip is set in the smart door lock, a second security chip is set in the server, and a third security chip is set in the terminal device; the smart door lock is used to access the Internet through the wireless gateway to communicate and interact with the server or the terminal device; the server is used to generate a public key and a private key through the second security chip, and encrypt or decrypt the data for communication and interaction with the first security chip and the third security chip through the public key and the private key; the smart door lock is used to generate a public key and a private key through the first security chip, and encrypt or decrypt the data for communication and interaction with the second security chip and the third security chip through the public key and the private key; the terminal device is used to generate a public key and a private key through the third security chip, and encrypt or decrypt the data for communication and interaction with the second security chip and the first security chip through the public key and the private key.
[0010] The door lock communication system based on the security chip of the embodiment of the present invention comprises: a smart door lock, a wireless gateway, a server, and a terminal device, wherein a first security chip is set in the smart door lock, a second security chip is set in the server, and a third security chip is set in the terminal device, the smart door lock is used to access the Internet through the wireless gateway to communicate and interact with the server or the terminal device, the server is used to generate a public key and a private key through the second security chip, and encrypt or decrypt the data for communication and interaction with the first security chip and the third security chip through the public key and the private key, the smart door lock is used to generate a public key and a private key through the first security chip, and encrypt or decrypt the data for communication and interaction with the second security chip and the third security chip through the public key and the private key, and the terminal device is used to generate a public key and a private key through the third security chip, and encrypt or decrypt the data for communication and interaction with the second security chip and the first security chip through the public key and the private key. Thus, the smart door lock directly accesses the Internet through the wireless gateway to communicate and interact with the server or the terminal device, and uses the security chip to encrypt or decrypt the communication and interaction data locally, thereby ensuring the communication quality and security of the door lock.
[0011] In addition, the door lock communication system based on the security chip according to the above embodiment of the present invention may also have the following additional technical features:
[0012] Optionally, the terminal device is specifically used to set an unlocking password, and encrypts the unlocking password and door lock identification by using the public key and private key pre-stored in the third security chip and then sends the encrypted data to the second security chip; the server is specifically used to decrypt the data sent by the terminal device by using the public key and private key pre-stored in the second security chip to obtain the unlocking password and the door lock identification.
[0013] Optionally, the terminal device is also used to scan the QR code information on the smart door lock to obtain the door lock identification; the server is also used to decrypt the data sent by the smart door lock through the public key and private key pre-stored in the second security chip to obtain the door lock information, and verify whether the door lock identification is legal based on the door lock information. If legal, query the working status of the smart door lock.
[0014] Optionally, the server is further used to obtain the status of the smart door lock corresponding to the door lock identifier according to a preset polling cycle. If it is known that the smart door lock is in a communication state, the server encrypts the unlocking password by using the public key and private key pre-stored in the second security chip and sends it to the smart door lock, and feeds back a successful response to the terminal device; if it is known that the smart door lock is in a sleep state, a wake-up request is sent to the smart door lock, and a failure response is fed back to the terminal device; the smart door lock is specifically used to decrypt the received data by using the public key and private key pre-stored in the first security chip to obtain the unlocking password, so as to match the temporary password provided by the unlocking user according to the unlocking password. If the match is successful, the unlocking process is performed, and a successful unlocking response is fed back to the terminal device.
[0015] Optionally, the smart door lock is also used to detect the real-time status. If it is detected that the current status meets the preset sleep condition, it switches to the sleep state and updates the status to the server. If it is detected that the current status meets the preset communication condition, it switches to the communication state, updates the status to the server, and synchronizes data with the server.
[0016] To achieve the above-mentioned purpose, the second aspect of the present invention proposes a door lock communication method based on a security chip, which is applied to a door lock communication system based on a security chip, and the system includes: a smart door lock, a wireless gateway, a server, and a terminal device; wherein a first security chip is set in the smart door lock, a second security chip is set in the server, and a third security chip is set in the terminal device; the smart door lock accesses the Internet through the wireless gateway to communicate and interact with the server or the terminal device; the server generates a public key and a private key through the second security chip, and encrypts or decrypts the data for communication and interaction with the first security chip and the third security chip through the public key and the private key; the smart door lock generates a public key and a private key through the first security chip, and encrypts or decrypts the data for communication and interaction with the second security chip and the third security chip through the public key and the private key; the terminal device generates a public key and a private key through the third security chip, and encrypts or decrypts the data for communication and interaction with the second security chip and the first security chip through the public key and the private key.
[0017] In the door lock communication method based on the security chip of the embodiment of the present invention, the smart door lock is used to access the Internet through a wireless gateway to communicate and interact with a server or a terminal device, the server is used to generate a public key and a private key through the second security chip, and encrypt or decrypt the data for communication and interaction with the first security chip and the third security chip through the public key and the private key, the smart door lock is used to generate a public key and a private key through the first security chip, and encrypt or decrypt the data for communication and interaction with the second security chip and the third security chip through the public key and the private key, and the terminal device is used to generate a public key and a private key through the third security chip, and encrypt or decrypt the data for communication and interaction with the second security chip and the first security chip through the public key and the private key. As a result, the smart door lock directly accesses the Internet through the wireless gateway to communicate and interact with the server or the terminal device, and uses the security chip to locally encrypt or decrypt the communication and interaction data, thereby ensuring the communication quality and security of the door lock.
[0018] In addition, the door lock communication method based on the security chip according to the above embodiment of the present invention may also have the following additional technical features:
[0019] Optionally, the terminal device sets an unlocking password, and encrypts the unlocking password and door lock identification by using the public key and private key pre-stored in the third security chip and then sends the encrypted data to the second security chip; the server decrypts the data sent by the terminal device by using the public key and private key pre-stored in the second security chip to obtain the unlocking password and the door lock identification.
[0020] Optionally, the terminal device scans the QR code information on the smart door lock to obtain the door lock identification; the server decrypts the data sent by the smart door lock through the public key and private key pre-stored in the second security chip to obtain the door lock information, and verifies whether the door lock identification is legal based on the door lock information. If legal, the working status of the smart door lock is queried.
[0021] Optionally, the server obtains the status of the smart door lock corresponding to the door lock identifier according to a preset polling cycle. If it is learned that the smart door lock is in a communication state, the server encrypts the unlocking password by using the public key and private key pre-stored in the second security chip and sends it to the smart door lock, and feeds back a successful response to the terminal device; if it is learned that the smart door lock is in a sleep state, the server sends a wake-up request to the smart door lock, and feeds back a failure response to the terminal device; the smart door lock decrypts the received data by using the public key and private key pre-stored in the first security chip to obtain the unlocking password, so as to match the temporary password provided by the unlocking user according to the unlocking password. If the match is successful, the unlocking process is performed, and a successful unlocking response is fed back to the terminal device.
[0022] Optionally, the smart door lock detects the real-time status. If it is detected that the current status meets the preset sleep condition, it switches to the sleep state and updates the status to the server. If it is detected that the current status meets the preset communication condition, it switches to the communication state, updates the status to the server, and synchronizes data with the server.
[0023] To achieve the above-mentioned purpose, the third aspect of the present invention proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the door lock communication method based on the security chip described in the second aspect of the present invention is implemented.
[0024] In order to achieve the above-mentioned objectives, the fourth aspect embodiment of the present invention proposes a non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor, it enables the execution of the security chip-based door lock communication method described in the second aspect embodiment.
[0025] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0027] Figure 1It is a structural schematic diagram of the smart door lock of the prior art;
[0028] Figure 2 It is a schematic diagram of the structure of door lock communication in the prior art;
[0029] Figure 3 is a schematic diagram of the structure of door lock communication based on a security chip according to an embodiment of the present invention;
[0030] Figure 4 is a schematic diagram of the structure of a smart door lock according to an embodiment of the present invention;
[0031] Figure 5 is a schematic diagram of a data encryption process according to an embodiment of the present invention;
[0032] Figure 6 is a schematic diagram of a data encryption process according to another embodiment of the present invention;
[0033] Figure 7 is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0035] The following describes a door lock communication system and method based on a security chip according to an embodiment of the present invention with reference to the accompanying drawings.
[0036] At present, in the existing door lock systems, smart door locks, servers, terminal devices, etc. do not have security chips, and local hardware security encryption cannot be performed, the security is relatively low, and the communication process needs to be transferred through BLE / ZigBee gateways and Wi-Fi routers, resulting in unstable door lock communication quality.
[0037] To address this problem, the embodiment of the present invention provides a door lock communication system based on a security chip, which enables the smart door lock to directly access the Internet through a wireless gateway to communicate with a server or terminal device, and the smart door lock, server, and terminal device are all equipped with a security chip to encrypt or decrypt the communication data locally, thereby ensuring the door lock communication quality and security. The details are as follows:
[0038] Figure 3 FIG. 1 is a schematic diagram of a door lock communication structure based on a security chip according to an embodiment of the present invention. Figure 3As shown, the security chip-based door lock communication system includes: a smart door lock 100, a wireless gateway 200, a server 300 and a terminal device 400.
[0039] Among them, a first security chip 101 is set in the smart door lock 100, a second security chip 301 is set in the server 300, and a third security chip 401 is set in the terminal device 400.
[0040] Specifically, the smart door lock 100 is used to access the Internet through the wireless gateway 200 to communicate with the server 300 or the terminal device 400. That is, based on a low-power wireless (such as NBIOT, Lora or Zigbee) network, the smart door lock 100 directly connects the low-power wireless gateway (NBIOT does not require a gateway) to the Internet, so that the quality of low-power wireless network communication is guaranteed.
[0041] It should be noted that in the implementation of the present invention, for example Figure 4 As shown, smart door locks are different from Figure 1 The structure shown also includes: communication modules such as security chip, NBIOT module and BLE module. Introducing communication modules such as low-power wireless (such as NBIOT, Lora) modules into the smart door lock 100 eliminates the need for BLE / Zigbee gateways and Wi-Fi servers. This reduces the hidden dangers of single-point failures in gateways and Wi-Fi servers, and overcomes the instability of existing wireless networks.
[0042] The server 300 is used to generate a public key and a private key through the second security chip 301 , and encrypt or decrypt data for communication and interaction with the first security chip 101 and the third security chip 401 through the public key and the private key.
[0043] The smart door lock 100 is used to generate a public key and a private key through the first security chip 101, and encrypt or decrypt data for communication and interaction with the second security chip 301 and the third security chip 401 through the public key and the private key.
[0044] The terminal device 400 is used to generate a public key and a private key through the third security chip 401 , and encrypt or decrypt data for communication and interaction with the second security chip 301 and the first security chip 101 through the public key and the private key.
[0045] It is understandable that the smart door lock 100 can connect the door lock to the Internet through various wireless communication technologies, so that remote unlocking can be achieved through the terminal device 400. For example, when a friend comes to the house when no one is at home, the one-time password can be shared with the friend. After the password is encrypted by the relevant security chip, the password is remotely configured on the smart door lock 100, so that the friend can enter the door by himself through the password, which is convenient for the user.
[0046] It should be noted that the data used by the smart door lock to communicate and interact with the server or terminal device is not limited to the above-mentioned password, but can also be update data, etc., which can be selected and set according to actual application needs.
[0047] Specifically, taking the communication data as an unlocking password as an example, in one embodiment of the present invention, the terminal device 400 is used to set the unlocking password, and encrypts the unlocking password and the door lock identification through the public key and private key pre-stored in the third security chip 401 and sends them to the second security chip 301, so that the server 300 is used to decrypt the data sent by the terminal device 400 through the public key and private key pre-stored in the second security chip 301 to obtain the unlocking password and the door lock identification.
[0048] That is, the user sets a password through a terminal device 400 such as a mobile phone, a tablet computer, etc. and encrypts the password with a security chip hardware and then sends it to the server 300 through a mobile phone network or the like.
[0049] Specifically, in one embodiment of the present invention, the terminal device 400 is also used to scan the QR code information on the smart door lock 100 to obtain the door lock identification, and the server 300 is also used to decrypt the data sent by the smart door lock 100 through the public key and private key pre-stored in the second security chip 301 to obtain the door lock information, and verify whether the door lock identification is legal based on the door lock information. If it is legal, the working status of the smart door lock is queried.
[0050] That is to say, the smart door lock and the corresponding terminal device are bound by scanning the two-dimensional code to obtain the door lock identification and verify it. The QR code is the unique identification of the door lock and can be generated at the factory, further improving the security of the door lock communication.
[0051] Among them, there are many ways to query the working status of the smart door lock. As one possible implementation method, the server 300 obtains the status of the smart door lock 100 corresponding to the door lock identifier according to a preset polling cycle. If it is known that the smart door lock 100 is in a communication state, the unlocking password is encrypted by the public key and private key pre-stored in the second security chip 301 and sent to the smart door lock 100, and a successful response is fed back to the terminal device 400; if it is known that the smart door lock 100 is in a sleep state, a wake-up request is sent to the smart door lock 100, and a failed response is fed back to the terminal device 400.
[0052] It is understandable that the communication modules such as the BLE module, ZigBee module and NB-IoT (Narrow-band Internet of Things) module in the smart door lock 100 are usually in a dormant state, and only when the smart door lock 100 is triggered by someone trying to enter a password, or wakes up at a scheduled time according to the program design, will it connect to the server 300. That is, in order to save energy, the communication module on the smart door lock 100 is only activated when the user operates the smart door lock 100 or according to a set cycle, so that the smart door lock 100 can communicate with the network. The communication module is in a dormant state at other times, and the smart door lock 100 cannot communicate with the outside.
[0053] Among them, the smart door lock 100 is in a communication state, which can be when the smart door lock 100 is activated by a person, such as pulling up the cover, pressing a fingerprint, pressing the touch screen or other operation actions, or it can be a timed start, such as setting it to connect to the server once every hour to synchronize the status and information, or it can be after each communication interaction. It should be noted that if the smart door lock 100 is already in a closed state and there is no new communication interaction within a preset time, such as 100s, the communication module enters a dormant state. Among them, before entering the dormant state, the communication module will notify the server 300 so that the server 300 can correctly judge the status of the communication module.
[0054] Among them, the smart door lock 100 is in a dormant state, which may be that the communication (such as NBIOT, Lora or Zigbee) module does not send or receive any data, or the communication module is in periodic communication according to the corresponding communication protocol. This cycle is the same as the communication module-server 300 interaction cycle to reduce unnecessary signaling overhead. It can also be that after recovering from the dormant state and establishing a connection with the server 300, the server 300 will update the stored communication module status.
[0055] Specifically, in one embodiment of the present invention, the smart door lock 100 decrypts the received data through the public key and private key pre-stored in the first security chip 101 to obtain the unlocking password, so as to match the temporary password provided by the unlocking user according to the unlocking password. If the match is successful, the unlocking process is performed and a successful unlocking response is fed back to the terminal device 400.
[0056] Specifically, in one embodiment of the present invention, the smart door lock 100 is used to detect the real-time status. If it is detected that the current status meets the preset sleep condition, it switches to the sleep state and updates the status to the server 300. If it is detected that the current status meets the preset communication condition, it switches to the communication state and updates the status to the server 300, and synchronizes data with the server 300 to further meet the communication requirements of the door lock.
[0057] In order to make the technical personnel in this field more clear about the specific process of how to encrypt data locally through the security chip, the following is combined with Figure 5 and Figure 6 Described in detail, this encryption method can improve the security of data.
[0058] Specifically, Figure 5 As shown, first the communication module is initialized, the security chip waits for commands, and receives commands through SPI (Serial Peripheral Interface); then it is determined whether the command is a valid command. If not, the security chip continues to wait for commands. If it is, the valid command is processed; then the valid commands that can be executed include random number acquisition, RSA encryption, RSA decryption, AES encryption and AES decryption, and the corresponding command is selected and executed according to the valid command; finally, the valid command is processed, and after processing, it returns to wait for commands.
[0059] in, Figure 5 The RSA in the text refers to the RSA algorithm, which is based on a very simple number theory fact: it is very easy to multiply two large prime numbers, but it is extremely difficult to factorize the product. Therefore, the product can be made public as an encryption key. RSA is currently the most influential and most commonly used public key encryption algorithm. It can resist most of the cryptographic attacks known so far and has been recommended as the public key data encryption standard.
[0060] Figure 5 AES refers to the AES algorithm, which is also known as Rijndael encryption in cryptography. The length of AES encrypted data blocks must be 128 bits, and the key length can be any one of 128 bits, 192 bits, and 256 bits (if the data block and key length are insufficient, they will be supplemented). AES encryption has many rounds of repetition and transformation.
[0061] Specifically, Figure 6 As shown in the figure, the RSA encryption and encryption verification process of a smart door lock is used as an example to illustrate. Figure 6As shown, first, the security chip receives the ciphertext sent by the server or terminal device through the SPI interface, and then uses the RSA method to decrypt the ciphertext to obtain the private key. When decrypting, the ciphertext ID (the ID identification number of the ciphertext sent by the other party) and the MAC address of the ciphertext (the MAC address contained in the ciphertext) must be verified. If the ID and MAC address are inconsistent, the security chip performs error processing. If they are consistent, the encrypted random number R1 (the encrypted random number sent by the other party) sent by the other party is obtained, and the security chip generates an encrypted random number R2. The ciphertext is encrypted by RSA method R1+R2 to obtain the negotiated public key, and finally the encrypted ciphertext data is transmitted to the other party (server or terminal device) through the SPI interface.
[0062] It should be noted that the local encryption of the above-mentioned security chip and its encryption verification process can be implemented in the security chips in the smart door lock 100, the server 300 and the terminal device 400. RSA can also be replaced by AES to perform AES encryption and verification.
[0063] Therefore, the process of changing the configuration password of the smart door lock 100 through the terminal device 400 can be as follows: set the password through the terminal device 400, the terminal device 400 sends the password to the first security chip 101 in the smart door lock 100 through Bluetooth or NBIOT, Lora and other networks, and the first security chip 101 receives the data through the SPI port. Figure 5 and Figure 6 The password is encrypted through the process, and the encrypted data is finally stored in the specified security area of the flash.
[0064] In summary, the door lock communication system based on the security chip of the embodiment of the present invention includes: a smart door lock, a wireless gateway, a server, and a terminal device, wherein a first security chip is set in the smart door lock, a second security chip is set in the server, and a third security chip is set in the terminal device, the smart door lock is used to access the Internet through the wireless gateway to communicate and interact with the server or the terminal device, the server is used to generate a public key and a private key through the second security chip, and encrypt or decrypt the data for communication and interaction with the first security chip and the third security chip through the public key and the private key, the smart door lock is used to generate a public key and a private key through the first security chip, and encrypt or decrypt the data for communication and interaction with the second security chip and the third security chip through the public key and the private key, the terminal device is used to generate a public key and a private key through the third security chip, and encrypt or decrypt the data for communication and interaction with the second security chip and the first security chip through the public key and the private key. As a result, the smart door lock directly accesses the Internet through the wireless gateway to communicate and interact with the server or the terminal device, and uses the security chip to encrypt or decrypt the communication and interaction data locally, thereby ensuring the communication quality and security of the door lock.
[0065] In order to implement the above embodiment, the present invention further proposes a door lock communication method based on a security chip, and the door lock communication method based on a security chip includes:
[0066] Among them, the method is applied to a door lock communication system based on a security chip, and the system includes: a smart door lock, a wireless gateway, a server, and a terminal device; wherein a first security chip is set in the smart door lock, a second security chip is set in the server, and a third security chip is set in the terminal device.
[0067] Specifically, the smart door lock accesses the Internet through a wireless gateway to communicate and interact with a server or terminal device.
[0068] The server generates a public key and a private key through the second security chip, and encrypts or decrypts data for communication and interaction with the first security chip and the third security chip through the public key and the private key.
[0069] The smart door lock generates a public key and a private key through the first security chip, and encrypts or decrypts the data for communication and interaction with the second security chip and the third security chip through the public key and the private key.
[0070] The terminal device generates a public key and a private key through the third security chip, and encrypts or decrypts data for communication and interaction with the second security chip and the first security chip through the public key and the private key.
[0071] In one embodiment of the present invention, the terminal device sets an unlocking password, and encrypts the unlocking password and door lock identification by using the public key and private key pre-stored in the third security chip and sends them to the second security chip; the server decrypts the data sent by the terminal device by using the public key and private key pre-stored in the second security chip to obtain the unlocking password and door lock identification.
[0072] In one embodiment of the present invention, the terminal device scans the QR code information on the smart door lock to obtain the door lock identification; the server decrypts the data sent by the smart door lock through the public key and private key pre-stored in the second security chip to obtain the door lock information, and verifies whether the door lock identification is legal based on the door lock information. If legal, the working status of the smart door lock is queried.
[0073] In one embodiment of the present invention, the server obtains the status of the smart door lock corresponding to the door lock identifier according to a preset polling cycle. If it is learned that the smart door lock is in a communication state, the server encrypts the unlocking password by using the public key and private key pre-stored in the second security chip and sends it to the smart door lock, and feedbacks a successful response to the terminal device; if it is learned that the smart door lock is in a sleep state, a wake-up request is sent to the smart door lock, and a failure response is fed back to the terminal device; the smart door lock decrypts the received data by using the public key and private key pre-stored in the first security chip to obtain the unlocking password, so as to match the temporary password provided by the unlocking user according to the unlocking password. If the match is successful, the unlocking process is performed, and a successful unlocking response is fed back to the terminal device.
[0074] In one embodiment of the present invention, the smart door lock detects the real-time status. If it is detected that the current status meets the preset sleep condition, it switches to the sleep state and updates the status to the server. If it is detected that the current status meets the preset communication condition, it switches to the communication state, updates the status to the server, and synchronizes data with the server.
[0075] In summary, in the door lock communication method based on the security chip of the embodiment of the present invention, the smart door lock is used to access the Internet through a wireless gateway to communicate and interact with a server or a terminal device, the server is used to generate a public key and a private key through the second security chip, and encrypt or decrypt the data for communication and interaction with the first security chip and the third security chip through the public key and the private key, the smart door lock is used to generate a public key and a private key through the first security chip, and encrypt or decrypt the data for communication and interaction with the second security chip and the third security chip through the public key and the private key, and the terminal device is used to generate a public key and a private key through the third security chip, and encrypt or decrypt the data for communication and interaction with the second security chip and the first security chip through the public key and the private key. As a result, the smart door lock directly accesses the Internet through the wireless gateway to communicate and interact with the server or the terminal device, and uses the security chip to locally encrypt or decrypt the communication and interaction data, thereby ensuring the communication quality and security of the door lock.
[0076] The present invention provides a computer device, Figure 7 Schematic diagram of the structure of a computer device according to an embodiment of the present invention. Figure 7 As shown, a memory 21, a processor 22, and a computer program stored in the memory 21 and executable on the processor 22.
[0077] When the processor 22 executes the program, the door lock communication method based on the security chip provided in the above embodiment is implemented.
[0078] Furthermore, the computer device also includes:
[0079] The communication interface 23 is used for communication between the memory 21 and the processor 22 .
[0080] The memory 21 is used to store computer programs that can be run on the processor 22 .
[0081] The memory 21 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0082] The processor 22 is used to implement the door lock communication method based on the security chip described in the above embodiment when executing the program.
[0083] If the memory 21, the processor 22 and the communication interface 23 are implemented independently, the communication interface 21, the memory 21 and the processor 22 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0084] Optionally, in a specific implementation, if the memory 21, the processor 22 and the communication interface 23 are integrated on a chip, the memory 21, the processor 22 and the communication interface 23 can communicate with each other through an internal interface.
[0085] The processor 22 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0086] In order to implement the above embodiment, the present invention also proposes a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by a processor, the door lock communication method based on a security chip of the above embodiment can be executed.
[0087] In order to implement the above embodiment, the present invention further proposes a computer program product. When the instruction processor in the computer program product is executed, the door lock communication method based on the security chip of the above embodiment is executed.
[0088] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0089] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0090] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0091] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0092] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0093] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0094] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0095] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A door lock communication system based on a security chip, characterized in that: include: Smart door lock, low-power wireless network, server, terminal device; wherein, a first security chip, an NBIOT module and a BLE module are set in the smart door lock, a second security chip is set in the server, and a third security chip is set in the terminal device; The smart door lock is used to access the Internet through the low-power wireless network to communicate and interact with the server or the terminal device, and the low-power wireless network includes: an NBIOT module; The server is configured to generate a public key and a private key through the second security chip, and encrypt or decrypt data for communication and interaction with the first security chip and the third security chip through the public key and the private key; The smart door lock is used to generate a public key and a private key through the first security chip, and encrypt or decrypt data for communication and interaction with the second security chip and the third security chip through the public key and the private key; The terminal device is used to generate a public key and a private key through the third security chip, and encrypt or decrypt data for communication and interaction with the second security chip and the first security chip through the public key and the private key; The terminal device is specifically used to set the unlocking password, and is also used to scan the QR code information on the smart door lock to obtain the door lock identification, and encrypt the unlocking password and the door lock identification through the public key and private key pre-stored in the third security chip and send them to the second security chip; The server is specifically configured to decrypt the data sent by the terminal device by using the public key and the private key pre-stored in the second security chip to obtain the unlocking password and the door lock identification; The smart door lock is specifically used to decrypt the received data by using the public key and private key pre-stored in the first security chip to obtain the unlocking password, so as to match the temporary password provided by the unlocking user according to the unlocking password. If the match is successful, the unlocking process is performed, and a successful unlocking response is fed back to the terminal device; The security chip is used to receive the ciphertext transmitted from the server or terminal device, decrypt the ciphertext using the RSA method, obtain the private key, and verify the ciphertext ID and the MAC address of the ciphertext during decryption. If the ID and the MAC address are inconsistent, the security chip performs error processing. If they are consistent, the security chip obtains the encrypted random number R1 transmitted by the other party, generates the encrypted random number R2, encrypts the ciphertext with R1+R2 using the RSA method, obtains the negotiated public key, and transmits the encrypted ciphertext data to the server or terminal device through the SPI interface.
2. The system according to claim 1, characterized in that The server is also used to decrypt the data sent by the smart door lock through the public key and private key pre-stored in the second security chip to obtain door lock information, and verify whether the door lock identifier is legal based on the door lock information. If legal, query the working status of the smart door lock.
3. The system according to claim 2, characterized in that The server is also used to obtain the status of the smart door lock corresponding to the door lock identifier according to a preset polling cycle. If it is known that the smart door lock is in a communication state, the unlocking password is encrypted by the public key and private key pre-stored in the second security chip and sent to the smart door lock, and a successful response is fed back to the terminal device; if it is known that the smart door lock is in a sleep state, a wake-up request is sent to the smart door lock, and a failure response is fed back to the terminal device.
4. The system according to claim 1, characterized in that The smart door lock is also used to detect the real-time status. If it is detected that the current status meets the preset sleep condition, it switches to the sleep state and updates the status to the server. If it is detected that the current status meets the preset communication condition, it switches to the communication state, updates the status to the server, and synchronizes data with the server.
5. A door lock communication method based on a security chip, characterized in that: The method is applied to a door lock communication system based on a security chip, the system comprising: a smart door lock, a low-power wireless network, a server, and a terminal device; wherein a first security chip, an NBIOT module, and a BLE module are arranged in the smart door lock, a second security chip is arranged in the server, and a third security chip is arranged in the terminal device; The smart door lock accesses the Internet through the low-power wireless network to communicate and interact with the server or the terminal device, and the low-power wireless network includes: an NBIOT module; The server generates a public key and a private key through the second security chip, and encrypts or decrypts data for communication and interaction with the first security chip and the third security chip through the public key and the private key; The smart door lock generates a public key and a private key through the first security chip, and encrypts or decrypts data for communication and interaction with the second security chip and the third security chip through the public key and the private key; The terminal device generates a public key and a private key through the third security chip, and encrypts or decrypts data for communication and interaction with the second security chip and the first security chip through the public key and the private key; The terminal device sets an unlocking password, scans the QR code information on the smart door lock to obtain the door lock identification, and encrypts the unlocking password and the door lock identification through the public key and private key pre-stored in the third security chip and sends them to the second security chip; The server decrypts the data sent by the terminal device by using the public key and the private key pre-stored in the second security chip to obtain the unlocking password and the door lock identification; The smart door lock decrypts the received data by using the public key and private key pre-stored in the first security chip to obtain the unlocking password, so as to match the temporary password provided by the unlocking user according to the unlocking password. If the match is successful, the unlocking process is performed, and a successful unlocking response is fed back to the terminal device; The security chip receives the ciphertext sent from the server or terminal device, decrypts the ciphertext using the RSA method, obtains the private key, verifies the ciphertext ID and the MAC address of the ciphertext during decryption, if the ID and MAC address are inconsistent, the security chip performs error processing, if they are consistent, obtains the encrypted random number R1 sent by the other party, generates the encrypted random number R2, encrypts the ciphertext with R1+R2 using the RSA method, obtains the negotiated public key, and transmits the encrypted ciphertext data to the server or terminal device through the SPI interface.
6. The method according to claim 5, characterized in that Also includes: The server decrypts the data sent by the smart door lock through the public key and private key pre-stored in the second security chip to obtain the door lock information, verifies whether the door lock identifier is legal based on the door lock information, and if legal, queries the working status of the smart door lock.
7. A computer device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the door lock communication method based on the security chip as described in any one of claims 5-6 is implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the door lock communication method based on a security chip as described in any one of claims 5-6 is implemented.
