Application self-upgrading system and method
By dynamically generating upgrade content by defining APK update content in the application self-upgrade system, the upgrade compatibility problem caused by differences in different devices is solved, the flexibility and efficiency of APK self-upgrade is achieved, and the user experience and maintenance efficiency are improved.
Patent Information
- Application Number
- CN202411801396.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-14
AI Technical Summary
The existing technology cannot automatically adapt to the differences between different devices during the application upgrade process, resulting in upgrade compatibility issues and increasing the maintenance difficulty and workload of manufacturers.
Provides an application self-upgrade system and method to dynamically generate upgrade content by defining APK update content, so that the same version of APK can automatically adapt to device differences and achieve self-upgrade. The system includes a self-upgrade startup module, an APK verification module, an update content definition module, a download and update module, an update content verification module, a business logic module, an installation package installation module, etc.
It realizes the flexibility of APK self-upgrade, reduces the time for users to operate manually, improves user experience and satisfaction, reduces the workload of maintenance personnel, and improves upgrade efficiency and accuracy through automatic filtering and sharding downloads.
Smart Images

Figure CN119621110A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of computer network technology, and in particular to an application self-upgrade system and method. Background Art
[0002] At present, the same problem is encountered in the upgrade process of major applications, that is, the upgrade installation package will not be different with different mobile phone terminals, but the same installation package will be used for upgrade. However, in fact, different mobile phones may have tailored services, tailored functions, or different configurations. Therefore, if an APK wants to be compatible with all situations, it will limit the upgrade of many mobile phones. For example, if the configuration of a mobile phone is not tailored in terms of business, but the content in a certain APK needs to be connected with other functions, this will cause some mobile phones to be unable to upgrade or the business will not run smoothly after the upgrade.
[0003] In the current general technology, this situation is generally solved by customizing multiple different APKs. As the APK is constantly updated and changed, the number of customizations of such installation packages increases, and maintenance is more cumbersome. Almost every business adjustment requires re-customization of different APKs, and the workload of maintenance personnel is very large.
[0004] There is also a common method, which is to only tailor the business so that the same APK package can be compatible with all businesses. However, when encountering different configurations, only a low-profile solution can be selected. Therefore, under the premise of satisfying business functions without tailoring, the interface will be unsightly or some small functions will be lost. In fact, this is acceptable, but developers will still use the method of customizing multiple APKs to solve the problem.
[0005] Through the above analysis, the existing methods are to solve the compatibility problem by customizing multiple APKs, but multiple versions of APK make it very cumbersome for manufacturers to maintain, which increases the difficulty of maintenance for manufacturers. Manufacturers have many aspects of maintenance work both in R&D and operation. In addition, it is not convenient to maintain. Due to the existence of multiple installation packages, it is impossible to know which installation package is customized for a specific mobile phone. When upgrading, it is necessary to know very clearly which APK the terminal device uses, and each release requires the release of multiple APKs. If the upgrade version is very high, it is also very troublesome to release.
[0006] Therefore, a system and method capable of self-upgrading applications can dynamically generate upgrade content by defining APK update content, so that the same version of APK can automatically adapt to device differences and meet the customized needs of different users. Summary of the invention
[0007] The present invention aims at the problems in the prior art and provides an application self-upgrade system and method. The method can upgrade other application software or services of the system by updating an independent application software or service, so that the entire system is updated, saving the user's time, eliminating the need for multiple manual operations, improving the user experience and user satisfaction, and changing the original manual screening startup to automatic screening startup.
[0008] In order to solve the above problems, the technical solution adopted by the invention is:
[0009] 1. An application self-upgrade system, characterized in that the system includes: a self-upgrade startup module, an application / installation package (APK) verification module, an update content definition module, a download update module, an update content verification module, a business logic module, a first notification module, a download control module, a second notification module and an APK installation module;
[0010] The self-upgrade startup module is used to receive an upgrade start request and start the update content definition module;
[0011] The APK verification module is used to verify whether the APK is complete;
[0012] The application / installation package (APK) update content definition module is used to define the update content of the application / installation package (APK), and the update content includes version information, data blocks and configurations; the download update module is used to segment the defined update content according to the set standard and establish a download link for each segment;
[0013] The business logic module is used to receive the upgrade completion notification, parse the update content, and call the corresponding installation package installation module or business logic module according to the update content; the installation package installation module is used to install the upgraded APK;
[0014] The first notification module is used to notify the user when APK verification, fragmentation and / or downloading are completed;
[0015] The download control module is used to download the segments;
[0016] The second notification module is used to notify the user after the analysis is completed.
[0017] 2. A method for self-upgrading an application, characterized in that the method includes: self-upgrade startup; application / installation package (APK) verification to determine whether the APK is complete, and if the APK is complete, starting the update content definition module, the update content includes version information, data blocks and configuration; a download module downloads the update content and verifies it, and the downloaded content is defined by the update content definition module; a business logic module receives the upgrade completion notification, parses the update content, and calls the corresponding installation package installation module or business logic module according to the parsed update content.
[0018] The beneficial effects of this program are:
[0019] Beneficial effects:
[0020] The system includes a self-upgrade startup module, an APK verification module, an update content definition module, a download update module, an update content verification module, a business logic module, an APK installation module, a download control module, a first notification module, and a second notification module, wherein the self-upgrade startup module is used to receive a response to the user's upload and download, and start the application / installation package (APK) verification module; the APK verification module is used to verify whether the APK is complete; the application / installation package (APK) update content definition module is used to define the update content of the application / installation package (APK), and the update content includes version information, data blocks and configurations; the download update module is used to slice the defined update content according to the set standard, and establish a download link according to each slice; the business logic module is used to receive the upgrade completion notification, parse the update content, and call the corresponding installation package installation module or business logic module according to the update content; the APK installation module is used to install the upgraded APK; the download control module is used to download the slices; the first notification module is used to notify the user; the second notification module is used to notify the user. The system defines the data blocks that need to be updated as update content, which improves the flexibility of self-upgrade.
[0021] The present invention also includes a notification information management step before self-upgrading to the startup module, which is used to store terminal device information requested by the system for upgrade. The notification information management module notifies the terminal device requesting the upgrade at a set time. The notification information management step stores the notification information when the user requests an upgrade, and automatically performs timed polling at the set time, automatically triggering the upgrade step, so that the user can automatically request an upgrade in certain business scenarios, such as when the network is idle.
[0022] The present invention sets an update mode selection step in the server, and the update mode selection is used to select the files to be updated, including two modes: full update and partial update; in the full update mode, the updated data block is defined as "1"; in the partial update mode, the updated data block is defined as "1", and the unupdated data block is defined as "0". Among them, the mode is set, the data block is generated, the data block is matched with the APK of the corresponding storage address, and an APK upgrade request is generated. The APK request is a prerequisite for the APK verification module to verify whether the APK is complete.
[0023] Since the application self-upgrade system includes multiple steps, it can be updated according to the data block, thus realizing the application self-upgrade. The data block update mode can freely choose full update or partial update. For example, when it is necessary to update in modules, it is not necessary to update all applications, but only some modules, such as updating the network management module, updating the server parameters and other applications that do not need to be fully upgraded. If the user adopts full update, all applications can be backed up and the updated content can be downloaded to the local computer to achieve backup.
[0024] The user can automatically trigger the application self-upgrade step through the timed polling of the notification information management step, which is convenient for the user to automatically upgrade. Thereby, the cloud desktop can be upgraded on a regular basis; and because the self-upgrade system can freely set all or part of the updates, the self-upgrade system of the present invention can also upgrade multiple applications of the cloud desktop. Since the application self-upgrade system of the present invention includes multiple modules, each module receives an update request separately according to the demand, so the self-upgrade solution of the present invention is suitable for upgrading different device models and different applications.
[0025] Furthermore, the data block is segmented according to a set size, and all updated contents are segmented once according to the data block size; the data block includes: all source file data blocks, all source file data blocks are APK file content data blocks (that is, all contents in apk: executable files, jar packages, resource texts, etc.), APK content index data block, which records the source file storage location (offset) in the APK file; update file definition data block, which records the update file storage location (relative to offset), update file size, and file checksum value; update content data block, which stores the update file, and the storage locations of the APK content index data block, update file definition data block, and update content data block are in the APK, and are found through the offset of the source file storage location recorded in the APK content index data block.
[0026] All data blocks of the source file are processed in the form of APK file content data blocks, which can organize and manage the basic data of the application more clearly. The introduction of the APK content index data block records the storage location of the source file in the APK file, which is convenient for quick positioning and retrieval of the source file. The update file definition data block records the key information of the update file; the storage location of other related data blocks is found through the offset of the source file storage location recorded in the APK content index data block, which improves the efficiency of data retrieval and access, can quickly and accurately obtain the required data blocks, reduces the search time, enhances the organization and structure of the data, and makes the data processing in the entire upgrade process more orderly and controllable. Finally, it helps to optimize data transmission, avoid unnecessary data transmission and repeated processing, and reduce the consumption of network bandwidth.
[0027] Furthermore, the self-upgrade startup step includes: pre-defining the data block to be updated and the storage address of the data block; storing the corresponding data block in the storage address, and the data block includes the data file of the storage address where the data block is located.
[0028] The specific data blocks to be updated and their storage addresses are clearly defined. During the upgrade process, the target location can be found quickly and accurately without a comprehensive search of the entire system, which greatly saves time and resources. Only specific data blocks are processed, avoiding unnecessary repeated operations and improving the execution speed of the upgrade. The data block contains the data file at the storage address, ensuring that the key information of the original data will not be lost during the upgrade process. At the same time, if there is a problem during the upgrade process, it can be more easily located to the specific data block and storage address for error detection and correction. At the same time, due to the association between data blocks and data files, it is also possible to determine whether the upgrade is correct by analyzing the data files. Due to the pre-definition of data blocks and storage addresses, as well as the association between data blocks and data files, in subsequent maintenance and troubleshooting, it is easier to trace the upgrade process and find the root cause of the problem.
[0029] Further, downloading the update content includes: segmenting the defined update content according to set standards, wherein segmentation refers to dividing the update content into small data blocks according to the byte length of the update content; dividing the source file in the update content into multiple small data blocks according to the data block, and establishing a corresponding download link for each small block; setting a download link for the source file, and downloading the multiple small data blocks divided by the source file according to the source file.
[0030] Divide the update content and source files into multiple small data blocks, and establish a download link for each small block, so that the download can be carried out in parallel. Different data blocks can be downloaded from different servers or nodes at the same time, making full use of network bandwidth and greatly shortening the download time. For unstable network conditions, the download method of small data blocks is more flexible. If a data block fails to download, it can be re-downloaded separately without affecting the download progress of other data blocks. At the same time, small data blocks are also easier to adapt to changes in different network speeds. The download strategy can be adjusted according to actual conditions. Since the data blocks are small, even if some data blocks are damaged or lost during the download process, these small blocks can be quickly re-downloaded without re-downloading the entire update content or source file, which improves the download success rate and reduces the number of repeated downloads caused by download errors. Since only part of the content needs to be updated, the small data block method can achieve accurate incremental updates. Only the changed data blocks need to be downloaded instead of the entire source file, saving download traffic and time.
[0031] Further, the downloading and verifying of update content includes: downloading an APK content index data block, an update file definition data block, and an update content data block for downloading update content; downloading a source file, finding the storage address of the source file and downloading it according to the index of the update content data block; and verifying the downloaded update content.
[0032] Ensure the integrity of update content: Check whether the downloaded file contains missing or damaged data to avoid update failure or abnormal application operation due to missing content; confirm that the downloaded content matches the expected update version and data to prevent incorrect update content from being applied; detect whether there is risk of malicious code or tampering to ensure the security of applications and user data; only updated content that has passed verification is applied, reducing the possibility of application crashes or failures due to update content problems.
[0033] Furthermore, the business logic module receives the upgrade completion notification, parses the update content, and calls the corresponding installation package installation module or business logic module according to the parsed update content, including: the business logic module receives the upgrade completion notification; parses the update content according to the data block; if the file is incomplete, deletes the update content; if the data block is not needed in the business logic, deletes the data block; updates the business logic; and installs the APK after the business logic is updated.
[0034] By accurately parsing the update content, we can ensure that the application is updated and optimized as expected, avoid errors caused by misunderstanding the update content, and promptly delete incomplete update content and unnecessary data blocks, saving storage space and system resources, and improving the operating efficiency of the application. By updating the business logic, the application can better adapt to new functions and requirements, improve the application's performance and user experience, and smoothly install the APK with updated business logic, ensuring the integrity and stability of the application and reducing potential risks and failures caused by upgrades.
[0035] Furthermore, the application self-upgrade method also includes: a notification information management step, which is before self-upgrading to the startup module, and the notification information management module is at a storage address, used to store terminal device information requested by the system for upgrade; the notification information management module notifies the terminal device requesting the upgrade according to the set time.
[0036] By storing terminal equipment information requested for upgrade in a specific storage address system, centralized and orderly management of terminal equipment is achieved, and the scope of equipment that needs to be upgraded can be accurately grasped to avoid omissions. By storing terminal equipment information requested for upgrade in a specific storage address system, centralized and orderly management of terminal equipment is achieved, and the scope of equipment that needs to be upgraded can be accurately grasped to avoid omissions.
[0037] Furthermore, the application self-upgrade method also includes: update mode selection, which is used to select the data blocks that need to be updated, including two modes: full update and partial update; in the full update mode, the updated data blocks are defined as "1"; in the partial update mode, the updated data blocks are defined as "1" and the unupdated data blocks are defined as "0"; the mode is set, the data blocks are generated, the data blocks are matched with the APK at the corresponding storage address, and an APK upgrade request is generated, and the APK request is a prerequisite for the APK verification module to verify whether the APK is complete.
[0038] Two modes, full update and partial update, are provided, allowing users to flexibly choose according to actual conditions. In the full update mode, the updated data block is defined as "1". This clear identification helps the system to quickly identify and process, improving the efficiency and accuracy of the update. The updated data block is defined as "1" and the unupdated data block is defined as "0", realizing the accurate marking of the data block update status. This enables the system to accurately distinguish between the updated and unupdated parts when processing update requests, avoiding unnecessary data processing and transmission, and saving network bandwidth and system resources.
[0039] The data block generated by the setting mode is matched with the APK at the corresponding storage address, and an APK upgrade request is generated. This process provides a clear verification basis for the APK verification module. As a prerequisite for the APK verification module to verify whether the APK is complete, it can ensure that only complete and accurate update data is applied, thereby improving the reliability and stability of application updates. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a flow chart of the system of the present invention;
[0041] Figure 2 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0042] The following is further described in detail through specific implementation methods:
[0043] Example 1
[0044] As attached Figure 1-2 As shown, the present invention first provides an application self-upgrade system, the system includes: a self-upgrade startup module, an application / installation package (APK) verification module, an update content definition module, a download update module, an update content verification module, a business logic module, a first notification module, a download control module, a second notification module and an APK installation module.
[0045] The self-upgrade startup module is used to receive an upgrade start request and start the update content definition module. When the user initiates an upgrade request or the system reaches the preset upgrade conditions, the module is activated, thereby triggering the subsequent upgrade process.
[0046] The APK verification module is used to verify whether the APK is complete. It will perform a comprehensive check on the APK's file structure, signature, version information, etc. to ensure that the APK has not been tampered with or damaged before upgrading. If the APK is incomplete or has an abnormality, it will promptly notify the user and stop the upgrade process.
[0047] The application / installation package (APK) update content definition module is used to define the update content of the application / installation package (APK), which includes version information, data blocks and configuration. This module will analyze the differences between the new version and the old version in detail, determine the data blocks, files and related configuration information that need to be updated, and provide accurate guidance for subsequent download and installation.
[0048] The update content download module is used to segment the defined update content according to the set standard, divide the update content into n data blocks according to the set standard, and establish a download link according to each segment, and the link can be generated by a dynamic link. During the download process, the module will dynamically adjust the download strategy according to the network status and server load, such as giving priority to downloading key data blocks or using multi-threaded downloading to increase the speed.
[0049] The business logic module is used to receive notifications of upgrade completion, parse the update content, and call the corresponding installation package installation module or business logic module based on the update content. This module is not only responsible for parsing the update content, but also determines whether to install the installation package or directly update the business logic based on the analysis results. If the update content is mainly data adjustments, the business logic may be updated directly; if it involves new functions or major architectural changes, the installation package installation module is called.
[0050] The installation package installation module is used to install the upgraded APK. During the installation process, it will strictly follow the installation process, including backing up old version data, replacing files, updating configurations, etc., and performing necessary cleanup and optimization work after the installation is complete.
[0051] The notification information management module is used to record the terminal device information that requests an upgrade and notify the terminal device of the upgrade at the set time. The module will formulate a personalized notification strategy based on factors such as the type of terminal device, network environment, and user usage habits. For example, for devices that are less frequently used at night and connected to Wi-Fi, choose to make upgrade notifications at night; for devices that are frequently used during working hours, postpone notifications until non-working hours.
[0052] The first notification module is used to notify the user when the APK is verified, segmented and / or downloaded; so that the user can understand the progress of the upgrade process in real time and take corresponding actions in time, such as choosing to install immediately or later after the download is complete.
[0053] The download control module is used to download segments. It monitors the download progress, handles abnormal situations such as download interruptions and retries, and ensures that each segment can be downloaded to the terminal device completely and accurately.
[0054] The second notification module is used to notify the user when the analysis is completed. The user is informed of the completion of the analysis in a timely manner so that the user can decide whether to perform subsequent operations immediately.
[0055] The criteria are:
[0056] The data block is sharded according to the set size, and all updated content is sharded once according to the data block size;
[0057] The data block includes:
[0058] All data blocks of the source file, all data blocks of the source file are APK file content data blocks;
[0059] APK content index data block records the storage location of source files in the APK file;
[0060] The update file definition data block records the update file storage location, update file size, and file checksum value;
[0061] The update content data block stores the update file. The storage locations of the APK content index data block, the update file definition data block and the update content data block are in the APK and can be found through the offset of the source file storage location recorded in the APK content index data block.
[0062] The update content of APK includes: data blocks that need to be updated or deleted, and location information where the data blocks are stored.
[0063] The update mode is used to select the data blocks that need to be updated, including full update and partial update modes. In the full update mode, the updated data block is defined as "1"; in the partial update mode, the updated data block is defined as "1" and the unupdated data block is defined as "0"; the mode is set, the data block is generated, the data block is matched with the APK at the corresponding storage address, and an APK upgrade request is generated. The APK request is the basis for module 001 to verify whether the APK is complete.
[0064] In actual applications, the full update mode is suitable for major version updates, such as application architecture adjustments, substantial additions or modifications to functional modules, etc. This mode can ensure the integrity and stability of the application, but may take a long time and require large network traffic. The partial update mode is suitable for some smaller fixes or optimizations, such as fixing individual vulnerabilities and updating a small amount of data. Its advantage is that it can complete the update quickly, reduce the impact on user use, and save network traffic.
[0065] The APK file content data block 100 contains all the data blocks of the source file, which are segmented into 1M pieces according to the set size. The segmented pieces are 101, 102, and 103, corresponding to the offsets of all the data blocks of the first source file. The first offset is 101, the second is 102, and the third is 103. The APK content index data block records all the data blocks of the source file in the entire APK, including the offsets of all the data blocks of the source file and the source file information. The update file definition data block records the update file definition data block, including the update file size, the update file name, and the offset of the source file in all the data blocks of the source file, and the offset position of the update file in the APK. The update file data block contains the specific content of the update file, including the actual update file data of the offset, size, and content of the update file in the update file.
[0066] The business logic module is also used for business logic updates and update requests. For example, after the user has completed the upgrade, the update files in the upgrade package have all been downloaded. If a program error is detected in the APK, an error is returned and a request is made to re-update the error file in the corresponding APK.
[0067] The download control submodule downloads files in the order of the source files; this helps ensure data integrity and consistency and avoids file confusion or errors caused by out-of-order downloads.
[0068] The present application also provides an application self-upgrade method, the method comprising:
[0069] Self-upgrade request initiated;
[0070] The self-upgrade to the start module is used to receive the upgrade start request and start the update content definition module;
[0071] Self-upgrade mode: Update mode selection, used to select the data block to be updated, including full update and partial update modes. In full update mode, the updated data block is defined as "1"; in partial update mode, the updated data block is defined as "1" and the unupdated data block is defined as "0"; the mode is set, the data block is generated, the data block is matched with the APK at the corresponding storage address, and an APK upgrade request is generated. The APK request is the basis for module 001 to verify whether the APK is complete;
[0072] Application / installation package (APK) verification, to determine whether the APK is complete. If the APK is complete, the update content definition module is started according to the information in the update content definition module; the update content includes version information, data blocks and configuration. The download module downloads the update content and verifies it, and the update content is defined by the update content definition module;
[0073] An application / installation package (APK) update content definition module, used to define the update content of the application / installation package (APK), the update content including version information, data blocks and configuration;
[0074] The download module downloads and verifies the update content, wherein the download content is defined by the update content definition module.
[0075] The download update content includes:
[0076] Slice the defined data block according to the set standard, wherein the slicing means dividing the update content into multiple small data blocks according to the size of the data block;
[0077] Divide the source files in the update content into multiple small data blocks according to the data block, and establish a corresponding download link for each small data block;
[0078] Set the data block as a download link and download the files in the order of the source files.
[0079] Specifically, the setting standards are:
[0080] The data block is sharded according to the set size;
[0081] All updated content is sharded according to the data block size;
[0082] The data block includes:
[0083] All data blocks of the source file, all data blocks of the source file are APK file content data blocks;
[0084] APK content index data block records the storage location of source files in the APK file;
[0085] The update file definition data block records the update file storage location, update file size, and file checksum value;
[0086] The update content data block stores the update file. The storage locations of the APK content index data block, the update file definition data block and the update content data block are in the APK and can be found through the offset of the source file storage location recorded in the APK content index data block.
[0087] The APK file content data block 100 contains all the data blocks of the source file, which are segmented into 1M pieces according to the set size. The segmented pieces are 101, 102, and 103, corresponding to the offsets of all the data blocks of the first source file. The first offset is 101, the second is 102, and the third is 103. The APK content index data block records all the data blocks of the source file in the entire APK, including the offsets of all the data blocks of the source file and the total information of the source file. The update file definition data block records the update file definition data block, including the update file size, the update file name, and the offset of the source file in all the data blocks of the source file, and the position of the update file in the APK. The update file data block records the specific content of the update file, including the actual update file data of the offset, size, and content of the update file in the update file.
[0088] The download update includes:
[0089] Download data updates;
[0090] Download data update content and verify including:
[0091] Download APK content index data block, update file definition data block and update content data block, which are used to download update content;
[0092] Download the source file, find the storage address of the source file according to the index of the update content data block and download it;
[0093] Verify the downloaded updates.
[0094] In practical applications, the accuracy and integrity of the updated content can be effectively guaranteed through the above download and verification process. Taking an upgrade of a certain application as an example, the download success rate was increased from 85% to 98% by using the method of the present invention, and the verification accuracy rate reached 100%, which greatly reduced user complaints and application failures caused by update failures.
[0095] The business logic module receives the upgrade completion notification, parses the update content, and calls the corresponding installation package installation module or business logic module according to the parsed update content.
[0096] Of course, the present invention may also include: a notification information management step, which is before the self-upgrade to the startup module, and the notification information management module is at a storage address, used to store the terminal device information requested by the system for upgrade; the notification information management module notifies the terminal device requesting the upgrade according to the set time.
[0097] Through effective management of notification information, accurate push notifications can be achieved to avoid unnecessary interference to users. For example, in an experiment with upgrade notifications on 1,000 terminal devices, 95% of users said that the notification time met their expectations, and their satisfaction increased by 20% compared to the previous notification method.
[0098] Example 2
[0099] As attached Figure 1 As shown, the present invention describes an application self-upgrade system, which includes: a self-upgrade startup module, an application / installation package (APK) verification module, an update content definition module, a download update module, an update content verification module, a business logic module, a first notification module, a download control module, a second notification module and an APK installation module;
[0100] The self-upgrade startup module is used to receive an upgrade start request and start the update content definition module;
[0101] The application / installation package (APK) verification module is used to verify whether the APK is complete;
[0102] The application / installation package (APK) update content definition module is used to define the update content of the application / installation package (APK), and the update content includes version information, data blocks and configuration;
[0103] The download update module is used to segment the defined update content according to the set standard and establish a download link for each segment;
[0104] The business logic module is used to receive the upgrade completion notification, parse the update content, and call the corresponding installation package installation module or business logic module according to the update content; the installation package installation module is used to install the upgraded APK;
[0105] The first notification module is used to notify that the APK has been verified, fragmented, and / or downloaded;
[0106] The download control module is used to download the segments;
[0107] The second notification module is used to notify that the parsing is completed.
[0108] The data block is fragmented according to a set size, and all updated content is fragmented once according to the data block size; the data block includes:
[0109] All data blocks of the source file, all data blocks of the source file are APK file content data blocks;
[0110] APK content index data block, which records the storage location of source files in the APK file, in the updated APK;
[0111] The update file definition data block records the update file storage location, update file size, and file checksum value;
[0112] Update content data block stores update files.
[0113] The storage locations of the APK content index data block, the update file definition data block, and the update content data block are in the APK and are found through the offset of the source file storage location recorded in the APK content index data block.
[0114] The present invention describes an application self-upgrade method, as shown in the attached Figure 2 As shown;
[0115] The self-upgrade to startup steps include: pre-defining the data block to be updated and the storage address of the data block; storing the corresponding data block in the storage address, the data block includes the storage address of the data block, and the data block refers to the data file (download module) stored in the data block.
[0116] From the upgrade to the verification step: Use the application / installation package (APK) verification module to check the legality and validity of the upgrade data package, and check whether the content of the upgrade data package is complete.
[0117] Data sharding step: Download the update content, use the download update module, shard the data blocks, and download according to the settings;
[0118] Data check step: Before installing the module and starting the application logic, you need to check whether the updated content is complete;
[0119] Application logic calling steps: After parsing the update content, you can call the corresponding module.
[0120] Notification information management steps: How to process notification information.
[0121] Select update mode: the scope and method of the upgrade.
[0122] In the data sharding step, the data definition that needs to be called by the application logic is divided into data blocks, and the format of each data block is defined;
[0123] In the application logic calling step, when installing the corresponding installation, first read the configuration file, the corresponding module interface, and update the content according to the interface analysis.
[0124] The steps to apply the self-upgrade method are as follows:
[0125] First, pre-define the data blocks that need to be updated. The data blocks can be data sub-packaging during actual software upgrades, such as partial data sub-packaging of APK files, update data sub-packaging, etc. After defining the data blocks, number the data blocks and determine the storage area; pre-define the data blocks to be updated and the storage addresses of the data blocks, and store the corresponding data in the storage addresses;
[0126] The download module downloads update content, and the download update content includes APK content and storage address;
[0127] The business logic module receives the upgrade completion notification, parses the update content, deletes the update content if the update content is fully parsed, calls the installation module according to the business logic, deletes the update content if the business logic does not need the update content, performs data update according to the business logic, calls the installation module, and installs the installation package after the business logic. The installation logic module will parse the update content according to the protocol, and delete the update content if the file is incomplete;
[0128] Before executing the self-upgrade to startup step, the notification information management module will be called to send the upgrade start information. If all the updated content has been downloaded, the upgrade completion information will be sent. If the program fails, an error message will be sent.
[0129] Before the self-upgrade to the step of downloading the update module, the data block will be called, and then the judgment module will be called to judge whether the download module needs to download the data block. If so, the download control module will be called to download the data block that needs to be downloaded, so as to ensure that the system will not fail to update due to an abnormality of a file; then the notification module will be called to send a download notification;
[0130] Self-upgrade to the notification information module step; the function of this step is to notify all systems and terminal devices that need to be updated and send corresponding notifications; after receiving the notification, the notification module sends a feedback instruction;
[0131] In the step of downloading the update module, the download content of the APK is defined by the update module, and the definition refers to the data block that defines the update content; to download the update content, it is necessary to first download the APK content index data block, the update file definition data block and the update content data block for downloading the update content; to download the source file, according to the index of the update content data block, find the storage address of the source file and download it; to verify the downloaded update content; the data block is fragmented according to the set size, and all the update content is fragmented once according to the data block size; the data block includes: all data blocks of the source file, and all data blocks of the source file are the content of the APK file Data block; the APK content index module is the source file storage location in the APK file; the update file definition module is the updated source file storage location, update file size, and file checksum. The storage location is in the APK and is found through the offset of the source file storage location recorded in the APK file index module; fragmentation refers to dividing the update content into small data blocks according to the byte length of the update content; establishing a corresponding download link for each small block; downloading the source file, finding the storage address of the source file and downloading it according to the index of the update content data block; dividing the source file into multiple small data blocks according to the data block, and establishing a corresponding download link for each small block.
[0132] There are many types of update content, including full update, partial update and change update; full update refers to updating the entire system or the entire program, partial update refers to updating part of the program, and change update refers to updating the changed part of the program.
[0133] In the self-upgrade to verification step, verify that the APP is complete, set the APP to be complete in the system configuration information, and the configuration information is the data block for installing the upgraded APK. If the APP verification is incomplete, the update content is automatically deleted, and the update content refers to the update content defined in the full module, and an error message is sent;
[0134] In the step of self-upgrading to module downloading and updating the module, the step of downloading the updated content includes data block downloading and data block checking;
[0135] In the self-upgrade to notification information step, in the notification information module, the notification information is sent;
[0136] In the step of upgrading to the first notification module, the notification module receives the download completion information and sends the information to the download control module;
[0137] Since upgrading to the second notification step, the notification module receives the verification completion and sends the verification completion information;
[0138] In the self-upgrade to download control step, the download control module receives the download notification information and downloads the segments;
[0139] In the self-upgrade to the third notification step, the notification module receives the download completion and sends the download completion to the download control module;
[0140] In the self-upgrade to installation module step, the installation module receives the download notification information and installs the slice;
[0141] Since the escalation to the exception handling step, the exception issues an error instruction.
[0142] The APK upgrade mode selects the data block that needs to be updated, including two modes: full update and partial update. In the full update mode, the updated data block is defined as "1". In the partial update mode, the updated data block is defined as "1", and the unupdated data block is defined as "0". The setting mode, that is, the data block defined as "1" or "0", generates a data block, and the data block is matched with the APK at the corresponding storage address to generate an APK upgrade request. The APK request is a prerequisite for the APK verification module to verify whether the APK is complete.
[0143] The install module installs the APK.
[0144] The self-upgrade system and method used in the present invention are suitable for devices with large programs and more update data. The method can upgrade the application without reinstalling the operating system, shortening the upgrade time. Since the method of the present invention does not require downloading or reinstalling the operating system, the pressure on network transmission is reduced and hardware overhead is reduced.
[0145] The above is only an embodiment of the invention, and the common knowledge such as the known specific structure and characteristics in the scheme is not described in detail here. It should be pointed out that for those skilled in the art, several deformations and improvements can be made without departing from the structure of the invention, which should also be regarded as the scope of protection of the invention, and these will not affect the effect of the implementation of the invention and the practicality of the patent. The scope of protection required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.
Claims
1. An application self-upgrade system, characterized in that: The system includes: a self-upgrade startup module, an application / installation package (APK) verification module, an update content definition module, a download update module, an update content verification module, a business logic module, a first notification module, a download control module, a second notification module and an APK installation module; The self-upgrade startup module is used to receive an upgrade start request and start the update content definition module; The APK verification module is used to verify whether the APK is complete; The application / installation package (APK) update content definition module is used to define the update content of the application / installation package (APK), and the update content includes version information, data blocks and configurations; the update content download module is used to segment the defined update content according to the set standard and establish a download link for each segment; The business logic module is used to receive the upgrade completion notification, parse the update content, and call the corresponding installation package installation module or business logic module according to the update content; the installation package installation module is used to install the upgraded APK; The first notification module is used to notify the user when APK verification, fragmentation and / or downloading are completed; The download control module is used to download the segments; The second notification module is used to notify the user after the analysis is completed.
2. The application self-upgrade system according to claim 1, characterized in that: The data block is segmented according to the set size, and all update contents are segmented once according to the data block size; the data block includes: all source file data blocks, which are APK file content data blocks; APK content index data block, which records the source file storage location in the APK file; update file definition data block, which records the update file storage location, update file size, and file checksum value; update content data block, which stores the update file. The storage locations of the APK content index data block, update file definition data block, and update content data block are in the APK and are found through the offset of the source file storage location recorded in the APK content index data block.
3. An application self-upgrade method, characterized in that: The method includes: self-upgrade startup; application / installation package (APK) verification to determine whether the APK is complete, if the APK is complete, starting the update content definition module, the update content includes version information, data blocks and configuration; the download module downloads the update content and verifies it, the downloaded content is defined by the update content definition module; the business logic module receives the upgrade completion notification, parses the update content, and calls the corresponding installation package installation module or business logic module according to the parsed update content.
4. The application self-upgrade method according to claim 3, characterized in that: The self-upgrade startup step includes: pre-defining the data block to be updated and the storage address of the data block; storing the corresponding data block in the storage address, and the data block includes the data file of the storage address where the data block is located.
5. The application self-upgrade method according to claim 3, characterized in that: The downloading of update content includes: segmenting the defined update content according to set standards, wherein segmentation refers to dividing the update content into small data blocks according to the byte length of the update content; dividing the source file in the update content into multiple small data blocks according to the data blocks, and establishing a corresponding download link for each small block; setting a download link for the source file, and downloading the multiple small data blocks divided by the source file according to the source file.
6. The application self-upgrade method according to claim 3, characterized in that: The downloading and verifying of update content includes: downloading APK content index data block, update file definition data block and update content data block for downloading update content; downloading source file, finding the storage address of source file and downloading it according to the index of update content data block; verifying the downloaded update content.
7. The application self-upgrade method according to claim 3, characterized in that: The business logic module receives the upgrade completion notification, parses the update content, and calls the corresponding installation package installation module or business logic module according to the parsed update content, including: the business logic module receives the upgrade completion notification; parses the update content according to the data block; if the file is incomplete, deletes the update content; if the data block is not needed in the business logic, deletes the data block; updates the business logic; and installs the APK after the business logic is updated.
8. The application self-upgrade method according to claim 3, characterized in that: The application self-upgrade method also includes: a notification information management step, which is performed before self-upgrading to a startup module, wherein the notification information management module is at a storage address and is used to store terminal device information for which the system requests an upgrade; the notification information management module notifies the terminal device requesting an upgrade at a set time.
9. The application self-upgrade method according to claim 3, characterized in that: The application self-upgrade method also includes: update mode selection, which is used to select the data blocks that need to be updated, including two modes: full update and partial update; in the full update mode, the updated data blocks are defined as "1"; in the partial update mode, the updated data blocks are defined as "1" and the unupdated data blocks are defined as "0"; the mode is set, the data blocks are generated, the data blocks are matched with the APK at the corresponding storage address, and an APK upgrade request is generated, and the APK request is a prerequisite for the APK verification module to verify whether the APK is complete.