Application program updating method, device, electronic device and storage medium
By comparing the version deviation of the application, obtaining incremental update files from the cloud and directly updating the application, solving the problems of long update time and low efficiency in the existing technology, and achieving efficient and timely application updates.
Patent Information
- Application Number
- CN202310888255.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-18
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2043-07-18
AI Technical Summary
Existing application update technology requires downloading the entire update packet, and the application needs to be closed to update, resulting in a long update time and low efficiency, which affects the user experience.
By comparing the version deviation of the application, obtain incremental update files from the cloud, update the application directly, avoid downloading the entire update packet, and support updating in the running state of the application.
It greatly reduces the download process of duplicate content, improves the efficiency and timeliness of application updates, and allows updates during application running.
Smart Images

Figure CN117055937B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular, relates to an application updating method, device, electronic device and storage medium. Background Art
[0002] With the continuous advancement of the electronic process, more and more services can be realized through applications installed in the terminal, which greatly improves the user's operating efficiency. In order to meet the ever-changing service needs of users, the update speed of applications installed in the terminal has also increased. Therefore, how to effectively update the applications in the terminal directly affects the user experience.
[0003] With existing application management technology, when updating an application, it is generally necessary to download the entire update data package of the application through a management application, and update the application through the update data package. In addition, the application needs to be closed to complete the update operation. The time required to download the update data package is long, which reduces the update efficiency and affects the smoothness of user operations. Summary of the invention
[0004] The embodiments of the present application provide an application updating method, device, electronic device and storage medium, which can solve the problems of existing application management technology. When updating an application, it is generally necessary to download the entire update data package of the application through a management application, and update the application through the update data package, and the application needs to be closed to complete the update operation. The time required to download the update data package is long, and the update efficiency is low.
[0005] In a first aspect, an embodiment of the present application provides a method for updating an application program, comprising:
[0006] In response to an update request for an application initiated by a terminal, determining a first application version of the application installed on the terminal; the update request is generated when the application is in a preset state; the preset state includes an application running state;
[0007] Based on the version deviation between the current second application version of the application and the first application version, extracting an incremental update file corresponding to the version deviation from an update database of the application stored in the cloud;
[0008] The application program is updated to the second application version based on the incremental update file.
[0009] In a possible implementation of the first aspect, based on the version deviation between the current second application version of the application and the first application version, extracting the incremental update file corresponding to the version deviation from an update database of the application stored in the cloud includes:
[0010] Obtaining a full update data package of the application;
[0011] Determining the incremental update file according to the existing program package of the first application version and the full update data package;
[0012] Encapsulating all the incremental update files to generate an incremental update data packet for the application;
[0013] The updating of the application to the second application version based on the incremental update file includes:
[0014] The application is updated to the second application version via the incremental update data package.
[0015] In a possible implementation of the first aspect, the updating method is applied to a server;
[0016] Before extracting the incremental update file corresponding to the version deviation from the update database of the application stored in the cloud based on the version deviation between the current second application version of the application and the first application version, the method further includes:
[0017] Determine all third application versions that have been released by the application; each of the third application versions is associated with corresponding application update content;
[0018] Based on the application update content, respectively determine application objects that need to be updated when updating from the third application version to the second application version; the application objects include objects displayed in the application program;
[0019] According to a plurality of intermediate update data packets between the third application version and the second application version, respectively determine the update code content of each application object; each of the update code contents is associated with the version number of the intermediate version; the intermediate version is the version from the third application version to the second application version;
[0020] Based on the version number, import all the update code contents into an object update simulation program to generate a target update code for the application object in the process of updating from the third application version to the second application version;
[0021] Generate a candidate incremental file for updating from the third application version to the second application version according to the target update code of all the application objects corresponding to the third application version;
[0022] Based on the third application version corresponding to all the candidate incremental files, a version update index of the application is generated; the version update index is used to search for the incremental update file based on the first application version; the version update index records all the application objects that need to be updated during the update from the third application version to the second application version.
[0023] In a possible implementation of the first aspect, after generating the version update index of the application based on the third application version corresponding to all the candidate incremental files, the method further includes:
[0024] If a new version data packet for updating the application to a fourth application version is received, determining that there is an updated application object between the fourth application version and the second application version;
[0025] Based on the newly added version data packet and the application data packet of the second application version, obtaining the newly added update code of each of the updated application objects;
[0026] Determining all third application versions including any of the updated application objects through the version update index;
[0027] Based on the newly added update code, the candidate incremental file of the third application version containing any of the updated application objects is updated to obtain an updated incremental file adapted to the fourth application version;
[0028] The version update index is updated based on all the updated incremental files to make the version update index applicable to the fourth application version.
[0029] In a possible implementation manner of the first aspect, the update request carries an update mode of the terminal;
[0030] The extracting, based on the version deviation between the current second application version of the application and the first application version, an incremental update file corresponding to the version deviation from an update database of the application stored in the cloud, comprises:
[0031] If the update mode is the first update mode, all first application objects corresponding to the first application version are determined according to the version update index; the first update mode is an update mode when the storage occupancy rate of the terminal is less than a preset occupancy ratio;
[0032] generating the incremental update file of the first application version based on the target update codes of all the first application objects;
[0033] If the update mode is the second update mode, a plurality of historical usage records of the application installed on the terminal are obtained; the second update mode is an update mode when the storage occupancy rate of the terminal is greater than or equal to the occupancy ratio;
[0034] Calculating an update weight index of each application object in the application based on the operation objects in the plurality of historical usage records;
[0035] Selecting a second application object from all the application objects based on the updated weight index;
[0036] The incremental update file of the first application version is generated based on the target update code of all the second application objects.
[0037] In a possible implementation manner of the first aspect, the calculating, based on the operation objects in the plurality of historical usage records, an update weight index of each application object in the application program includes:
[0038] Determining a preset weighting coefficient of a storage space corresponding to the terminal according to the storage occupancy rate;
[0039] Calculate a usage weight value of each application object based on the corresponding operation duration in the historical usage record and the application object associated with the operation object;
[0040] Calculating the capacity weight value of each application object according to the target update code and the preset weight coefficient of each application object;
[0041] Obtaining a list of applications installed in the terminal, and calculating a function replacement weight value of each application object based on the usage frequency of other applications in the application list that are functionally associated with the application program;
[0042] The update weight index of the application object is calculated based on the function replacement weight value, the usage weight value, and the capacity weight value.
[0043] In a possible implementation manner of the first aspect, updating the application to the second application version based on the incremental update file includes:
[0044] If the terminal is in a first running state in which the application is running in the foreground, an update object is generated on a first layer based on the incremental update file; the first layer is on a second layer of the operation interface of the application;
[0045] When the rendering of the update object is completed, the application object corresponding to the update object in the operation interface is removed, and the update object is added to the operation interface in the second layer.
[0046] In a second aspect, an embodiment of the present application provides an application updating device, including:
[0047] An update request response unit, configured to determine a first application version of the application installed on the terminal in response to an update request for the application initiated by the terminal; the update request is generated when the application is in a preset state; the preset state includes an application running state;
[0048] an update file determining unit, configured to extract, based on a version deviation between a current second application version of the application and the first application version, an incremental update file corresponding to the version deviation from an update database of the application stored in the cloud;
[0049] An application updating unit is used to update the application program to the second application version based on the incremental update file.
[0050] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method as described in any one of the first aspects above when executing the computer program.
[0051] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the first aspects above is implemented.
[0052] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a server, enables the server to execute any of the methods described in the first aspect.
[0053] Compared with the prior art, the embodiments of the present application have the following beneficial effects: when the application needs to be updated, the first application version of the application is determined, and by comparing the version deviation between the second application version currently released and the first application version, the corresponding incremental update file is obtained from the cloud, without downloading the update data package of the entire application, and the version of the above application is updated through the incremental update file, so that the application locally installed on the terminal is updated to the second application version released in the cloud, thereby achieving the purpose of updating the application. Compared with the existing application management technology, when the application in the embodiments of the present application needs to be updated, it is not necessary to obtain the entire update data package, but it is sufficient to obtain the corresponding incremental update file according to the version deviation, which greatly reduces the download process of duplicate content and improves the efficiency of application updates. In addition, the process of initiating application updates can be initiated during the operation of the application, which can further improve the timeliness of application updates. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0055] Figure 1 It is a schematic diagram of an implementation method of an application program update provided in an embodiment of the present application;
[0056] Figure 2 It is a schematic diagram comparing the update process of the original application provided in one embodiment of the present application with the update process of the application provided in the present application;
[0057] Figure 3 This is a specific implementation flow chart of an application updating method provided in the second embodiment of the present application in S102 and S103;
[0058] Figure 4 This is a specific implementation flow chart of an application updating method provided in the third embodiment of the present application before S102;
[0059] Figure 5 This is a specific implementation flow chart after S406 of an application program update method provided in the fourth embodiment of the present application;
[0060] Figure 6 This is a specific implementation flow chart of a method S102 for updating an application program provided in the fourth embodiment of the present application;
[0061] Figure 7 This is a specific implementation flow chart of a method S103 for updating an application program provided in the fifth embodiment of the present application;
[0062] Figure 8 It is a structural diagram of an application program update device provided in an embodiment of the present application;
[0063] Fig. 9 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0065] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0066] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0067] The application updating method provided in the embodiment of the present application can be applied to electronic devices that can update the application, such as servers, smart phones, tablet computers, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, etc. The embodiment of the present application does not impose any restrictions on the specific type of electronic devices. Among them, the electronic device can be a terminal with an application installed, such as a smart phone, a tablet computer, a smart watch, etc. In this case, the electronic device can download the incremental update file corresponding to the application from the cloud server, and update the locally installed application through the incremental update file.
[0068] In one possible implementation, the electronic device may also be a cloud server that responds to update requests, that is, a server corresponding to an application. In this case, a terminal that needs to support the application may establish a communication connection with the cloud server and send an update request to the cloud server through the communication connection. The cloud server may feed back the incremental update file to the terminal, and the terminal may perform a version update on the local application after receiving the incremental update file.
[0069] See also Figure 1 , Figure 1 A schematic diagram of an implementation method of an application program update method provided in an embodiment of the present application is shown, and the method comprises the following steps:
[0070] In S101, in response to an update request for an application initiated by a terminal, a first application version of the application installed on the terminal is determined; the update request is generated when the application is in a preset state; the preset state includes an application running state.
[0071] In this embodiment, the terminal has one or more applications installed. If it is detected that a newly released version of the locally installed application exists, that is, there is a version difference between the first application version of the local application and the second application version released by the cloud server, it is determined that the application needs to be updated, and the terminal will generate an update request for the application.
[0072] In one possible implementation, the terminal may be set with a version deviation threshold. If the version deviation between the first application version and the second application version is less than the above-mentioned version deviation threshold, it is recognized that not upgrading the application will not affect the normal functional use of the user, and the application of the first application version can continue to run. On the contrary, if the version deviation between the above-mentioned two is greater than or equal to the above-mentioned version deviation threshold, some functions may be unavailable. At this time, the terminal will generate an update request for the application to update the application.
[0073] In this embodiment, when the terminal runs an application, it can send a version query request to the cloud server corresponding to the application, receive the second application version of the latest version currently released fed back by the cloud server, and compare the first application version with the second application version. If there is a difference between the two, the above-mentioned update request is generated, and the update request carrying the first application version is sent to the cloud server corresponding to the application.
[0074] In this embodiment, the hot update process of the application supports updating the program during the running of the application. Therefore, when the update request is initiated, the preset state of the application running in the terminal includes the running state of the application. Among them, the preset state also includes the state of the application running in the background and the state of the application being closed. The terminal can be installed with a program management application, such as an application mall, an application store, etc. The terminal can detect whether the locally installed application needs to be updated through the above application, and if necessary, the above update request can be sent to the cloud server corresponding to the application.
[0075] It should be noted that if the electronic device that is the execution subject of the above-mentioned S101 is a terminal with an application installed, then after the terminal receives the update request initiated by the application, it determines the first application version of the application, encapsulates the first application version in the update request, and sends it to the cloud server; if the above-mentioned electronic device is a cloud server, the cloud server can parse the update request to extract the first application version carried in the update request.
[0076] In S102, based on the version deviation between the current second application version of the application and the first application version, an incremental update file corresponding to the version deviation is extracted from an update database of the application stored in the cloud.
[0077] In this embodiment, after determining the first application version of the application installed on the terminal, the electronic device will determine the version deviation between the first application version and the second application version currently released by the application. For example, the version number of the first application version is: Ver1.1.005, and the version number of the second application version is: Ver1.1.010, which means that there is a difference of five versions between the above two versions. The electronic device can determine the corresponding update content between the two versions according to the version deviation between the above two application versions, and generate a corresponding incremental update file based on the update content between the two versions.
[0078] In this embodiment, the electronic device can be connected to a cloud server for storing update data packets of application programs, and based on the first application version and the second application version, extract the incremental update file corresponding to the version deviation of the above two versions from the update data of all versions stored in the cloud server.
[0079] If the electronic device is a terminal with an application installed, the corresponding incremental update file can be downloaded from the cloud server; optionally, the terminal can download the overall update file for the second application version from the cloud server, and compare it with the data packet of the first application version stored locally to determine the incremental update file between the two versions.
[0080] If the electronic device is a cloud server, the cloud server can extract the overall update file of the second application version and the overall update file of the first application version from the database, and determine the updated content by comparing the overall update files of the two versions, and then obtain the corresponding incremental update file, and feed the incremental update file back to the terminal.
[0081] In S103, the application program is updated to the second application version based on the incremental update file.
[0082] In this embodiment, after obtaining the incremental update file for updating the application, the terminal can run the incremental update file to achieve the purpose of updating the application without re-downloading the entire update data package of the application, thereby improving the update efficiency.
[0083] Among them, after the terminal obtains the incremental update file, if the incremental update file supports the hot update mode and the terminal is currently running the above-mentioned application, the running application can be updated through hot update. For example, the update content is index.jsbundle, image resources, json configuration file and other type files, then the terminal can replace the above-mentioned update content by running the above-mentioned incremental update file, thereby achieving the purpose of hot update of the application.
[0084] For example, Figure 2 A schematic diagram comparing the update process of the original application provided by an embodiment of the present application with the update process of the application provided by the present application (ie, the optimized update process) is shown. Figure 2 As shown, for native applications in the terminal, the update of this type of application is achieved by downloading the entire application data package (i.e., full update package), and the application needs to be closed before updating; while for the hot update process provided by this application, an incremental update file can be downloaded and the application can be hot updated according to the incremental update file.
[0085] From the above, it can be seen that the application updating method provided by the embodiment of the present application determines the first application version of the application when the application needs to be updated, and obtains the corresponding incremental update file from the cloud by comparing the version deviation between the second application version currently released and the first application version, without downloading the update data package of the entire application, and updates the version of the above application through the incremental update file, so that the application locally installed on the terminal is updated to the second application version released in the cloud, thereby achieving the purpose of updating the application. Compared with the existing application management technology, when the application in the embodiment of the present application needs to be updated, it is not necessary to obtain the entire update data package, but it is sufficient to obtain the corresponding incremental update file according to the version deviation, which greatly reduces the download process of duplicate content and improves the efficiency of application update. In addition, the process of initiating the application update can be initiated during the operation of the application, which can further improve the timeliness of the application update.
[0086] Figure 3 The following is a flowchart showing the specific implementation of an application updating method in S102 and S103 provided in the second embodiment of the present application. Figure 3 , relative to Figure 1 In the embodiment, the electronic device in the application updating method provided in the embodiment is a terminal installed with the application, S102 in the above updating method includes: S1021 to S1023, S103 includes S1031, which are specifically described as follows:
[0087] Furthermore, based on the version deviation between the current second application version of the application and the first application version, extracting the incremental update file corresponding to the version deviation from the update database of the application stored in the cloud includes:
[0088] In S1021, a full update data package of the application is obtained.
[0089] In this embodiment, when the terminal needs to hot update the application, it can send an update request carrying the program identifier of the application to the cloud server. After receiving the above update request, the cloud server can send the full update data packet corresponding to the second application version to the terminal.
[0090] In one possible implementation, the terminal can send an update request for the version number of the second application version to a cloud server. After receiving the program identifier of the update request, the cloud server can send the file index of the full update data packet of the second application version to the terminal, so that the terminal can compare the updated incremental files based on the file index. Since the index has a smaller amount of data than the entire update data packet, the amount of data required to be transmitted can be reduced.
[0091] In S1022, the incremental update file is determined according to the existing program package of the first application version and the full update data package.
[0092] In S1023, all the incremental update files are packaged to generate an incremental update data packet of the application.
[0093] In this embodiment, the terminal can obtain the existing program package of the first application version locally and decompress the existing program package to determine the first file list; correspondingly, the full update data packet of the second application version can also be decompressed to determine the second file list. If the above feedback is a file index, the second file list can also be determined based on the file index.
[0094] In this embodiment, the electronic device can create three types of folders, namely, a full folder, a current demand folder, and an incremental resource folder. The electronic device can determine the file content with deviations between the first application version and the second application version by comparing the content and modification time of each file in the first file list and the second file list, so as to determine the two types of full program files and incremental update files, and store them in corresponding folders according to the different attributes of the files to obtain full update data packets and incremental update data packets.
[0095] Specifically, the method for determining the file contents with deviations between the two file lists can be: using Python's hashlib module, constructing a hashlib object for the incoming file and updating the specified string after encryption, and then obtaining the string code from hexdigest to achieve file difference comparison: the file difference distinction algorithm is the guarantee for achieving incremental updates, by traversing all resource files on the server and the latest requirements, the difference between the old and new files is compared and the new difference file after comparison is output.
[0096] Further, updating the application to the second application version based on the incremental update file includes:
[0097] In S1031, the application is updated to the second application version via the incremental update data package.
[0098] In this embodiment, after determining that there is a deviation in the file content, the terminal can replace the corresponding existing file in the first file list in the first application version with the incremental update file, and add the newly added incremental update file to the existing program package, thereby achieving the purpose of hot updating the application.
[0099] In an embodiment of the present application, by comparing files with differences, corresponding incremental update data packets are generated for updated incremental update files, thereby achieving the purpose of hot updating of the application and improving the update efficiency.
[0100] Figure 4 FIG. 4 shows a specific implementation flow chart of an application updating method provided in the third embodiment of the present application before S102. Figure 4 , relative to Figure 1 In the embodiment, the electronic device in the application updating method provided in the embodiment is the application server. The updating method further includes, before S102: S401 to S406, which are described in detail as follows:
[0101] In S401, all third application versions that have been released by the application are determined; each of the third application versions is associated with corresponding application update content.
[0102] In this embodiment, the server can store program data packages of all published third application versions of the application. Since the applications installed in different terminals can be any published third application version, in order to quickly determine the incremental update file corresponding to the update request, the server can construct a corresponding version update index table to determine the version deviation between each published third application version and the current second application version.
[0103] In this embodiment, when an application releases a program version, it often generates a corresponding update content list to describe which content in the application is updated during this version update, such as updating a certain image or a certain function. The update information of all application objects is encapsulated to obtain the application update content corresponding to the third application version.
[0104] In S402, based on the application update content, application objects that need to be updated when updating from the third application version to the second application version are respectively determined; the application objects include objects displayed in the application program.
[0105] In this embodiment, after determining the update content corresponding to each published third application version, the server can determine the intermediate versions between any third application version and the second application version, and determine all application objects that need to be updated based on the application update content corresponding to the third application version and all intermediate versions. The above application objects include objects displayed in the application, such as images, controls, menu bars, etc. Optionally, the above application objects also include program functions, jumpable links, and menu bars of the application.
[0106] For example, the third application version is Ver.1.1.002, and the second application version is Ver.1.1.010, then there are 8 intermediate versions between the above two application versions. The server will determine the application update content of the above 8 intermediate versions, determine the application objects that need to be updated in each application update content, cluster and integrate all application objects, and thus determine all application objects that need to be updated from the third application version to the second application version.
[0107] It should be noted that the above clustering and integration of application objects specifically includes: identifying application objects updated in multiple different intermediate versions as the same application object, and determining the object update content of the application object between different intermediate versions.
[0108] In S403, based on multiple intermediate update data packets from the third application version to the second application version, the update code content of each application object is determined respectively; each update code content is associated with the version number of the intermediate version; the intermediate version is the version from the third application version to the second application version.
[0109] In this embodiment, after determining that there is an updated application object, the server can determine the update code content associated with the above application object from the intermediate update data packets corresponding to multiple intermediate versions, where different application objects can correspond to one or more update files, and the code related to the application object in all update files is extracted to obtain the update code content corresponding to each intermediate version, and each update code content is associated with the version number of an intermediate version.
[0110] In S404, based on the version number, all the update code contents are imported into an object update simulation program to generate a target update code for the application object in the process of updating from the third application version to the second application version.
[0111] In this embodiment, since the same application object may be updated to varying degrees between multiple different versions, in order to improve the accuracy of the subsequent target update code, the server will import the update code content of the application object in different intermediate versions into the object update simulation program at one time according to the order of version numbers, so as to simulate the corresponding timing update of the application object during the change of the intermediate version, thereby obtaining the target update code corresponding to the application object in the process of updating from the third application version to the second application version.
[0112] Exemplarily, an application object contains 8 intermediate versions, such as Ver.1.1.003 to Ver.1.1.010. The server will first import the application object's update code content in Ver.1.1.003 into the above-mentioned object update simulation program, so that the above-mentioned application object can be updated from Ver.1.1.002 to Ver.1.1.003; then import the application object's update code content in Ver.1.1.004 into the above-mentioned object update simulation program, and so on, until the application object can be updated to the second application version, that is, Ver.1.1.010, so that through the above-mentioned object update simulation program, it can generate the target update code corresponding to the direct update from the third application version to the second application version.
[0113] In S405, a candidate incremental file for updating from the third application version to the second application version is generated according to the target update code of all the application objects corresponding to the third application version.
[0114] In this embodiment, after determining the target update code corresponding to each application object in the third application version, the server can encapsulate the target update code of all application objects, thereby obtaining a candidate incremental file corresponding to the update from the third application version to the second application version, thereby eliminating the need to iterate through multiple versions and being able to directly update from the third application version to the second application version. At the same time, it can also reduce the content that does not need to be updated between the two versions in the entire incremental file, thereby reducing the file data volume of the incremental file.
[0115] In S406, a version update index of the application is generated based on the third application version corresponding to all the candidate incremental files; the version update index is used to search for the incremental update file based on the first application version; the version update index records all the application objects that need to be updated during the update from the third application version to the second application version.
[0116] In this embodiment, after determining the candidate supplementary files corresponding to each published third application version, the server can generate a corresponding version update index table. Exemplarily, Table 1 shows a schematic diagram of a version update index table provided by an embodiment of the present application. As shown in Table 1, the index table records the version number of the currently published version and the version number of the historical version that has been published. Each historical version can be associated with a corresponding incremental update file, and the specific update content of the supplementary update file is recorded, so that when the update is performed later, the incremental update file corresponding to the first application version can be queried through the version update index, without the need to perform file parsing and content comparison again, thereby improving the efficiency of the update.
[0117]
[0118] Table 1
[0119] Figure 5 FIG4 shows a specific implementation flow chart of an application updating method after S406 provided in the fourth embodiment of the present application. Figure 5 , relative to Figure 4 In the embodiment, the method for updating an application provided in the embodiment includes, after S406, S501 to S505, which are described in detail as follows:
[0120] In S501, if a new version data packet for updating the application to a fourth application version is received, it is determined that there is an updated application object between the fourth application version and the second application version.
[0121] In this embodiment, after the server generates the above version update index, if the application releases a new application version, that is, the above fourth application version, the server needs to adjust the above version update index so that after receiving the update request, the application installed on the terminal can be updated to the fourth application version based on the above version update index. The server will parse the new version data packet of the above fourth application version to determine its corresponding file list, compare the file list of the fourth application version with the file list obtained by parsing the program data packet of the second application version, determine the updated content, and determine the application object involved in this update, that is, the above updated application object.
[0122] In S502, based on the newly added version data packet and the application data packet of the second application version, a newly added update code of each updated application object is obtained.
[0123] In this embodiment, after determining the updated application object between two versions, the server can extract the first update code associated with the updated application object from the new version data packet, and the corresponding second update code from the second application version, and generate a new update code for the updated application object through the contents of the above two update codes, so as to determine how to update the updated application object from the display state of the second application version to the display state corresponding to the fourth application version.
[0124] In S503, all third application versions including any of the updated application objects are determined through the version update index.
[0125] In this embodiment, the version update index of the server records the updated application objects involved when updating from each published third application version to the second application version. If the updated application object exists in the updated application objects in the third application version, it means that the corresponding application object in the third application version needs to be adjusted so that its code content can be consistent with the current latest released version; if all the updated application objects involved in a third application version do not involve the updated application object, it means that it is the newly added content this time, and the code file corresponding to the updated application object can be directly added to the corresponding incremental update data package in the third application version, without re-determining the incremental update file.
[0126] In S504, based on the newly added update code, the candidate incremental file of the third application version containing any of the updated application objects is updated to obtain an updated incremental file adapted to the fourth application version.
[0127] In this embodiment, after the server has determined all third application versions involved in updating the application object, it can add new update code to update the code content of the updated application object in the candidate incremental file corresponding to the third application version, thereby obtaining an updated incremental file from the third application version to the fourth application version, realizing timely update when a new version appears.
[0128] In S505, the version update index is updated based on all the update incremental files to make the version update index applicable to the fourth application version.
[0129] In this embodiment, after determining that there is an updated incremental text, the server will update the current version in the version update index to the fourth application version, and adjust the updated application object recorded in the version update index table according to the updated application object contained in the updated incremental text to implement a version update of the index table.
[0130] It should be noted that, since there is a newly released fourth application version, the above version update index will record the index updated from the second application version to the fourth application version, and determine the corresponding incremental update file.
[0131] In an embodiment of the present application, by establishing a version update index and updating it when a new version exists, it is possible to determine the updated objects during version backtracking and adjust the corresponding code content, thereby improving the update efficiency and the accuracy of version maintenance.
[0132] Figure 6 FIG. 4 shows a specific implementation flow chart of a method S102 for updating an application program provided in the fourth embodiment of the present application. Figure 6 , relative to Figure 4 In the embodiment, the present embodiment provides an application updating method, in which S102 includes: S601 to S606, which are described in detail as follows:
[0133] In S601, if the update mode is the first update mode, all first application objects corresponding to the first application version are determined according to the version update index; the first update mode is an update mode when the storage occupancy rate of the terminal is less than a preset occupancy ratio.
[0134] In S602, the incremental update file of the first application version is generated based on the target update code of all the first application objects.
[0135] In this embodiment, before the server feeds back the above incremental update file to the terminal, it needs to determine the storage occupancy rate of the terminal. If the storage occupancy rate is less than the preset occupancy ratio, the terminal can set the update mode to the first update mode and add the mode identifier to the above update request; if the storage occupancy rate is greater than or equal to the preset occupancy ratio, the terminal can set the update mode to the second update mode. The server can determine the update mode of the terminal through the update identifier in the update request and execute the corresponding update process.
[0136] Optionally, the storage occupancy rate may be carried in the above-mentioned update request, and the server may determine whether the storage occupancy rate of the terminal is greater than a preset occupancy rate by reading a corresponding field in the above-mentioned update request.
[0137] In this embodiment, since the terminal is in the first update mode, that is, the terminal has more available storage space, all application objects involved in the update can be updated without updating some objects. In this case, the server will determine the third application version corresponding to the first application version based on the version update index, and determine all application objects that need to be updated recorded in the version update index of the third application version, that is, the above-mentioned first application objects, and generate incremental update files based on the target update codes of all first application objects to implement the update process of all application objects.
[0138] In this embodiment, after receiving the incremental update file including all first application objects, the terminal may update the local program data package to update the first application version to the second application version.
[0139] In S603, if the update mode is the second update mode, multiple historical usage records of the application installed on the terminal are obtained; the second update mode is an update mode when the storage occupancy rate of the terminal is greater than or equal to the occupancy ratio.
[0140] In this embodiment, since the terminal is in the second update mode, the available storage space of the terminal is small. In this case, if all application objects that need to be updated in the application are updated, the storage pressure of the terminal may be further increased. In order to avoid the above situation, the server needs to select the application objects that urgently need to be updated from all application objects according to the user's usage habits (i.e., through the above historical usage records). Therefore, the server can extract the historical usage records of the application corresponding to the terminal from the user database. The historical usage records carry the user's usage time information of the application, the operation object information initiated by the user, etc.
[0141] In S604, based on the operation objects in the plurality of historical usage records, an update weight index of each application object in the application program is calculated.
[0142] In this embodiment, the server can respectively determine the operation objects of the interactive operations initiated by the user in each historical usage record, and import a preset weight indicator conversion algorithm according to the characteristic values of the operation object such as the operation duration and operation frequency, and respectively calculate the update weight indicator of each application object in the application to determine the application objects that are frequently used or used by the user, so as to perform personalized partial object updates later, thereby improving storage utilization and reducing the impact on user usage.
[0143] Further, as another embodiment of the present application, the above S604 may specifically include the following steps:
[0144] Step 1: Determine a preset weighting coefficient of the storage space corresponding to the terminal according to the storage occupancy rate.
[0145] In this embodiment, the server may determine the corresponding weighting coefficient according to the storage occupancy rate of the terminal to determine the number of second application objects that need to be updated. The larger the storage occupancy rate, the smaller the corresponding weighting coefficient; conversely, the smaller the storage occupancy rate, the larger the corresponding weighting coefficient. The server may store a corresponding mapping relationship to determine the preset weighting coefficient corresponding to the storage occupancy rate.
[0146] Step 2: Calculate the usage weight value of each application object based on the corresponding operation duration in the historical usage record and the application object associated with the operation object.
[0147] In this embodiment, the server can calculate the usage weight value corresponding to the application based on the operation time of the operation object in the historical usage record and the application object involved in the operation object in the application. Among them, the longer the operation time, the higher the corresponding usage weight value; conversely, the shorter the operation time, the lower the corresponding usage weight value. It should be noted that since there may be newly added application objects and replaced application objects in the second application version, that is, the operation objects in the original historical usage records, there may not be consistent application objects in the second application version. In this case, the server can determine the application object with the same object type and function type from the second application version as its associated application object based on the object type and function type of the operation object.
[0148] Step 3: Calculate the capacity weight value of each application object according to the target update code of each application object and the preset weight coefficient.
[0149] In this embodiment, since the capacity of the application object after the update will also directly affect the actual storage pressure of the terminal, the server can also calculate the corresponding capacity weight value according to the data volume of the target update code of the application object when calculating the above update weight value. It should be noted that the data volume of the target update code is inversely proportional to the above capacity weight value, that is, the larger the data volume, the smaller the corresponding capacity weight value.
[0150] Step 4: Obtain a list of applications installed in the terminal, and calculate a function replacement weight value of each application object based on the usage frequency of other applications in the application list that are functionally associated with the application program.
[0151] In this embodiment, the server can obtain the usage of other applications installed in the terminal, and determine whether there are other applications that can replace the functions provided by a certain application object in the application being updated. If there are other applications with the same functions that can be replaced, and the usage frequency of other applications is relatively high, then the update weight index of the corresponding application object is relatively low; for example, there is an application object with a camera function in a certain application, and there are other camera applications with high user usage frequency in the terminal, then the function is highly replaceable and the corresponding function replacement weight is relatively small.
[0152] Step 5: Calculate the update weight index of the application object based on the function replacement weight value, the usage weight value and the capacity weight value.
[0153] In this embodiment, the server can import the multiple weight values obtained by the above calculation into a preset indicator conversion algorithm, each weight value can correspond to a preset weighting factor, and perform superposition calculation of the weighting factors on the multiple weight values to obtain the above-mentioned updated weight indicator.
[0154] In the embodiment of the present application, by acquiring characteristic indicators of multiple dimensions, the update weight indicator of each application object in the application is determined, thereby improving the accuracy of the subsequent selection of the second application object.
[0155] In S605, a second application object is selected from all the application objects based on the updated weight index.
[0156] In this embodiment, the server may select an application object whose update weight index is greater than a preset weight threshold as the second application object.
[0157] In S606, the incremental update file of the first application version is generated based on the target update code of all the second application objects.
[0158] In this embodiment, the server encapsulates all target update codes of the second application object to obtain an incremental update file to update some objects of the first application version so that the second application object commonly used by the user is consistent with the current version, thereby achieving the purpose of personalized update.
[0159] In an embodiment of the present application, corresponding incremental update files are generated according to different update modes, which improves the accuracy of the update and reduces the occupancy of terminal storage resources after the update, thereby improving the terminal resource utilization.
[0160] Figure 7 FIG. 5 shows a specific implementation flow chart of a method S103 for updating an application program provided in the fifth embodiment of the present application. Figure 7 , relative to Figure 1-6 In any of the embodiments, in the method for updating an application provided in this embodiment, S103 includes: S701 to S702, which are described in detail as follows:
[0161] In S701, if the terminal is in a first running state in which the application is running in the foreground, an update object is generated on a first layer based on the incremental update file; the first layer is on a second layer of the operation interface of the application.
[0162] In S702, when the rendering of the update object is completed, the application object corresponding to the update object in the operation interface is removed, and the update object is added to the operation interface in the second layer.
[0163] In this embodiment, the process of updating the application program by the terminal supports the hot update mode. When the incremental update file is obtained, if the terminal foreground is running the application program to be updated, that is, the application program is in the first running state mentioned above, the terminal will adopt the hot update mode, and by running the incremental update file, an update object corresponding to the application object to be updated is generated in the first layer, and the update object will be on the second layer of the original operation interface to cover the application object originally displayed. After the rendering of the update object is completed, the application object to be replaced in the second layer will be deleted, and the code of the application object will be updated to the target update code of the update object, so that after removing the original application object, the update object will be added to the operation interface where the second layer is located, thereby achieving the purpose of hot update.
[0164] Figure 8 The structure block diagram of an application updating device provided by an embodiment of the present application is shown. The evaluation report generating device includes units for executing Figure 1 The steps implemented by the generating device in the corresponding embodiment. For details, please refer to Figure 1 and Figure 1 For the convenience of explanation, only the parts related to this embodiment are shown.
[0165] See also Figure 8 , the updating device of the application program comprises:
[0166] An update request response unit 81, configured to determine a first application version of the application installed on the terminal in response to an update request for the application initiated by the terminal; the update request is generated when the application is in a preset state; the preset state includes an application running state;
[0167] An update file determining unit 82 is used to extract an incremental update file corresponding to the version deviation between the current second application version of the application and the first application version from an update database of the application stored in the cloud;
[0168] The application updating unit 83 is configured to update the application program to the second application version based on the incremental update file.
[0169] It should be understood that Figure 8 In the structural block diagram of the evaluation report generation device shown, each module is used to execute Figures 1 to 7 The steps in the corresponding embodiments, and for Figures 1 to 7 Each step in the corresponding embodiment has been explained in detail in the above embodiment. Figures 1 to 7 as well as Figures 1 to 7 The relevant descriptions in the corresponding embodiments are not repeated here.
[0170] Fig. 9 is a structural block diagram of an electronic device provided by another embodiment of the present application. Fig. 9 As shown, the electronic device 900 of this embodiment includes: a processor 910, a memory 920, and a computer program 930 stored in the memory 920 and executable by the processor 910, such as a program of a method for generating an evaluation report. When the processor 910 executes the computer program 930, the steps of each embodiment of the method for generating an evaluation report are implemented, such as Figure 1 Alternatively, the processor 910 implements the above when executing the computer program 930 Fig. 9 The functions of each module in the corresponding embodiment are, for example, Figure 8 For details on the functions of units 81 to 83, please refer to Figure 8 Related description in the corresponding embodiment.
[0171] Exemplarily, the computer program 930 may be divided into one or more modules, one or more modules are stored in the memory 920, and are executed by the processor 910 to complete the present application. One or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 930 in the electronic device 900. For example, the computer program 930 may be divided into various unit modules, and the specific functions of each module are as described above.
[0172] The electronic device 900 may include, but is not limited to, a processor 910 and a memory 920. Those skilled in the art will appreciate that Fig. 9 It is only an example of the electronic device 900 and does not constitute a limitation of the electronic device 900. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0173] The processor 910 may be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0174] The memory 920 may be an internal storage unit of the electronic device 900, such as a hard disk or memory of the electronic device 900. The memory 920 may also be an external storage device of the electronic device 900, such as a plug-in hard disk, a smart memory card, a flash memory card, etc. equipped on the electronic device 900. Furthermore, the memory 920 may also include both an internal storage unit of the electronic device 900 and an external storage device.
[0175] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for updating an application, characterized in that: include: In response to a request for updating an application initiated by a terminal, determining a first application version of the application installed on the terminal; The update request is generated when the application is in a preset state; the preset state includes an application running state; Based on the version deviation between the current second application version of the application and the first application version, extracting an incremental update file corresponding to the version deviation from an update database of the application stored in the cloud; updating the application to the second application version based on the incremental update file; The updating method is applied to the server; Before extracting the incremental update file corresponding to the version deviation from the update database of the application stored in the cloud based on the version deviation between the current second application version of the application and the first application version, the method further includes: Determine all third application versions that have been released by the application; each of the third application versions is associated with corresponding application update content; Based on the application update content, respectively determine the application objects that need to be updated when updating from the third application version to the second application version, including: determining the intermediate versions between any third application version and the second application version, and based on the application update content corresponding to the third application version and all the intermediate versions, determine all the application objects that need to be updated, cluster and integrate all the updated application objects, and determine all the application objects that need to be updated when updating from the third application version to the second application version, including: identifying the application objects that have been updated in multiple different intermediate versions as the same application object, and determining the object update content of the application object between different intermediate versions; the application objects include objects displayed in the application program; According to a plurality of intermediate update data packets between the third application version and the second application version, respectively determine the update code content of each application object; each of the update code contents is associated with the version number of the intermediate version; the intermediate version is the version from the third application version to the second application version; Based on the version number, all the update code contents are imported into the object update simulation program to generate the target update code of the application object in the process of updating from the third application version to the second application version, including: according to the order of the version numbers, the update codes of the application object in different intermediate versions are sequentially imported into the object update simulation program to simulate the corresponding sequential update of the application object in the process of changing the intermediate versions, so as to generate the target update code corresponding to the direct update from the third application version to the second application version; Generate a candidate incremental file for updating from the third application version to the second application version according to the target update code of all the application objects corresponding to the third application version; Based on the third application version corresponding to all the candidate incremental files, a version update index of the application is generated; the version update index is used to search for the incremental update file based on the first application version; the version update index records all the application objects that need to be updated during the update from the third application version to the second application version; The update request carries the update mode of the terminal; The extracting, based on the version deviation between the current second application version of the application and the first application version, an incremental update file corresponding to the version deviation from an update database of the application stored in the cloud, comprises: If the update mode is the first update mode, all first application objects corresponding to the first application version are determined according to the version update index; the first update mode is an update mode when the storage occupancy rate of the terminal is less than a preset occupancy ratio; generating the incremental update file of the first application version based on the target update codes of all the first application objects; If the update mode is the second update mode, multiple historical usage records of the application installed on the terminal are obtained; the second update mode is an update mode when the storage occupancy rate of the terminal is greater than or equal to the occupancy ratio; the historical usage record carries the usage time information of the user using the application and the operation object information initiated by the user; Calculating an update weight index of each application object in the application based on the operation objects in the plurality of historical usage records; Selecting a second application object from all the application objects based on the updated weight index; generating the incremental update file of the first application version based on the target update codes of all the second application objects; The step of calculating the update weight index of each application object in the application based on the operation objects in the plurality of historical usage records includes: Determining a preset weighting coefficient of a storage space corresponding to the terminal according to the storage occupancy rate; Calculate a usage weight value of each application object based on the corresponding operation duration in the historical usage record and the application object associated with the operation object; Calculating the capacity weight value of each application object according to the target update code and the preset weight coefficient of each application object; Obtaining a list of applications installed in the terminal, and calculating a function replacement weight value of each application object based on the usage frequency of other applications in the application list that are functionally associated with the application program; The update weight index of the application object is calculated based on the function replacement weight value, the usage weight value, and the capacity weight value.
2. The updating method according to claim 1, characterized in that: The extracting, based on the version deviation between the current second application version of the application and the first application version, an incremental update file corresponding to the version deviation from an update database of the application stored in the cloud, comprises: Obtaining a full update data package of the application; Determining the incremental update file according to the existing program package of the first application version and the full update data package; Encapsulating all the incremental update files to generate an incremental update data packet for the application; The updating of the application to the second application version based on the incremental update file includes: The application is updated to the second application version via the incremental update data package.
3. The updating method according to claim 1, characterized in that: After generating the version update index of the application program based on the third application version corresponding to all the candidate incremental files, the method further includes: If a new version data packet for updating the application to a fourth application version is received, determining that there is an updated application object between the fourth application version and the second application version; Based on the newly added version data packet and the application data packet of the second application version, obtaining the newly added update code of each of the updated application objects; Determining all third application versions including any of the updated application objects through the version update index; Based on the newly added update code, the candidate incremental file of the third application version containing any of the updated application objects is updated to obtain an updated incremental file adapted to the fourth application version; The version update index is updated based on all the updated incremental files to make the version update index applicable to the fourth application version.
4. The updating method according to any one of claims 1 to 3, characterized in that: The updating of the application to the second application version based on the incremental update file includes: If the terminal is in a first running state in which the application is running in the foreground, an update object is generated on a first layer based on the incremental update file; the first layer is on a second layer of the operation interface of the application; When the rendering of the update object is completed, the application object corresponding to the update object in the operation interface is removed, and the update object is added to the operation interface in the second layer.
5. An application updating device, characterized in that: include: An update request response unit, configured to determine a first application version of the application installed on the terminal in response to an update request for the application initiated by the terminal; The update request is generated when the application is in a preset state; The preset state includes the application running state; an update file determining unit, configured to extract, based on a version deviation between a current second application version of the application and the first application version, an incremental update file corresponding to the version deviation from an update database of the application stored in the cloud; an application updating unit, configured to update the application to the second application version based on the incremental update file; The updating device of the application program is applied to the server; The update request response unit is also used for: Determine all third application versions that have been released by the application; each of the third application versions is associated with corresponding application update content; Based on the application update content, respectively determine the application objects that need to be updated when updating from the third application version to the second application version, including: determining the intermediate versions between any third application version and the second application version, and based on the application update content corresponding to the third application version and all the intermediate versions, determine all the application objects that need to be updated, cluster and integrate all the updated application objects, and determine all the application objects that need to be updated when updating from the third application version to the second application version, including: identifying the application objects that have been updated in multiple different intermediate versions as the same application object, and determining the object update content of the application object between different intermediate versions; the application objects include objects displayed in the application program; According to a plurality of intermediate update data packets between the third application version and the second application version, respectively determine the update code content of each application object; each of the update code contents is associated with the version number of the intermediate version; the intermediate version is the version from the third application version to the second application version; Based on the version number, all the update code contents are imported into the object update simulation program to generate the target update code of the application object in the process of updating from the third application version to the second application version, including: according to the order of the version numbers, the update codes of the application object in different intermediate versions are sequentially imported into the object update simulation program to simulate the corresponding sequential update of the application object in the process of changing the intermediate versions, so as to generate the target update code corresponding to the direct update from the third application version to the second application version; Generate a candidate incremental file for updating from the third application version to the second application version according to the target update code of all the application objects corresponding to the third application version; Based on the third application version corresponding to all the candidate incremental files, a version update index of the application is generated; the version update index is used to search for the incremental update file based on the first application version; the version update index records all the application objects that need to be updated during the update from the third application version to the second application version; The update request carries the update mode of the terminal; The extracting, based on the version deviation between the current second application version of the application and the first application version, an incremental update file corresponding to the version deviation from an update database of the application stored in the cloud, comprises: If the update mode is the first update mode, all first application objects corresponding to the first application version are determined according to the version update index; the first update mode is an update mode when the storage occupancy rate of the terminal is less than a preset occupancy ratio; generating the incremental update file of the first application version based on the target update codes of all the first application objects; If the update mode is the second update mode, multiple historical usage records of the application installed on the terminal are obtained; the second update mode is an update mode when the storage occupancy rate of the terminal is greater than or equal to the occupancy ratio; the historical usage record carries the usage time information of the user using the application and the operation object information initiated by the user; Calculating an update weight index of each application object in the application based on the operation objects in the plurality of historical usage records; Selecting a second application object from all the application objects based on the updated weight index; generating the incremental update file of the first application version based on the target update codes of all the second application objects; The step of calculating the update weight index of each application object in the application based on the operation objects in the plurality of historical usage records includes: Determining a preset weighting coefficient of a storage space corresponding to the terminal according to the storage occupancy rate; Calculate a usage weight value of each application object based on the corresponding operation duration in the historical usage record and the application object associated with the operation object; Calculating the capacity weight value of each application object according to the target update code and the preset weight coefficient of each application object; Obtaining a list of applications installed in the terminal, and calculating a function replacement weight value of each application object based on the usage frequency of other applications in the application list that are functionally associated with the application program; The update weight index of the application object is calculated based on the function replacement weight value, the usage weight value, and the capacity weight value.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
