Differential upgrade method, device, server and readable storage medium

By updating the available flash memory capacity on small flash devices and leveraging the partition space of zero-differential upgrades, the problem of high failure rate of differential upgrades is solved, achieving higher success rate and cost reduction.

CN112416381BActive Publication Date: 2024-12-31ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910782516.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-22
Publication Date
2024-12-31
Estimated Expiration
2039-08-22

AI Technical Summary

Technical Problem

In the prior art, the failure rate of small flash memory devices during differential upgrade process is high, and the minimum remaining flash memory space required for the upgrade cannot be met, resulting in the upgrade failure.

Method used

By obtaining the available flash memory capacity when receiving the client's upgrade request, and updating the available flash memory capacity when the upgrade conditions are not met, using the partition data space of zero-differential upgrade as temporary flash memory, expanding the capacity during the differential upgrade process and ensuring the upgrade success.

Benefits of technology

Improves the success rate of differential upgrades on devices with insufficient flash memory capacity, while reducing product costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112416381B_ABST
    Figure CN112416381B_ABST
Patent Text Reader

Abstract

The present invention discloses a differential upgrade method, comprising the following steps: upon receiving an upgrade request sent by a client, obtaining the available flash memory capacity corresponding to the client based on the upgrade request, determining whether the available flash memory capacity meets the upgrade conditions, and when the available flash memory capacity does not meet the upgrade conditions, updating the available flash memory capacity, and using the updated available flash memory capacity as the available flash memory capacity, continuing to perform the step of determining whether the available flash memory capacity meets the upgrade conditions, and responding to the upgrade request when the available flash memory capacity meets the upgrade conditions. The present invention also discloses a device, a server, and a readable storage medium. By using the data space of the partition corresponding to the zero differential upgrade as a temporary flash memory, the capacity of the flash memory that can be used in the differential upgrade process is expanded, the success rate of differential upgrades on devices with insufficient flash memory capacity is improved, and the product cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of differential upgrade technology, and in particular to a differential upgrade method, device, server and readable storage medium. Background Art

[0002] In the prior art, the differential upgrade of mobile terminals is to prepare the differential packages of the two versions before and after the upgrade on the PC side, and then deploy them to the server. The terminal initiates a query and downloads the differential package to perform the software Fota (Firmware Over the Air). In this process, whether the flash memory space on the device is sufficient is the key to ensure whether Fota can be completed. If the minimum remaining flash memory space required for the upgrade (i.e., the flash memory is required to be greater than or equal to the size of the largest connected body) is not met, the upgrade will fail. Summary of the invention

[0003] The main purpose of the present invention is to provide a differential upgrade method, device, server and readable storage medium, aiming to at least solve the technical problem of high differential upgrade failure rate on existing small flash memory devices.

[0004] To achieve at least the above-mentioned purpose, the present invention provides a differential upgrade method, which comprises the following steps:

[0005] When receiving an upgrade request sent by a client, obtaining the available flash memory capacity corresponding to the client based on the upgrade request;

[0006] Determining whether the available flash memory capacity meets the upgrade condition;

[0007] When the available flash memory capacity does not meet the upgrade condition, updating the available flash memory capacity, and using the updated available flash memory capacity as the available flash memory capacity, and continuing to perform the step of determining whether the available flash memory capacity meets the upgrade condition;

[0008] When the available flash memory capacity meets the upgrade condition, respond to the upgrade request.

[0009] In addition, to achieve the above-mentioned purpose, the present invention also provides a server, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the steps of the differential upgrade method described in any one of the above items are implemented.

[0010] In addition, to achieve the above-mentioned purpose, the present invention also provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the differential upgrade method described in any one of the above items are implemented.

[0011] When receiving an upgrade request sent by a client, the present invention obtains the available flash memory capacity corresponding to the client based on the upgrade request, and then determines whether the available flash memory capacity meets the upgrade conditions. Next, when the available flash memory capacity does not meet the upgrade conditions, the available flash memory capacity is updated, and the updated available flash memory capacity is used as the available flash memory capacity, and the step of determining whether the available flash memory capacity meets the upgrade conditions is continued. When the available flash memory capacity meets the upgrade conditions, the upgrade request is responded to. By using the data space of the partition corresponding to the zero differential upgrade as a temporary flash memory, the capacity of the flash memory that can be used in the differential upgrade process is expanded, the success rate of differential upgrade on devices with insufficient flash memory capacity is improved, and the product cost is reduced at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a schematic diagram of the structure of a server in a hardware operating environment involved in an embodiment of the present invention;

[0013] Figure 2 It is a flowchart of the first embodiment of the differential upgrade method of the present invention;

[0014] Figure 3 It is a flow chart of the second embodiment of the differential upgrade method of the present invention;

[0015] Figure 4 It is a flow chart of the third embodiment of the differential upgrade method of the present invention;

[0016] Figure 5 It is a flowchart of a fourth embodiment of a differential upgrade method of the present invention;

[0017] Figure 6 It is a functional module diagram of an embodiment of a differential upgrade device of the present invention.

[0018] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0019] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0020] like Figure 1 As shown, Figure 1 It is a schematic diagram of the structure of a server in a hardware operating environment involved in an embodiment of the present invention.

[0021] like Figure 1As shown, the server may include: a processor 1001, such as a CPU, a network interface 1004, a client interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The client interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional client interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0022] In one embodiment, the server may be a differential upgrade server. In other preferred embodiments, the server may be any applicable server.

[0023] In one embodiment, the server may further include a camera, a RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. Sensors such as light sensors, motion sensors, and other sensors are not described in detail here.

[0024] Those skilled in the art will understand that Figure 1 The system structure shown in the figure does not constitute a limitation on the server, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0025] like Figure 1 As shown, the memory 1005 as a readable storage medium may include an operating system, a network communication module, a client interface module, a computer program, and the like.

[0026] exist Figure 1 In the system shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the client interface 1003 is mainly used to connect to the client (client) and communicate data with the client; and the processor 1001 can be used to call the computer program stored in the memory 1005.

[0027] In this embodiment, the server may include: a memory 1005, a processor 1001, and a computer program stored on the memory 1005 and executable on the processor 1001, wherein when the processor 1001 calls the computer program stored in the memory 1005, the steps of the differential upgrade method provided in each embodiment of the present application are executed.

[0028] The present invention also provides a differential upgrade method, referring to Figure 2 , Figure 2 FIG. 1 is a flow chart of a first embodiment of a differential upgrade method according to the present invention.

[0029] The embodiment of the present invention provides an embodiment of a differential upgrade method. It should be noted that although a logical sequence is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different from that shown here.

[0030] In this embodiment, the differential upgrade method includes:

[0031] Step S10: upon receiving an upgrade request sent by a client, obtaining the available flash memory capacity corresponding to the client based on the upgrade request.

[0032] In this embodiment, the FOTA (Firmware Over-The-Air) mobile terminal's air download software upgrade refers to providing firmware upgrade services for devices with networking functions, such as mobile phones, tablet computers, portable media players, mobile Internet devices, etc., through cloud upgrade technology. Users use the network to obtain smart terminal system upgrade packages in an on-demand, easily scalable manner, and perform cloud upgrades through FOTA to complete system repair and optimization. The essence of FOTA is firmware upgrade, including upgrades of drivers, systems, functions, applications, etc., and has no direct relationship with hardware. Further, FOTA generally adopts a differential upgrade method. Conventional differential upgrades require the remaining available flash memory space on the device to meet the temporary process files (i.e., Unicom data) that can store differential package files and differential upgrades, so only the remaining flash memory space can hold differential package files and the maximum strong Unicom data to ensure that the FOTA upgrade is successful. If the remaining flash memory space is not enough, the upgrade will fail. The conventional differential upgrade method does not consider the flash memory space on the partition data because the original data needs to be calculated together with the differential package to obtain the new version data through complex calculations. Generally, if the original data is destroyed, the restored new data is also wrong. However, this problem does not exist for zero-difference data partitions. The principle of zero-difference upgrade is equivalent to completing the upgrade without the old data. Therefore, you can consider borrowing the data partition space of the zero-difference upgrade, temporarily deleting the space data of the zero-difference upgrade data partition, and storing the connected body, that is, the temporary data of the differential process.

[0033] Specifically, when the client needs to perform a FOTA upgrade operation, it sends an upgrade request to the server. When the server receives the upgrade request sent by the client, it obtains the available flash memory capacity of the client based on the upgrade request. The available flash memory capacity is a key indicator that determines whether the FOTA upgrade can be successful.

[0034] Step S20, determining whether the available flash memory capacity meets the upgrade condition;

[0035] In this embodiment, after the server obtains the available flash memory capacity of the client according to the upgrade request, it further confirms whether the available flash memory capacity meets the upgrade condition.

[0036] Specifically, the client includes multiple partitions. First, the server generates sub-difference packages corresponding to each partition to be upgraded according to the obtained available flash memory capacity of the client and the preset configuration data according to the differential algorithm. When generating the differential package, the maximum interconnected body capacity corresponding to each sub-difference package is synchronously determined; then, the capacity sum of each partition to be upgraded is calculated, wherein the capacity sum corresponding to the partition is equal to the sum of the sub-difference package capacity corresponding to the partition and the maximum interconnected body capacity. When the maximum capacity sum in each partition to be upgraded is less than or equal to the available flash memory capacity, it is determined that the available flash memory capacity meets the upgrade conditions. Otherwise, when the maximum capacity sum in each partition to be upgraded is greater than the available flash memory capacity, it is determined that the available flash memory capacity does not meet the upgrade conditions.

[0037] Step S30, when the available flash memory capacity does not meet the upgrade condition, updating the available flash memory capacity, and using the updated available flash memory capacity as the available flash memory capacity, and continuing to perform the step of determining whether the available flash memory capacity meets the upgrade condition;

[0038] In this embodiment, if the available flash memory capacity of the client cannot accommodate the maximum capacity and, it means that the requirements for the flash memory during the FOTA upgrade process cannot be met, which will cause the FOTA upgrade to fail. At this time, measures need to be taken to expand the available flash memory capacity, thereby meeting the requirements for the flash memory during the FOTA upgrade process and ensuring the success of the FOTA upgrade. Specifically, when the available flash memory capacity does not meet the upgrade conditions, the available flash memory capacity is updated according to the preset rules. The method adopted in the present invention is: according to the preset rules, a data partition for zero differential packet production is determined, and the capacity of the data partition can be used as a temporary available flash memory capacity, thereby achieving the purpose of expanding the available flash memory capacity. Next, the updated available flash memory capacity is used as the current available flash memory capacity, and the step of determining whether the available flash memory capacity meets the upgrade conditions is continued until the current available flash memory capacity meets the upgrade requirements, thereby completing the differential packet production.

[0039] Step S40: respond to the upgrade request when the available flash memory capacity meets the upgrade condition.

[0040] In this embodiment, when the available flash memory capacity meets the upgrade conditions, it means that the available flash memory capacity at this time can meet the requirements of the flash memory during the FOTA upgrade process, and then the server responds to complete the upgrade request of the client. The sub-difference packets corresponding to each partition and the upgrade rules are sent to the client, so that the client can further upgrade each partition of the client according to the upgrade rules.

[0041] The differential upgrade method proposed in this embodiment obtains the available flash memory capacity corresponding to the client based on the upgrade request when receiving the upgrade request sent by the client, and then determines whether the available flash memory capacity meets the upgrade conditions. Next, when the available flash memory capacity does not meet the upgrade conditions, the available flash memory capacity is updated, and the updated available flash memory capacity is used as the available flash memory capacity, and the step of determining whether the available flash memory capacity meets the upgrade conditions is continued. When the available flash memory capacity meets the upgrade conditions, the upgrade request is responded to. By using the data space of the partition corresponding to the zero differential upgrade as a temporary flash memory, the capacity of the flash memory that can be used in the differential upgrade process is expanded, the success rate of differential upgrade on devices with insufficient flash memory capacity is improved, and the product cost is reduced.

[0042] Based on the first embodiment, refer to Figure 3 , a second embodiment of the differential upgrade method of the present invention is proposed. In this embodiment, step S20 includes:

[0043] Step S21, based on the available flash memory capacity and preset configuration data, respectively determine the maximum interconnect capacity corresponding to each partition;

[0044] In this embodiment, the configuration data is the data required for making a differential packet, which has a preset format and includes a lot of content, such as available flash memory capacity, partition length, partition corresponding new data length, etc. The configuration data is configured according to the actual situation, and can be set through the configuration interface, or can be set and changed through configuration instructions. The server can determine the maximum interconnect capacity corresponding to each partition based on the available flash memory capacity and the configuration data.

[0045] Specifically, step S21 includes: generating sub-differential packages corresponding to each partition based on the available flash memory capacity and configuration data, and determining the maximum interconnect capacity corresponding to each sub-differential package.

[0046] In this embodiment, the server makes a differential package. Specifically, the client includes multiple partitions. Each upgrade may involve some data partitions. When the client sends an upgrade request to the server, it also provides information such as a partition partition table (given data partitions to be upgraded). The server generates sub-differential packages corresponding to each partition according to a differential algorithm based on the available flash memory capacity and configuration data. When generating the differential package, the maximum interconnect capacity corresponding to each sub-differential package is synchronously determined.

[0047] Step S22, determining whether the available flash memory capacity meets the upgrade condition based on the maximum interconnect capacity corresponding to each partition;

[0048] In this embodiment, the available flash memory space must be sufficient to store differential package files and temporary process files for differential upgrades (i.e., interconnected body data). Therefore, only when the remaining available flash memory space can store differential package files and the maximum strongly interconnected body data can the FOTA upgrade be successful. Therefore, whether the available flash memory capacity meets the upgrade conditions is determined based on the maximum interconnected body capacity corresponding to each partition.

[0049] Specifically, step S22 includes:

[0050] Step a, determining the capacity sum corresponding to each partition, and obtaining the maximum capacity sum based on each capacity sum, wherein the capacity sum corresponding to the partition is equal to the sum of the sub-difference packet capacity corresponding to the partition and the maximum interconnected body capacity;

[0051] Specifically, the FOTA upgrade process of the client is carried out in partitions, and the partitions to be upgraded are upgraded in a certain order, and the available flash memory space stores the upgrade-related data of each partition in turn. The server calculates the capacity sum corresponding to each partition, which is equal to the sum of the sub-difference packet capacity corresponding to the partition and the maximum connected body capacity corresponding to the partition, and selects the maximum capacity sum from the multiple capacity sums of each partition, and further determines whether the available flash memory capacity meets the upgrade conditions based on the maximum capacity sum.

[0052] Step b, when the maximum capacity is less than or equal to the available flash memory capacity, determining that the available flash memory capacity meets the upgrade condition;

[0053] Step c: when the maximum capacity is greater than the available flash memory capacity, determining that the available flash memory capacity does not meet the upgrade condition.

[0054] In this embodiment, the maximum capacity and occupies the most flash memory capacity. If the available flash memory capacity of the client can accommodate the maximum capacity and , it means that the available flash memory capacity is sufficient to meet the requirements of the flash memory during the FOTA upgrade process, and the FOTA upgrade can be guaranteed to be successful. Otherwise, the FOTA upgrade will fail.

[0055] Specifically, when the maximum capacity sum is less than or equal to the available flash memory capacity of the client, it means that the available flash memory capacity meets the upgrade conditions. Conversely, when the maximum capacity sum is greater than the available flash memory capacity of the client, it means that the available flash memory capacity does not meet the upgrade conditions.

[0056] The differential upgrade method proposed in this embodiment generates a sub-differential package according to the available flash memory capacity and preset configuration data, and then determines the maximum connected body capacity, and further determines whether the available flash memory capacity meets the upgrade conditions based on the sum of the sub-differential package capacity corresponding to the partition and the maximum connected body capacity.

[0057] Based on the first and second embodiments, refer to Figure 4 , a third embodiment of the differential upgrade method of the present invention is proposed. In this embodiment, step S30 may include:

[0058] Step S31, obtaining the capacity of the zero-difference packet corresponding to each partition;

[0059] In this embodiment, the client has multiple partitions, and each partition that needs to be upgraded can generate a conventional differential package or a zero differential package. The principle of zero differential upgrade is equivalent to completing the upgrade without the need for old data, so the zero differential package is much larger than the conventional differential package. Therefore, a zero differential package is only made for the specified data partition when needed. The server obtains the capacity of the zero differential package corresponding to each partition, wherein the zero differential package can generate the zero differential package corresponding to each partition according to the available flash memory capacity and the preset zero differential configuration data.

[0060] Step S32, based on the zero-difference packets and the sum of capacities corresponding to each partition, determining whether there is a first partition in each partition whose capacity of the zero-difference packet is less than the sum of capacities, wherein the sum of capacities corresponding to the partition is equal to the sum of the sub-difference packet capacity corresponding to the partition and the maximum interconnected body capacity;

[0061] In this embodiment, the sum of the capacity of each partition is equal to the sum of the sub-difference packet capacity corresponding to the partition and the maximum connected body capacity corresponding to the partition. After obtaining the capacity of the zero-difference packet corresponding to each partition, determine whether there is a partition in each partition whose zero-difference packet capacity is less than the sum of the capacities according to the capacity of the zero-difference packet corresponding to each partition and the sum of the capacities of each partition. If such a partition exists, the partition is the data partition selected for zero-difference, because after replacing the partition with zero-difference, the zero-difference packet of the partition is smaller than the sum of the ordinary differential packet and the maximum value of the connected body of the partition, indicating that zero-difference for the partition can save a part of the flash memory space for expanding the available flash memory space.

[0062] Step S33, when there is a first partition whose capacity of the zero-difference packet is less than the sum of the capacities, the available flash memory capacity is summed with the capacity of the first partition as the updated available flash memory capacity, and the sub-configuration data corresponding to the first partition in the configuration data is updated at the same time, and the updated configuration data is used as the configuration data.

[0063] In this embodiment, the present invention can save a part of the data partition space by compressing the partition data with zero differential, and reasonably use the flash memory space on the data partition to ensure the successful differential upgrade of the system software on the small flash memory device. For example, assuming that a partition data is 9M, if the partition is made into a normal differential package of 5M, if the normal differential package of the partition is replaced with a zero differential package, the zero differential package may be 8M, which is 3M more than the normal differential package, but the partition space is 9M, which is equivalent to 9M-3M=6M more space than the normal differential upgrade, which can be temporarily requisitioned, expanding the temporary flash memory space in the FOTA upgrade process to meet the flash memory requirements for the upgrade of the largest Unicom body, and ensure the success of the upgrade.

[0064] Specifically, when there is a first partition whose capacity of a zero-difference packet is smaller than the capacity sum, the available flash memory capacity is recalculated, that is, the current available flash memory capacity is summed with the capacity of the first partition as the updated available flash memory capacity, and the sub-configuration data corresponding to the first partition in the configuration data is updated at the same time, that is, the first partition is configured as a partition for generating a zero-difference packet, and the updated configuration data is used as the configuration data. Further, the server generates a new differential packet and performs related operations.

[0065] Furthermore, in one embodiment, step S30 further includes:

[0066] Step d, obtaining the capacity of the zero-difference packet corresponding to each partition;

[0067] In this embodiment, the client has multiple partitions, and each partition that needs to be upgraded can generate a conventional differential package or a zero differential package. The principle of zero differential upgrade is equivalent to completing the upgrade without the need for old data, so the zero differential package is much larger than the conventional differential package. Therefore, a zero differential package is only made for the specified data partition when needed. The server obtains the capacity of the zero differential package corresponding to each partition, wherein the zero differential package can generate the zero differential package corresponding to each partition according to the available flash memory capacity and the preset zero differential configuration data.

[0068] Step e, determining the capacity difference corresponding to each partition, wherein the capacity difference corresponding to the partition is equal to the difference between the capacity of the partition and the capacity of the zero-difference packet;

[0069] In this embodiment, the capacity difference of each partition is equal to the difference between the partition capacity corresponding to the partition and the capacity of the zero-difference packet corresponding to the partition. After obtaining the capacity of the zero-difference packet corresponding to each partition, the capacity difference corresponding to each partition is calculated according to the capacity of the zero-difference packet corresponding to each partition and the partition capacity of each partition.

[0070] Step f, obtaining the maximum capacity difference based on the capacity differences corresponding to each partition, and summing the capacity of the second partition corresponding to the maximum capacity difference and the available flash memory capacity as the updated available flash memory capacity, and at the same time updating the sub-configuration data corresponding to the second partition in the configuration data, and using the updated configuration data as the configuration data.

[0071] In this embodiment, the maximum capacity difference is obtained according to the capacity difference corresponding to each partition, and the partition corresponding to the maximum capacity difference is the data partition selected for zero differential upgrade, because the partition is replaced by a normal differential upgrade to a zero differential upgrade, and after the partition is zero differential, the data partition flash memory capacity temporarily used in the FOTA upgrade process can be expanded to the maximum. Further, the server recalculates the available flash memory capacity, that is, sums the current available flash memory capacity with the capacity of the second partition as the updated available flash memory capacity, where the second partition is the data partition corresponding to the maximum capacity difference, and updates the sub-configuration data corresponding to the second partition in the configuration data at the same time, that is, configures the second partition as a partition for generating a zero differential packet, and uses the updated configuration data as the configuration data. Next, the server generates a new differential packet and related operations.

[0072] Furthermore, in one embodiment, step S30 also includes: obtaining the maximum differential package capacity based on the capacity of the sub-differential packages corresponding to each partition, and summing the capacity of the third partition corresponding to the maximum differential package capacity and the available flash memory capacity as the updated available flash memory capacity, and simultaneously updating the sub-configuration data corresponding to the third partition in the configuration data, and using the updated configuration data as the configuration data.

[0073] In this embodiment, the maximum differential package capacity is obtained according to the capacity of the sub-differential package corresponding to each partition, and the partition corresponding to the maximum differential package capacity is the data partition selected for zero differential, because the partition is replaced by a normal differential upgrade to a zero differential upgrade, and the total size of the differential package increases slightly, but the data flash memory of the partition can be used temporarily, so as to achieve the purpose of expanding the temporarily available flash memory. Further, the server recalculates the available flash memory capacity, that is, sums the current available flash memory capacity with the capacity of the third partition as the updated available flash memory capacity, wherein the third partition is the data partition corresponding to the maximum differential package capacity, and updates the sub-configuration data corresponding to the third partition in the configuration data at the same time, that is, configures the third partition as a partition for generating zero differential packages, and uses the updated configuration data as the configuration data. Next, the server generates a new differential package and related operations.

[0074] Furthermore, in one embodiment, step S30 also includes: obtaining a target interconnect capacity in the maximum interconnect capacity corresponding to each partition, and summing the capacity of the fourth partition corresponding to the target interconnect capacity and the available flash memory capacity as the updated available flash memory capacity, and simultaneously updating the sub-configuration data corresponding to the fourth partition in the configuration data, and using the updated configuration data as the configuration data, wherein the target interconnect capacity is the maximum value of the maximum interconnect capacities corresponding to each partition.

[0075] In this embodiment, according to the target interconnected body capacity in the maximum interconnected body capacity corresponding to each partition, wherein the target interconnected body capacity is the maximum value among all maximum interconnected body capacities, the partition corresponding to the target interconnected body capacity is the data partition selected for zero differential, because the partition is replaced by a normal differential upgrade to a zero differential upgrade, the maximum interconnected body size of the partition is reduced to 0, and the maximum interconnected body size of other partitions is updated to the maximum interconnected body size, thereby reducing the value of the maximum interconnected body and reducing the requirement for the available flash memory capacity. Further, the server recalculates the available flash memory capacity, that is, sums the current available flash memory capacity with the capacity of the fourth partition as the updated available flash memory capacity, wherein the fourth partition is the data partition corresponding to the target interconnected body capacity, and simultaneously updates the sub-configuration data corresponding to the fourth partition in the configuration data, that is, configures the fourth partition as a partition for generating a zero differential packet, and uses the updated configuration data as the configuration data. Next, the server generates a new differential packet and related operations.

[0076] It should be noted that the present invention determines a data partition for zero-difference packet production according to preset rules, and the capacity of the data partition can be used as temporary available flash memory capacity, thereby achieving the expansion of the available flash memory capacity. In summary, the four expansion rules described in this embodiment can select one or more of them and perform random combination, and different combinations all fall within the scope of protection of this patent.

[0077] The differential upgrade method proposed in this embodiment obtains the capacity of the zero-difference package corresponding to each partition, and then determines whether there is a first partition in each partition whose capacity of the zero-difference package is less than the capacity sum based on the zero-difference package corresponding to each partition and the capacity sum. Next, when there is a first partition whose capacity of the zero-difference package is less than the capacity sum, the available flash memory capacity is summed with the capacity of the first partition as the updated available flash memory capacity, and the sub-configuration data corresponding to the first partition in the configuration data is updated at the same time, and the updated configuration data is used as the configuration data. By using the data space of the partition corresponding to the zero-difference upgrade as a temporary flash memory, the capacity of the flash memory that can be used in the differential upgrade process is expanded, which improves the success rate of differential upgrades on devices with insufficient flash memory capacity and reduces product costs.

[0078] Based on the embodiment, refer to Figure 5 , a fourth embodiment of the differential upgrade method of the present invention is proposed. In this embodiment, step S40 includes:

[0079] Step S41, when the available flash memory capacity meets the upgrade condition, updating the upgrade rule based on the configuration data;

[0080] In this embodiment, when the client performs a partition upgrade, the partition corresponding to the zero-difference package needs to be upgraded last, because the partition is used to expand the currently available flash memory capacity. The upgrade rule specifies the upgrade order of the partitions, and as long as the partition corresponding to the zero-difference package is upgraded last, the upgrade order of other partitions can be determined according to actual conditions.

[0081] For example, suppose that the client has 3 partition data, namely data1 partition, data2 partition, data3 partition, and the partition storing the differential package is FOTA partition. The remaining available flash memory space capacity is the available flash memory size of the FOTA partition. The conventional differential upgrade idea is that when upgrading the data1 partition, temporary files are stored in the flash memory corresponding to the FOTA partition. If the remaining flash memory space of the FOTA partition is not enough to store the connected body of the data1 partition, the data1 partition will fail to upgrade. According to the method in the present invention, assuming that the normal differential package corresponding to the data3 partition is replaced with a zero differential package, when upgrading the data1 partition, in addition to storing the temporary files of the upgrade process in the flash memory of the FOTA partition, it can also be stored in the flash memory on the data3 partition, which is equivalent to increasing the capacity of the temporary available flash memory space to ensure that the data1 partition can complete the upgrade. When upgrading the data2 partition, the size of the flash memory space available for storing temporary files is still the flash memory on data3 plus the flash memory on the FOTA partition, as with data1. When upgrading data3, the available flash memory space is only the remaining flash memory space of the FOTA partition. However, since data3 is upgraded in a zero-difference manner, there is no upgrade failure, ensuring that all three data partitions can be successfully upgraded.

[0082] Step S42, sending the sub-differential packages corresponding to each partition and the upgrade rule to the client, so that the client performs differential upgrade on each partition of the client based on the upgrade rule.

[0083] In this embodiment, when the available flash memory capacity meets the upgrade conditions, it means that the available flash memory capacity of the client at this time can ensure the success of the FOTA upgrade, so the sub-differential packages corresponding to each partition to be upgraded and the partition upgrade rules are sent to the client, so that the client can perform differential upgrades on each partition to be upgraded of the client in turn according to the upgrade rules.

[0084] The differential upgrade method proposed in this embodiment, when the available flash memory capacity meets the upgrade conditions, ensures that the partition corresponding to the zero-difference package is upgraded last by specifying the upgrade order of the partitions in the upgrade rules, thereby further ensuring the success rate of the upgrade.

[0085] The present invention further provides a differential upgrade device, referring to Figure 6 , Figure 6 It is a functional module diagram of an embodiment of a differential upgrade device of the present invention.

[0086] The acquisition module 10, when receiving an upgrade request sent by a client, acquires the available flash memory capacity corresponding to the client based on the upgrade request;

[0087] A judgment module 20 determines whether the available flash memory capacity meets the upgrade condition;

[0088] The processing module 30 updates the available flash memory capacity when the available flash memory capacity does not meet the upgrade condition, and uses the updated available flash memory capacity as the available flash memory capacity, and continues to perform the step of determining whether the available flash memory capacity meets the upgrade condition;

[0089] The response module 40 responds to the upgrade request when the available flash memory capacity meets the upgrade condition.

[0090] Furthermore, the judging module 20 is further configured to:

[0091] Based on the available flash memory capacity and preset configuration data, respectively determine the maximum interconnect capacity corresponding to each partition;

[0092] Based on the maximum interconnect capacity corresponding to each partition, it is determined whether the available flash memory capacity meets the upgrade condition.

[0093] Furthermore, the judging module 20 is further configured to:

[0094] Sub-differential packages corresponding to each partition are generated based on the available flash memory capacity and configuration data, and the maximum interconnect capacity corresponding to each sub-differential package is determined.

[0095] Furthermore, the judging module 20 is further configured to:

[0096] Determine the capacity sum corresponding to each partition, and obtain the maximum capacity sum based on each capacity sum, wherein the capacity sum corresponding to the partition is equal to the sum of the sub-difference packet capacity corresponding to the partition and the maximum interconnected body capacity;

[0097] When the maximum capacity is less than or equal to the available flash memory capacity, determining that the available flash memory capacity meets the upgrade condition;

[0098] When the maximum capacity is greater than the available flash memory capacity, it is determined that the available flash memory capacity does not meet the upgrade condition.

[0099] Furthermore, the processing module 30 is also used for:

[0100] Get the capacity of zero-difference packets corresponding to each partition;

[0101] Based on the zero-difference packets and the sum of capacities corresponding to each partition, determine whether there is a first partition in each partition whose capacity of the zero-difference packet is less than the sum of capacities, wherein the sum of capacities corresponding to the partition is equal to the sum of the sub-difference packet capacity corresponding to the partition and the maximum interconnected body capacity;

[0102] When there is a first partition whose capacity of the zero-difference packet is smaller than the sum of the capacities, the available flash memory capacity is summed with the capacity of the first partition as the updated available flash memory capacity, and the sub-configuration data corresponding to the first partition in the configuration data is updated at the same time, and the updated configuration data is used as the configuration data.

[0103] Furthermore, the processing module 30 is also used for:

[0104] Get the capacity of zero-difference packets corresponding to each partition;

[0105] Determine the capacity difference corresponding to each partition, wherein the capacity difference corresponding to the partition is equal to the difference between the capacity of the partition and the capacity of the zero-difference packet;

[0106] The maximum capacity difference is obtained based on the capacity difference corresponding to each partition, and the capacity of the second partition corresponding to the maximum capacity difference is summed with the available flash memory capacity as the updated available flash memory capacity. At the same time, the sub-configuration data corresponding to the second partition in the configuration data is updated, and the updated configuration data is used as the configuration data.

[0107] Furthermore, the processing module 30 is also used for:

[0108] The maximum differential package capacity is obtained based on the capacity of the sub-differential packages corresponding to each partition, and the capacity of the third partition corresponding to the maximum differential package capacity is summed with the available flash memory capacity as the updated available flash memory capacity. At the same time, the sub-configuration data corresponding to the third partition in the configuration data is updated, and the updated configuration data is used as the configuration data.

[0109] Furthermore, the processing module 30 is also used for:

[0110] Obtain a target interconnected body capacity from the maximum interconnected body capacity corresponding to each partition, and sum the capacity of the fourth partition corresponding to the target interconnected body capacity and the available flash memory capacity as the updated available flash memory capacity, and at the same time update the sub-configuration data corresponding to the fourth partition in the configuration data, and use the updated configuration data as the configuration data, wherein the target interconnected body capacity is the maximum value of the maximum interconnected body capacities corresponding to each partition.

[0111] Furthermore, the response module 40 is also used for:

[0112] When the available flash memory capacity meets the upgrade condition, updating the upgrade rule based on the configuration data;

[0113] The sub-differential packages corresponding to each partition and the upgrade rule are sent to the client, so that the client performs differential upgrade on each partition of the client based on the upgrade rule.

[0114] In addition, an embodiment of the present invention further provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the differential upgrade method in the above-mentioned embodiments are implemented.

[0115] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0116] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0117] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a system device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0118] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A differential upgrade method, applied to a server, characterized in that: The differential upgrade method comprises the following steps: When receiving an upgrade request sent by a client, obtaining the available flash memory capacity corresponding to the client based on the upgrade request; Determining whether the available flash memory capacity meets the upgrade condition; When the available flash memory capacity does not meet the upgrade condition, updating the available flash memory capacity, and using the updated available flash memory capacity as the available flash memory capacity, and continuing to perform the step of determining whether the available flash memory capacity meets the upgrade condition; When the available flash memory capacity meets the upgrade condition, responding to the upgrade request; Wherein, the step of updating the available flash memory capacity comprises: Obtaining the capacity of zero-difference packets corresponding to each partition; the zero-difference packets are data packets that do not require old data for upgrading; Based on the zero-difference packets and the sum of capacities corresponding to each partition, determine whether there is a first partition in each partition whose capacity of the zero-difference packet is less than the sum of capacities, wherein the sum of capacities corresponding to the partition is equal to the sum of the sub-difference packet capacity corresponding to the partition and the maximum interconnected body capacity; the maximum interconnected body is a temporary process file for differential upgrade; When there is a first partition whose capacity of the zero-difference packet is smaller than the sum of the capacities, the available flash memory capacity is summed with the capacity of the first partition as the updated available flash memory capacity, and the sub-configuration data corresponding to the first partition in the preset configuration data is updated at the same time, and the updated configuration data is used as the configuration data.

2. The differential upgrade method according to claim 1, characterized in that: The client includes a plurality of partitions, and the step of determining whether the available flash memory capacity meets the upgrade condition includes: Based on the available flash memory capacity and preset configuration data, respectively determine the maximum interconnect capacity corresponding to each partition; Based on the maximum interconnect capacity corresponding to each partition, it is determined whether the available flash memory capacity meets the upgrade condition.

3. The differential upgrade method according to claim 2, characterized in that: The step of determining the maximum interconnect capacity corresponding to each partition based on the available flash memory capacity and the preset configuration data comprises: Sub-differential packages corresponding to each partition are generated based on the available flash memory capacity and configuration data, and the maximum interconnected body capacity corresponding to each sub-differential package is determined to confirm the maximum interconnected body capacity corresponding to each partition.

4. The differential upgrade method according to claim 3, characterized in that: The step of determining whether the available flash memory capacity meets the upgrade condition based on the maximum interconnect capacity corresponding to each partition comprises: Determine the capacity sum corresponding to each partition, and obtain the maximum capacity sum based on each capacity sum; When the maximum capacity is less than or equal to the available flash memory capacity, determining that the available flash memory capacity meets the upgrade condition; When the maximum capacity is greater than the available flash memory capacity, it is determined that the available flash memory capacity does not meet the upgrade condition.

5. The differential upgrade method according to claim 3, characterized in that: The step of updating the available flash memory capacity further includes: Get the capacity of zero-difference packets corresponding to each partition; Determine the capacity difference corresponding to each partition, wherein the capacity difference corresponding to the partition is equal to the difference between the capacity of the partition and the capacity of the zero-difference packet; The maximum capacity difference is obtained based on the capacity difference corresponding to each partition, and the capacity of the second partition corresponding to the maximum capacity difference is summed with the available flash memory capacity as the updated available flash memory capacity. At the same time, the sub-configuration data corresponding to the second partition in the configuration data is updated, and the updated configuration data is used as the configuration data.

6. The differential upgrade method according to claim 3, characterized in that: The step of updating the available flash memory capacity further includes: The maximum differential package capacity is obtained based on the capacity of the sub-differential packages corresponding to each partition, and the capacity of the third partition corresponding to the maximum differential package capacity is summed with the available flash memory capacity as the updated available flash memory capacity. At the same time, the sub-configuration data corresponding to the third partition in the configuration data is updated, and the updated configuration data is used as the configuration data.

7. The differential upgrade method according to claim 3, characterized in that: The step of updating the available flash memory capacity further includes: Obtain a target interconnected body capacity from the maximum interconnected body capacity corresponding to each partition, and sum the capacity of the fourth partition corresponding to the target interconnected body capacity and the available flash memory capacity as the updated available flash memory capacity, and at the same time update the sub-configuration data corresponding to the fourth partition in the configuration data, and use the updated configuration data as the configuration data, wherein the target interconnected body capacity is the maximum value of the maximum interconnected body capacities corresponding to each partition.

8. The differential upgrade method according to any one of claims 3 to 7, characterized in that: When the available flash memory capacity meets the upgrade condition, the step of responding to the upgrade request includes: When the available flash memory capacity meets the upgrade condition, updating the upgrade rule based on the configuration data; The sub-differential packages corresponding to each partition and the upgrade rule are sent to the client, so that the client performs differential upgrade on each partition of the client based on the upgrade rule.

9. A differential upgrade device, characterized in that: The differential upgrade device comprises: an acquisition module, which, upon receiving an upgrade request sent by a client, acquires the available flash memory capacity corresponding to the client based on the upgrade request; A judgment module, determining whether the available flash memory capacity meets the upgrade condition; a processing module, which updates the available flash memory capacity when the available flash memory capacity does not meet the upgrade condition, and uses the updated available flash memory capacity as the available flash memory capacity, and continues to execute the step of determining whether the available flash memory capacity meets the upgrade condition; A response module, when the available flash memory capacity meets the upgrade condition, responds to the upgrade request; Wherein, the step of updating the available flash memory capacity comprises: Obtaining the capacity of zero-difference packets corresponding to each partition; the zero-difference packets are data packets that do not require old data for upgrading; Based on the zero-difference packets and the sum of capacities corresponding to each partition, determine whether there is a first partition in each partition whose capacity of the zero-difference packet is less than the sum of capacities, wherein the sum of capacities corresponding to the partition is equal to the sum of the sub-difference packet capacity corresponding to the partition and the maximum interconnected body capacity; the maximum interconnected body is a temporary process file for differential upgrade; When there is a first partition whose capacity of the zero-difference packet is smaller than the sum of the capacities, the available flash memory capacity is summed with the capacity of the first partition as the updated available flash memory capacity, and the sub-configuration data corresponding to the first partition in the preset configuration data is updated at the same time, and the updated configuration data is used as the configuration data.

10. A server, characterized in that: The server comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the differential upgrade method according to any one of claims 1 to 8 when executed by the processor.

11. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the differential upgrade method according to any one of claims 1 to 8 are implemented.