Application program upgrade method, system, device and storage medium
By obtaining and comparing the upgrade configuration information of the application and obtaining upgrade files for application upgrades, the problem of low upgrade success rate in the existing technology is solved and a more efficient upgrade process is achieved.
Patent Information
- Application Number
- CN202011271018.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-13
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2040-11-13
AI Technical Summary
In the prior art, the success rate of application upgrades is low, especially when differential package exceptions or download errors occur, the upgrade fails.
By obtaining the upgrade configuration information of the application, compare the file information of the new version with the local file information, and obtain the upgrade file for upgrading. When a file with the same file name does not exist locally, a new file is obtained; when it exists, a differential file is obtained based on the file summary information for upgrading.
Improves the success rate of application upgrades, and reduces the risk of bandwidth consumption and download failure through fine-grained file comparison and differential file usage.
Smart Images

Figure CN112328284B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an application program upgrade method, system, device and storage medium. Background Art
[0002] Currently, client applications often encounter version upgrade issues during operation. Whenever an application has defects or needs to add certain functions, the application on the client needs to be upgraded.
[0003] In the related art, in order to save bandwidth, differential upgrade is generally performed, that is, a new version of the installation package is compared with the old version of the installation package, a differential package is generated, and the application is upgraded using the differential package. However, if the generated differential package is abnormal or an error occurs during the download of the differential package, the application upgrade will fail, resulting in a low success rate for the application upgrade. Summary of the invention
[0004] The present application provides an application upgrade method, system, device and storage medium to improve the success rate of application upgrades.
[0005] In a first aspect, the present application provides an application program upgrade method, comprising:
[0006] According to the download path of the first version of the application, the upgrade configuration information of the first version is obtained; the upgrade configuration information includes: file information of the first file of the first version, and the file information includes: the name of the first file and summary information of the first file;
[0007] If there is no second file with the same name as the first file in the local directory of the application, obtaining the first file according to the download path, and upgrading the application according to the first file;
[0008] If there is a second file with the same name as the first file in the local directory of the application, the upgrade file corresponding to the second file is obtained according to the summary information of the second file, the summary information of the first file and the download path, and the application is upgraded according to the upgrade file.
[0009] In a second aspect, the present application provides an application program upgrade method, comprising:
[0010] Sending upgrade configuration information of a first version to the electronic device; the upgrade configuration information includes: file information of a first file of the first version, the file information includes: a name of the first file and summary information of the first file;
[0011] Sending a first file to the electronic device according to a first request message sent by the electronic device, the first file being used for the electronic device to upgrade the application; the first request message being used to indicate that there is no second file with the same name as the first file in the electronic device;
[0012] An upgrade file of the second file is sent to the electronic device according to a second request message sent by the electronic device, and the upgrade file of the second file is used for the electronic device to upgrade the application; the second request message is used to indicate that a second file with the same name as the first file exists in the electronic device.
[0013] In a third aspect, the present application provides an application program upgrade device, comprising:
[0014] an acquisition module, configured to acquire upgrade configuration information of a first version of an application program according to a download path of the first version of the application program; the upgrade configuration information includes file information of a first file of the first version of the application program, the file information includes a name of the first file and summary information of the first file;
[0015] a processing module, configured to obtain the first file according to the download path if there is no second file with the same name as the first file in the local directory of the application, and upgrade the application according to the first file;
[0016] The processing module is also used to obtain an upgrade file corresponding to the second file based on the summary information of the second file, the summary information of the first file and the download path, if there is a second file with the same name as the first file in the local directory of the application, and upgrade the application based on the upgrade file.
[0017] In a fourth aspect, the present application provides an application program upgrade device, comprising:
[0018] A sending module, configured to send upgrade configuration information of a first version to an electronic device; the upgrade configuration information includes: file information of a first file of the first version, the file information includes: a name of the first file and summary information of the first file;
[0019] A receiving module, configured to receive a first request message sent by the electronic device;
[0020] The sending module is further used to send a first file to the electronic device according to the first request message, where the first file is used for the electronic device to upgrade the application; the first request message is used to indicate that there is no second file with the same name as the first file in the electronic device;
[0021] The receiving module is further used to receive a second request message sent by the electronic device; the sending module is further used to send an upgrade file of the second file to the electronic device according to the second request message, and the upgrade file of the second file is used for the electronic device to upgrade the application; the second request message is used to indicate that a second file with the same name as the first file exists in the electronic device.
[0022] In a fifth aspect, an embodiment of the present application provides an application upgrade system, including:
[0023] Electronic equipment and servers;
[0024] The electronic device is used to obtain upgrade configuration information of the first version of the application according to the download path of the first version of the application; the upgrade configuration information includes: file information of the first file of the first version, and the file information includes: the name of the first file and summary information of the first file;
[0025] The electronic device is further configured to: if there is no second file with the same name as the first file in the local directory of the application, obtain the first file according to the download path, and upgrade the application according to the first file; if there is a second file with the same name as the first file in the local directory of the application, obtain an upgrade file corresponding to the second file according to summary information of the second file, summary information of the first file and the download path, and upgrade the application according to the upgrade file;
[0026] The server is used to send the upgrade configuration information of the first version to the electronic device;
[0027] The server is further used to send the first file to the electronic device according to a first request message sent by the electronic device, wherein the first request message is used to indicate that a second file with the same name as the first file does not exist in the electronic device; and to send an upgrade file of the second file to the electronic device according to a second request message sent by the electronic device, wherein the second request message is used to indicate that a second file with the same name as the first file exists in the electronic device.
[0028] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method described in any one of the first aspect and the second aspect is implemented.
[0029] In a seventh aspect, an embodiment of the present application provides an electronic device, including:
[0030] Processor; and
[0031] A memory, configured to store executable instructions of the processor;
[0032] The processor is configured to perform the method according to any one of the first aspects by executing the executable instructions.
[0033] In an eighth aspect, an embodiment of the present application provides a server, including:
[0034] Processor; and
[0035] A memory, configured to store executable instructions of the processor;
[0036] The processor is configured to perform the method described in any one of the second aspects by executing the executable instructions.
[0037] The application upgrade method, system, device and storage medium provided in the embodiments of the present application compare the first file of the new version with the second file of the local application by upgrading the file information of the new first version in the configuration information, thereby obtaining the upgrade file and performing the upgrade. When the second file with the same name as the first file does not exist locally in the application, the first file is obtained. When the second file with the same name as the first file exists locally in the application, the upgrade file corresponding to the second file is obtained based on the summary information of the second file, the summary information of the first file and the download path, thereby upgrading the application according to the first file or the upgrade file, and the granularity of the obtained files is finer, thereby improving the upgrade success rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0039] Figure 1 A schematic diagram of the system architecture provided for an embodiment of the present application;
[0040] Figure 2 It is a flowchart of an embodiment of an application program upgrade method provided by the present application;
[0041] Figure 3 It is a schematic diagram of the principle of an embodiment of the method provided by the present application;
[0042] Figure 4 It is a flowchart of another embodiment of the application program upgrade method provided by the present application;
[0043] Figure 5 This is a schematic diagram of a tool interface of an embodiment of a method provided by the present application;
[0044] Figure 6It is a schematic diagram of the principle of another embodiment of the method provided by the present application;
[0045] Figure 7 It is a structural diagram of an embodiment of an application program upgrading device provided by the present application;
[0046] Figure 8 It is a structural diagram of another embodiment of the application program upgrading device provided by the present application;
[0047] Fig. 9 is a structural schematic diagram of an electronic device embodiment provided by the present application;
[0048] Fig.10 It is a structural diagram of a server embodiment provided in this application.
[0049] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0050] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0051] The terms "including" and "having" and any variations thereof in the specification and claims of the present application and the drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0052] First, the application scenarios involved in the embodiments of the present application are introduced.
[0053] Figure 1 This is a schematic diagram of the system architecture provided in the embodiment of the present application. Figure 1 As shown, the system architecture of the embodiment of the present application may include but is not limited to: an electronic device 11 and a server 12. The electronic device includes, for example, a mobile phone, a tablet computer, a wearable device, an Internet of Things device, and the like.
[0054] The electronic device 11 and the server 12 may be connected via a network.
[0055] The method provided in the embodiment of the present application can be implemented by an electronic device such as a processor executing corresponding software codes, or can be implemented by an electronic device executing corresponding software codes while interacting with a server for data.
[0056] In the related art, in order to save bandwidth, differential upgrade is generally performed, that is, a new version of the installation package is compared with the old version of the installation package, a differential package is generated, and the application is upgraded using the differential package. However, if the generated differential package is abnormal or an error occurs during the download of the differential package, the application upgrade will fail, resulting in a low success rate for the application upgrade.
[0057] The differential package is the differential package between the entire installation package. If the installation package is differential, the old version of the installation package must be available locally. However, once the application is installed, the installation package has no effect and cannot be used by the program. A large amount of storage space will be temporarily used, wasting resources. If the old version of the installation package is not available locally, the old version of the installation package must be downloaded to generate the new version of the installation package through the differential package, which increases the bandwidth cost. The size of the differential package may be relatively large, and it is easy to fail to download, which will cause the application upgrade to fail.
[0058] The method of the embodiment of the present application, in order to improve the success rate of the upgrade, compares the first file of the new version with the second file of the local application one by one through the file information of the new version in the upgrade configuration information, so as to obtain the upgrade file, and when the second file with the same name as the first file does not exist locally in the application, the first file is obtained; when the second file with the same name as the first file exists locally in the application, the upgrade file corresponding to the second file is further obtained based on the summary information of the second file and the summary information of the first file and the download path, so that the application is upgraded according to the first file or the upgrade file, and the file granularity is finer than the differential package of the entire installation package.
[0059] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0060] Figure 2 This is a flow chart of an embodiment of the application program upgrade method provided by this application. Figure 2 As shown, the method provided in this embodiment is applied to an electronic device, and the method includes:
[0061] Step 101: Obtain upgrade configuration information of the first version according to the download path of the first version of the application; the upgrade configuration information includes: file information of the first file of the first version, and the file information includes: the name of the first file and summary information of the first file.
[0062] Specifically, when the electronic device needs to upgrade the application, for example, the server pushes upgrade information, such as the latest version number, to the electronic device. If the electronic device determines to upgrade, it obtains the version information of the application, such as the download path, from the server, for example, by sending an upgrade request message to obtain the version information;
[0063] Download the upgrade configuration information according to the download path. The upgrade configuration information is stored in a file, such as an XML file.
[0064] In one embodiment, if the upgrade configuration information download fails and the local version number is lower than the latest version number, the latest first version installation package is directly downloaded (eg Figure 3 v3.0.0.exe) and upgrade the application.
[0065] The upgrade configuration information includes: file information of a first file of a first version, the file information including: a name of the first file and summary information of the first file;
[0066] The first file of the first version is obtained according to the installation package of the first version, such as by decompressing the installation package of the first version. The first file may be one or more files.
[0067] Step 102: If there is no second file with the same name as the first file in the local directory of the application, the first file is obtained according to the download path, and the application is upgraded according to the first file.
[0068] Specifically, the acquired upgrade configuration information is parsed, and file information of all first files in the upgrade configuration information is traversed to compare with second files in the local directory where the application is installed.
[0069] If there is no second file with the same name as the first file in the local directory of the application, it means that the first file may be newly added or deleted (deleted by the user by mistake or by other malicious software). In this case, the first file is obtained according to the download path, and the application is upgraded according to the first file.
[0070] Step 103: If there is a second file with the same name as the first file in the local directory of the application, obtain the upgrade file corresponding to the second file according to the summary information of the second file and the summary information of the first file and the download path, and upgrade the application according to the upgrade file.
[0071] Specifically, if there is a second file with the same name as the first file in the local directory of the application, it is further determined whether the first file has been updated based on the summary information of the second file and the summary information of the first file. If the summary information is inconsistent, it means that the first file has been updated. According to the download path, the upgrade file corresponding to the second file is obtained, and the application is upgraded according to the upgrade file.
[0072] If the summary information is consistent, it means that the local second file is already the latest and does not need to be updated, that is, there is no need to obtain the first file.
[0073] In one embodiment, the summary information is obtained by processing the file using a message digest algorithm.
[0074] In other embodiments, other algorithms may also be used to obtain the value, and this application does not limit this.
[0075] The message digest algorithm is, for example, MD2, MD4 or MD5. For example, the MD5 value of the first file is 3CBFB301FC5BA55BB8613BAC43F670E4.
[0076] If the summary information of the second file in the local directory is inconsistent with the latest summary information of the first file, in order to save bandwidth, first determine whether the differential file between the second file and the first file can be obtained. If the differential file can be obtained, then obtain the differential file. At this time, the upgrade file is the differential file, and the differential file is used for upgrading; if the differential file between the second file and the first file cannot be obtained, then obtain the first file. At this time, the upgrade file is the first file, and the first file is used for upgrading.
[0077] The method of this embodiment compares the new version of the first file with the local second file of the application by upgrading the new first version of the file information in the configuration information, thereby obtaining the upgrade file and performing the upgrade. When the second file with the same name as the first file does not exist locally in the application, the first file is obtained. When the second file with the same name as the first file exists locally in the application, the upgrade file corresponding to the second file is obtained based on the summary information of the second file, the summary information of the first file, and the download path. The application is upgraded based on the first file or the upgrade file, and the granularity of the obtained files is finer, thereby improving the upgrade success rate.
[0078] In one embodiment, in order to save bandwidth and improve download efficiency, obtaining the first file according to the download path can be achieved in the following manner:
[0079] According to the download path, a compressed package of the first file is obtained, and the compressed package is decompressed to obtain the first file.
[0080] Specifically, the compressed package of the first file is downloaded, and decompressed to obtain the latest first file. For example, if the AnalyzeData.dll file is lost locally, the AnalyzeData.zip file is downloaded from the server, and decompressed to obtain the latest AnalyzeData.dll file.
[0081] In order to avoid errors during the upgrade process, the local second file can be saved in a temporary folder (such as a tmp folder) first, and then the application is upgraded according to the first file.
[0082] In one embodiment, the upgrade configuration information further includes: summary information of the third file of the second version. Step 103 can be implemented as follows:
[0083] If the summary information of the second file is different from the summary information of the first file, and there is a third file having the same summary information as the second file, then obtaining the differential file corresponding to the second file according to the download path, and generating an upgrade file according to the differential file corresponding to the second file and the second file;
[0084] If the summary information of the second file is different from the summary information of the first file, and there is no third file having the same summary information as the second file, the first file is obtained according to the download path, and the first file is used as the upgrade file.
[0085] Specifically, if the summary information of the second file in the local directory is inconsistent with the summary information of the latest first file, it means that the file needs to be updated, and then compared with the summary information of the third file corresponding to the first file in the old version in the upgrade configuration information. If there is a third file with the same summary information as the second file, it means that there is a corresponding differential file for the second file (that is, the differential file between the first file and the second file, that is, the differential file between the first file and the third file). Download the differential file corresponding to the second file, and then generate the latest first file, that is, the upgrade file, through the differential file and the second file in the local directory, and use the upgrade file to upgrade.
[0086] For example, the AnalyzeData.dll file needs to be updated, and the MD5 value calculated by the second file in the local directory is 701117ABF00A63384EB57DFC27B9C5DC, which matches the MD5 in a third file in the upgrade configuration information. Then, the corresponding differential file (2B9C8C681D609CABBB5CD0BF593BACA0.diff) is downloaded. After the differential file is downloaded successfully, the latest AnalyzeData.dll file is generated by 2B9C8C681D609CABBB5CD0BF593BACA0.diff and the AnalyzeData.dll file in the local directory. In order to avoid errors during the upgrade process, the AnalyzeData.dll file can be saved to a temporary folder (such as a tmp folder) first.
[0087] When generating a complete upgrade file through a differential file, the old file is required (for example, the old file A1 and the differential file A.diff can generate the upgrade file A2). If the old version of the local program needs to be upgraded, the A1 file must exist (because the A1 file is needed when the program is running), so you only need to download another differential file A.diff to generate the upgrade file A2.
[0088] In one embodiment, in order to save bandwidth, the differential file may be obtained by obtaining a compressed differential file and decompressing the compressed differential file to obtain the differential file.
[0089] In one embodiment, if the differential file fails to be obtained, the first file is obtained and the upgrade is performed through the first file, which is similar to the method of the aforementioned step 102 and will not be repeated here.
[0090] If the summary information of the second file in the local directory is inconsistent with the summary information of the latest first file, and the summary information of the second file in the local directory is also inconsistent with the summary information of the third file of the old version (i.e., the second version) in the upgrade configuration information, then obtain the first file and upgrade it through the first file, which is similar to the method of the aforementioned step 102 and will not be repeated here.
[0091] In one embodiment, if there is a failure in obtaining part of the first file, the installation package of the first version is downloaded for upgrading, or the first file is periodically obtained again.
[0092] In the above implementation, multiple upgrade methods are used, first using differential files for upgrade, then using file-by-file upgrade, and if it still fails, the latest version of the installation package can be downloaded to ensure that the application can be upgraded to the latest version, thereby improving the upgrade success rate. In addition, in the above method, as small a file as possible is downloaded to obtain the new first file, saving bandwidth costs and improving download efficiency.
[0093] In one embodiment, after obtaining the first file or the upgrade file, the application is upgraded, which can be achieved in the following manner:
[0094] If the first file is obtained in step 102, the first file is stored in the local directory of the application.
[0095] If an upgrade file (including a differential file or a first file) is obtained in step 103, the second file is replaced with the upgrade file.
[0096] Specifically, if the files to be updated have been successfully obtained, the upgrade is performed; if there is no second file with the same name as the first file in the local directory of the application, the first file is stored in the local directory of the application.
[0097] If a second file with the same name as the first file exists in the local directory of the application, the upgraded file replaces the original second file.
[0098] In one embodiment, if some files fail to be replaced, the installation package of the first version is downloaded for upgrading, or the files are periodically retrieved for replacement.
[0099] In one embodiment, in order to avoid an upgrade error that causes the application program to be unusable, the second file in the local directory of the application program is backed up before the upgrade.
[0100] For example, back up the second file to a new folder.
[0101] In one embodiment, before replacing the second file with the upgrade file, the method further includes:
[0102] Rename the second file.
[0103] Specifically, if the replacement of the second file in the local directory fails, the reason may be that the second file in the local directory is occupied, then rename the second file in the local directory and try to replace it in the local directory again. For example, if the AnalyzeData.dll file in the local directory is occupied and causes the replacement to fail, then rename the AnalyzeData.dll file in the local directory to AnalyzeData1.dll and then replace it.
[0104] In one embodiment, if there is a file that always fails to be replaced, the update is stopped, and the previously successfully replaced file is restored to the original one (obtained from the backup folder).
[0105] If all files are replaced successfully, the upgrade is successful.
[0106] The method of the embodiment of the present application traverses all the first files of the first version in the upgrade configuration information, compares them with the files in the local directory of the application, and updates to the latest version of the files if there are differences. Regardless of whether the version number displayed by the current application is the same as the version number of the latest first version, as long as the files in the local directory are different from the latest files, they will be updated to prevent the files from being tampered with by other third parties. Even if the local application is the latest version, the upgrade configuration information will be downloaded and parsed, and all files of the latest first version will be compared with the files in the local directory.
[0107] Figure 4 This is a flow chart of an embodiment of the application program upgrade method provided by this application. Figure 4 As shown, the method provided in this embodiment is applied to a server, and the method includes:
[0108] Step 201: Send upgrade configuration information of a first version to an electronic device; the upgrade configuration information includes: file information of a first file of the first version, and the file information includes: a name of the first file and summary information of the first file.
[0109] Specifically, if there is a latest version release package, the server pushes upgrade information, such as the latest version number, to the electronic device. If the electronic device determines to upgrade, it obtains the upgrade configuration information of the first version from the server.
[0110] In one embodiment, sending the first version of the upgrade configuration information to the electronic device may be sent after receiving an upgrade request message of the application sent by the electronic device.
[0111] Step 202: Send a first file to the electronic device according to a first request message sent by the electronic device, where the first file is used to upgrade the application of the electronic device; the first request message is used to indicate that there is no second file with the same name as the first file in the electronic device.
[0112] Specifically, the electronic device determines whether there is a second file with the same name as the first file in the local directory, and if not, obtains the first file from the server, for example, by sending a first request message to the server, the first request message is used to indicate that there is no second file with the same name as the first file in the electronic device, or is used to request the first file, and the server sends the first file according to the first request message. The first file may also be a compressed file.
[0113] Step 203: Send an upgrade file of a second file to the electronic device according to a second request message sent by the electronic device, where the upgrade file of the second file is used to upgrade the application of the electronic device; the second request message is used to indicate that a second file with the same name as the first file exists in the electronic device.
[0114] Specifically, the electronic device determines whether there is a second file with the same name as the first file in the local directory. If so, it further determines whether the summary information of the first file and the second file are the same based on the summary information. If they are different, it obtains the first file or the differential file of the first file and the second file from the server. For example, a second request message is sent to the server, and the second request message is used to indicate that there is a second file with the same name as the first file in the electronic device, or to request an upgrade file. The server sends the upgrade file according to the second request message. The upgrade file can be the first file or the differential file, wherein the first file or the differential file can also be a compressed first file or differential file.
[0115] The method of this embodiment has similar implementation principles and technical effects to the method on the electronic device side described above, and will not be described in detail here.
[0116] In one embodiment, before receiving the upgrade request message from the electronic device, the server will obtain the release package in advance. The release package may be generated by the server, or may be generated by other electronic devices and uploaded to the server.
[0117] Generate a release package, which can be achieved in the following ways:
[0118] According to the installation package of the first version, obtain the first file of the first version;
[0119] If there is a third file with the same name as the first file in the files corresponding to the second version, and the summary information of the first file is different from the summary information of the third file, then a differential file between the first file and the third file is generated;
[0120] Generate a release package of the first version according to the differential file, the first file and the upgrade configuration information of the first version; the upgrade configuration information includes: file information of each first file of the first version; the file information includes: the name of the first file and summary information of the first file.
[0121] In one embodiment, the upgrade configuration information also includes at least one of the following information: summary information of the third file of the second version, version identifier of the first version, summary information of the compressed first file, and summary information of the differential file between the first file and the third file.
[0122] In one embodiment, generating a release package can be implemented by a release packaging tool (AutoSetup.exe), such as Figure 5 As shown, this is the interface of the release packaging tool. Select the second version of the installation package (generate the corresponding differential file for the old version. If you do not need to generate a differential file for an old version, you can choose not to do so). Figure 5 There are two old versions, old version 1 and old version 2. Click the Generate button to execute the release package generation process through the release packaging tool.
[0123] Specifically, the installation package of the first version is decompressed to obtain at least one first file of the first version, that is, all first files in the installation package are extracted, such as Figure 6 Unzip the new version v3.0.0.exe into the v3.0.0 folder.
[0124] Also decompress the old versions v2.0.0.exe and v1.0.0.exe, and unzip them to the corresponding directories according to the installation package names.
[0125] After decompression is completed, the v3.0.0 folder is traversed to generate summary information for the traversed first file. Further, the first file can be compressed, that is, a .zip file is generated. Compressing the first file can reduce bandwidth consumption when downloading files and increase download speed.
[0126] For the first file traversed, search for files with the same name in the v2.0.0 and v1.0.0 folders:
[0127] If there is no file with the same name as the first file in the old version folder, it means that the first file has been added to version v3.0.0 and there is no need to generate a differential file.
[0128] If there is a file with the same name as the first file in the old version folder, and the summary information of the first file is consistent with that of the file with the same name in the old version folder, it means that the first file has not been updated and there is no need to generate a differential file.
[0129] If there is a file with the same name as the first file in the old version folder, and the summary information of the first file is inconsistent with that of the file with the same name in the old version folder, it means that the first file has been updated, and a corresponding differential file is generated.
[0130] If the summary information of the file with the same name as the first file in v2.0.0 and v1.0.0 is inconsistent, it means that the file has been updated in all three versions, then v1.0.0 and v3.0.0 generate a differential file, and v2.0.0 and v3.0.0 generate a differential file.
[0131] Among them, the differential file will be much smaller than the new first file, such as: AnalyzeData.dll file, the actual size may be 1MB, if you download the file directly, you need to download 1MB of size. However, the file may reach 0.5MB after compression, so you only need to download 0.5MB to finally get the file. For example, if there is an old version of AnalyzeData.dll file in the local directory, and it is relatively small in difference with the latest AnalyzeData.dll file, the generated differential file may be only 2KB, then you only need to download 2KB, and combine it with the local file to finally get the latest AnalyzeData.dll file.
[0132] After the first file of the first version is traversed, the upgrade configuration information of the first version is generated.
[0133] The generated release file and upgrade configuration file are saved to the release package folder of the server, and the release package includes: the first file of the first version, the differential file corresponding to the first file, the installation package of the first version and the upgrade configuration information of the first version, wherein the first file of the first version can be a compressed file. In one embodiment, in order to save download bandwidth and improve download efficiency, before step 202, it also includes:
[0134] compressing the first file;
[0135] Step 202 includes:
[0136] The compressed first file is sent to the electronic device.
[0137] In one embodiment, the differential file, the compressed first file, and the upgrade configuration information of the first version are combined to generate a release package of the first version.
[0138] In this embodiment, by comparing the new and old files, extracting the difference data to generate a differential file, then compressing the new file data to generate a compressed package, and finally generating an application release package, the upgrade success rate of the application on the electronic device side can be improved, bandwidth can be saved, and the upgrade efficiency can be improved.
[0139] Figure 7 This is a structural diagram of an embodiment of an application program upgrade device provided by the present application, such as Figure 7 As shown, the application program upgrade device of this embodiment is applied to an electronic device, and the application program upgrade device includes:
[0140] The acquisition module 701 is used to acquire the upgrade configuration information of the first version of the application according to the download path of the first version of the application; the upgrade configuration information includes: the file information of the first file of the first version, and the file information includes: the name of the first file and the summary information of the first file;
[0141] The processing module 702 is used to obtain the first file according to the download path if there is no second file with the same name as the first file in the local directory of the application, and upgrade the application according to the first file;
[0142] The processing module 702 is also used to obtain an upgrade file corresponding to the second file based on the summary information of the second file, the summary information of the first file and the download path, if there is a second file with the same name as the first file in the local directory of the application, and upgrade the application based on the upgrade file.
[0143] The device of this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0144] Figure 8 This is a structural diagram of an embodiment of an application program upgrade device provided by the present application, such as Figure 8 As shown, the application program upgrade device of this embodiment is applied to a server, and the application program upgrade device includes:
[0145] A sending module, configured to send upgrade configuration information of a first version to an electronic device; the upgrade configuration information includes: file information of a first file of the first version, the file information includes: a name of the first file and summary information of the first file;
[0146] A receiving module, configured to receive a first request message sent by the electronic device;
[0147] The sending module is further used to send a first file to the electronic device according to the first request message, where the first file is used for the electronic device to upgrade the application; the first request message is used to indicate that there is no second file with the same name as the first file in the electronic device;
[0148] The receiving module is further used to receive a second request message sent by the electronic device; the sending module is further used to send an upgrade file of the second file to the electronic device according to the second request message, and the upgrade file of the second file is used for the electronic device to upgrade the application; the second request message is used to indicate that a second file with the same name as the first file exists in the electronic device.
[0149] In a possible implementation, the method further includes:
[0150] A processing module, configured to obtain a first file of the first version according to the installation package of the first version;
[0151] If there is a third file with the same name as the first file in the files corresponding to the second version, and the summary information of the first file is different from the summary information of the third file, then generating a differential file between the first file and the third file;
[0152] Generate a release package of the first version according to the differential file, the first file and the upgrade configuration information of the first version; the upgrade configuration information includes: file information of each first file of the first version; the file information includes: the name of the first file and summary information of the first file.
[0153] The device of this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0154] In one embodiment of the present application, there is also provided an application program upgrade system, including:
[0155] Electronic equipment and servers;
[0156] The electronic device is used to obtain upgrade configuration information of the first version of the application according to the download path of the first version of the application; the upgrade configuration information includes: file information of the first file of the first version, and the file information includes: the name of the first file and summary information of the first file;
[0157] If there is no second file with the same name as the first file in the local directory of the application, obtaining the first file according to the download path, and upgrading the application according to the first file;
[0158] If a second file with the same name as the first file exists in the local directory of the application, obtaining an upgrade file corresponding to the second file according to the summary information of the second file and the summary information of the first file and the download path, and upgrading the application according to the upgrade file;
[0159] The server is used to: send the upgrade configuration information of the first version to the electronic device; send a first file to the electronic device according to a first request message sent by the electronic device, wherein the first request message is used to indicate that there is no second file with the same name as the first file in the electronic device;
[0160] An upgrade file of the second file is sent to the electronic device according to a second request message sent by the electronic device, where the second request message is used to indicate that a second file with the same name as the first file exists in the electronic device.
[0161] The system of this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0162] Fig. 9 The structure diagram of the electronic device embodiment provided in this application is as follows: Fig. 9 As shown, the electronic device includes:
[0163] A processor 901 and a memory 902 for storing executable instructions of the processor 901 .
[0164] Optionally, it may also include: a communication interface 903, which is used to implement communication with other devices.
[0165] The above components may communicate via one or more buses.
[0166] Among them, the processor 901 is configured to execute the corresponding method in the aforementioned method embodiment by executing the executable instructions. The specific implementation process can be found in the aforementioned method embodiment and will not be repeated here.
[0167] Fig.10 The structural diagram of the server embodiment provided in this application is as follows: Fig.10 As shown, the server includes:
[0168] A processor 1001 and a memory 1002 for storing executable instructions of the processor 1001 .
[0169] Optionally, it may also include: a communication interface 1003, which is used to implement communication with other devices.
[0170] The above components may communicate via one or more buses.
[0171] Among them, the processor 301 is configured to execute the corresponding method in the aforementioned method embodiment by executing the executable instructions. The specific implementation process can be found in the aforementioned method embodiment and will not be repeated here.
[0172] A computer-readable storage medium is also provided in an embodiment of the present application, on which a computer program is stored. When the computer program is executed by a processor, the corresponding method in the aforementioned method embodiment is implemented. The specific implementation process can be found in the aforementioned method embodiment. The implementation principle and technical effects are similar and will not be repeated here.
[0173] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0174] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for upgrading an application, characterized in that: include: According to the download path of the first version of the application, obtaining upgrade configuration information of the first version; The upgrade configuration information includes: file information of the first file of the first version, the file information includes: the name of the first file and summary information of the first file; If there is no second file with the same name as the first file in the local directory of the application, obtaining the first file according to the download path, and upgrading the application according to the first file; If a second file with the same name as the first file exists in the local directory of the application, obtaining an upgrade file corresponding to the second file according to the summary information of the second file and the summary information of the first file and the download path, and upgrading the application according to the upgrade file; The upgrade configuration information further includes summary information of a third file of the second version, and acquiring the upgrade file corresponding to the second file according to the summary information of the second file and the summary information of the first file, and the download path, includes: If the summary information of the second file is different from the summary information of the first file, and there is a third file having the same summary information as the second file, obtaining a differential file corresponding to the second file according to the download path, and generating the upgrade file according to the differential file corresponding to the second file and the second file; If the summary information of the second file is different from the summary information of the first file, and there is no third file having the same summary information as the second file, acquiring the first file according to the download path, and using the first file as the upgrade file; The step of upgrading the application according to the upgrade file comprises: Backing up the second file to a backup folder; Rename the second file, and replace the renamed second file with the upgrade file; If the replacement is successful, the upgrade is confirmed to be successful; If there are some second files that always fail to be replaced, the update is stopped, and the second files that have been successfully replaced are restored based on the backup folder.
2. The method according to claim 1, characterized in that Acquiring the first file according to the download path includes: According to the download path, obtain the compressed first file, and decompress it to obtain the first file; Upgrading the application according to the first file includes: The first file is stored in the local directory of the application.
3. The method according to claim 1, characterized in that The summary information is obtained by processing the file using a message digest algorithm.
4. A method for upgrading an application, characterized in that: include: Sending the first version of upgrade configuration information to the electronic device; The upgrade configuration information includes: file information of the first file of the first version, the file information includes: the name of the first file and summary information of the first file; Sending a first file to the electronic device according to a first request message sent by the electronic device, the first file being used for the electronic device to upgrade the application; the first request message being used to indicate that there is no second file with the same name as the first file in the electronic device; Sending an upgrade file of the second file to the electronic device according to a second request message sent by the electronic device, so that the electronic device backs up the second file to a backup folder, renames the second file, and replaces the renamed second file with the upgrade file. If the replacement is successful, it is determined that the upgrade is successful; if there are some second files that always fail to be replaced, the update is stopped, and the second files that have been successfully replaced are replaced based on the backup folder; wherein the second request message is used to indicate that there is a second file with the same name as the first file in the electronic device; if the summary information of the second file is different from the summary information of the first file, and there is a third file with the same summary information as the second file, the upgrade file is a differential file; if the summary information of the second file is different from the summary information of the first file, and there is no third file with the same summary information as the second file, the upgrade file is the first file.
5. The method according to claim 4, characterized in that Also includes: According to the installation package of the first version, obtaining a first file of the first version; If there is a third file with the same name as the first file in the files corresponding to the second version, and the summary information of the first file is different from the summary information of the third file, then generating a differential file between the first file and the third file; Generate a release package of the first version according to the differential file, the first file and the upgrade configuration information of the first version; The upgrade configuration information includes: file information of each first file of the first version; the file information includes: the name of the first file and summary information of the first file.
6. The method according to claim 4 or 5, characterized in that: Before sending the first file to the electronic device according to the first request message, the method further includes: compressing the first file; Sending a first file to the electronic device according to the first request message includes: The compressed first file is sent to the electronic device.
7. The method according to claim 5, characterized in that Generating a release package of the first version according to the differential file, the first file, and the upgrade configuration information of the first version includes: The differential file, the compressed first file and the upgrade configuration information of the first version are combined to generate a release package of the first version.
8. An application program upgrade system, characterized in that: include: Electronic equipment and servers; The electronic device is used to obtain upgrade configuration information of the first version of the application according to the download path of the first version of the application; the upgrade configuration information includes: file information of the first file of the first version, and the file information includes: the name of the first file and summary information of the first file; The electronic device is further configured to: if there is no second file with the same name as the first file in the local directory of the application, obtain the first file according to the download path, and upgrade the application according to the first file; if there is a second file with the same name as the first file in the local directory of the application, obtain an upgrade file corresponding to the second file according to summary information of the second file, summary information of the first file and the download path, and upgrade the application according to the upgrade file; The server is used to send the upgrade configuration information of the first version to the electronic device; The server is further configured to send the first file to the electronic device according to a first request message sent by the electronic device, the first request message being used to indicate that there is no second file with the same name as the first file in the electronic device; send an upgrade file of the second file to the electronic device according to a second request message sent by the electronic device, the second request message being used to indicate that there is a second file with the same name as the first file in the electronic device; if the summary information of the second file is different from the summary information of the first file, and there is a third file with the same summary information as the second file, the upgrade file is a differential file; if the summary information of the second file is different from the summary information of the first file, and there is no third file with the same summary information as the second file, the upgrade file is the first file; The upgrade configuration information further includes summary information of a third file of the second version, and acquiring the upgrade file corresponding to the second file according to the summary information of the second file and the summary information of the first file, and the download path, includes: If the summary information of the second file is different from the summary information of the first file, and there is a third file having the same summary information as the second file, obtaining a differential file corresponding to the second file according to the download path, and generating the upgrade file according to the differential file corresponding to the second file and the second file; If the summary information of the second file is different from the summary information of the first file, and there is no third file having the same summary information as the second file, acquiring the first file according to the download path, and using the first file as the upgrade file; When the electronic device upgrades the application according to the upgrade file, it is specifically used to: back up the second file to a backup folder; rename the second file and replace the renamed second file with the upgrade file; if the replacement is successful, it is determined that the upgrade is successful; if there are some second files that always fail to be replaced, stop updating, and restore the second files that have been successfully replaced based on the backup folder.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method according to any one of claims 1 to 3 by executing the executable instructions.
11. A server, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 4 to 7 by executing the executable instructions.
Citation Information
Patent Citations
Automatic file publishing or upgrading method and system thereof
CN105099780A
OTA upgrade method, client, server and system
CN106603311A