CN111142922B - Application program updating method, device, terminal and server - Google Patents

Application program updating method, device, terminal and server Download PDF

Info

Publication number
CN111142922B
CN111142922B CN201811303291.6A CN201811303291A CN111142922B CN 111142922 B CN111142922 B CN 111142922B CN 201811303291 A CN201811303291 A CN 201811303291A CN 111142922 B CN111142922 B CN 111142922B
Authority
CN
China
Prior art keywords
file
source
target
executable file
repair code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811303291.6A
Other languages
Chinese (zh)
Other versions
CN111142922A (en
Inventor
李龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201811303291.6A priority Critical patent/CN111142922B/en
Publication of CN111142922A publication Critical patent/CN111142922A/en
Application granted granted Critical
Publication of CN111142922B publication Critical patent/CN111142922B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides an application program updating method, device, terminal and server. Determining at least one repair code and a corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package by comparing the source installation package with the target installation package; generating a patch file according to the at least one repair code and the corresponding relation; and the patch file is issued to an application program, and the application program repairs the at least one source executable file by utilizing the at least one repair code based on the corresponding relation so as to obtain at least one target executable file, and optimizes the at least one target executable file at the same time. The technical scheme provided by the embodiment of the application shortens the optimization time and improves the repair efficiency.

Description

Application program updating method, device, terminal and server
Technical Field
The embodiment of the application relates to the technical field of computer application, in particular to an application program updating method, an application program updating device, a terminal and a server.
Background
After App (application program) is online, if bug exists, the App needs to be updated, but in the traditional version updating mode, a new version App installation package needs to be reissued and is actively downloaded and installed by a user, so that the cost is high and the update is not timely, and currently, the App realized based on Android (Android) is generally updated by adopting a thermal repair technology.
The App installation package comprises an executable file of the App, and the App has a bug, and usually, a code in the executable file has a problem, so that the App is subjected to hot repair, namely, the code of the executable file is repaired. And an executable file in an installation package of an App based on Android implementation is a dex (a file type) file. In order to accelerate the starting speed of the App, the dex file is optimized when the installation package is installed for the first time, and the obtained optimized file is loaded into the memory, so that the installation package can be directly operated.
The existing thermal repair technology is that a difference package is generated by comparing a new installation package with an old installation package, the difference package is issued to an App as a patch file, the App merges the patch file with an old dex file in the App, namely, a source dex file, then the source dex file is replaced integrally, and then the combined file is optimized integrally, so that the purpose of repair is achieved.
However, in the existing thermal repair technology, the merged file is usually larger, so that the optimization time is longer, and the repair efficiency is affected.
Disclosure of Invention
The embodiment of the application provides an application program updating method, device, terminal and server, which are used for solving the problem of repairing efficiency in the prior art.
In a first aspect, an embodiment of the present application provides an application program update method, including:
Comparing a source installation package with a target installation package, and determining at least one repair code and a corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package;
generating a patch file according to the at least one repair code and the corresponding relation;
and issuing the patch file to an application program so that the application program repairs the at least one source executable file by using the at least one repair code based on the corresponding relation to obtain at least one target executable file, and simultaneously optimizing the at least one target executable file.
In a second aspect, an embodiment of the present application provides an application program update method, including:
determining a patch file issued by a server; the patch file is generated according to at least one repair code obtained by comparing a source installation package with a target installation package and the corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package;
repairing the at least one source executable file with the at least one repair code based on the correspondence to obtain at least one target executable file;
And simultaneously optimizing the at least one target executable file to obtain at least one optimized file.
In a third aspect, an embodiment of the present application provides an application program update method, including:
comparing a source APK with a target APK, and determining at least one repair code and a corresponding relation between the at least one repair code and at least one source dex file contained in the source APK;
generating a patch file according to the at least one repair code and the corresponding relation;
and sending the patch file to an application program so that the application program repairs the at least one source dex file by using the at least one repair code based on the corresponding relation to obtain at least one target dex file, and simultaneously optimizing the at least one target dex file.
In a fourth aspect, an embodiment of the present application provides an application program update method, including:
determining a patch file issued by a server; the patch file is generated according to at least one repair code obtained by comparing the source APK and the target APK and the corresponding relation between the at least one repair code and at least one source dex file contained in the source APK;
Repairing the at least one source dex file by using the at least one repair code based on the correspondence to obtain at least one target dex file;
and simultaneously optimizing the at least one target dex file to obtain at least one optimized file.
In a fifth aspect, an embodiment of the present application provides an application update apparatus, including:
the comparison module is used for comparing the source installation package with the target installation package and determining at least one repair code and the corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package;
the patch generation module is used for generating a patch file according to the at least one repair code and the corresponding relation;
and the patch issuing module is used for issuing the patch file to an application program so that the application program repairs the at least one source executable file by utilizing the at least one repair code based on the corresponding relation to obtain at least one target executable file and simultaneously optimizes the at least one target executable file.
In a sixth aspect, an embodiment of the present application provides an application update apparatus, including:
The patch acquisition module is used for determining patch files issued by the server; the patch file is generated according to at least one repair code obtained by comparing a source installation package with a target installation package and the corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package;
the patch repair module is used for repairing the at least one source executable file by utilizing the at least one repair code based on the corresponding relation so as to obtain at least one target executable file;
and the file optimization module is used for simultaneously optimizing the at least one target executable file to obtain at least one optimized file.
In a seventh aspect, in an embodiment of the present application, a server is provided, including a processing component and a storage component;
the storage component stores one or more computer instructions; the one or more computer instructions are to be invoked for execution by the processing component;
the processing assembly is configured to:
comparing a source installation package with a target installation package, and determining at least one repair code and a corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package;
Generating a patch file according to the at least one repair code and the corresponding relation;
and issuing the patch file to an application program so that the application program repairs the at least one source executable file by using the at least one repair code based on the corresponding relation to obtain at least one target executable file, and simultaneously optimizing the at least one target executable file.
In an eighth aspect, an embodiment of the present application provides a terminal, including a processing component and a storage component;
the storage component stores one or more computer instructions; the one or more computer instructions are to be invoked for execution by the processing component;
the processing assembly is configured to:
determining a patch file issued by a server; the patch file is generated according to at least one repair code obtained by comparing a source installation package with a target installation package and the corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package;
repairing the at least one source executable file with the at least one repair code based on the correspondence to obtain at least one target executable file;
And simultaneously optimizing the at least one target executable file to obtain at least one optimized file.
In the embodiment of the application, the server compares the source installation package with the target installation package, not only determines at least one repair code, but also further determines the corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package, so that the generated patch file not only comprises the at least one repair code but also comprises the corresponding relation; and the application program directly repairs the at least one source executable file by using the at least one repair code according to the corresponding relation so as to obtain at least one target executable file, thereby simultaneously optimizing the at least one target executable file. Because the source executable file can be directly repaired based on the corresponding relation, the source executable file does not need to be repaired after being combined with the source executable file, at least one target executable file can be simultaneously optimized in parallel, the optimization time is shortened, and the repair efficiency is improved.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief description will be given below of the drawings that are needed in the embodiments or the prior art descriptions, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 illustrates a flow chart of one embodiment of an application update method provided herein;
FIG. 2 illustrates a flow chart of yet another embodiment of an application update method provided herein;
FIG. 3 is an interactive schematic diagram of another embodiment of an application update method provided herein;
FIG. 4 is a schematic diagram illustrating one embodiment of an application update apparatus provided herein;
FIG. 5 illustrates a schematic diagram of one embodiment of a server provided herein;
FIG. 6 is a schematic structural diagram of another embodiment of an application update apparatus provided in the present application;
fig. 7 is a schematic structural diagram of an embodiment of a terminal provided in the present application.
Detailed Description
In order to enable those skilled in the art to better understand the present application, the following description will make clear and complete descriptions of the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application.
In some of the flows described in the specification and claims of this application and in the foregoing figures, a number of operations are included that occur in a particular order, but it should be understood that the operations may be performed in other than the order in which they occur or in parallel, that the order of operations such as 101, 102, etc. is merely for distinguishing between the various operations, and that the order of execution is not by itself represented by any order of execution. In addition, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first" and "second" herein are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, and are not limited to the "first" and the "second" being different types.
The technical scheme of the embodiment of the application is mainly used in a scene of performing hot repair on an App (application), and particularly the App based on Android implementation.
Taking an App implemented based on Android as an example, as described in the background technology, in the current thermal repair technology, a difference Package obtained by comparing a source APK (Android Package) and a target APK is used as a patch file to be issued to the App, the App merges the patch file with a source dex (a file type) file in the source APK, and replaces the source dex file with the merged file as a whole, so that the merged file is optimized as a whole to achieve the repair purpose. The source APK is the old App, the target APK is the new APK, the target APK is not required to be downloaded by a thermal repair technology, and the target dex file in the target APK is obtained by repairing the dex file in the source APK. The difference packet between the source APK and the target APK is the difference information of the target dex file in the target APK compared with the source dex file of the source APK, and the difference information is used as a repair code to repair the source dex file in the source APK.
Because of the existing thermal repair technology, a complete file is obtained by combining the patch file and the source dex file, and because the combined file is larger, the optimization time is longer, so that the repair efficiency is affected. Particularly, in a multi-dex (multi-dex) environment, the combined file occupies larger memory, the optimization time is longer, and the repair efficiency is seriously affected.
In order to improve the repair efficiency, the inventor proposes a technical scheme of an embodiment of the application through a series of researches, in the embodiment of the application, a server compares a source installation package and a target installation package, not only determines at least one repair code, but also further determines a corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package, so that a generated patch file not only comprises the at least one repair code, but also comprises the corresponding relation; after the application program obtains the patch file, the at least one source executable file can be directly repaired by using the at least one repair code according to the corresponding relation so as to obtain at least one target executable file, so that the at least one target executable file can be optimized at the same time. Because the source executable file can be directly repaired based on the corresponding relation, the source executable file is not required to be repaired after being combined with the source executable file, the obtained at least one target executable file is the corresponding executable file in the target installation package, and therefore the at least one target executable file can be optimized simultaneously in parallel, compared with the combined file, the optimization time can be greatly shortened, and the repair efficiency is improved.
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Fig. 1 is a flowchart of one embodiment of an application program updating method provided in the embodiments of the present application, where the method may include the following steps:
101: and comparing the source installation package with the target installation package, and determining at least one repair code and the corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package.
A source installation package refers to a downloaded installation package, and a source installation package may include one or more source executables, i.e., source executables stored within an application.
The target installation package refers to an installation package after updating, and the target installation package does not need to be downloaded and installed by adopting a hot repair technology and comprises one or more target executable files.
By performing differential comparison on the source installation package and the target installation package, differential information of at least one target executable file in the target installation package and at least one source executable file in the source installation package can be obtained, and at least one repair code is obtained, wherein the at least one repair code is used for repairing the at least one source executable file in the source installation package.
In the embodiment of the application, based on the comparison result, a corresponding relationship between the at least one repair code and at least one source executable file contained in the source installation package may also be determined.
The correspondence may also include a code identifier of each repair code and a file identifier of a corresponding source executable file. Based on the correspondence, it is possible to determine which source executable file each repair code uses to repair.
In practical application, the class is stored in the executable file, and each repair code is a class, so that the class with bug in the source executable file is replaced.
102: and generating a patch file according to the at least one repair code and the corresponding relation.
103: and issuing the patch file to an application program so that the application program repairs the at least one source executable file by using the at least one repair code based on the corresponding relation to obtain at least one target executable file, and simultaneously optimizing the at least one target executable file.
In this embodiment, the patch file includes not only the at least one repair code but also the correspondence, so that an application program can directly repair at least one source executable file in a source installation package by using the correspondence, thereby obtaining at least one target executable file in the source installation package after repair, where the at least one target executable file is an executable file that has been repaired, so that the at least one target executable file can be optimized in parallel, that is, simultaneously, the at least one target executable file is optimized, so as to shorten the optimization time and improve the repair efficiency.
Compared with the combined file in the prior art, the combined file comprises the patch file and the source executable file, because the source executable file is not repaired and needs to be repaired simultaneously during optimization, and the combined file is large, the optimization time is long.
Fig. 2 is a flowchart of another embodiment of an application program updating method provided in the embodiment of the present application, where the technical solution is described in detail from the application program perspective. The method can specifically comprise the following steps:
201: and determining the patch file issued by the server.
The patch file is generated according to at least one repair code obtained by comparing the source installation package and the target installation package and the corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package.
The patch file may be obtained as described in the above embodiments, and will not be described herein.
202: and repairing the at least one source executable file by using the at least one repairing code based on the corresponding relation so as to obtain at least one target executable file.
203: and simultaneously optimizing the at least one target executable file to obtain at least one optimized file.
Wherein the at least one target executable file is composed of an executable file after repairing a source executable file with a bug and a source executable file without a bug.
In this embodiment, the patch file includes not only the at least one repair code but also the correspondence, so that an application program can directly repair at least one source executable file in a source installation package by using the correspondence, thereby obtaining at least one target executable file in the source installation package after repair, where the at least one target executable file is an executable file that has been repaired, so that the at least one target executable file can be optimized in parallel, that is, simultaneously, the at least one target executable file is optimized, so as to shorten the optimization time and improve the repair efficiency.
And simultaneously optimizing the at least one target executable file, and after obtaining at least one optimized file, loading the at least one optimized file into the memory, wherein the at least one optimized file can be executed.
Thus, in some embodiments, the optimizing the at least one target executable file simultaneously obtains at least one optimized file, and the method further includes:
and loading the at least one optimized file into a memory.
In the Android application scene, the executable file is a dex file, so that in order to accelerate the starting speed of an application program, the executable file is extracted from the APK in advance, namely, the dex file in the APK is optimized through dex to obtain an optimized file, and the optimized file can be directly operated by an Android system.
The optimization of the dex file may be achieved by executing the dex2oat (dex file to oat file, where the dex file is converted into the oat file), and the obtained optimized file is the oat file, where the dex and the oat are both file types. By optimizing the dex file to the oat file by the dex2oat, the generated oat file is generally expanded by about 3 times compared with the dex file, that is, one dex file is generally optimized to 3 oat files, which results in that the obtained optimized files are also many.
In the prior art, since the optimization is performed on the merged file, the obtained optimized file may also have a large load time, and in this embodiment of the present application, in order to further optimize the load time, in some embodiments, loading the at least one optimized file into the memory includes:
and loading the at least one optimized file into the memory at the same time.
In some embodiments, the loading the at least one optimization file into the memory at the same time includes:
and loading the at least one optimized file into the memory at the same time when the system is started next time.
That is, when the application program is started each time, the unloaded optimization file can be searched, and the unloaded optimization file is loaded to the memory. And if the optimization file does not exist, executing the optimization operation, and optimizing the executable file of the source installation package.
In addition, in the Android application scene, the dex file may be optimized to be an odex file instead of the dex2oat, and the odex file may also be an Android system executable file, so the obtained optimized file may be specifically the odex file.
It should be noted that, the method for optimizing the dex file and the optimizing process are the same as the prior art, and the present application does not limit this specifically. The optimization scheme realized by adopting the parallel mode of the embodiment of the application is within the protection scope of the embodiment of the application.
Wherein, as can be seen from the above description, the at least one target executable file completely replaces at least one source executable file in the source installation package, and the at least one target executable file is composed of an executable file after repairing the source executable file with bug and a source executable file without bug.
Repairing the at least one source executable file with at least one repair code may refer to repairing a source executable file of the at least one source executable file that corresponds to the at least one repair code, respectively.
In other words, in this embodiment of the present application, the source executable file with the bug in the source installation package is repaired by using the at least one repair code, and the source executable file in the repaired source installation package is the target executable file, where the target executable file may include one or more target executable files according to different actual application scenarios.
As an alternative, repairing the at least one source executable file with the at least one repair code based on the correspondence to obtain at least one target executable file includes:
copying the at least one source executable file contained in the source installation package to obtain at least one copy file;
repairing the at least one copy file with the at least one repair code based on the correspondence;
and respectively taking the at least one copied file after repair as a target executable file, and writing the target executable file into the source installation package to replace the at least one source executable file.
Alternatively, repairing the at least one copy file with the at least one repair code based on the correspondence may be repairing copy files of respective corresponding source executable files with the at least one repair code based on the correspondence, such that a middle level of the at least one copy file after repair specifically includes copy files after bug is present and repaired, and copy files after bug is not present.
In the alternative mode, at least one source executable file contained in the source installation package is copied to obtain at least one copy file, so that the at least one copy file is repaired, and all source executable files in the source installation package are replaced by the at least one copy file after repair, so that the purpose of repairing is achieved.
In an Android application scenario, the optional mode may be applicable to an Android system running ART (Android run, an application running mode for an Android platform). Those skilled in the ART will appreciate that, before writing at least one target executable file to the source installation package in ART mode, necessary operations to satisfy ART operation, such as code inlining, may also be performed, and will not be described in detail herein.
As another alternative, repairing the at least one source executable file with the at least one repair code based on the correspondence to obtain at least one target executable file corresponding to the target installation package may include:
determining a source executable file corresponding to the at least one repair code based on the corresponding relation;
copying source executable files corresponding to the at least one repair code respectively to obtain copy files corresponding to the at least one repair code;
repairing the respective corresponding copy files using the at least one repair code;
and writing the copy files corresponding to the at least one repaired code into the source installation package to replace the source executable files corresponding to the at least one repaired code, so as to obtain at least one target executable file recovered in the source installation package.
In the alternative mode, only the source executable files with bug in the source installation package are copied, namely the source executable files corresponding to the at least one repair code are copied, and the corresponding copy files are repaired by the at least one repair code, so that the source executable files corresponding to the at least one repair code in the source installation package are replaced by the repaired copy files, the purpose of repairing is achieved, and the repaired source executable files of the source installation package are target executable files.
In an Android application scenario, the optional mode can be applied to an Android system running dalvik (a virtual machine for an Android platform).
In practical application, an App realized based on Android generally adopts a thermal repair technology to update the App, in an Android application scene, an installation package is an APK, an executable file is a dex file, and an optimization file can be an oat file or an odex file.
Thus, as yet another embodiment, an application program updating method is provided in an embodiment of the present application, including:
comparing a source APK with a target APK, and determining at least one repair code and a corresponding relation between the at least one repair code and at least one source dex file contained in the source APK;
Generating a patch file according to the at least one repair code and the corresponding relation;
and sending the patch file to an application program so that the application program repairs the at least one source dex file by using the at least one repair code based on the corresponding relation to obtain at least one target dex file, and simultaneously optimizing the at least one target dex file.
As yet another embodiment, an application program updating method is provided in an embodiment of the present application, including:
determining a patch file issued by a server; the patch file is generated according to at least one repair code obtained by comparing the source APK and the target APK and the corresponding relation between the at least one repair code and at least one source dex file contained in the source APK;
repairing the at least one source dex file by using the at least one repair code based on the correspondence to obtain at least one target dex file;
and simultaneously optimizing the at least one target dex file to obtain at least one optimized file.
Taking an App implemented based on Android as an example, as shown in fig. 3, an application program updating method provided in the embodiment of the present application may include:
301: the server compares a source APK and a target APK, and determines at least one repair code and a corresponding relation between the at least one repair code and at least one source dex file contained in the source APK;
302: the service degree generates a patch file according to the at least one repair code and the corresponding relation;
303: and the server side issues the patch file to an application program.
304: the application program repairs the at least one source dex file by using the at least one repair code based on the corresponding relation so as to obtain at least one target dex file;
305: and the application program simultaneously optimizes the at least one target dex file to obtain at least one optimized file.
Wherein, a target dex file may be optimized to obtain one or more optimized files.
306: and when the application program is started next time, the at least one optimization file is simultaneously loaded into the memory.
I.e. after at least one optimized file is obtained, the application program can be loaded into the memory for operation after restarting, thereby achieving the purpose of repairing,
in some embodiments, repairing the at least one source dex file with the at least one repair code based on the correspondence to obtain at least one target dex file may include:
Copying the at least one source dex file contained in the source APK to obtain at least one copy file;
repairing the at least one copy file with the at least one repair code based on the correspondence;
and respectively taking the at least one repaired copy file as a target dex file, and writing the target dex file into the source installation package to replace the at least one source dex file.
In some embodiments, repairing the at least one source dex file with the at least one repair code based on the correspondence to obtain at least one target dex file may include:
determining a source dex file corresponding to the at least one repair code based on the corresponding relation;
copying the source dex file corresponding to the at least one repair code respectively to obtain a copy file corresponding to the at least one repair code;
repairing the respective corresponding copy files using the at least one repair code;
writing the copy files corresponding to the at least one repaired code after repair into the source installation package to replace the source dex files corresponding to the at least one repaired code, and obtaining at least one target dex file retrieved from the source installation package.
Fig. 4 is a schematic structural diagram of an embodiment of an application program updating apparatus provided in an embodiment of the present application, where the apparatus may include:
a comparison module 401, configured to compare a source installation package and a target installation package, and determine at least one repair code and a correspondence between the at least one repair code and at least one source executable file included in the source installation package;
a patch generation module 402, configured to generate a patch file according to the at least one repair code and the correspondence;
the patch issuing module 403 is configured to issue the patch file to an application program, so that the application program repairs the at least one source executable file by using the at least one repair code based on the correspondence, so as to obtain at least one target executable file, and optimize the at least one target executable file at the same time.
The corresponding relation comprises a code identifier of each repair code and a file identifier of a corresponding source executable file.
In an Android application scenario, the comparison module is specifically configured to compare a source APK and a target APK, and determine at least one repair code and a corresponding relationship between the at least one repair code and at least one source dex file contained in the source APK;
The patch generation module is specifically configured to generate a patch file according to the at least one repair code and the corresponding relationship;
the patch issuing module is specifically configured to issue the patch file to an application program, so that the application program repairs the at least one source dex file by using the at least one repair code based on the corresponding relationship, so as to obtain at least one target dex file, and optimize the at least one target dex file at the same time.
The application updating device shown in fig. 4 may execute the application updating method described in the embodiment shown in fig. 1, and its implementation principle and technical effects are not repeated. The specific manner in which the respective modules and units of the application updating apparatus in the above-described embodiments perform operations has been described in detail in the embodiments related to the method, and will not be described in detail here.
In one possible design, the application updating apparatus of the embodiment shown in fig. 4 may be implemented as a server, which may include a storage component 501 and a processing component 502 as shown in fig. 5;
the storage component 501 includes one or more computer instructions that are invoked for execution by the processing component 502.
The processing component 502 is configured to:
comparing a source installation package with a target installation package, and determining at least one repair code and a corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package;
generating a patch file according to the at least one repair code and the corresponding relation;
and issuing the patch file to an application program so that the application program repairs the at least one source executable file by using the at least one repair code based on the corresponding relation to obtain at least one target executable file, and simultaneously optimizing the at least one target executable file.
Wherein the processing component 502 can include one or more processors to execute computer instructions to perform all or part of the steps of the methods described above. Of course, the processing component may also be implemented as one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic elements for executing the methods described above.
Storage component 501 is configured to store various types of data to support operations at a server. The memory component may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
Of course, the server may necessarily also include other components, such as input/output interfaces, communication components, and the like.
The embodiment of the application also provides a computer readable storage medium, which stores a computer program, and the computer program can implement the application program updating method of the embodiment shown in fig. 1 when being executed by a computer.
Fig. 6 is a schematic structural diagram of an embodiment of an application program updating apparatus according to an embodiment of the present application, where the apparatus may include:
the patch obtaining module 601 is configured to determine a patch file issued by the server; the patch file is generated according to at least one repair code obtained by comparing a source installation package with a target installation package and the corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package;
A patch repair module 602, configured to repair the at least one source executable file with the at least one repair code based on the correspondence, so as to obtain at least one target executable file;
the file optimizing module 603 is configured to optimize the at least one target executable file simultaneously to obtain at least one optimized file.
As an alternative, the patch repair module is specifically configured to:
copying the at least one source executable file contained in the source installation package to obtain at least one copy file;
repairing the at least one copy file with the at least one repair code based on the correspondence;
and respectively taking the at least one copied file after repair as a target executable file, and writing the target executable file into the source installation package to replace the at least one source executable file.
As another alternative, the patch repair module is specifically configured to:
determining a source executable file corresponding to the at least one repair code based on the corresponding relation;
copying source executable files corresponding to the at least one repair code respectively to obtain copy files corresponding to the at least one repair code;
Repairing the respective corresponding copy files using the at least one repair code;
and writing the copy files corresponding to the at least one repaired code into the source installation package to replace the source executable files corresponding to the at least one repaired code, so as to obtain at least one target executable file retrieved from the source installation package.
In some embodiments, the apparatus may further comprise:
and the loading module is used for loading the at least one optimized file into the memory.
Optionally, the loading module may be specifically configured to load the at least one optimization file into the memory at the same time.
In some embodiments, the loading module may specifically load the at least one optimization file into the memory at the same time when the at least one optimization file is started next time.
The application updating device shown in fig. 6 may execute the application updating method described in the embodiment shown in fig. 2, and its implementation principle and technical effects are not repeated. The specific manner in which the respective modules and units of the application updating apparatus in the above-described embodiments perform operations has been described in detail in the embodiments related to the method, and will not be described in detail here.
In one possible design, the application updating apparatus of the embodiment shown in fig. 6 may be implemented as a terminal, which may include a storage component 701 and a processing component 702 as shown in fig. 7;
the storage component 701 stores one or more computer instructions for execution by the processing component 702.
The processing component 702 is configured to:
determining a patch file issued by a server; the patch file is generated according to at least one repair code obtained by comparing a source installation package with a target installation package and the corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package;
repairing the at least one source executable file with the at least one repair code based on the correspondence to obtain at least one target executable file;
and simultaneously optimizing the at least one target executable file to obtain at least one optimized file.
Wherein the processing component 702 may include one or more processors to execute computer instructions to perform all or part of the steps in the methods described above. Of course, the processing component may also be implemented as one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic elements for executing the methods described above.
The storage component 701 is configured to store various types of data to support operations at the terminal. The memory component may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
Of course, the terminal may naturally also comprise other components, such as input/output interfaces, communication components, etc.
The embodiment of the application also provides a computer readable storage medium, which stores a computer program, and the computer program can implement the application program updating method of the embodiment shown in fig. 2 when being executed by a computer.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (13)

1. An application update method, comprising:
comparing a source installation package with a target installation package, and determining at least one repair code and a corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package;
generating a patch file according to the at least one repair code and the corresponding relation;
the patch file is issued to an application program, so that the application program repairs the at least one source executable file by utilizing the at least one repair code based on the corresponding relation to obtain at least one target executable file, and the at least one target executable file is optimized at the same time;
the corresponding relation comprises a code identifier of each repair code and a file identifier of a corresponding source executable file.
2. An application update method, comprising:
determining a patch file issued by a server; the patch file is generated according to at least one repair code obtained by comparing a source installation package with a target installation package and the corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package; the corresponding relation comprises a code identifier of each repair code and a file identifier of a corresponding source executable file;
Repairing the at least one source executable file with the at least one repair code based on the correspondence to obtain at least one target executable file;
and simultaneously optimizing the at least one target executable file to obtain at least one optimized file.
3. The method of claim 2, wherein repairing the at least one source executable file with the at least one repair code based on the correspondence to obtain at least one target executable file comprises:
copying the at least one source executable file contained in the source installation package to obtain at least one copy file;
repairing the at least one copy file with the at least one repair code based on the correspondence;
and respectively taking the at least one copied file after repair as a target executable file, and writing the target executable file into the source installation package to replace the at least one source executable file.
4. The method of claim 2, wherein repairing the at least one source executable file with the at least one repair code based on the correspondence to obtain at least one target executable file corresponding to the target installation package comprises:
Determining a source executable file corresponding to the at least one repair code based on the corresponding relation;
copying source executable files corresponding to the at least one repair code respectively to obtain copy files corresponding to the at least one repair code;
repairing the respective corresponding copy files using the at least one repair code;
and writing the copy files corresponding to the at least one repaired code into the source installation package to replace the source executable files corresponding to the at least one repaired code, so as to obtain at least one target executable file retrieved from the source installation package.
5. The method of claim 2, wherein the optimizing the at least one target executable file is performed simultaneously, and wherein after obtaining at least one optimized file, the method further comprises:
and loading the at least one optimized file into a memory.
6. The method of claim 5, wherein loading the at least one optimized file into memory comprises:
and loading the at least one optimized file into the memory at the same time.
7. The method of claim 6, wherein simultaneously loading the at least one optimized file into memory comprises:
And loading the at least one optimized file into the memory at the same time when the system is started next time.
8. An application update method, comprising:
comparing a source APK with a target APK, and determining at least one repair code and a corresponding relation between the at least one repair code and at least one source dex file contained in the source APK;
generating a patch file according to the at least one repair code and the corresponding relation;
and sending the patch file to an application program so that the application program repairs the at least one source dex file by using the at least one repair code based on the corresponding relation to obtain at least one target dex file, and simultaneously optimizing the at least one target dex file.
9. An application update method, comprising:
determining a patch file issued by a server; the patch file is generated according to at least one repair code obtained by comparing the source APK and the target APK and the corresponding relation between the at least one repair code and at least one source dex file contained in the source APK; the corresponding relation comprises a code identifier of each repair code and a file identifier of a corresponding source dex file;
Repairing the at least one source dex file by using the at least one repair code based on the correspondence to obtain at least one target dex file;
and simultaneously optimizing the at least one target dex file to obtain at least one optimized file.
10. An application updating apparatus, comprising:
the comparison module is used for comparing the source installation package with the target installation package and determining at least one repair code and the corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package; the corresponding relation comprises a code identifier of each repair code and a file identifier of a corresponding source executable file;
the patch generation module is used for generating a patch file according to the at least one repair code and the corresponding relation;
and the patch issuing module is used for issuing the patch file to an application program so that the application program repairs the at least one source executable file by utilizing the at least one repair code based on the corresponding relation to obtain at least one target executable file and simultaneously optimizes the at least one target executable file.
11. An application updating apparatus, comprising:
the patch acquisition module is used for determining patch files issued by the server; the patch file is generated according to at least one repair code obtained by comparing a source installation package with a target installation package and the corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package; the corresponding relation comprises a code identifier of each repair code and a file identifier of a corresponding source executable file;
the patch repair module is used for repairing the at least one source executable file by utilizing the at least one repair code based on the corresponding relation so as to obtain at least one target executable file;
and the file optimization module is used for simultaneously optimizing the at least one target executable file to obtain at least one optimized file.
12. A server, comprising a processing component and a storage component;
the storage component stores one or more computer instructions; the one or more computer instructions are to be invoked for execution by the processing component;
the processing assembly is configured to:
comparing a source installation package with a target installation package, and determining at least one repair code and a corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package; the corresponding relation comprises a code identifier of each repair code and a file identifier of a corresponding source executable file;
Generating a patch file according to the at least one repair code and the corresponding relation;
and issuing the patch file to an application program so that the application program repairs the at least one source executable file by using the at least one repair code based on the corresponding relation to obtain at least one target executable file, and simultaneously optimizing the at least one target executable file.
13. A terminal, comprising a processing component and a storage component;
the storage component stores one or more computer instructions; the one or more computer instructions are to be invoked for execution by the processing component;
the processing assembly is configured to:
determining a patch file issued by a server; the patch file is generated according to at least one repair code obtained by comparing a source installation package with a target installation package and the corresponding relation between the at least one repair code and at least one source executable file contained in the source installation package; the corresponding relation comprises a code identifier of each repair code and a file identifier of a corresponding source executable file;
repairing the at least one source executable file with the at least one repair code based on the correspondence to obtain at least one target executable file;
And simultaneously optimizing the at least one target executable file to obtain at least one optimized file.
CN201811303291.6A 2018-11-02 2018-11-02 Application program updating method, device, terminal and server Active CN111142922B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811303291.6A CN111142922B (en) 2018-11-02 2018-11-02 Application program updating method, device, terminal and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811303291.6A CN111142922B (en) 2018-11-02 2018-11-02 Application program updating method, device, terminal and server

Publications (2)

Publication Number Publication Date
CN111142922A CN111142922A (en) 2020-05-12
CN111142922B true CN111142922B (en) 2023-04-25

Family

ID=70516032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811303291.6A Active CN111142922B (en) 2018-11-02 2018-11-02 Application program updating method, device, terminal and server

Country Status (1)

Country Link
CN (1) CN111142922B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612502A (en) * 2020-12-23 2021-04-06 苏州三六零智能安全科技有限公司 Patch generation method, device, equipment and storage medium
CN112799690A (en) * 2021-02-01 2021-05-14 联想(北京)有限公司 Information processing method, device, equipment and storage medium
CN114610516B (en) * 2022-03-10 2023-07-04 抖音视界有限公司 Application program repairing method and device, computer equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9477461B1 (en) * 2014-03-12 2016-10-25 Cloud Linux Zug GmbH Systems and methods for generating and applying operating system live updates
CN106095502A (en) * 2016-06-13 2016-11-09 北京奇虎科技有限公司 Hot restorative procedure, device, server and the system of a kind of Android application
CN106951280A (en) * 2017-02-28 2017-07-14 努比亚技术有限公司 Mobile terminal and apply restorative procedure
CN107329781A (en) * 2017-06-21 2017-11-07 努比亚技术有限公司 The hot restorative procedure of software, terminal, system and computer-readable recording medium
CN107391107A (en) * 2017-06-12 2017-11-24 北京明朝万达科技股份有限公司 The restorative procedure and device of a kind of application program
CN107451474A (en) * 2016-05-31 2017-12-08 百度在线网络技术(北京)有限公司 Software vulnerability restorative procedure and device for terminal
CN108399080A (en) * 2018-03-05 2018-08-14 深圳市华讯方舟软件信息有限公司 A kind of hot update methods of Android App
CN108491216A (en) * 2018-03-05 2018-09-04 北京指掌易科技有限公司 A kind of method of android system unaware application installation upgrading

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7313792B2 (en) * 2003-09-08 2007-12-25 Microsoft Corporation Method and system for servicing software
US20060075001A1 (en) * 2004-09-30 2006-04-06 Canning Jeffrey C System, method and program to distribute program updates

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9477461B1 (en) * 2014-03-12 2016-10-25 Cloud Linux Zug GmbH Systems and methods for generating and applying operating system live updates
CN107451474A (en) * 2016-05-31 2017-12-08 百度在线网络技术(北京)有限公司 Software vulnerability restorative procedure and device for terminal
CN106095502A (en) * 2016-06-13 2016-11-09 北京奇虎科技有限公司 Hot restorative procedure, device, server and the system of a kind of Android application
CN106951280A (en) * 2017-02-28 2017-07-14 努比亚技术有限公司 Mobile terminal and apply restorative procedure
CN107391107A (en) * 2017-06-12 2017-11-24 北京明朝万达科技股份有限公司 The restorative procedure and device of a kind of application program
CN107329781A (en) * 2017-06-21 2017-11-07 努比亚技术有限公司 The hot restorative procedure of software, terminal, system and computer-readable recording medium
CN108399080A (en) * 2018-03-05 2018-08-14 深圳市华讯方舟软件信息有限公司 A kind of hot update methods of Android App
CN108491216A (en) * 2018-03-05 2018-09-04 北京指掌易科技有限公司 A kind of method of android system unaware application installation upgrading

Also Published As

Publication number Publication date
CN111142922A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
US10019256B2 (en) Systems and methods for incremental software development
US10642596B2 (en) Embedded device and program updating method
US9430224B2 (en) Hot-update method and apparatus
CN111142922B (en) Application program updating method, device, terminal and server
CN105677415B (en) Hot update method and device
CN104915595B (en) Cloud platform virtualizes the method and device of loophole reparation
US9027014B2 (en) Updating firmware compatibility data
CN109542415B (en) Code merging method supporting parallel research and development of application programs and related equipment
CN105786537A (en) Hot patch realization method and device
US20200034282A1 (en) Object-oriented regression-candidate filter
CA3155732A1 (en) Business process configuring method, business request processing method, and devices
US9134975B1 (en) Determining which computer programs are candidates to be recompiled after application of updates to a compiler
CN113767365A (en) Communication module software upgrading method and system and communication module
CN102592084A (en) Bug-fixing client logic testing method and bug-fixing client logic testing system
WO2020029967A1 (en) Method and apparatus for repairing fault in operating system
US11467824B2 (en) Method and system for fast building and testing software
CN109840105A (en) A kind of hot update method that do not withdraw
WO2022156512A1 (en) Method and apparatus for firmware upgrade, device, and storage medium
US8438000B2 (en) Dynamic generation of tests
CN109375953B (en) Operating system starting method and device
CN112416360B (en) Method, device and server for generating thermal patch
CN107193582B (en) Publishing method and system
CN107301105B (en) Method and device for checking hot patch or dynamic library
CN109408073B (en) Android non-invasive application repacking method
CN110928570A (en) Firmware upgrading method and device and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant