Intelligent curtain motor firmware upgrading method
By introducing a backup firmware area and an automatic rollback mechanism, combined with multi-layered encryption verification and integrity checks, the reliability and security issues in the upgrade process of smart curtain motors have been resolved, achieving improved stability and security and meeting the needs of smart home IoT systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-03-20
AI Technical Summary
Existing upgrade technologies for smart curtain motors are insufficient in terms of system reliability and security. They are prone to device malfunction due to network fluctuations and interruptions, and pose a high risk of user privacy information leakage, thus failing to meet the requirements of new smart home IoT systems.
It employs a backup firmware area and an automatic rollback mechanism, combined with multi-layered encryption verification and integrity checks, to perform firmware upgrades through an external interface module and a relay upgrade module, ensuring the integrity and security of the upgrade package, and automatically rolling back to the old version in case of failure.
It significantly reduces the probability of upgrade failure, enhances system stability and maintainability, prevents malicious firmware implantation and data leakage, and meets the high security requirements of the smart Internet of Things.
Smart Images

Figure CN121704875A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent curtain equipment technology, and more specifically to a method for upgrading the firmware of an intelligent curtain motor. Background Technology
[0002] Today, smart curtains have been widely integrated into the smart home ecosystem, with the smart curtain motor as their core driver. With the development of IoT technology, smart curtain motors have evolved from simple electric devices into important nodes in smart home networks. Their core architecture integrates the motor body, microcontroller (MCU), wireless communication module, and firmware storage unit, allowing for firmware upgrades via OTA (over-the-air) or local interface to meet the customized needs of different customers.
[0003] However, while existing upgrade solutions significantly improve product usability, they also present significant vulnerabilities in system reliability and security. Firstly, current smart curtain motor upgrade methods are simplistic and lack effective backup and rollback mechanisms. If OTA upgrades are interrupted due to network fluctuations or interference, the motor is prone to program errors and freezing, requiring costly factory repairs. Secondly, existing solutions generally neglect the security of smart curtain motors after they are connected to the internet: on the one hand, firmware data contains information about curtain opening and closing times that can reflect user habits, posing a risk of leaking personal information; on the other hand, as a node in the home IoT network, the smart curtain motor is given far less attention than home security cameras, routers, and other devices, making it vulnerable to becoming a "stepping stone" for unauthorized intrusion into the entire IoT network.
[0004] In summary, existing smart curtain motors have significant shortcomings in reliability, safety, and maintainability, and cannot meet the requirements of new smart home IoT systems. Summary of the Invention
[0005] The purpose of this invention is to provide a firmware upgrade method for a smart curtain motor. This method can enhance the stability of the smart curtain motor during the firmware upgrade process and reduce the probability of upgrade failure. It can also improve the data security of the smart curtain motor and meet the requirements of new smart home Internet of Things systems.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0007] This invention provides a firmware upgrade method for a smart curtain motor. The method is applied to a smart curtain motor system, which includes a motor module, a control unit, a firmware storage unit, and an external interface module. The firmware storage unit is divided into an upgrade firmware area and a backup firmware area. The backup firmware area stores the original firmware or an older firmware upgrade package. The method includes:
[0008] The firmware upgrade package is obtained from the relay upgrade module by connecting to the relay upgrade module via an external interface module; the firmware upgrade package is written into the upgrade firmware area of the firmware storage unit.
[0009] The control unit reads the firmware upgrade package stored in the upgrade firmware area and decrypts and verifies it;
[0010] If the control unit successfully reads the firmware upgrade package and completes the decryption verification, it executes the firmware upgrade process; if the control unit fails to read the firmware upgrade package or fails the decryption verification, it automatically reads the original firmware or old version firmware upgrade package stored in the backup firmware area and performs a version rollback.
[0011] As a preferred embodiment of the present invention, the intelligent curtain motor firmware upgrade method further includes a synchronous backup step:
[0012] The control unit synchronously copies the firmware upgrade package in the upgrade firmware area to the backup firmware area for storage as a temporary rollback backup.
[0013] As a preferred embodiment of the present invention, before the step of writing the firmware upgrade package into the upgrade firmware area of the firmware storage unit, an integrity verification step is further included:
[0014] The control unit performs CRC32 cyclic redundancy check on the received firmware upgrade package;
[0015] If the verification is successful, writing to the upgraded firmware area is allowed and subsequent decryption steps are executed; if the verification fails, writing is rejected and a failure response is sent.
[0016] As a preferred embodiment of the present invention, before writing the firmware upgrade package into the upgrade firmware area of the firmware storage unit, a decryption and verification step is further included:
[0017] The host computer encrypts the firmware upgrade package using the XXTEA encryption algorithm and sends it to the relay upgrade module;
[0018] The control unit decrypts the encrypted firmware upgrade package sent by the relay upgrade module based on the XXTEA decryption algorithm;
[0019] If decryption is successful, the decrypted firmware upgrade package is written to the upgrade firmware area of the firmware storage unit; if decryption fails, the firmware upgrade package is not written.
[0020] As a preferred embodiment of the present invention, a secondary data decryption and legality verification step is included before the firmware upgrade process:
[0021] The control unit performs secondary data decryption and legality verification on the firmware upgrade package in the upgrade firmware area based on a preset key;
[0022] If the secondary data decryption and verification are successful, the firmware upgrade process is executed; if the secondary data decryption or verification fails, the firmware upgrade package is determined to be corrupted or erroneous, the upgrade is rejected, and a version rollback is executed.
[0023] As a preferred embodiment of the present invention, this intelligent curtain motor firmware upgrade method further includes an operation monitoring step:
[0024] The control unit continuously monitors the running status of the firmware program corresponding to the latest firmware upgrade package after the upgrade is completed;
[0025] If an operational anomaly, watchdog reset, or startup failure is detected, the control unit automatically switches to read the firmware stored in the backup firmware area to complete the version rollback.
[0026] As a preferred embodiment of the present invention, this intelligent curtain motor firmware upgrade method further includes a forced recovery step:
[0027] When the reset button on the external interface module is triggered, a forced recovery command is sent to the control unit;
[0028] The control unit responds to the forced recovery command by forcibly reading the firmware stored in the backup firmware area and performing a version rollback.
[0029] As a preferred embodiment of the present invention, the intelligent curtain motor system further includes a wireless communication module; the intelligent curtain motor firmware upgrade method further includes a wireless communication step:
[0030] The control unit interacts wirelessly with the cloud terminal through the wireless communication module, downloads the firmware upgrade package and saves it to the upgrade firmware area, and synchronously transmits upgrade status information.
[0031] In summary, the present invention has the following beneficial effects:
[0032] This invention introduces a backup firmware area and an automatic rollback mechanism, which allows the system to automatically restore to the old firmware version when the upgrade fails or the verification fails. This effectively avoids the problem of the device becoming "bricked" due to the upgrade interruption, significantly reduces maintenance costs, and enhances the stability and maintainability of the system.
[0033] This invention employs multi-layered encryption verification (such as the XXTEA algorithm) and integrity verification (such as CRC32) to ensure the reliable source and complete transmission of firmware upgrade packages, preventing malicious firmware implantation or data leakage. This protects user privacy (such as the pattern of curtain opening and closing) and reduces the risk of devices becoming a springboard for network attacks, meeting the high security requirements of the smart Internet of Things. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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.
[0035] Figure 1 A block diagram of an intelligent curtain motor system;
[0036] Figure 2 A flowchart for the firmware upgrade method of smart curtain motor. Detailed Implementation
[0037] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed merely to enable those skilled in the art to better understand and implement the subject matter described herein, and are not intended to limit the scope, applicability, or examples set forth in the claims. The function and arrangement of the elements discussed may be changed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the various examples. For example, the described methods may be performed in a different order than described, and steps may be added, omitted, or combined. Furthermore, features described in some examples may be combined in other examples.
[0038] As used herein, the term "comprising" and its variations are open terms meaning "including but not limited to". The term "based on" means "at least partially based on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other definitions, whether explicit or implicit, may be included below. Unless explicitly indicated by the context, the definition of a term shall remain consistent throughout the specification.
[0039] Example 1: As Figure 1 As shown, the firmware upgrade method for a smart curtain motor proposed in this invention operates in a smart curtain motor system. The hardware of this system mainly includes the following core components:
[0040] The motor module is the power unit responsible for driving the opening and closing of the curtains;
[0041] The control unit, as the core processing center of the system, is responsible for logical judgment, data encryption and decryption, verification, and control of the motor module; it can be implemented based on an MCU on the PCB control motherboard installed in the smart curtain motor, such as a single-chip microcontroller.
[0042] The firmware storage unit uses Flash memory or EEPROM, and its storage space is logically or physically strictly divided into two areas: one is the upgrade firmware area (Zone A): used to store firmware upgrade packages for unverified or latest downloaded versions; the other is the backup firmware area (Zone B): used to store the original factory firmware or the upgrade package for the previous stable version of firmware. This area is usually write-protected and can only be overwritten under a specific confirmation process to ensure that the system always has a safety bottom line that can be rolled back.
[0043] The external interface module provides physical connection interfaces (such as UART, USB or dedicated debugging port) for connecting to the relay upgrade module. The external interface module also integrates a physical reset / restore button for forced system recovery or restart.
[0044] The relay upgrade module is an independent upgrade relay module. It is implemented based on a single-chip microprocessor and has a built-in hardware encryption engine. It can convert the firmware upgrade package downloaded from the host computer into an upgrade package format that the smart curtain motor can process. Its hardware encryption engine allows the host computer to perform factory-level encryption on the upgrade package and can be adapted to different smart curtain motor models. It can solve the problem that traditional smart curtain motors cannot wirelessly download firmware upgrade packages and ensure the security and availability of information on the transmission link.
[0045] The wireless communication module is used to connect to Wi-Fi, Zigbee, or Bluetooth networks to enable data interaction with the cloud. It can give smart curtain motors with certain signals the ability to upgrade wirelessly and is suitable for data transmission with low security requirements.
[0046] Example 2: This example will combine Figure 2 This document provides a detailed description of the complete method for firmware upgrades via an external interface.
[0047] First, the relay upgrade module is connected via an external interface module to obtain the firmware upgrade package from the relay upgrade module; then, the firmware upgrade package is written into the upgrade firmware area of the firmware storage unit.
[0048] Specifically, before the upgrade begins, the user or maintenance personnel physically connect the relay upgrade module to the external interface module of the smart curtain motor. To prevent the firmware upgrade package from being intercepted or tampered with on the transmission link, the host computer (PC or server) encrypts the original firmware data using the XXTEA encryption algorithm before sending the firmware upgrade package.
[0049] Specifically, after receiving the firmware upgrade package (considered the latest firmware upgrade package) through the external interface module, the control unit does not immediately write it to the firmware storage unit. Instead, it first performs a CRC32 cyclic redundancy check. If the check result is inconsistent with the checksum in the data packet header, it indicates that packet loss or bit error occurred during transmission. The control unit directly discards the packet and sends a "failure / retransmission" response, refusing to write it. Only when the CRC32 check passes does the control unit determine that the data is complete, allowing it to be written to the upgrade firmware area and execute subsequent decryption steps.
[0050] Next, the control unit reads the firmware upgrade package stored in the upgrade firmware area and decrypts and verifies it.
[0051] Specifically, after the verification is successful, the control unit calls the internally integrated XXTEA decryption algorithm to decrypt the data. If the decrypted data header identifier does not conform to the system specifications, it is judged as illegal firmware and is refused to be written. This measure can identify malicious attack programs that intrude into the motor control system and prevent the motor node from becoming a springboard for attacks on the entire home Internet of Things network.
[0052] If decryption is successful, the control unit will write the decrypted firmware code into the upgrade firmware area of the firmware storage unit.
[0053] Then, if the control unit successfully reads the firmware upgrade package and completes the decryption and verification, the firmware upgrade process is executed.
[0054] Before the firmware upgrade process, a secondary data decryption and legality verification step is also included:
[0055] The control unit performs secondary data decryption and legality verification on the firmware upgrade package in the upgrade firmware area based on a preset key;
[0056] If the secondary data decryption and verification are successful, the firmware upgrade process is executed; if the secondary data decryption or verification fails, the firmware upgrade package is determined to be corrupted or erroneous, the upgrade is rejected, and a version rollback is performed. Specifically, the secondary data decryption corresponds to the static security verification step. After the firmware upgrade package is written, the system does not immediately restart and run the new firmware, but instead enters the data decryption stage.
[0057] The control unit reads the data just written to the upgrade firmware area and uses the preset AES256 algorithm key to perform secondary decryption and legality verification on the contents of the upgrade firmware area (including signature verification, version number logic check, etc.). This step is to prevent attackers from writing corrupted or malicious firmware even if the transmission encryption is bypassed. If the AES256 verification fails, the system determines that the upgrade firmware area data is untrusted, refuses to perform the upgrade, and triggers the rollback logic.
[0058] It is important to note that a synchronization and backup step is included before the firmware upgrade process:
[0059] The control unit synchronously copies the firmware upgrade package from the upgrade firmware area to the backup firmware area for storage as a temporary rollback backup. The purpose of this step is to update the "known good" baseline. In practical applications, it is also possible to choose not to copy after verification, but to copy after the new firmware has successfully started and run once, in order to further improve security.
[0060] During the firmware upgrade process, the control unit updates the bootloader pointer to point to the firmware upgrade area and performs a soft reboot to start running the new firmware. This part can be implemented based on existing technology, and will not be described in detail in this embodiment.
[0061] If the control unit fails to read the firmware upgrade package or fails the decryption verification, it will automatically read the original firmware or old version firmware upgrade package stored in the backup firmware area and perform a version rollback.
[0062] Specifically, the above steps are for exception handling and version rollback. Below are some specific examples of these steps:
[0063] In one possible scenario, a rollback is performed during the upgrade process. Specifically, if any error occurs, such as transmission verification failure, XXTEA decryption failure, or AES256 verification failure, the control unit will terminate the upgrade process and start the bootloader to automatically point to the backup firmware area. The system loads the original firmware or the old version firmware in the backup firmware area to ensure that the motor will not be "bricked" or unresponsive due to the upgrade interruption.
[0064] In another possible scenario, dynamic rollback is performed during operation. Specifically, even if the new firmware passes static verification and starts running, there may still be runtime bugs (such as infinite loops or memory overflows). The control unit has a built-in watchdog timer and an exception interrupt service routine to continuously monitor the running status of the new firmware. If the system detects a watchdog reset, a HardFault exception, or multiple startup failures within a short period after startup, the control unit will determine that the new firmware is unstable. At this time, the control unit will automatically modify the startup flag and force the firmware to be loaded from the backup firmware area on the next startup, thereby restoring the basic control function of the curtain motor.
[0065] In another possible scenario, a physical forced recovery is performed. Specifically, when the system experiences a software deadlock or the user forgets the configuration information and a forced factory reset is required, the user presses and holds the reset / restore button on the external interface module. After the control unit detects this hardware signal, it ignores the current status of the upgrade firmware area and directly sends a forced recovery command. The system forcibly reads the original factory firmware stored in the backup firmware area to overwrite or boot, thus achieving a physical version rollback.
[0066] Example 3: Wireless OTA upgrade.
[0067] The intelligent curtain motor system also includes a wireless communication module; the intelligent curtain motor firmware upgrade method further includes a wireless communication step: the control unit interacts wirelessly with the cloud terminal through the wireless communication module, downloads the firmware upgrade package and saves it to the upgrade firmware area, and synchronously transmits upgrade status information.
[0068] Specifically, the wireless communication module can be implemented based on the WIFI module. Through data interaction with cloud terminals (such as external mobile devices, the Tuya WIFI device APP, etc.), the system can periodically query version information. When a new version is available, the control unit downloads the firmware package through the wireless network. The post-download processing flow is completely consistent with steps S1-S4 in Embodiment 2 (i.e., it also undergoes CRC verification, storage, AES verification, backup and execution). The only difference is that the data source changes from an external interface to a wireless network. At the same time, the control unit will send status information such as "download progress", "verification result", and "upgrade success / failure" back to the cloud APP in real time for users to view.
[0069] The wireless OTA upgrade function in this embodiment can be adapted to some independent smart curtain motor systems (not connected to the home IoT network) or smart curtain motor systems with low security requirements, providing more upgrade channels for smart curtain motor systems, meeting the needs of different customers or scenarios, and complementing the upgrade solution through the relay upgrade module, thereby improving the product's applicability and competitiveness.
[0070] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
Claims
1. A method for upgrading firmware of a smart curtain motor, characterized in that, The method is applied to an intelligent curtain motor system, the system including a motor module, a control unit, a firmware storage unit, and an external interface module. The firmware storage unit is divided into an upgrade firmware area and a backup firmware area, the backup firmware area storing the original firmware or an old version firmware upgrade package; the method includes: The firmware upgrade package is obtained from the relay upgrade module by connecting to the relay upgrade module via an external interface module; the firmware upgrade package is written into the upgrade firmware area of the firmware storage unit. The control unit reads the firmware upgrade package stored in the upgrade firmware area and decrypts and verifies it; If the control unit successfully reads the firmware upgrade package and completes the decryption verification, it executes the firmware upgrade process; if the control unit fails to read the firmware upgrade package or fails the decryption verification, it automatically reads the original firmware or old version firmware upgrade package stored in the backup firmware area and performs a version rollback.
2. The firmware upgrade method for a smart curtain motor according to claim 1, characterized in that, This method for upgrading the firmware of smart curtain motors also includes a synchronous backup step: The control unit synchronously copies the firmware upgrade package in the upgrade firmware area to the backup firmware area for storage as a temporary rollback backup.
3. The firmware upgrade method for a smart curtain motor according to claim 1, characterized in that, Before the step of writing the firmware upgrade package into the upgrade firmware area of the firmware storage unit, an integrity verification step is also included: The control unit performs CRC32 cyclic redundancy check on the received firmware upgrade package; If the verification is successful, writing to the upgraded firmware area is allowed and subsequent decryption steps are executed; if the verification fails, writing is rejected and a failure response is sent.
4. The firmware upgrade method for a smart curtain motor according to claim 3, characterized in that, Before writing the firmware upgrade package into the upgrade firmware area of the firmware storage unit, a decryption and verification step is also included: the host computer encrypts the firmware upgrade package based on the XXTEA encryption algorithm and sends it to the relay upgrade module. The control unit decrypts the encrypted firmware upgrade package sent by the relay upgrade module based on the XXTEA decryption algorithm; If decryption is successful, the decrypted firmware upgrade package is written to the upgrade firmware area of the firmware storage unit. If decryption fails, the firmware upgrade package will not be written.
5. A firmware upgrade method for a smart curtain motor according to claim 4, characterized in that, Before executing the firmware upgrade process, a secondary data decryption and legality verification step is also included: The control unit performs secondary data decryption and legality verification on the firmware upgrade package in the upgrade firmware area based on a preset key; If the secondary data decryption and verification are successful, then the firmware upgrade process will be executed. If the secondary data decryption or verification fails, the firmware upgrade package is determined to be corrupted or incorrect, the upgrade is rejected, and a version rollback is performed.
6. The firmware upgrade method for a smart curtain motor according to claim 1, characterized in that, This method for upgrading the firmware of a smart curtain motor also includes a performance monitoring step: The control unit continuously monitors the running status of the firmware program corresponding to the latest firmware upgrade package after the upgrade is completed; If an operational anomaly, watchdog reset, or startup failure is detected, the control unit automatically switches to read the firmware stored in the backup firmware area to complete the version rollback.
7. The firmware upgrade method for a smart curtain motor according to claim 1, characterized in that, This method for upgrading the firmware of smart curtain motors also includes a forced recovery step: When the reset button on the external interface module is triggered, a forced recovery command is sent to the control unit; The control unit responds to the forced recovery command by forcibly reading the firmware stored in the backup firmware area and performing a version rollback.
8. A firmware upgrade method for a smart curtain motor according to claim 1, characterized in that, This intelligent curtain motor system also includes a wireless communication module; the intelligent curtain motor firmware upgrade method further includes a wireless communication step. The control unit interacts wirelessly with the cloud terminal through the wireless communication module, downloads the firmware upgrade package and saves it to the upgrade firmware area, and synchronously transmits upgrade status information.