Over-the-air firmware upgrading method, device, equipment, system, medium and computer program product
By obtaining and storing firmware keys in smart home devices and using these keys to decrypt encrypted firmware, the problem of smart home devices being unable to perform Matter protocol OTA upgrades is solved, thus enabling secure and legal firmware upgrades.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-03-10
AI Technical Summary
Existing smart home devices lack OTA functionality based on the Matter protocol, making secure firmware upgrades impossible via wireless communication links, resulting in incomplete product connectivity.
The target firmware is obtained through the first wireless communication link and the function of the second wireless communication link is added. The firmware key is obtained and stored in the device. The encrypted firmware is decrypted using the key, thereby realizing a legitimate and secure over-the-air firmware upgrade.
It enables secure OTA upgrades for existing smart home devices via a second wireless communication link, improving the product chain and ensuring the security and legality of the upgrades.
Smart Images

Figure CN121645264A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of home appliance technology, and particularly relates to an over-the-air firmware upgrade method, device, equipment, system, medium and computer program product. Background Technology
[0002] The Matter protocol is an open standard smart home protocol that provides unified device discovery, security, data models, and communication protocols, enabling seamless connection and collaboration between devices from different brands. Smart home devices configured with the Matter protocol can interconnect with other smart home devices via the Matter link. Because Matter technology is a relatively new communication protocol, its functionality was not fully developed in its early stages. This resulted in existing smart home devices lacking OTA (Over-the-Air) technology capabilities (i.e., the ability to perform over-the-air firmware upgrades). Over-the-air firmware upgrades utilize OTA technology to update the device's firmware. For smart home devices, the lack of OTA functionality signifies an incomplete product pipeline, and enabling secure over-the-air firmware upgrades for existing smart home devices via the Matter link is a pressing technical challenge that needs to be addressed. Summary of the Invention
[0003] The present invention provides an over-the-air firmware upgrade method, apparatus, device, system, medium, and computer program product, which at least solves the technical problem that existing smart home devices have imperfect product links and cannot be securely upgraded over the air via a second wireless communication link.
[0004] In a first aspect of the invention, an over-the-air firmware upgrade method for a smart home device is provided, applied to a target home device, the target home device being configured with a first wireless communication link and a second wireless communication link supporting interconnection between the target home device and other devices, the method comprising: acquiring a first target firmware through the first wireless communication link, and adding a function for over-the-air firmware upgrade using the second wireless communication link to the target home device based on the first target firmware; acquiring a firmware key from a key management system; and storing the firmware key in the target home device, wherein the firmware key is used to decrypt the acquired encrypted firmware when the target home device performs an over-the-air firmware upgrade via the second wireless communication link.
[0005] In conjunction with the first aspect, in some embodiments, obtaining the firmware key from the key management system includes: performing two-way authentication with the access layer server; initiating a key distribution request to the access layer server, triggering the access layer server to retrieve the firmware key generated by the key management system from the key management system through a security service; and receiving the firmware key distributed by the access layer server.
[0006] In conjunction with the first aspect, in some embodiments, storing the firmware key in the target home device includes: encrypting the firmware key to obtain encrypted ciphertext of the firmware key; and storing the encrypted ciphertext in the non-volatile memory of the target home device.
[0007] In conjunction with the first aspect, in some embodiments, after storing the firmware key in the target home device, the method further includes: obtaining encrypted firmware through the second wireless communication link; decrypting the encrypted firmware based on the firmware key to obtain a second target firmware; and verifying the legitimacy of the second target firmware.
[0008] In conjunction with the first aspect, in some embodiments, before decrypting the encrypted firmware based on the firmware key, the method further includes: reading encrypted ciphertext of the firmware key from the non-volatile memory of the target home device; and decrypting the encrypted ciphertext to obtain the firmware key.
[0009] In conjunction with the first aspect, in some embodiments, verifying the legitimacy of the second target firmware includes: obtaining a public key certificate from the second target firmware; decrypting the public key of the public-private key pair from the public key certificate; and verifying the signature information of the second target firmware based on the public key, wherein the signature information is obtained by signing the firmware hash value of the second target firmware using the private key of the public-private key pair.
[0010] In conjunction with the first aspect, in some embodiments: before obtaining the encrypted firmware through the second wireless communication link, the method further includes: switching from the first partition to the second partition; after verifying the legality of the second target firmware, the method further includes: switching back from the second partition to the first partition.
[0011] In a second aspect of the invention, an over-the-air firmware upgrade method for a smart home device is also provided, applied to a first developer platform. The method includes: sending a first target firmware to a target home device via a first wireless communication link, so that the target home device can add the function of over-the-air firmware upgrade using a second wireless communication link according to the first target firmware.
[0012] In a third aspect of the present invention, an over-the-air firmware upgrade method for a smart home device is provided, applied to a second developer platform. The method includes: packaging an original firmware file according to the public key of a public-private key pair to obtain packaged firmware; obtaining signature information of the packaged firmware and concatenating the signature information to the packaged firmware to obtain a second target firmware; and encrypting the second target firmware according to the obtained firmware key to obtain encrypted firmware.
[0013] In conjunction with the third aspect, in some embodiments, obtaining the signature information of the packaged firmware includes: calculating the firmware hash value of the packaged firmware; sending the firmware hash value to a security service so that the security service can generate the signature information of the packaged firmware using the private key of the public-private key pair and the firmware hash value; and receiving the signature information returned by the security service.
[0014] In conjunction with the third aspect, in some embodiments, before packaging the original firmware file according to the public key of the public-private key pair, the method further includes: initiating a public key invocation request to a security service, triggering the security service to retrieve the public key from the key management system; and receiving the public key returned by the security service.
[0015] In conjunction with the third aspect, in some embodiments, the step of packaging the original firmware file according to the public key of the public-private key pair to obtain the packaged firmware includes: obtaining a signed public key certificate according to the public key; and packaging the public key certificate with the original firmware file to obtain the packaged firmware.
[0016] In conjunction with the third aspect, in some embodiments, before encrypting the second target firmware according to the obtained firmware key, the method further includes: initiating a key invocation request to a security service, triggering the security service to retrieve the firmware key from the key management system; and receiving the firmware key returned by the security service.
[0017] In a fourth aspect, the present invention also provides a smart home system, including a first developer platform, a second developer platform, and a target home device, wherein: the first developer platform is configured to send a first target firmware to the target home device via a first wireless communication link; the target home device is configured to obtain the first target firmware from the first developer platform via the first wireless communication link, add an over-the-air firmware upgrade function using a second wireless communication link to the target home device based on the first target firmware, obtain a firmware key from a key management system, and store the firmware key in the target home device; the second developer platform is configured to perform an over-the-air firmware upgrade on the target home device via the second wireless communication link; the target home device is further configured to decrypt the encrypted firmware obtained from the second developer platform when the target home device performs an over-the-air firmware upgrade via the second wireless communication link.
[0018] In a fifth aspect of the invention, an over-the-air firmware upgrade device for a smart home device is also provided, applied to a target home device. The target home device is configured with a first wireless communication link and a second wireless communication link supporting interconnection between the target home device and other devices. The over-the-air firmware upgrade device includes: a first upgrade unit, configured to acquire a first target firmware through the first wireless communication link and add the function of over-the-air firmware upgrade using the second wireless communication link to the target home device based on the first target firmware; a key acquisition unit, configured to acquire a firmware key from a key management system; and a key storage unit, configured to store the firmware key in the target home device, wherein the firmware key is used to decrypt the acquired encrypted firmware when the target home device performs an over-the-air firmware upgrade through the second wireless communication link.
[0019] In a sixth aspect of the invention, an over-the-air firmware upgrade device for a smart home device is also provided for a first developer platform. The over-the-air firmware upgrade device includes: a distribution unit, configured to distribute a first target firmware to a target home device via a first wireless communication link, so that the target home device can add the function of over-the-air firmware upgrade using a second wireless communication link according to the first target firmware.
[0020] In a seventh aspect of the invention, an over-the-air firmware upgrade device for a smart home device is also provided, applied to a second developer platform. The over-the-air firmware upgrade device includes: a packaging unit for packaging an original firmware file according to the public key of a public-private key pair to obtain packaged firmware; an information acquisition unit for acquiring signature information of the packaged firmware and concatenating the signature information to the packaged firmware to obtain a second target firmware; and a firmware encryption unit for encrypting the second target firmware according to the acquired firmware key to obtain encrypted firmware.
[0021] In an eighth aspect of the invention, a smart home device is also provided, comprising: a processor; and a memory for storing processor-executable instructions, wherein the processor is configured to execute the instructions to implement the over-the-air firmware upgrade method for the smart home device as described in any embodiment of the first aspect.
[0022] In a ninth aspect of the invention, a computer-readable storage medium is also provided, having a computer program stored thereon that, when executed by a processor, implements the over-the-air firmware upgrade method for a smart home device as described in any embodiment of the first aspect.
[0023] In a tenth aspect of the invention, a computer program product is also provided, comprising computer instructions that, when executed by a processor, implement the over-the-air firmware upgrade method for a smart home device as described in any embodiment of the first aspect.
[0024] According to one or more technical solutions provided in the embodiments of the present invention, at least the following technical effects or advantages are achieved:
[0025] The system acquires a first target firmware via a first wireless communication link and adds the function of over-the-air firmware upgrade via a second wireless communication link to the target home device based on the first target firmware. It also acquires a firmware key from a key management system and stores it in the target home device. This allows the target home device to decrypt the acquired encrypted firmware using the firmware key stored in the target home device when performing an over-the-air firmware upgrade via the second wireless communication link. This enables OTA (Over-The-Air) updates for existing smart home devices using the first wireless communication link, adds the function of OTA updates via the second wireless communication link to existing smart home devices, and issues relevant keys. This allows the target home device to subsequently perform over-the-air firmware upgrades via the second wireless communication link, improving the product chain and ensuring the security and legality of over-the-air firmware upgrades via the second wireless communication link. This upgrades existing smart home devices to support secure OTA updates via the second wireless communication link. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 A system architecture diagram of a smart home system provided according to some embodiments of the present invention is shown;
[0028] Figure 2 A flowchart is shown below illustrating an over-the-air firmware upgrade method for a smart home device applied to a target home device, according to some embodiments of the present invention.
[0029] Figures 3 to 5 The flowchart illustrates the interaction process of each stage of over-the-air firmware upgrade for smart home devices.
[0030] Figure 6 A flowchart is shown of an over-the-air firmware upgrade method for a smart home device applied to a first developer platform, according to some embodiments of the present invention;
[0031] Figure 7 A flowchart is shown of an over-the-air firmware upgrade method for smart home devices applied to a second developer platform, according to some embodiments of the present invention;
[0032] Figure 8 This diagram illustrates a functional block diagram of an over-the-air firmware upgrade device for a target home device, provided according to some embodiments of the present invention.
[0033] Figure 9 A functional block diagram of an over-the-air firmware upgrade device for a smart home device applied to a first developer platform, according to some embodiments of the present invention, is shown.
[0034] Figure 10 A functional block diagram of an over-the-air firmware upgrade device for a smart home device applied to a second developer platform, according to some embodiments of the present invention, is shown.
[0035] Figure 11 The diagram shows a structural schematic of a smart home device provided in some embodiments of the present invention. Detailed Implementation
[0036] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0037] Furthermore, in this invention, descriptions involving "first," "second," etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed by this invention.
[0038] This invention provides a smart home system, such as... Figure 1 As shown, the smart home system includes a first developer platform 100, a second developer platform 200, an access layer server 300, and a target home device 400. The target home device 400 is configured with a first wireless communication link and a second wireless communication link to support interconnection between the target home device 400 and other devices. The first wireless communication link is used for communication between the target home device 400 and other smart home devices, the access layer server 300, and the first developer platform 100. The second wireless communication link is used for communication between the target home device 400 and other smart home devices and the second developer platform 200.
[0039] The first developer platform 100 is used to: send the first target firmware to the target home device 400 via the first wireless communication link.
[0040] The target home device 400 is used to: obtain a first target firmware from a first developer platform 100 via a first wireless communication link; add an over-the-air firmware upgrade function to the target home device 400 using a second wireless communication link based on the first target firmware; and obtain a firmware key from a key management system (KMS) 500 and store the firmware key in the target home device 400.
[0041] The second developer platform 200 is used to perform over-the-air firmware upgrades on the target home device 400 via a second wireless communication link.
[0042] The target home device 400 is also used to: decrypt encrypted firmware obtained from the second developer platform 200 when the target home device 400 performs an over-the-air firmware upgrade via the second wireless communication link.
[0043] Access layer server 300 is the backend server corresponding to target home device 400. Access layer server 300 communicates with key management system 500 through security service 600. Second developer platform 200 communicates with key management system 500 through security service 600.
[0044] It is understandable that the first wireless communication link is established based on a wireless communication protocol suitable for smart home devices, and the second wireless communication link is established based on another wireless communication protocol suitable for smart home devices.
[0045] In some embodiments, the first wireless communication link can be a communication link for wireless communication based on the Msmart protocol, and the second wireless communication link can be a communication link for wireless communication based on the matter protocol. That is, the target home device 400 is a smart home device that supports both the Msmart protocol and the matter protocol.
[0046] It is understandable that the target home device 400 is one of the following types: smart speaker, smart lighting, smart door lock, smart curtain, smart monitoring, smart air conditioner, smart switch, etc.
[0047] This invention provides an over-the-air firmware upgrade method for smart home devices, which can be applied to... Figure 1 And the target home devices 400 in the aforementioned smart home system. For example... Figure 2 As shown, the over-the-air firmware upgrade method for this smart home device includes the following steps S201 to S203.
[0048] In step S201: the first target firmware is obtained through the first wireless communication link, and the target home device is given the function of over-the-air firmware upgrade using the second wireless communication link according to the first target firmware.
[0049] Understandably, prior to step S201, the target home device is in a state where it supports over-the-air firmware upgrades via the second wireless communication link, but also does not support over-the-air firmware upgrades via the second wireless communication link. The target home device can obtain the first target firmware from the first developer platform or the target home device's manufacturer server via the first wireless communication link.
[0050] Understandably, the first target firmware is pre-compiled by the developer and uploaded to the first developer platform or manufacturer's server. This first target firmware enables smart home devices to perform over-the-air firmware upgrades based on the Matter protocol. After obtaining the first target firmware through the first wireless communication link, the target home device uses it to perform an over-the-air firmware upgrade, thereby enabling the target home device to perform over-the-air firmware upgrades using the second wireless communication link.
[0051] In step S202: Obtain the firmware key from the key management system.
[0052] In some embodiments, the target home device obtains the firmware key from the key management system via a key transmission medium.
[0053] In some embodiments, the key transmission medium includes an access layer server and a security service. The target home device obtains the firmware key from the key management system through the key transmission medium, including: the target home device initiating a key issuance request to the access layer server, triggering the access layer server to retrieve the firmware key generated by the key management system from the key management system through the security service; and the target home device receiving the firmware key issued by the access layer server.
[0054] Understandably, in response to a key distribution request initiated by the target home appliance, the access layer server sends a key access request to the security service. The security service, in turn, retrieves the firmware key from the key management system. The security service then returns the firmware key retrieved from the key management system to the access layer server via a secure, encrypted channel after calling the SDK (Software Development Kit) interface. The access layer server then distributes the firmware key returned by the security service to the target home appliance via the SST protocol. Thus, the target home appliance obtains the firmware key through both the access layer server and the security service.
[0055] In some embodiments, the firmware key may be a 256-bit key randomly generated by the key management system.
[0056] In some embodiments, the key access request sent by the access layer server to the security service carries a UUID (Universally Unique Identifier) as the request ID of the key access request.
[0057] In some embodiments, after the security service returns the firmware key to the access layer server, the firmware key cached in the security service is cleared, and after the access layer server distributes the firmware key to the target home device via the SST protocol, the firmware key cached in the access layer server is cleared.
[0058] To enhance communication security, in some embodiments, the target home device performs two-way authentication with the access layer server before sending a key distribution request to the access layer server. The target home device can use the SST (Secure Sockets Layer Protocol) to perform two-way authentication with the access layer server.
[0059] Step S203: Store a firmware key in the target home device, wherein the firmware key stored in the target home device is used to decrypt the acquired encrypted firmware when the target home device performs an over-the-air firmware upgrade via the second wireless communication link.
[0060] In some embodiments, when storing the firmware key in the target home device, it is stored in the non-volatile memory of the target home device, for example, the firmware key is stored in a reserved sector of flash memory. This enables the firmware key to be permanently stored in the target home device, so that the firmware key stored in the non-volatile memory of the target home device can be used to decrypt the acquired encrypted firmware each time an over-the-air firmware upgrade is performed via the second wireless communication link.
[0061] Through the above steps S201 to S203, the existing smart home devices are upgraded over the air via the first wireless communication link, enabling them to perform over the air via the second wireless communication link. At the same time, the key information required for subsequent over the air via the second wireless communication link is also issued to decrypt the encrypted firmware obtained during subsequent over the air via the second wireless communication link, thus upgrading the existing smart home devices to support secure over the air via the second wireless communication link.
[0062] To enhance the security of storing firmware keys in the target home device, the firmware key issued by the access layer server is encrypted before storage. In some embodiments, the step of storing the firmware key in the target home device includes: the target home device encrypting the firmware key issued by the access layer server to obtain encrypted ciphertext of the firmware key; and the target home device storing the encrypted ciphertext in the non-volatile memory of the target home device.
[0063] In some embodiments, when the target home device encrypts the firmware key issued by the access layer server, it can do so by calling a key burned into the eFuse (one-time programmable memory) module of the target home device's network module. It is understood that the key burned into the eFuse module is called the eFuse key, also known as the data key, and is 128 bits long. It is an AES (Advanced Encryption Standard) key burned into the eFuse module.
[0064] In some embodiments, after storing the firmware key in the target home device, the process may further include: the target home device performing an over-the-air firmware upgrade via a second wireless communication link.
[0065] In some embodiments, each time the target home device performs an over-the-air firmware upgrade via the second wireless communication link, the process includes: the target home device obtaining encrypted firmware via the second wireless communication link; the target home device decrypting the obtained encrypted firmware based on a firmware key to obtain a second target firmware; and the target home device verifying the legitimacy of the second target firmware.
[0066] In some embodiments, the encrypted firmware may be obtained by the target home device from a second developer platform via a second wireless communication link. The encrypted firmware is generated by the second developer platform based on the original firmware file uploaded by the developer. The generation of encrypted firmware by the second developer platform based on the original firmware file uploaded by the developer includes: the second developer platform packaging the original firmware file using the public key of a public-private key pair to obtain packaged firmware; the second developer platform obtaining the signature information of the packaged firmware and concatenating the signature information to the packaged firmware to obtain the second target firmware; and the second developer platform encrypting the second target firmware using a firmware key obtained from a key management system to obtain the encrypted firmware. It is understood that the encryption of the second target firmware may, but is not limited to, using the AES-CBC-256 encryption algorithm.
[0067] Understandably, the second developer platform needs to obtain the public key of the public-private key pair from the key management system. Therefore, in some embodiments, before the second developer platform packages the original firmware file based on the public key of the public-private key pair, the process further includes: the second developer platform initiating a public key call request to the security service, triggering the security service to retrieve the public key from the key management system; and the second developer platform receiving the public key returned by the security service.
[0068] In some embodiments, the public key access request initiated by the second developer platform to the security service carries a UUID as the request ID. In response to the public key access request, the security service retrieves the public key from the public-private key pair randomly generated by the key management system. It is understood that the public-private key pair randomly generated by the key management system is used for signing the firmware on the second developer platform, and the private key in the public-private key pair must not be exported. The security service returns the public key retrieved from the key management system to the second developer platform.
[0069] In some embodiments, the second developer platform packages the original firmware file based on the public key of the public-private key pair, including: the second developer platform obtains a signed public key certificate based on the public key returned by the security service, and packages the public key certificate with the original firmware file to obtain the packaged firmware.
[0070] In some embodiments, the second developer platform obtains a signed public key certificate based on the public key returned by the security service. This includes: using the private key of the PAI (Product Attestation Intermediate) on the second developer platform to sign a certificate for the public key returned by the security service, thereby obtaining the public key certificate. It is understood that the public key is stored in the configuration center of the second developer platform, and the certificate application platform corresponding to the second developer platform issues certificates for the public key. The certificate application platform uses the private key of the PAI (Product Attestation Intermediate) to sign a certificate for the public key returned by the security service.
[0071] In some embodiments, the second developer platform obtains the signature information of the packaged firmware by: calculating the firmware hash value of the packaged firmware and sending the firmware hash value to the security service, so that the security service can generate signature information using the private key of the public-private key pair and the firmware hash value; and receiving the signature information returned by the security service.
[0072] In some embodiments, the second developer platform may use a hash algorithm (e.g., SHA-256 algorithm) to calculate the firmware hash value of the packaged firmware.
[0073] In some embodiments, the second developer platform sends a firmware hash value and a private key retrieval request for the packaged firmware to the security service, in order to request signature information for the packaged firmware. In response to the private key retrieval request initiated by the second developer platform, the security service retrieves the private key from the public-private key pair from the key management system and uses the private key retrieved from the key management system to sign the firmware hash value, thereby obtaining signature information. The security service returns the signature information to the second developer platform.
[0074] It is understandable that when the second developer platform appends the signature information to the packaged firmware, it may append the signature information to the end of the packaged firmware. The second developer platform may send the firmware hash value to the security service through the signature interface of the SDK provided by the security service, and the private key call request sent by the second developer platform carries the UUID as the request ID.
[0075] In some embodiments, before encrypting the second target firmware using the obtained firmware key, the process further includes: the second developer platform initiating a key access request to the security service, triggering the security service to retrieve the firmware key from the key management system; and receiving the firmware key returned by the security service. It is understood that the second developer platform initiates the key access request to the security service, the security service responds to the key request by retrieving the firmware key from the key management system, the security service returns the retrieved firmware key to the second developer platform through the SDK interface and secure encryption channel, and the second developer platform uses the firmware key returned by the security service to encrypt the second target firmware to obtain encrypted firmware.
[0076] In some embodiments, before decrypting the encrypted firmware based on the acquired firmware key, the method further includes: reading the encrypted ciphertext of the firmware key from the non-volatile memory of the target home device; and decrypting the encrypted ciphertext to obtain the firmware key. It is understood that the networking module of the target home device calls the key burned into the eFuse module to decrypt the encrypted ciphertext to obtain the firmware key.
[0077] In some embodiments, the target home device verifies the legitimacy of the second target firmware, including: the target home device obtaining a public key certificate from the second target firmware; the target home device decrypting the public key from the public-private key pair in the public key certificate; and the target home device verifying the signature information of the second target firmware based on the decrypted public key, wherein the signature information is obtained by signing the firmware hash value of the second target firmware using the private key from the public-private key pair. It is understood that ECDSA (Elliptic Curve Digital Signature Algorithm), such as NIST P-256, can be used to sign the firmware hash value of the second target firmware.
[0078] In some embodiments, the target home device uses the PAI's public key to decrypt the public key pair from the public key certificate.
[0079] In some embodiments, to improve system performance, protect data security, and reduce firmware failure risks, the system switches from the first partition to the second partition before the target home device performs an over-the-air firmware upgrade via the second wireless communication link. Encrypted firmware obtained from the second developer platform is written to the second partition, where it is decrypted and the legitimacy of the decrypted target firmware is verified. After verifying the legitimacy of the target firmware, the system switches back to the first partition, which stores the original firmware of the target home device.
[0080] To facilitate understanding of the over-the-air firmware upgrade method for smart home devices provided in this embodiment of the invention, taking a first wireless communication link as a Msmart link and a second wireless communication link as a Matter link as an example, the interactive implementation process of each stage of the over-the-air firmware upgrade method for smart home devices in this embodiment of the invention is described as follows:
[0081] The following is for reference. Figure 3 The interactive implementation process of adding the function of over-the-air firmware upgrade based on the second wireless communication link to the target home device via the first wireless communication link, and the stage of issuing relevant keys to the target home device is described:
[0082] Step S31: The key management system randomly generates firmware key K_fw and public-private key pair (PUK_s, PRK_s);
[0083] Step S32: The target home device performs an over-the-air firmware upgrade via the Msmart link and the first developer platform to add the function of over-the-air firmware upgrade based on the Matter link to the target home device;
[0084] Step S33: The target home device uses the SST protocol to perform two-way authentication with the access layer server;
[0085] Step S34: The target home device initiates a key distribution request to the access layer server;
[0086] Step S35: The access layer server initiates a key call request UUID(K_fw) to the security service, requesting to call the firmware key K_fw;
[0087] Step S36: The security service retrieves K_fw from the key management system;
[0088] Step S37: The key management system returns K_fw to the security service;
[0089] Step S38: The security service returns K_fw to the access layer server;
[0090] Step S39: The access layer server sends the firmware key K_fw to the target home device;
[0091] Step S310: The target home device calls the key eFusekey burned into the eFuse module to encrypt K_fw and permanently stores the encrypted ciphertext in the reserved sector of flash.
[0092] Below, for reference Figure 4 The process of encrypting and signing firmware on the second developer platform is described below:
[0093] Step S41: The second developer platform sends a public key call request UUID(PUK_s) to the security service, requesting to call the public key PUK_s;
[0094] Step S42: The security service retrieves PUK_s from the key management system;
[0095] Step S43: The key management system returns PUK_s to the security service;
[0096] Step S44: The security service returns PUK_s to the second developer platform;
[0097] Step S45: The second developer platform uses the private key of PAI to issue a certificate to PUK_s, generates a public key certificate Cert_PUK_s, and packages Cert_PUK_s into the original firmware file;
[0098] Step S46: The second developer platform calculates the firmware hash value SHA_fw of the packaged firmware;
[0099] Step S47: The second developer platform sends SHA_fw and private key call request UUID(PRK_s) to the security service;
[0100] Step S48: The security service retrieves the private key PRK_s from the key management system;
[0101] Step S49: The key management system returns PRK_s to the security service;
[0102] Step S410: The security service uses SHA_fw and PRK_s to generate signature information Sig;
[0103] Step S411: The security service returns the signature information Sig to the second developer platform;
[0104] Step S412: The second developer platform concatenates the signature information Sig into the packaged firmware to obtain the second target firmware;
[0105] Step S413: The second developer platform sends a key invocation request UUID(K_fw) to the security service;
[0106] Step S414: The security service retrieves K_fw from the key management system;
[0107] Step S415: The key management system returns K_fw to the security service;
[0108] Step S416: The security service returns K_fw to the second developer platform;
[0109] Step S417: The second developer platform uses K_fw to encrypt and package the firmware to obtain encrypted firmware.
[0110] Below, for reference Figure 5 The interaction process of over-the-air firmware upgrades for target home devices via the Matter link and a second developer platform is described:
[0111] Step S51: The target home device obtains encrypted firmware from the second developer platform via the Matter link;
[0112] Step S52: The target home device calls the eFuse key burned into the eFuse module to decrypt the encrypted ciphertext, and uses the decrypted firmware key to decrypt the encrypted firmware to obtain the second target firmware;
[0113] Step S53: The target home device retrieves the public key certificate from the second target firmware, decrypts the public key from the public key certificate using the PAI's public key, and uses the public key to verify the signature information Sig of the second target firmware.
[0114] Step S54: Switch partitions; the current over-the-air firmware upgrade is complete.
[0115] Based on the above and Figures 3 to 5 The interactive embodiment shown utilizes the Msmart link to perform OTA upgrades on existing smart home devices, enabling these devices to perform OTA updates via the matter link. It also issues relevant key information for OTA updates via the matter link and securely stores the keys using efuse_key, ensuring the security and legitimacy of OTA updates via the matter link throughout the entire process.
[0116] Based on the same inventive concept, embodiments of the present invention also provide an over-the-air firmware upgrade method for smart home devices, which can be applied to... Figure 1 And the first developer platform 100 in the aforementioned smart home system. (For example...) Figure 6 As shown, the over-the-air firmware upgrade method for the smart home device includes the following steps: S601: sending a first target firmware to the target home device through a first wireless communication link, so that the target home device can add the function of over-the-air firmware upgrade using a second wireless communication link according to the first target firmware.
[0117] Based on the same inventive concept, embodiments of the present invention also provide an over-the-air firmware upgrade method for smart home devices, applicable to... Figure 1 And the second developer platform 200 in the aforementioned smart home system, such as Figure 7 As shown, the over-the-air firmware upgrade method for this smart home device includes the following steps S701 to S703:
[0118] S701. Package the original firmware file according to the public key of the public-private key pair to obtain the packaged firmware;
[0119] S702. Obtain the signature information of the packaged firmware and concatenate the signature information into the packaged firmware to obtain the second target firmware.
[0120] S703. Encrypt the second target firmware according to the obtained firmware key to obtain encrypted firmware.
[0121] In some embodiments, obtaining the signature information of the packaged firmware includes: calculating the firmware hash value of the packaged firmware; sending the firmware hash value to a security service so that the security service can generate the signature information of the packaged firmware using the private key of the public-private key pair and the firmware hash value; and receiving the signature information returned by the security service.
[0122] In some embodiments, before packaging the original firmware file according to the public key of the public-private key pair, the method further includes: initiating a public key call request to the security service to trigger the security service to retrieve the public key from the key management system; and receiving the public key returned by the security service.
[0123] In some embodiments, the original firmware file is packaged according to the public key of the public-private key pair to obtain packaged firmware, including: obtaining a signed public key certificate according to the public key; and packaging the public key certificate with the original firmware file to obtain packaged firmware.
[0124] In some embodiments, before encrypting the second target firmware according to the obtained firmware key, the method further includes: initiating a key call request to the security service to trigger the security service to retrieve the firmware key from the key management system; and receiving the firmware key returned by the security service.
[0125] Based on the same inventive concept, embodiments of the present invention also provide an over-the-air firmware upgrade device for smart home devices, such as... Figure 8 As shown, the over-the-air firmware upgrade device 401 is applied to, for example... Figure 1 The target home device 400 shown has a first wireless communication link and a second wireless communication link supporting interconnection between the target home device 400 and other devices. The over-the-air firmware upgrade device 401 includes: a first upgrade unit 4011, used to acquire a first target firmware through the first wireless communication link and add the function of over-the-air firmware upgrade using the second wireless communication link to the target home device according to the first target firmware; a key acquisition unit 4012, used to acquire a firmware key from a key management system; and a key storage unit 4013, used to store the firmware key in the target home device, wherein the firmware key is used to decrypt the acquired encrypted firmware when the target home device performs an over-the-air firmware upgrade through the second wireless communication link.
[0126] In some embodiments, the key acquisition unit 4012 includes: an authentication subunit for performing two-way authentication with the access layer server; a request subunit for initiating a key issuance request to the access layer server, triggering the access layer server to retrieve the firmware key generated by the key management system from the key management system through a security service; and a receiving subunit for receiving the firmware key issued by the access layer server.
[0127] In some embodiments, the key storage unit 4013 includes: an encryption subunit for encrypting the firmware key to obtain encrypted ciphertext of the firmware key; and a storage subunit for storing the encrypted ciphertext in the non-volatile memory of the target home device.
[0128] In some embodiments, the over-the-air firmware upgrade device 401 further includes: a firmware acquisition unit for acquiring encrypted firmware via a second wireless communication link; a firmware decryption unit for decrypting the encrypted firmware based on a firmware key to obtain a second target firmware; and a verification unit for verifying the legality of the second target firmware.
[0129] In some embodiments, the over-the-air firmware upgrade device 401 further includes: a reading unit for reading encrypted ciphertext of the firmware key from the non-volatile memory of the target home device; and a key decryption unit for decrypting the encrypted ciphertext to obtain the firmware key.
[0130] In some embodiments, the verification unit includes: a certificate acquisition subunit, configured to acquire a public key certificate from the second target firmware; a certificate decryption subunit, configured to decrypt the public key of the public-private key pair from the public key certificate; and a signature verification subunit, configured to verify the signature information of the second target firmware based on the public key, wherein the signature information is obtained by signing the firmware hash value of the second target firmware using the private key of the public-private key pair.
[0131] In some embodiments, the over-the-air firmware upgrade device 401 further includes: a partition switching unit, used to switch from a first partition to a second partition before obtaining encrypted firmware via a second wireless communication link;
[0132] After verifying the legitimacy of the second target firmware, switch back to the first partition from the second partition.
[0133] Based on the same inventive concept, embodiments of the present invention also provide an over-the-air firmware upgrade device for smart home devices, such as... Figure 9 As shown, the over-the-air firmware upgrade device 101 is applied to the first developer platform 100. The over-the-air firmware upgrade device 1001 includes: a distribution unit 1011, which is used to distribute a first target firmware to the target home device through a first wireless communication link, so that the target home device can add the function of over-the-air firmware upgrade using a second wireless communication link according to the first target firmware.
[0134] Based on the same inventive concept, embodiments of the present invention also provide an over-the-air firmware upgrade device for smart home devices, such as... Figure 10 As shown, the over-the-air firmware upgrade device 201 is applied to the second developer platform 200. The over-the-air firmware upgrade device 201 includes: a packaging unit 2011, used to package the original firmware file according to the public key of the public-private key pair to obtain packaged firmware; an information acquisition unit 2012, used to acquire the signature information of the packaged firmware and concatenate the signature information to the packaged firmware to obtain the second target firmware; and a firmware encryption unit 2013, used to encrypt the second target firmware according to the acquired firmware key to obtain encrypted firmware.
[0135] The specific functions of each functional unit in the above-mentioned device have been described in detail in the over-the-air firmware upgrade method for smart home devices provided in some embodiments of the present invention, and will not be elaborated here.
[0136] Based on the same inventive concept, embodiments of the present invention also provide a smart home device, such as... Figure 11 As shown, the smart home device includes: a processor 1102; and a memory 1104 for storing executable instructions of the processor 1102, wherein the processor 1102 is configured to execute the instructions to implement the over-the-air firmware upgrade method for the smart home device described in any of the above embodiments.
[0137] Among them, Figure 11 In this document, a bus architecture (represented by bus 1100) is used. Bus 1100 may include any number of interconnected buses and bridges, linking various circuits including one or more processors represented by processor 1102 and memory represented by memory 1104. Bus 1100 may also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. Bus interface 1105 provides an interface between bus 1100 and receiver 1101 and transmitter 1103. Receiver 1101 and transmitter 1103 may be the same element, i.e., a transceiver, providing a unit for communicating with various other devices over a transmission medium. Processor 1102 is responsible for managing bus 1100 and general processing, while memory 1104 may be used to store data used by processor 1102 during operation.
[0138] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the over-the-air firmware upgrade method for smart home devices described in any of the above embodiments.
[0139] Based on the same inventive concept, embodiments of the present invention also provide a computer program product, including computer instructions, which, when executed by a processor, implement the over-the-air firmware upgrade method for smart home devices described in any of the above embodiments.
[0140] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0141] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0142] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0143] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0144] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0145] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. An over-the-air firmware upgrade method for a smart home device, the method comprising: The method is applied to a target home device configured with a first wireless communication link and a second wireless communication link supporting interconnection of the target home device and other devices, and comprises the following steps: obtaining a first target firmware through the first wireless communication link, and adding a function of over-the-air firmware upgrade using the second wireless communication link to the target home device according to the first target firmware; obtaining a firmware key from a key management system; storing the firmware key in the target home device, wherein the firmware key is used to decrypt encrypted firmware when the target home device performs over-the-air firmware upgrade through the second wireless communication link.
2. The method of claim 1, wherein, The step of obtaining the firmware key from the key management system comprises the following steps: performing bidirectional identity authentication with an access layer server; initiating a key issuance request to the access layer server, triggering the access layer server to call the firmware key generated by the key management system from the key management system through a security service; receiving the firmware key issued by the access layer server.
3. The method of claim 1, wherein, The step of storing the firmware key in the target home device comprises the following steps: encrypting the firmware key to obtain encrypted ciphertext of the firmware key; storing the encrypted ciphertext in a non-volatile memory of the target home device.
4. The method of any one of claims 1-3, wherein, After storing the firmware key in the target home device, the method further comprises the following steps: obtaining encrypted firmware through the second wireless communication link; decrypting the encrypted firmware based on the firmware key to obtain a second target firmware; verifying legality of the second target firmware.
5. The method of claim 4, wherein, Before decrypting the encrypted firmware based on the firmware key, the method further comprises the following steps: reading encrypted ciphertext of the firmware key from the non-volatile memory of the target home device; decrypting the encrypted ciphertext to obtain the firmware key.
6. The method of claim 4, wherein, The step of verifying legality of the second target firmware comprises the following steps: obtaining a public key certificate from the second target firmware; decrypting a public key of a public-private key pair from the public key certificate; verifying a signature of the second target firmware based on the public key, wherein the signature is obtained by signing a firmware hash value of the second target firmware using a private key of the public-private key pair.
7. The method of claim 4, wherein: before obtaining encrypted firmware through the second wireless communication link, the method further comprises switching from a first partition to a second partition; after verifying legality of the second target firmware, the method further comprises switching back from the second partition to the first partition.
8. A smart home system, characterized by, The system comprises a first developer platform, a second developer platform and a target home device, wherein: the first developer platform is configured to issue a first target firmware to the target home device through a first wireless communication link; the target home device is configured to obtain the first target firmware from the first developer platform through the first wireless communication link, add a function of over-the-air firmware upgrade using a second wireless communication link to the target home device according to the first target firmware, obtain a firmware key from a key management system, and store the firmware key in the target home device; a second developer platform, configured to perform over-the-air firmware upgrade on the target home device via a second wireless communication link; the target home device is further configured to decrypt the encrypted firmware obtained from the second developer platform when the target home device performs over-the-air firmware upgrade via the second wireless communication link.
9. An over-the-air firmware upgrade device for smart home devices, characterized in that, The over-the-air firmware upgrade device is applied to a target home device, and the target home device is configured with a first wireless communication link and a second wireless communication link supporting interconnection between the target home device and other devices. The over-the-air firmware upgrade device comprises: a first upgrade unit, configured to obtain a first target firmware via the first wireless communication link, and add a function of over-the-air firmware upgrade via the second wireless communication link to the target home device according to the first target firmware; a key obtaining unit, configured to obtain a firmware key from a key management system; a key storage unit, configured to store the firmware key in the target home device, wherein the firmware key is used to decrypt the obtained encrypted firmware when the target home device performs over-the-air firmware upgrade via the second wireless communication link.
10. A smart home device, comprising: comprise: a processor; a memory for storing instructions executable by the processor, wherein the processor is configured to execute the instructions to implement the over-the-air firmware upgrade method of the smart home device according to any one of claims 1-7.
11. A computer readable storage medium having stored thereon a computer program, characterized in that The program is executed by the processor to implement the over-the-air firmware upgrade method of the smart home device according to any one of claims 1-7.
12. A computer program product, characterised in that, comprise computer instructions, which are executed by the processor to implement the over-the-air firmware upgrade method of the smart home device according to any one of claims 1-7.