Firmware upgrade system and method for embedded device, storage medium and embedded device

By establishing a data transmission link between the host computer and multi-level control modules in the embedded device, and distributing firmware upgrade data step by step with a rollback mechanism, the problems of lengthy upgrade links and uncontrollable states in distributed systems are solved, thus achieving safe and reliable firmware upgrades.

CN122285033APending Publication Date: 2026-06-26SUZHOU SHIRUIZHUO TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUZHOU SHIRUIZHUO TECHNOLOGY CO LTD
Filing Date
2026-01-15
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing firmware upgrade methods for embedded systems have lengthy and uncontrollable upgrade links in distributed systems, which are prone to upgrade failure or version inconsistency due to transmission interruptions.

Method used

A data transmission link is established between a main control host computer and multiple levels of control modules. A wired or wireless data transmission link is established between every two adjacent levels of control modules. The main control host computer sends firmware upgrade data down level by level, and the target control module performs firmware upgrade. A rollback mechanism and a data verification mechanism are set up during the upgrade process.

Benefits of technology

It enables firmware distribution across communication links without changing the original topology of embedded devices, ensuring safe and reliable upgrades for multi-module embedded devices and avoiding problems caused by transmission interruptions and version inconsistencies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122285033A_ABST
    Figure CN122285033A_ABST
Patent Text Reader

Abstract

This application discloses a firmware upgrade system, method, storage medium, and embedded device for embedded devices. The firmware upgrade system includes a main control computer and multiple levels of control modules. The main control computer establishes a data transmission link with the first-level control module, and wired or wireless data transmission links are established between every two adjacent control modules. In response to a firmware upgrade request, the main control computer determines the target control module to be upgraded and distributes the firmware upgrade data level by level along the data transmission links from the main control computer to the target control module, enabling the target control module to perform a firmware upgrade based on the upgrade data. This system can achieve unified upgrades of control modules at all levels in a hybrid topology or independent upgrades of control modules at each level. Its topology and firmware distribution method can flexibly adapt to the firmware upgrade needs of various embedded devices, ensuring safe and reliable upgrades for embedded devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of firmware upgrade technology, and in particular to a firmware upgrade system, method, storage medium, and embedded device for embedded devices. Background Technology

[0002] With the trend of intelligent development in embedded systems, modern devices often need to integrate multiple functional control units and various communication modules to meet diverse functional requirements. The communication links between these modules are diverse, typically covering multiple wired and wireless communication protocols to build a complex distributed system architecture. Under this architecture, unified upgrades of numerous modules become a key link in ensuring stable device operation.

[0003] Currently, for firmware upgrades of embedded systems, existing OTA (Over-the-Air) solutions mostly adopt a single-node, single-link approach. That is, a separate upgrade link is established for each independent module, and the firmware update data is transmitted to the corresponding module through this link to complete the upgrade operation. This firmware upgrade method can meet basic upgrade requirements in simple system architectures.

[0004] However, in distributed systems, especially those with complex structures such as a main control unit, multiple sub-functional control units, and wireless base stations, traditional firmware upgrade methods result in lengthy and uncontrollable upgrade links, which are prone to failure due to transmission interruptions or version inconsistencies. Summary of the Invention

[0005] In view of this, the embodiments of this application provide a firmware upgrade system, method, storage medium and embedded device for embedded devices. The main purpose is to solve the technical problems of the firmware upgrade method of embedded devices having a long upgrade link and uncontrollable status, which is prone to upgrade failure or version inconsistency due to transmission interruption.

[0006] According to one aspect of this application, a firmware upgrade system for an embedded device is provided, the system comprising a main control host computer and multiple levels of control modules, wherein... The host computer establishes a data transmission link with the first-level control module, and a wired or wireless data transmission link is established between every two adjacent control modules. The host computer is used to respond to a firmware upgrade request, determine the target control module to be upgraded, and send the firmware upgrade data step by step along the data transmission link between the host computer and the target control module, so that the target control module can perform a firmware upgrade based on the firmware upgrade data.

[0007] Optionally, the host computer stores the firmware upgrade data and the firmware upgrade strategy file. The host computer is used to respond to the firmware upgrade request and, based on the firmware upgrade strategy file, determine the target control module to be upgraded and the corresponding firmware upgrade data of the target control module.

[0008] Optionally, when there are multiple target control modules, the host computer is further configured to determine the upgrade order of the target control modules based on the firmware upgrade strategy file, and sequentially distribute the firmware upgrade data along the data transmission link between the host computer and each target control module according to the upgrade order, so that each target control module performs firmware upgrade sequentially based on the firmware upgrade data.

[0009] Optionally, when the host computer sends the firmware upgrade data down level by level, the working mode of all control modules on the data transmission link, except for the target control module, is switched to data pass-through mode.

[0010] Optionally, when the target control module detects a firmware upgrade failure or a firmware upgrade data verification failure, it restores the firmware to the original version based on the rollback flag stored in the target control module.

[0011] Optionally, if adjacent control modules establish a data transmission link through a wireless communication module, the control module switches the operating mode of the wireless communication module to a fixed-frequency mode when transmitting the firmware upgrade data through the wireless communication module.

[0012] Optionally, if the target control module to be upgraded is connected to an external storage module, the target control module is used to store the received firmware upgrade data in the external storage module, verify the stored firmware upgrade data, and perform firmware upgrade based on the firmware upgrade data after successful verification.

[0013] Optionally, if the target control module to be upgraded is also connected to at least one peripheral function module to be upgraded, the target control module is further used to trigger the peripheral function module to be upgraded to perform a firmware upgrade based on the successfully verified firmware upgrade data.

[0014] Optionally, if the target control module to be upgraded is connected to an external storage module, the target control module is further configured to record the transmission progress of the firmware upgrade data when an interruption in firmware upgrade data transmission is detected, and to receive and store the remaining firmware upgrade data based on the transmission progress when the firmware upgrade data transmission resumes.

[0015] Optionally, the multiple levels of control modules include a main control module, at least one sub-control module, and at least one peripheral control module; the main control host computer establishes a data transmission link with the main control module through a first serial bus; the main control module establishes a data transmission link with each of the sub-control modules through a second serial bus; and the communication sub-control module in the sub-control module establishes a data transmission link with the peripheral control module through a wireless communication module.

[0016] Optionally, the embedded device to be upgraded includes a mobile device and a corresponding communication device, wherein the main control host computer, the main control module and each of the sub-control modules are disposed in the mobile device, and the peripheral control module is disposed in the communication device.

[0017] According to another aspect of this application, a firmware upgrade method for an embedded device is provided. The method is applied to an embedded device including a main control host computer and multiple levels of control modules. The main control host computer establishes a data transmission link with the first-level control module, and a wired or wireless data transmission link is established between every two adjacent control modules. The method includes: The host computer responds to the firmware upgrade request and determines the target control module to be upgraded. The host computer sends firmware upgrade data step by step along the data transmission link between the host computer and the target control module. The target control module performs a firmware upgrade based on the received firmware upgrade data.

[0018] Optionally, the host computer stores the firmware upgrade data and firmware upgrade strategy file; then, in response to the firmware upgrade request, the host computer determines the target control module to be upgraded, including: in response to the firmware upgrade request, the host computer determines the target control module to be upgraded and the firmware upgrade data corresponding to the target control module based on the firmware upgrade strategy file.

[0019] Optionally, the method further includes: when there are multiple target control modules, the host computer determines the upgrade order of the target control modules based on the firmware upgrade strategy file; the host computer sequentially sends the firmware upgrade data along the data transmission link between the host computer and each target control module according to the upgrade order; and each target control module sequentially performs firmware upgrade based on the firmware upgrade data.

[0020] Optionally, the host computer sends firmware upgrade data step by step along the data transmission link between the host computer and the target control module, including: when the host computer sends the firmware upgrade data step by step, other control modules on the data transmission link, except for the target control module, switch their working mode to data pass-through mode.

[0021] Optionally, the method further includes: when the target control module detects a firmware upgrade failure or a firmware upgrade data verification failure, it restores the firmware to the original version based on a rollback flag stored in the target control module.

[0022] Optionally, if adjacent control modules establish a data transmission link through a wireless communication module, the method further includes: when the control module transmits the firmware upgrade data through the wireless communication module, the operating mode of the wireless communication module is switched to a fixed frequency mode.

[0023] Optionally, if the target control module to be upgraded is connected to an external storage module, the target control module performs a firmware upgrade based on the received firmware upgrade data, including: the target control module stores the received firmware upgrade data in the external storage module, verifies the stored firmware upgrade data, and performs a firmware upgrade based on the firmware upgrade data after successful verification.

[0024] Optionally, if the target control module to be upgraded is also connected to at least one peripheral function module to be upgraded, the target control module performs a firmware upgrade based on the received firmware upgrade data, and the upgrade further includes: the target control module triggers the peripheral function module to be upgraded to perform a firmware upgrade based on the successfully verified firmware upgrade data.

[0025] Optionally, if the target control module to be upgraded is connected to an external storage module, before the target control module performs a firmware upgrade based on the received firmware upgrade data, the method further includes: when the target control module detects an interruption in the firmware upgrade data transmission, recording the transmission progress of the firmware upgrade data, and when the firmware upgrade data transmission resumes, receiving and storing the remaining firmware upgrade data based on the transmission progress.

[0026] Optionally, the multiple levels of control modules include a main control module, at least one sub-control module, and at least one peripheral control module, wherein the main control host computer establishes a data transmission link with the main control module through a first serial bus; the main control module establishes a data transmission link with each of the sub-control modules through a second serial bus; and the communication sub-control module in the sub-control module establishes a data transmission link with the peripheral control module through a wireless communication module.

[0027] Optionally, the embedded device includes a mobile device and a communication device corresponding to the mobile device, wherein the main control host computer, the main control module and each of the sub-control modules are disposed in the mobile device, and the peripheral control module is disposed in the communication device.

[0028] According to another aspect of this application, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the firmware upgrade method of the aforementioned embedded device.

[0029] According to another aspect of this application, an embedded device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the firmware upgrade method of the embedded device described above.

[0030] By employing the above technical solutions, embodiments of this application provide a firmware upgrade system, method, storage medium, and embedded device for embedded devices. The firmware upgrade system can be deployed in an embedded device with multiple control modules. A data transmission link is established between the host computer and the first-level control module in the embedded device. A wired or wireless data transmission link is established between every two adjacent control modules. During firmware upgrades, the host computer can distribute firmware upgrade data step-by-step along the data transmission link from the host computer to each target control module to be upgraded, enabling each target control module to perform a firmware upgrade based on the received firmware upgrade data. The firmware upgrade system can establish data transmission links between the host computer and each level of control modules through various communication methods without changing the original topology of the embedded device. This allows for firmware distribution across communication links within the embedded device and enables unified upgrades or independent upgrades of control modules at each level in a hybrid topology. The aforementioned topology and firmware distribution method can flexibly adapt to the firmware upgrade needs of various embedded devices and ensure safe and reliable upgrades for multi-module embedded devices.

[0031] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0032] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1This paper shows a schematic diagram of the structure of a firmware upgrade system for an embedded device provided in an embodiment of this application; Figure 2 This illustration shows a structural diagram of a firmware upgrade system for a scenario where the embedded device is a mobile device, according to an embodiment of this application. Figure 3 A schematic diagram of a data transmission link for a mobile device provided in an embodiment of this application is shown; Figure 4 This illustration shows a data transmission link diagram for another mobile device provided in an embodiment of this application; Figure 5 This paper illustrates a flowchart of a firmware upgrade method for an embedded device provided in an embodiment of this application. Detailed Implementation

[0033] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.

[0034] Currently, embedded devices are constantly evolving towards intelligence. Within these devices, multiple microcontroller units (MCUs) and various communication modules are often integrated. These modules can communicate with each other through various wired and wireless communication protocols such as RS485, Controller Area Network (CAN), Universal Asynchronous Receiver / Transmitter (UART), and Long Range Radio (LoRa) to build a complex distributed system architecture. Under this architecture, achieving unified firmware upgrades across nodes and links is highly complex. Existing Over-The-Air (OTA) solutions are mostly limited to single-node, single-link upgrade modes, making it difficult to adapt to the needs of multi-module cascaded upgrades in distributed systems. Especially when the system includes a main control MCU, multiple sub-MCUs, and a wireless base station, the upgrade path is often lengthy, status monitoring is difficult, and transmission interruptions or version inconsistencies are easily caused. Particularly in wireless transmission environments, unified firmware upgrades place higher demands on system stability, data integrity, and security.

[0035] To address the above problems, in one embodiment, such as Figure 1As shown, a firmware upgrade system for an embedded device is provided. This system includes a main control host computer 10 and multiple levels of control modules 20. The multiple levels of control modules 20 may include a first-level control module 21, a second-level control module 22, a third-level control module 23, and so on. In terms of connectivity, the main control host computer 10 establishes a data transmission link with the first-level control module 21, and a wired or wireless data transmission link is established between every two adjacent control modules. For example, the first-level control module 21 establishes a wired or wireless data transmission link with the second-level control module 22, and the second-level control module 22 establishes a wired or wireless data transmission link with the third-level control module 23. The main control host computer 10 can respond to a firmware upgrade request, determine the target control module to be upgraded, and distribute firmware upgrade data step-by-step along the data transmission link from the main control host computer 10 to the target control module, so that the target control module can perform a firmware upgrade based on the firmware upgrade data. In this embodiment, the target control module to be upgraded can be a single control module at a certain level, multiple control modules distributed across one or more levels in the embedded device, or all control modules in the embedded device. It is understood that the number and type of the target control modules can be determined based on actual upgrade requirements, and this embodiment does not impose specific limitations.

[0036] In this context, the host computer refers to the top-level computer system within the embedded device that initiates the firmware upgrade task, such as the host Linux system. The control module refers to the hardware unit within the embedded device that performs specific control functions, such as a microcontroller unit. Multiple levels of control modules can include the host microcontroller unit as a first-level node, various sub-microcontroller units as second-level nodes, and independent base station modules as remote nodes. The data transmission link refers to the wired or wireless communication connection channel used for data transmission, such as a wired RS485 serial bus, a controller area network bus, a universal asynchronous transceiver interface, or a wireless long-distance radio link. Firmware upgrade data refers to a data packet containing the new version of executable program code; the target control module refers to one or more specific control modules selected for firmware updates in an upgrade task.

[0037] In this embodiment, the host computer, acting as the firmware upgrade task initiator, can connect to the first-level control module via a wired or wireless link. The first-level control module can connect to multiple second-level control modules via wired or wireless links, and one or more second-level control modules can connect to peripheral third-level control modules via wired or wireless links. When the host computer responds to a firmware upgrade request, it first needs to determine the target control module to be upgraded. If the target control module is a single or partial control module at a specific level, the host computer can send the firmware upgrade data corresponding to the target control module level by level through the link between the host computer and the target control module. Subsequently, the firmware upgrade data will be received by the target control module and the upgrade will be performed. If the target is all control modules in the embedded device, the host computer will, according to the set strategy, the level of each control module and / or the pre-set upgrade order, send the firmware upgrade data of each control module level by level along the link. In this implementation, after each target control module is upgraded, the upgrade status will be uploaded to the main control host computer level by level, so that the main control host computer can synchronize the upgrade status of each target control module in real time.

[0038] For example, suppose the embedded device is as follows: Figure 2 For mobile devices such as the smart lawnmower shown, when only a software defect needs to be fixed in the side-cutting motor microcontroller unit located in the second level, the main control Linux system can send the firmware upgrade data for the side-cutting motor microcontroller unit to the side-cutting motor microcontroller unit via the first-level main control microcontroller unit and the RS485 bus. Other motor modules do not participate in this upgrade. However, when all modules in the device need to be upgraded, the system will sequentially upgrade the first-level main control microcontroller unit and the second-level steering motor microcontroller unit, front wheel motor microcontroller unit, and other control modules. Finally, the firmware upgrade data will be transmitted wirelessly to the third-level base station module via the second-level mobile station microcontroller unit for firmware upgrade.

[0039] The aforementioned firmware upgrade system can be deployed in embedded devices with multiple control modules. The host computer in this embedded device establishes a data transmission link with the first-level control module, and wired or wireless data transmission links are established between every two adjacent control modules. During firmware upgrades, the host computer can distribute firmware upgrade data level by level along the data transmission links from the host computer to each target control module to be upgraded, enabling each target control module to perform a firmware upgrade based on the received data. This firmware upgrade system can establish data transmission links between the host computer and each level of control modules through various communication methods without changing the original topology of the embedded device. This allows for firmware distribution across communication links within the embedded device and enables unified upgrades or independent upgrades of control modules at each level in a hybrid topology. The aforementioned topology and firmware distribution method can flexibly adapt to the firmware upgrade needs of various embedded devices and ensure safe and reliable upgrades for multi-module embedded devices.

[0040] In one embodiment, the host computer stores firmware upgrade data and firmware upgrade strategy file. The host computer can be used to respond to a firmware upgrade request and, based on the firmware upgrade strategy file, determine the target control module to be upgraded and the corresponding firmware upgrade data of the target control module.

[0041] In this embodiment, the host computer internally stores multiple firmware upgrade data files and firmware upgrade strategy files for upgrading control modules at various levels. When the host computer responds to a firmware upgrade request from a user or a scheduled task, it first reads and parses the locally stored firmware upgrade strategy file. The firmware upgrade strategy file defines the upgrade logic for each level of control modules within the device. Based on this file, the host computer can analyze the identification of one or more target control modules that need to be upgraded in this task, extract the firmware upgrade data packet corresponding to the hardware model and software version of each identified target control module, and then distribute the firmware upgrade data step-by-step along the data transmission link between the host computer and the target control module, enabling the target control module to perform a firmware upgrade based on the firmware upgrade data.

[0042] For example, suppose we need to... Figure 2When the mobile device shown undergoes a large-scale upgrade, the main control Linux system first identifies the target control modules that need to be upgraded, including the main control microcontroller unit, the side-cutting motor microcontroller unit, and the remote base station module, based on the firmware upgrade policy file. Then, the main control Linux system can find the firmware upgrade data adapted to these three different modules from its multiple stored firmware upgrade data files, and then distribute the firmware upgrade data corresponding to each control module to the three control modules one by one according to the corresponding data link, so that the three control modules can perform firmware upgrades.

[0043] This embodiment integrates a firmware upgrade strategy file into the main control host computer and controls the main control host computer to automatically determine the target control module to be upgraded based on the firmware upgrade strategy file during the upgrade startup phase, and extracts and distributes the corresponding firmware upgrade data. This can ensure the accuracy and reliability of the subsequent upgrade process and avoid the risk of upgrade mismatch caused by human selection errors or chaotic version management.

[0044] In one embodiment, the host computer can also be used to determine the upgrade order of the target control modules based on the firmware upgrade strategy file when there are multiple target control modules, and to send the firmware upgrade data down level by level along the data transmission link between the host computer and each target control module in the order of upgrade, so that each target control module can upgrade its firmware in sequence based on the firmware upgrade data.

[0045] In this embodiment, when the host computer identifies that multiple target control modules need to be upgraded based on the firmware upgrade strategy file, it can further parse the configuration rules in the firmware upgrade strategy file regarding the upgrade order between the various control modules, and process each target control module one by one according to the pre-configured upgrade order. For example, for the first target control module in the upgrade order, the host computer can send the firmware upgrade data corresponding to the module through the established data transmission link, and after confirming that the module has been successfully upgraded, it will start the upgrade process for the next target control module in the upgrade order. This process is iterated until all target control modules have been processed, thereby completing the upgrade task for multiple control modules.

[0046] For example, suppose we need to... Figure 2The illustrated mobile device undergoes upgrades to multiple functional modules. The firmware upgrade strategy file specifies the upgrade order as follows: steering motor microcontroller unit, edge cutting motor microcontroller unit, and front wheel motor microcontroller unit. The main control Linux system first sends the corresponding firmware upgrade data to the steering motor microcontroller unit and waits for feedback after the upgrade is complete. Upon receiving feedback, the upgrade process for the edge cutting motor microcontroller unit is initiated, and finally, the front wheel motor microcontroller unit is upgraded, thus completing the safe and orderly upgrade of the three functional modules.

[0047] This embodiment performs sequential upgrades on multiple control modules based on the upgrade order configured in the firmware upgrade strategy file. This effectively avoids problems such as sudden changes in power load, communication bandwidth contention, or functional logic conflicts that may be caused by concurrent or out-of-order upgrades in a multi-node distributed system. As a result, it effectively ensures the smooth transition of the overall device status and the controllability of the device status during the upgrade.

[0048] In one embodiment, when the host computer sends firmware upgrade data step by step, the working mode of all control modules on the data transmission link, except for the target control module, is switched to data pass-through mode.

[0049] In this embodiment, when the host computer initiates the process of progressively distributing firmware upgrade data along the data transmission link, it sends a mode switching command to all intermediate control modules in the link except the target control module. Upon receiving the command, these intermediate control modules switch their operating mode from the conventional data processing mode to the data transparent transmission mode. In the data transparent transmission mode, the intermediate control modules can only receive, verify, and forward the received firmware upgrade data packets without parsing or executing the firmware update content, thus forming a transparent data transmission channel directly from the host computer to the target control module. Based on the above method, only the target control module at the end of the link will remain in firmware upgrade mode and be responsible for fully receiving the firmware upgrade data to perform its own firmware update operation.

[0050] For example, suppose we need to... Figure 2Upgrading the steering motor microcontroller unit of the illustrated mobile device involves the main Linux system first sending an upgrade command and firmware upgrade data to the main microcontroller unit via the RS485 bus. Upon receiving the upgrade command, the main microcontroller unit switches its operating mode to data pass-through mode and then forwards the firmware upgrade data packet to the steering motor microcontroller unit via the controller area network bus. The steering motor microcontroller unit, acting as the target control module, receives and executes the burning and updating of the firmware upgrade data to complete the firmware upgrade. During this process, the main microcontroller unit, acting as an intermediate control module, does not process the firmware content within the firmware upgrade data packet.

[0051] This embodiment switches the intermediate control module's operating mode to data pass-through mode during firmware upgrade data distribution, thus establishing a dedicated data pipeline from the main control computer to the target control module. This effectively avoids unnecessary parsing and processing overhead on the intermediate control module, thereby significantly improving data transmission efficiency, reducing the risk of interruptions to the upgrade process due to abnormal intermediate node states, and ensuring reliable transmission of firmware upgrade data to the target control module.

[0052] In one embodiment, when the target control module detects a firmware upgrade failure or a firmware upgrade data verification failure, it can restore the firmware to the original version based on the rollback flag stored in the target control module.

[0053] In this embodiment, if the target control module detects an upgrade failure such as a data verification error, program abnormality, or startup timeout during the writing, verification, or startup of the new firmware, it will automatically query the status of a preset rollback flag in its non-volatile memory. If the flag is set, indicating that the system allows or requires version recovery, the target control module will immediately suspend the current upgrade process and trigger an internal rollback procedure to safely erase the problematic firmware from its backup storage area and restore the system software to the original version that was running stably before the upgrade.

[0054] For example, suppose for such Figure 2 When the base station module of the mobile device shown is upgraded, if the base station module receives firmware upgrade data through a long-distance wireless communication link and upgrades the firmware of its own microcontroller unit, and an upgrade failure is detected after firmware burning, the microcontroller unit of the base station module can immediately check its rollback flag. If the rollback flag is valid, the old version of firmware is started in the backup partition, and then the rollback event is reported to the upper-level node through the wireless link. This ensures that the embedded device can quickly recover to a working and stable state after an unexpected interruption of the wireless upgrade.

[0055] This embodiment sets up an upgrade failure detection function in the target control module and enables the control module to trigger an automatic recovery mechanism for old firmware based on a rollback flag. This allows upgrade anomalies in a single control module to be quickly isolated and corrected, effectively preventing the risk of the entire device system being paralyzed due to a partial upgrade failure. This significantly improves the security of the over-the-air (OTA) upgrade process and the overall robustness of the system.

[0056] In one embodiment, if a data transmission link is established between adjacent control modules via a wireless communication module, the control module can switch the operating mode of the wireless communication module to a fixed-frequency mode when transmitting firmware upgrade data via the wireless communication module.

[0057] In this embodiment, when two adjacent control modules in an embedded device establish a data transmission link relying on a wireless communication module, the control module initiating the data transmission can send a working mode switching command to the wireless communication module it is connected to before starting the firmware upgrade data transmission process. This allows the wireless communication module to switch from the frequency-hopping working mode of conventional data communication to a fixed-frequency mode for transmission and reception on a fixed single frequency point. In the fixed-frequency mode, the two communicating parties can establish a point-to-point connection on a known stable frequency point and perform stable transmission of firmware upgrade data. After the data transmission task is completed and confirmed, the working mode of the wireless communication module will revert to the frequency-hopping working mode according to the command.

[0058] For example, when Figure 2 When the mobile station microcontroller unit in the illustrated mobile device sends firmware upgrade data to an independent base station module, the mobile station microcontroller unit first sends a working mode switching command to the wireless communication module it controls via a universal asynchronous transceiver interface (UART), causing the wireless communication module to enter fixed-frequency mode and lock onto the same communication frequency as the base station module's wireless communication module. Subsequently, the mobile station microcontroller unit sends the firmware upgrade data packet to the base station module via a stable wireless link. The base station module can receive the firmware upgrade data and temporarily store it in an external storage module.

[0059] This embodiment switches the operating mode of the wireless communication module from frequency hopping mode to fixed frequency mode when transmitting firmware upgrade data. This provides a stable wireless channel environment for the transmission of firmware upgrade data, thereby effectively avoiding problems such as instantaneous packet loss or connection instability caused by frequency hopping, and thus ensuring the data integrity of the wireless over-the-air download technology upgrade process.

[0060] In one embodiment, if the target control module to be upgraded is connected to an external storage module, the target control module can be used to store the received firmware upgrade data in the external storage module, verify the stored firmware upgrade data, and perform firmware upgrade based on the firmware upgrade data after successful verification.

[0061] In this embodiment, when the target control module to be upgraded is connected to an external storage module such as an external flash memory, a data buffering and verification step is added during the firmware upgrade process. That is, after receiving the firmware upgrade data, the target control module does not immediately perform the firmware update operation. Instead, it first writes the received firmware upgrade data to the external storage module for temporary storage. Subsequently, after all data has been received, it reads the stored firmware upgrade data from the external storage module and performs data integrity verification. For example, it calculates the cyclic redundancy check code or hash value of the firmware upgrade data and compares it with the expected value. Only after successful verification confirms that the data is complete and error-free does the target control module initiate the firmware upgrade process, read the data from the external storage module, and perform the firmware burning and update operations.

[0062] For example, in the case of Figure 2 When the base station module of the illustrated mobile device undergoes a firmware upgrade, the base station microcontroller unit (BMCU) in the BMCU first receives firmware upgrade data packets from the mobile station microcontroller unit (MSU) via a long-distance wireless communication link. These data packets are then continuously written to the external flash memory connected to the BMCU. After all data packets have been received and stored, the BMCU performs a cyclic redundancy check on the complete firmware image file in the external flash memory. Upon successful check, the BMCU loads the firmware upgrade data from the external flash memory into its internal program memory to complete the firmware upgrade. Simultaneously, the BMCU can further trigger upgrades to its connected peripherals, such as positioning modules. After the BMCU and its connected modules have completed their upgrades, according to the upgrade strategy, if an upgrade to the MSU and its connected modules is required, the MSU loads the upgrade firmware from the external flash memory and upgrades the MSU and its connected modules, such as positioning modules and wireless communication modules.

[0063] This embodiment utilizes an external storage module to pre-store firmware upgrade data, verifies the firmware upgrade data, and executes the upgrade process after successful verification. This effectively prevents the risk of firmware upgrade failure due to momentary errors or incomplete data during data transmission, thereby significantly improving the reliability and security of the firmware upgrade process, especially enhancing the reliability of firmware upgrades in wireless transmission mode.

[0064] In one embodiment, if the target control module to be upgraded is also connected to at least one peripheral function module to be upgraded, the target control module can also be used to trigger the peripheral function module to be upgraded to perform a firmware upgrade based on the successfully verified firmware upgrade data.

[0065] In this embodiment, when the target control module to be upgraded is also connected to at least one peripheral functional module that needs to be upgraded synchronously, the target control module can, after verifying the firmware upgrade data in the peripheral storage module, actively generate and send an upgrade trigger signal to itself and the peripheral functional module connected to it, according to predetermined logic or instructions. This allows the target control module and its connected peripheral functional modules to independently initiate their own firmware update processes. In this embodiment, when one or more peripheral functional modules connected to the target control module do not require updates, the target control module typically will not receive firmware upgrade data from the corresponding peripheral functional modules and will not trigger upgrades for such peripheral functional modules. It is understood that whether to upgrade the peripheral functional modules connected to the target control module can be determined based on the actual upgrade requirements of the embedded device, and this embodiment does not impose specific limitations on this.

[0066] For example, in the case of Figure 2 When the base station module of the illustrated mobile device undergoes a firmware upgrade, the base station microcontroller unit of the base station module, after verifying the data in the external flash memory of the base station, sends specific firmware upgrade commands to the positioning module and the wireless communication module directly connected to it via a universal asynchronous transceiver interface. Upon receiving the command, the positioning module and the wireless communication module can then read their respective firmware upgrade data from the external flash memory through the base station microcontroller unit and independently execute their internal firmware update operations, ultimately achieving a coordinated update of all functional components of the entire base station module.

[0067] This embodiment controls the target control module to actively trigger the peripheral function module connected to it to perform firmware upgrade after the firmware upgrade data verification is successful. This can realize the automated upgrade management of multiple related components within a complex device node, thereby avoiding the tedious operation and version inconsistency of upgrading peripheral modules individually or manually, ensuring version coordination between functional units and the integrity of the overall system function.

[0068] In one embodiment, if the target control module to be upgraded is connected to an external storage module, the target control module is further configured to record the transmission progress of the firmware upgrade data when an interruption in firmware upgrade data transmission is detected, and to receive and store the remaining firmware upgrade data based on the transmission progress when the firmware upgrade data transmission resumes.

[0069] In this embodiment, when the target control module to be upgraded is connected to an external storage module, it continuously monitors the link status during the process of receiving firmware upgrade data through the data transmission link. Once an unexpected interruption in data transmission is detected, such as loss of wireless signal or bus communication timeout, the target control module records the amount of data successfully received and written to the external storage module or the identifier of the last valid data packet as the transmission progress in its non-volatile memory. When the communication link is restored and data transmission resumes, the target control module first reads the saved transmission progress and sends a request to the superior control module accordingly. This request is passed up the chain to the host computer, requesting the host computer to send the remaining firmware upgrade data packets from the point of last interruption, rather than starting from the beginning. Subsequently, the target control module appends the remaining data packets received after the recovery to the corresponding location in the external storage module, thereby forming a complete firmware image file for subsequent verification and upgrade.

[0070] For example, in the case of Figure 2 When the base station module of the illustrated mobile device is undergoing firmware upgrades, if a temporary signal interruption causes the transmission to be interrupted while the base station module receives firmware upgrade data from the mobile station microcontroller unit via the wireless communication link, the base station microcontroller unit records the length of data already written to the base station's external flash memory as the data transmission progress. After the wireless signal is restored, the base station microcontroller unit reports this data transmission progress to the mobile station microcontroller unit. Subsequently, this progress is reported level by level to the host computer. The host computer sends the remaining firmware upgrade data packets from the point of last interruption. Then, the mobile station microcontroller unit forwards the received firmware upgrade data packets, and the base station module sequentially writes the received data packets after the existing data in the base station's external flash memory until the entire firmware file transmission is complete.

[0071] This embodiment records the transmission progress of firmware upgrade data in real time and resumes data transmission by reporting the transmission progress. This enables data interruption resumption when temporary communication failures occur during the firmware upgrade process, thereby effectively avoiding the waste of resources and time delay caused by retransmitting the entire firmware data packet due to communication interruption. This significantly improves the adaptability of the upgrade process to unstable communication environments.

[0072] In one embodiment, the multi-level control modules may include a main control module, at least one sub-control module, and at least one peripheral control module. The host computer can establish a data transmission link with the main control module via a first serial bus. The main control module can establish data transmission links with each sub-control module via a second serial bus. The communication sub-control module within the sub-control module can establish a data transmission link with the peripheral control module via a wireless communication module. The first serial bus, second serial bus, and wireless communication module can be designed according to the actual requirements of the embedded device. For example, the first serial bus can be an RS485 bus, the second serial bus can be a controller area network bus or a universal asynchronous transceiver bus (CAN bus or UART bus), and the wireless communication module can be a long-range radio transmission module (LoRa module). It is understood that there are no specific restrictions on the type of bus.

[0073] In this embodiment, the firmware upgrade system for the embedded device can include multiple levels of control modules, specifically a main control module, at least one sub-control module, and at least one peripheral control module. The main control host computer can be a computer system such as a Linux system, which can establish a reliable wired data transmission link with the main control module via a first serial bus, such as an RS485 bus. The main control module, as the central node in the device, can establish an internal data transmission network with each sub-control module via a second serial bus, such as a controller area network (CAN) bus. Furthermore, the communication sub-control module, specifically responsible for wireless communication, can establish a wireless data transmission link with independent peripheral control modules via a connected wireless communication module, such as a long-range radio communication module, thus forming a complete multi-level upgrade architecture encompassing both wired and wireless communication links, from the top-level computer system to the device's peripherals.

[0074] For example, with Figure 2 Taking the mobile device shown as an example, its internal main control host computer, namely the main control Linux system, can be connected to the main control microcontroller unit via RS485 bus. The main control microcontroller unit can be connected to multiple sub-microcontroller units, such as the steering motor microcontroller unit, via the controller LAN bus or universal asynchronous transceiver bus. In addition, the mobile station microcontroller unit can wirelessly communicate with the remote base station module via a long-distance radio communication module to upgrade peripheral components.

[0075] Based on the above architecture, the firmware upgrade system can perform firmware upgrades on any sub-control module in an embedded device. For example, refer to... Figure 3As shown in the data link diagram, when upgrading the firmware of the rear wheel motor microcontroller unit, the main control Linux system first sends the firmware upgrade data corresponding to the rear wheel motor microcontroller unit to the main control microcontroller unit via the RS485 bus. Subsequently, the main control microcontroller unit transmits the firmware upgrade data to the rear wheel motor microcontroller unit via the universal asynchronous receiver / transmitter bus, enabling the rear wheel motor microcontroller unit to perform a firmware upgrade based on the received firmware upgrade data. After the rear wheel motor microcontroller unit upgrade is completed, the upgrade status can be uploaded to the main control Linux system level by level.

[0076] For example, refer to Figure 4 As shown in the data link diagram, when upgrading the peripheral base station module as a whole, the main control Linux system first sends the firmware upgrade data of the entire base station module to the main control microcontroller unit via the RS485 bus. Subsequently, the main control microcontroller unit transmits the firmware upgrade data to the mobile station microcontroller unit via the controller LAN bus. The mobile station microcontroller unit then sends the firmware upgrade data to the wireless communication module of the base station module via its own wireless communication module. The base station microcontroller unit of the base station module can temporarily store the received firmware upgrade data in the external flash memory of the base station. After all firmware upgrade data has been received, the firmware upgrade data is verified. If the data verification is successful, it triggers its own and the positioning and wireless communication modules of the peripherals to perform firmware upgrades. After the firmware upgrade of each component is completed, the upgrade status can be uploaded to the main control Linux system level by level.

[0077] This embodiment divides the firmware upgrade system into three levels: main control module, sub-control module, and peripheral control module. By setting up wired or wireless data transmission links for adjacent control modules, a clear hierarchical hybrid communication upgrade architecture can be constructed. This allows the system to simultaneously utilize the reliability of wired buses and the flexibility of wireless communication to achieve unified upgrade management of heterogeneous nodes in complex distributed devices.

[0078] In one embodiment, the embedded device to be upgraded includes a mobile device and a corresponding communication device, wherein the main control host computer, the main control module and each sub-control module are disposed in the mobile device, and the peripheral control module is disposed in the communication device.

[0079] Among them, the mobile device, as the embedded device to be upgraded, can include, but is not limited to, various mobile intelligent devices such as smart lawnmowers, robot vacuum cleaners, and wearable robots. Inside the mobile device, there is a main control host computer, as well as various motor controllers, sensor processing units, and other multi-level control modules and various communication buses. Furthermore, it can wirelessly communicate with a fixed external communication device, such as a base station or charging dock, as needed, thus forming a distributed, multi-level, interconnected OTA upgrade system.

[0080] In this embodiment, the embedded system to be upgraded can consist of two physically separate device entities: a mobile device and its corresponding communication device. The main control computer, the main control module, and the sub-control modules that execute various functions are all integrated within the mobile device, while the peripheral control modules are located in the remote communication device. Within the mobile device, the various control modules can be interconnected via a wired bus. The sub-control module responsible for communication can establish a connection with the peripheral control module in the communication device via wireless communication, thus forming a distributed upgrade system that spans multiple devices and spaces.

[0081] For example, with Figure 2 Taking the illustrated mobile device as an example, the main body of the smart lawnmower can function as a mobile device. Internally, it includes a main control Linux system, a main control microcontroller unit, and sub-microcontroller units that control each motor. Simultaneously, an independent base station deployed in a corner of the yard to extend the communication range can serve as the device's communication equipment. When a firmware upgrade is required for the base station, the upgrade command and firmware data can be initiated from the main control Linux system within the lawnmower and transmitted via the internal wired network to the mobile station microcontroller unit. Finally, it is wirelessly transmitted over a long distance to the base station module in the corner of the yard.

[0082] This embodiment places the main control module and sub-control modules inside the mobile device, and places the peripheral control module outside the communication device. This provides an independent firmware upgrade link for the control modules at all levels inside the device and the peripheral control modules outside the device, thereby improving the upgrade reliability of the entire device.

[0083] In one embodiment, such as Figure 5 As shown, a firmware upgrade method for an embedded device is provided. This firmware upgrade method can be applied to an embedded device, which may include a main control host computer and multiple levels of control modules. The main control host computer establishes a data transmission link with the first-level control module, and a wired or wireless data transmission link is established between every two adjacent control modules. In this scenario, the method may include the following steps: Step 101: The host computer responds to the firmware upgrade request and determines the target control module to be upgraded.

[0084] Step 102: The host computer sends the firmware upgrade data down level by level along the data transmission link between the host computer and the target control module.

[0085] Step 103: The target control module performs a firmware upgrade based on the received firmware upgrade data.

[0086] By applying the technical solution of this embodiment, during firmware upgrades, the host computer can progressively distribute firmware upgrade data along the data transmission link between the host computer and each target control module to be upgraded, enabling each target control module to perform firmware upgrades based on the received firmware upgrade data. This firmware upgrade method can establish data transmission links between the host computer and control modules at various levels through multiple communication methods without changing the original topology of the embedded device. This allows for firmware distribution across communication links within the embedded device and enables unified upgrades of control modules at all levels or independent upgrades of control modules at each level in a hybrid topology. The aforementioned topology and firmware upgrade method can flexibly adapt to the firmware upgrade needs of various embedded devices and ensure safe and reliable upgrades for multi-module embedded devices.

[0087] In one embodiment, the host computer stores firmware upgrade data and firmware upgrade strategy file. Under this condition, step 101 can be implemented by the following method: the host computer responds to the firmware upgrade request and, based on the firmware upgrade strategy file, determines the target control module to be upgraded and the firmware upgrade data corresponding to the target control module.

[0088] In one embodiment, the firmware upgrade method may further include the following steps: when there are multiple target control modules, the host computer determines the upgrade order of the target control modules based on the firmware upgrade strategy file. Under this condition, steps 102 and 103 can be implemented by the following method: the host computer sequentially sends firmware upgrade data along the data transmission link between the host computer and each target control module according to the upgrade order; each target control module sequentially performs firmware upgrade based on the firmware upgrade data.

[0089] In one embodiment, in step 102, before the firmware upgrade data is distributed step by step, the following method may also be performed: when the host computer distributes the firmware upgrade data step by step, other control modules on the data transmission link, except for the target control module, will switch their working mode to data pass-through mode.

[0090] In one embodiment, the above firmware upgrade method may further include the following step 104: when the target control module detects a firmware upgrade failure or a firmware upgrade data verification failure, it restores the firmware to the original version based on the rollback flag stored in the target control module.

[0091] In one embodiment, if a data transmission link is established between adjacent control modules via a wireless communication module, step 102 may also perform the following method: when the control module transmits firmware upgrade data via the wireless communication module, it switches the operating mode of the wireless communication module to a fixed frequency mode.

[0092] In one embodiment, if the target control module to be upgraded is connected to an external storage module, step 103 may also perform the following method: the target control module stores the received firmware upgrade data in the external storage module, verifies the stored firmware upgrade data, and performs firmware upgrade based on the firmware upgrade data after successful verification.

[0093] In one embodiment, if the target control module to be upgraded is also connected to at least one peripheral function module to be upgraded, then step 103 may also perform the following method: the target control module triggers the peripheral function module to be upgraded to perform a firmware upgrade based on the successfully verified firmware upgrade data.

[0094] In one embodiment, if the target control module to be upgraded is connected to an external storage module, the following method may also be performed before step 103: when the target control module detects an interruption in firmware upgrade data transmission, it records the transmission progress of the firmware upgrade data, and when the firmware upgrade data transmission resumes, it receives and stores the remaining firmware upgrade data based on the transmission progress.

[0095] In one embodiment, the multiple levels of control modules may include a main control module, at least one sub-control module, and at least one peripheral control module. The main control host computer establishes a data transmission link with the main control module through a first serial bus, the main control module establishes a data transmission link with each sub-control module through a second serial bus, and the communication sub-control module in the sub-control module establishes a data transmission link with the peripheral control module through a wireless communication module.

[0096] In one embodiment, the embedded device includes a mobile device and a corresponding communication device, wherein the main control host computer, the main control module and each sub-control module are disposed in the mobile device, and the peripheral control module is disposed in the communication device.

[0097] For the specific implementation process and technical effects of the above firmware upgrade methods, please refer to the embodiments of the corresponding firmware upgrade systems, and therefore will not be elaborated here.

[0098] It should be noted that the user information (including but not limited to device information, user information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. In addition, the labels corresponding to each step in the above embodiments are only for identification purposes and are not intended to limit the execution order of the steps. The execution order of the steps in each embodiment can be set according to the actual situation.

[0099] This application also provides an embedded device, specifically a personal computer, server, network device, etc. The embedded device includes a bus, processor, memory, and communication interface, and may also include input / output interfaces and a display device. The processor of the embedded device provides computing and control capabilities. The memory of the embedded device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the embedded device stores location information. The network interface of the embedded device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the various method embodiments.

[0100] Those skilled in the art will understand that the structure of the embedded device described above is only a partial structure related to the solution of this application, and does not constitute a limitation on the embedded device to which the solution of this application is applied. A specific embedded device may include more or fewer components, or combine certain components, or have different component arrangements.

[0101] In one embodiment, a computer-readable storage medium is provided, which may be non-volatile or volatile, having stored thereon a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0102] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0103] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0104] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0105] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A firmware upgrade system for an embedded device, characterized in that, The system includes a main control host computer and multiple levels of control modules, among which, The host computer establishes a data transmission link with the first-level control module, and a wired or wireless data transmission link is established between every two adjacent control modules. The host computer is used to respond to a firmware upgrade request, determine the target control module to be upgraded, and send the firmware upgrade data step by step along the data transmission link between the host computer and the target control module, so that the target control module can perform a firmware upgrade based on the firmware upgrade data.

2. The system according to claim 1, characterized in that, The host computer stores the firmware upgrade data and firmware upgrade strategy file. The host computer is used to respond to the firmware upgrade request and, based on the firmware upgrade strategy file, determine the target control module to be upgraded and the corresponding firmware upgrade data of the target control module.

3. The system according to claim 2, characterized in that, The host computer is also used to determine the upgrade order of the target control modules based on the firmware upgrade strategy file when there are multiple target control modules, and to send the firmware upgrade data down level by level along the data transmission link between the host computer and each target control module in the order of upgrade, so that each target control module can perform firmware upgrade in sequence based on the firmware upgrade data.

4. The system according to claim 1, characterized in that, When the host computer sends the firmware upgrade data down level by level, all control modules on the data transmission link, except for the target control module, switch to data pass-through mode.

5. The system according to claim 1, characterized in that, When the target control module detects a firmware upgrade failure or a firmware upgrade data verification failure, it restores the firmware to the original version based on the rollback flag stored in the target control module.

6. The system according to claim 1, characterized in that, If adjacent control modules establish a data transmission link through a wireless communication module, then when the control module transmits the firmware upgrade data through the wireless communication module, it switches the operating mode of the wireless communication module to a fixed frequency mode.

7. The system according to claim 1, characterized in that, If the target control module to be upgraded is connected to an external storage module, the target control module is used to store the received firmware upgrade data in the external storage module, verify the stored firmware upgrade data, and perform firmware upgrade based on the firmware upgrade data after successful verification.

8. The system according to claim 7, characterized in that, If the target control module to be upgraded is also connected to at least one peripheral function module to be upgraded, the target control module is also used to trigger the peripheral function module to be upgraded to perform a firmware upgrade based on the successfully verified firmware upgrade data.

9. The system according to claim 1, characterized in that, If the target control module to be upgraded is connected to an external storage module, the target control module is also used to record the transmission progress of the firmware upgrade data when the firmware upgrade data transmission is interrupted, and to receive and store the remaining firmware upgrade data based on the transmission progress when the firmware upgrade data transmission resumes.

10. The system according to any one of claims 1 to 9, characterized in that, The multiple levels of control modules include a main control module, at least one sub-control module, and at least one peripheral control module; The host computer establishes a data transmission link with the main control module through the first serial bus; The main control module establishes a data transmission link with each of the sub-control modules through a second serial bus; The communication sub-control module in the sub-control module establishes a data transmission link with the peripheral control module through a wireless communication module.

11. The system according to claim 10, characterized in that, The embedded device to be upgraded includes a mobile device and a corresponding communication device, wherein the main control host computer, the main control module and each of the sub-control modules are located in the mobile device, and the peripheral control module is located in the communication device.

12. A firmware upgrade method for an embedded device, characterized in that, The method is applied to an embedded device, which includes a main control host computer and multiple levels of control modules. The main control host computer establishes a data transmission link with the first-level control module, and a wired or wireless data transmission link is established between every two adjacent levels of control modules. The method includes: The host computer responds to the firmware upgrade request and determines the target control module to be upgraded. The host computer sends firmware upgrade data step by step along the data transmission link between the host computer and the target control module. The target control module performs a firmware upgrade based on the received firmware upgrade data.

13. The method according to claim 12, characterized in that, The host computer stores the firmware upgrade data and firmware upgrade strategy file; then, in response to the firmware upgrade request, the host computer determines the target control module to be upgraded, including: In response to the firmware upgrade request, the host computer determines the target control module to be upgraded and the corresponding firmware upgrade data based on the firmware upgrade strategy file.

14. The method according to claim 13, characterized in that, The method further includes: When there are multiple target control modules, the host computer determines the upgrade order of the target control modules based on the firmware upgrade strategy file. The host computer sends the firmware upgrade data step by step along the data transmission link between the host computer and each target control module in the upgrade order. Each of the target control modules performs a firmware upgrade in sequence based on the firmware upgrade data.

15. The method according to claim 12, characterized in that, The host computer sends firmware upgrade data step by step along the data transmission link between the host computer and the target control module, including: When the host computer sends the firmware upgrade data down level by level, the other control modules on the data transmission link, except for the target control module, will switch their working mode to data pass-through mode.

16. The method according to claim 12, characterized in that, The method further includes: When the target control module detects a firmware upgrade failure or a firmware upgrade data verification failure, it restores the firmware to the original version based on the rollback flag stored in the target control module.

17. The method according to claim 12, characterized in that, If adjacent control modules establish a data transmission link through a wireless communication module, the method further includes: When transmitting the firmware upgrade data through the wireless communication module, the control module switches the operating mode of the wireless communication module to fixed frequency mode.

18. The method according to claim 12, characterized in that, If the target control module to be upgraded is connected to an external storage module, the target control module performs a firmware upgrade based on the received firmware upgrade data, including: The target control module stores the received firmware upgrade data in the peripheral storage module and verifies the stored firmware upgrade data. If the verification is successful, the firmware upgrade is performed based on the firmware upgrade data.

19. The method according to claim 18, characterized in that, If the target control module to be upgraded is also connected to at least one peripheral functional module to be upgraded, then the target control module performs a firmware upgrade based on the received firmware upgrade data, further including: The target control module triggers the peripheral function module to be upgraded to perform a firmware upgrade based on the successfully verified firmware upgrade data.

20. The method according to claim 12, characterized in that, If the target control module to be upgraded is connected to an external storage module, then before the target control module performs a firmware upgrade based on the received firmware upgrade data, the method further includes: When the target control module detects an interruption in the firmware upgrade data transmission, it records the transmission progress of the firmware upgrade data. When the firmware upgrade data transmission resumes, it receives and stores the remaining firmware upgrade data based on the transmission progress.

21. The method according to claim 12, characterized in that, The multiple levels of control modules include a main control module, at least one sub-control module, and at least one peripheral control module, wherein... The host computer establishes a data transmission link with the main control module through the first serial bus; The main control module establishes a data transmission link with each of the sub-control modules through a second serial bus; The communication sub-control module in the sub-control module establishes a data transmission link with the peripheral control module through a wireless communication module.

22. The method according to claim 21, characterized in that, The embedded device includes a mobile device and a corresponding communication device, wherein the main control host computer, the main control module and each of the sub-control modules are disposed in the mobile device, and the peripheral control module is disposed in the communication device.

23. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 12 to 22.

24. An embedded device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 12 to 22.