CN114461253B - Method, system and smart door lock for wirelessly upgrading firmware of front lock via rear lock - Google Patents
Method, system and smart door lock for wirelessly upgrading firmware of front lock via rear lock Download PDFInfo
- Publication number
- CN114461253B CN114461253B CN202210229804.3A CN202210229804A CN114461253B CN 114461253 B CN114461253 B CN 114461253B CN 202210229804 A CN202210229804 A CN 202210229804A CN 114461253 B CN114461253 B CN 114461253B
- Authority
- CN
- China
- Prior art keywords
- lock
- front lock
- upgrade
- rear lock
- package
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000004891 communication Methods 0.000 claims description 25
- ZNOLGFHPUIJIMJ-UHFFFAOYSA-N fenitrothion Chemical compound COP(=S)(OC)OC1=CC=C([N+]([O-])=O)C(C)=C1 ZNOLGFHPUIJIMJ-UHFFFAOYSA-N 0.000 claims description 18
- 238000012795 verification Methods 0.000 claims description 11
- 238000000060 site-specific infrared dichroism spectroscopy Methods 0.000 claims description 4
- 101100217298 Mus musculus Aspm gene Proteins 0.000 claims description 3
- 238000012856 packing Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Telephone Function (AREA)
- Stored Programmes (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The application relates to a method for wirelessly upgrading firmware by a front lock through a rear lock, which comprises the following steps that the front lock is bound with the rear lock, a WIFI module acquires an upgrade total packet from a server, the WIFI module notifies the rear lock to enter an upgrade mode, the rear lock receives the upgrade packet of the rear lock and upgrades the firmware after upgrading is completed, the WIFI module receives the upgrade returned by the rear lock and then sends the size of the upgrade packet of the front lock and the hash value of the upgrade packet of the front lock to the rear lock, the rear lock sends the upgrade notification and the received size of the upgrade packet of the front lock and the hash value of the upgrade packet of the front lock to the front lock through Bluetooth, and the rear lock is notified and sent to the WIFI module after the front lock is upgraded.
Description
Technical Field
The invention relates to the technical field of intelligent door locks, in particular to a method and a system for wirelessly upgrading firmware from a rear lock to a front lock and an intelligent door lock.
Background
With the increasing maturity of the internet of things technology and the popularization of intelligent door locks, the door locks are various in form, the intelligent door locks with front and rear lock split designs are realized, and as the front and rear lock split is free from wired connection and data transmission is realized through wireless, the firmware upgrading of the front and rear locks is also a problem.
The current solutions in the industry mainly include the following:
1. The method does not support remote upgrading and needs to reserve a burning port;
2. The front lock and the rear lock are respectively upgraded through wireless communication, such as Bluetooth, after the APP connection front lock is required to be upgraded, the connection is switched and then the rear lock is required to be upgraded, and the method is required to manually switch the connection front lock and the rear lock, is complex and inconvenient to operate.
A more convenient and reliable method for upgrading firmware by front and rear locks is needed.
Disclosure of Invention
The invention aims to solve the technical problem of providing a method, a system and an intelligent door lock for wirelessly upgrading firmware through a rear lock to a front lock aiming at the defects in the prior art.
The technical scheme adopted for solving the technical problems is as follows:
A method of constructing a wireless upgrade of firmware by a rear lock to a front lock, comprising the steps of:
binding the front lock and the rear lock, and transmitting a router SSID and a password for the WIFI distribution network to a WIFI module on the rear lock;
The WIFI module obtains an upgrade total package from the server, wherein the upgrade total package contains a total package hash verification value, the upgrade total package contains a front lock upgrade package and a rear lock upgrade package, the front lock upgrade package comprises front lock upgrade package size information and a corresponding front lock upgrade package hash value, the rear lock upgrade package comprises rear lock upgrade package size information and a corresponding rear lock upgrade package hash value;
The WIFI module analyzes the front lock upgrading packet size, the rear lock upgrading packet size, the front lock upgrading packet hash value and the rear lock upgrading packet hash value according to the packing rule;
The WIFI module notifies the rear lock of entering an upgrading mode, and notifies the rear lock of the size of the upgrade package of the rear lock and the hash value of the upgrade package of the rear lock through a serial port;
The WIFI module sends the back lock upgrade package to the back lock in multiple packages according to the maximum sub-package size returned by the back lock, and the back lock responds to one package every time when receiving one package until the sending is completed;
The WIFI module receives the upgrade returned by the back lock and then sends the front lock upgrade package size and the front lock upgrade package hash value to the back lock;
the seventh step, after the front lock receives the upgrade notice sent by the rear lock, recording the size of the upgrade package of the front lock and the hash value of the upgrade package of the front lock, and returning the maximum sub-package size received by the front lock to the rear lock once;
The WIFI module sends the firmware of the front lock to the rear lock in multiple packets according to the packet size returned by the front lock, the rear lock sends the data of the WIFI module to the front lock, and after each time the front lock receives one packet of upgrade, the rear lock responds and sends the data to the WIFI module until all the upgrade data are sent;
step nine, after the front lock receives the front lock upgrade package, calculating whether the hash value of the front lock upgrade package is consistent with the hash value of the received front lock upgrade package, if so, upgrading, after upgrading, notifying the rear lock, and sending the rear lock to the WIFI module;
and tenth, after the WIFI module receives the notification of successful upgrade of the front lock, the WIFI module informs the server of the upgrade result, and the front lock upgrade and the rear lock upgrade are completed.
The invention discloses a method for wirelessly upgrading firmware to a front lock through a rear lock, wherein in the first step, the binding of the front lock and the rear lock adopts the following steps:
the front lock and the rear lock of the intelligent door lock are respectively internally provided with a low-power consumption Bluetooth module, and an APP or an applet and the front lock and the rear lock jointly define a set of private safety communication protocol;
When the intelligent door lock leaves a factory, the front lock and the rear lock are respectively correspondingly posted with MAC bar codes;
After verifying the legitimacy of the MAC address of the rear lock, the APP or the applet scans the MAC bar code of the rear lock, establishes connection with the rear lock obtained by scanning the code through Bluetooth, communicates with the rear lock by using a default AESkey, issues a binding instruction, modifies the default AESkey into AESkey1 after binding is completed, issues AESKey2 communicated with the front lock, takes the modified AESkey1 as AESkey communicated with the APP or the applet next time, and reports the MAC address, AESkey1 and AESkey of the rear lock to the server;
The APP or the applet scans the MAC bar code of the front lock, after verifying the validity of the MAC address of the front lock, the APP or the applet uses default AESkey to communicate with the front lock, and sends the MAC address of the rear lock and communication AESkey which are bound by pairing the front lock and the front lock;
after the front lock receives a rear lock MAC address which is issued by the APP or the applet and needs to be bound and an encryption key AESkey communicated with the rear lock, the front lock initiates Bluetooth connection to the designated rear lock;
After Bluetooth connection is established, the front lock communicates with the rear lock by using AESkey, initiates a binding instruction, and sends information such as MAC (media access control) and the like of the front lock to the rear lock;
After the rear lock receives communication data initiated by the front lock, the data is decrypted by AESkey < 2 >, after the decryption is correct, the MAC address of the front lock bound with the data is recorded, and the MAC address of the rear lock is also informed to the front lock;
After the front lock receives the binding response of the rear lock, checking whether the MAC address returned by the rear lock is consistent with the MAC address issued by the APP or the applet, and if so, completing the pairing binding of the front lock and the rear lock.
The invention relates to a method for wirelessly upgrading firmware through a rear lock to a front lock, wherein the data format of a secure communication protocol is defined as follows:
The data includes a packet header, a packet identifier, a packet length, a data area, a verification bit, and a packet tail.
The invention relates to a method for wirelessly upgrading firmware by a rear lock to a front lock, wherein the data area is encrypted data, and encryption and decryption objects during communication are all the data area;
The data area is an integer multiple of 16 bytes in length and includes an effective data length, a command cluster ID, a subcommand ID, and data content.
The invention discloses a method for wirelessly upgrading firmware through a rear lock to a front lock, wherein the upgrade total package is formed by adopting the following format:
total packet header information + packet header 1 information + packet header 2 information + packet header N information + packet header 1 content + packet 2 content + packet header N content;
the total packet header information comprises content including identification, sub-packet number, total packet size, total packet hash verification value and reserved value;
the sub-package header information comprises the contents of an upgrade package type, an Nth upgrade package size, an Nth upgrade package version number and an upgrade package hash verification value.
The invention discloses a method for wirelessly upgrading firmware through a rear lock to a front lock, wherein the WIFI module obtains an upgrade total package from a server by adopting the following method:
The product provider makes an upgrade total package, uploads the upgrade total package to a server background, and sets a notice of pushing the upgrade at night;
The intelligent door lock is automatically awakened at 2-4 points at night, a server is pulled to obtain an updated task;
The WIFI module goes to a server to obtain an upgrade total package requesting upgrade, and the server sends the upgrade total package to the WIFI module.
The invention relates to a method for wirelessly upgrading firmware by a rear lock to a front lock, wherein a Hash value is calculated according to an upgrade packet, and an algorithm is an SHA1 Hash algorithm.
The system for wirelessly upgrading the firmware by the rear lock to the front lock is applied to the method for wirelessly upgrading the firmware by the rear lock to the front lock, and comprises a server and an intelligent door lock;
The intelligent door lock comprises a WIFI module, a front lock and a rear lock, wherein the rear lock is connected with the WIFI module through a serial port, and the rear lock is connected with the front lock through Bluetooth;
the server is used for providing an upgrade total package;
and when the intelligent door lock is subjected to firmware upgrading, the method steps from the first step to the tenth step are executed.
The invention relates to a system for wirelessly upgrading firmware by a rear lock to a front lock, wherein the system further comprises an APP or an applet;
the front lock and the rear lock of the intelligent door lock are respectively internally provided with a low-power consumption Bluetooth module, and an APP or an applet and the front lock and the rear lock jointly define a set of private safety communication protocol; the intelligent door lock is characterized in that a front lock and a rear lock are correspondingly posted with MAC bar codes respectively when leaving a factory, an APP or an applet scans the MAC bar codes of the front lock and verifies the validity of the MAC address of the rear lock by the aid of Bluetooth, the connection is established with the rear lock obtained by scanning the codes through the Bluetooth and the scanning, the connection is communicated with the rear lock by using a default AESkey, a binding instruction is issued, after binding is completed, the default AESkey is modified to AESkey1, AESKey2 communicated with the front lock is issued, the modified AESkey serves as AESkey communicated with the APP or the applet next time, the MAC address of the rear lock, AESkey and AESkey are reported to a server, the APP or the applet scans the MAC bar codes of the front lock, after verifying the validity of the MAC address of the front lock, the MAC address of the front lock is communicated with the front lock by using the default AESkey, the rear lock and the communication AESkey2 are transmitted, the front lock receives the MAC address of the APP or the applet which needs to be bound and the rear lock after the binding, the Bluetooth connection is initiated to be assigned after the Bluetooth connection is issued, the modified AESkey is used as a AESkey communicated with the Bluetooth connection, the MAC address of the APP or the applet is transmitted to the APP or the applet is decrypted, and the MAC address of the APP or the applet is matched with the front lock after the APP or the APP is decrypted, and the APP is matched with the MAC address after the MAC address is received, and the MAC address is decrypted, and the address is matched with the address is sent to the address after the address is decrypted.
The intelligent door lock comprises a front lock and a rear lock, and is characterized in that firmware of the front lock and the rear lock is upgraded by adopting the method for wirelessly upgrading the firmware of the front lock through the rear lock.
The method has the advantages that the front lock and the rear lock of the intelligent door lock can be automatically upgraded by applying the innovative firmware upgrading method, and the method is high in reliability, convenient and quick, does not need to reserve a burning firmware interface and does not need to be operated by a user in person.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be further described with reference to the accompanying drawings and embodiments, in which the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained by those skilled in the art without inventive effort:
FIG. 1 is a flowchart of a method for wirelessly upgrading firmware by a back lock to a front lock in accordance with a preferred embodiment of the present invention;
FIG. 2 is a flowchart of a method for wirelessly upgrading firmware to a front lock via a rear lock in accordance with a preferred embodiment of the present invention;
FIG. 3 is a diagram showing the data format of the secure communication protocol of the method for wirelessly upgrading firmware by back lock to front lock according to the preferred embodiment of the present invention;
FIG. 4 is a table showing details of the secure communication protocol data content of the method of wirelessly upgrading firmware by a rear lock to a front lock in accordance with the preferred embodiment of the present invention;
Fig. 5 is a table of header information of a method for wireless upgrading firmware by a back lock to a front lock according to a preferred embodiment of the present invention;
FIG. 6 is a table of packet header information for a method of wirelessly upgrading firmware by a back lock to a front lock in accordance with a preferred embodiment of the present invention;
Fig. 7 is a system schematic block diagram of a preferred embodiment of the present invention for wireless upgrade of firmware via a back lock to a front lock.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the following description will be made in detail with reference to the technical solutions in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by a person skilled in the art without any inventive effort, are intended to be within the scope of the present invention, based on the embodiments of the present invention.
The method, system and intelligent door lock for wirelessly upgrading firmware by back lock to front lock in the preferred embodiment of the invention, as shown in fig. 1, and referring to fig. 2-6, comprises the following steps:
S01, binding the front lock and the rear lock, and sending a router SSID and a password for the WIFI distribution network to a WIFI module on the rear lock;
The WIFI module obtains an upgrade total package from the server, wherein the upgrade total package comprises a total package hash verification value, the upgrade total package comprises a front lock upgrade package and a rear lock upgrade package, the front lock upgrade package comprises front lock upgrade package size information and a corresponding front lock upgrade package hash value, the rear lock upgrade package comprises rear lock upgrade package size information and a corresponding rear lock upgrade package hash value;
s03, according to a packing rule, the WIFI module analyzes the front lock upgrading packet size, the rear lock upgrading packet size, the front lock upgrading packet hash value and the rear lock upgrading packet hash value;
S04, the WIFI module informs the rear lock of entering an upgrading mode, and informs the rear lock of the size of the upgrade package of the rear lock and the hash value of the upgrade package of the rear lock through a serial port;
S05, the WIFI module sends the back lock upgrade package to the back lock in multiple packages according to the maximum sub-package size returned by the back lock, and the back lock responds to one package after receiving one package until the sending is completed;
S06, after the WIFI module receives the successful upgrade returned by the WIFI module, the front lock upgrade package size and the front lock upgrade package hash value are sent to the rear lock;
S07, after receiving an upgrade notification sent by the rear lock, the front lock records the size of the upgrade package of the front lock and the hash value of the upgrade package of the front lock, and returns the maximum sub-package size received by the front lock to the rear lock once;
The WIFI module sends the firmware of the front lock to the rear lock according to the packet size returned by the front lock, the rear lock sends the data of the WIFI module to the front lock, and after each time the front lock receives a packet of upgrade, the rear lock responds to the rear lock and sends the data to the WIFI module until all the upgrade data are sent;
S09, after the front lock receives the front lock upgrading packet, calculating whether the hash value of the front lock upgrading packet is consistent with the hash value of the received front lock upgrading packet, if so, upgrading, after upgrading, notifying the rear lock, and sending the rear lock to the WIFI module;
S10, after the WIFI module receives a notice of successful front lock upgrading, informing a server of an upgrading result, and finishing front and rear lock upgrading;
The inventive firmware upgrading method can realize the automatic upgrading of the front lock and the rear lock of the intelligent door lock, and has high reliability, convenience and rapidness, no need of reserving a burning firmware interface and no need of personally operating by a user.
Preferably, the first step adopts the method:
s100, a front lock and a rear lock of the intelligent door lock are respectively internally provided with a low-power consumption Bluetooth module, and an APP or an applet and the front lock and the rear lock jointly define a set of private safety communication protocol;
s101, when the intelligent door lock leaves a factory, respectively and correspondingly pasting MAC bar codes on a front lock and a rear lock;
S102, after an APP or a small program scans the MAC bar code of a post-lock, verifying the validity of the MAC address of the post-lock with a server, establishing connection with the post-lock obtained by scanning the code through Bluetooth, communicating with the post-lock by using a default AESkey, issuing a binding instruction, after binding is completed, modifying the default AESkey to be AESkey1, issuing AESKey2 communicated with a front lock, taking the modified AESkey1 as AESkey communicated with the APP or the small program next time, and reporting the MAC address, AESkey1 and AESkey of the post-lock to the server;
s103, APP or applet scans MAC bar code of front lock, after verifying validity of front lock MAC address, uses default AESkey to communicate with front lock, sends back lock MAC address and communication AESkey of front lock and its pairing binding;
S104, after the front lock receives a rear lock MAC address which is issued by the APP or the applet and needs to be bound and an encryption key AESkey communicated with the rear lock, the front lock initiates Bluetooth connection to the designated rear lock;
S105, after Bluetooth connection is established, the front lock communicates with the rear lock by using AESkey, a binding instruction is initiated, and information such as MAC (media access control) and the like of the front lock is sent to the rear lock;
s106, after the rear lock receives communication data initiated by the front lock, the data is decrypted by using AESkey, after the decryption is correct, the MAC address of the front lock bound with the data is recorded, and the MAC address of the rear lock is also informed to the front lock;
S107, after the front lock receives the binding response of the rear lock, checking whether the MAC address returned by the rear lock is consistent with the MAC address issued by the APP or the applet, and if so, completing the pairing binding of the front lock and the rear lock;
s108, the APP or the applet sends the router SSID and the password for the WIFI distribution network to the WIFI module on the rear lock;
Compared with the existing binding mode of the front lock and the rear lock, the binding mode of the application has higher safety performance, definite binding direction and no error binding condition.
The invention relates to a method for wirelessly upgrading firmware through a rear lock to a front lock, wherein the data format of a secure communication protocol is defined as follows:
The data comprises a packet head, a packet identifier, a packet length, a data area, a verification bit and a packet tail;
The data area is encrypted data, and the encryption and decryption objects are all data areas during communication;
the length of the data area is an integer multiple of 16 bytes, and the data area comprises the effective data length, the command cluster ID, the subcommand ID and the data content, and has better safety performance.
The upgrade total package is formed by the format:
total packet header information + packet header 1 information + packet header 2 information + packet header N information + packet header 1 content + packet 2 content + packet header N content;
the total packet header information comprises content including identification, sub-packet number, total packet size, total packet hash verification value and reserved value;
the sub-package header information comprises the contents of an upgrade package type, an Nth upgrade package size, an Nth upgrade package version number and an upgrade package hash verification value.
A preferred WIFI module obtains an upgrade total package from a server in the following way:
The product provider makes an upgrade total package, uploads the upgrade total package to a server background, and sets a notice of pushing the upgrade at night;
The intelligent door lock is automatically awakened at 2-4 points at night, a server is pulled to obtain an updated task;
The WIFI module goes to a server to obtain an upgrade total package requesting upgrade, and the server sends the upgrade total package to the WIFI module;
the time node used by the door lock is avoided, and the automatic upgrading reliability is good.
Preferably, the Hash value calculated according to the upgrade package adopts an algorithm which is an SHA1 Hash algorithm, and of course, it can be understood that the Hash value can be replaced by other existing Hash algorithm forms.
A system for wirelessly upgrading firmware by back lock to front lock is applied to the method for wirelessly upgrading firmware by back lock to front lock, as shown in fig. 7, and comprises a server 1 and an intelligent door lock 2;
The intelligent door lock 2 comprises a WIFI module 20, a front lock 21 and a rear lock 22, wherein the rear lock 22 is connected with the WIFI module 20 through a serial port, and the rear lock 22 is connected with the front lock 21 through Bluetooth;
a server 1 for providing an upgrade total package;
when the intelligent door lock 2 is subjected to firmware upgrading, the method steps from the first step to the tenth step are executed;
The inventive firmware upgrading method can realize the automatic upgrading of the front lock and the rear lock of the intelligent door lock, and has high reliability, convenience and rapidness, no need of reserving a burning firmware interface and no need of personally operating by a user.
The system also includes APP or applet 3;
The front lock and the rear lock of the intelligent door lock 2 are respectively internally provided with a low-power consumption Bluetooth module, and an APP or an applet and the front lock and the rear lock jointly define a set of private safety communication protocol; when the intelligent door lock leaves a factory, the front lock and the rear lock are respectively correspondingly posted with MAC bar codes; after verifying the legitimacy of the MAC address of the rear lock, the APP or the applet scans the MAC bar code of the rear lock, establishes connection with the rear lock obtained by scanning the code through Bluetooth, communicates with the rear lock by using a default AESkey, issues a binding instruction, modifies the default AESkey into AESkey1 after binding is completed, issues AESKey2 communicated with the front lock, takes the modified AESkey1 as AESkey communicated with the APP or the applet next time, and reports the MAC address, AESkey1 and AESkey2 of the rear lock to the server; the APP or the applet scans the MAC bar code of the front lock, after verifying the validity of the MAC address of the front lock, uses the default AESkey to communicate with the front lock, sends the back lock MAC address and communication AESkey2 which are bound with the front lock in a pairing way, and after the front lock receives the back lock MAC address which is required to be bound and is issued by the APP or the applet and the encryption key AESkey2 communicated with the back lock, initiates Bluetooth connection to the appointed back lock, after establishing Bluetooth connection, the front lock uses AESkey2 to communicate with the back lock, initiates a binding instruction and sends information such as the MAC of the front lock to the back lock, after the back lock receives communication data initiated by the front lock, uses AESkey to decrypt the data, records the front lock MAC address bound with the back lock after decryption is correct, and also informs the front lock of the MAC address of the back lock;
Compared with the existing binding mode of the front lock and the rear lock, the binding mode of the application has higher safety performance, definite binding direction and no error binding condition.
The intelligent door lock comprises a front lock and a rear lock, and is characterized in that firmware of the front lock and the rear lock is upgraded by adopting the method for wirelessly upgrading the firmware of the front lock through the rear lock.
It will be understood that modifications and variations will be apparent to those skilled in the art from the foregoing description, and it is intended that all such modifications and variations be included within the scope of the following claims.
Claims (10)
1. A method for wirelessly upgrading firmware by a rear lock to a front lock, comprising the steps of:
binding the front lock and the rear lock, and transmitting a router SSID and a password for the WIFI distribution network to a WIFI module on the rear lock;
The WIFI module obtains an upgrade total package from the server, wherein the upgrade total package contains a total package hash verification value, the upgrade total package contains a front lock upgrade package and a rear lock upgrade package, the front lock upgrade package comprises front lock upgrade package size information and a corresponding front lock upgrade package hash value, the rear lock upgrade package comprises rear lock upgrade package size information and a corresponding rear lock upgrade package hash value;
The WIFI module analyzes the front lock upgrading packet size, the rear lock upgrading packet size, the front lock upgrading packet hash value and the rear lock upgrading packet hash value according to the packing rule;
The WIFI module notifies the rear lock to enter an upgrading mode, and notifies the rear lock of the size of the upgrade package of the rear lock and the hash value of the upgrade package of the rear lock through a serial port;
The WIFI module sends the back lock upgrade package to the back lock in multiple packages according to the maximum sub-package size returned by the back lock, and the back lock responds to one package every time when receiving one package until the sending is completed;
The WIFI module receives the upgrade returned by the back lock and then sends the front lock upgrade package size and the front lock upgrade package hash value to the back lock;
the seventh step, after the front lock receives the upgrade notice sent by the rear lock, recording the size of the upgrade package of the front lock and the hash value of the upgrade package of the front lock, and returning the maximum sub-package size received by the front lock to the rear lock once;
The WIFI module sends the firmware of the front lock to the rear lock in multiple packets according to the packet size returned by the front lock, the rear lock sends the data of the WIFI module to the front lock, and after each time the front lock receives one packet of upgrade, the rear lock responds and sends the data to the WIFI module until all the upgrade data are sent;
step nine, after the front lock receives the front lock upgrade package, calculating whether the hash value of the front lock upgrade package is consistent with the hash value of the received front lock upgrade package, if so, upgrading, after upgrading, notifying the rear lock, and sending the rear lock to the WIFI module;
and tenth, after the WIFI module receives the notification of successful upgrade of the front lock, the WIFI module informs the server of the upgrade result, and the front lock upgrade and the rear lock upgrade are completed.
2. The method for wireless upgrading firmware to a front lock via a rear lock according to claim 1, wherein in the first step, the binding between the front lock and the rear lock is performed by:
the front lock and the rear lock of the intelligent door lock are respectively internally provided with a low-power consumption Bluetooth module, and an APP or an applet and the front lock and the rear lock jointly define a set of private safety communication protocol;
When the intelligent door lock leaves a factory, the front lock and the rear lock are respectively correspondingly posted with MAC bar codes;
After verifying the legitimacy of the MAC address of the rear lock, the APP or the applet scans the MAC bar code of the rear lock, establishes connection with the rear lock obtained by scanning the code through Bluetooth, communicates with the rear lock by using a default AESkey, issues a binding instruction, modifies the default AESkey into AESkey1 after binding is completed, issues AESKey2 communicated with the front lock, takes the modified AESkey1 as AESkey communicated with the APP or the applet next time, and reports the MAC address, AESkey1 and AESkey of the rear lock to the server;
The APP or the applet scans the MAC bar code of the front lock, after verifying the validity of the MAC address of the front lock, the APP or the applet uses default AESkey to communicate with the front lock, and sends the MAC address of the rear lock and communication AESkey which are bound by pairing the front lock and the front lock;
after the front lock receives a rear lock MAC address which is issued by the APP or the applet and needs to be bound and an encryption key AESkey communicated with the rear lock, the front lock initiates Bluetooth connection to the designated rear lock;
After Bluetooth connection is established, the front lock communicates with the rear lock by using AESkey, initiates a binding instruction, and sends information such as MAC (media access control) and the like of the front lock to the rear lock;
After the rear lock receives communication data initiated by the front lock, the data is decrypted by AESkey < 2 >, after the decryption is correct, the MAC address of the front lock bound with the data is recorded, and the MAC address of the rear lock is also informed to the front lock;
After the front lock receives the binding response of the rear lock, checking whether the MAC address returned by the rear lock is consistent with the MAC address issued by the APP or the applet, and if so, completing the pairing binding of the front lock and the rear lock.
3. The method for wireless upgrading of firmware by back lock to front lock of claim 2, wherein the data format of the secure communication protocol is defined as follows:
The data includes a packet header, a packet identifier, a packet length, a data area, a verification bit, and a packet tail.
4. The method for wirelessly upgrading firmware by a back lock to a front lock according to claim 3, wherein the data area is encrypted data, and the encrypted and decrypted objects are all the data area during communication;
The data area is an integer multiple of 16 bytes in length and includes an effective data length, a command cluster ID, a subcommand ID, and data content.
5. The method for wirelessly upgrading firmware by back lock to front lock according to any one of claims 1-4, wherein the upgrade package composition is in the format of:
total packet header information + packet header 1 information + packet header 2 information + packet header N information + packet header 1 content + packet 2 content + packet header N content;
the total packet header information comprises content including identification, sub-packet number, total packet size, total packet hash verification value and reserved value;
The sub-package header information includes contents of an upgrade package type, an nth upgrade package size, an nth upgrade package version number, and an upgrade package hash check value.
6. The method for wirelessly upgrading firmware by back lock to front lock according to claim 5, wherein the WIFI module obtains an upgrade package from a server by:
The product provider makes an upgrade total package, uploads the upgrade total package to a server background, and sets a notice of pushing the upgrade at night;
The intelligent door lock is automatically awakened at 2-4 points at night, a server is pulled to obtain an updated task;
The WIFI module goes to a server to obtain an upgrade total package requesting upgrade, and the server sends the upgrade total package to the WIFI module.
7. The method for wireless upgrading of firmware by back lock to front lock according to any one of claims 1-4, wherein the algorithm used to calculate the Hash value from the upgrade package is SHA1 Hash algorithm.
8. The system for wirelessly upgrading the firmware by the rear lock to the front lock is characterized by comprising a server and an intelligent door lock;
The intelligent door lock comprises a WIFI module, a front lock and a rear lock, wherein the rear lock is connected with the WIFI module through a serial port, and the rear lock is connected with the front lock through Bluetooth;
the server is used for providing an upgrade total package;
When the intelligent door lock is used for firmware upgrading, the method for wirelessly upgrading the firmware through the rear lock to the front lock according to any one of claims 1-7 is executed.
9. The system for wirelessly upgrading firmware by back lock to front lock of claim 8, wherein the system further comprises an APP or applet;
The front lock and the rear lock of the intelligent door lock are respectively internally provided with a low-power consumption Bluetooth module, and an APP or an applet and the front lock and the rear lock jointly define a set of private safety communication protocol; the intelligent door lock is characterized in that a front lock and a rear lock are correspondingly posted with MAC bar codes respectively when leaving a factory, an APP or an applet scans the MAC bar codes of the front lock and verifies the validity of the MAC address of the rear lock by the aid of Bluetooth, the connection is established with the rear lock obtained by scanning the codes through the Bluetooth and the scanning, the connection is communicated with the rear lock by using a default AESkey, a binding instruction is issued, after binding is completed, the default AESkey is modified to AESkey1, AESKey2 communicated with the front lock is issued, the modified AESkey serves as AESkey communicated with the APP or the applet next time, the MAC address of the rear lock, AESkey and AESkey are reported to a server, the APP or the applet scans the MAC bar codes of the front lock, after verifying the validity of the MAC address of the front lock, the MAC address of the front lock is communicated with the front lock by using the default AESkey, the rear lock and the communication AESkey2 are transmitted, the front lock receives the MAC address of the APP or the applet which needs to be bound and the rear lock after the binding, the Bluetooth connection is initiated to be assigned after the Bluetooth connection is issued, the modified AESkey is used as a AESkey communicated with the Bluetooth connection, the MAC address of the APP or the applet is transmitted to the APP or the applet is decrypted, and the MAC address of the APP or the applet is matched with the front lock after the APP or the APP is decrypted, and the APP is matched with the MAC address after the MAC address is received, and the MAC address is decrypted, and the address is matched with the address is sent to the address after the address is decrypted.
10. An intelligent door lock comprising a front lock and a rear lock, wherein firmware upgrades of the front lock and the rear lock employ the method of wirelessly upgrading firmware of the front lock by the rear lock as claimed in any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210229804.3A CN114461253B (en) | 2022-03-10 | 2022-03-10 | Method, system and smart door lock for wirelessly upgrading firmware of front lock via rear lock |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210229804.3A CN114461253B (en) | 2022-03-10 | 2022-03-10 | Method, system and smart door lock for wirelessly upgrading firmware of front lock via rear lock |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114461253A CN114461253A (en) | 2022-05-10 |
CN114461253B true CN114461253B (en) | 2025-02-11 |
Family
ID=81417826
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210229804.3A Active CN114461253B (en) | 2022-03-10 | 2022-03-10 | Method, system and smart door lock for wirelessly upgrading firmware of front lock via rear lock |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114461253B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114756266B (en) * | 2022-05-12 | 2024-07-23 | 深圳指芯物联技术有限公司 | Method and system for supporting online and offline upgrading of integral firmware of face cat eye lock |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107832064A (en) * | 2017-10-13 | 2018-03-23 | 东峡大通(北京)管理咨询有限公司 | Smart lock and its firmware upgrade method, device, system and upgrading part |
CN107888577A (en) * | 2017-10-31 | 2018-04-06 | 美的智慧家居科技有限公司 | Upgrade method, door lock, server, system and the storage medium of door lock firmware |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108605034B (en) * | 2015-10-14 | 2021-02-12 | 总锁有限责任公司 | Wireless firmware update |
CN108259174A (en) * | 2018-04-23 | 2018-07-06 | 唯得智慧(湖北)科技有限公司 | The update method of safety door unblocking key based on narrowband Internet of Things |
CN112365636B (en) * | 2020-10-30 | 2022-05-03 | 深圳坚朗海贝斯智能科技有限公司 | Smart lock management system based on mobile smart terminal and its working method |
-
2022
- 2022-03-10 CN CN202210229804.3A patent/CN114461253B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107832064A (en) * | 2017-10-13 | 2018-03-23 | 东峡大通(北京)管理咨询有限公司 | Smart lock and its firmware upgrade method, device, system and upgrading part |
CN107888577A (en) * | 2017-10-31 | 2018-04-06 | 美的智慧家居科技有限公司 | Upgrade method, door lock, server, system and the storage medium of door lock firmware |
Also Published As
Publication number | Publication date |
---|---|
CN114461253A (en) | 2022-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11388005B2 (en) | Connected gateway server system for real-time vehicle control service | |
US7391748B2 (en) | Configuration of enterprise gateways | |
EP3314977B1 (en) | Systems, methods, and apparatus to configure embedded devices | |
US8413138B2 (en) | System and method to securely load a management client from a stub client to facilitate remote device management | |
CN101252434B (en) | Apparatus and method for implementing mobile telephone access identification in wireless local area network | |
JP5189066B2 (en) | User authentication method, authentication system, terminal device and authentication device in terminal device | |
CN113678484B (en) | Method for providing subscription configuration file, user identity module and subscription server | |
CN101288063B (en) | Wireless device discovery and configuration | |
US20050226423A1 (en) | Method for distributes the encrypted key in wireless lan | |
CN101267307B (en) | Method for realizing remote management of mobile phone digital certificate using OTA system | |
US8396138B2 (en) | System and method for controlling wireless network access information in using removable external modem | |
US20040131188A1 (en) | Method of generating key data for successful communication during a network link | |
CN102695194B (en) | Element management system and method and system for self-configuration of eNodeBs | |
CN101657036B (en) | Method for updating correspondence between terminal identifier and user identifier, device and system thereof | |
EP3920466B1 (en) | Device configuration method, system, and apparatus | |
CN101616414A (en) | Method, system and server for terminal authentication | |
CN114461253B (en) | Method, system and smart door lock for wirelessly upgrading firmware of front lock via rear lock | |
CN101247295A (en) | A method and device for obtaining access controller information in a wireless local area network | |
CN113923241A (en) | Method and device for Internet of things device distribution network, router, and Internet of things device | |
JP6392709B2 (en) | Setting information generating apparatus, method, setting terminal and method | |
CN103442328A (en) | Method and system for controlling quality of service of terminal of Internet of Things | |
CN114390521A (en) | Key updating method, device, equipment and storage medium | |
CN101473599A (en) | System and method for controlling bandwidth at a wireless endpoint | |
US20230403557A1 (en) | Bluetooth Low Energy for Network Troubleshooting | |
JP3851781B2 (en) | Wireless communication apparatus, wireless communication system, and connection authentication method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |