Electronic device and system upgrade method and medium thereof

By adjusting the partition information of the electronic device to make it consistent with the target version, and using a differential upgrade package for upgrading, the upgrade failure problem caused by inconsistent partition information is solved, and the smooth upgrade of the system is achieved.

CN114860293BActive Publication Date: 2025-09-05HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110157461.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-04
Publication Date
2025-09-05
Estimated Expiration
2041-02-04

AI Technical Summary

Technical Problem

In the process of upgrading electronic equipment system in the prior art, there is a problem that differential upgrade cannot be performed due to inconsistent partition information of the original version and the target version.

Method used

By obtaining partition information for the second version in the differential upgrade package, adjust the partition size and start and end positions of the first version installed on the electronic device to make it consistent with the second version, and use the differential upgrade package to perform system upgrades.

Benefits of technology

It realizes that the electronic device system is successfully upgraded from the original version to the target version in case of inconsistent partition information, ensuring the accuracy and completeness of the upgrade process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114860293B_ABST
    Figure CN114860293B_ABST
Patent Text Reader

Abstract

The present application relates to an electronic device and a method for upgrading its system. The method comprises: adjusting each partition in the first version of the system currently installed on the electronic device to be consistent with the corresponding partition in the second version according to the partition information of the second version in the differential upgrade package of the electronic device; and then upgrading the system from the first version to the second version based on the differential upgrade package. The method of the present application can make it possible to adjust the partition of the first version of the current system to be consistent with the partition of the second version before performing a differential upgrade on the system currently installed on the electronic device, and then perform a differential upgrade on the system. This solves the problem that the system cannot be upgraded through the differential upgrade package when the partition of the first version of the current system is inconsistent with the partition of the second version.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to communication technologies in the field of mobile terminals, and more particularly to an electronic device and a system upgrade method and medium thereof. Background Art

[0002] The storage area of ​​an electronic device includes a system partition for storing system files of the electronic device (such as driver files and configuration files corresponding to functions and services). Generally, the system partition does not change. However, as the functions and services of the electronic device develop, the system partition may become larger or smaller, or the partition position may change.

[0003] For example, Figure 1 As shown, the original partition A of the original version of the electronic device is the partition related to the communication function, the original partition B is the partition related to the call function, and the original partition C is the partition related to the camera function. With the development of communication technology, the 2G and 3G services in the original partition A have gradually disappeared. Therefore, when the electronic device is upgraded, the 2G and 3G functions are generally deleted in the upgrade file of the target version of the system. As a result, the target partition A' in the upgrade file becomes smaller relative to the original partition A. Since the call function has not changed, the original partition B and the target partition B' are the same size. However, with the development of camera technology, the new system of the electronic device has added a shooting function, that is, compared with the original partition C, the target partition C' becomes larger and its position changes.

[0004] The existing technology uses OTA (Over the Air Technology) to differentially upgrade the system of an electronic device. When the partition information between the original version and the target version of the system is inconsistent, for example, the location and size of the partitions of the original version and the target version are inconsistent, there is a problem that the existing system differential upgrade technology cannot perform the system upgrade. Summary of the Invention

[0005] The purpose of this application is to provide an electronic device and a system upgrade method and medium thereof. Through the method of this application, the electronic device will adjust the partitions of the original version of the system to be consistent with the partitions of the target version based on the differences between the partition information of the original version of the currently installed system and the differential upgrade package of the target version, and then upgrade the system from the original version to the target version. In the event that the partitions of the target version of the differential upgrade package of the electronic device's system are inconsistent with the partitions of the original version, the system is upgraded using the differential upgrade package by adjusting the original version.

[0006] A first aspect of the present application provides a system upgrade method for an electronic device, comprising: obtaining a differential upgrade package required to upgrade a system currently installed on the electronic device from a first version to a second version; adjusting the size and start and end positions of each partition in the first version of the system installed on the electronic device to be consistent with the size and start and end positions of the corresponding partition in the second version based on the partition information of the second version in the differential upgrade package; and upgrading the system from the first version to the second version in each adjusted partition on the electronic device based on the differential upgrade package.

[0007] That is, in an embodiment of the present application, the electronic device may be a mobile phone 100. The first version of the system currently installed on the mobile phone 100 may be the original version of the system currently installed on the mobile phone 100, and the second version may be the target version of the system. If the partition information of the original version and the target version are inconsistent. For example, the partition size of the partition in the first version is larger than the partition corresponding to the second version, the start and end positions of the partition are inconsistent with the partition corresponding to the second version, or the partition size is larger than the partition corresponding to the second version. The start and end positions here are the partition start address and partition end address of the partition. At this time, it is necessary to adjust the partition of the first version of the system of the mobile phone 100 to be consistent with the corresponding partition of the second version, and then use the differential upgrade package to upgrade.

[0008] In a possible implementation of the first aspect, before adjusting the size and start and end positions of each partition in the first version of the system installed on the electronic device to be consistent with the size and start and end positions of the corresponding partition in the second version based on the partition information of the second version in the differential upgrade package, the method further includes:

[0009] The electronic device enters the upgrade mode and loads the partition of the electronic device installation system separately.

[0010] That is, in an embodiment of the present application, after the mobile phone 100 enters the upgrade mode, the mobile phone 100 will not mount a file system other than the partition of the currently installed system, so that the mobile phone 100 will not affect other files contained in the mobile phone 100 during the system upgrade process.

[0011] In a possible implementation of the first aspect above, the partition information includes a partition name, a start position, an end position, and a partition size.

[0012] That is, in an embodiment of the present application, for example, for partition A of the currently installed system of mobile phone 100, the partition name of the partition is A, the starting position of the partition, that is, the starting address is 0001, the partition size is 1000, and the ending position of the partition, that is, the ending address is 1000.

[0013] In a possible implementation of the first aspect, adjusting the size and start and end positions of each partition in the first version of the system installed on the electronic device to be consistent with the size and start and end positions of the corresponding partition in the second version based on the partition information of the second version in the differential upgrade package includes:

[0014] When the first partition in the first version is larger than the corresponding second partition in the second version, a partition connected to the first partition is used to cover the area of ​​the first partition outside the start and end positions shown, so that the size of the first partition of the first version is consistent with the size of the second partition of the second version.

[0015] That is, in the embodiment of the present application, for example, the first partition of the first version is the original partition A of the original version of the mobile phone 100 system, with a partition start address of 0001 and a partition size of 2000. The second partition of the second version is the target partition A' of the target version, with a partition start address of 0001 and a partition size of 1000. At this time, the files in the area from address 1001 to 2000 in the first partition will be overwritten by the original partition B connected to the original partition A, that is, the partition end address of the first partition is adjusted from 2000 to 1000, so that the first partition is consistent with the second partition.

[0016] In a possible implementation of the first aspect, adjusting the size and start and end positions of each partition in the first version of the system installed on the electronic device to be consistent with the size and start and end positions of the corresponding partition in the second version based on the partition information of the second version in the differential upgrade package, further includes:

[0017] When the first partition in the first version is smaller than the second partition in the second version, the starting position of the first partition is adjusted to be the same as the starting position of the second partition, and the ending address of the first partition is moved backward so that the ending position of the first partition is the same as the ending position of the second partition.

[0018] In the embodiment of the present application, for example, the first partition of the first version is the original partition C of the original version of the mobile phone 100 system, with a starting address of 3001 and a size of 1000. The second partition of the second version is the target partition C' of the target version, with a starting address of 2001 and a size of 2000. In this case, the start and end positions of the first partition are moved forward by 1000, so that the starting address becomes 2001, and the end address of the first partition is moved back to 4000, so that the first partition is consistent with the second partition.

[0019] In a possible implementation of the first aspect above, based on the differential upgrade package, the system is upgraded from the first version to the second version in each adjusted partition on the electronic device, including: when the adjusted partition of the first version is consistent with the partition of the second version, the files belonging to the second version of the system in the differential upgrade package are written into the corresponding partitions on the electronic device whose size and start and end positions have been adjusted.

[0020] In a possible implementation of the first aspect above, a differential upgrade package is generated in the following manner: the files of each partition in the second version are compared with the files in the differential sub-partition of the corresponding partition in the first version, and the differential upgrade package required to upgrade the first version to the second version is generated, wherein the differential sub-partition of the partition of the first version has the same partition size and start and end positions as the corresponding partition in the second version.

[0021] In a possible implementation of the first aspect, the partition is a physical partition or a logical partition.

[0022] A second aspect of the present application provides an electronic device, comprising:

[0023] a memory storing instructions;

[0024] The processor is coupled to the memory, and when the program instructions stored in the memory are executed by the processor, the electronic device executes the system upgrade method of the electronic device provided in the first aspect, or the electronic device executes the method for making a system upgrade package of the electronic device provided in the second aspect.

[0025] A third aspect of the present application provides a readable medium, wherein the readable medium stores instructions, and the instructions are executed on a machine to enable the machine to execute any of the above-mentioned system upgrade methods for electronic devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A schematic diagram showing that the partition of the original version of the system currently installed on the electronic device is inconsistent with the partition of the target version;

[0027] Figure 2 A diagram showing a scenario in which an electronic device obtains a differential upgrade package from a server;

[0028] Figure 3 A flowchart showing a method for preparing a differential upgrade package for a system in an embodiment of the present application is shown;

[0029] Figure 4a A schematic diagram showing the partitions of the original version and the target version of the system in an embodiment of the present application;

[0030] Figure 4bA schematic diagram showing the partitions of the original version, the intermediate version, and the target version of the system in an embodiment of the present application is shown;

[0031] Figure 4c A schematic diagram showing a process of adjusting an original version of a system into an intermediate version in an embodiment of the present application;

[0032] Figure 4d A schematic diagram showing a process of adjusting an original version of a system into an intermediate version in an embodiment of the present application;

[0033] Figure 4e A schematic diagram showing a process of adjusting an original version of a system into an intermediate version in an embodiment of the present application;

[0034] Figure 5a A schematic diagram showing partitions of an original version and partitions of a target version of another system in an embodiment of the present application is shown;

[0035] Figure 5b A schematic diagram showing partitions of an original version, intermediate versions, and a target version of another system in an embodiment of the present application is shown;

[0036] Figure 5c A schematic diagram showing a process of adjusting an original version of another system into an intermediate version in an embodiment of the present application;

[0037] Figure 5d A schematic diagram showing a process of adjusting an original version of another system into an intermediate version in an embodiment of the present application;

[0038] Figure 5e A schematic diagram showing a process of adjusting an original version of another system into an intermediate version in an embodiment of the present application;

[0039] Figure 6 A flowchart showing a method for preparing a differential upgrade package for a system in an embodiment of the present application is shown;

[0040] Figure 7 The following is a block diagram showing the hardware structure of the electronic device in the embodiment of the present application;

[0041] Figure 8 A structural diagram of a module for differential upgrading of an electronic device in an embodiment of the present application is shown;

[0042] Figure 9 A flow chart of a differential upgrade method for an electronic device in an embodiment of the present application is shown;

[0043] Figure 10a A schematic diagram showing the partitions of the original version and the target version of the system in an embodiment of the present application;

[0044] Figure 10b A schematic diagram showing the partitions of the original version, the intermediate version, and the target version of the system in an embodiment of the present application is shown;

[0045] Figure 10c A schematic diagram showing a process of adjusting an original version of a system into an intermediate version in an embodiment of the present application;

[0046] Figure 10d A schematic diagram showing a process of adjusting an original version of a system into an intermediate version in an embodiment of the present application; DETAILED DESCRIPTION

[0047] The embodiments of the present application include but are not limited to an electronic device and its system upgrade method and medium. To make the purpose, technical solution and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0048] Figure 2 According to some embodiments of the present application, a scenario diagram of an upgrade system 10 including an electronic device 100 and a server 200 is shown.

[0049] like Figure 2 As shown, when the electronic device 100 needs to perform a system upgrade, the server 200 can obtain the version number of the original version of the system installed on the electronic device 100 from the electronic device 100. Based on the obtained version number of the original version, the server 200 compares the original version corresponding to the version number with the target version to which the electronic device 100 is to be upgraded to create a differential upgrade package, and then sends the created differential upgrade package to the electronic device 100. After receiving the differential upgrade package, the electronic device 100 performs a system upgrade to upgrade its own system to the target version.

[0050] In order to solve the problem mentioned above that, when the target partition of the target version of the system of the electronic device 100 is inconsistent with the original partition of the original version, a differential upgrade package from the original version to the target version cannot be generated, resulting in the inability to perform a system upgrade, in some embodiments of the present application, when generating a differential upgrade package for the target version, the server 200 determines the change of each target partition in the target version relative to each original partition in the original version based on the partition information of the original version and the target version already installed on the electronic device 100, and then deletes the files in each original partition of the original version or adjusts the start and end positions of the partitions according to the change, such as the partition becoming larger or smaller, the partition position changing, etc., to obtain an intermediate version. In this way, each intermediate partition in the intermediate version is consistent with each target partition in the target version, that is, the partition size and start and end positions of each intermediate partition in the intermediate version are consistent with the target partition of the target version. Then, the target version and the intermediate version are compared to generate a differential upgrade package corresponding to the target version of the system. In this way, after the electronic device 100 performs a differential upgrade according to the differential upgrade package, the system partition on the electronic device 100 will change and become consistent with the partition of the target version.

[0051] For example, the server 200 may first copy the original version file corresponding to the version number of the original version installed on the electronic device 100, and then refer to Figure 1 The server 200 can also directly obtain the original version and adjust the original version to an intermediate version that is consistent with the partition of the target version.

[0052] For example, reference Figure 1 , the partition size of the target partition A' is smaller than the original partition A. In an embodiment of the present application, the original partition A of the original version needs to be adjusted to an intermediate partition A" that is consistent with the target partition A'. The server 200 can reduce the partition size of the original partition A according to the size and start and end positions of the corresponding target partition A' in the target version, that is, move the end position of the original partition A forward, so that the size and start and end positions of the remaining partitions of the original partition are consistent with the size and start and end positions of the corresponding target partition, that is, obtain an intermediate partition A" that is consistent with the target partition A'. If there is an original partition B after the original partition A, part of the original partition A will be overwritten by the original partition B.

[0053] For another example, if the target partition of the target version and the original partition of the original version have different starting and ending positions, such as Figure 1In the target version, the target partition B' is the same size as the original partition B. Since the original partition B is connected to the original partition A, the start and end positions of the original partition B need to change as the original partition A becomes smaller. You can move the start and end positions of the original partition B' forward according to the start and end positions of the corresponding target partition B' in the target version, so that the start and end positions of the original partition B and the corresponding target partition B' are consistent, thus obtaining an intermediate partition B" with the same start and end positions as the target partition B'.

[0054] The target partition C' is larger than the original partition C. Since the original partition C is connected to the original partition B, the start and end positions of the original partition C must also be changed when the start and end positions of the original partition B change. First, the starting position of the original partition C can be moved forward according to the start and end positions of the corresponding target partition C' in the target version. Then, the original partition C can be expanded, that is, the end position of the original partition C can be moved backward, so that the partition size and start and end positions of the original partition C and the corresponding target partition C' are consistent, thus obtaining an intermediate partition C' with the same start and end positions and partition size as the target partition C'.

[0055] It can be understood that after the server 200 adjusts the original partitions of the original version into intermediate partitions consistent with the target partitions of the target version, it obtains the intermediate version of the system, compares the intermediate version with the target version, and obtains a differential upgrade package.

[0056] Figure 2 The server 200 in the embodiment may be a hardware server or embedded in a virtualized environment. For example, according to some embodiments of the present application, the server 200 may be a virtual machine executed on a hardware server that includes one or more other virtual machines. The target version corresponding to the original version of the electronic device 100 system may be stored in the storage area of ​​the server 200, and a differential upgrade package for upgrading from the original version to the target version may be produced based on the original version of the electronic device 100 system and the target version of the system. After the server 200 obtains the original version of the electronic device 100, the differential upgrade package for the target version may be pushed to the electronic device 100.

[0057] It is understood that the electronic device 100 here can be various electronic devices, for example, including but not limited to laptop computers, desktop computers, tablet computers, mobile phones, servers, wearable devices, head-mounted displays, mobile email devices, portable game consoles, portable music players, reader devices, or other electronic devices capable of accessing the Internet. In some embodiments, the embodiments of the present application can also be applied to wearable devices worn by users. For example, smart watches, bracelets, jewelry (for example, devices made into decorative items such as earrings, bracelets, etc.) or glasses, etc., or as part of watches, bracelets, jewelry or glasses, etc. For ease of description, the following description is taken as an example where the electronic device 100 is a mobile phone 100.

[0058] Below we first Figure 2 Taking the server 200 shown in the figure as an example, the method for making a differential upgrade package of the server 200 based on the original version and the target version of the system is described, and combined with Figures 3 to 4d The following describes in detail the method for producing the differential upgrade package involved in the embodiment of the present application.

[0059] like Figure 3 As shown, in the embodiment of the present application, the method for preparing the differential upgrade package includes:

[0060] S301: The server 200 obtains the file packages corresponding to the original version and the target version of the system.

[0061] The original version here refers to the current version of the system installed on the electronic device 100, and the target version refers to the version to be upgraded of the system of the electronic device 100. The version number of the target version is higher than the version number of the original version. The file packages of the original version and the target version can be stored in the storage area of ​​the server 200.

[0062] S302: The server 200 obtains the partition information of the original version and the target version.

[0063] The original and target versions' file packages contain their respective partition information. Partition information describes each partition in the original and target versions, including its name, start and end locations, and size. Partition information can be stored in the original and target versions' file packages in the form of partition information files. Server 200 can obtain the partition information for the original and target versions by reading the partition information files.

[0064] The partition name is used to describe the identifier of each partition. For example, the partition name of the original partition A of the original version may be A.

[0065] The partition start and end positions are used to describe the location of the partition in the storage device of mobile phone 100. The start and end positions may include the partition start address, which can be described by the number of the first data block of the partition. For example, the partition start address of the original version of original partition A is 0001, indicating that the original version of original partition A starts from the 0001th data block in the storage device of mobile phone 100.

[0066] The partition size is used to describe the size of the data block occupied by the partition in the storage space of the mobile phone 100. For example, the partition size of the original partition A of the original version may be 1000, which means that the original partition A occupies the storage space from 0001 to 1000 starting from data block 0001 in the storage space of the mobile phone 100.

[0067] S303: The server 200 adjusts the original partition of the original version based on the partition information of the original version and the target version to obtain an intermediate version.

[0068] It is understandable that the server 200 can first copy the original version to obtain a copy of the original version; then determine the changes in each partition of the original version based on the partition information of the original version and the target version. If there are changes, the server 200 adjusts the original partition of the copy of the original version to an intermediate partition that is the same as the target partition of the target version, and obtains an intermediate version containing the intermediate partition. The server 200 can also directly obtain the original version and adjust the original version to an intermediate version that is consistent with the partition of the target version. In response to the different changes in each original partition, the server 200 can execute different methods to adjust the original partition to an intermediate partition that is consistent with the target partition. The process of S303 will be described in detail below.

[0069] S304: The server 200 creates a differential upgrade package from the intermediate version to the target version.

[0070] When the intermediate partition of the intermediate version is identical to the target partition of the target version, the server 200 creates a differential upgrade package from the intermediate version to the target version.

[0071] The following describes the process in which the server 200 adjusts the original partition of the original version based on the partition information of the original version and the target version, obtains an intermediate version consistent with the target version, and creates a differential upgrade package from the intermediate version to the target version.

[0072] like Figure 4a As shown, the original partition A, original partition B and original partition C of the original version and the target partition A', target partition B' and target partition C' of the target version are arranged in sequence, that is, the partition end position of the previous partition is adjacent to the partition start address of the next partition. Figure 4aThe partition information of the original version and the target version described in , for example, the partition starting address of the target partition A' of the target version is determined to be 0001 and the partition size is 1000, and the partition starting address of the original partition A of the original version is determined to be 0001 and the partition size is 2000. The partition starting address of the target partition B' of the target version is determined to be 1001 and the partition size is 1000, while the partition starting address of the original partition B of the original version is 2001 and the partition size is 1000. The partition starting address of the target partition C' of the target version is determined to be 2001 and the partition size is 2000, while the partition starting address of the original partition C of the original version is 3001 and the partition size is 1000.

[0073] In this case, after comparing the partitions of the original version with those of the target version, the size of the original partition A of the original version becomes smaller. The position of the original partition B changes, and the position of the original partition C changes and the size of the partition becomes larger. Figure 4b As shown, the server 200 can adjust the partitions of the original version to obtain an intermediate version that is consistent with each partition of the target version.

[0074] Here, reference Figure 4c For the original partition A of the original version, server 200 compares original partition A with target partition A' of the target version and determines that the partition start addresses of original partition A and target partition A' are the same, both being 0001. However, the partition size of original partition A, 2000, is larger than the partition size of target partition A', 1000. Therefore, after comparing the partition information of the two, server 200 determines that the files within the area from addresses 1001 to 2000 are the files in original partition A that will be overwritten by original partition B relative to target partition A'.

[0075] That is, the server 200 adjusts the partition end address of the original partition A from 2000 to 1000, while keeping the partition start address of the original partition A at 0001, thereby obtaining the middle partition A". After the partition size is adjusted to 1000, the files outside the start and end positions of the original partition A (the area from 1001 to 2000) will be overwritten by the original partition B after the original partition A.

[0076] Continue to refer Figure 4dFor the original version's original partition B, the target version's target partition B' has a partition start address of 1001 and a partition size of 1000, while the original version's original partition B has a partition start address of 2001. Compared to the target partition B', the original partition B's size remains unchanged; only its position has changed. That is, the original version's original partition B has shifted by 1000 toward a smaller partition start address. Server 200 can adjust the original version's original partition B's position based on the positions of the original partition B and the target partition B' to obtain the intermediate partition B".

[0077] Here, the server 200 moves the starting and ending positions of the original partition B of the original version forward by 1000 to obtain the intermediate partition B". The partition starting address of the intermediate partition B" becomes 1001, and the partition size remains unchanged. At the same time, for the files in the intermediate partition B", such as file B1 and file B2, the server 200 also subtracts 1000 from the data block numbers of file B1 and file B2 in the intermediate partition B" based on the change in the position of the original partition B relative to the target partition B'.

[0078] Continue to refer Figure 4e For the original partition C of the original version, the target partition C' of the target version has a partition start address of 2001 and a partition size of 2000, while the original partition C of the original version has a partition start address of 3001 and a partition size of 1000. That is, relative to the target partition C', the original partition C of the original version needs to be moved by 1000 toward a smaller partition start address. At the same time, the partition size of the original partition C of the original version is larger than that of the target partition C' of the target version. The server 200 determines that 3001 to 4000 are the newly added area of ​​the original partition C.

[0079] First, the server 200 moves the start and end positions of the original partition C of the original version forward by 1000, that is, changes the partition start address of the original partition C to 2001. For the files in the original partition C, such as file C1 and file C2, the server 200 similarly decrements the data block numbers of file C1 and file C2 in the original partition C by 1000 based on the change in the position of the original partition C relative to the target partition C'.

[0080] Next, the server 200 expands the original partition C, that is, moves the partition end address of the original partition C to 4000, thereby obtaining an intermediate partition C" that is consistent with the target partition C'. It is understood that the area from 3001 to 4000 of the obtained intermediate partition C" is a newly added area of ​​the intermediate partition C" and therefore does not contain any files.

[0081] After the server 200 completes the adjustment of the original partitions A, B, and C of the original version, the server 200 obtains an intermediate version consistent with each partition of the target version, and the server 200 creates a differential upgrade package from the intermediate version to the target version.

[0082] For the intermediate partition A" of the intermediate version, the server 200 compares the remaining files in the intermediate partition A" with the files in the target partition A' to obtain a differential upgrade package. It can be understood that if a file that has been overwritten in the original partition A does not exist in the target partition A', it means that the target version does not need the file; if it does exist, the file will be included in the differential upgrade package obtained after comparing the files in the intermediate partition A" with the files in the target partition A'.

[0083] For example, for files A1 and A2 in original partition A, the data block number corresponding to file A1 is 1100, and the data block number corresponding to file A2 is 1200. Here, both file A1 and file A2 have already been overwritten in original partition A. For file A1, a file with the same file name exists in target partition A' of the target version. However, file A2 does not exist in target partition A' of the target version. Therefore, after server 200 compares the files in original partition A with the files in target partition A' to obtain a differential upgrade package, the differential upgrade package contains file A1 but not file A2.

[0084] Similarly, the server 200 compares the files in the intermediate partition B" with the files in the target partition B' to obtain a differential upgrade package.

[0085] For intermediate partition C", server 200 compares the files in target version C' with the files in intermediate partition C" to create a differential upgrade package. For example, file C3 contained in versions 3001 to 4000 of target version C' is a new file for intermediate partition C". Therefore, the differential upgrade package created by server 200 will include file C3.

[0086] It can be understood that after the server 200 completes the production of the differential upgrade package for each partition of the intermediate version, the server 200 also adds the partition information of each partition of the target version to the differential upgrade package.

[0087] Apart from Figures 4a to 4e The description of the situation where each partition of the original version of the system is adjusted to be consistent with each partition of the target version, Figures 5a to 5e Another scenario is described in which each partition of the original version of the system is adjusted to be consistent with each partition of the target version.

[0088] like Figure 5aAs shown, the original version includes original partition A, original partition B, original partition C, original partition D, original partition E and original partition F, and the target version includes target partition A', target partition B', target partition C', target partition D', target partition E' and target partition F'. Figure 5a In the example, server 200 determines, based on the partition information of the original version and the target version, that the partition starting address of target partition A' of the target version is 0001 and the partition size is 1000, while the partition starting address of original partition A of the original version is 0001 and the partition size is 2000. The partition starting address of target partition B' of the target version is 1001 and the partition size is 2000, while the partition starting address of original partition B of the original version is 2001 and the partition size is 1000. The partition starting address of target partition C' of the target version is 3001 and the partition size is 1000, while the partition starting address of original partition C of the original version is 3001 and the partition size is 1000. The partition starting address of target partition D' of the target version is 4001 and the partition size is 2000, while the partition starting address of original partition D of the original version is 4001 and the partition size is 1000. The target partition E' of the target version has a partition start address of 6001 and a partition size of 2000, while the original partition E of the original version has a partition start address of 5001 and a partition size of 1000; the target partition F' of the target version has a partition start address of 7001 and a partition size of 1000, while the original partition F of the original version has a partition start address of 6001 and a partition size of 2000.

[0089] In this case, after comparing the partitions of the original version with those of the target version, the size of the original partition A of the original version becomes smaller; the position of the original partition B changes and the size of the partition becomes larger; the original partition C of the original version remains unchanged; the size of the original partition D of the original version becomes larger; the position of the original partition E changes; and the position of the original partition F changes and the size of the partition becomes smaller. Figure 5b As shown, the server 200 needs to adjust each partition of the original version based on each partition of the target version to obtain an intermediate version that is consistent with each partition of the target version.

[0090] Here, reference Figure 5c For the original partition A of the original version, the server 200 compares the original partition A with the target partition A' of the target version, keeps the partition start address of the original partition A at 0001, and adjusts the partition size to 1000, that is, the area from 1001 to 2000 in the original partition A will be overwritten by the original partition B, and obtains the intermediate partition A", so that the intermediate partition A" is consistent with the target partition A'.

[0091] Continue to refer Figure 5dFor the original partition B of the original version, the server 200 will compare it with the target partition B' of the target version, and move the starting and ending positions of the original partition B of the original version forward by 1000, so that the partition starting address of the original partition B becomes 1001. At the same time, the server 200 moves the partition ending address of the original partition B back to 3000, expands the original partition B, and obtains the intermediate partition B", so that the intermediate partition B" is consistent with the target partition B'.

[0092] Continue to refer Figure 5d For the original partition C of the original version, the server 200 determines that the original partition C has not changed relative to the target partition C' of the target version.

[0093] Continue to refer Figure 5e For the original partition D of the original version, the server 200 compares the original partition D with the target partition D' of the target version, keeps the partition start address of the original partition D at 4001, adjusts the partition size to 2000, that is, moves the partition end address of the original partition D backward to 6000, expands the original partition D, obtains the intermediate partition D, and makes the intermediate partition D consistent with the target partition D'.

[0094] Continue to refer Figure 5e For the original partition E of the original version, the server 200 compares the original partition E with the target partition E' of the target version, and moves the starting and ending positions of the original partition E of the original version backward by 1000, so that the partition starting address of the original partition E becomes 6001, and then obtains the intermediate partition E, so that the intermediate partition E is consistent with the target partition E'.

[0095] Continue to refer Figure 5e For the original partition F of the original version, server 200 compares it with the target partition F' of the target version. It then shifts the starting and ending positions of the original partition F of the original version backward by 1000, so that the starting address of the original partition F becomes 7001. At the same time, the partition size is adjusted to 1000 to obtain the intermediate partition F, making it consistent with the target partition F'. Here, the area from 7001 to 8000 in the original partition F will be overwritten by the target partition E'.

[0096] After adjusting each partition of the original version based on the partition information of the target version, the server 200 obtains an intermediate version that is consistent with each partition of the target version. The server 200 compares the files in each partition of the intermediate version with the files in each partition of the target version to create a differential upgrade package.

[0097] In the embodiments of the present application, the process of creating a differential upgrade package from an intermediate version to a target version involves server 200 performing a differential comparison between the target version's files and the intermediate version's files, and creating a differential upgrade package from the intermediate version to the target version based on the differences between the target and intermediate versions. The differences between the target and intermediate versions can be reflected in the number of files each contains. For example, taking the intermediate partition B' of the intermediate version as an example, the intermediate partition B' of the intermediate version contains files B1 and B2, while the target partition B' of the target version contains files B1, B2, and B3. Therefore, the differential upgrade package can include file B3.

[0098] It is understood that the difference between the intermediate version and the target version can also be reflected in the content of the files. For example, continuing with the intermediate partition B" of the intermediate version, the intermediate version and the target version both include file B1, file B2, and file B3. File B3 of the intermediate version contains content a and b, and file B3 of the target version contains content a, b, and c. The difference between the target version and the intermediate version is file B3, and the content contained in file B3 is c. The differential upgrade package then contains file B3, where file B3 contains content c.

[0099] For example, server 200 can determine whether there is a difference in the content of the file by comparing the hash value (hash value) of the target version file and the intermediate version file. If the hash values ​​are the same, it means that the intermediate version file has not changed relative to the target version. If the hash values ​​are different, it means that the intermediate version file has changed.

[0100] It can be understood that the difference between the intermediate version and the target version can also be reflected in the location of the files. For example, the intermediate version contains file A, file C, and file B, and the target version contains file A, file B, and file C. Compared with the target version, the content of file B and file C in the intermediate version has not changed, but the location has changed. The differential upgrade package can change the differential information of the location of file C and file B.

[0101] In addition to the above Figure 3 The method for making a differential upgrade package described in , in the embodiment of the present application, can also directly make a differential upgrade package without generating an intermediate version. Figure 3 The difference between the method for making a differential upgrade package described in the is that the server 200 can directly make a differential upgrade package from the original version to the target version based on the partition information of the system target version. The method for making a differential upgrade package here includes:

[0102] S601: The server 200 obtains the file packages corresponding to the original version and the target version of the system.

[0103] It can be understood that S601 is the same as the above S301, the target version of the system is higher than the target version of the system, and the file packages of the original version and the target version can be stored in the storage area of ​​the server 200.

[0104] S602: The server 200 obtains the partition information of the original version and the target version.

[0105] It can be understood that S602 is the same as the above S302. Figure 4a Taking the original version and target version of the system described in as an example, server 200 determines that the partition starting address of target partition A' of the target version is 0001 and the partition size is 1000, and determines that the partition starting address of original partition A of the original version is 0001 and the partition size is 2000. The partition starting address of target partition B' of the target version is determined to be 1001 and the partition size is 1000, while the partition starting address of original partition B of the original version is 2001 and the partition size is 1000. The partition starting address of target partition C' of the target version is determined to be 2001 and the partition size is 2000, while the partition starting address of original partition C of the original version is 3001 and the partition size is 1000.

[0106] S603: The server 200 creates a differential upgrade package from the original version to the target version.

[0107] In the case that the information of the original version and the target version are inconsistent, the server 200 can use the partition size of the target partition as a reference to perform a differential comparison on the files contained in the original partition and the target partition, and generate a differential upgrade package from the original partition to the target partition. The process of generating a differential upgrade package can be as follows: Figure 6 As shown, the following steps are included:

[0108] Server 200 first searches for files that exist in the target version but not in the original version. For such files, server 200 determines that they are new files and need to be added to the differential upgrade package. Next, for files that exist in both the target version and the original version, server 200 determines whether the address of the file in the original version is located outside the start and end positions of the target partition of the target version. If so, server 200 also determines that the file is a new file and needs to be added to the differential upgrade package. Finally, server 200 generates a differential upgrade package based on the hash values ​​of the files in the original and target versions.

[0109] For example, if the target partition is smaller than the original partition, the server 200 selects an area with the same size as the target partition, starting from the starting address of the original partition, based on the target partition's size. The server then performs a differential comparison between the files contained in the area and the files contained in the target partition to obtain a differential upgrade package from the original partition to the target partition. The server 200 does not perform a differential comparison on the files contained in the remaining areas of the original partition.

[0110] If the target partition is larger than the original partition, server 200 selects an area of ​​the target partition, starting from the starting address of the target partition, that has the same size as the original partition. It then performs a differential comparison between the files contained in this area and the files contained in the original partition, obtaining a differential upgrade package from the original partition to the target partition. For files in the target partition that exceed the size of the original partition, server 200 adds these files to the differential upgrade package as new files.

[0111] Continue to refer Figure 4a For the original partition A, the partition size of the original partition A is larger than that of the target partition A'. Server 200 starts at partition start address 0001 of the original partition A and selects a region with a partition size of 1000. That is, server 200 selects region 0001 to 1000 in the original partition A. Server 200 then performs a differential comparison between the files contained in region 0001 to 1000 of the original partition A and the files contained in the target partition A', obtaining a differential upgrade package from the original partition A to the target partition A'. Server 200 does not perform a differential comparison between the files in region 1001 to 2000 of the original partition A and the files contained in the target partition A'.

[0112] For the original partition B, the partition sizes of the original partition B and the target partition B' are unchanged. The server 200 can perform a differential comparison between the files contained in the original partition B and the files contained in the target partition B' to obtain a differential upgrade package from the original partition B to the target partition B'.

[0113] For the original partition C, the partition size of the original partition C is smaller than that of the target partition C'. Server 200 selects a region with a partition size of 1000, starting from the partition start address 3001 of the original partition C. That is, server 200 selects the region from 3001 to 4000 in the original partition C. Server 200 then performs a differential comparison between the files contained in the region from 3001 to 4000 of the original partition C and the files contained in the region from 2001 to 4000 of the target partition C', obtaining a differential upgrade package from the original partition C to the target partition C'. The files contained in the region from 3001 to 4000 of the target partition C' are directly added as new files to the differential upgrade package.

[0114] After completing the differential upgrade package, the mobile phone 100 obtains the differential upgrade package from the server 200, performs differential upgrade on the system of the mobile phone 100, and combines the Figures 7 to 9 The differential upgrade method of this application is described in detail.

[0115] Figure 7 A structural diagram of a mobile phone 100 according to an embodiment of the present application is shown.

[0116] The mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0117] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may include more or fewer components than shown, or may combine or separate certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0118] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0119] In an embodiment of the present application, the processor 110 is configured to upgrade the original version of the system of the mobile phone 100 using a differential upgrade package corresponding to the original version of the system.

[0120] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0121] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is merely an illustrative illustration and does not constitute a structural limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may also adopt a different interface connection method from the above embodiment, or a combination of multiple interface connection methods.

[0122] The charging management module 140 is configured to receive charging input from a charger. The power management module 141 is configured to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160.

[0123] The wireless communication function of the mobile phone 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0124] The mobile communication module 150 can provide wireless communication solutions including 2G / 3G / 4G / 5G applied on the mobile phone 100.

[0125] The wireless communication module 160 can provide wireless communication solutions for the mobile phone 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. In some embodiments, the antenna 1 of the mobile phone 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.

[0126] In an embodiment of the present application, the mobile phone 100 can communicate with the server 200 through the wireless communication module 160 and obtain a differential upgrade package corresponding to the original version of the system from the server 200.

[0127] The mobile phone 100 implements the display function through the GPU, the display screen 194 , and the application processor, etc. In some embodiments, the mobile phone 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.

[0128] The mobile phone 100 can realize the shooting function through the ISP, camera 193, video codec, GPU, display 194 and application processor.

[0129] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0130] The internal memory 121 can be used to store computer executable program code, which includes instructions. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the mobile phone 100 (such as audio data, a phone book, etc.). In other embodiments of the present application, the internal memory 121 can store the service code of the application.

[0131] In an embodiment of the present application, the original version of the system of the mobile phone 100 can be installed in the internal memory 121. When the mobile phone 100 uses the differential upgrade package corresponding to the original version of the system for upgrading, the mobile phone 100 can decompress the differential upgrade package and store it in the internal memory 121.

[0132] The mobile phone 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0133] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0134] The speaker 170A, also called a "horn," is used to convert audio electrical signals into sound signals. The mobile phone 100 can listen to music or make hands-free calls through the speaker 170A.

[0135] The receiver 170B, also called the "earpiece", is used to convert audio electrical signals into sound signals. When the mobile phone 100 receives a call or a voice message, the voice can be heard by placing the receiver 170B close to the ear.

[0136] Microphone 170C, also known as a "microphone" or "speaker," converts sound signals into electrical signals. When making a call or sending a voice message, a user can place their mouth close to microphone 170C and speak, inputting the sound signal into microphone 170C. Mobile phone 100 may be equipped with at least one microphone 170C.

[0137] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0138] The fingerprint sensor 180H is used to collect fingerprints. The mobile phone 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0139] The touch sensor 180K is also called a “touch control device”. The touch sensor 180K can be provided on the display screen 194 . The touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.

[0140] Keys 190 include a power button, a volume button, etc. Keys 190 may be mechanical keys or touch keys. Mobile phone 100 may receive key inputs and generate key signal inputs related to user settings and function control of mobile phone 100.

[0141] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts and can also be used for touch vibration feedback.

[0142] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0143] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the mobile phone 100 by inserting or removing the SIM card into or from the SIM card interface 195.

[0144] Figure 8 The structure diagram of the modules involved in differential upgrade in the mobile phone 100 is shown, wherein the mobile phone 100 includes a CPU 101 and a storage device 102.

[0145] CPU101 is used to restart the mobile phone 100 and enter the upgrade mode before the mobile phone 100 upgrades the original version of the system. At the same time, CPU101 can also run the partition adjustment module 1011, the partition driver 1012 and the upgrade module 1013. The partition adjustment module 1011 is used to compare the partition of the target version of the system with the partition of the original version of the system of the mobile phone 100. When the two are different, the partition of the original version of the system of the mobile phone 100 is adjusted according to the partition information of the target version of the system. The partition driver 1012 is used to execute the instruction issued by the partition adjustment module 1011 to adjust the partition of the original version of the system of the mobile phone 100. The upgrade module 1013 is used to upgrade the original version of the system using the differential upgrade package of the target version of the system.

[0146] The storage device 102 is used to store the target version differential upgrade package of the system when the upgrade module 1013 of the CPU 101 uses the target version differential upgrade package of the system to upgrade the original version of the system. At the same time, the storage device 102 also stores the original version file of the system of the mobile phone 100.

[0147] In the embodiment of the present application, after the mobile phone 100 is restarted and enters the upgrade mode, the CPU 101 of the mobile phone 100 may enter the mini-system (minimal functional set). When the mobile phone 100 is restarted and enters the mini-system, the CPU 101 does not start the application program of the mobile phone 100. The partition adjustment module 1011, partition driver 1012, and upgrade module 1013 in the mini-system run directly in the memory of the mobile phone 100.

[0148] like Figure 9 As shown, the technical solution for performing differential upgrade of mobile phone 100 includes:

[0149] S901: The mobile phone 100 receives a differential upgrade package of a target version from the server 200.

[0150] Here, after establishing a communication connection between mobile phone 100 and server 200, mobile phone 100 can send the version number of the original version of mobile phone 100's system to server 200. Based on the version number of the original version, server 200 matches the target version stored in the storage area of ​​server 200 with a differential upgrade package corresponding to the version number of the original version. Server 200 then sends the differential upgrade package to mobile phone 100 for differential upgrade.

[0151] In some embodiments of the present application, the server 200 may also actively obtain the version number of the original version of the system of the mobile phone 100 to which it is communicating. If the storage area of ​​the server 200 stores a differential upgrade package of the target version corresponding to the version number, the server 200 may push a prompt message to the mobile phone 100 asking whether to update. After the user confirms that the mobile phone 100 needs to be updated, the server 200 sends the differential upgrade package to the mobile phone 100 for differential upgrade.

[0152] S902: The mobile phone 100 obtains files and partition information from the differential upgrade package of the target version.

[0153] Here, CPU101 restarts the mobile phone 100 into the upgrade mode by executing the restart command. In the upgrade mode, the mobile phone 100 will not mount the file system outside the system partition, so as to ensure that other files of the mobile phone 100 will not be affected during the differential upgrade process. Figure 8 , the mobile phone 100 imports the differential upgrade package of the target version into the storage device 102 of the mobile phone 100 .

[0154] Here, the target version differential upgrade package can be in the format of a compressed file. After the mobile phone 100 restarts and enters the upgrade mode, the differential upgrade package can be decompressed using a decompression tool corresponding to the compressed file format. The mobile phone 100 stores the files and partition information in the decompressed differential upgrade package in the storage device 102 of the mobile phone 100.

[0155] S903: Mobile phone 100 compares the partition information of the original version of its system with the partition information of the target version to determine whether the partitions of the original version and the target version are consistent. If they are inconsistent, the process proceeds to S904, where the partitions of the original version are adjusted to be consistent with the partitions of the target version. If they are consistent, the process proceeds to S905, where mobile phone 100 performs a differential upgrade of the original version of its system based on the differential upgrade package of the target version.

[0156] For example, the partition adjustment module 1011 of the mobile phone 100 can obtain the partition position and partition size of each partition in the target version from the partition information in the differential upgrade package of the target version saved in the storage device 102, and then compare it with the partition position and partition size obtained by each person in the original version to determine whether the partition of the original version is consistent with that in the target version.

[0157] It is understood that once it is confirmed that the partitions of the original version and the target version are inconsistent, S904 is executed: the mobile phone 100 adjusts the partitions of the original version to be consistent with the partitions of the target version based on the partition information of the target version. Otherwise, S905 is executed, and the mobile phone 100 performs a differential upgrade on the original version of its own system based on the differential upgrade package of the target version.

[0158] S904: The mobile phone 100 adjusts the partition of the original version to be consistent with the partition of the target version based on the partition information of the target version.

[0159] Here, the method in which the mobile phone 100 adjusts the partition of the original version to be consistent with the partition of the target version is similar to that described in the above step S303, which will be explained below.

[0160] S905: The mobile phone 100 performs a differential upgrade on the original version of its own system based on the differential upgrade package of the target version.

[0161] After the partitions of the original version of the system of the mobile phone 100 are consistent with the partitions of the target version, the upgrade module 1013 of the mobile phone 100 uses the differential upgrade package of the target version of the system to upgrade the original version of the system. The upgrade process here is that the upgrade module 1013 of the mobile phone 100 updates the files in the differential upgrade package to the original version of the mobile phone 100.

[0162] Below is Figure 4a The original version of the system and the partition of the target version described in are taken as the original version and the target version of the system of the mobile phone 100 as an example to illustrate the implementation process of the above step S904.

[0163] Continue to refer Figure 4a The original version of the mobile phone 100 includes original partition A, original partition B, and original partition C; the target version includes target partition A', target partition B', and target partition C'. It can be understood that the original partition A, original partition B, and original partition C here can be either logical partitions or physical partitions.

[0164] After obtaining the partition information corresponding to the original version and the target version from the storage device 102, the partition adjustment module 1011 of the mobile phone 100 compares the two and determines that the target partition A' of the target version has a partition starting address of 0001 and a partition size of 1000, while the original partition A of the original version has a partition starting address of 0001 and a partition size of 2000. The target partition B' of the target version has a partition starting address of 1001 and a partition size of 1000, while the original partition B of the original version has a partition starting address of 2001 and a partition size of 1000. The target partition C' of the target version has a partition starting address of 2001 and a partition size of 2000, while the original partition C of the original version has a partition starting address of 3001 and a partition size of 1000.

[0165] After mobile phone 100 determines that the partitions of the original version and the target version are inconsistent, mobile phone 100 adjusts the original partition A of the original version to keep the partition start address unchanged at 0001 and the partition size at 1000. In other words, the area from 1001 to 2000 will be overwritten by original partition B. Therefore, the files in this area will also be overwritten. The files in the area from 0001 to 1000 of the original partition A of the original version remain unchanged.

[0166] For the original partition B of the original version, although the partition size does not change compared with the target partition B' of the target version, since the original partition B is connected to the original partition A, after the partition adjustment module 1011 adjusts the original partition A of the original version to be consistent with the target partition A' of the target version, the partition adjustment module 1011 will adjust the position of the original partition B of the original version. That is, the partition adjustment module 1011 moves the partition position of the original partition B forward by 1000, so that the partition starting position of the original partition B becomes 1001. At the same time, the files contained in the original partition B are also moved to the adjusted original partition B.

[0167] After the partition adjustment module 1011 of the mobile phone 100 has adjusted the original partition B, the partition adjustment module 1011 will adjust the original partition C of the original version according to the partition size of the target partition C' of the target version. First, the partition adjustment module 1011 moves the partition position of the original partition C forward by 1000, so that the partition start address of the original partition C is 2001, and at the same time adjusts the partition size of the original partition C to 2000. In other words, the partition adjustment module 1011 moves the files in the area 3001 to 4000 of the original partition C of the original version to the area 2001 to 3000. After the partition adjustment module 1011 performs the above steps, the partition adjustment module 1011 adjusts the partition end address of the original partition C from 3000 to 4000. The area 3000 to 4000 is a newly added area of ​​the original partition C.

[0168] After the partition adjustment module 1011 of the mobile phone 100 adjusts the partition of the original version of the system to be consistent with the target version, the mobile phone 100 executes step 905 to upgrade the original version of the system.

[0169] Apart from Figures 4a to 4e After comparing the original version of the described file package with each partition of the target version, the partition size of the original partition A of the original version becomes smaller; the position of the original partition B changes; the position of the original partition C changes and the partition size becomes larger. In another embodiment of the present application, Figures 10a to 10d Describes the changes in each partition between the original version and the target version of another file package.

[0170] like Figure 10a As shown in the figure, the target version's target partition A' has a partition start address of 0001 and a partition size of 2000; the target partition B' has a partition start address of 2001 and a partition size of 1000; the target partition C' has a partition start address of 3001 and a partition size of 1000. Relative to the target version, the original version's original partition A has a partition start address of 0001 and a partition size of 1000; the original partition B has a partition start address of 1001 and a partition size of 1000; and the original partition C has a partition start address of 2001 and a partition size of 2000.

[0171] In this case, after comparing the partitions of the original version with those of the target version, the size of the original partition A of the original version becomes larger. The position of the original partition B changes, and the position of the original partition C changes and the size of the partition becomes smaller. Figure 10b As shown, the server 200 can adjust the partitions of the original version to obtain an intermediate version that is consistent with each partition of the target version.

[0172] Here, reference Figure 10c For the original partition A of the original version, server 200 compares original partition A with target partition A' of the target version and determines that the partition start addresses of original partition A and target partition A' are identical, both being 0001. However, the partition size of original partition A, 1000, is smaller than the partition size of target partition A', 2000. In other words, server 200 shifts the partition end address of original partition A to 2000, thereby obtaining intermediate partition A' that is consistent with target partition A'.

[0173] Continue to refer Figure 10c For the original version's original partition B, the target version's target partition B' has a partition start address of 2001 and a partition size of 1000, while the original version's original partition B has a partition start address of 1001. Compared to the target partition B', the original partition B's size remains unchanged; only its position has changed. That is, the original version's original partition B has shifted by 1000 toward a larger partition start address. Server 200 can adjust the original version's original partition B's position based on the positions of the original partition B and the target partition B' to obtain the intermediate partition B".

[0174] Continue to refer Figure 10dFor the original version's original partition C, the target version's target partition C' has a partition start address of 3001 and a partition size of 1000, while the original version's original partition C has a partition start address of 2001 and a partition size of 2000. That is, relative to the target partition C', server 200 moves the original version's original partition C by 1000 toward a larger partition start address. At the same time, server 200 shrinks the original partition C by moving its partition end address forward to 4000, obtaining the intermediate partition C".

[0175] It should be understood that although the terms "first," "second," and the like may be used herein to describe various features, these features should not be limited by these terms. These terms are used merely to distinguish and should not be understood as indicating or implying relative importance. For example, a first feature may be referred to as a second feature, and similarly, a second feature may be referred to as a first feature, without departing from the scope of the exemplary embodiments.

[0176] Furthermore, various operations will be described as multiple, separate operations in a manner that is most helpful for understanding the illustrative embodiments; however, the order of description should not be construed to imply that the operations must be performed in order of description, and many of the operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can terminate when the described operations are completed, but can also have additional operations not included in the figures. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0177] References in the specification to "one embodiment," "an embodiment," "an illustrative embodiment," etc., indicate that the described embodiment may include a particular feature, structure, or property, but that every embodiment may or may not necessarily include the particular feature, structure, or property. Furthermore, these phrases are not necessarily referring to the same embodiment. Furthermore, while particular features may be described in conjunction with a specific embodiment, the knowledge of those skilled in the art may affect how those features may be combined with other embodiments, whether or not those embodiments are explicitly described.

[0178] Unless the context dictates otherwise, the terms "comprising," "having," and "including" are synonymous. The phrase "A / B" means "A or B." The phrase "A and / or B" means "(A), (B), or (A and B)."

[0179] As used herein, the term "module" may refer to, be part of, or include: memory (shared, dedicated, or group) for running one or more software or firmware programs, application-specific integrated circuits (ASICs), electronic circuits and / or processors (shared, dedicated, or group), combinational logic circuits, and / or other suitable components that provide the functionality.

[0180] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order is not required. Rather, in some embodiments, these features may be illustrated in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular drawing does not mean that all embodiments need to include such features. In some embodiments, these features may not be included, or they may be combined with other features.

[0181] The embodiments of the present application are described in detail above with reference to the accompanying drawings. However, the application of the technical solution of the present application is not limited to the various applications mentioned in the embodiments of the present patent. Various structures and variations can be easily implemented with reference to the technical solution of the present application to achieve the various beneficial effects mentioned herein. Various changes made within the knowledge of ordinary technicians in this field without departing from the purpose of the present application should fall within the scope of coverage of the patent application.

Claims

1. A system upgrade method for an electronic device, characterized in that: include: Obtaining a differential upgrade package required to upgrade a system currently installed on the electronic device from a first version to a second version, the differential upgrade package being produced based on differences between files of an intermediate version and files of the second version, the intermediate version being obtained by adjusting original partitions of the first version based on partition information of the first and second versions, the differences between the files of the intermediate version and the files of the second version including the number of files, file contents, and file locations contained in the files of the intermediate version and the files of the second version, respectively; The electronic device enters an upgrade mode and loads a partition of the electronic device installation system separately; Adjusting the size and start and end positions of each partition in the first version of the system installed on the electronic device to be consistent with the size and start and end positions of the corresponding partition in the second version according to the partition information of the second version in the differential upgrade package; Based on the differential upgrade package, the system is upgraded from the first version to the second version in each adjusted partition on the electronic device.

2. The method according to claim 1, characterized in that The partition information in the differential upgrade package includes the partition name, starting position, ending position, and partition size of the partition.

3. The method according to claim 2, characterized in that Adjusting the size and start and end positions of each partition in the first version of the system installed on the electronic device to be consistent with the size and start and end positions of the corresponding partition in the second version according to the partition information of the second version in the differential upgrade package, including: When the first partition in the first version is larger than the corresponding second partition in the second version, based on the start and end positions of the second partition, a partition connected to the first partition is used to cover the area of ​​the first partition outside the start and end positions, so that the size of the first partition of the first version is consistent with the size of the second partition of the second version.

4. The method according to claim 2, characterized in that Adjusting the size and start and end positions of each partition in the first version of the system installed on the electronic device to be consistent with the size and start and end positions of the corresponding partition in the second version based on the partition information of the second version in the differential upgrade package, further comprising: When the first partition in the first version is smaller than the second partition in the second version, the starting position of the first partition is adjusted to be the same as the starting position of the second partition, and the ending address of the first partition is moved backward so that the ending position of the first partition is the same as the ending position of the second partition.

5. The method according to claim 1, characterized in that Upgrading the system from the first version to the second version in each adjusted partition on the electronic device based on the differential upgrade package includes: When the adjusted partitions of the first version are consistent with the partitions of the second version, the files belonging to the second version of the system in the differential upgrade package are written into the corresponding partitions on the electronic device after the sizes and start and end positions are adjusted.

6. The method according to claim 1, wherein Generate the differential upgrade package in the following way: Compare the files of each partition in the second version with the files in the differential sub-partition of the corresponding partition in the first version to generate the differential upgrade package required to upgrade the first version to the second version, wherein the differential sub-partition of the partition of the first version has the same partition size and start and end positions as the corresponding partition in the second version.

7. The method according to any one of claims 1 to 6, characterized in that The partition is a physical partition or a logical partition.

8. An electronic device, characterized in that: include: a memory storing instructions; A processor is coupled to a memory, and when the program instructions stored in the memory are executed by the processor, the electronic device executes the system upgrade method of the electronic device according to any one of claims 1 to 7.

9. A readable medium, characterized in that The readable medium stores instructions, and the instructions are executed on a machine to enable the machine to execute the system upgrade method of the electronic device according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Subarea adjustment method, device, terminal, server and system

    CN103455348A

  • Software upgrading method and system for mobile terminal

    CN103473099A