A differential upgrading method, device, equipment and readable storage medium

By using the status flag value of the difference block and the real-time update mechanism, the problem of high FLASH resource consumption in the differential upgrade scheme is solved, and differential upgrades are realized on small embedded platforms, reducing resource requirements.

CN116069377BActive Publication Date: 2026-05-19WUHAN TIANYU INFORMATION IND
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN TIANYU INFORMATION IND
Filing Date
2023-02-24
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing differential upgrade schemes require a large amount of FLASH resources to back up old version data, resulting in insufficient resources for small embedded platforms and preventing widespread use.

Method used

The update status is determined by the status flag value of the difference block. The status flag value of the difference block is updated in real time, and the decompression differential upgrade is performed to generate a new differential package. The difference block data is backed up in real time to avoid backing up old version data.

Benefits of technology

It effectively reduces the consumption of FLASH resources and lowers the resource requirements during the upgrade process, making it suitable for small embedded platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116069377B_ABST
    Figure CN116069377B_ABST
Patent Text Reader

Abstract

The application relates to a differential upgrading method and device, equipment and a readable storage medium, and relates to the technical field of small mobile terminal equipment upgrading. The application comprises the following steps: sequentially obtaining the state mark value of each difference block from a parameter area, and determining the update state of the difference block according to the state mark value; if the update state of the difference block is in an unfinished update state, decompression differential upgrading is carried out, and the state mark value of the record difference block is updated in real time to represent the update state of the difference block until all the difference blocks are updated. The application realizes differential upgrading through the update of the difference block, does not need to back up the old version data, reduces the FLASH resource utilization rate in the backup process, and effectively reduces the resource consumption of the FLASH.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of small mobile terminal device upgrade technology, and in particular to a differential upgrade method, apparatus, device and readable storage medium. Background Technology

[0002] With the continuous development of software technology, the firmware packages of embedded products are getting bigger and bigger. In order to greatly reduce the size of the upgrade package, differential upgrade schemes have been widely used in various embedded product fields, such as mobile phones, tablets, and in-vehicle multimedia.

[0003] Existing differential upgrade schemes generally employ the bsdiff open-source differential algorithm combined with some compression algorithm to obtain a small upgrade package. However, during the upgrade process, to prevent abnormal interruptions that could prevent the device from reverting to normal mode, backup space is often used to back up the old version data; however, this secure backup process consumes a large amount of FLASH space, meaning that existing differential upgrade schemes require a significant amount of FLASH resources to meet the secure backup requirements. Since small embedded platforms have extremely limited resources, existing differential upgrade schemes cannot be widely used on small embedded platforms. Summary of the Invention

[0004] This application provides a differential upgrade method, apparatus, device, and readable storage medium to solve the problem of high FLASH resource consumption caused by the need to back up old version data during differential upgrades in related technologies.

[0005] Firstly, a differential upgrade method is provided, including the following steps:

[0006] The status flag value of each difference block is obtained sequentially from the parameter area, and the update status of the difference block is determined based on the status flag value;

[0007] If the update status of the difference block is incomplete, decompression differential upgrade is performed, and the status flag value of the difference block is updated in real time to represent the update status of the difference block, until all difference blocks are updated.

[0008] In some embodiments, if the update status of the difference block is incomplete, then decompression differential upgrade is performed, and the status flag value of the difference block is updated in real time to characterize the update status of the difference block, including:

[0009] If the update status of the difference block is incomplete, the initial difference package and the old version upgrade package are decompressed and restored to obtain a temporary upgrade package;

[0010] A new differential package is generated based on the temporary upgrade package, the old version upgrade package, and the difference block;

[0011] Differential upgrades are performed based on the new differential packets, and the status flag values ​​of the differential blocks are updated in real time to indicate that the update status of the differential blocks is in the completed update state.

[0012] In some embodiments, generating a new differential package based on the temporary upgrade package, the old version upgrade package, and the difference block includes:

[0013] Based on the temporary upgrade package and the old version upgrade package, the original difference block data corresponding to the difference block in the old version upgrade package and the target difference block data corresponding to the difference block in the temporary upgrade package are determined respectively.

[0014] The original difference block data is backed up to the original block backup area, and the status flag value of the difference block is updated to indicate that the update status of the difference block is that the difference block data backup is complete.

[0015] The target difference block data is overwritten to the old version upgrade package to generate a new upgrade package;

[0016] A new differential package is generated based on the temporary upgrade package and the new upgrade package.

[0017] In some embodiments, after the step of determining the update state of the difference block based on the state flag value, the method further includes:

[0018] If the update status of the difference block is "difference block data backup completed", the target original difference block data corresponding to the difference block is restored from the original block backup area;

[0019] The old version upgrade package that has an anomaly is updated based on the target original difference block data to obtain the original old version upgrade package;

[0020] The initial differential package and the original old version upgrade package are decompressed and restored to obtain a new temporary upgrade package. Based on the new temporary upgrade package and the original old version upgrade package, the process of generating a new differential package according to the temporary upgrade package, the old version upgrade package and the difference block is executed.

[0021] In some embodiments, after the step of generating a new differential package based on the temporary upgrade package and the new upgrade package, the method further includes:

[0022] The new differential packet is backed up to the differential packet backup area, and the status flag value of the differential block is updated to indicate that the update status of the differential block is that the differential packet backup is complete.

[0023] In some embodiments, after the step of determining the update state of the difference block based on the state flag value, the method further includes:

[0024] If the update status of the difference block is "differential packet backup completed", the target differential packet corresponding to the difference block is obtained from the differential packet backup area, and the differential upgrade based on the new differential packet is performed based on the target differential packet.

[0025] In some embodiments, there is a mapping relationship between the status flag value and the system power-down region, and the method further includes:

[0026] When an abnormal power outage occurs during system upgrade, the target power outage area is located based on the status flag value and the mapping relationship.

[0027] Secondly, a differential upgrade device is provided, comprising:

[0028] A state determination unit is used to sequentially obtain the state flag value of each difference block from the parameter area, and determine the update state of the difference block based on the state flag value;

[0029] The upgrade and update unit is used to perform decompression differential upgrade if the update status of the difference block is incomplete, and to update the status flag value of the record difference block in real time to represent the update status of the difference block until all difference blocks are updated.

[0030] Thirdly, a differential upgrade device is provided, comprising: a memory and a processor, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the aforementioned differential upgrade method.

[0031] Fourthly, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned differential upgrade method.

[0032] This application provides a differential upgrade method, apparatus, device, and readable storage medium, including sequentially obtaining the status flag value of each differential block from a parameter area, and determining the update status of the differential block based on the status flag value; if the update status of the differential block is incomplete, then decompression differential upgrade is performed, and the status flag value of the differential block is updated in real time to characterize the update status of the differential block, until all differential blocks are updated. This application achieves differential upgrade by updating differential blocks, eliminating the need to back up old version data, thereby reducing FLASH resource usage during the backup process and effectively reducing FLASH resource consumption. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0034] Figure 1 A flowchart illustrating a differential upgrade method provided in an embodiment of this application;

[0035] Figure 2 This is a schematic diagram of the upgrade process provided in an embodiment of this application;

[0036] Figure 3 This is a schematic diagram of the partitioning provided in an embodiment of this application;

[0037] Figure 4 This is a schematic diagram illustrating the key locations that cause upgrade anomalies, provided in an embodiment of this application.

[0038] Figure 5 This is a schematic diagram of the structure of a differential upgrade device provided in an embodiment of this application. Detailed Implementation

[0039] 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 completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0040] This application provides a differential upgrade method, apparatus, device, and readable storage medium, which can solve the problem of high FLASH resource consumption caused by the need to back up old version data for differential upgrades in related technologies.

[0041] See Figure 1 and Figure 2 As shown in the figure, this application provides a differential upgrade method, including the following steps:

[0042] Step S10: Sequentially obtain the status flag value of each difference block from the parameter area, and determine the update status of the difference block based on the status flag value;

[0043] Exemplary, see Figure 3As shown, in this embodiment, the FLASH storage area will be partitioned to store different objects. Specifically, the FLASH storage area will be divided into at least five regions: a first partition (diff_pkg), a second partition (diff_pkg_bak), a third partition (block_bak), a fourth partition (param), and a fifth partition (app_pkg). The diff_pkg region is used to store differential packets, the diff_pkg_bak region is used to back up differential packets, the block_bak region (i.e., the block backup region) is used to back up the original differential block data, the param region (i.e., the parameter region) is used to store upgrade parameters, including key flags, such as status flag values ​​indicating whether the differential blocks have been updated, and the app_pkg region (i.e., the region to be upgraded or the target upgrade region) is used to store the old version data corresponding to the old version upgrade package. In addition, an app_pkg_temp region is set in RAM or other memory to store temporary upgrade packages generated during the upgrade process.

[0044] It should be understood that the difference block in this embodiment represents the difference data between the temporary upgrade package and the old version upgrade package. That is, through the difference block, both the original difference block data corresponding to it in the old version upgrade package and the target difference block data corresponding to it in the temporary upgrade package can be determined. It should be noted that in this embodiment, the differences between the temporary upgrade package and the old version upgrade package can be compared according to a block size (i.e., BLOCK_SIZE) to obtain multiple difference blocks between the temporary upgrade package and the old version upgrade package and the difference block number of each difference block. The original difference block data and the target difference block data corresponding to it are then found through the difference block number, and subsequent differential upgrades are performed based on the found difference block data.

[0045] It is understandable that the update status of the difference blocks will change during the differential upgrade process. In this embodiment, the update status of the difference blocks will be represented by a status flag value `block_flag`, and the status flag value of each difference block will be stored in the parameter area (i.e., the param area). Thus, the param area stores (FLASH_SIZE / BLOCK_SIZE) `block_flag` values, where `FLASH_SIZE` represents the size of the FLASH file containing the `app_pkg` (i.e., the old version upgrade package), and `BLOCK_SIZE` represents the size of the difference block, which can preferably be defined as 4K. Furthermore, this embodiment preferably uses bit-modification atomic operations to store the status flag values, eliminating the need for erasure and thus ensuring the absolute security of the status flag values.

[0046] The status flag values ​​can be used to represent states including, but not limited to, the following: differential block update incomplete, differential block data backup completed, differential packet backup completed, and update completed. For example, 0xffff, 0xfffe, 0xfffc, and 0xfff8 can be used as status flag values, i.e., 0xffff indicates incomplete update, 0xfffe indicates completed differential block data backup, 0xfffc indicates completed differential packet backup, and 0xfff8 indicates completed update of the new differential packet. It should be noted that the above is only an example presentation, and other values ​​can also be used to represent the status flag values, which are not limited here.

[0047] Since there may be multiple difference blocks between the temporary upgrade package and the old version upgrade package, when differential upgrade is required in this embodiment, the status flag value of each difference block needs to be obtained sequentially from the param area. The update status of each difference block is determined based on the status flag value of the difference block. The update status of the difference block can then be used to determine whether all difference blocks between the temporary upgrade package and the old version upgrade package have completed differential upgrade.

[0048] Step S20: If the update status of the difference block is incomplete, perform decompression differential upgrade and update the status flag value of the difference block in real time to represent the update status of the difference block until all difference blocks are updated.

[0049] As an example, in this embodiment, the decision to perform decompression differential upgrade based on the update status of the difference block will be determined based on the difference block. For example, if the update status of a difference block is incomplete, it means that the difference block data corresponding to the difference block has not yet been differentially upgraded. In this case, it is necessary to find the corresponding difference block data from the temporary upgrade package and the old version upgrade package based on the difference block and perform decompression differential upgrade. The status update of the difference block during the decompression differential upgrade process will be adjusted, that is, the status flag value of the difference block will be updated and recorded in real time to represent the update status of the difference block.

[0050] Meanwhile, since there are often multiple difference blocks between the temporary upgrade package and the old version upgrade package, before performing differential upgrade based on each difference block, it is necessary to determine whether all difference blocks have been compared and searched. If not, differential upgrade is performed based on the difference blocks, and the previous steps are repeated until all difference blocks are updated. If yes, it means that all difference blocks have been updated and differential upgrade has been completed based on all difference blocks, and the differential upgrade ends directly.

[0051] Furthermore, if the update status of the difference block is incomplete, then decompression differential upgrade is performed, and the status flag value of the difference block is updated in real time to characterize the update status of the difference block, including:

[0052] If the update status of the difference block is incomplete, the initial difference package and the old version upgrade package are decompressed and restored to obtain a temporary upgrade package;

[0053] A new differential package is generated based on the temporary upgrade package, the old version upgrade package, and the difference block;

[0054] Differential upgrades are performed based on the new differential packets, and the status flag values ​​of the differential blocks are updated in real time to indicate that the update status of the differential blocks is in the completed update state.

[0055] In this exemplary embodiment, when it is determined that the update status of the difference block is incomplete, indicating that decompression differential upgrade is required, the initial differential package diff_pkg is decompressed using the bz2 data compression algorithm. Then, the bsdiff differential algorithm is used to restore the decompressed diff_pkg and the old version upgrade package app_pkg into a temporary upgrade package app_pkg_temp, and app_pkg_temp is temporarily stored in RAM. Next, the bz2 data compression algorithm and the bsdiff differential algorithm are used to generate a new differential package based on app_pkg_temp, app_pkg, and the difference block data corresponding to the difference block, and this new differential package is stored in the diff_pkg_bak area. Finally, differential upgrade is performed based on this new differential package, and the status flag value block_flag of the difference block is updated and recorded as 0xfff8 in real time to indicate that the update status of the difference block is complete. This is recorded in the param area, thus completing the safe update of the new differential package.

[0056] Furthermore, the step of generating a new differential package based on the temporary upgrade package, the old version upgrade package, and the difference block includes:

[0057] Based on the temporary upgrade package and the old version upgrade package, the original difference block data corresponding to the difference block in the old version upgrade package and the target difference block data corresponding to the difference block in the temporary upgrade package are determined respectively.

[0058] The original difference block data is backed up to the original block backup area, and the status flag value of the difference block is updated to indicate that the update status of the difference block is that the difference block data backup is complete.

[0059] The target difference block data is overwritten to the old version upgrade package to generate a new upgrade package;

[0060] A new differential package is generated based on the temporary upgrade package and the new upgrade package.

[0061] As an example, in this embodiment, the target difference block data and the original difference block data will be found from the temporary upgrade package app_pkg_temp and the old version upgrade package app_pkg respectively according to the difference block number corresponding to the difference block. Specifically, when comparing the differences between the temporary upgrade package app_pkg_temp and the old version upgrade package app_pkg according to a block size, the difference block number corresponding to each difference block can be obtained. Then, the original difference block data in the old version upgrade package app_pkg corresponding to the difference block number and the target difference block data in the temporary upgrade package app_pkg_temp corresponding to the difference block number can be determined by the difference block number. At this time, the original difference block data can be backed up to the original block backup area to complete the safe backup of one block of the original data, and the status flag value block_flag of the difference block is updated to 0xfffe to indicate that the update status of the difference block is that the difference block data backup is completed, that is, the safe backup of the original block data of app_pkg is completed. At the same time, the target difference block data is overwritten to the old version upgrade package to generate a new upgrade package, and then a new differential package is generated based on the temporary upgrade package and the new upgrade package.

[0062] Furthermore, after the step of determining the update status of the difference block based on the status flag value, the method further includes:

[0063] If the update status of the difference block is "difference block data backup completed", the target original difference block data corresponding to the difference block is restored from the original block backup area;

[0064] The old version upgrade package that has an anomaly is updated based on the target original difference block data to obtain the original old version upgrade package;

[0065] The initial differential package and the original old version upgrade package are decompressed and restored to obtain a new temporary upgrade package. Based on the new temporary upgrade package and the original old version upgrade package, the process of generating a new differential package according to the temporary upgrade package, the old version upgrade package and the difference block is executed.

[0066] As an example, it is understandable that during the differential upgrade process, the system may experience an abnormal power outage, which may prevent the differential upgrade from being completed. Furthermore, the old version upgrade package may have been corrupted during the differential upgrade process before the power outage. In this case, the only option is to retrieve the backed-up old version data after power is restored and perform the differential upgrade again.

[0067] However, in this embodiment, since the differential packets and differential block data involved in the differential upgrade process are backed up and the status flag values ​​of the differential blocks are stored, when an abnormal power outage occurs and power is restored, the corresponding differential packets or differential block data will be obtained according to the stored status flag values ​​of the differential blocks to perform the differential upgrade, without having to back up the old version to perform the differential upgrade again.

[0068] Specifically, when the update status of the difference block is detected as "difference block data backup complete" (i.e., the status flag value is 0xfffe), it indicates that reliable original difference block data has been backed up in the original block backup area block_bak in FLASH. Therefore, the original difference block data in the old version upgrade package can be recovered from the block_bak area, and the old version upgrade package that has malfunctioned (i.e., the corrupted old version upgrade package) is updated based on this original difference block data to obtain the original old version upgrade package (i.e., the old version upgrade package before corruption). Then, the initial difference package and the original old version upgrade package are decompressed and restored using the bz2 data compression algorithm and the bsdiff differential algorithm to obtain a new temporary upgrade package. A new difference package is then generated based on the new temporary upgrade package and the original old version upgrade package, and finally, differential upgrade is implemented based on the new difference package.

[0069] Furthermore, after the step of generating a new differential package based on the temporary upgrade package and the new upgrade package, the method further includes:

[0070] The new differential packet is backed up to the differential packet backup area, and the status flag value of the differential block is updated to indicate that the update status of the differential block is that the differential packet backup is complete.

[0071] In this exemplary embodiment, during the differential upgrade process, after a new differential packet is generated, it can be backed up to the `diff_pkg_bak` area. This allows for direct differential upgrades based on the backed-up differential packet in the event of an abnormal power outage, without needing to re-acquire the complete old version upgrade packet, i.e., without backing up the old version upgrade packet. The status flag value `block_flag` of the differential block is marked as 0xfffc to indicate that the differential block update status is in the "differential packet backup complete" state, and the updated status flag value is recorded in the `param` area. This completes the secure backup of the new differential packet. Therefore, under normal circumstances, the `block_flag` of an unupdated differential block is equal to 0xffff, and the `block_flag` of an updated differential block is equal to 0xfff8. When the differential block update process is fully completed, `block_flag` may be equal to 0xfffe or 0xfffc.

[0072] Furthermore, after the step of determining the update status of the difference block based on the status flag value, the method further includes:

[0073] If the update status of the difference block is "differential packet backup completed", the target differential packet corresponding to the difference block is obtained from the differential packet backup area, and the differential upgrade based on the new differential packet is performed based on the target differential packet.

[0074] As an example, it should be understood that when the update status of the difference block is detected as "differential packet backup complete" (i.e., the status flag value is 0xfffc), it means that a reliable new differential packet has been backed up in the diff_pkg_bak area of ​​the FLASH. Therefore, the new differential packet backed up in the diff_pkg_bak area can be updated to diff_pkg, and then differential upgrade can be performed based on the new differential packet in diff_pkg.

[0075] Furthermore, there is a mapping relationship between the status flag value and the system power-down region, and the method further includes:

[0076] When an abnormal power outage occurs during system upgrade, the target power outage area is located based on the status flag value and the mapping relationship.

[0077] As an example, in this embodiment, see Figure 4 As shown, this illustrates potential upgrade anomalies in this embodiment, identifying five abnormal power-down points. These anomalies will cause the status flag value `block_flag` of the difference block to equal different values, indicating a mapping relationship between `block_flag` and the system power-down region. Specifically:

[0078] When the abnormal power outage occurs in "power outage area 1", block_flag equals 0xffff;

[0079] When the abnormal power outage occurs in "power outage region 2", block_flag equals 0xfffe;

[0080] When the abnormal power failure occurs in "power failure area 3", block_flag equals 0xfffc;

[0081] When the abnormal power outage occurs in "power outage area 4", the block_flag of the difference block that has been updated is equal to 0xfff8, and the block_flag of the difference block that has not been updated is equal to 0xffff.

[0082] When the abnormal power outage occurs in "power outage zone 5", block_flag equals 0xfffe.

[0083] Therefore, when an abnormal power outage occurs during a system upgrade, the target power outage area can be located based on the specific value of the status flag and the mapping relationship, and then power restoration can be performed based on the target power outage area.

[0084] Furthermore, it is understood that in this embodiment, differential upgrades can be implemented by setting up a differential packet generation module, an upgrade management module, and an upgrade anomaly recovery module. The differential packet generation module can use the mainstream BSDiff differential algorithm + BZ2 compression algorithm to generate differential packets; the upgrade management module manages the upgrade process, including dynamic secure overwrite and backup functions; and the upgrade anomaly recovery module manages the anomaly recovery process. During the upgrade process, the new firmware version restored from the BSDiff differential packet is compared with the old firmware version in the storage area, and the difference block number is recorded. The minimum block size is the smallest erasable unit, with no maximum limit. During this period, the BSDiff differential packet, the difference block content, and the difference block number are recorded and stored in real time.

[0085] In summary, the FLASH space consumed during the security upgrade process in this embodiment is: diff_pkg + diff_pkg_bak + block_bak + param; where diff_pkg and diff_pkg_bak are the sizes of the differential packets, block_bak is the size of the differential block backup, and param is the size of the parameter area. It should be noted that block_bak can be customized, with a minimum and preferred definition of 4K. A smaller block_bak results in a slower upgrade speed and less resource consumption, and vice versa; the param area can preferably be defined as 4K.

[0086] Taking the problem of insufficient FLASH resources in a certain Cortex-R5-based CAT.1 embedded platform that prevents the implementation of application upgrade functions as an example, its full upgrade package is about 700K. If a full upgrade solution is adopted, at least 1.4M of FLASH space will be required. If the mainstream differential upgrade solution is adopted, 700K+48K (48K represents the size of the differential package) of FLASH space will be required. However, using the differential upgrade method provided in this embodiment, only 48K+48K+4K+4K of FLASH space is required.

[0087] Therefore, this embodiment provides a secure differential upgrade method with low resource consumption. It mainly achieves differential upgrade by updating the differential block, so that there is no need to back up the old version data. Since the size of the differential package is much smaller than the old version firmware package, the FLASH usage rate during the secure backup process can be reduced by backing up the differential package, thereby effectively reducing the FLASH resource consumption. It can be applied to the firmware upgrade or database upgrade functions of current small embedded mobile terminal devices.

[0088] This application also provides a differential upgrade device, including:

[0089] A state determination unit is used to sequentially obtain the state flag value of each difference block from the parameter area, and determine the update state of the difference block based on the state flag value;

[0090] The upgrade and update unit is used to perform decompression differential upgrade if the update status of the difference block is incomplete, and to update the status flag value of the record difference block in real time to represent the update status of the difference block until all difference blocks are updated.

[0091] Furthermore, the upgrade and update unit is specifically used for:

[0092] If the update status of the difference block is incomplete, the initial difference package and the old version upgrade package are decompressed and restored to obtain a temporary upgrade package;

[0093] A new differential package is generated based on the temporary upgrade package, the old version upgrade package, and the difference block;

[0094] Differential upgrades are performed based on the new differential packets, and the status flag values ​​of the differential blocks are updated in real time to indicate that the update status of the differential blocks is in the completed update state.

[0095] Furthermore, the upgrade and update unit is specifically used for:

[0096] Based on the temporary upgrade package and the old version upgrade package, the original difference block data corresponding to the difference block in the old version upgrade package and the target difference block data corresponding to the difference block in the temporary upgrade package are determined respectively.

[0097] The original difference block data is backed up to the original block backup area, and the status flag value of the difference block is updated to indicate that the update status of the difference block is that the difference block data backup is complete.

[0098] The target difference block data is overwritten to the old version upgrade package to generate a new upgrade package;

[0099] A new differential package is generated based on the temporary upgrade package and the new upgrade package.

[0100] Furthermore, the upgrade and update unit is specifically used for:

[0101] If the update status of the difference block is "difference block data backup completed", the target original difference block data corresponding to the difference block is restored from the original block backup area;

[0102] The old version upgrade package that has an anomaly is updated based on the target original difference block data to obtain the original old version upgrade package;

[0103] The initial differential package and the original old version upgrade package are decompressed and restored to obtain a temporary upgrade package. Based on the temporary upgrade package and the original old version upgrade package, a new differential package is generated according to the temporary upgrade package, the old version upgrade package and the difference block.

[0104] Furthermore, the upgrade and update unit is specifically used for:

[0105] The new differential packet is backed up to the differential packet backup area, and the status flag value of the differential block is updated to indicate that the update status of the differential block is that the differential packet backup is complete.

[0106] Furthermore, the upgrade and update unit is specifically used for:

[0107] If the update status of the difference block is "differential packet backup completed", the target differential packet corresponding to the difference block is obtained from the differential packet backup area, and the differential upgrade based on the new differential packet is performed based on the target differential packet.

[0108] Furthermore, there is a mapping relationship between the status flag value and the system power failure area, and the device also includes an anomaly recovery unit, which is used for:

[0109] When an abnormal power outage occurs during system upgrade, the target power outage area is located based on the status flag value and the mapping relationship.

[0110] It should be noted that those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the device and each unit described above can be referred to the corresponding process in the aforementioned differential upgrade method embodiments, and will not be repeated here.

[0111] The apparatus provided in the above embodiments can be implemented as a computer program, which can be used in, for example... Figure 5 It runs on the differential upgrade device shown.

[0112] This application also provides a differential upgrade device, including: a memory, a processor, and a network interface connected via a system bus. The memory stores at least one instruction, which is loaded and executed by the processor to implement all or part of the steps of the aforementioned differential upgrade method.

[0113] The network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 5The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0114] A processor can be a CPU, or other general-purpose processors, DSPs (Digital Signal Processors), ASICs (Application Specific Integrated Circuits), FPGAs (Field Programmable Gate Arrays), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor, or any conventional processor. The processor is the control center of a computer device, connecting all parts of the computer device through various interfaces and lines.

[0115] Memory can be used to store computer programs and / or modules. The processor implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory. Memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, at least one application program required for a function (such as video playback, image playback, etc.), etc.; the data storage area can store data created based on the use of the mobile phone (such as video data, image data, etc.). Furthermore, memory can include high-speed random access memory (RAM), and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, SMC (SmartMediaCard), SD (Secure Digital) cards, flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.

[0116] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements all or part of the steps of the aforementioned differential upgrade method.

[0117] The embodiments of this application can implement all or part of the aforementioned processes, or they can be accomplished by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various methods described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, ROM (Read-Only memory), RAM (Random Access memory), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0118] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, servers, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0119] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0120] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0121] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A differential upgrade method, characterized in that, Includes the following steps: The status flag value of each difference block is obtained sequentially from the parameter area, and the update status of the difference block is determined based on the status flag value; If the update status of the difference block is incomplete, decompression differential upgrade is performed, and the status flag value of the difference block is updated in real time to represent the update status of the difference block until all difference blocks are updated. Wherein, if the update status of the difference block is incomplete, decompression differential upgrade is performed, and the status flag value of the difference block is updated in real time to characterize the update status of the difference block, including: If the update status of the difference block is incomplete, the initial difference package and the old version upgrade package are decompressed and restored to obtain a temporary upgrade package; A new differential package is generated based on the temporary upgrade package, the old version upgrade package, and the difference block; Differential upgrades are performed based on the new differential packets, and the status flag values ​​of the differential blocks are updated and recorded in real time to indicate that the update status of the differential blocks is in the completed update state. The step of generating a new differential package based on the temporary upgrade package, the old version upgrade package, and the difference block includes: Based on the temporary upgrade package and the old version upgrade package, the original difference block data corresponding to the difference block in the old version upgrade package and the target difference block data corresponding to the difference block in the temporary upgrade package are determined respectively. The original difference block data is backed up to the original block backup area, and the status flag value of the difference block is updated to indicate that the update status of the difference block is that the difference block data backup is complete. The target difference block data is overwritten to the old version upgrade package to generate a new upgrade package; A new differential package is generated based on the temporary upgrade package and the new upgrade package; After the step of determining the update status of the difference block based on the status flag value, the method further includes: If the update status of the difference block is "difference block data backup completed", the target original difference block data corresponding to the difference block is restored from the original block backup area; The old version upgrade package that has an anomaly is updated based on the target original difference block data to obtain the original old version upgrade package; The initial differential package and the original old version upgrade package are decompressed and restored to obtain a new temporary upgrade package. Based on the new temporary upgrade package and the original old version upgrade package, the process of generating a new differential package according to the temporary upgrade package, the old version upgrade package and the difference block is executed.

2. The differential upgrade method as described in claim 1, characterized in that, After the step of generating a new differential package based on the temporary upgrade package and the new upgrade package, the method further includes: The new differential packet is backed up to the differential packet backup area, and the status flag value of the differential block is updated to indicate that the update status of the differential block is that the differential packet backup is complete.

3. The differential upgrade method as described in claim 2, characterized in that, After the step of determining the update status of the difference block based on the status flag value, the method further includes: If the update status of the difference block is "differential packet backup completed", the target differential packet corresponding to the difference block is obtained from the differential packet backup area, and the differential upgrade based on the new differential packet is performed based on the target differential packet.

4. The differential upgrade method as described in claim 1, characterized in that, There is a mapping relationship between the status flag value and the system power-down region, and the method further includes: When an abnormal power outage occurs during system upgrade, the target power outage area is located based on the status flag value and the mapping relationship.

5. A differential upgrade device, characterized in that, include: A state determination unit is used to sequentially obtain the state flag value of each difference block from the parameter area, and determine the update state of the difference block based on the state flag value; The upgrade and update unit is used to perform decompression differential upgrade if the update status of the difference block is incomplete, and update the status flag value of the record difference block in real time to represent the update status of the difference block until all difference blocks are updated. Wherein, if the update status of the difference block is incomplete, decompression differential upgrade is performed, and the status flag value of the difference block is updated in real time to characterize the update status of the difference block, including: If the update status of the difference block is incomplete, the initial difference package and the old version upgrade package are decompressed and restored to obtain a temporary upgrade package; A new differential package is generated based on the temporary upgrade package, the old version upgrade package, and the difference block; Differential upgrades are performed based on the new differential packets, and the status flag values ​​of the differential blocks are updated and recorded in real time to indicate that the update status of the differential blocks is in the completed update state. The step of generating a new differential package based on the temporary upgrade package, the old version upgrade package, and the difference block includes: Based on the temporary upgrade package and the old version upgrade package, the original difference block data corresponding to the difference block in the old version upgrade package and the target difference block data corresponding to the difference block in the temporary upgrade package are determined respectively. The original difference block data is backed up to the original block backup area, and the status flag value of the difference block is updated to indicate that the update status of the difference block is that the difference block data backup is complete. The target difference block data is overwritten to the old version upgrade package to generate a new upgrade package; A new differential package is generated based on the temporary upgrade package and the new upgrade package; After the step of determining the update status of the difference block based on the status flag value, the method further includes: If the update status of the difference block is "difference block data backup completed", the target original difference block data corresponding to the difference block is restored from the original block backup area; The old version upgrade package that has an anomaly is updated based on the target original difference block data to obtain the original old version upgrade package; The initial differential package and the original old version upgrade package are decompressed and restored to obtain a new temporary upgrade package. Based on the new temporary upgrade package and the original old version upgrade package, the process of generating a new differential package according to the temporary upgrade package, the old version upgrade package and the difference block is executed.

6. A differential upgrade device, characterized in that, include: A memory and a processor, wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the differential upgrade method of any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that, when executed by a processor, implements the differential upgrade method according to any one of claims 1 to 4.