An embedded firmware self-adaptive upgrading method and system based on device state and network environment
By real-time sensing of device status and network environment and dynamic adjustment of policies, differential upgrade and fragmented download are adopted to solve the problems of high resource consumption and low success rate of firmware upgrade for IoT devices, and realize intelligent upgrade management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUZHOU DIGITAL VISION POWER TECHNOLOGY CO LTD
- Filing Date
- 2026-03-26
- Publication Date
- 2026-06-12
AI Technical Summary
Existing firmware upgrade methods for IoT devices suffer from high resource consumption, low success rate, poor network compatibility, and an inability to make intelligent decisions based on device status and network environment, leading to upgrade failures and device damage.
By real-time sensing of device status and network environment, combined with a preset strategy model, the system dynamically selects upgrade strategies, adopts differential upgrade mode and segmented download, supports breakpoint resume, and achieves adaptive upgrades on the device side.
It improves the success rate of firmware upgrades, reduces network resource consumption, optimizes the upgrade process, adapts to diverse IoT devices and network environments, and enhances device stability and management efficiency.
Smart Images

Figure CN122195489A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of embedded systems, and in particular to an embedded firmware adaptive upgrade method based on device status and network environment. Background Technology
[0002] With the rapid development of IoT technology, the number of embedded IoT devices in fields such as smart homes, industrial IoT, and smart cities has exploded. As a core component of IoT devices, firmware remote upgrades are a key means to achieve device function iteration, vulnerability repair, and performance optimization. Over-the-air (OTA) firmware upgrade technology has also become one of the core technologies for IoT device management.
[0003] Currently, firmware upgrades for IoT devices generally adopt a full-download approach, which has several technical drawbacks: First, the full-download upgrade package is large, consuming significant network bandwidth and resulting in long upgrade times and severe waste of network resources. Second, in unstable wireless network environments, upgrade package downloads are prone to interruption, and most upgrade solutions lack efficient resumption mechanisms, requiring re-downloading after interruption, further exacerbating resource consumption. Third, the upgrade process does not consider the real-time operating status of the device; if the device is operating with low power, high CPU load, and high memory usage, the upgrade is highly likely to fail, potentially leading to firmware corruption or functional abnormalities. Fourth, existing upgrade solutions lack the ability to dynamically perceive and comprehensively consider device resource status and network environment, failing to adjust upgrade strategies according to actual scenarios, resulting in low levels of intelligence in the upgrade process.
[0004] While improved firmware upgrade methods such as differential upgrades and breakpoint resume have emerged, alleviating the resource consumption problem of full upgrades to some extent, most technical solutions only optimize the download method and do not take into account the device's hardware status and network environment such as network signal strength, bandwidth, and packet loss rate. They cannot achieve intelligent upgrade decisions and scheduling based on the actual status of the device and the network, and still cannot solve core problems such as unreasonable upgrades, poor network adaptability, and low upgrade success rate. They cannot meet the diverse and complex application scenarios of IoT devices. Summary of the Invention
[0005] To improve the success rate of firmware upgrades and reduce resource consumption during the upgrade process, this application provides an embedded firmware adaptive upgrade method and system based on device status and network environment.
[0006] Firstly, this application provides an embedded firmware adaptive upgrade method based on device status and network environment, employing the following technical solution:
[0007] An embedded firmware adaptive upgrade method based on device status and network environment includes the following steps:
[0008] S1. The cloud server sends upgrade tasks to the networked embedded IoT devices, and the devices receive the upgrade instructions from the cloud.
[0009] S2. The device collects its own device status information in real time, and also collects information about the network environment in which the device is located.
[0010] S3. The device dynamically selects the corresponding upgrade strategy based on the preset strategy model and the collected device status information and network environment information. The upgrade strategy includes at least one of the following: upgrade mode, download time period, retry mechanism, and breakpoint resume strategy.
[0011] S4. The device executes the upgrade process sequentially according to the selected upgrade strategy, including downloading the upgrade package, verifying the integrity of the upgrade package, installing the firmware, and restarting the device.
[0012] S5. After the device completes the upgrade process, it will report the upgrade results and log information during the upgrade process to the cloud server.
[0013] Optionally, in step S2, the device status information includes at least one of the following: device power, memory usage, CPU load, and remaining storage space.
[0014] The network environment information includes at least one of network signal strength, available bandwidth, network latency, and network packet loss rate.
[0015] Optionally, in step S3, the upgrade mode includes a full upgrade mode and a differential upgrade mode, wherein the differential upgrade mode only downloads the difference data between the old and new firmware versions;
[0016] The differential upgrade mode calculates and merges firmware difference data based on the BSDiff algorithm or similar difference calculation algorithms.
[0017] Optionally, in step S3, the dynamic selection of the corresponding upgrade strategy includes:
[0018] When the device's battery level is below a preset threshold or the CPU load is above a preset threshold, the upgrade task is postponed until the device meets the preset operating conditions.
[0019] When the device is on a cellular network and the signal strength is below a preset signal strength threshold, it will automatically switch to differential upgrade mode.
[0020] Optionally, in step S4, the firmware is installed silently during idle periods when the CPU load on the device is below a preset threshold and there are no user operation commands.
[0021] If the firmware installation or upgrade package verification fails, the device will initiate a rollback mechanism to automatically restore to the previous working firmware version.
[0022] Optionally, in step S4, the upgrade package download adopts a segmented download method and supports breakpoint resumption. The device can dynamically adjust the size of the segments according to the real-time network environment information, reducing the segment size when the network bandwidth is low and increasing the segment size when the network bandwidth is high.
[0023] The retry mechanism refers to the device dynamically adjusting the number of retries for downloading the upgrade package based on network stability.
[0024] Optionally, the embedded IoT device includes at least one of smart home devices, industrial IoT devices, and smart city devices.
[0025] On the other hand, this application also provides an embedded firmware adaptive upgrade system based on device status and network environment to implement the above-mentioned upgrade method, and adopts the following technical solution:
[0026] An embedded firmware adaptive upgrade system based on device status and network environment includes a cloud-based upgrade management platform and a device-side upgrade module, which are connected via network communication.
[0027] The cloud-based upgrade management platform is used for upgrade task distribution, firmware version management, upgrade preset strategy model configuration, device upgrade results and log collection.
[0028] The device-side upgrade module is integrated into the embedded IoT device and is used for device status and network environment perception, upgrade strategy decision-making, adaptive upgrade process execution, and upgrade result reporting.
[0029] Optionally, the device-side upgrade module includes:
[0030] The device status monitoring module is used to collect device status information in real time, such as device power consumption, memory usage, CPU load, and storage space remaining.
[0031] The network sensing module is used to detect network environment information in real time, such as network signal strength, available bandwidth, network latency, network packet loss rate, and network type.
[0032] The differential upgrade engine, built on the BSDiff algorithm or similar difference calculation algorithms, is used to calculate, download, and merge the difference data between the old and new firmware versions.
[0033] The upgrade agent module, integrated into the OtterThings framework, is used to receive upgrade instructions, execute upgrade strategy decisions, schedule upgrade processes, and report upgrade results.
[0034] Optionally, the system supports cellular network protocols and is also compatible with IoT standard communication protocols such as short-range IoT communication protocols and low-power wide-area network protocols.
[0035] The network sensing module can detect the current communication protocol type of the device and the network characteristics of the corresponding protocol.
[0036] The upgrade proxy module invokes the differential upgrade engine, dynamically adjusts the fragment size and retry mechanism according to the network characteristics of different protocols, and implements an adaptive upgrade strategy under the corresponding protocol.
[0037] In summary, this application includes at least one of the following beneficial technical effects:
[0038] 1. By using the device-side status monitoring module and network sensing module, the device hardware status and network environment information are collected in real time and comprehensively. Based on the preset strategy model, the upgrade strategy is dynamically selected and adjusted. It can automatically determine the upgrade timing and select the upgrade mode according to the actual situation such as device power, CPU load, network type, and signal strength. This avoids upgrade failure caused by high device load and poor network environment from the root, and effectively improves the overall success rate of firmware upgrade.
[0039] 2. Supports differential upgrade mode based on BSDiff algorithm, which only downloads and merges the difference data between the old and new firmware versions. Compared with full upgrade, this significantly reduces the amount of data transmitted in the upgrade package and reduces the network bandwidth usage. At the same time, the upgrade package download adopts a segmented method, and the segment size can be dynamically adjusted according to the real-time network bandwidth. Combined with intelligent retry and breakpoint resume mechanism, it avoids repeated downloads after network interruption, further reducing the waste of network resources. The upgrade process also makes more reasonable use of hardware resources such as device memory and storage.
[0040] 3. The upgrade system consists of a cloud-based upgrade management platform and a device-side upgrade module. The cloud platform enables centralized management of upgrade tasks, versions, and strategies, while the device-side platform integrates a multi-functional module to perform localized upgrades. The cloud and device-side work together to facilitate firmware upgrade management for large-scale IoT devices. The device-side upgrade module is integrated into the OtterThings framework and can be directly embedded into various embedded IoT devices, supporting device types in multiple fields such as smart homes, industrial IoT, and smart cities. At the same time, the system can adapt to various IoT communication protocols such as cellular networks and short-range IoT communication protocols, and adjust upgrade strategies according to the network characteristics of different protocols, thus meeting the diverse communication and application needs of IoT devices. Attached Figure Description
[0041] Figure 1 This is an adaptive upgrade system architecture diagram according to an embodiment of this application.
[0042] Figure 2 This is a flowchart illustrating the upgrade strategy decision-making process in an embodiment of this application.
[0043] Figure 3 This is a schematic diagram of differential upgrade and breakpoint resume in an embodiment of this application.
[0044] Figure 4 This is a schematic diagram of the device status and network environment perception module in an embodiment of this application. Detailed Implementation
[0045] The following is in conjunction with the appendix Figure 1-4 This application will be described in further detail.
[0046] This application provides an embedded firmware adaptive upgrade system based on device status and network environment. It includes a cloud-based upgrade management platform and a device-side upgrade module. The two establish a bidirectional network communication connection via a standard IoT communication protocol. The cloud platform centrally manages upgrade tasks and summarizes results, while the device-side platform performs localized status awareness, policy decision-making, and upgrade execution. The device-side upgrade module is integrated into the firmware of the embedded IoT device. Through the collaborative work of the cloud and the device, it achieves full-dimensional awareness of device status and network environment, and dynamically adjusts the firmware upgrade strategy based on a preset strategy model. This solves the problems of high resource consumption, low success rate, and impact on normal device operation associated with existing IoT device firmware upgrades.
[0047] The cloud-based upgrade management platform serves as the core for initiating and managing upgrade tasks. It manages firmware versions, stores old and new firmware versions and differential upgrade packages for IoT devices, and performs firmware version iteration and maintenance. It also issues upgrade tasks, sending targeted upgrade instructions or batch upgrade tasks to specified IoT devices based on device model and version. Furthermore, it configures preset strategy models, allowing for personalized upgrade strategy thresholds (such as power thresholds, CPU load thresholds, and network signal strength thresholds) and decision rules based on device type and application scenario, synchronizing these to all devices. Finally, it collects upgrade results and logs, receiving upgrade success / failure results reported by devices, as well as full log information during the upgrade process (such as sensing data, download progress, verification results, and installation status), enabling centralized operation and maintenance for large-scale device upgrades.
[0048] The device side further includes a device status monitoring module, a network sensing module, a differential upgrade engine, and an upgrade agent module.
[0049] The device status monitoring module is the hardware status acquisition unit on the device side. It adopts a real-time polling method to continuously acquire the core operating status information of the device. The acquisition dimensions include device power, memory usage, CPU load, and storage space remaining. The acquisition frequency can be preset according to the device type (e.g., once every 5 seconds for smart home devices and once every 2 seconds for industrial IoT devices). The acquired real-time data is transmitted to the upgrade agent module in real time as the hardware status basis for upgrade strategy decision-making. If the acquired data exceeds the preset threshold, an abnormal status reminder is immediately sent to the upgrade agent module.
[0050] The network sensing module is a network environment detection unit on the device side. It works in conjunction with the device's network communication unit to detect the device's network connection status in real time. The detection dimensions include network signal strength, available bandwidth, network latency, network packet loss rate, and network type (such as Wi-Fi, cellular network, Bluetooth, etc.). The detection data is transmitted to the upgrade agent module in real time as the network environment basis for upgrade strategy decisions. At the same time, it can detect changes in network status in real time (such as network interruption, sudden drop in bandwidth) and synchronize the change information to the upgrade agent module to trigger dynamic adjustments to the upgrade strategy.
[0051] The differential upgrade engine is built on the BSDiff algorithm and can also use similar firmware difference calculation algorithms. It is the core unit for implementing differential upgrades. Its core functions include: receiving instructions from the upgrade agent module and selecting to download a full upgrade package or a differential upgrade package; after downloading the differential upgrade package, merging it with the old firmware version on the device to generate a complete new firmware version; after merging, performing a preliminary integrity check on the new firmware, and sending an installable signal to the upgrade agent module after the check passes.
[0052] The upgrade agent module is integrated into the OtterThings IoT device firmware framework and is the core control unit on the device side. As the communication hub between various sub-modules and the cloud, it mainly performs the following functions: receiving upgrade commands issued by the cloud and initiating the upgrade preprocessing process; receiving real-time data collected by the device status monitoring module and network sensing module, and calling the preset strategy model to complete the dynamic decision-making of the upgrade strategy; scheduling the differential upgrade engine to execute the download and merging of upgrade packages, and controlling the firmware installation, restart and rollback process; after the upgrade process is completed, encapsulating the upgrade results and log information and reporting them to the cloud upgrade management platform.
[0053] This application also provides an embedded firmware adaptive upgrade method based on device status and network environment. This upgrade method is implemented based on the aforementioned system, and its overall execution flow includes five core steps: upgrade task triggering, status and environment awareness, upgrade strategy decision-making, adaptive upgrade execution, and upgrade result reporting. Specifically:
[0054] S1. The cloud-based upgrade management platform sends upgrade tasks to the network-connected embedded IoT devices based on the device's firmware version. The upgrade command includes core information such as device model, target firmware version, and upgrade package address. The upgrade agent module on the device side receives the upgrade command through the network communication unit, parses and verifies the command, and starts the upgrade preprocessing process after the verification is successful. It initializes the upgrade log and records basic information such as upgrade start time and target version.
[0055] S2. After the upgrade agent module starts the preprocessing process, it immediately sends a data collection command to the device status monitoring module and the network sensing module, triggering real-time data collection and synchronization of the two modules:
[0056] 1) The device status monitoring module collects hardware status information such as device power, memory usage, CPU load, and storage space remaining at a preset frequency. After removing invalid data, the valid data is encapsulated and transmitted to the upgrade agent module.
[0057] 2) The network sensing module detects network environment information such as network signal strength, available bandwidth, network latency, network packet loss rate, and network type in real time, analyzes the network data in real time, determines the network stability level, and synchronizes the detection results and stability level to the upgrade agent module.
[0058] 3) If the device is offline or the hardware status collection is abnormal, the upgrade agent module will immediately terminate the current sensing process, record the abnormal status information to the upgrade log, and report the upgrade pending status to the cloud. The sensing process will be retried after the device returns to normal.
[0059] S3. After receiving the collected data from the two main modules, the upgrade agent module calls the locally preset strategy model and performs multi-dimensional judgment based on device status information and network environment information to dynamically select the corresponding upgrade strategy. The upgrade strategy includes at least one of the following: upgrade mode, download time period, retry mechanism, and breakpoint resume strategy.
[0060] 1) Upgrade Timing Judgment: If the device battery level is lower than the preset threshold (e.g., smart home device battery level < 20%) or the CPU load is higher than the preset threshold (e.g., CPU load > 80%), the upgrade agent module will add the upgrade task to the waiting queue, pause the upgrade process, continuously monitor the device status, and restart the strategy decision after the device status returns to the preset normal range; if the device status meets the upgrade requirements, proceed to the next upgrade mode selection.
[0061] 2) Upgrade Mode Selection: Upgrade modes include full upgrade mode and differential upgrade mode. The differential upgrade mode only downloads the difference data between the old and new firmware versions, and the differential upgrade engine completes the difference merging. If the device is on a Wi-Fi network with high signal strength and sufficient bandwidth, the full upgrade mode is selected to improve upgrade efficiency. If the device is on a cellular network with signal strength below the preset threshold, or with low network bandwidth and high packet loss rate, the device will automatically switch to differential upgrade mode to reduce data transmission volume.
[0062] 3) Download and Retry Strategy Configuration: The upgrade agent module configures the chunk size and number of download retries based on the available network bandwidth and stability. When the network bandwidth is high and the stability is good, the chunk size is increased (e.g., 10MB / chunk) and the number of retries is reduced (e.g., 3 times). When the network bandwidth is low and the stability is poor, the chunk size is decreased (e.g., 1MB / chunk) and the number of retries is increased (e.g., 5 times). At the same time, the breakpoint resume strategy is enabled, and the breakpoint recording rules and resume triggering conditions of the upgrade package are agreed upon.
[0063] 4) Installation time period determination: Regardless of the upgrade mode selected, the device idle time period is determined as the firmware installation time period. The idle time period is defined as the time period when the device CPU load is lower than the preset threshold and there are no user operation commands, to ensure that the installation process does not affect the normal use of the device.
[0064] S4. After the upgrade agent module completes the strategy decision, it executes the firmware upgrade process according to the selected upgrade strategy. The core processes include upgrade package download, integrity verification, firmware installation, device restart, and rollback in case of anomalies. Specifically, this includes:
[0065] 1) Upgrade Package Download: The upgrade agent module initiates an upgrade package download request to the cloud-based upgrade management platform according to the selected upgrade mode. The differential upgrade engine is responsible for receiving the upgrade package data. A chunked download method is used, dividing the upgrade package into several data chunks according to a preset chunk size and downloading them one by one. During the download process, if the network is interrupted, the breakpoint resume strategy is immediately triggered, recording the chunk number and position of the currently downloaded chunk and terminating the download. After the network is restored, the download of the incomplete chunks resumes from the breakpoint position, without needing to re-download the full data. During the download process, the network awareness module continuously monitors the network status. If the bandwidth or stability changes, the upgrade agent module dynamically adjusts the chunk size to adapt to the network environment.
[0066] 2) Integrity Verification: After the upgrade package is downloaded, the upgrade agent module performs a hash integrity verification on the full upgrade package or the merged complete new firmware, and compares the verification value with the standard verification value provided by the cloud. If the verification matches, it is determined that the upgrade package is not damaged or missing, and the firmware installation process begins. If the verification does not match, it is determined that the upgrade package is abnormal, and it is re-downloaded according to the preset retry mechanism. After the number of retries reaches the limit, the upgrade process is terminated and the upgrade failure is reported to the cloud.
[0067] 3) Silent Firmware Installation: After the upgrade package is verified, the upgrade agent module detects the current status of the device and waits for the device to enter an idle period before starting the silent firmware installation process. During the installation process, non-core user operation commands are blocked and non-core functions of the device are turned off to ensure sufficient installation resources. The progress of the installation process is recorded in the upgrade log in real time. If any abnormal situation such as installation lag or error occurs, the installation will be terminated immediately.
[0068] 4) Abnormal Rollback and Normal Reboot: If an abnormality occurs during firmware installation or the device fails self-test after installation, the upgrade agent module immediately initiates the rollback mechanism, automatically deleting the incomplete firmware files and restoring the device to the previous working firmware version to ensure that the device has no functional abnormalities; if the firmware installation is complete and the device self-test passes, the upgrade agent module controls the device to perform a soft reboot to load and activate the new firmware; during the reboot process, information such as reboot time and reboot status is recorded.
[0069] S5. After the device restarts, if the new firmware runs normally, the upgrade agent module determines that the upgrade is successful; if the device malfunctions or reverts to the old firmware version after restarting, the upgrade is determined to have failed. Regardless of whether the upgrade is successful or failed, the upgrade agent module encapsulates the upgrade result (success / failure) and the core upgrade logs (sensing data, policy decision results, download progress, verification results, installation / restart status) into a reporting data packet and uploads it to the cloud upgrade management platform through the network communication unit. After receiving the data, the cloud updates the upgrade status of the device to the version management system, completing the upgrade process.
[0070] To more clearly illustrate the technical solution of the present invention, the following uses a smart coffee machine as an example to describe in detail the actual application of the upgrade method and system of the embodiments of this application. The smart coffee machine is an embedded Internet of Things device that integrates the OtterThings framework and supports dual-mode communication of Wi-Fi and cellular networks. The preset upgrade strategy thresholds are: battery power ≥ 50%, CPU load ≤ 60%, and Wi-Fi signal strength ≥ -60dBm.
[0071] A1. Upgrade Task Triggered: The cloud-based upgrade management platform detects that the firmware of the smart coffee machine is an old version and sends an upgrade command to it. The command includes the target firmware version, the address of the full upgrade package and the address of the differential upgrade package. The upgrade agent module of the coffee machine receives and parses the command and starts the upgrade preprocessing process.
[0072] A2. Status and Environment Awareness: The upgraded agent module triggers a data collection command, and the device status monitoring module collects data showing that the coffee machine's current battery level is 90%, CPU load is 15%, and storage space is sufficient, meeting the hardware upgrade requirements; the network awareness module detects that the coffee machine is currently connected to Wi-Fi, with a signal strength of -50dBm, available bandwidth of 100Mbps, and packet loss rate of 0, indicating a high-quality network environment.
[0073] A3. Upgrade Strategy Decision: Based on the collected data, the upgrade agent module was determined to meet the high-quality standards for both device status and network environment. Therefore, a full upgrade mode was selected, with a fragment size of 8MB / fragment, 3 retries, and a breakpoint resume strategy enabled. The idle period was determined to be from 23:00 to 6:00 the next day (the normal period when there is no user operation on the coffee machine).
[0074] A4. Adaptive Upgrade Execution: The upgrade agent module initiates a full upgrade package download request according to the strategy. The differential upgrade engine uses 8MB chunks for downloading. The network status is stable and there are no interruptions during the download process. After the download is completed, the hash verification is consistent. At 23:00 at night, the coffee machine enters the idle period. The upgrade agent module starts the silent installation process. There are no abnormalities during the installation process. After the installation is completed, the coffee machine passes the self-test, automatically soft restarts, and the new firmware is loaded and takes effect.
[0075] A5. Upgrade Result Reporting: After the coffee machine restarts, the new firmware runs normally. The upgrade agent module reports the successful upgrade result, along with the perception data, policy decisions, and download / installation / restart logs of this upgrade, to the cloud. The cloud then updates the firmware version of the coffee machine, completing the upgrade.
[0076] The embedded firmware adaptive upgrade system of this invention adopts a modular design. The device-side upgrade module can be directly embedded into the firmware of various embedded IoT devices without modifying the device hardware. It is compatible with device types in multiple fields such as smart home (smart appliances, smart sensors), industrial IoT (industrial controllers, industrial sensors), and smart city (street light controllers, environmental monitoring equipment). At the same time, the system supports IoT standard communication protocols such as cellular network protocols, short-range IoT communication protocols, and low-power wide-area network protocols. The network sensing module can detect the current communication protocol type of the device and the network characteristics of the corresponding protocol. The upgrade agent module dynamically adjusts the upgrade strategy according to the network characteristics of different protocols (such as low bandwidth of low-power wide-area network and stable signal of short-range protocol), realizing adaptive upgrades under multiple protocols. It has strong scalability and practical application value.
[0077] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. An embedded firmware adaptive upgrade method based on device status and network environment, characterized in that, Includes the following steps: S1. The cloud server sends upgrade tasks to the networked embedded IoT devices, and the devices receive the upgrade instructions from the cloud. S2. The device collects its own device status information in real time, and also collects information about the network environment in which the device is located. S3. The device dynamically selects the corresponding upgrade strategy based on the preset strategy model and the collected device status information and network environment information. The upgrade strategy includes at least one of the following: upgrade mode, download time period, retry mechanism, and breakpoint resume strategy. S4. The device executes the upgrade process sequentially according to the selected upgrade strategy, including downloading the upgrade package, verifying the integrity of the upgrade package, installing the firmware, and restarting the device. S5. After the device completes the upgrade process, it will report the upgrade results and log information during the upgrade process to the cloud server.
2. The embedded firmware adaptive upgrade method based on device status and network environment according to claim 1, characterized in that: In step S2, the device status information includes at least one of the following: device battery level, memory usage, CPU load, and remaining storage space. The network environment information includes at least one of network signal strength, available bandwidth, network latency, and network packet loss rate.
3. The embedded firmware adaptive upgrade method based on device status and network environment according to claim 1, characterized in that: In step S3, the upgrade mode includes a full upgrade mode and a differential upgrade mode. The differential upgrade mode only downloads the difference data between the old and new firmware versions. The differential upgrade mode calculates and merges firmware difference data based on the BSDiff algorithm or similar difference calculation algorithms.
4. The embedded firmware adaptive upgrade method based on device status and network environment according to claim 1, characterized in that, In step S3, the dynamic selection of the corresponding upgrade strategy includes: When the device's battery level is below a preset threshold or the CPU load is above a preset threshold, the upgrade task is postponed until the device meets the preset operating conditions. When the device is on a cellular network and the signal strength is below a preset signal strength threshold, it will automatically switch to differential upgrade mode.
5. The embedded firmware adaptive upgrade method based on device status and network environment according to claim 1, characterized in that: In step S4, the firmware is silently installed during idle periods when the CPU load on the device is below a preset threshold and there are no user operation commands. If the firmware installation or upgrade package verification fails, the device will initiate a rollback mechanism to automatically restore to the previous working firmware version.
6. The embedded firmware adaptive upgrade method based on device status and network environment according to claim 1, characterized in that: In step S4, the upgrade package download adopts a segmented download method and supports breakpoint resumption. The device can dynamically adjust the size of the segments according to the real-time network environment information. When the network bandwidth is low, the segment size is reduced, and when the network bandwidth is high, the segment size is increased. The retry mechanism refers to the device dynamically adjusting the number of retries for downloading the upgrade package based on network stability.
7. The embedded firmware adaptive upgrade method based on device status and network environment according to any one of claims 1-6, characterized in that: The embedded IoT device includes at least one of smart home devices, industrial IoT devices, and smart city devices.
8. An embedded firmware adaptive upgrade system based on device status and network environment, characterized in that: The system for implementing the upgrade method according to any one of claims 1-6 includes a cloud-based upgrade management platform and a device-side upgrade module, which are connected via network communication. The cloud-based upgrade management platform is used for upgrade task distribution, firmware version management, upgrade preset strategy model configuration, device upgrade results and log collection. The device-side upgrade module is integrated into the embedded IoT device and is used for device status and network environment perception, upgrade strategy decision-making, adaptive upgrade process execution, and upgrade result reporting.
9. The embedded firmware adaptive upgrade system based on device status and network environment according to claim 8, characterized in that, The device-side upgrade module includes: The device status monitoring module is used to collect device status information in real time, such as device power consumption, memory usage, CPU load, and storage space remaining. The network sensing module is used to detect network environment information in real time, such as network signal strength, available bandwidth, network latency, network packet loss rate, and network type. The differential upgrade engine, built on the BSDiff algorithm or similar difference calculation algorithms, is used to calculate, download, and merge the difference data between the old and new firmware versions. The upgrade agent module, integrated into the OtterThings framework, is used to receive upgrade instructions, execute upgrade strategy decisions, schedule upgrade processes, and report upgrade results.
10. The embedded firmware adaptive upgrade system based on device status and network environment according to claim 8, characterized in that: The system supports cellular network protocols and is also compatible with IoT standard communication protocols such as short-range IoT communication protocols and low-power wide-area network protocols. The network sensing module can detect the current communication protocol type of the device and the network characteristics of the corresponding protocol. The upgrade proxy module invokes the differential upgrade engine, dynamically adjusts the fragment size and retry mechanism according to the network characteristics of different protocols, and implements an adaptive upgrade strategy under the corresponding protocol.