Firmware upgrading method and device based on partition management and embedded equipment

By dividing the embedded device into a head area, a tail area, and a blank area, and combining differential patching and compression techniques, efficient firmware upgrades for embedded devices are achieved, solving the problem of wasted storage resources and improving upgrade storage efficiency.

CN121858141APending Publication Date: 2026-04-14ASR MICROELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-16
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In the process of differential firmware upgrades for existing embedded devices, storage resources are wasted significantly, and limited storage space cannot be used efficiently, especially for devices with large firmware sizes.

Method used

By employing partition management and compression technology, the storage space of the embedded device is divided into a front-end area, a back-end area, and a blank area. The front-end area stores the original firmware data, the back-end area stores the compressed firmware data, and the blank area serves as a shared space. Differential patches and compressed data are stored alternately to avoid wasting extra storage space.

Benefits of technology

It significantly reduces the storage space consumption for firmware upgrades of embedded devices, requiring only a single blank area for shared space, reducing the need for dual reservation of storage resources, improving upgrade storage efficiency, and adapting to embedded devices with limited storage resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121858141A_ABST
    Figure CN121858141A_ABST
Patent Text Reader

Abstract

The invention discloses a firmware upgrading method and device based on partition management and embedded equipment, and the method comprises the steps: 1, obtaining a differential patch, carrying out the differential solving operation through the differential patch and compressed firmware data, obtaining upgraded firmware compressed data, storing the upgraded firmware compressed data in a head end accommodation region, and storing the upgraded firmware compressed data in a head end accommodation region; the initial address of the head end accommodating area is recorded as the initial address of the compressed data of the upgrade firmware, and the differential patch is obtained by differentiating a compressed packet obtained by compressing the original firmware data and the upgrade firmware data; and step 2, performing decompression processing on the upgrade firmware compressed data to obtain upgrade firmware decompressed data, storing the upgrade firmware decompressed data in the tail end accommodating area, and recording the initial address of the tail end accommodating area as the initial address of storage of the upgrade firmware decompressed data so as to complete upgrade. According to the method, the storage space consumption of firmware upgrading of the embedded equipment is remarkably reduced, and an independent storage space equivalent to the firmware in size does not need to be additionally distributed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of embedded systems technology, and more specifically to a firmware upgrade method, apparatus, and embedded device based on partition management. Background Technology

[0002] like Figure 1 As shown, the existing embedded device full-package differential upgrade process mainly includes the following three steps: First, read the current firmware data from the firmware storage area, perform differential operation with the downloaded differential patch file, and generate new firmware data; Second, store the newly generated firmware data in an additional storage space that can accommodate the complete new firmware; Third, copy and burn the new firmware data to the original firmware partition to complete the upgrade.

[0003] In existing technologies, because new firmware data cannot be dynamically written directly to the existing firmware partition during differential upgrades, and because the differential operation may call data from the existing firmware partition at any time, the integrity of the partition's data during the upgrade must be ensured. Therefore, in the above process, the capacity of the additional storage space is usually equivalent to the firmware itself, which significantly increases the storage burden on embedded devices. For embedded systems with limited storage resources, especially devices with large firmware sizes, the problem of insufficient storage space is even more prominent. Furthermore, the firmware storage area and the additional space required for differential upgrades are usually two independent areas of similar capacity, and both need to reserve a certain amount of margin to meet future upgrade needs, which further results in a double waste of storage resources.

[0004] Therefore, how to efficiently implement firmware differential upgrades within limited storage resources has become a pressing technical challenge. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a firmware upgrade method, apparatus and embedded device based on partition management, so as to at least solve the problems existing in the prior art.

[0006] The embodiments of the present invention provide the following technical solutions: This invention provides a firmware upgrade method based on partition management and compression, applied to the storage space of an embedded device. The embedded device storage space includes a start area, a stop area, and a blank area formed between the start area and the stop area. The start area pre-stores the original firmware data, and the starting address of the start area is recorded as the firmware boot address. The stop area pre-stores compressed firmware data obtained by compressing the original firmware data, and the starting address of the stop area is recorded as the compressed firmware start address. The method includes: Step 1: Obtain the differential patch, and use the differential patch and the compressed firmware data to perform dedifferential operation to obtain the upgraded firmware compressed data. Store the upgraded firmware compressed data in the first end storage area, and record the first address of the first end storage area as the starting address of the upgraded firmware compressed data. The differential patch is obtained by differentially processing the compressed package obtained by compressing the original firmware data and the upgraded firmware data. Step 2: Decompress the compressed data of the upgrade firmware to obtain decompressed upgrade firmware data, and store the decompressed upgrade firmware data in the end-of-line storage area. Record the first address of the end-of-line storage area as the starting address of the decompressed upgrade firmware data storage to complete the upgrade.

[0007] Furthermore, when upgrading the firmware in subsequent updates, steps 1-2 are repeated, and the first and last accommodating areas are used alternately to store the compressed data and the original data of the subsequent firmware upgrade, respectively.

[0008] Furthermore, before pre-storing the original firmware data, a comprehensive partition is allocated in the embedded device storage space. The first-end accommodating area is located at the beginning of the comprehensive partition, the last-end accommodating area is located at the end of the comprehensive partition, and the blank area is located between the first-end accommodating area and the last-end accommodating area, which is shared during the process of alternately storing the upgraded firmware compressed data and the upgraded firmware original data in the first-end accommodating area and the last-end accommodating area.

[0009] Furthermore, the size of the integrated partition is configured to simultaneously accommodate the size of the original firmware data, the size of the compressed firmware data, and the upgrade reserve space required by the blank area.

[0010] Furthermore, before performing step 2, the estimated size of the decompressed upgrade firmware data is calculated based on the compressed upgrade firmware data, and then the decompressed upgrade firmware data is stored in the terminal storage area based on the estimated size.

[0011] Furthermore, the differential patch is generated by performing a differential operation on the compressed package of the original firmware data and the compressed package of the upgraded firmware data using a differential tool.

[0012] Furthermore, after storing the decompressed data of the upgrade firmware in step 2, the data startup firmware is loaded from the starting address of the decompressed data storage of the upgrade firmware.

[0013] Furthermore, during subsequent alternating storage, the storage locations of the upgraded firmware compressed data and the upgraded firmware original data are always separated by the white space, and the white space continues to serve as a shared reserved space for each upgrade.

[0014] This invention also provides an embedded firmware upgrade device based on partition management and compression, applied to an embedded device. The embedded device's storage space includes a head area, an end area, and a blank area formed between the head area and the end area. The device includes: The communication module is used to obtain differential patches, which are obtained by differentially analyzing the compressed package obtained by compressing the original firmware data and the upgraded firmware data. The storage management module is used to dynamically manage the comprehensive partition consisting of the first-end storage area, the last-end storage area, and the blank area. It pre-stores the original firmware data to the first-end storage area and records the first address of the first-end storage area as the firmware start address. It also pre-stores the compressed firmware data obtained after compressing the original firmware data to the last-end storage area and records the first address of the last-end storage area as the compressed firmware start address. It is also used to record the start address of the compressed data of the upgrade firmware and the start address of the decompressed data of the upgrade firmware. The upgrade processing module is used to perform differential decompression, compression / decompression, and data transfer operations. It uses the differential patch obtained by the communication module and the compressed firmware data pre-stored in the end-of-line storage area to perform differential decompression to obtain upgraded firmware compressed data. The upgraded firmware compressed data is transferred to the beginning-of-line storage area and the address is recorded by the storage management module. The upgraded firmware compressed data is decompressed to obtain upgraded firmware decompressed data. The upgraded firmware decompressed data is transferred to the end-of-line storage area and the address is recorded by the storage management module to complete the firmware upgrade.

[0015] This invention also provides an embedded device for performing any of the firmware upgrade methods described above.

[0016] Compared with the prior art, the beneficial effects that the at least one technical solution adopted in the embodiments of the present invention can achieve include at least: This invention discloses a firmware upgrade method based on partition management. The method divides the device storage space into a first-end area, a last-end area, and a blank area in between. The first-end area pre-stores the original firmware data and records the firmware startup address. The last-end area pre-stores compressed data of the original firmware and records the compressed firmware start address. During the upgrade, a differential patch is first obtained based on the difference between the original firmware and the upgraded firmware compressed package. This patch is then dedifferentiated with the compressed firmware data to obtain the upgraded firmware compressed data, which is stored in the first-end area and its address is recorded. The upgraded firmware compressed data is then decompressed and stored in the last-end area, and its address is recorded, thus completing the upgrade. This significantly reduces the storage space consumption for embedded device firmware upgrades. It eliminates the need for additional independent storage space equivalent to the firmware size, avoids double reservations by sharing a single blank area, and reduces data volume using compression technology. The storage requirement is optimized to "original firmware size + compressed data size + single reserved space," effectively solving the space waste problem of traditional differential upgrades, adapting to embedded devices with limited storage resources, and improving upgrade storage efficiency. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the existing whole package differential upgrade process; Figure 2 This is an upgrade flowchart of a firmware upgrade method based on partition management according to an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the entire process of a firmware upgrade method based on partition management according to an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the changes in storage data in a firmware upgrade method based on partition management according to an embodiment of the present invention. Figure 5 This is a module diagram of a firmware upgrade device based on partition management according to an embodiment of the present invention. Detailed Implementation

[0019] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0020] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. This application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this application, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number and aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.

[0022] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. The drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0023] Additionally, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that practice can be carried out without these specific details.

[0024] The technical solutions provided by the various embodiments of this application are described below with reference to the accompanying drawings.

[0025] like Figure 2-4As shown, this embodiment of the invention provides a firmware upgrade method based on partition management, applied to the storage space of an embedded device. The embedded device storage space includes a first-end storage area, a last-end storage area, and a blank area formed between the first-end storage area and the last-end storage area. The first-end storage area pre-stores the original firmware data, and the first address of the first-end storage area is recorded as the firmware start address. The last-end storage area pre-stores the compressed firmware data obtained after compressing the original firmware data, and the first address of the last-end storage area is recorded as the compressed firmware start address.

[0026] Before pre-storing the original firmware data, a comprehensive partition is allocated in the embedded device's storage space. The first-end storage area is located at the beginning of the comprehensive partition, the last-end storage area is located at the end of the comprehensive partition, and the blank area is located between the first-end and last-end storage areas. This blank area is used for sharing during the process of alternately storing the compressed data of the upgrade firmware and the original data of the upgrade firmware in the first-end and last-end storage areas.

[0027] The overall partition size is configured to accommodate the original firmware data, the compressed firmware data, and the upgrade reserve space required for the blank area.

[0028] The firmware boot address is the firmware address used when the system boots for the first time.

[0029] This invention integrates and manages storage resources by allocating a single comprehensive partition and dividing it into a head / tail storage area and a blank area, avoiding the scattered layout of traditional dual independent partitions. The head storage area pre-stores the original firmware and records the firmware boot address, allowing the original firmware to be addressed by the system without decompression, ensuring the efficiency and stability of the first boot and clearly defining the core boot address. The tail storage area pre-stores compressed firmware and records the starting address, which can significantly reduce the firmware storage volume. At the same time, clearly defining the address facilitates quick location and retrieval of compressed data during upgrades, reducing search time. The blank area, as a shared space, can meet the temporary need of "alternating storage of compressed and original firmware data" during each upgrade, without the need to reserve independent space for different partitions.

[0030] The method includes: Step 1: Obtain the differential patch, and use the differential patch and compressed firmware data to perform dedifferential operation to obtain the upgraded firmware compressed data. Store the upgraded firmware compressed data in the first-end storage area, and record the first address of the first-end storage area as the starting address of the upgraded firmware compressed data. The differential patch is obtained by differentially processing the compressed package obtained by compressing the original firmware data and the upgraded firmware data.

[0031] The differential patch is generated by performing differential operations on the compressed package of the original firmware data and the compressed package of the upgrade firmware data using a differential tool.

[0032] Before storing the upgraded firmware compressed data in the first-end storage area, the data stored in the first-end storage area can be deleted before storage.

[0033] When creating a differential patch, the original firmware package data and the upgrade firmware package data to be upgraded are first obtained from the embedded device. Then, a compression algorithm is used to compress the original firmware package data and the upgrade firmware package data respectively to generate corresponding original firmware compressed packages and upgrade firmware compressed packages. Finally, a differential tool is used to perform differential operations on the original firmware compressed package and the upgrade firmware compressed package, extract the difference data between the two and encapsulate it to obtain the differential patch for subsequent upgrades.

[0034] By using compressed firmware data as a base and dedifferentiating it with differential patches, the volume advantage of the original compressed data can be reused, and the compressed data required for the upgrade can be accurately obtained through differential calculation. In addition, storing the compressed upgrade firmware data in the initial storage area and recording the starting address provides a clear location basis for subsequent decompression and boot processes, and also avoids data corruption.

[0035] Step 1 uses a compression-then-differential approach to concentrate the differential data, resulting in a patch that is significantly smaller than a patch directly differentially applied to the original firmware. This reduces network traffic and temporary device storage usage during the upgrade process. Furthermore, the dedifferentialized data remains compressed, further saving storage space compared to generating a complete original upgrade firmware, making it suitable for embedded devices with limited storage. Finally, a standardized patch generation process and explicit address recording ensure smooth workflow between differential dedifferentiation, storage, and subsequent decompression, preventing data location errors or process interruptions. Additionally, the processing efficiency of compressed data is higher than that of processing large amounts of raw data.

[0036] Step 2: Decompress the compressed data of the upgrade firmware to obtain the decompressed upgrade firmware data, and store the decompressed upgrade firmware data in the end storage area. Record the first address of the end storage area as the starting address of the data storage of the decompressed upgrade firmware data to complete the upgrade.

[0037] Before executing step 2, the estimated size of the decompressed upgrade firmware data is calculated based on the compressed upgrade firmware data. Then, the decompressed upgrade firmware data is stored in the end-of-line storage area based on the estimated size. This is used to predict the actual volume of the decompressed upgrade firmware in advance, avoid decompression failure or data overflow due to insufficient space in the end-of-line storage area, provide a basis for storage allocation, and ensure that the decompressed upgrade firmware data can be fully adapted to the end-of-line storage area, so as not to waste extra space or affect the integrity of data storage due to insufficient space.

[0038] After storing the decompressed data of the upgrade firmware in step 2, the data is loaded from the starting address of the decompressed data storage to start the firmware. This clarifies the addressing entry point of the upgrade firmware, allowing the system to accurately locate and load the upgrade firmware, completing the closed loop of the upgrade process and ensuring the normal operation of the device after the upgrade.

[0039] Step 2 avoids space adaptation issues in embedded device storage scenarios by pre-calculating the size and ensuring accurate storage, reducing upgrade failures such as decompression failure and data loss, and eliminating the need to reserve excessive redundant space for the end-capacity area, allocating storage only according to the actual estimated size.

[0040] In subsequent firmware upgrades, steps 1-2 are repeated, and the first and last storage areas are used alternately to store the compressed data and the original data of the subsequent firmware upgrades, respectively. This eliminates the need for additional physical partitions and enables firmware data storage by simply switching locations, maximizing the reuse of the existing space in the comprehensive partition.

[0041] During subsequent alternating storage, the storage locations of the upgraded firmware compressed data and the upgraded firmware original data are always separated by a blank area. The blank area continues to serve as a shared reserved space for each upgrade, and the upgraded firmware compressed data and original data are always separated by the blank area to avoid the two types of data overlapping or conflicting, thus ensuring data integrity during the upgrade process.

[0042] The blank space continues to serve as a shared space for each upgrade, eliminating the need to reserve separate space for each upgrade and maintaining the core design of a single reserved area to avoid duplication and waste.

[0043] like Figure 2 As shown, the following is a schematic flowchart of a specific implementation of the present invention: Step S1: Generate differential patch after firmware compression: Use a differential tool to compress the old and new firmware separately, and then perform differential processing on the two compressed packages to generate a differential patch.

[0044] Step S2: Allocate a whole space in the embedded device's storage space. This space is large enough to accommodate the original firmware data size, the compressed firmware data size, and the upgrade blank space size, serving as a comprehensive partition for firmware storage and upgrades.

[0045] Step S3: Store the uncompressed raw firmware at the beginning of the integrated partition, and record the starting address as the firmware storage address; this address will be used as the firmware address for the first system boot firmware.

[0046] The compressed data of the original firmware is stored at the end of the integrated partition, and the starting address is recorded as the starting address of the compressed firmware; the area between the firmware storage data and the compressed firmware data is reserved as a blank area for future upgrades.

[0047] Step S4: After receiving the differential patch, the differential upgrade process uses the differential patch and the data of the compressed firmware to dedifferentiate, obtains the compressed data of the generated upgrade firmware, and stores it at the beginning of the uncompressed firmware storage partition used by the original system, marking it as the new compressed firmware starting address.

[0048] Step S5: Based on the new compressed firmware data generated in Step S4, calculate the decompressed size of the new original firmware, and store the decompressed new firmware data at the end of the integrated partition. The firmware start position is marked as the new firmware storage start address; the middle part between the new firmware compressed data and the decompressed upgrade firmware original data is used as a blank area for subsequent upgrades.

[0049] Step S6: After the upgrade is complete, load the data from the new firmware's original data storage area to start the firmware.

[0050] Step S7: In subsequent upgrades, steps S4-S5 are repeated similarly, except that the two data locations are alternated. New firmware compressed data is generated based on the current compressed storage data and differential patch. After calculating the size, it is stored at the end of the comprehensive partition. Then, the new firmware compressed data is decompressed to the beginning of the comprehensive partition and marked as the new firmware storage location. The middle area is left as a blank area.

[0051] In this way, the two data areas can share a single storage area and alternately switch locations to achieve the process of differential upgrade each time.

[0052] The following is a specific differential upgrade process according to an embodiment of the present invention: Upon receiving the differential patch, the differential patch and the compressed firmware data are used to perform a dedifferentiation operation to obtain the target firmware compressed data generated by the differential patch. This data is then stored at the starting position of the original firmware storage used by the original system and marked as the new compressed firmware starting address.

[0053] Retrieve the new compressed firmware data from the new compressed firmware starting address, calculate the decompressed size of the new original firmware, decompress the new firmware data and store it at the end of the comprehensive partition, marking it as the new firmware storage address.

[0054] The middle section between the new firmware compressed data and decompressed data serves as a blank area for subsequent upgrades.

[0055] After the upgrade is complete, boot the firmware from the new firmware storage address.

[0056] Finally, the process of subsequent upgrades: Similar to the first upgrade process, new firmware compressed data is generated based on the current compressed storage area and differential patch. After calculating the size, it is stored at the end of the comprehensive partition.

[0057] The new firmware compressed data is then decompressed and placed at the beginning of the integrated partition, marking it as the new firmware storage location, with the middle area left blank. This process of alternating between the two storage data domains enables the differential firmware upgrade process.

[0058] Compared with the traditional whole-packet differential upgrade process, the firmware upgrade method of the present invention has the following advantages: The differential upgrade method described in this invention improves storage efficiency. Traditional upgrade schemes require an additional storage space equivalent to the firmware size. Therefore, the total storage requirement is equivalent to 2 × (firmware size + reserved space). The space requirement of this invention is firmware size + compressed size + single reserved space; further reducing the space of the entire firmware size to the space required for firmware compression. Therefore, the storage space required for firmware upgrades is smaller, saving storage space consumption.

[0059] Furthermore, the firmware storage area and compressed data area described in this method dynamically alternate using the same physical space, with the blank area shared by the compression / decompression process, avoiding double reservation. This further reduces storage space consumption.

[0060] like Figure 5 As shown, this embodiment of the invention also provides a firmware upgrade device based on partition management, applied to an embedded device. The embedded device's storage space includes a head-end area, a tail-end area, and a blank area formed between the head-end and tail-end areas. The device includes: a communication module for acquiring differential patches, wherein the differential patches are obtained by differentially analyzing compressed packages obtained from the original firmware data and the upgraded firmware data; a storage management module for dynamically managing the comprehensive partitions formed by the head-end area, tail-end area, and blank area, pre-storing the original firmware data in the head-end area and recording the head address of the head-end area as the firmware boot address, pre-storing the compressed firmware data obtained from compressing the original firmware data in the tail-end area and recording the head address of the tail-end area as the compressed firmware start address, and also recording the start address of the upgraded firmware compressed data and the start address of the upgraded firmware decompressed data storage; and an upgrade processing module for performing differential decompression operations, compression / ... The decompression and data transfer operation uses the differential patch obtained by the communication module and the pre-stored compressed firmware data in the end-of-line storage area to perform differential decompression calculations to obtain the upgraded firmware compressed data. The upgraded firmware compressed data is transferred to the beginning-of-line storage area and the address is recorded by the storage management module. The upgraded firmware compressed data is then decompressed to obtain the upgraded firmware decompressed data. The upgraded firmware decompressed data is then transferred to the end-of-line storage area and the address is recorded by the storage management module to complete the firmware upgrade.

[0061] This invention also provides an embedded device for performing any of the firmware upgrade methods described above.

[0062] In this specification, the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the product embodiments described later, since they correspond to the methods, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions in the system embodiments.

[0063] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A firmware upgrade method based on partition management, characterized in that, An embedded device storage space is used, comprising a head region, a tail region, and a blank area formed between the head region and the tail region. The head region pre-stores raw firmware data, and the starting address of the head region is recorded as the firmware boot address. The tail region pre-stores compressed firmware data obtained by compressing the raw firmware data, and the starting address of the tail region is recorded as the compressed firmware start address. The method includes: Step 1: Obtain the differential patch, and use the differential patch and the compressed firmware data to perform dedifferential operation to obtain the upgraded firmware compressed data. Store the upgraded firmware compressed data in the first end storage area, and record the first address of the first end storage area as the starting address of the upgraded firmware compressed data. The differential patch is obtained by differentially processing the compressed package obtained by compressing the original firmware data and the upgraded firmware data. Step 2: Decompress the compressed data of the upgrade firmware to obtain decompressed upgrade firmware data, and store the decompressed upgrade firmware data in the end-of-line storage area. Record the first address of the end-of-line storage area as the starting address of the decompressed upgrade firmware data storage to complete the upgrade.

2. The firmware upgrade method according to claim 1, characterized in that, When upgrading the firmware in the future, repeat steps 1-2, and alternately use the first end storage area and the last end storage area to store the compressed data and the original data of the subsequent firmware upgrade respectively.

3. The firmware upgrade method according to claim 1, characterized in that, Before pre-storing the original firmware data, a comprehensive partition is allocated in the embedded device storage space. The first-end accommodating area is located at the beginning of the comprehensive partition, the last-end accommodating area is located at the end of the comprehensive partition, and the blank area is located between the first-end accommodating area and the last-end accommodating area. This blank area is shared during the process of alternately storing the upgraded firmware compressed data and the upgraded firmware original data in the first-end accommodating area and the last-end accommodating area.

4. The firmware upgrade method according to claim 3, characterized in that, The size of the integrated partition is configured to simultaneously accommodate the size of the original firmware data, the size of the compressed firmware data, and the upgrade reserve space required by the blank area.

5. The firmware upgrade method according to claim 1, characterized in that, Before performing step 2, the estimated size of the decompressed upgrade firmware data is calculated based on the compressed upgrade firmware data. Then, the decompressed upgrade firmware data is stored in the terminal storage area based on the estimated size.

6. The firmware upgrade method according to claim 1, characterized in that, The differential patch is generated by performing a differential operation on the compressed package of the original firmware data and the compressed package of the upgraded firmware data using a differential tool.

7. The firmware upgrade method according to claim 1, characterized in that, After storing the decompressed data of the upgrade firmware in step 2, the data is loaded from the starting address of the decompressed data storage of the upgrade firmware to start the firmware.

8. The firmware upgrade method according to claim 2, characterized in that, During subsequent alternating storage, the storage locations of the upgraded firmware compressed data and the upgraded firmware original data are always separated by the white space, and the white space continues to serve as a shared reserved space for each upgrade.

9. A firmware upgrade device based on partition management, characterized in that, Applied to embedded devices, the embedded device storage space includes a front end accommodating area, a rear end accommodating area, and a blank area formed between the front end accommodating area and the rear end accommodating area, the device comprising: The communication module is used to obtain differential patches, which are obtained by differentially analyzing the compressed package obtained by compressing the original firmware data and the upgraded firmware data. The storage management module is used to dynamically manage the comprehensive partition consisting of the first-end storage area, the last-end storage area, and the blank area. It pre-stores the original firmware data to the first-end storage area and records the first address of the first-end storage area as the firmware start address. It also pre-stores the compressed firmware data obtained after compressing the original firmware data to the last-end storage area and records the first address of the last-end storage area as the compressed firmware start address. It is also used to record the start address of the compressed data of the upgrade firmware and the start address of the decompressed data of the upgrade firmware. The upgrade processing module is used to perform differential decompression, compression / decompression, and data transfer operations. It uses the differential patch obtained by the communication module and the compressed firmware data pre-stored in the end-of-line storage area to perform differential decompression to obtain upgraded firmware compressed data. The upgraded firmware compressed data is transferred to the beginning-of-line storage area and the address is recorded by the storage management module. The upgraded firmware compressed data is decompressed to obtain upgraded firmware decompressed data. The upgraded firmware decompressed data is transferred to the end-of-line storage area and the address is recorded by the storage management module to complete the firmware upgrade.

10. An embedded device, characterized in that, Used to perform the firmware upgrade method according to any one of claims 1-8.