A differential upgrade method based on a separable terminal
By selecting a suitable upgrade mode for the detachable terminal and utilizing the storage space of the main and secondary terminals to complete the upgrade collaboratively, the problems of high upgrade failure risk, excessive storage space occupation, and slow speed in detachable terminal devices are solved, achieving a higher success rate and faster upgrade speed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 读书郎教育科技有限公司
- Filing Date
- 2022-09-07
- Publication Date
- 2026-06-26
AI Technical Summary
In existing technologies, differential upgrades of dual-terminal or multi-terminal devices have problems such as high risk of upgrade failure, excessive storage space consumption, and slow upgrade speed. In particular, there is a lack of efficient upgrade methods in detachable terminals.
Based on the storage space of the detachable terminals, select the appropriate upgrade mode and use the storage space of the main and secondary terminals to complete the upgrade collaboratively. There are four modes: the first terminal upgrades itself, the original installation package is migrated to the secondary terminal, the secondary terminal upgrades itself, and the main terminal merges the packages and then upgrades, so as to ensure reasonable use of storage space and high upgrade success rate.
It improves the success rate of upgrades for detachable terminal devices, reduces storage space usage, and enhances upgrade speed and efficiency.
Smart Images

Figure BDA0003837028690000021 
Figure BDA0003837028690000051 
Figure FDA0003837028680000011
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic equipment technology, and more specifically to a differential upgrade method based on a detachable terminal. Background Technology
[0002] Currently, dual-terminal or multi-terminal devices are constantly emerging, including those with one main terminal and at least one secondary terminal (such as multi-screen terminals that include one main screen terminal and at least one secondary screen terminal). Detachable terminals refer to secondary terminals that can be connected to the main terminal for combined use or detached for independent use. The main terminal and secondary terminal usually have independent storage space.
[0003] As current terminal devices become increasingly feature-rich and powerful, the storage space occupied by application software or firmware also increases. Full upgrades (downloading the entire upgrade package before upgrading) are not only expensive in terms of bandwidth but also slow. Most current smart devices use differential upgrades (only the differences between the full upgrade package and the device's current application or firmware package need to be downloaded to complete the upgrade).
[0004] However, to prevent application or firmware errors due to upgrade failure, the original application APK or firmware package can only be deleted after the differential upgrade is completely successful. Therefore, the upgrade process actually involves two packages: the original package and the merged package from the differential upgrade, resulting in a relatively large storage space requirement. Thus, to ensure a higher upgrade success rate, a more suitable upgrade method should be found for detachable terminals. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention aims to provide a differential upgrade method based on a detachable terminal.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] A differential upgrade method based on a detachable terminal, wherein the detachable terminal includes a first terminal and a second terminal that can be interconnected but separated from each other, and the first terminal and the second terminal each have independent storage space; the specific process of the method is as follows:
[0008] When the first terminal receives an upgrade event, it obtains upgrade information and space information, selects an upgrade mode, and performs the upgrade according to the selected upgrade mode. The upgrade information includes at least the differential packet size for this upgrade. The space information includes the available storage space of the first terminal and the storage space that the second terminal can assist in supporting.
[0009] The specific steps for selecting the upgrade mode are as follows:
[0010] Calculate the required storage space for the upgrade using the following formula:
[0011]
[0012] Where Rspace is the storage space required for the first terminal upgrade, Rcurpkg is the size of the original installation package before the application or firmware upgrade, Rpatch is the size of the differential package for this upgrade, Rgap is the redundant space required for the upgrade, and Rmin is the storage space required for the full package of this upgrade.
[0013] When the current available storage space of the first terminal is greater than or equal to Rspace, select the first upgrade mode; when the current available storage space of the first terminal is less than Rspace, and the auxiliary storage space of the second terminal is greater than or equal to Rspace, use the second upgrade mode; when the current available storage space of the first terminal is greater than or equal to Rmin and less than Rspace, and the auxiliary storage space of the second terminal is less than Rmin but greater than or equal to Rcurpkg, use the third upgrade mode; when the current available storage space of the first terminal is greater than Rcurpkg and less than Rmin, and the auxiliary storage space of the second terminal is greater than or equal to Rmin and less than Rspace, use the fourth upgrade mode; when the current available storage space of the first terminal is less than Rmin and the auxiliary storage space of the second terminal is less than Rmin, there is insufficient space, the upgrade cannot be completed, and a prompt should be given to the user.
[0014] The first upgrade mode is as follows: The first terminal downloads the differential package for this upgrade to its local machine, and the first terminal completes the entire upgrade process on its own. The entire upgrade process includes: copying the original installation package and merging it with the downloaded differential package to form a full package; verifying the version and MD5 value or hash value of the full package; executing the upgrade program after verification; obtaining the upgrade status after the upgrade is completed; if the upgrade is successful, the process ends; if the upgrade fails, the version is rolled back according to the original installation package.
[0015] The second upgrade mode is as follows: the first terminal migrates both the original installation package and the downloaded differential package to the storage space of the second terminal, and the second terminal completes the entire upgrade process;
[0016] The third upgrade mode is as follows: the first terminal transfers the original installation package to the second terminal, merges the original installation package and the local differential package into a full package and saves it in the first terminal, and then the first terminal completes the entire upgrade process.
[0017] The fourth upgrade mode is as follows: the first terminal downloads the differential package and saves it on the second terminal. After merging the original installation package and the differential package on the second terminal into a full package and saving it on the first terminal, the first terminal completes the entire upgrade process.
[0018] Furthermore, the first terminal obtains the upgrade event either by pushing the upgrade package to the first terminal when the server mounts it, or by obtaining it by accessing the server after the first terminal triggers an update detection event itself.
[0019] Furthermore, the upgrade information also includes the target version number of the differential package, the MD5 value and / or hash value of the full package, the update content, and the new application or firmware icon.
[0020] Furthermore, if the current available storage space of the second terminal is less than the preset maximum storage space that can be used to assist in supporting the upgrade of the first terminal, then the storage space that the second terminal can assist in supporting is equal to the current available storage space of the second terminal; if the current storage space of the second terminal is greater than or equal to the maximum storage space that can be used to assist in supporting the upgrade of the first terminal, then the storage space that the second terminal can assist in supporting is equal to the preset maximum storage space that can be used to assist in supporting the upgrade of the first terminal.
[0021] The present invention also provides a detachable terminal for implementing the above method.
[0022] The beneficial effects of this invention are as follows: This invention makes full use of the characteristics and advantages of detachable terminals, and the two terminals can assist each other in upgrading, thereby improving the success rate of terminal device upgrades. Detailed Implementation
[0023] The present invention will be further described below. It should be noted that this embodiment is based on the present technical solution and provides detailed implementation methods and specific operation processes, but the protection scope of the present invention is not limited to this embodiment.
[0024] This embodiment provides a differential upgrade method based on a detachable terminal. The detachable terminal includes a first terminal and a second terminal that can be interconnected and separated from each other. The first terminal and the second terminal each have independent storage space. The specific process of the method is as follows:
[0025] When the first terminal receives an upgrade event, it obtains upgrade information and space information, selects an upgrade mode, and performs the upgrade according to the selected upgrade mode. The upgrade information includes at least the size of the differential packet for this upgrade. The space information includes the available storage space of the first terminal and the storage space that the second terminal can assist in supporting.
[0026] The specific steps for selecting the upgrade mode are as follows:
[0027] Calculate the required storage space for the upgrade using the following formula:
[0028]
[0029] Here, Rspace represents the storage space required for the first terminal upgrade; Rcurpkg represents the size of the original installation package before the application or firmware upgrade; this value is multiplied by 2 to ensure rollback capability, so the original installation package must be retained, and a copy of the original installation package needs to be merged with the differential package to form the full package; Rpatch represents the size of the differential package for this upgrade; Rgap represents the redundant space required for the upgrade; since space utilization cannot reach 100%, it will become very slow at a certain point, causing the upgrade to fail, so redundant space is required; Rmin represents the storage space required for the full package of this upgrade.
[0030] When the current available storage space of the first terminal is greater than or equal to Rspace, the first upgrade mode is selected; when the current available storage space of the first terminal is less than Rspace, and the auxiliary storage space of the second terminal is greater than or equal to Rspace, the second upgrade mode is adopted; when the current available storage space of the first terminal is greater than or equal to Rmin and less than Rspace, and the auxiliary storage space of the second terminal is less than Rmin but greater than or equal to Rcurpkg, the third upgrade mode is adopted.
[0031] When the current available storage space of the first terminal is greater than Rcurpkg and less than Rmin, and the auxiliary storage space of the second terminal is greater than or equal to Rmin and less than Rspace, the fourth upgrade mode is adopted; when the current available storage space of the first terminal is less than Rmin and the auxiliary storage space of the second terminal is less than Rmin, there is insufficient space and the upgrade cannot be completed, and the user needs to be prompted.
[0032] The first upgrade mode is as follows: the first terminal downloads the differential package for this upgrade to its local machine, and the first terminal completes the entire upgrade process on its own. The entire upgrade process includes: copying the original installation package and merging it with the downloaded differential package to form a full package; verifying the version and MD5 value or hash value of the full package; executing the upgrade program after verification; obtaining the upgrade status after the upgrade is completed; if the upgrade is successful, the process ends; if the upgrade fails, the version is rolled back according to the original installation package.
[0033] The second upgrade mode is as follows: the first terminal migrates both the original installation package and the downloaded differential package to the storage space of the second terminal, and the second terminal completes the entire upgrade process;
[0034] The third upgrade mode is as follows: the first terminal transfers the original installation package to the second terminal, merges the original installation package and the local differential package into a full package and saves it on the first terminal, and then the first terminal completes the entire upgrade process.
[0035] The fourth upgrade mode is as follows: the first terminal downloads the differential package and saves it on the second terminal. After merging the original installation package and the differential package on the second terminal into a full package and saving it on the first terminal, the first terminal completes the entire upgrade process.
[0036] Specifically, in this embodiment, the first terminal can obtain the upgrade event by either pushing the upgrade package to the first terminal when the server mounts the upgrade package, or by the first terminal itself triggering an update detection event and then accessing the server to obtain the event.
[0037] In this embodiment, the upgrade information may also include the target version number of the differential package, the MD5 value and / or the hash value of the full package (used to verify the accuracy of the full package after merging the differential package and the original installation package), update content (such as bug fixes), and new application or firmware icons.
[0038] In this embodiment, the storage space that the second terminal can assist in supporting is less than or equal to the preset maximum storage space that can be used to assist in supporting the upgrade of the first terminal (system preset or user-defined). Because the second terminal's own applications require storage space, not all of its available storage space can be freed up to assist in supporting the upgrade of the first terminal. As the second terminal is used, its currently available storage space may become less than the maximum storage space that can be used to assist in supporting the upgrade of the first terminal; in this case, the storage space that the second terminal can assist in supporting is equal to the second terminal's currently available storage space. If the second terminal's current storage space is greater than the maximum storage space that can be used to assist in supporting the upgrade of the first terminal, then the storage space that the second terminal can assist in supporting is equal to the maximum storage space that can be used to assist in supporting the upgrade of the first terminal.
[0039] It should be noted that the first terminal and the second terminal described in this embodiment refer to the terminal that needs to be upgraded and the second terminal that assists in the upgrade. When the main terminal in the detachable terminal is the terminal that needs to be upgraded, the main terminal is the first terminal and the secondary terminal is the second terminal. Conversely, when the secondary terminal in the detachable terminal is the terminal that needs to be upgraded, the secondary terminal is the first terminal and the main terminal is the second terminal.
[0040] For those skilled in the art, various corresponding changes and modifications can be made based on the above technical solutions and concepts, and all such changes and modifications should be included within the protection scope of the claims of this invention.
Claims
1. A differential upgrade method based on a detachable terminal, wherein the detachable terminal includes a first terminal and a second terminal that can be interconnected and separated from each other, the first terminal and the second terminal each having independent storage space; characterized in that, The specific process of the method is as follows: When the first terminal receives an upgrade event, it obtains upgrade information and space information, selects an upgrade mode, and performs the upgrade according to the selected upgrade mode. The upgrade information includes at least the differential packet size for this upgrade. The space information includes the available storage space of the first terminal and the storage space that the second terminal can assist in supporting. The specific steps for selecting the upgrade mode are as follows: Calculate the required storage space for the upgrade using the following formula: Where Rspace is the storage space required for the first terminal upgrade, Rcurpkg is the size of the original installation package before the application or firmware upgrade, Rpatch is the size of the differential package for this upgrade, Rgap is the redundant space required for the upgrade, and Rmin is the storage space required for the full package of this upgrade. When the current available storage space of the first terminal is greater than or equal to Rspace, select the first upgrade mode; when the current available storage space of the first terminal is less than Rspace, and the auxiliary storage space of the second terminal is greater than or equal to Rspace, use the second upgrade mode; when the current available storage space of the first terminal is greater than or equal to Rmin and less than Rspace, and the auxiliary storage space of the second terminal is less than Rmin but greater than or equal to Rcurpkg, use the third upgrade mode; when the current available storage space of the first terminal is greater than Rcurpkg and less than Rmin, and the auxiliary storage space of the second terminal is greater than or equal to Rmin and less than Rspace, use the fourth upgrade mode; when the current available storage space of the first terminal is less than Rmin and the auxiliary storage space of the second terminal is less than Rmin, there is insufficient space, the upgrade cannot be completed, and a prompt should be given to the user. The first upgrade mode is as follows: The first terminal downloads the differential package for this upgrade to its local machine, and the first terminal completes the entire upgrade process on its own. The entire upgrade process includes: copying the original installation package and merging it with the downloaded differential package to form a full package; verifying the version and MD5 value or hash value of the full package; executing the upgrade program after verification; obtaining the upgrade status after the upgrade is completed; if the upgrade is successful, the process ends; if the upgrade fails, the version is rolled back according to the original installation package. The second upgrade mode is as follows: the first terminal migrates both the original installation package and the downloaded differential package to the storage space of the second terminal, and the second terminal completes the entire upgrade process; The third upgrade mode is as follows: the first terminal transfers the original installation package to the second terminal, merges the original installation package and the local differential package into a full package and saves it in the first terminal, and then the first terminal completes the entire upgrade process. The fourth upgrade mode is as follows: the first terminal downloads the differential package and saves it on the second terminal. After merging the original installation package and the differential package on the second terminal into a full package and saving it on the first terminal, the first terminal completes the entire upgrade process.
2. The method according to claim 1, characterized in that, The first terminal obtains the upgrade event either by pushing the upgrade package to the first terminal when the server mounts it, or by obtaining it by accessing the server after the first terminal triggers the update detection event itself.
3. The method according to claim 1, characterized in that, The upgrade information also includes the target version number of the differential package, the MD5 value and / or hash value of the full package, the update content, and the new application or firmware icon.
4. The method according to claim 1, characterized in that, If the current available storage space of the second terminal is less than the preset maximum storage space that can be used to assist in the upgrade of the first terminal, then the storage space that the second terminal can assist in supporting is equal to the current available storage space of the second terminal. If the current storage space of the second terminal is greater than or equal to the maximum storage space that can be used to assist in supporting the upgrade of the first terminal, then the storage space that the second terminal can assist in supporting is equal to the preset maximum storage space that can be used to assist in supporting the upgrade of the first terminal.
5. A detachable terminal that implements the differential upgrade method based on a detachable terminal as described in any one of claims 1-4.