CN116594644A - Android system-based application program hot update method and device - Google Patents

Android system-based application program hot update method and device Download PDF

Info

Publication number
CN116594644A
CN116594644A CN202310500630.4A CN202310500630A CN116594644A CN 116594644 A CN116594644 A CN 116594644A CN 202310500630 A CN202310500630 A CN 202310500630A CN 116594644 A CN116594644 A CN 116594644A
Authority
CN
China
Prior art keywords
application program
version
target application
target
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.)
Pending
Application number
CN202310500630.4A
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310500630.4A priority Critical patent/CN116594644A/en
Publication of CN116594644A publication Critical patent/CN116594644A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • 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

Abstract

The application provides an android system-based application program hot updating method and device, which can be used in the financial field or other technical fields. The method comprises the following steps: when a target application program of a first version is locally operated, a target differential packet is obtained; generating and storing an installation package of the target application program of the second version according to the target differential packet and the locally stored installation package of the target application program of the first version; according to the target differential packet and the installation packet of the target application program of the second version, the mapping relation between the embedded pile component and the newly-added component and/or the mapping relation between the embedded pile process and the newly-added process in the target application program of the second version are obtained; and storing the mapping relation in a target mapping relation file. According to the android system-based application program hot updating method and device provided by the embodiment of the application, the addition and modification of four android components can be completed on the premise of ensuring smaller patches, and meanwhile, the resource consumption is ensured to be smaller.

Description

Android system-based application program hot update method and device
Technical Field
The application relates to the technical field of computers, in particular to an application program hot update method and device based on an android system.
Background
Application (APP) hot update refers to: if the APP is found to be defective after being online, if the re-running release process is likely to be longer, the user experience of re-installing the APP is not good, and at the moment, the code in the update package can be loaded when the APP is operated by releasing an update package, so that the defect is overcome, and the APP is not felt by a user.
At present, application program thermal update based on an android system adopts a class loading scheme mainly comprising a messenger system, a micro-messenger Tinker, an hungry Amigo and the like; the adopted bottom layer replacement scheme is mainly AndFix and the like of the ali system, and the Sophix scheme which combines the bottom layer replacement and the class loading mode is adopted.
However, sophix does not support repair of four large components, and Amigo supports new repair of four large components, but needs to introduce a full amount of patches, so that resources are consumed relatively, and other schemes have more serious problems compared with other schemes.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the application provides an application program hot updating method and device based on an android system, which can at least partially solve the problems in the prior art.
In one aspect, the application provides an application program hot update method based on an android system, which comprises the following steps:
when a target application program of a first version is locally operated, a target differential packet is obtained, wherein the target differential packet is generated according to an installation packet of the target application program of the first version and an installation packet of the target application program of a second version;
generating and storing an installation package of a second version of the target application program according to the target differential packet and the locally stored installation package of the first version of the target application program;
according to the target differential packet and the installation packet of the target application program of the second version, obtaining a mapping relation between an embedded pile component and a newly-added component and/or a mapping relation between an embedded pile process and the newly-added process in the target application program of the second version;
and storing the mapping relation between the embedded pile component and the newly added component and/or the mapping relation between the embedded pile process and the newly added process in a target mapping relation file.
In some embodiments, the target differential packet is generated by comparing the installation package of the first version of the target application program and the installation package of the second version of the target application program by using a target differential algorithm tool, and then generating a control file, a differential file and a new file, and compressing the control file, the differential file and the new file.
In some embodiments, the generating and saving the installation package of the second version of the target application program according to the target differential packet and the locally saved installation package of the first version of the target application program includes:
adding difference information in the installation package of the first version of target application program according to the control file and the difference file in the target difference package, and adding new information in the installation package of the first version of target application program according to the control file and the new file in the difference package to generate the installation package of the second version of target application program;
and storing the installation package of the target application program of the second version under the private directory of the target application program.
In some embodiments, after generating and saving the installation package of the second version of the target application program based on the target differential packet and the locally saved installation package of the first version of the target application program, the method further comprises:
and copying the dynamic link library file in the installation package of the target application program of the second version to the private directory of the target application program.
In some embodiments, after copying the dynamically linked library file in the installation package of the second version of the target application under the private directory of the target application, the method further comprises:
compiling an installation package of the target application program of the second version to generate an oat file which can be directly executed by the ART of the android virtual machine;
and storing the oat file under a private directory of the target application program.
In some embodiments, after storing the mapping relationship between the embedded pile component and the newly added component and/or the mapping relationship between the embedded pile process and the newly added process in a target mapping relationship file, the method further includes:
and writing a mark information for recording that the installation of the thermal update of the target application program is completed and activated in the local cache.
In some embodiments, after storing the mapping relationship between the embedded pile component and the newly added component and/or the mapping relationship between the embedded pile process and the newly added process locally, the method further comprises:
according to the starting request aiming at the target application program, checking whether the local cache has the marking information or not;
and if the local cache has the marking information, loading the installation package of the target application program of the second version.
In some embodiments, the method further comprises:
when an embedded pile component in the target application program of the second version is started, judging whether a new component with a mapping relation with the embedded pile component exists in the mapping relation file or not;
if the mapping relation file has a new component with a mapping relation with the embedded pile component, the embedded pile component is replaced by the new component for starting; and/or
When an embedded pile component in the target application program of the second version is started, judging whether a new component with a mapping relation with the embedded pile component exists in the mapping relation file or not;
and if the mapping relation file has a new process with a mapping relation with the embedded pile process, replacing the embedded pile process with the new process for starting.
On the other hand, the application provides an application program hot updating device based on an android system, which comprises the following steps:
the first acquisition module is used for acquiring a target differential packet when the target application program of the first version is locally operated, wherein the target differential packet is generated according to an installation packet of the target application program of the first version and an installation packet of the target application program of the second version;
the generation module is used for generating and storing an installation package of the target application program of the second version according to the target differential packet and the locally stored installation package of the target application program of the first version;
the second acquisition module is used for acquiring a mapping relation between the embedded pile component and the newly added component and/or a mapping relation between the embedded pile process and the newly added process in the second version of target application program according to the target differential packet and the installation packet of the second version of target application program;
and the storage module is used for storing the mapping relation between the embedded pile assembly and the newly-added assembly and/or the mapping relation between the embedded pile process and the newly-added process in a target mapping relation file.
The embodiment of the application also provides electronic equipment, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the steps of the android system-based application program hot updating method are realized when the processor executes the program.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the android system-based application program hot updating method described in any of the above embodiments.
According to the application program hot updating method and device based on the android system, the target differential packet is firstly obtained, then the second version of installation packet is locally synthesized according to the target differential packet and the first version of installation packet, finally the second version of installation packet is silently installed, and the mapping relation between the embedded pile component and the newly added component and/or the mapping relation between the embedded pile process and the newly added process are saved, so that the new addition and modification of the four android components can be completed on the premise of ensuring that patches are smaller, and meanwhile, the resource consumption is smaller. Compared with the application market update, the method can provide the traceless shortcut app update which is not required to be downloaded and installed by a user for the terminal device app update, and simultaneously reduce the flow and the memory consumption caused by the update.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. In the drawings:
fig. 1 is an overall flowchart of an application program hot update method based on an android system according to an embodiment of the present application.
Fig. 2 is a flowchart of an application hot update method based on an android system according to an embodiment of the present application.
FIG. 3 is a block diagram of new-version apk and old-version apk files provided by an embodiment of the present application.
Fig. 4 is a partial flow chart of an application program hot update method based on an android system according to an embodiment of the present application.
Fig. 5 is a partial flow chart of an application program hot update method based on an android system according to an embodiment of the present application.
Fig. 6 is a partial flow chart of an application program hot update method based on an android system according to an embodiment of the present application.
FIG. 7 is a diagram illustrating a loading process of a new activity according to an embodiment of the present application.
Fig. 8 is a schematic structural diagram of an application program hot update device based on an android system according to an embodiment of the present application.
Fig. 9 is a schematic physical structure of an electronic device according to an embodiment of the application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings. The exemplary embodiments of the present application and their descriptions herein are for the purpose of explaining the present application, but are not to be construed as limiting the application. It should be noted that, without conflict, the embodiments of the present application and features in the embodiments may be arbitrarily ordered with respect to each other.
The terms "first," "second," … …, and the like, as used herein, do not denote a particular order or sequence, nor are they intended to be limiting of the application, but rather are merely used to distinguish one element or operation from another in the same technical terms.
As used herein, the terms "comprising," "including," "having," "containing," and the like are intended to be inclusive and mean an inclusion, but not limited to.
As used herein, "and/or" includes any or all ordering of such things.
And (3) assembly: the application program component is a basic building block of an Android application program. These components are loosely coupled organized by application manifest files. AndroidManifest. Xml describes each component of an application and how they interact. Android contains four types of components, activity, service, contentProvider, broadcastReceiver respectively.
Inheritance: is a concept in object-oriented software technology. If a class B "inherits from" another class A, this B is referred to as "subclass of A" and a parent class of A as "B" may also be referred to as "A is a superclass of B". Inheritance can enable a child to have various properties and methods of the parent class without having to write the same code again. While the child class inherits the parent class, certain attributes can be redefined and certain methods are rewritten, namely the original attributes and methods of the parent class are covered, so that the child class obtains functions different from the parent class. Additionally, it is also common practice to append new attributes and methods to the subclasses. In general, static object-oriented programming languages, inheritance is static, i.e., the behavior of the subclass is already decided at compile time and cannot be extended at execution time.
Parent class: among the two classes having inheritance relationships, the inherited class is the parent class, and the inherited class is the child class.
Function instrumentation: some code is inserted or modified into some locations in the object code to obtain some program state during the running process of the object program and analyze. In a simple way, a code is inserted into the code.
hook: function hooks are designed to intercept and monitor the transmission of events before they are transmitted to the endpoint, just like the hook-on events, and to be able to handle some own specific events when they are hooked. And the proxy mode can do this exactly.
dex2oat: the dex2oat is an executable program and is used for compiling a dex file to generate an oat file which can be directly executed by the android virtual machine ART.
Androidmanifast. The application manifest, one for each application's root directory, must be included. The file contains the configuration information of the APP, and the system needs to run the APP code and display the interface according to the content in the file.
Application: a system component of the android framework creates an application object for storing some information of the system when the android program is started. Usually, we do not need to specify an Application, and the system can automatically help us to create, if own Application needs to be created, also simply create a class inheritance Application and register in the Application label of the manifest (only adding a name attribute to the Application label to place the name of own Application). an android system creates one Application class object and only one for each program run-time, so Application can be said to be a class of single instance (single) mode. Some operations such as data transfer, data sharing, data caching and the like can be performed through Application.
LoadedApk: representation of APK files in memory. Information about the Apk file, such as code and resource of the Apk file, and even information about components such as Activity in the code, can be obtained through the object.
Activity: and one of the four Android components is used for displaying interface elements and related logic flows.
ActivityManager: an important part of the android framework. It is responsible for the creation of a new actythread process, maintenance of the Activity lifecycle, and the state switching of the Activity in the management system.
Actighread: an initial class of android APP process whose main function is the entry for this APP process. The execution code segments of the UI event in the app process are all provided by ActivityThread.
In order to better understand the present application, the following describes the overall flow of the application program hot update method based on the android system provided by the present application.
The application program hot update firstly needs to generate a differential packet, the differential packet is uploaded to a server, when the terminal equipment runs the old version app, the differential packet is checked and downloaded, the new version apk is synthesized locally, then the new apk is installed in a silent mode, and when the user restarts the app, the new apk information is loaded. The overall flow is shown in fig. 1. The scheme provided by the application can be used for completing the addition and modification of four Android components, has lower realization cost and smaller transformation of application projects, and can be used for updating the app when the app small version is updated or the known problem is repaired, without uploading the full installation package of the application market, thereby realizing traceless and rapid app update.
Fig. 2 is a flow chart of an application program hot update method based on an android system according to an embodiment of the present application, as shown in fig. 2, where the application program hot update method based on an android system provided by the embodiment of the present application includes:
s101, when a target application program of a first version is locally operated, a target differential packet is obtained, wherein the target differential packet is generated according to an installation packet of the target application program of the first version and an installation packet of the target application program of a second version;
in step S101, for the target application, the second version of the target application may refer to a new version of the target application, and the first version of the target application may refer to an old version of the target application. When the terminal equipment with the android operating system locally runs the target application program of the first version, the terminal equipment checks that a new version which can be updated exists, and then downloads the target differential packet from the server. The target differential packet may be generated using a differential algorithm tool to compare an installation package of the first version of the target application with an installation package of the second version of the target application.
S102, generating and storing an installation package of a second version of target application program according to the target differential packet and the locally stored installation package of the first version of target application program;
in step S102, a second version of installation package is synthesized by using the installation package of the first version of the target application program and the target differential package as raw materials, and the second version of installation package is stored locally, for example, in a private directory/data/data/package name/files/. NewApk folder of the target application program.
S103, according to the target differential packet and the installation packet of the target application program of the second version, obtaining a mapping relation between an embedded pile component and a newly added component and/or a mapping relation between an embedded pile process and a newly added process in the target application program of the second version;
in step S103, some four component piles are added (pre-embedded) in advance in the application engineering code of the target application program for pre-preempting, so that the four component piles can be replaced in the pre-embedded pile under the condition of newly added components and processes. And after locally storing the installation package of the target application program of the second version, acquiring a newly-added component and a newly-added process in the target differential package, acquiring an embedded pile component and an embedded pile process in the installation package of the target application program of the second version, and respectively distributing corresponding embedded pile components and embedded pile processes for the newly-added component and the newly-added process to obtain a mapping relation between the embedded pile component and the newly-added component and a mapping relation between the embedded pile process and the newly-added process.
As shown in FIG. 3, for example, a space occupying active component (Activity) B is pre-embedded in the application engineering code, and an active component A is actually added, then the relationship between A and B is recorded, so that the A can be replaced by B for practical use in the subsequent loading process.
S104, storing the mapping relation between the embedded pile component and the newly added component and/or the mapping relation between the embedded pile process and the newly added process in a target mapping relation file.
In step S104, the mapping relationship is saved to a target mapping relationship file, for example, when the installation package of the target application program of the second version is saved in the private directory/data/data/package name/files/. NewApk folder of the target application program, the mapping relationship is saved to the target mapping relationship file under the/data/data/package name/files/. NewApk directory.
According to the android system-based application program hot updating method provided by the embodiment of the application, the target differential packet is firstly obtained, then the second version of installation packet is locally synthesized according to the target differential packet and the first version of installation packet, finally the second version of installation packet is silently installed, and the mapping relation between the embedded pile assembly and the newly added assembly and/or the mapping relation between the embedded pile process and the newly added process are stored, so that the new addition and the modification of the android four assemblies can be completed on the premise of ensuring smaller patches, and meanwhile, the resource consumption is ensured to be smaller. Compared with the application market update, the method can provide the traceless shortcut app update which is not required to be downloaded and installed by a user for the terminal device app update, and simultaneously reduce the flow and the memory consumption caused by the update.
In some embodiments, the target differential packet is generated by comparing the installation package of the first version of the target application program and the installation package of the second version of the target application program by using a target differential algorithm tool, and then generating a control file, a differential file and a new file, and compressing the control file, the differential file and the new file.
Specifically, an open-source hdiffatch differential algorithm tool may be used to compare the first version and the second version of the installation package to generate a control file, a differential file, and a new file, where the control file contains guide information that requires the addition and insertion of binary data segments ("adding" is reading the appropriate byte binary data from the differential file and "inserting" is reading the appropriate binary data from the new file), the differential file contains byte differences that approximately match fields, the new file contains completely different fields that cannot be approximately matched, and the three types of files are compressed to generate the differential packet.
As shown in fig. 4, in some embodiments, the generating and storing the installation package of the second version of the target application program according to the target differential packet and the locally stored installation package of the first version of the target application program includes:
s1021, adding difference information into the installation package of the first version of target application program according to the control file and the difference file in the target difference package, and adding new information into the installation package of the first version of target application program according to the control file and the new file in the difference package to generate the installation package of the second version of target application program;
in step S1021, after the target differential packet is downloaded locally, the second version apk may be synthesized again by using the hdiffpatch tool, using the first version installation packet and the target differential packet as raw materials, according to the "adding" differential portion and the "inserting" new added portion of the control file in the target differential packet.
And S1022, storing the installation package of the target application program of the second version under the private directory of the target application program.
In step S1022, the second version of the installation package is saved in the private directory of the target application, for example, in the private directory/data/data/package name/files/. NewApk folder of the target application.
In some embodiments, after generating and saving the installation package of the second version of the target application program based on the target differential packet and the locally saved installation package of the first version of the target application program, the method further comprises: and copying the dynamic link library file in the installation package of the target application program of the second version to the private directory of the target application program.
Specifically, after the second version apk is generated by merging, the initialization silent installation is started to be performed: firstly, checking whether the signatures of the first version apk and the second version apk are consistent, if so, continuing, otherwise, stopping; copying the dynamic link library file (so) in the second version apk under the private directory of the target application program, for example copying the dynamic link library file (so) in the second version apk into the private directory/data/data/package name/files/. NewApk/so of the target application program.
As shown in fig. 5, in some embodiments, after copying the dynamic link library file in the installation package of the second version of the target application program to the private directory of the target application program, the method further includes:
s105, compiling an installation package of the target application program of the second version to generate an oat file which can be directly executed by the ART of the android virtual machine;
and S106, storing the oat file under a private directory of the target application program.
Specifically, after copying the dynamic link library file in the installation package of the second version of the target application program to the private directory of the target application program, the automatic triggering system executes dex2oat on the second version apk to generate a compiling product-oat file so as to accelerate the app starting performance after the hot-standby.
In some embodiments, after storing the mapping relationship between the embedded pile component and the newly added component and/or the mapping relationship between the embedded pile process and the newly added process in a target mapping relationship file, the method further includes: and writing a mark information for recording that the installation of the thermal update of the target application program is completed and activated in the local cache.
Specifically, after the hot update installation is completed, a flag is written to the local cache, recording that the target application hot update installation is completed and activated, and the next time the app is started, the flag will be checked to determine whether to perform the hot update load operation.
As shown in fig. 6, in some embodiments, after the mapping relationship between the embedded pile component and the newly added component and/or the mapping relationship between the embedded pile process and the newly added process are stored locally, the method further includes:
s107, checking whether the local cache has the marking information according to a starting request aiming at the target application program;
s108, if the local cache has the marking information, loading an installation package of the target application program of the second version.
Specifically, after the installation process is completed, the app is restarted to check whether the tag information is in the local cache, and if so, the installation package of the second version of the target application program is loaded.
In some embodiments, the method further comprises:
when an embedded pile component in the target application program of the second version is started, judging whether a new component with a mapping relation with the embedded pile component exists in the mapping relation file or not; if the mapping relation file has a new component with a mapping relation with the embedded pile component, the embedded pile component is replaced by the new component for starting; and/or
When an embedded pile component in the target application program of the second version is started, judging whether a new component with a mapping relation with the embedded pile component exists in the mapping relation file or not;
and if the mapping relation file has a new process with a mapping relation with the embedded pile process, replacing the embedded pile process with the new process for starting.
Specifically, an Application class hotfix Application for implementing hot update loading when an Application is started is added in Application engineering codes of a target Application program, and the Application class hotfix Application is used for loading a second version of apk and executing an additional loading flow when the Application is started, and the compiling period in the apk synthesis process of the second version utilizes a function instrumentation technology to modify a parent class of the hotfix Application into an Application stated in android management. After the installation of the hot update is completed, generating a new Hotfix Application object by using a loadedApk.makeapplication method when restarting the app, and replacing the original old Application object; and the starting flow of the hook four components in the application engineering code of the target application program enables pile replacement operation to be carried out in a starting method when the newly added component is started. As shown in fig. 7, for example, a newly added Activity a needs to be started, because the app does not include a in the components registered in the system, and therefore, the app cannot be directly invoked, first hook ActivityManager, the pre-embedded Activity B replaces a to provide the system with Activity related information to be started, when the system determines that the Activity can execute the initialization flow, then hook ActivityThread replaces B with a to execute the initialization flow of a, thereby achieving the purpose of starting a.
Therefore, compared with the existing class loading scheme and the underlying replacement scheme, the method and the device initialize and load new version apk information by modifying the android app starting flow, thereby realizing the effect of app update, and the existing scheme realizes the purpose of app update by replacing old classes with new classes on class level by utilizing different technologies, and the realization principle is different. In addition, the scheme provided by the application has stronger updating range and capability than the existing class replacement scheme because of loading the new version apk.
Fig. 8 is a schematic structural diagram of an application program hot update device based on an android system according to an embodiment of the present application, where as shown in fig. 8, the application program hot update device based on an android system according to an embodiment of the present application includes:
a first obtaining module 21, configured to obtain, when the first version of the target application program is locally running, a target differential packet, where the target differential packet is generated according to an installation package of the first version of the target application program and an installation package of the second version of the target application program;
a generating module 22, configured to generate and store an installation package of the second version of the target application program according to the target differential packet and the locally stored installation package of the first version of the target application program;
the second obtaining module 23 is configured to obtain, according to the target differential packet and the installation packet of the second version of the target application program, a mapping relationship between the embedded pile component and the newly added component and/or a mapping relationship between the embedded pile process and the newly added process in the second version of the target application program;
and the storage module 24 is used for storing the mapping relation between the embedded pile component and the newly added component and/or the mapping relation between the embedded pile process and the newly added process in a target mapping relation file.
According to the android system-based application program hot updating device provided by the embodiment of the application, the target differential packet is firstly obtained, then the second version of installation packet is locally synthesized according to the target differential packet and the first version of installation packet, finally the second version of installation packet is silently installed, and the mapping relation between the embedded pile assembly and the newly added assembly and/or the mapping relation between the embedded pile process and the newly added process are stored, so that the new addition and the modification of the android four assemblies can be completed on the premise of ensuring smaller patches, and meanwhile, the resource consumption is ensured to be smaller. Compared with the application market update, the method can provide the traceless shortcut app update which is not required to be downloaded and installed by a user for the terminal device app update, and simultaneously reduce the flow and the memory consumption caused by the update.
In some embodiments, the target differential packet is generated by comparing the installation package of the first version of the target application program and the installation package of the second version of the target application program by using a target differential algorithm tool, and then generating a control file, a differential file and a new file, and compressing the control file, the differential file and the new file.
In some embodiments, the generating module is specifically configured to:
adding difference information in the installation package of the first version of target application program according to the control file and the difference file in the target difference package, and adding new information in the installation package of the first version of target application program according to the control file and the new file in the difference package to generate the installation package of the second version of target application program;
and storing the installation package of the target application program of the second version under the private directory of the target application program.
In some embodiments, the apparatus further comprises:
and the copying module is used for copying the dynamic link library file in the installation package of the target application program of the second version to the private directory of the target application program.
In some embodiments, the generating module is further configured to compile an installation package of the second version of the target application program, and generate an oat file that can be directly executed by the android virtual machine ART;
the saving module is also used for saving the oat file under the private directory of the target application program.
In some embodiments, the apparatus further comprises:
and the writing module is used for writing mark information for recording that the installation of the thermal update of the target application program is completed and activated into the local cache.
In some embodiments, the apparatus further comprises:
the verification module is used for verifying whether the local cache has the marking information or not according to a starting request aiming at the target application program;
and the loading module is used for loading the installation package of the target application program of the second version if the local cache has the marking information.
In some embodiments, the apparatus further comprises:
the first judging module is used for judging whether a newly added component with a mapping relation with the embedded pile component exists in the mapping relation file or not when the embedded pile component in the target application program of the second version is started;
the first replacing module is used for replacing the embedded pile component with the new component for starting if the new component with the mapping relation with the embedded pile component is in the mapping relation file; and/or
The second judging module is used for judging whether a newly added component with a mapping relation with the embedded pile component exists in the mapping relation file or not when the embedded pile component in the target application program of the second version is started;
and the second replacing module is used for replacing the embedded pile process with the new process for starting if the new process with the mapping relation with the embedded pile process exists in the mapping relation file.
The embodiment of the apparatus provided in the embodiment of the present application may be specifically used to execute the above-mentioned processing flow applied to each method embodiment, and the functions thereof are not described herein again, and may refer to the detailed description of the above-mentioned method embodiment.
It should be noted that, the application program thermal updating method and device based on the android system provided by the embodiment of the application can be used in the financial field, and also can be used in any technical field except the financial field.
Fig. 9 is a schematic physical structure of an electronic device according to an embodiment of the present application, as shown in fig. 9, the electronic device may include: processor 301, communication interface (Communications Interface) 302, memory (memory) 303 and communication bus 304, wherein processor 301, communication interface 302, memory 303 accomplish the communication between each other through communication bus 304. The processor 301 may invoke logic instructions in the memory 303 to perform the method described in any of the embodiments above.
Further, the logic instructions in the memory 303 may be implemented in the form of software functional units and stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The present embodiments disclose a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, are capable of performing the methods provided by the method embodiments described above.
The present embodiment provides a computer-readable storage medium storing a computer program that causes the computer to execute the methods provided by the above-described method embodiments.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the description of the present specification, reference to the terms "one embodiment," "one particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the application, and is not meant to limit the scope of the application, but to limit the application to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the application are intended to be included within the scope of the application.

Claims (11)

1. An application program hot update method based on an android system is characterized by comprising the following steps:
when a target application program of a first version is locally operated, a target differential packet is obtained, wherein the target differential packet is generated according to an installation packet of the target application program of the first version and an installation packet of the target application program of a second version;
generating and storing an installation package of a second version of the target application program according to the target differential packet and the locally stored installation package of the first version of the target application program;
according to the target differential packet and the installation packet of the target application program of the second version, obtaining a mapping relation between an embedded pile component and a newly-added component and/or a mapping relation between an embedded pile process and the newly-added process in the target application program of the second version;
and storing the mapping relation between the embedded pile component and the newly added component and/or the mapping relation between the embedded pile process and the newly added process in a target mapping relation file.
2. The method of claim 1, wherein the target differencing packet is generated by comparing the installation package of the first version of the target application program with the installation package of the second version of the target application program using a target differencing algorithm tool to generate a control file, a difference file, and a new file, and then compressing the control file, the difference file, and the new file.
3. The method of claim 2, wherein generating and saving the installation package of the second version of the target application program based on the target differential packet and the locally saved installation package of the first version of the target application program comprises:
adding difference information in the installation package of the first version of target application program according to the control file and the difference file in the target difference package, and adding new information in the installation package of the first version of target application program according to the control file and the new file in the difference package to generate the installation package of the second version of target application program;
and storing the installation package of the target application program of the second version under the private directory of the target application program.
4. A method according to any one of claims 1 to 3, wherein after generating and saving an installation package of a second version of a target application program from the target differential packet and a locally saved installation package of a first version of the target application program, the method further comprises:
and copying the dynamic link library file in the installation package of the target application program of the second version to the private directory of the target application program.
5. The method of claim 4, wherein after copying the dynamically linked library file in the installation package of the second version of the target application under the private directory of the target application, the method further comprises:
compiling an installation package of the target application program of the second version to generate an oat file which can be directly executed by the ART of the android virtual machine;
and storing the oat file under a private directory of the target application program.
6. A method according to any one of claims 1 to 3, wherein after storing the mapping between the embedded pile assembly and the newly added assembly and/or the mapping between the embedded pile process and the newly added process in a target mapping file, the method further comprises:
and writing a mark information for recording that the installation of the thermal update of the target application program is completed and activated in the local cache.
7. The method of claim 6, wherein after storing the mapping between the embedded pile assembly and the newly added assembly and/or the mapping between the embedded pile process and the newly added process locally, the method further comprises:
according to the starting request aiming at the target application program, checking whether the local cache has the marking information or not;
and if the local cache has the marking information, loading the installation package of the target application program of the second version.
8. The method of claim 7, wherein the method further comprises:
when an embedded pile component in the target application program of the second version is started, judging whether a new component with a mapping relation with the embedded pile component exists in the mapping relation file or not;
if the mapping relation file has a new component with a mapping relation with the embedded pile component, the embedded pile component is replaced by the new component for starting; and/or
When an embedded pile component in the target application program of the second version is started, judging whether a new component with a mapping relation with the embedded pile component exists in the mapping relation file or not;
and if the mapping relation file has a new process with a mapping relation with the embedded pile process, replacing the embedded pile process with the new process for starting.
9. An android system-based application program hot update apparatus, comprising:
the first acquisition module is used for acquiring a target differential packet when the target application program of the first version is locally operated, wherein the target differential packet is generated according to an installation packet of the target application program of the first version and an installation packet of the target application program of the second version;
the generation module is used for generating and storing an installation package of the target application program of the second version according to the target differential packet and the locally stored installation package of the target application program of the first version;
the second acquisition module is used for acquiring a mapping relation between the embedded pile component and the newly added component and/or a mapping relation between the embedded pile process and the newly added process in the second version of target application program according to the target differential packet and the installation packet of the second version of target application program;
and the storage module is used for storing the mapping relation between the embedded pile assembly and the newly-added assembly and/or the mapping relation between the embedded pile process and the newly-added process in a target mapping relation file.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any one of claims 1 to 8 when the computer program is executed by the processor.
11. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 8.
CN202310500630.4A 2023-05-05 2023-05-05 Android system-based application program hot update method and device Pending CN116594644A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310500630.4A CN116594644A (en) 2023-05-05 2023-05-05 Android system-based application program hot update method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310500630.4A CN116594644A (en) 2023-05-05 2023-05-05 Android system-based application program hot update method and device

Publications (1)

Publication Number Publication Date
CN116594644A true CN116594644A (en) 2023-08-15

Family

ID=87593011

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310500630.4A Pending CN116594644A (en) 2023-05-05 2023-05-05 Android system-based application program hot update method and device

Country Status (1)

Country Link
CN (1) CN116594644A (en)

Similar Documents

Publication Publication Date Title
US11853774B2 (en) Dynamically loaded plugin architecture
KR101143112B1 (en) Applying custom software image updates to non-volatile storage in a failsafe manner
US10019256B2 (en) Systems and methods for incremental software development
US9483242B2 (en) Wholesale replacement of specialized classes in a runtime environments
US10146522B1 (en) Live code updates
KR102084816B1 (en) Layout and execution of software applications using bpram
US6314567B1 (en) Apparatus and method for transferring state data when performing on-line replacement of a running program code and data
JP7090657B2 (en) Methods, devices, devices and storage media for upgrading applications
JP4878715B2 (en) Method, computer system and computer readable recording medium for patching applications that do not conform to operating system
JP5663006B2 (en) System and method for building a runtime environment
KR20110030447A (en) Synchronizing virtual machine and application life cycles
KR102136906B1 (en) Layout and execution of operating systems using bpram
US7269464B2 (en) System, method and computer program product for providing an interface for instantiating additional programmable logic controller functionality
US9063819B2 (en) Extensible patch management
JP2007521529A (en) Maintaining component-based software products
JP2000181725A (en) Method and system for altering executable code and giving addition function
CN109710317B (en) System starting method and device, electronic equipment and storage medium
CN102073525A (en) Method and device for dynamically upgrading Web service system based on Java platform
CN103309696B (en) Method and device for updating Java card extended library, and Java card
US9952953B2 (en) Non-monotonic eventual convergence for desired state configuration
US9841982B2 (en) Locating import class files at alternate locations than specified in classpath information
BR102013006506A2 (en) Update Method and Embedded Multidomain System
CN108228266B (en) Method and device for starting Fragment component between different plug-ins under Android plug-in framework
CN114490103A (en) Operating system interface calling method and device and electronic equipment
CN116594644A (en) Android system-based application program hot update method and device

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