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

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

Info

Publication number
CN111142922A
CN111142922A CN201811303291.6A CN201811303291A CN111142922A CN 111142922 A CN111142922 A CN 111142922A CN 201811303291 A CN201811303291 A CN 201811303291A CN 111142922 A CN111142922 A CN 111142922A
Authority
CN
China
Prior art keywords
file
source
target
repair code
executable file
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.)
Granted
Application number
CN201811303291.6A
Other languages
Chinese (zh)
Other versions
CN111142922B (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 program updating method and device, a terminal and a server. Comparing a source installation package and 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, repairing the at least one source executable file by using the at least one repair code by the application program based on the corresponding relation so as to obtain at least one target executable file, and optimizing the at least one target executable file simultaneously. The technical scheme provided by the embodiment of the application shortens the optimization time and improves the repair efficiency.

Description

Application program updating method and 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 an App (application) is online, if there is a bug (fault), the App needs to be updated, and in the traditional version updating mode, a new version of App installation package needs to be reissued and actively downloaded and installed by a user, so that the cost is high and the update is not timely, and therefore, at present, for an App realized based on Android (Android), a hot repair technology is generally adopted for updating.
The App installation package comprises an executable file of the App, the App has bugs, and usually, codes in the executable file have problems, so that the App is subjected to hot repair, namely, the codes of the executable file are repaired. And the executable file in the installation package of the Android-implemented App is a dex (one file type) file. In order to accelerate the starting speed of the App, dex file optimization is performed when the installation package is installed for the first time, and the obtained optimized file is loaded into a memory, so that the operation can be directly performed.
The existing hot repair technology is that a differential packet is generated by comparing a new installation packet and an old installation packet, the differential packet 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 integrally replaces the source dex file, and then integrally optimizes the merged file to achieve the purpose of repair.
However, in the existing hot repair technology, the merged file is usually large, so that the optimization time is long, and the repair efficiency is influenced.
Disclosure of Invention
The embodiment of the application provides an application program updating method, an application program updating device, a terminal and a server, and is used for solving the problem of repair efficiency in the prior art.
In a first aspect, an embodiment of the present application provides an application program updating method, including:
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;
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 updating 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 and 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 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 to obtain at least one optimized file.
In a third aspect, an embodiment of the present application provides an application program updating method, including:
comparing the source APK with the target APK, and determining at least one repair code and the 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 issuing 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 updating 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 APK and a 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 corresponding relation 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 updating 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 generating 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 can repair 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 optimize the at least one target executable file.
In a sixth aspect, an embodiment of the present application provides an application updating apparatus, including:
the patch acquisition module is used for determining 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 and 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, configured to repair 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 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, an embodiment of the present application provides a server, including a processing component and a storage component;
the storage component stores one or more computer instructions; the one or more computer instructions to be invoked for execution by the processing component;
the processing component is to:
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;
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 to be invoked for execution by the processing component;
the processing component is 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 and 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 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 to obtain at least one optimized file.
In the embodiment of the application, the server compares the source installation package and the target installation package, and 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, so that the at least one target executable file can be optimized simultaneously. Because the source executable file can be directly repaired based on the corresponding relation without being combined with the source executable file and then repaired, at least one target executable file can be optimized simultaneously 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, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart illustrating one embodiment of an application update method provided herein;
FIG. 2 is a flow chart illustrating a further embodiment of an application update method provided herein;
FIG. 3 is an interactive diagram illustrating another embodiment of an application update method provided by the present application;
FIG. 4 is a schematic diagram illustrating an embodiment of an application update apparatus provided in the present application;
FIG. 5 is a schematic diagram illustrating an embodiment of a server provided by the present application;
FIG. 6 is a schematic diagram illustrating an application update apparatus according to another embodiment of the present application;
fig. 7 is a schematic structural diagram illustrating an embodiment of a terminal provided in the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the 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 above-described figures, a number of operations are included that occur in a particular order, but it should be clearly understood that these operations may be performed out of order or in parallel as they occur herein, the number of operations, e.g., 101, 102, etc., merely being used to distinguish between various operations, and the number itself does not represent any order of performance. Additionally, 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", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
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 is an App realized based on Android.
Taking an App implemented based on Android as an example, as described in the background art, in the current thermal repair technology, a delta packet obtained by comparing a source APK (Android Package) and a target APK is issued to the App as a patch file, 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 purpose of repair. The source APK is also an old App, the target APK is a new APK, the hot repair technology is to repair the dex file in the source APK without downloading the target APK, and the purpose of obtaining the target dex file in the target APK is achieved. The delta package of the source APK and the target APK is 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 the existing hot repair technology needs to merge the patch file and the source dex file to obtain a complete file, the merged file is large, so that the optimization time is long, and the repair efficiency is affected. Especially, in a Multidex environment, merged files not only occupy a larger memory, but also have longer optimization time, and the repair efficiency is seriously affected.
In the embodiment of the present application, a server compares a source installation package and a target installation package, determines not only at least one repair code, but also further determines a correspondence between the at least one repair code and at least one source executable file included in the source installation package, so that a generated patch file includes not only the at least one repair code but also the correspondence; 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, and therefore the at least one target executable file can be optimized simultaneously. Because the source executable file can be directly repaired based on the corresponding relation and is not required to be repaired after being merged with the source executable file, at least one obtained target executable file is also the corresponding executable file in the target installation package, and therefore, the at least one target executable file can be optimized simultaneously in parallel.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart of an embodiment of an application program updating method provided in an embodiment 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.
The source installation package refers to a downloaded installation package, and the source installation package may include one or more source executable files, that is, source executable files already stored in the application program.
The target installation package is 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 comparing the source installation package and the target installation package in a differentiation manner, the difference information between 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 addition, in the embodiment of the present application, based on the comparison result, a correspondence between the at least one repair code and at least one source executable file included in the source installation package may also be determined.
The corresponding relationship may also include the code identifier of each repair code and the file identifier of the source executable file corresponding to the code identifier. Based on the correspondence, it may be determined which source executable file each repair code is to repair.
In practical applications, classes are stored in the executable file, and each repair code is also a class to replace the class in which the bug (fault) occurs in the source executable file.
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 corresponding relationship, so that the application program can directly use the corresponding relationship to repair the at least one source executable file in the source installation package by using the at least one repair code, thereby obtaining at least one target executable file in the source installation package after the repair, where the at least one target executable file is an executable file that has been repaired, and therefore, parallel optimization can be performed, that is, the at least one target executable file is simultaneously optimized, so as to shorten the optimization time and improve the repair efficiency.
Compared with the merged files in the prior art, including the patch file and the source executable file, the source executable file is not repaired, and needs to be repaired simultaneously during optimization, and the merged file is very large, so that the optimization time is long.
Fig. 2 is a flowchart of an application updating method according to another embodiment of the present application, and this embodiment describes a technical solution in detail from the perspective of an application. The method can specifically comprise the following steps:
201: and determining 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 and 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 obtaining of the patch file may be specifically described in the above embodiments, and is not described herein again.
202: and repairing the at least one source executable file by utilizing 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 the source executable file with the bug and a source executable file without the bug.
In this embodiment, the patch file includes not only the at least one repair code but also the corresponding relationship, so that the application program can directly use the corresponding relationship to repair the at least one source executable file in the source installation package by using the at least one repair code, thereby obtaining at least one target executable file in the source installation package after the repair, where the at least one target executable file is an executable file that has been repaired, and therefore, parallel optimization can be performed, that is, the at least one target executable file is simultaneously optimized, so as to shorten the optimization time and improve the repair efficiency.
And after the at least one optimized file is obtained, the at least one optimized file can be executed after being loaded into the memory.
Thus, in some embodiments, after the optimizing the at least one target executable file simultaneously and obtaining at least one optimized file, the method further comprises:
and loading the at least one optimization file into a memory.
In an Android application scene, the executable file is a dex file, so that in order to accelerate the starting speed of an application program, an executable file can be extracted from an 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 can be realized by executing dex2 at (the dex file is converted into an at file), and the obtained optimized file is the at file, wherein the dex and the at are both file types. The dex file is optimized into the oat file through the dex2oat, and the generated oat file is expanded by about 3 times compared with the dex file, that is, one dex file is optimized into 3 oat files, so that the number of the obtained optimized files is large.
In the prior art, because the merged file is optimized, the obtained optimized file may be large, and the loading time is also long, in this embodiment of the present application, in order to further optimize the loading time, in some embodiments, the loading the at least one optimized file into the memory includes:
and simultaneously loading the at least one optimization file into a memory.
In practical applications, after obtaining the optimized file, because the current application program is started and run, and the optimized file is loaded into the memory when the application program is started, and cannot be loaded continuously, in some embodiments, the loading the at least one optimized file into the memory at the same time includes:
and simultaneously loading the at least one optimization file into the memory when the next startup is carried out.
That is, when the application program is started each time, the unloaded optimized file can be searched, and the unloaded optimized file is loaded to the memory. And if the optimization file does not exist, executing optimization operation and optimizing the executable file of the source installation package.
In addition, in an Android application scenario, the dex file may not be optimized by adopting dex2oat, but the dex file is optimized to be an odex file, and the odex file may also be a file that can be run by an Android system, so that the obtained optimized file may be specifically the odex file.
It should be noted that, what kind of optimized file is specifically optimized for the dex file, and the specific optimization process are the same as the prior art, and this application does not specifically limit this. Any optimization scheme implemented in a parallel manner by using the embodiments of the present application is within the scope of the embodiments of the present application.
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 the repair of the source executable file with the bug and a source executable file without the bug.
Repairing the at least one source executable file using the at least one repair code may refer to repairing a source executable file corresponding to each of the at least one repair code in the at least one source executable file.
That is, in the embodiment of the present application, the source executable file having the bug in the source installation package is repaired by using the at least one repair code, the source executable file in the source installation package after being repaired is used as the target executable file, and the target executable file may include one or more target executable files according to different actual application scenarios.
As an optional way, the 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 copied file with the at least one repair code based on the correspondence;
and writing the at least one copied file after repair into the source installation package to replace the at least one source executable file respectively as a target executable file.
Optionally, based on the correspondence, repairing the at least one copy file by using the at least one repair code may be based on the correspondence, and repairing the copy file of each corresponding source executable file by using the at least one repair code, so that the repaired at least one copy file includes the copy file in which the bug exists and which is repaired, and the copy file in which the bug does not exist.
In the optional manner, at least one source executable file included in the source installation package is firstly copied respectively to obtain at least one copy file, so that the at least one copy file is repaired, and then all source executable files in the source installation package are replaced by the repaired at least one copy file as a whole, so as to achieve the purpose of repairing.
In an Android application scene, the optional mode may be applicable to an Android system that runs ART (an application running mode for an Android platform). It will be understood by those skilled in the ART that, before writing at least one target executable file into the source installation package in the ART mode, necessary operations such as code inlining and the like for satisfying ART running may be performed, and will not be described in detail herein.
As another alternative, the repairing, based on the correspondence relationship, the at least one source executable file by using the at least one repair code 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 relationship;
copying the 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 by using the at least one repair code;
and writing the copy file corresponding to each repaired at least one repair code into the source installation package to replace the source executable file corresponding to each repaired at least one repair code, and obtaining at least one target executable file obtained again in the source installation package.
In the optional manner, only the source executable file with bug in the source installation package is copied, that is, the source executable files corresponding to the at least one repair code are copied, and the copy files corresponding to the at least one repair code are repaired by using the at least one repair code, so that the source executable file corresponding to the at least one repair code in the source installation package is replaced by using only the repaired copy file, thereby achieving the purpose of repairing, and the executable file of the repaired source installation package is the target executable file.
In an Android application scenario, the alternative may be applicable to an Android system running dalvik (a virtual machine for an Android platform).
In practical application, an App realized based on Android usually adopts a hot repair technology to update the App, in an Android application scene, an installation package is also an APK, an executable file is usually a dex file, and an optimized file can be an oat file or an odex file.
Therefore, as another embodiment, an embodiment of the present application further provides an application program updating method, including:
comparing the source APK with the target APK, and determining at least one repair code and the 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 issuing 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 another embodiment, an embodiment of the present application further provides an application program updating 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 APK and a 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 corresponding relation 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 App realized based on Android as an example, as shown in fig. 3, the application program updating method provided by the embodiment of the application may include:
301: the server compares the source APK with the target APK, and determines at least one repair code and the corresponding relation between the at least one repair code and at least one source dex file contained in the source APK;
302: generating a patch file according to the at least one repair code and the corresponding relation by the service degree;
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 to obtain at least one target dex file;
305: and simultaneously optimizing the at least one target dex file by the application program to obtain at least one optimized file.
Wherein, one target dex file can be optimized to obtain one or more optimized files.
306: and when the application program is started next time, loading the at least one optimized file into the memory simultaneously.
That is, after the at least one optimized file is obtained and the application program is restarted, the optimized file can be loaded into the memory to run, so as to achieve the aim of repairing,
in some embodiments, said repairing, based on the correspondence, the at least one source dex file with the at least one repair code 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 copied file;
repairing the at least one copied file with the at least one repair code based on the correspondence;
and respectively taking the at least one copied file after being repaired 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, said repairing, based on the correspondence, the at least one source dex file with the at least one repair code 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 by using the at least one repair code;
and writing the copy file corresponding to the repaired at least one repair code into the source installation package to replace the source dex file corresponding to the at least one repair code, so as to obtain at least one target dex file obtained in the source installation package again.
Fig. 4 is a schematic structural diagram of an embodiment of an application updating apparatus according to 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 corresponding relationship between the at least one repair code and at least one source executable file included in the source installation package;
a patch generating module 402, configured to generate a patch file according to the at least one repair code and the corresponding relationship;
a patch issuing module 403, 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 simultaneously optimizes the at least one target executable file.
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 scene, 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 included in the source APK;
the patch generating 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 correspondence, so as to obtain at least one target dex file, and simultaneously optimize the at least one target dex file.
The application updating apparatus shown in fig. 4 can execute the application updating method shown in the embodiment shown in fig. 1, and the implementation principle and the technical effect are not described again. The specific manner in which each module and unit of the application updating apparatus in the above embodiments perform operations has been described in detail in the embodiments related to the method, and will not be described in detail herein.
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 stores one or more computer instructions, wherein the one or more computer instructions are invoked for execution by the processing component 502.
The processing component 502 is configured to:
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;
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.
The processing component 502 may include one or more processors executing computer instructions to perform all or part of the steps of the method described above. Of course, the processing elements 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, micro-controllers, microprocessors or other electronic components configured to perform the above-described methods.
The storage component 501 is configured to store various types of data to support operations at the server. The memory components may be implemented by any type or combination of volatile or non-volatile 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 disks.
Of course, the server may of course also comprise other components, such as input/output interfaces, communication components, etc.
The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a computer, the application updating method of the embodiment shown in fig. 1 may be implemented.
Fig. 6 is a schematic structural diagram of an embodiment of an application updating apparatus according to an embodiment of the present application, where the apparatus may include:
a patch obtaining module 601, configured to determine 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 and 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 by using the at least one repair code based on the correspondence relationship to obtain at least one target executable file;
the file optimization module 603 is configured to optimize the at least one target executable file simultaneously to obtain at least one optimized file.
As an optional way, 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 copied file with the at least one repair code based on the correspondence;
and writing the at least one copied file after repair into the source installation package to replace the at least one source executable file respectively as a target executable file.
As another optional way, 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 relationship;
copying the 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 by using the at least one repair code;
and writing the copy file corresponding to the repaired at least one repair code into the source installation package to replace the source executable file corresponding to the repaired at least one repair code, so as to obtain at least one target executable file obtained again in 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 optimized file into the memory at the same time.
In some embodiments, the loading module may specifically load the at least one optimized file into the memory at the same time when the next boot is performed.
The application updating apparatus shown in fig. 6 can execute the application updating method shown in the embodiment shown in fig. 2, and the implementation principle and the technical effect are not described again. The specific manner in which each module and unit of the application updating apparatus in the above embodiments perform operations has been described in detail in the embodiments related to the method, and will not be described in detail herein.
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 the processing component 702 to invoke for execution.
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 and 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 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 to obtain at least one optimized file.
Among other things, the processing component 702 may include one or more processors to execute computer instructions to perform all or some of the steps of the methods described above. Of course, the processing elements 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, micro-controllers, microprocessors or other electronic components configured to perform the above-described methods.
The storage component 701 is configured to store various types of data to support operations at the terminal. The memory components may be implemented by any type or combination of volatile or non-volatile 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 disks.
Of course, the terminal may of course also comprise other components, such as input/output interfaces, communication components, etc.
An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a computer, the application updating method of the embodiment shown in fig. 2 may be implemented.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (14)

1. An application program update method, comprising:
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;
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.
2. The method of claim 1, wherein the correspondence comprises a code identification of each repair code and a file identification of its corresponding source executable.
3. An application program 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 and 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 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 to obtain at least one optimized file.
4. The method of claim 3, wherein repairing the at least one source executable file with the at least one repair code to obtain at least one target executable file based on the correspondence 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 copied file with the at least one repair code based on the correspondence;
and writing the at least one copied file after repair into the source installation package to replace the at least one source executable file respectively as a target executable file.
5. The method of claim 3, wherein the 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 relationship;
copying the 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 by using the at least one repair code;
and writing the copy file corresponding to the repaired at least one repair code into the source installation package to replace the source executable file corresponding to the repaired at least one repair code, so as to obtain at least one target executable file obtained again in the source installation package.
6. The method of claim 3, wherein the optimizing the at least one target executable file simultaneously, after obtaining at least one optimized file, the method further comprises:
and loading the at least one optimization file into a memory.
7. The method of claim 6, wherein loading the at least one optimized file into memory comprises:
and simultaneously loading the at least one optimization file into a memory.
8. The method of claim 7, wherein the loading the at least one optimized file into memory simultaneously comprises:
and simultaneously loading the at least one optimization file into the memory when the next startup is carried out.
9. An application program update method, comprising:
comparing the source APK with the target APK, and determining at least one repair code and the 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 issuing 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.
10. An application program 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 APK and a 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 corresponding relation 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.
11. An application program update 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 patch generating 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 can repair 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 optimize the at least one target executable file.
12. An application program update apparatus, comprising:
the patch acquisition module is used for determining 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 and 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, configured to repair 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 the file optimization module is used for simultaneously optimizing the at least one target executable file to obtain at least one optimized file.
13. 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 to be invoked for execution by the processing component;
the processing component is to:
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;
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.
14. 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 to be invoked for execution by the processing component;
the processing component is 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 and 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 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 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 true CN111142922A (en) 2020-05-12
CN111142922B 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)

Cited By (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
CN114610516A (en) * 2022-03-10 2022-06-10 北京字节跳动网络技术有限公司 Application program repairing method and device, computer equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050055686A1 (en) * 2003-09-08 2005-03-10 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
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

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050055686A1 (en) * 2003-09-08 2005-03-10 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
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

Cited By (4)

* 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
CN114610516A (en) * 2022-03-10 2022-06-10 北京字节跳动网络技术有限公司 Application program repairing method and device, computer equipment and storage medium
CN114610516B (en) * 2022-03-10 2023-07-04 抖音视界有限公司 Application program repairing method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111142922B (en) 2023-04-25

Similar Documents

Publication Publication Date Title
US10656936B2 (en) Systems and methods for software integrity validation using blockchain
US10019256B2 (en) Systems and methods for incremental software development
US10642596B2 (en) Embedded device and program updating method
US9027014B2 (en) Updating firmware compatibility data
US8423991B2 (en) Embedded network device and firmware upgrading method
US11017091B2 (en) Firmware map data
JP2021002317A (en) Method, apparatus, device and storage medium for upgrading application
CN104915595B (en) Cloud platform virtualizes the method and device of loophole reparation
CN105446712B (en) Application program defect repairing method and device
US20110320794A1 (en) Flash System And Method For Updating The Flash System
CN111142922B (en) Application program updating method, device, terminal and server
CN105677415A (en) Hot updating method and device
TW201502974A (en) Extensible firmware abstraction
CN105786537A (en) Hot patch realization method and device
US20210311711A1 (en) Desired state model for managing lifecycle of virtualization software
US20210311717A1 (en) Desired state model for managing lifecycle of virtualization software
CA3155732A1 (en) Business process configuring method, business request processing method, and devices
CN109688472A (en) Upgrading TV system method, apparatus, equipment and storage medium
CN109375953B (en) Operating system starting method and device
CN105677409A (en) System upgrading method and device
CN112835601A (en) Firmware updating method, device, equipment and storage medium
US20130173527A1 (en) Life Cycle Management Of Rule Sets
CN110716723A (en) Firmware upgrading method and system
CN111949290B (en) Hot patch management method and device, electronic equipment and storage medium
CN114924742A (en) Hot patch making and applying method and device for virtual machine simulation software

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