Remote upgrading method of device, centralized control center unit, cloud and system

By centrally compressing and organizing upgrade data from multiple device microcontrollers in a unified control center, the upgrade is first completed on the baseline device, and target upgrade data is generated. This solves the problem of high complexity in upgrade data processing in complex device networking environments, and improves upgrade efficiency and resource utilization efficiency.

CN123185073APending Publication Date: 2026-11-27SHENZHEN POWEROAK NEWENER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611526557.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-29
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In complex device networking environments, existing remote upgrade methods suffer from high complexity in data processing and transmission due to differences in device firmware versions, which affects data processing efficiency and communication resource utilization efficiency, making it difficult to meet the needs of collaborative upgrades for multiple devices.

Method used

The central control unit receives the overall compressed package generated by the cloud, compresses and organizes the upgrade data of multiple microcontroller units in a unified manner, completes the firmware upgrade on the base device first, and generates the target base package and differential package for the device to be upgraded based on the actual version information, and performs the upgrade using a preset data packet sending strategy.

Benefits of technology

It reduces the burden of data processing and communication interaction during multi-device collaborative upgrades, improves the efficiency of upgrade data processing and communication resource utilization, and adapts to the needs of efficient remote firmware upgrades in complex device networking environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123185073A_ABST
    Figure CN123185073A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of firmware upgrading, and relates to a remote upgrading method of equipment, a centralized control center unit, a cloud end and a system. The upgrading data corresponding to multiple microcontroller units in a first equipment end is organized as first overall upgrading data and is uniformly compressed and transmitted, so that data processing and communication interaction in the multi-firmware upgrading process are reduced. The centralized control center first upgrades the firmware of the first equipment end, and uses the upgraded firmware as a target reference for subsequent equipment upgrading, and then generates corresponding target basic packages and target differential packages based on the current firmware version of the equipment to be upgraded, thereby reducing the processing burden of the cloud end for repeatedly generating upgrading data for multiple equipment. Further, the data packages are distributed according to a preset data package sending strategy, so that the version difference of different equipment is adapted, thereby reducing the data processing and communication burden in the multi-equipment and multi-firmware upgrading process, improving the data processing efficiency, communication resource utilization efficiency and multi-equipment collaborative upgrading efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of firmware upgrade technology, specifically relating to a remote upgrade method for a device, a central control unit, a cloud platform, and a system. Background Technology

[0002] With the continuous development of devices with digital control capabilities, more and more devices are adopting remote upgrade methods to update their software firmware. Remote upgrades typically involve the server obtaining the device's current firmware version and the target version information, generating corresponding upgrade data based on the differences between the current and target versions, and then sending the upgrade data to the device via a communication network. The device then completes the firmware update based on the received upgrade data. Compared to directly transmitting the complete firmware, upgrading based on version differences can reduce the amount of data that needs to be transmitted to a certain extent, and therefore it is increasingly being used in device systems with remote maintenance requirements.

[0003] In practical applications, some equipment systems are not composed of a single device, but rather multiple devices connected and operating collaboratively according to a certain network relationship. Different devices can exchange operational or upgrade data through a communication network, and the upgrade process of multiple devices is uniformly managed by an upper-level control node or server. Simultaneously, a single device may also contain multiple microcontroller units (MCUs) to perform different functions, each running its own corresponding firmware. Since different devices may have different firmware version states during actual operation, the corresponding firmware of devices of the same type may not necessarily be at the same version.

[0004] In the aforementioned device system, when remote upgrades are required for multiple firmware versions across multiple devices, the server needs to generate corresponding upgrade data based on the current firmware version status of each device and transmit the upgrade data to the corresponding device via a communication network. As the number of devices and the amount of firmware within each device increases, the amount of firmware version information and upgrade data that needs to be processed also increases, further enhancing the complexity of data generation, data transmission, data management, and inter-device upgrade coordination involved in the remote upgrade process.

[0005] Furthermore, when multiple devices are being upgraded simultaneously, the upgrade data between different devices may have certain correlations, but the current firmware versions of each device may differ. This means that the organization and transmission of upgrade data must take into account the version status of different devices and the upgrade requirements of different firmware within each device. When there are a large number of devices or a single device contains multiple firmware versions, if the upgrade process involves a large amount of independent upgrade data, it may increase the number of data interactions on the communication link and the management complexity of the upgrade task, placing higher demands on the upgrade data processing capabilities of the server side and the upgrade processing capabilities of the device side.

[0006] In the process of developing this application, the inventors discovered that the prior art has at least the following problems: In a complex device network environment containing multiple devices and each device having multiple firmware versions, due to the possible differences in firmware version status between different devices, the existing remote upgrade method tends to generate a large number of upgrade data processing and transmission requirements when performing firmware upgrades on multiple devices. This affects the data processing efficiency, communication resource utilization efficiency, and multi-device collaborative upgrade efficiency of remote upgrades, making it difficult to meet the demand for efficient remote firmware upgrades in a complex device network environment. Summary of the Invention

[0007] To address the aforementioned issues, this application provides a remote upgrade method for devices, a centralized control center unit, a cloud platform, and a system to improve the data processing efficiency, communication resource utilization efficiency, and collaborative upgrade efficiency of remote upgrades for multiple devices and firmware in complex device networking environments.

[0008] To solve the above-mentioned technical problems, one technical solution adopted in this application is: providing a remote upgrade method for equipment, applied to a centralized control center unit, the centralized control center unit being communicatively connected to multiple device terminals and the cloud; multiple device terminals are divided into multiple device groups according to a preset networking relationship, and communication connections are established between the device terminals within each device group; each device terminal includes multiple microcontroller units, the multiple device terminals belong to the same device type, and the multiple microcontroller units in different device terminals correspond to each other according to a preset module mapping relationship, the method including: receiving a first overall compressed package sent by the cloud; wherein, the first overall compressed package is obtained by the cloud compressing first overall upgrade data generated by the cloud from a first base package, a first differential package, and a preset partition segmentation identifier header; wherein, the first base... The base packet and the first differential packet are obtained by the cloud based on the first current version information, target version information, and preset differential rules of the firmware corresponding to any one of the multiple device terminals. Based on the first overall compressed packet, the first device terminal and the device terminal to be upgraded are determined, and the firmware of the first device terminal is upgraded. The device terminal to be upgraded is any device terminal other than the first device terminal among the multiple device terminals. The second current version information of the firmware corresponding to the device terminal to be upgraded is obtained, and based on the second current version information, target version information, and differential rules, a target base packet and a target differential packet corresponding to the device terminal to be upgraded are generated. According to a preset data packet sending strategy, the target base packet and the target differential packet are sent to the device terminal to be upgraded, so that the device terminal to be upgraded can perform a firmware upgrade based on the target base packet and the target differential packet.

[0009] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a remote upgrade method for a device, applied in the cloud, wherein a central control unit communicates with multiple device terminals and the cloud; the multiple device terminals are divided into multiple device groups according to a preset networking relationship, and communication connections are established between the device terminals within each device group; each device terminal includes multiple microcontroller units, the multiple device terminals belong to the same device type, and the multiple microcontroller units in different device terminals correspond to each other according to a preset module mapping relationship, the method includes: obtaining the first current version information and target version information of the firmware corresponding to any one of the multiple device terminals; obtaining a first basic packet and a first differential packet according to the first current version information, the target version information, and a preset differential rule; generating first overall upgrade data according to the first basic packet, the first differential packet, and a preset partition segmentation header; compressing the first overall upgrade data to obtain a first overall compressed package, and sending the first overall compressed package to the central control unit.

[0010] To solve the above-mentioned technical problems, another technical solution adopted in the embodiments of this application is: to provide a centralized control center unit, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above-mentioned method.

[0011] To solve the above-mentioned technical problems, another technical solution adopted in the embodiments of this application is: providing a cloud, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above-mentioned method.

[0012] To solve the above-mentioned technical problems, another technical solution adopted in the embodiments of this application is: providing a remote upgrade system for equipment, including: a central control unit as described above, multiple device terminals, and a cloud as described above; the central control unit is communicatively connected to the multiple device terminals and the cloud respectively; the multiple device terminals are divided into multiple device groups according to a preset networking relationship, and communication connections are established between the device terminals in each device group; each device terminal includes multiple microcontroller units, the multiple device terminals belong to the same device type, and the multiple microcontroller units in different device terminals correspond to each other according to a preset module mapping relationship.

[0013] Unlike related technologies, this application provides a remote upgrade method for devices, a centralized control center unit, a cloud platform, and a system. By receiving a first unified compressed package generated by the cloud for multiple microcontroller units, the upgrade data corresponding to the multiple microcontroller units is organized into a first unified upgrade data set, compressed uniformly, and then transmitted to the centralized control center. This allows upgrade data that was originally processed and transmitted separately for different microcontroller units to be transmitted as a unified data set. Upon receiving the first unified compressed package, the centralized control center determines the first device and the device to be upgraded based on the package and performs a firmware upgrade on the first device. Since the first device can serve as the baseline device among multiple devices to complete the target firmware upgrade first, it is possible to first establish a device that has reached the target version even when multiple devices have different firmware version states. This provides a unified target firmware reference for subsequent upgrades of other devices, thereby reducing the complexity of upgrade data processing caused by differences in current firmware versions between different devices. Based on this, the central control center obtains the second current version information of the firmware corresponding to the device to be upgraded, and generates the target base package and target differential package corresponding to the device to be upgraded on the central control center side according to the second current version information, the target version information, and the preset differential rules. Compared with the method of generating all upgrade data for multiple devices separately by the cloud, this application decentralizes the upgrade data generation process of the device to be upgraded to the central control center. This eliminates the need for the cloud to perform differential data generation and organization for each device to be upgraded separately, and allows it to first form overall upgrade data for the central control center to process. Therefore, as the number of devices increases, the central control center can generate corresponding upgrade data based on the actual current version status of the devices, thereby reducing the differential data generation tasks that need to be repeatedly executed on the cloud side and reducing the data processing burden on the cloud during remote upgrades. Furthermore, this application generates target base packets and target differential packets for the devices to be upgraded, and then sends these packets to the corresponding devices according to a preset data packet sending strategy. This allows basic upgrade data with the same or corresponding upgrade requirements to be processed according to the corresponding data transmission methods, while differential upgrade data related to the current firmware version of a specific device can be sent to the corresponding device to be upgraded. Therefore, when multiple devices are upgraded simultaneously, the repeated generation and indiscriminate processing of the same upgrade data across different devices can be reduced, and version differences between different devices can be adapted through corresponding differential data, thereby reducing the amount of communication data and the complexity of upgrade management during multi-device collaborative upgrades.Therefore, this application organizes and compresses the upgrade data of multiple microcontroller units for overall transmission. After the upgrade of the base device is completed at the central control center, differential upgrade data is generated based on the current firmware version of the device to be upgraded. Then, multi-device upgrades are implemented according to a preset data packet sending strategy. This allows the generation, transmission, and distribution of upgrade data to adapt to complex network structures with multiple devices and multiple microcontroller units. As the number of devices and the amount of firmware contained in a single device increase, the data processing and communication interaction burden during remote upgrades can be reduced, improving upgrade data processing efficiency, communication resource utilization efficiency, and multi-device collaborative upgrade efficiency, thereby meeting the demand for efficient remote firmware upgrades in complex device networking environments. Attached Figure Description

[0014] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0015] Figure 1 This is a schematic diagram of the structure of a remote upgrade system for a device provided in an embodiment of this application; Figure 2 This is a schematic diagram of the hardware structure of a centralized control center unit provided in an embodiment of this application; Figure 3 This is a schematic diagram of a cloud-based hardware structure provided in an embodiment of this application; Figure 4 This is a flowchart of a remote upgrade method for a device provided in an embodiment of this application; Figure 5 This is an example schematic diagram of a file corresponding to the firmware on the device side provided in an embodiment of this application; Figure 6 This is a flowchart of a remote upgrade method for a device provided in another embodiment of this application. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0017] It should be noted that, unless otherwise specified, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. When an element is described as "connected" to another element, it can be directly connected to the other element, or there may be one or more intervening elements between them.

[0018] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and are not limited in number; for example, a first object can be one or more.

[0019] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application.

[0020] Example 1 Please see Figure 1 , Figure 1 This is a schematic diagram of a remote upgrade system for a device provided in an embodiment of this application. The remote upgrade system 1000 includes a central control unit 100, a cloud platform 200, and multiple device terminals (such as a first device terminal 11, a second device terminal 12, a third device terminal 13, a fourth device terminal 21, a fifth device terminal 31, and a sixth device terminal 32). The central control unit is communicatively connected to the multiple device terminals and the cloud platform 200, and is used to uniformly manage the firmware upgrade process of the multiple device terminals. The cloud platform 200 is used to provide the central control unit 100 with baseline upgrade data related to device firmware upgrades. The multiple device terminals are used to receive upgrade data sent by the central control unit 100 and complete the corresponding firmware upgrades based on the upgrade data. The device terminals can be power electronic devices, energy storage devices, industrial equipment, intelligent devices, or other electronic devices with multiple firmware operation requirements, which may have multiple microcontroller units. Different microcontroller units in the device terminals can be used to implement different control functions and run firmware corresponding to the corresponding control functions, so that the device terminals can collaboratively achieve the overall function of the device through multiple microcontroller units.

[0021] In this embodiment, multiple devices are divided into multiple device groups according to a preset network relationship. For example, the first device 11 (P11), the second device 12 (P12), and the third device 13 (P13) can constitute device group 1; the fourth device 21 (P21) can constitute device group 2; and the fifth device 31 (P31) and the sixth device 32 (P32) can constitute device group 3. It should be noted that the division of device groups can be determined based on the actual network relationship, collaborative operation relationship, or preset device management relationship between devices. The device group division method in this embodiment is only for illustrative purposes.

[0022] Furthermore, communication connections are established between devices within each device group to enable data interaction between different devices within the same device group. For example, the second device 12 in device group 1 is communicatively connected to the first device 11 and the third device 13, enabling the first device 11, the second device 12, and the third device 13 to perform intra-group data interaction and firmware upgrades under the unified management of the central control unit 100. Similarly, a communication connection is established between the fifth device 31 and the sixth device 32 in device group 3. Devices in different device groups may not establish direct communication connections but instead perform data interaction and upgrade management through the central control unit 100.

[0023] In this embodiment, each device terminal includes multiple microcontroller units, and different microcontroller units are used to execute different control functions of the device and run corresponding firmware. For example, the first device terminal 11 includes MCU1, MCU2, and MCU3, which run corresponding first firmware, second firmware, and third firmware, respectively; the second device terminal 12 and the third device terminal 13 also include MCU1, MCU2, and MCU3. Multiple device terminals belong to the same device type, and the multiple microcontroller units in different device terminals correspond to each other according to a preset module mapping relationship, so that the firmware run by the corresponding microcontroller units in different device terminals has a corresponding relationship. For example, MCU1 in the first device terminal 11 corresponds to MCU1 in the second device terminal 12 and MCU1 in the third device terminal 13; MCU2 in the first device terminal 11 corresponds to MCU2 in the second device terminal 12 and MCU2 in the third device terminal 13, and so on.

[0024] In a practical application scenario, multiple devices may have different firmware versions during operation due to differences in deployment time, historical upgrade records, or operating status. For example, MCU1, MCU2, and MCU3 in the first device 11 may be in the first current version, the second current version, and the third current version, respectively, while the microcontroller units corresponding to the aforementioned MCUs in the second device 12 and the third device 13 may be in other current versions. When remote upgrades are required for multiple microcontroller units in multiple devices, the cloud 200 can generate upgrade data corresponding to the firmware version differences according to preset differential rules, and send the corresponding overall upgrade data to the central control unit 100, which will then further implement the upgrades for the multiple devices.

[0025] In this embodiment, the central control unit 100 can establish communication connections with multiple device terminals using wired communication, wireless communication, or a combination of both. The specific communication method can be determined based on the actual deployment environment of the devices. The central control unit 100 can also determine the device group to which each device terminal belongs and the communication relationships between each device terminal based on a preset network relationship, and perform corresponding firmware upgrades on multiple microcontroller units of different device terminals based on the correspondence between different microcontroller units within the device terminals.

[0026] It should be noted that the first device terminal 11, the second device terminal 12, the third device terminal 13, the fourth device terminal 21, the fifth device terminal 31, and the sixth device terminal 32, as well as device group 1, device group 2, and device group 3, are merely one exemplary application scenario of this application. This application does not limit the number of device groups, the number of device terminals in each device group, the number of device terminals, or the number of microcontroller units in each device terminal. In practical applications, the corresponding number of device terminals and microcontroller units can be set according to the scale of the device system, the networking relationship, and the device control functions. As long as there is a corresponding device and microcontroller unit correspondence between different device terminals and remote firmware upgrades can be implemented through the central control unit 100, they all fall within the application scope of this application.

[0027] Example 2 Please see Figure 2 The diagram illustrates the hardware structure of a central control unit 100 capable of executing the methods of embodiments of this application. The central control unit 100 may be a locally located industrial control device, edge computing device, gateway device, control server, or computing device with data processing and communication functions, used to establish communication connections with the cloud 200 and multiple device terminals, and to uniformly manage the firmware upgrade process of multiple device terminals. The central control unit 100 includes: at least one processor 110; and a memory 120 communicatively connected to the at least one processor 110. Figure 2 Taking a processor 110 as an example, the memory 120 stores instructions executable by at least one processor 110. These instructions, when executed by at least one processor 110, enable the at least one processor 110 to perform the remote upgrade method of the device according to this embodiment. The processor 110 and the memory 120 can be connected via a bus or other means. Figure 2 Taking the example of a connection between China and Israel via a bus.

[0028] The memory 120, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the remote upgrade method of the device in this embodiment. The processor 110 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions, and modules stored in the memory 120, thereby realizing the remote upgrade method of the device in this embodiment.

[0029] The memory 120 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computing device. Furthermore, the memory 120 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include memory remotely located relative to the processor 110, and these remote memories may be connected to the computing device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0030] One or more modules are stored in memory 120 and, when executed by one or more processors 110, perform the remote upgrade method of the device according to the embodiments of this application.

[0031] Example 3 Please see Figure 3 The diagram illustrates a hardware structure of a cloud-based 200 capable of executing the methods described in the embodiments of this application. The cloud-based 200 can be a cloud server, server cluster, cloud computing platform, or other computing device with data storage, data processing, and communication functions. It stores different version information of device firmware and corresponding upgrade data, generates corresponding upgrade data based on the firmware version status of the device, and sends the generated upgrade data to the central control unit 100. The cloud-based 200 includes: at least one processor 210; and a memory 220 communicatively connected to the at least one processor 210. Figure 3Taking a processor 210 as an example, the memory 220 stores instructions executable by at least one processor 210. These instructions, when executed by at least one processor 210, enable the at least one processor 210 to perform the remote upgrade method of the device according to this embodiment. The processor 210 and the memory 220 can be connected via a bus or other means. Figure 3 Taking the example of a connection between China and Israel via a bus.

[0032] The memory 220, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the remote upgrade method of the device in this embodiment. The processor 210 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions, and modules stored in the memory 220, thereby realizing the remote upgrade method of the device in this embodiment.

[0033] Memory 220 may include a stored program area and a stored data area, wherein the stored program area may store the operating system and applications required for at least one function; the stored data area may store data created based on the use of the computing device, etc. Furthermore, memory 220 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 220 may optionally include memory remotely located relative to processor 210, and these remote memories may be connected to the computing device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0034] One or more modules are stored in memory 220 and, when executed by one or more processors 210, perform the remote upgrade method of the device according to the embodiments of this application.

[0035] Example 4 Please see Figure 4 , Figure 4 This is a flowchart illustrating a remote upgrade method for a device provided in an embodiment of this application. The method is applied to the aforementioned centralized control center unit 100. For example... Figure 4 As shown, the method includes steps S11-S14: S11: Receive the first overall compressed package sent by the cloud; wherein, the first overall compressed package is obtained by the cloud after compressing the first overall upgrade data generated by the first basic package, the first differential package and the preset partition segmentation header; wherein, the first basic package and the first differential package are obtained by the cloud based on the first current version information, target version information and preset differential rules of the firmware corresponding to any one of the multiple device terminals.

[0036] The partition segmentation header includes a microcontroller unit quantity identifier and a microcontroller unit grouped data segment set. The microcontroller unit quantity identifier identifies the type and quantity of microcontroller units. The microcontroller unit grouped data segment set includes multiple identifier data segments. Each identifier data segment includes a type identifier field, a start address field, a data volume field, and a checksum field. The microcontroller unit grouped data segment set is used to identify the upgrade data location, upgrade data size, and upgrade data type of all microcontroller units in the device.

[0037] In one embodiment, the cloud 200 determines a reference device based on any one of multiple device terminals, and generates a first overall compressed package according to the current version information of the firmware corresponding to multiple microcontroller units in the reference device terminal and the target version information, and then sends the first overall compressed package to the central control unit 100. For ease of explanation, this embodiment uses the first device terminal 11 as the reference device terminal, and the first device terminal 11 includes three types of microcontroller units: MCU1, MCU2, and MCU3.

[0038] Specifically, the cloud 200 first obtains the first current version information corresponding to each microcontroller unit in the first device 11. The first current version information is used to characterize the firmware version currently running on the corresponding microcontroller unit in the first device 11. For example, the cloud 200 can obtain the firmware version V1_C currently running on MCU1, the firmware version V2_C currently running on MCU2, and the firmware version V3_C currently running on MCU3. Simultaneously, the cloud 200 obtains the target version information corresponding to each of the aforementioned microcontroller units. The target version information is used to characterize the target firmware version required for this remote upgrade. For example, MCU1 corresponds to target version V1_T, MCU2 corresponds to target version V2_T, and MCU3 corresponds to target version V3_T. The target version information can correspond to the latest available firmware version or can be predetermined based on the actual upgrade task.

[0039] After obtaining the first current version information and the target version information, the cloud 200 determines the firmware difference data between the current firmware and the corresponding target firmware of each microcontroller unit in the first device 11 according to the preset differential rules, and further generates a difference data packet and a dedicated differential packet corresponding to the firmware difference data. The preset differential rules can be as follows: first, the current firmware and the target firmware are compared to determine the common content and differences such as added or modified content between the current firmware and the target firmware; then, the corresponding differential data is formed based on preset differential instruction rules (such as quaternary instruction streams). The differential instruction rules can include combinations of instructions to instruct reading existing content from the current firmware, skipping irrelevant content in the current firmware, reading added or changed content from the basic upgrade data, and skipping irrelevant content in the basic upgrade data, thereby enabling the device to reconstruct the target firmware based on the local current firmware and the received upgrade data. It should be noted that the specific implementation details of the differential rules are explained in detail in step S13, and will not be elaborated here.

[0040] In this embodiment, the above differential processing procedure is performed on MCU1, MCU2, and MCU3 respectively, thereby obtaining differential data packets corresponding to MCU1, MCU2, and MCU3, as well as dedicated differential packets corresponding to MCU1, MCU2, and MCU3 respectively. The differential data packets carry the common differential upgrade data required for the corresponding microcontroller unit to upgrade from the first current version to the target version; the dedicated differential packets further describe the differential upgrade data based on the specific differences between the current firmware of the first device and the corresponding basic upgrade data, enabling the first device to complete the firmware upgrade of the corresponding microcontroller unit based on the differential data packets and dedicated differential packets.

[0041] It should be noted that the first basic package is not limited to data corresponding to only one type of microcontroller unit, but can be used to summarize the collection of differential data corresponding to multiple microcontroller units in the first device. Therefore, in this embodiment, the differential data packets corresponding to MCU1, MCU2, and MCU3 can be collectively used as the first basic package; correspondingly, the dedicated differential packets corresponding to MCU1, MCU2, and MCU3 can be collectively used as the first differential package. Thus, the first basic package and the first differential package respectively form a holistic upgrade data set for multiple microcontroller units.

[0042] After obtaining the first basic package and the first differential package, the cloud unit 200 further generates a partition segmentation header and sets the partition segmentation header at a preset position in the overall upgrade data set, such as at the very beginning of the overall upgrade data set, thereby generating the first overall upgrade data. The partition segmentation header is used to describe the organizational relationship of the upgrade data corresponding to different microcontroller units in the first basic package and the first differential package, so that after obtaining the overall upgrade data set, the central control unit 100 can determine the position, size, and data type of the upgrade data corresponding to different microcontroller units based on the partition segmentation header.

[0043] Specifically, the partition segmentation header in this embodiment includes a microcontroller unit quantity identifier and a set of microcontroller unit grouped data segments. The microcontroller unit quantity identifier identifies the number of microcontroller unit types included in the current first overall upgrade data. For example, this embodiment includes three types of microcontroller units: MCU1, MCU2, and MCU3. Therefore, the microcontroller unit quantity identifier can be set to a 1-byte value "3" to indicate that the current first overall upgrade data contains upgrade data corresponding to the three types of microcontroller units.

[0044] The microcontroller unit group data segment set includes multiple identifier data segments corresponding to each microcontroller unit. In this embodiment, each type of microcontroller unit corresponds to one differential data packet and one dedicated differential packet. Therefore, each type of microcontroller unit can correspond to two identifier data segments, and the three microcontroller units form a total of six identifier data segments. Each identifier data segment adopts a fixed-length data structure, for example, set to 10 bytes, and includes a type identifier field, a start address field, a data volume field, and a checksum field.

[0045] The type identifier field is used to simultaneously identify the microcontroller unit type and the upgrade data type corresponding to the current identifier data segment. In this embodiment, the type identifier field occupies 2 bytes, where the high 8 bits are used to represent the microcontroller unit type and the low 8 bits are used to represent the upgrade data type. For example, the high 8 bits "0x01" represents MCU1, the high 8 bits "0x02" represents MCU2, and the high 8 bits "0x03" represents MCU3; the low 8 bits "0x01" indicates that the current data is a difference data packet, and the low 8 bits "0x02" indicates that the current data is a dedicated differential packet. Therefore, the type identifier field "0x0101" represents "MCU1 + difference data packet", "0x0102" represents "MCU1 + dedicated differential packet", "0x0201" represents "MCU2 + difference data packet", "0x0202" represents "MCU2 + dedicated differential packet", "0x0301" represents "MCU3 + difference data packet", and "0x0302" represents "MCU3 + dedicated differential packet".

[0046] It should be noted that "0x01" in "0x0101" is not a separate hexadecimal representation, but rather the high 8 bits and low 8 bits of a 2-byte field being "0x01" and "0x01" respectively. That is, this field can be understood as "high byte 0x01 | low byte 0x01", hence the overall representation is "0x0101". Similarly, "0x0102" represents a 2-byte type identifier field with a high byte of 0x01 and a low byte of 0x02.

[0047] The start address field indicates the starting position of the corresponding upgrade data within the first overall upgrade data. The data volume field indicates the length of data occupied by the corresponding upgrade data starting from that starting position. The checksum field is used to perform integrity verification on the corresponding upgrade data. In this embodiment, the start address field occupies 4 bytes, the data volume field occupies 2 bytes, and the checksum field occupies 2 bytes. By setting the above fields in each identifier data segment, the central control unit 100, when subsequently parsing the overall upgrade data, can determine "which microcontroller unit the upgrade data belongs to and what type of upgrade data it is" based on the type identifier field, determine "the position of the upgrade data within the first overall upgrade data and the amount of space it occupies" based on the start address field and the data volume field, and perform integrity verification on the corresponding upgrade data based on the checksum field.

[0048] Taking the difference data packet corresponding to MCU1 as an example, its corresponding identifier data segment can be represented as: [0x0101, 0x0000003D, 0x4000, 0x5456].

[0049] Among them, 0x0101 is the type identifier field, indicating that the data segment corresponds to the difference data packet of MCU1; 0x0000003D is the start address field, indicating that the difference data packet of MCU1 starts from the 0x0000003D position of the first overall upgrade data; 0x4000 is the data volume field, indicating that the difference data packet occupies 0x4000 bytes, that is, 16384 bytes; 0x5456 is the checksum field, which is used to perform integrity verification on the difference data packet.

[0050] Correspondingly, the dedicated differential packet for MCU1 can correspond to the following identifier data segment: [0x0102, 0x0000403D, 0x0200, 0x1456].

[0051] In this data segment, 0x0102 indicates the dedicated differential packet for MCU1; 0x0000403D indicates the starting position of this dedicated differential packet within the first overall upgrade data; 0x0200 indicates that this dedicated differential packet occupies 0x0200 bytes, or 512 bytes; and 0x1456 is the corresponding checksum. Since the differential data packet for MCU1 occupies 0x4000 bytes, in this example, the dedicated differential packet for MCU1 can be stored immediately following this differential data packet.

[0052] Using the same method, identification data segments corresponding to MCU2 and MCU3 can be generated separately. For example, the difference data packets and dedicated difference packets corresponding to MCU2 can be identified by 0x0201 and 0x0202 respectively, and the difference data packets and dedicated difference packets corresponding to MCU3 can be identified by 0x0301 and 0x0302 respectively. Thus, in this embodiment, a partition segmentation header containing one microcontroller unit quantity identifier and six identification data segments is formed. Since one microcontroller unit quantity identifier occupies 1 byte and each identification data segment occupies 10 bytes, the total length of the partition segmentation header is 61 bytes when there are 3 types of microcontroller units and each type of microcontroller unit corresponds to two upgrade data segments.

[0053] After generating the partition segmentation header, the cloud 200 combines the partition segmentation header, the first basic packet, and the first differential packet according to a preset data organization order to form the first overall upgrade data. For example, the first overall upgrade data can be formed in the order of "partition segmentation header → MCU1 differential data packet → MCU1 dedicated differential packet → MCU2 differential data packet → MCU2 dedicated differential packet → MCU3 differential data packet → MCU3 dedicated differential packet". At this time, the starting address fields in the partition segmentation header are used to indicate the position of the corresponding upgrade data in the first overall upgrade data, thereby forming an overall data structure with clear data boundaries and data type identifiers for the first overall upgrade data.

[0054] After the first overall upgrade data is generated, the cloud-based 200 uses a preset universal compression algorithm to uniformly compress the first overall upgrade data, resulting in a first overall compressed package. This first overall compressed package therefore contains a uniformly compressed partition segmentation header, as well as differential data and dedicated differential data corresponding to multiple microcontroller units. Compared to compressing the upgrade data for MCU1, MCU2, and MCU3 independently, organizing the upgrade data for multiple microcontroller units into a first overall upgrade data and then uniformly compressing it allows for processing of potentially duplicate or similar data between different upgrade data within the same compressed data stream, while avoiding the generation of multiple independent compressed packages for each microcontroller unit.

[0055] Finally, the cloud-based 200 sends the first overall compressed package to the central control unit 100 via the established communication link. This communication link can be wired, wireless, or other data communication methods suitable for remote device upgrades. At this point, the cloud-based 200 has completed the generation, partitioning, overall organization, and unified compression of upgrade data for multiple microcontroller units on the base device side, and provides a first overall compressed package to the central control unit 100 for subsequent overall upgrade data parsing, base device upgrade, and other device upgrade data generation.

[0056] Through step S11 above, the cloud generates the first basic packet and the first differential packet corresponding to each microcontroller unit only for the first device terminal, which serves as the reference device terminal. It then organizes the upgrade data corresponding to multiple microcontroller units into a first overall upgrade data set, compresses it uniformly, forms a first overall compressed package, and sends it to the central control unit. Since the upgrade data for multiple microcontroller units is transformed from multiple independent data sets into a single compressed data set for transmission, the number of upgrade data transmissions and data interaction overhead between the cloud and the central control unit is reduced. Simultaneously, because the cloud only generates the corresponding upgrade data for the reference device terminal, the upgrade data for other devices can be further generated by the central control unit based on the actual current firmware version. This reduces the cloud's burden of repeatedly performing differential data generation tasks for multiple devices, lowering the data processing load in multi-device upgrade scenarios.

[0057] Furthermore, by setting a partition segmentation header at the beginning of the first overall upgrade data, and using microcontroller unit quantity identifiers and multiple identifier data segments to record microcontroller unit type, data type, data start position, data volume, and verification information, the upgrade data of multiple microcontroller units, although organized and transmitted using a unified compression method, can still quickly determine the correspondence and data boundaries of each upgrade data after decompression based on the partition segmentation header. The central control unit does not need to perform complex data scanning on the first overall upgrade data; it can obtain the location, size, and type of the upgrade data corresponding to each microcontroller unit by parsing the partition segmentation header located at the beginning of the data, thereby achieving rapid sorting of the first overall upgrade data. After adopting the partition segmentation header, the fixed-format identifier structure requires only a small amount of storage and operating resources to complete the parsing, which can adapt to resource-constrained embedded controllers such as STM32F103VCT6.

[0058] Furthermore, the partitioning header combines the microcontroller unit type with the data type for identification, and describes different numbers of microcontroller units through a microcontroller unit quantity identifier and corresponding identifier data segments. This allows the same data organization and parsing logic to adapt to different numbers of microcontroller units. When the number of microcontroller units in the device changes, only the corresponding identifier data segments need to be added or adjusted according to the actual number of microcontroller units to describe the corresponding upgrade data, without changing the overall upgrade data organization and parsing logic. Therefore, this embodiment reduces the amount of upgrade data transmission and sorting processing latency while also meeting the expansion needs of multi-microcontroller unit devices.

[0059] S12: Based on the first overall compressed package, determine the first device and the device to be upgraded, and perform firmware upgrade on the first device; wherein, the device to be upgraded is a device other than the first device among multiple devices.

[0060] The process includes: determining the first device and the device to be upgraded based on the first overall compressed package, and performing a firmware upgrade on the first device. This includes: decompressing the first overall compressed package to obtain first overall upgrade data; wherein the first overall upgrade data includes a partition segmentation header, a first basic packet, and a first differential packet; parsing the first overall upgrade data based on the partition segmentation header to determine the device corresponding to the first overall upgrade data as the first device, determining the device other than the first device among multiple device devices as the device to be upgraded, and extracting the first basic packet and the first differential packet corresponding to the first device; and sending the first basic packet and the first differential packet to the first device so that the first device can perform a firmware upgrade based on the first basic packet and the first differential packet.

[0061] After receiving the first overall compressed package sent by the cloud 200, the central control unit 100 decompresses the first overall compressed package to restore the first overall upgrade data generated by the cloud 200 when the first overall compressed package was created. Since the first overall compressed package is obtained by uniformly compressing the first overall upgrade data containing the partition segmentation identifier header, the first basic package, and the first differential package, the central control unit 100 can obtain the first overall upgrade data including the partition segmentation identifier header, the first basic package, and the first differential package after decompression.

[0062] After obtaining the first overall upgrade data, the central control unit 100 first parses the partition segmentation header located at the beginning of the first overall upgrade data. Since the partition segmentation header contains a microcontroller unit quantity identifier and multiple identifier data segments corresponding to different microcontroller units, the central control unit 100 can determine the number of microcontroller unit types included in this first overall upgrade data based on the microcontroller unit quantity identifier, and further determine the upgrade data type, data location, data size, and verification information corresponding to different microcontroller units based on the type identifier field, start address field, data volume field, and checksum field in each identifier data segment.

[0063] Taking the first device terminal 11, which includes MCU1, MCU2, and MCU3 in this embodiment, as an example, after the central control unit 100 parses the partition segmentation identifier header, it can determine that the first overall upgrade data contains differential data packets and dedicated differential packets corresponding to MCU1, MCU2, and MCU3, respectively. Specifically, the type identifier field 0x0101 corresponding to MCU1 is used to indicate that the corresponding data is a differential data packet of MCU1, and 0x0102 is used to indicate that the corresponding data is a dedicated differential packet of MCU1; the upgrade data corresponding to MCU2 and MCU3 can be identified by 0x0201, 0x0202, and 0x0301, 0x0302. The central control unit 100 further locates and extracts the corresponding upgrade data from the first overall upgrade data based on the start address field and data volume field in each identifier data segment.

[0064] During the parsing of the partition segmentation header, the central control unit 100 can also perform integrity verification on the corresponding upgrade data located based on the checksum field in each identifier data segment. For example, for the differential data packet of MCU1, the central control unit 100 determines its starting position and data volume in the first overall upgrade data based on the corresponding identifier data segment, and verifies the extracted data according to the corresponding checksum. When the verification result meets the preset verification conditions, it is determined that the upgrade data can be used for subsequent firmware upgrades; when the verification result does not meet the preset verification conditions, the corresponding upgrade data can be determined as abnormal data, and the transmission of the abnormal upgrade data to the corresponding microcontroller unit can be stopped. The specific abnormal handling method can be determined according to the actual upgrade strategy.

[0065] Furthermore, the central control unit 100, based on the upgrade data organization relationship described in the partition segmentation identifier header, determines the device end corresponding to the first overall upgrade data as the first device end 11, and identifies the other device ends besides the first device end 11 among the multiple device ends as the device ends to be upgraded. The first device end 11 is the pre-selected reference device end in this upgrade process, used to first complete the firmware upgrade based on the first overall upgrade data; the device ends to be upgraded are the other device ends among the multiple device ends that have not yet completed the target firmware upgrade based on this upgrade task. For example, in this embodiment, the first device end 11 serves as the reference device end, and the second device end 12, the third device end 13, the fourth device end 21, the fifth device end 31, and the sixth device end 32 are all device ends to be upgraded.

[0066] After identifying the first device terminal 11, the central control unit 100 extracts the first basic packet and the first differential packet corresponding to the first device terminal 11 from the first overall upgrade data. Since the first basic packet and the first differential packet contain differential data and dedicated differential data corresponding to MCU1, MCU2 and MCU3 respectively, the central control unit 100 can determine the upgrade data corresponding to different microcontroller units according to the aforementioned partition segmentation identifier header, and send the corresponding upgrade data to the first device terminal 11 according to the preset microcontroller unit upgrade order.

[0067] For example, the central control unit 100 can first send the differential data packet and dedicated differential packet corresponding to MCU1 to the first device terminal 11, enabling MCU1 in the first device terminal 11 to reconstruct the target firmware based on its current firmware and the received differential data packet and dedicated differential packet, and complete the firmware upgrade of MCU1. After MCU1 completes the upgrade and passes the corresponding verification, the central control unit 100 then sends the differential data packet and dedicated differential packet corresponding to MCU2 to the first device terminal 11, enabling MCU2 to complete the firmware upgrade; subsequently, the same method is used to perform the firmware upgrade on MCU3. Thus, the firmware upgrade of multiple microcontroller units in the first device terminal 11 can be completed sequentially in the order of MCU1, MCU2, and MCU3.

[0068] It should be noted that the upgrade order of MCU1, MCU2, and MCU3 described above is only an example. In practical applications, the central control unit 100 can determine the corresponding upgrade order based on the functional dependencies, firmware upgrade dependencies, or preset upgrade strategies among multiple microcontroller units; for microcontroller units that do not have strict sequential dependencies, upgrades can also be performed separately according to preset strategies.

[0069] After receiving the corresponding first base packet and first differential packet, the first device 11 performs firmware reconstruction based on the firmware currently running on the corresponding microcontroller unit, the first base packet, and the first differential packet to obtain the corresponding target firmware. The reconstructed target firmware is then written to the corresponding firmware storage area, thereby completing the firmware upgrade of the corresponding microcontroller unit. For example, for MCU1, the first device 11 can determine the data to be retained, skipped, or replaced in the current firmware according to preset differential rules, based on the firmware currently running on MCU1, the corresponding differential data packet, and the dedicated differential packet, and combine this with the newly added or changed data in the differential data packet to form the target firmware for MCU1.

[0070] Once MCU1, MCU2, and MCU3 in the first device terminal 11 have all completed their upgrades and passed the corresponding integrity checks, the firmware version of each microcontroller unit in the first device terminal 11 is updated from the corresponding current version to the target version. At this point, the first device terminal 11 becomes the baseline device terminal that has reached the target version state of this upgrade task, and the target firmware corresponding to each upgraded microcontroller unit can be used as the target firmware reference when subsequent upgrade devices perform version difference processing.

[0071] In this manner, the central control unit 100 first uses the first overall compressed package generated by the cloud 200 to complete the upgrade of the first device 11, instead of requiring the cloud to generate corresponding independent upgrade data for all devices simultaneously. After the first device 11 completes the upgrade, all its microcontroller units are in the target version state, providing a target firmware reference for the central control unit 100 to generate corresponding target base packages and target differential packages based on the current firmware versions of other devices to be upgraded. This establishes a unified target version foundation for the subsequent collaborative upgrade of multiple devices to be upgraded.

[0072] S13: Obtain the second current version information of the firmware corresponding to the device to be upgraded, and generate the target base package and target differential package corresponding to the device to be upgraded based on the second current version information, target version information and differential rules.

[0073] The second current version information corresponds to the current version file, and the target version information corresponds to the target version file. Based on the second current version information, the target version information, and the differential rules, a target base package and a target differential package corresponding to the device to be upgraded are generated. This includes: determining the longest common subsequence in the current version file and the target version file for each device to be upgraded; generating a patch file for each device to be upgraded based on the longest common subsequence and a preset instruction stream; wherein the patch file includes the same segments between the current version file and the target version file, and the different segments between the current version file and the target version file; wherein the different segments include newly added segments; extracting the newly added segments from the patch file corresponding to each device to be upgraded to generate the target base package; wherein the target base package includes the newly added segments in the patch file corresponding to each device to be upgraded; generating a quaternion instruction group based on the target base package, the current version file, and the preset quaternion instruction stream, and generating the target differential package based on the quaternion instruction group.

[0074] After the firmware upgrade is completed on the first device, the central control unit further performs local collaborative upgrade data generation on the device to be upgraded, in order to generate the target base package and target differential package corresponding to the device to be upgraded. Specifically, the central control center obtains the second current version information of the firmware corresponding to the device to be upgraded, and generates the target base package and target differential package corresponding to the device to be upgraded based on the second current version information, the target version information, and the preset differential rules.

[0075] The second current version information is used to characterize the firmware version status currently running on the device to be upgraded. The second current version information corresponds to the current version file, and the target version information corresponds to the target version file. The current version file is the firmware file currently used by the corresponding microcontroller unit in the device to be upgraded, and the target version file is the target firmware file required after the corresponding microcontroller unit completes the upgrade. Since the first device has already completed the firmware upgrade in step S12, the upgraded firmware file of the corresponding microcontroller unit in the first device can be used as the corresponding target version file. Therefore, for microcontroller units with the same module mapping relationship in different devices, the same target version file can be used for subsequent differential processing.

[0076] like Figure 5As shown, assuming the first device is P11, the devices to be upgraded include P12 and P13, and P11, P12, and P13 each include MCU1, MCU2, and MCU3. In step S12, MCU1 in P11 has already been upgraded and obtained version 06 file. Therefore, when upgrading MCU1 in P12, the central control unit uses the version 01 firmware currently running on MCU1 in P12, corresponding to the version 01 file, as the current version file, and uses the version 06 firmware after the upgrade of MCU1 in P11, corresponding to the version 06 file, as the target version file. The central control unit then locally generates the target base package and target differential package for MCU1 in P12 based on the current version file and the target version file.

[0077] Specifically, the central control unit first determines the longest common subsequence between version 01 and version 06 files. The longest common subsequence represents the identical content segments that can be matched in the same order in both versions 01 and 06. Assuming both versions 01 and 06 are binary files, X0, X1, ..., X47 represent byte data stored in address order. By comparing version 01 and version 06 byte by byte, the longest common subsequence between them is determined, thereby identifying the identical data content that can be directly reused in both versions and further determining the differences between them. Figure 5 As shown, the longest common subsequence obtained is [X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X11, X12, X13, X14, X15, X16, X17, X18, X19, X20, X21, X22, X23, X25, X26, X27, X28, X29, X30, X31, X32, X33, X34, X35, X40, X41, X42, X43, X44, X45, X46, X47].

[0078] After determining the longest common subsequence, the central control unit generates the patch file corresponding to MCU1 of P12 based on the longest common subsequence and the preset instruction stream. The preset instruction stream includes the add instruction (ADD), copy instruction (COPY), retain instruction (EXTRA), and skip instruction (JUMP). The add instruction (ADD) indicates data added or modified in the target version file relative to the current version file; the copy instruction (COPY) indicates data that can be directly reused from the current version file; the retain instruction (EXTRA) indicates data in the current version file that does not match the target version but still needs to be retained; and the skip instruction (JUMP) indicates data in the current version file that does not match the target version and does not need to be retained.

[0079] For example, if bytes 0-9 of version 01 are identical to their corresponding bytes in version 06, then COPY(0, 10) is generated; if version 06 modifies byte 10 of version 01, then ADD(Y10) is generated; if bytes 11-15 of version 01 are identical to their corresponding bytes in version 06, then COPY(11, 5) is generated; if version 06 adds data N1 at the corresponding position, then ADD(N1) is generated; if bytes 16-23 of version 01 can be directly reused, then CO is generated. PY(16, 8); If the 24th byte is modified, then ADD(Y24) is generated; If the 25th to 35th bytes of the 01 version file can be directly reused, then COPY(25, 11) is generated; If the 36th to 38th bytes of the 01 version file are no longer retained in the 06 version file, then JUMP(36, 3) is generated; If the 39th to 47th bytes can be reused, then COPY(39, 9) is generated; If the 06 version file further adds N2, N3, N4, N5, N6 and N7 at the end of the 01 version file, then the corresponding ADD instructions are generated.

[0080] Therefore, the patch file corresponding to MCU1 of P12 can be represented as: {VER(06B01),COPY(0,10),ADD(Y10),COPY(11,5),ADD(N1),COPY(16,8),ADD(Y24),COPY(25,11),JUMP(36,3),COPY(39,9),ADD(N2,N3,N4,N5,N6,N7)}.

[0081] The patch file contains COPY instructions to describe data in the 01 version file that can be reused in the target version, ADD instructions to describe data added or modified in the target version relative to the 01 version, and JUMP instructions to describe data in the 01 version file that needs to be deleted from the target version. Thus, the patch file can fully describe the data changes required to convert the 01 version file to the 06 version file.

[0082] Furthermore, the central control unit extracts new fragments from the difference segments in the patch file to generate the target base package. New fragments refer to data content that exists in the target version file but not in the current version file, or data that needs to replace existing data in the current version file. In the example above, the new fragments in the patch file include Y10, N1, Y24, and N2 to N7. Therefore, the central control unit summarizes these new fragments according to a preset data organization method to form the target base package. For example, the target base package can be represented as: {ADD(Y10), ADD(N1), ADD(Y24), ADD(N2, N3, N4, N5, N6, N7)}.

[0083] After generating the target base package, the central control unit further generates the quadruple instruction group corresponding to MCU1 of P12 based on the target base package, the current version file of version 01 corresponding to MCU1 of P12, and the preset quadruple instruction stream, and generates the target differential package based on the quadruple instruction group.

[0084] The preset quaternion instruction stream is (X, Y1, Y2, Z). X indicates that the same content as the target version file should be read from the current version file; Y1 indicates that newly added segments in the target base package that are not needed by the current device to be upgraded should be skipped; Y2 indicates that newly added segments needed by the current device to be upgraded should be read from the target base package; and Z indicates that content in the current version file that is not needed for building the target version file should be skipped. A specific instruction consisting of these four parameters is called a quaternion instruction group, which describes how data in the current version file and the target base package should be read, skipped, or replaced, respectively.

[0085] For example, based on the target base package and version 01 file mentioned above, the quad instruction set corresponding to MCU1 of P12 can be obtained as follows: {(10,0,1,1), (5,0,1,0), (8,0,1,1), (11,0,0,3), (9,0,6,0)}.

[0086] In the first quaternion instruction (10, 0, 1, 1), the 10 indicates that 10 bytes (X0 to X9) are read from the 01 version file; the first 0 indicates that there is no need to skip the data in the target base package; the second 1 indicates that 1 byte of data is read from the target base package, that is, Y10 in ADD(Y10); the last 1 indicates that X10 in the 01 version file is skipped, and Y10 is used to replace the original X10.

[0087] The second quaternion instruction (5, 0, 1, 0) means reading 5 bytes (X11 to X15) from the 01 version file, reading 1 byte of data from ADD (N1) in the target base package, and there is no need to skip the data in the 01 version file at present.

[0088] The third quaternion instruction (8, 0, 1, 1) means reading 8 bytes from X16 to X23 from the 01 version file, reading Y24 from ADD(Y24) in the target base package, and skipping X24 in the 01 version file to replace the original X24 with Y24.

[0089] The fourth quaternion instruction (11, 0, 0, 3) means reading 11 bytes (X25 to X35) from the 01 version file, without reading data from the target base package, and skipping the three bytes (X36 to X38) in the 01 version file, so as not to write the data that has been deleted in the target version into the upgraded firmware.

[0090] The fifth quaternion instruction (9, 0, 6, 0) means reading the corresponding reusable data from the 01 version file and reading 6 bytes from ADD (N2, N3, N4, N5, N6, N7) from the target base package, adding N2 to N7 to the target version file, and no longer skipping the data in the current version file.

[0091] Using the aforementioned quaternion instruction set, P12's MCU1 can read corresponding data from the local 01 version firmware and the target base package, respectively, and construct the 06 version firmware according to the data reading, data skipping, and data replacement relationships described by the quaternion instruction set. Therefore, the target differential package is actually used to describe how P12's MCU1 uses its current version file and the target base package to construct the target version file.

[0092] For MCU2 and MCU3 in P12, and MCU1, MCU2, and MCU3 in P13, the central control unit follows the same process described above to obtain the second current version information corresponding to each microcontroller unit, determine their respective current version files, and use the upgraded firmware of the corresponding microcontroller unit in P11 as the target version file. The central control unit then generates the corresponding patch file, target base package, and target differential package locally. The current version files of different microcontroller units or different devices may differ, therefore their corresponding longest common subsequence, patch files, and quaternion instruction sets may also differ. However, multiple microcontroller units with the same target version and capable of sharing new fragments can share the corresponding target base package and determine the new fragments they need to use and the data to be read or skipped from their current version files through their respective target differential packages.

[0093] It should be noted that the generation principle of the target base package and the target differential package in this embodiment is the same as that of the generation principle of the first base package and the first differential package in step S11, both based on preset differential rules. The difference is that in step S11, the cloud generates the first base package and the first differential package based on the first current version information and the target version information of the first device, while in step S13, after the upgrade of the first device has been completed, the central control unit uses the upgraded firmware of the first device as the target version reference and obtains the second current version information of the device to be upgraded. The central control unit then re-executes the process of determining the longest common subsequence, generating patch files, extracting new fragments, and generating quadruple instruction groups locally to obtain the target base package and the target differential package.

[0094] Therefore, step S13 does not require the cloud to re-execute the differential data generation process for each device to be upgraded. Instead, the central control unit, based on the actual upgrade progress, uses the upgrade result of the first device as a unified target version reference after completing the upgrade of the first device, and generates corresponding differential upgrade data locally for the current firmware version of different devices to be upgraded. This reuses existing differential rules and combines the upgrade data generation process with the actual device upgrade status, thereby transferring the differential data generation tasks of subsequent multi-device and multi-microcontroller unit upgrades to the central control unit for local completion, reducing the amount of data processing involved in the cloud, and improving the data processing efficiency of multi-device collaborative upgrades in complex parallel systems.

[0095] S14: According to the preset data packet sending strategy, send the target base packet and the target differential packet to the device to be upgraded, so that the device to be upgraded can perform firmware upgrade based on the target base packet and the target differential packet.

[0096] Specifically, according to a preset data packet sending strategy, the target base packet and the target differential packet are sent to the device to be upgraded, so that the device to be upgraded can perform firmware upgrade based on the target base packet and the target differential packet. This includes: sending the target base packet to each device to be upgraded via broadcast, and sending the target differential packet to the device to be upgraded corresponding to the target differential packet via targeted transmission, so that the device to be upgraded can obtain the same content as the target version file from the current version file based on the target differential packet and the quaternary instruction stream, and obtain the new fragment from the target base packet, so as to perform upgrade based on the new fragment.

[0097] Specifically, this embodiment employs a data packet transmission strategy combining broadcast and targeted transmission. Broadcasting sends the same target base packet to multiple devices to be upgraded, while targeted transmission sends target differential packets corresponding to different devices to be upgraded to their respective destinations. Since the target base packet provides new fragments that multiple devices to be upgraded may use during firmware upgrades, different devices can share the same target base packet. The target differential packet describes how a specific device to be upgraded selects appropriate data from its current version file and the target base packet to construct the target version file; therefore, the target differential packets for different devices can be generated separately based on their current firmware version status.

[0098] For example, suppose the devices to be upgraded include P12 and P13, and both P12 and P13 include MCU1, MCU2, and MCU3. In step S13, the central control unit generates a target base package based on the current version information and target version information of the corresponding microcontroller units in each device to be upgraded, and generates target differential packages corresponding to P12 and P13 respectively. At this time, the target base package can be used as upgrade data for both P12 and P13, while the target differential package corresponding to P12 is only used to describe how the corresponding microcontroller unit in P12 uses the target base package, and the target differential package corresponding to P13 is only used to describe how the corresponding microcontroller unit in P13 uses the target base package.

[0099] When sending upgrade data to the devices to be upgraded, the central control unit first sends the target base packet via broadcast. Broadcast means that the central control unit sends the same target base packet to multiple or even all devices to be upgraded using a single transmission method, rather than generating and sending the same target base packet to each device individually. For example, the central control unit can set the data packet corresponding to the target base packet to a preset broadcast packet type and use a preset broadcast address as the transmission identifier for the data packet, so that multiple devices such as P12 and P13 in the same upgrade task can all receive the target base packet.

[0100] In some embodiments, the data packet corresponding to the target base packet includes base packet data and a header and verification information corresponding to the base packet data. The header is used to enable the device to identify the type of the currently received data packet and determine the upgrade task corresponding to the data packet. For example, a fixed field can be used to identify the base packet, where the broadcast address can be set to 0xFF, and a preset fixed field can be used to indicate that the current data packet is a base packet. For example, in one implementation, 0xFF 0x00 can be used as the fixed field corresponding to the base packet, where 0xFF indicates that the data packet is sent in a broadcast manner, and 0x00 indicates that the current data packet is a base packet. The central control unit encapsulates the fixed fields, target version information, base packet size, target base packet, and corresponding verification information according to a preset data packet format, and then sends them to multiple devices to be upgraded through the communication link.

[0101] After receiving the target base packet broadcast, the device to be upgraded determines that the currently received data belongs to the base packet based on the data packet type identifier in the packet header, and verifies the corresponding verification information of the target base packet. If the verification passes, the device to be upgraded saves the target base packet for subsequent firmware upgrades of the corresponding microcontroller unit; if the verification fails, the current target base packet can be identified as abnormal data, and the target base packet can be re-received according to the preset abnormality handling mechanism, thereby avoiding subsequent firmware reconstruction failure due to data loss or data errors during communication.

[0102] After broadcasting the target base packet, the central control unit further transmits the target differential packets to the corresponding upgradeable devices via targeted transmission. Targeted transmission means that the central control unit assigns a target device identifier to each target differential packet based on the correspondence between the target differential packets and the devices, and only sends the corresponding target differential packet to the target device, excluding other uncorresponding devices.

[0103] For example, a device identifier corresponding to P12 can be set for the target differential packet generated by P12, and a device identifier corresponding to P13 can be set for the target differential packet generated by P13. When the central control unit sends the target differential packet corresponding to P12, it encapsulates the device identifier of P12 as the target address or target identifier into the header of the target differential packet, and sends the target differential packet to P12 through the communication link; similarly, the target differential packet corresponding to P13 is sent to P13 in the same way. Thus, P12 only needs to process the target differential packet corresponding to P12, and P13 only needs to process the target differential packet corresponding to P13, without needing to parse and process target differential packets from other devices.

[0104] In some embodiments, the data packet corresponding to the target differential packet includes differential packet data, a header, and verification information. The header includes fixed fields for identifying the current data packet type and the target device. For example, 0x01 0x01 can be used as the fixed field for the target differential packet corresponding to P12, where the first 0x01 indicates that the current data packet is a differential packet, and the second 0x01 indicates that the target device of the current data packet is the first device corresponding to a preset identifier. For other devices, the corresponding target fields are set according to the identifier of the corresponding device. The central control unit encapsulates the fixed fields, the target differential packet size, and the corresponding verification information with the target differential packet, and sends the encapsulated data to the corresponding device to be upgraded.

[0105] After receiving the targeted differential packet, the device to be upgraded determines whether the current data packet belongs to itself based on the packet header. If the device identifier in the packet header matches the device identifier of the device, the target differential packet is received and parsed; otherwise, firmware reconstruction processing is not performed on the target differential packet. This method ensures that each device to be upgraded only processes the target differential packet corresponding to itself, thereby reducing the parsing and storage of irrelevant upgrade data.

[0106] Furthermore, both the target base packet and the target differential packet carry corresponding verification information during transmission. This verification information is used to verify the integrity of the data packets during transmission. The verification information can be generated using methods such as Cyclic Redundancy Check (CRC) or hash-based checksums. For example, before sending the target base packet or target differential packet, the central control unit calculates the corresponding checksum based on the data to be sent and encapsulates the checksum into the data packet. After the upgrade device receives the data packet, it recalculates the checksum based on the received data and compares the recalculated checksum with the checksum carried in the data packet. When they match, it is determined that the corresponding data packet is complete and no transmission errors that can be detected by this verification mechanism have occurred. When they do not match, it is determined that the corresponding data packet is abnormal, and the corresponding data packet is re-requested or re-received according to the preset data retransmission mechanism.

[0107] After receiving the target base package and the target differential package, the device to be upgraded performs firmware reconstruction based on the target base package and its corresponding target differential package. Specifically, the device to be upgraded retrieves the corresponding data from the local current version file and the received target base package according to a preset reading order, based on the quadruple instruction set in the target differential package. In the quadruple instruction set, X indicates reading the same data from the current version file as the target version file; Y1 indicates skipping data in the target base package that the device to be upgraded does not need; Y2 indicates reading new fragments needed by the device to be upgraded from the target base package; and Z indicates skipping data in the current version file that is not needed for building the target version file.

[0108] For example, in step S13, taking MCU1 of P12 as an example, a corresponding target differential packet is generated, and MCU1 of P12 is currently running firmware version 01, while the target version is firmware version 06. After P12 receives the target base packet sent via broadcast and the corresponding target differential packet sent via directed transmission, MCU1 of P12 performs firmware reconstruction according to the quaternion instruction group in the target differential packet. For the quaternion instruction group (10, 0, 1, 1), MCU1 of P12 reads 10 consecutive bytes from its local firmware version 01 as the corresponding content in the target firmware, skips 0 bytes in the target base packet, further reads 1 corresponding newly added segment from the target base packet, and skips 1 byte that does not need to be retained in the current version file; then it continues to execute the next quaternion instruction group. By executing each quaternion instruction group in the target differential packet in sequence, MCU1 of P12 reuses the data that can be retained from its current firmware version and obtains the data that needs to be added or replaced from the target base packet, finally forming the target firmware version 06 according to the data arrangement relationship of the target version file.

[0109] For the other microcontroller units in P12 and each microcontroller unit in P13, the same firmware reconstruction process is performed according to their respective target differential packets. Since the target differential packets of different devices describe the data usage relationship between the current version file and the target version file of the corresponding device, even if the current firmware versions of different devices are different, each device can complete the construction of the target firmware based on the commonly received target base packet and its own corresponding target differential packet.

[0110] Furthermore, for devices comprising multiple microcontroller units, firmware upgrades for each microcontroller unit can be performed sequentially according to a preset microcontroller upgrade order. For example, P12 can sequentially perform firmware reconstruction and firmware writing for MCU1, MCU2, and MCU3. After one microcontroller unit completes its upgrade and passes the corresponding verification, the upgrade of the next microcontroller unit can be performed. Alternatively, other preset upgrade orders can be adopted based on the functional dependencies between different microcontroller units. Thus, multiple microcontroller units in the same device can gradually complete firmware updates according to a preset upgrade strategy.

[0111] Through step S14 above, the central control unit only needs to send a common target base packet to multiple devices to be upgraded once via broadcast, and then send the target differential packets corresponding to each device separately via targeted transmission. This allows multiple devices to complete firmware upgrades using common upgrade data and their respective version difference information. Compared to sending complete base data and differential data to each device separately, this method reduces the repeated transmission of the same base data and lowers the amount of duplicate data in the communication link. Simultaneously, the targeted transmission of the target differential packets eliminates the need for each device to process the differential data corresponding to other devices, reducing the reception, parsing, and storage of irrelevant data. Therefore, in complex parallel systems where multiple devices and microcontroller units are upgraded simultaneously, this method can reduce the repeated transmission of upgrade data and the data processing burden on the devices, and improve the efficiency of batch collaborative upgrades of multiple devices and microcontroller units.

[0112] In some embodiments, the method further includes: after decompressing the first overall compressed package to obtain the first overall upgrade data, performing partition segmentation header verification on the partition segmentation identifier header to obtain a first verification result; when the first verification result meets the first verification condition, sending a first retransmission instruction to the cloud to enable the cloud to send the first overall compressed package according to the first retransmission instruction; after extracting the first basic packet and the first differential packet corresponding to the first device, performing data packet verification on each data segment in the first basic packet and each data segment in the first differential packet to obtain a second verification result; when the second verification result meets the second verification condition, determining the target data segment, and generating and sending a second retransmission instruction to the cloud according to the target data segment to enable the cloud to send the data segment corresponding to the target data segment according to the second retransmission instruction.

[0113] Specifically, in step S12, after receiving the first overall compressed package sent from the cloud, the central control unit first decompresses the first overall compressed package to obtain the first overall upgrade data. Since the header of the first overall upgrade data is set with a partition segmentation identifier header, which is used to describe the data type, data location, data size, and corresponding verification information of different microcontroller units, the central control unit first performs partition segmentation header verification on the partition segmentation identifier header before further parsing and sorting the first overall upgrade data based on the partition segmentation identifier header.

[0114] The partition segment header verification is used to verify whether the partition segment identifier header obtained by the central control unit after decompression is complete, and whether any errors have occurred in the identifier information within the partition segment identifier header during transmission. Specifically, the central control unit calculates a checksum based on the data content corresponding to each field in the partition segment identifier header, and compares the calculated checksum with the checksum carried in the partition segment identifier header to obtain a first verification result. When the calculated checksum matches the carried checksum, the first verification result indicates that the partition segment identifier header verification has passed; when they do not match, the first verification result indicates that the partition segment identifier header verification has failed.

[0115] When the first verification result indicates that the partition segmentation header verification fails (but the first verification condition is met), the central control unit generates a first retransmission instruction and sends it to the cloud. The first retransmission instruction instructs the cloud to resend the first overall compressed package corresponding to the current upgrade task. Upon receiving the first retransmission instruction, the cloud can re-acquire or resend the corresponding first overall compressed package. After receiving the resent first overall compressed package, the central control unit re-executes decompression and partition segmentation header verification.

[0116] Through the above processing, the organization information of the overall upgrade data can be quickly verified using the partition segmentation header located at the top of the data, even before the overall upgrade data has been effectively sorted. When the partition segmentation header is abnormal, the parsing and data extraction of erroneous partition information will not continue. Instead, the data will be re-acquired directly for the first overall compressed package, thereby avoiding the subsequent incorrect sorting or processing of multiple data segments due to header information errors.

[0117] After the partition segmentation header verification passes, the central control unit parses the first overall upgrade data based on the partition segmentation identifier header to determine the first basic packet and the first differential packet corresponding to the first device. It then further extracts the corresponding data segments according to the data type and data location of each microcontroller unit. Since the first basic packet and the first differential packet can each include upgrade data corresponding to multiple microcontroller units, after data extraction, the central control unit further performs data packet verification on each extracted data segment.

[0118] The packet verification is used to verify whether the specific upgrade data segments in the first base packet and the first differential packet are complete and whether any transmission errors have occurred. Unlike the aforementioned verification of the entire partition segmentation header, packet verification uses specific data segments as the verification object. The central control unit can independently verify each data segment based on the verification information corresponding to each data segment, and determine the second verification result based on the verification results of each data segment.

[0119] For example, after sorting, the first overall upgrade data yields differential data segments and dedicated differential data segments corresponding to MCU1, MCU2, and MCU3. For each data segment, the central control unit performs verification on the actually extracted data content based on the verification information corresponding to that data segment in the partition segmentation header. When the calculated verification value of a data segment matches its carried verification value, the data segment is determined to have passed verification; when the calculated verification value of a data segment does not match its carried verification value, the data segment is determined to have failed verification, and the data segment is identified as a target data segment with an anomaly.

[0120] When the second verification result indicates that a data segment has failed verification (meeting the second verification condition), the central control unit determines the target data segment based on the data segment that failed verification and generates a second retransmission instruction based on the target data segment. The second retransmission instruction instructs the cloud to only retransmit the upgrade data corresponding to the target data segment, without retransmitting the complete first overall compressed package.

[0121] For example, suppose the central control center has successfully extracted all upgrade data corresponding to MCU1, MCU2, and MCU3 after completing the partition header verification. However, when performing data packet verification on the dedicated differential data segment corresponding to MCU1, it finds that the verification value of this data segment is inconsistent with the preset verification value. In this case, the dedicated differential data segment corresponding to MCU1 is identified as the target data segment. At this time, the central control center generates a second retransmission instruction containing information such as the target data segment identifier, the corresponding microcontroller unit identifier, and the data type, and sends the second retransmission instruction to the cloud to request the cloud to resend the dedicated differential data segment corresponding to MCU1.

[0122] After receiving the second retransmission command, the cloud determines the upgrade data that needs to be retransmitted based on the target data segment indicated in the command, and retransmits the data segment corresponding to the target data segment to the central control unit. Upon receiving the retransmitted data segment, the central control unit can perform data packet verification on that segment again. If the verification passes, the re-received data segment replaces the original faulty data segment, and the subsequent firmware upgrade process continues; if the verification still fails, retransmission can be performed again for that target data segment.

[0123] Therefore, this embodiment establishes a hierarchical verification mechanism for different data levels. First, the partition segmentation header in the overall upgrade data is verified. After confirming the data organization information is correct, independent verification is then performed on each upgrade data segment determined by the partition segmentation header. Since the previous level of verification ensures the correctness of the partition information used for subsequent data parsing, and the subsequent level of verification further determines the integrity of specific upgrade data segments, the problem of inaccurate data location when using only a single verification method can be avoided.

[0124] Furthermore, the retransmission mechanism in this embodiment employs different retransmission granularities based on the data level at which the anomaly occurs. When the partition segmentation header verification fails, since the location and size of each upgraded data segment cannot be reliably determined at this time, the first overall compressed package is used as the retransmission target, and the cloud re-sends the first overall compressed package. However, when the partition segmentation header verification passes, but the specific upgraded data segment verification fails, since the central control unit can already determine the location, type, and corresponding microcontroller unit of the abnormal data segment, it is not necessary to re-acquire the complete first overall compressed package. Instead, a second retransmission instruction is generated only for the abnormal target data segment, and the cloud is requested to re-send the corresponding data segment.

[0125] In some embodiments, the retransmission mechanism described above can also be triggered for different abnormal situations. Besides the aforementioned verification failure, when the central control unit detects that upgrade data has been lost, or when the upgrade process is not completed normally due to reasons such as power outage or communication interruption, it can also determine the target data segment that has not been successfully received or processed based on the currently saved upgrade status, and trigger the corresponding retransmission request. For example, if a device experiences a power outage and restarts after completing the MCU1 upgrade, the central control center can determine from the upgrade status feedback from that device that the upgrade data corresponding to MCU2 has not been successfully received or processed. Therefore, it is not necessary to retransmit the successfully completed MCU1 upgrade data; instead, a retransmission can be performed for the upgrade data corresponding to MCU2.

[0126] Furthermore, the central control center can record the number of retransmissions for the same target data segment or the same overall upgrade data, and set a preset maximum number of retransmissions. For example, the number of consecutive retransmission failures for the same data segment can be accumulated. When the number of retransmissions reaches the preset number, such as more than 3 times without passing the verification, the central control center will stop infinitely retransmitting the data segment and generate an abnormal alarm message. This will notify the operation and maintenance personnel of the abnormal status of the corresponding device, microcontroller unit, and target data segment for further manual handling.

[0127] It should be noted that the aforementioned partition header verification and data packet verification are mainly performed by the central control center unit to ensure the integrity of upgrade data organization information and specific upgrade data segments on the central control center side. In addition to the hierarchical verification on the central control center side, in some embodiments, firmware splicing verification can be further set on the device side to form a multi-level reliability assurance mechanism that cooperates with the verification on the central control center side.

[0128] Specifically, after receiving the target base packet and its corresponding target differential packet, the device to be upgraded reads the corresponding data from the current version file and the target base packet according to the quaternion instruction group in the target differential packet and concatenates them to form the target version file. After the target version file is generated, the device can perform firmware concatenation verification on the generated target version file to verify whether the concatenated target firmware is complete and meets the integrity requirements corresponding to the target version. Firmware concatenation verification can use CRC check to reduce the computing and storage resources required for verification by the device. In one embedded implementation, the RAM occupied by the verification process can be controlled within 100 bytes, making it suitable for resource-constrained embedded controllers such as the STM32F103VCT6.

[0129] When the firmware splicing verification on the device side passes, it is determined that the target firmware corresponding to the current microcontroller unit is correctly constructed, and the firmware writing, version switching, or upgrade of the next microcontroller unit continues. When the firmware splicing verification fails, it indicates that there may be an anomaly in the upgrade data reception, data processing, or firmware splicing process. The device side can send a retransmission request for the corresponding microcontroller unit to the central control unit, so that the central control unit can further retransmit the upgrade data corresponding to that microcontroller unit.

[0130] This embodiment verifies upgrade data sequentially at the control center level, following a hierarchy of "partition segmentation header verification – specific data segment verification." For verification anomalies at different levels, it employs different retransmission granularities: "overall upgrade data retransmission – precise retransmission of abnormal data segments." This allows for narrowing the retransmission range based on the location of the anomaly. Furthermore, by combining firmware splicing verification at the device end, upgrade results can be verified during both the data transmission and target firmware generation stages. This improves the reliability of remote upgrades for multiple devices and microcontroller units in complex parallel systems without significantly increasing the resource burden on embedded devices.

[0131] This application provides a method for remotely upgrading a device, by upgrading a complex parallel system (such as...). Figure 1 The firmware upgrade process of multiple devices and multiple microcontroller units in the system is uniformly organized, and combined with differential upgrade, overall compression, partitioning, local collaborative generation of reference devices, and data transmission methods combining broadcast and directional, the generation, organization, transmission, sorting and retransmission of upgrade data can form a collaborative processing mechanism, thereby improving the efficiency and reliability of remote upgrade of multiple devices and multiple firmware in complex parallel systems.

[0132] First, this application uses a first device among multiple devices as the base device. The cloud generates a first basic packet and a first differential packet specifically for the multiple microcontroller units corresponding to the first device. A partitioning header is used to identify upgrade data for different microcontroller units and different data types. Then, the aforementioned data is uniformly organized and compressed into a first overall compressed packet. This allows for the unified organization of multiple upgrade data sets that were originally generated and transmitted separately for different microcontroller units. While preserving the independent identification capability of each microcontroller unit's upgrade data, redundant information between different upgrade data sets is used for unified compression.

[0133] Secondly, this application sets a partition segmentation header in the first overall upgrade data and parses the partition segmentation header first after decompression. This allows for the rapid determination of the location of different upgrade data segments based on information such as microcontroller unit type, data type, data start position, and data size. Compared to methods that require segment-by-segment scanning and identification of the overall upgrade data, the central control unit can directly locate the corresponding upgrade data based on pre-set partition information, achieving rapid sorting of upgrade data. Furthermore, the partition segmentation header uses a fixed-field organization method, resulting in simple parsing logic and low resource consumption, making it suitable for resource-constrained embedded control environments such as the STM32F103VCT6.

[0134] Furthermore, this application, after completing the upgrade on the first device, uses the target firmware version of the corresponding microcontroller unit in the first device as the target version reference for the corresponding microcontroller unit on subsequent devices to be upgraded. The central control unit then generates the corresponding target base package and target differential package locally based on the current version information of each device to be upgraded. Therefore, it eliminates the need for the cloud to perform a differential data generation process for each device to be upgraded separately. Instead, the central control unit utilizes the target version reference already obtained to complete the upgrade data generation for subsequent devices locally, thereby transferring a large amount of repetitive upgrade data generation processing from the cloud to the central control unit.

[0135] Furthermore, this application employs a combined "broadcast + targeted" transmission method, broadcasting a common target base packet to multiple devices to be upgraded, while targeted transmission of the target differential packets corresponding to different devices based on device identifiers. Since the common target base packet does not need to be repeatedly transmitted for different devices, the redundant transmission of identical upgrade data can be further reduced. Simultaneously, each device only receives and processes its own corresponding target differential packet, without needing to parse differential data from other devices, thus reducing the data reception, parsing, and storage burden on the devices. Combined with unified compression and a differential upgrade mechanism, this improves the efficiency of batch collaborative upgrades for multiple devices and microcontroller units.

[0136] Furthermore, this application establishes a hierarchical verification and retransmission mechanism for different data levels. The central control unit first verifies the partition segmentation header. After confirming the correctness of the partition organization information of the first overall upgrade data, it then performs data packet verification on each specific upgrade data segment. When the partition segmentation header is abnormal, it re-requests the cloud to send the overall compressed package. However, when only a specific data segment is abnormal, it only requests the re-sending of the corresponding target data segment. Further, after the device completes the target firmware assembly based on the target base packet and target differential packet, it can also perform integrity verification on the assembled target firmware. If the verification fails, it requests the corresponding microcontroller unit to re-acquire the upgrade data. Thus, the retransmission granularity can be determined according to the level of the abnormality, avoiding the retransmission of all upgrade data when a single data segment is incorrect, improving upgrade reliability while reducing the waste of communication resources caused by abnormal retransmissions.

[0137] Finally, this application combines the aforementioned differential upgrade mechanism with multiple devices, multiple microcontroller units, and intra- and inter-group communication relationships, enabling the same upgrade logic to be applicable to different numbers of devices and different numbers and types of microcontroller units. By adjusting the microcontroller unit quantity identifier and the corresponding data segment quantity in the partition segmentation header, it can adapt to multi-microcontroller unit devices of different scales. Simultaneously, the centralized control center unit manages upgrade data between different device groups uniformly and utilizes communication connections between devices within a group to achieve collaborative upgrades, adapting to application scenarios involving multi-module and multi-device collaborative operation, such as photovoltaic energy storage, industrial control, and smart grids. Therefore, this application not only reduces the data transmission and cloud processing burden during remote upgrades of complex parallel systems but also improves the efficiency of upgrade data sorting, batch distribution, and anomaly recovery, demonstrating good scalability, compatibility, and engineering application value.

[0138] Example 5 Please see Figure 6 , Figure 6 This is a flowchart illustrating a remote upgrade method for a device according to another embodiment of this application. This method is applied to the aforementioned cloud 200. For example... Figure 6 As shown, the method includes steps S21-S24: S21: Obtain the first current version information and target version information of the firmware corresponding to any one of the multiple device terminals.

[0139] S22: Based on the first current version information, the target version information, and the preset differential rules, obtain the first base package and the first differential package.

[0140] S23: Generate the first overall upgrade data based on the first base package, the first differential package, and the preset partition segmentation header.

[0141] S24: Compress the first overall upgrade data to obtain the first overall compressed package, and send the first overall compressed package to the central control unit.

[0142] In some embodiments, the partition segmentation header includes a microcontroller unit quantity identifier and a microcontroller unit group data segment set; the microcontroller unit quantity identifier is used to identify the type and quantity of microcontroller units; the microcontroller unit group data segment set includes multiple identifier data segments; wherein, each identifier data segment includes a type identifier field, a start address field, a data volume field, and a checksum field; the microcontroller unit group data segment set is used to identify the upgrade data location, upgrade data size, and upgrade data type of all microcontroller units in the device.

[0143] It should be noted that the implementation process of the remote upgrade method for the device provided in this embodiment (such as steps S21-S24) has been described in detail in the above embodiment four. For technical details not described in detail in this embodiment, please refer to the remote upgrade method for the device in embodiment four, and will not be repeated here.

[0144] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of this application as described above, which are not provided in detail for the sake of brevity; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for remotely upgrading equipment, characterized in that, The method is applied to a centralized control center unit, which is communicatively connected to multiple device terminals and a cloud. The multiple device terminals are divided into multiple device groups according to a preset networking relationship, and communication connections are established between the device terminals within each device group. Each device terminal includes multiple microcontroller units, and the multiple device terminals belong to the same device type. Furthermore, the multiple microcontroller units in different device terminals correspond to each other according to a preset module mapping relationship. The system receives a first overall compressed package sent by the cloud; wherein the first overall compressed package is obtained by the cloud after compressing the first overall upgrade data generated by the first basic package, the first differential package, and the preset partition segmentation identifier header; wherein the first basic package and the first differential package are obtained by the cloud based on the first current version information, target version information, and preset differential rules of the firmware corresponding to any one of the multiple device terminals; Based on the first overall compressed package, a first device and a device to be upgraded are determined, and the firmware of the first device is upgraded; wherein, the device to be upgraded is a device other than the first device among a plurality of device devices; Obtain the second current version information of the firmware corresponding to the device to be upgraded, and generate a target base package and a target differential package corresponding to the device to be upgraded based on the second current version information, the target version information and the differential rules; According to a preset data packet sending strategy, the target base packet and the target differential packet are sent to the device to be upgraded, so that the device to be upgraded can perform firmware upgrade based on the target base packet and the target differential packet.

2. The remote upgrade method for the device according to claim 1, characterized in that, The step of determining the first device and the device to be upgraded based on the first overall compressed package, and performing a firmware upgrade on the first device, includes: The first overall compressed package is decompressed to obtain the first overall upgrade data; wherein, the first overall upgrade data includes the partition segmentation identifier header, the first base package, and the first differential package; Based on the partition segmentation identifier header, the first overall upgrade data is parsed and processed to determine the device end corresponding to the first overall upgrade data as the first device end, determine the device end other than the first device end among the multiple device ends as the device end to be upgraded, and extract the first basic package and the first differential package corresponding to the first device end; The first base packet and the first differential packet are sent to the first device so that the first device can perform a firmware upgrade based on the first base packet and the first differential packet.

3. The remote upgrade method for the device according to claim 1, characterized in that, The second current version information corresponds to the current version file, and the target version information corresponds to the target version file. The step of generating a target base package and a target differential package corresponding to the device to be upgraded, based on the second current version information, the target version information, and the differential rules, includes: Determine the longest common subsequence in the current version file and the target version file for each device in the device to be upgraded; Based on the longest common subsequence and the preset instruction stream, a patch file is generated for each device in the device to be upgraded; wherein, the patch file includes the same segment between the current version file and the target version file, and the difference segment between the current version file and the target version file; wherein, the difference segment includes newly added segments; New fragments are extracted from the patch files corresponding to each device in the device to be upgraded to generate the target base package; wherein, the target base package includes the new fragments in the patch files corresponding to each device in the device to be upgraded; Based on the target base package, the current version file, and the preset quaternary instruction stream, a quaternary instruction set is generated, and based on the quaternary instruction set, the target differential package is generated.

4. The remote upgrade method for the device according to claim 3, characterized in that, The step of sending the target base packet and the target differential packet to the device to be upgraded according to a preset data packet sending strategy, so that the device to be upgraded can perform firmware upgrade based on the target base packet and the target differential packet, includes: The target base packet is broadcast to each of the devices to be upgraded, and the target differential packet is sent to the corresponding device in the devices to be upgraded via a targeted transmission method. This enables the devices in the devices to be upgraded to obtain the same content as the target version file from the current version file based on the target differential packet and the quaternary instruction stream, and to obtain the new fragment from the target base packet, so as to perform the upgrade based on the new fragment.

5. The remote upgrade method for the device according to claim 2, characterized in that, The method further includes: After decompressing the first overall compressed package to obtain the first overall upgrade data, the partition segmentation header is verified to obtain the first verification result. When the first verification result meets the first verification condition, a first retransmission instruction is sent to the cloud so that the cloud sends the first overall compressed package according to the first retransmission instruction. After extracting the first base packet and the first differential packet corresponding to the first device, data packet verification is performed on each data segment in the first base packet and each data segment in the first differential packet to obtain a second verification result. When the second verification result meets the second verification condition, the target data segment is determined, and a second retransmission instruction is generated and sent to the cloud based on the target data segment, so that the cloud can send the data segment corresponding to the target data segment according to the second retransmission instruction.

6. A method for remotely upgrading a device, characterized in that, Applied to the cloud, the central control unit is communicatively connected to multiple device terminals and the cloud; the multiple device terminals are divided into multiple device groups according to a preset networking relationship, and communication connections are established between the device terminals within each device group; each device terminal includes multiple microcontroller units, the multiple device terminals belong to the same device type, and the multiple microcontroller units in different device terminals correspond to each other according to a preset module mapping relationship, the method includes: Obtain the first current version information and target version information of the firmware corresponding to any one of the multiple device terminals; Based on the first current version information, the target version information, and the preset differential rules, a first base package and a first differential package are obtained; Based on the first base package, the first differential package, and the preset partition segmentation header, generate the first overall upgrade data; The first overall upgrade data is compressed to obtain a first overall compressed package, and the first overall compressed package is sent to the central control unit.

7. The remote upgrade method for the device according to claim 6, characterized in that, The partition segmentation header includes a microcontroller unit quantity identifier and a set of microcontroller unit grouped data segments. The microcontroller unit quantity identifier is used to identify the type and quantity of microcontroller units. The set of microcontroller unit grouped data segments includes multiple identifier data segments. Each identifier data segment includes a type identifier field, a start address field, a data volume field, and a checksum field. The set of microcontroller unit grouped data segments is used to identify the upgrade data location, upgrade data size, and upgrade data type of all microcontroller units in the device.

8. A centralized control center unit, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1-5.

9. A cloud platform, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 6-7.

10. A remote upgrade system for equipment, characterized in that, include: The control center unit as described in claim 8, the multiple device terminals, and the cloud as described in claim 9; the control center unit is communicatively connected to the multiple device terminals and the cloud respectively; the multiple device terminals are divided into multiple device groups according to a preset networking relationship, and communication connections are established between the device terminals in each device group; each device terminal includes multiple microcontroller units, the multiple device terminals belong to the same device type, and the multiple microcontroller units in different device terminals correspond to each other according to a preset module mapping relationship.