Application program updating method and device, electronic equipment and computer storage medium
By obtaining and updating the plug-in class installation package of Android applications and dynamically loading component configuration files, the problem that component configuration information cannot be updated as plug-ins is solved, and the efficiency and compatibility of application updates are improved.
Patent Information
- Application Number
- CN202310411489.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-06
- Publication Date
- 2024-10-15
AI Technical Summary
In Android application development, the component configuration information of the four major components is stored in the component configuration file, which makes it impossible to update in a plug-in manner, thereby reducing the efficiency of application updates.
By obtaining the plug-in class installation package containing the component configuration file, updating the component configuration file, and loading the updated plug-in class installation package when the application is running, the component configuration information is dynamically updated to avoid reinstalling the application.
It realizes efficient updating of applications, supports multiple information configuration modes, improves the efficiency, compatibility and flexibility of updates, and avoids system incompatibility issues.
Smart Images

Figure CN118778978A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device and readable storage medium for updating an application program. Background Art
[0002] In Android application development, it is necessary to configure the component configuration information of the four major components of Android to realize the relevant functions of the application. Every time a new application or a new version of an application is developed, the corresponding component configuration information must be reconfigured. If the component configuration information can be developed in the form of a plug-in, the component configuration information can be dynamically updated and flexibly replaced to quickly update the application.
[0003] However, the component configuration information of the four major components is stored in the corresponding component configuration files, and the component configuration files will not be loaded again after the application is installed, so it is impossible to update the component configuration information in a plug-in manner, resulting in low efficiency in updating the application. Summary of the invention
[0004] Embodiments of the present application provide a method, device, system, electronic device, and computer storage medium for updating an application program, which can improve the efficiency of updating the application program.
[0005] A first aspect of an embodiment of the present application provides a method for updating an application program, the method comprising:
[0006] Obtaining an installation package of the application, wherein the installation package includes a plug-in installation package, the plug-in installation package includes a component configuration file of the application, and the component configuration file includes component information of the application;
[0007] During the running of the application, the component configuration file is updated to obtain an updated component configuration file and an updated plug-in class installation package;
[0008] Installing the updated plug-in installation package in the application;
[0009] The updated component configuration file in the updated plug-in class installation package is loaded to update the component function corresponding to the updated component information into the application.
[0010] Accordingly, a second aspect of an embodiment of the present application provides an application program update device, the device comprising:
[0011] An installation package acquisition unit, configured to acquire an installation package of an application, wherein the installation package includes a plug-in installation package, the plug-in installation package includes a component configuration file of the application, and the component configuration file includes component information of the application;
[0012] An installation package updating unit, used to update the component configuration file during the running of the application program, and obtain an updated component configuration file and an updated plug-in class installation package;
[0013] An installation package installation unit, used to install the updated plug-in installation package in the application;
[0014] The application updating unit is used to load the updated component configuration file in the updated plug-in class installation package to update the component function corresponding to the updated component information into the application.
[0015] Optionally, the installation package updating unit includes:
[0016] A component information updating subunit, used to obtain updated component information;
[0017] A component information replacement subunit, used to replace the component information with the updated component information to obtain the updated component configuration file;
[0018] The component information packaging subunit is used to package the updated component configuration files into the updated plug-in class installation package.
[0019] Optionally, the installation package further includes a non-plug-in installation package, the non-plug-in installation package includes an installation file of the application, and the installation package installation unit is further specifically used to:
[0020] Downloading the updated plug-in installation package into the application to replace the plug-in installation package;
[0021] Installing the updated plug-in class installation package, and extracting the updated component configuration file from the updated plug-in class installation package;
[0022] The updated component configuration file is parsed, and the updated component information is synchronized to the non-plug-in installation package to update the installation file in the non-plug-in installation package.
[0023] Optionally, the installation package installation unit is further specifically used for:
[0024] Creating a loader for the updated component configuration file in the non-plug-in installation package;
[0025] The non-plug-in installation package is restarted to load the updated component information through the loader.
[0026] Optionally, the installation package installation unit is further specifically used for:
[0027] Obtaining a configuration mode of the component information, wherein the configuration mode includes multi-process configuration, theme configuration, and startup mode configuration;
[0028] The component information is modified in the configuration mode to obtain the updated component information.
[0029] Optionally, the application program updating device further includes:
[0030] An installation package restarting unit, used to restart the non-plug-in installation package;
[0031] The component information calling unit is used to call the updated component information of the plug-in installation package through the non-plug-in installation package to start the component corresponding to the updated component information and update the corresponding component function into the application.
[0032] Optionally, the installation package obtaining unit includes:
[0033] An installation file acquisition subunit, configured to acquire an installation file of the application, wherein the installation file includes component information of the application;
[0034] An installation file packaging subunit, used to package the installation file of the application into the non-plug-in installation package, and to package the component information into the plug-in installation package;
[0035] The module declaration subunit is used to declare that the plug-in installation package is an independent dynamic module of the application and the non-plug-in installation package is a host module of the dynamic module.
[0036] Optionally, the application program updating device further includes:
[0037] An installation package starting unit, used to start the installation package and extract the installation file of the application from the non-plug-in installation package and the plug-in installation package;
[0038] An installation file parsing unit, used to parse the installation file and synchronize the parsed installation information to the target package object of the non-plug-in installation package;
[0039] A non-plug-in installation package installation unit, configured to install the non-plug-in installation package based on the installation information to obtain the application program;
[0040] The package object synchronization unit is used to synchronize the target package object to the package object management server.
[0041] A third aspect of an embodiment of the present application provides an electronic device, including:
[0042] Processors and storage media;
[0043] The processor is used to implement each instruction;
[0044] The storage medium is used to store a plurality of instructions, and the instructions are used for the processor to load and execute the above-mentioned application program update method.
[0045] A fourth aspect of an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions suitable for loading by a processor to execute steps in a method for updating any application provided in an embodiment of the present application.
[0046] The fifth aspect of the embodiments of the present application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements a method for updating any application provided in the embodiments of the present application.
[0047] It can be seen that, by using the embodiment of the present application, the installation package of the application can be obtained first. Since the installation package contains a plug-in installation package that packages the component configuration file, the updated component configuration file can be dynamically and directly configured into the plug-in installation package later. The application can download the updated plug-in installation package to achieve dynamic update of the component configuration file. And after obtaining the updated plug-in installation package, the application does not need to be reinstalled, that is, the updated component configuration file can be dynamically loaded in a plug-in manner to update the component function corresponding to the updated component information into the application.
[0048] In this way, not only can the updated component configuration file be dynamically updated and dynamically loaded into the application in a targeted manner, but the application can be updated without reconfiguring and loading all the files of the application. In addition, no Hook solution is used in the whole process to avoid any system incompatibility issues. Since the embodiment of the present application directly modifies the component configuration information in the component configuration file, it can also support a variety of flexible information configuration modes. Based on the above points, the method of the embodiment of the present application can significantly improve the efficiency, compatibility and flexibility of application updates. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0050] Figure 1 It is a schematic diagram of the architecture of the application program update system provided in the embodiment of the present application;
[0051] Figure 2 It is a flowchart of a method for updating an application program provided in an embodiment of the present application;
[0052] Figure 3 is another flowchart of the method for updating an application program provided in an embodiment of the present application;
[0053] Figure 4 It is a schematic diagram of the structure of the installation package of the application provided in the embodiment of the present application;
[0054] Figure 5 Schematic diagram of installing a plug-in installation package and a non-plug-in installation package provided in an embodiment of the present application;
[0055] Figure 6 is a schematic diagram of dynamically updating an installation package provided in an embodiment of the present application;
[0056] Figure 7 It is a schematic diagram of the configuration information of the Hook verification component provided in an embodiment of the present application;
[0057] Figure 8 It is a schematic diagram of component configuration information based on proxy mode verification provided by an embodiment of the present application;
[0058] Fig. 9 It is a structural diagram of an application program update device provided in an embodiment of the present application;
[0059] Fig.10 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0061] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0062] If similar descriptions of "first / second" appear in the application documents, the following instructions are added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0063] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0064] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0065] 1) Installation package: An installation package refers to a packaged software program file, usually with an .apk extension, which is used for installation and deployment on the Android system. The installation package contains all the necessary files and data of the software program, such as code, resources, images, configuration files, etc. Users can install and run software programs on their devices by downloading and installing the installation package. In the Android system, the installation package is usually packaged and generated by developers using development tools such as Android Studio, and can also be downloaded and installed through third-party markets or official app stores.
[0066] 2)Apk: The full name is Android Package Kit, which is an application package format under the Android system, usually used to install and distribute applications on Android devices. APK contains all the code, resources, configuration files, and manifest files of the application, and it is the packaging format of Android applications.
[0067] 3) Four major components: refers to the four basic components in Android applications, namely Activity, Receiver, Service, and Provider. Among them, Activity represents a separate screen interface in the application with which users can interact; Service represents a component that performs long-running tasks or processes network requests in the background; Receiver can receive broadcast messages from the system or application and perform specific operations when receiving the broadcast; Provider provides a unified data access interface for applications, allowing applications to share data with other applications.
[0068] 4) Plug-in: It means packaging certain functions or modules of the application into plug-ins, and then dynamically loading them into the application at runtime. It is essentially an app compression package for Android terminals that does not require installation, usually in dex, apk, zip and other formats.
[0069] 5) Hook: It is a computer programming technique that changes the behavior of a program by injecting custom code when the program is executed. Hook technology can be used to modify the function of the program, add or delete specific operations, or execute custom code before or after the program is executed. In the Android plug-in solution, it is necessary to reflectively call the system-level API to achieve this. This technology of reflectively calling the system is called Hook.
[0070] 6) Android installation files: include code dex files, dynamic link library so files, resource files and configuration files, among which the configuration file includes AndroidManifest.xml file.
[0071] 7) AndroidManifest.xml: It is a required configuration file for Android applications. It contains some configuration information of the application, such as the application name, icon, version number, permissions, components, etc. Usually the four major components need to be declared and configured in this file before they can be used.
[0072] 8) Pre-creation of configuration information: Declare an Activity configuration in the AndroidManifest.xml file in advance to preload the configuration information required by the Activity before the Activity starts.
[0073] 9) Proxy: It is a design pattern used to provide a proxy or placeholder for other objects to control access to the object. The proxy pattern can be divided into two types: static proxy and dynamic proxy.
[0074] Based on the above explanations of the nouns and terms involved in the embodiments of the present application, the following describes an application program update system provided by the embodiments of the present application. Figure 1 , Figure 1 This is a schematic diagram of the architecture of the application update system provided in an embodiment of the present application. To support an exemplary application, terminals (terminal 400-1 and terminal 400-2 are shown as examples) are connected to server 200 via network 300. Network 300 can be a wide area network or a local area network, or a combination of the two, and data transmission is achieved using wireless or wired links.
[0075] The terminal (such as terminal 400-1 and terminal 400-2) has a client installed and running an application, which is used to receive the update notification sent by the server during the operation of the application, download the updated plug-in class installation package corresponding to the application from the server, store it in the local storage space (such as the SD card of the mobile terminal), and notify the process of the application so that the process can obtain the updated plug-in class installation package from the local storage space.
[0076] The terminal (such as terminal 400-1 and terminal 400-2) is also used to obtain an installation package of an application, wherein the installation package includes a plug-in installation package, the plug-in installation package includes a component configuration file of the application, and the component configuration file includes component information of the application; during the operation of the application, the component configuration file is updated to obtain an updated component configuration file and an updated plug-in installation package; the updated plug-in installation package is installed in the application; and the updated component configuration file in the updated plug-in installation package is loaded to update the component function corresponding to the updated component information into the application.
[0077] Server 200 is used to receive updated plug-in installation packages of applications uploaded by the development end during the running of the application, and to send update notifications to the terminals on which the application is installed to notify each terminal that an updated plug-in installation package of the application exists; at the same time, it is also used to receive download requests for updated plug-in installation packages of the application sent by the terminal, and send the updated plug-in installation packages to the terminals that sent the download requests (such as terminal 400-1 and terminal 400-2).
[0078] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms. The terminal 400 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.
[0079] The embodiments of the present application can be implemented with the help of cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or a local area network to achieve data calculation, storage, processing, and sharing.
[0080] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form a resource pool, which is used on demand and flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources. With the rapid development and application of the Internet industry, each item may have its own identification mark in the future, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can be achieved through cloud computing.
[0081] See also Figure 2 In this embodiment, a method for updating an application is provided, which is applied to a data sorting end, such as Figure 2 As shown, the specific process of the update method of the application can be as follows:
[0082] Step 201: Obtain an installation package of an application.
[0083] The installation package may include a plug-in installation package (Split Apk). The plug-in installation package may refer to an installation package developed in a plug-in form, which can be installed as a plug-in into a host application and usually needs to follow specific rules and standards so that it can be correctly loaded and used by the host application.
[0084] A plug-in installation package can contain some independent business function modules, as well as related resources, configuration files, codes, etc. These modules can be dynamically loaded and unloaded without affecting the stability and security of the host application, thereby expanding and customizing the functions and services of the host application. Common plug-in installation package formats include apk, jar, dex, etc.
[0085] The plug-in installation package may include a component configuration file of the application, and the component configuration file may include component information of the application, that is, the component information may be component configuration information in the component configuration file.
[0086] In this application, the component configuration file can be an AndroidManifest.xml file. During the application development stage, the AndroidManifest.xml file is used to configure the component information of the four major Android components and other components of the application. Each component needs to be registered and declared in the AndroidManifest.xml file so that the system can recognize and start the component. For example, for the Activity component, it is necessary to declare the component's name, startup mode, theme style, navigation bar settings, permission requirements and other information in the AndroidManifest.xml file. Similarly, for components such as Service, BroadcastReceiver and ContentProvider, they also need to be registered and declared in the AndroidManifest.xml file so that the system can start and call the component normally.
[0087] It should be noted that although the AndroidManifest.xml file will be parsed during the installation of the application, after the application is installed, the information extracted from the AndroidManifest.xml file will be stored in the system service or system memory. For example, the component configuration information of the AndroidManifest.xml file can be stored in the memory of the system service (such as PackageManagerService, referred to as PMS), or in the memory of the system process (system_process). Only when the system is started, PackageManagerService or system_process will load the AndroidManifest.xml file of the application and initialize and manage the application according to the information therein. For example, after starting the Activity component, the system will search for the component configuration information of the Activity component in the PackageManagerService. If it exists, the component configuration information of the Activity component is verified, and if it does not exist, the verification fails.
[0088] Therefore, according to the above description, the system process and the application process are completely isolated, and the component configuration information in the component configuration file cannot be modified and updated during the running of the application. The updated component information can only be packaged into the component configuration file in the new development stage, and after the application version is updated, the application is reinstalled to load the component functions corresponding to the updated component information. Therefore, the existing method cannot dynamically update the application without reinstalling it, and enable the application to dynamically load new functions.
[0089] In the existing method, Figure 7 As shown, after the Activity component is started, a pre-created Activity information can be declared in the AndroidManifest.xml file through the Hook technology. The pre-created Activity information can be the modified component configuration information. In the subsequent system verification process, since the pre-created Activity information has been declared, the system will issue a verification result for the pre-created Activity information. However, since the pre-created Activity information is only declared in the AndroidManifest.xml file using the Hook technology, the pre-created Activity information is not implemented in the current Apk, and the system needs to reflect and call a large number of APIs to implement it. Therefore, there is a compatibility risk, and the direct modification of the component configuration information in the component configuration file cannot be achieved during the entire process, and configuration properties such as theme configuration, multi-process configuration, and startup mode configuration cannot be supported.
[0090] In another existing method, Figure 8 As shown in the figure, you can solve the compatibility problem by starting the Activity component in proxy mode. To start the Activity component in proxy mode, first create a proxy Activity, and then call the method of the plug-in Activity in the proxy Activity. In this process, the proxy Activity, as an intermediate layer, can set the plug-in Activity as a proxy object and intercept the method call of the plug-in Activity, so as to achieve the purpose of bypassing the verification of Activity information before or after the plug-in Activity is started and perform some operations, such as permission checking, statistical analysis, etc.
[0091] However, since the proxy mode itself does not support direct configuration of the AndroidManifest.xml file, just like the way Hook pre-creates component configuration information, the plug-in that seeks component configuration information through the proxy mode still cannot support configuration attributes such as theme configuration, multi-process configuration, and startup mode configuration.
[0092] In some embodiments, the plug-in class installation package in the present application may only include the component configuration file of the application, which is equivalent to packaging the component configuration file of the application separately into the plug-in class installation package, so that it can be a "configuration class split package apk" (Config Split Apk) that is specifically responsible for configuring component configuration information, so as to realize the plug-in development and deployment of component configuration information.
[0093] The installation package of the present application may also include a non-plug-in installation package. In some embodiments, the non-plug-in installation package may be a base installation package of the application, i.e., Base Apk, which contains all the installation files of the non-plug-in installation package application, such as Figure 4 The non-plug-in installation package shown in may include De x files, So library files, component configuration files and resource files. It can be understood that when installing an application, all installation files inside the non-plug-in installation package can be decompressed by installing the non-plug-in installation package to install the corresponding application.
[0094] Optionally, step 201 may further include:
[0095] Obtaining an installation file of the application, wherein the installation file includes component information of the application;
[0096] Packing the installation file of the application into the non-plug-in installation package, and packing the component information into the plug-in installation package;
[0097] Declare that the plug-in installation package is an independent dynamic module of the application, and the non-plug-in installation package is a host module of the dynamic module.
[0098] Among them, the dynamic module refers to the functional module that can be dynamically added, updated or uninstalled when the application is running, and the host module refers to the functional module corresponding to the main part of the application, that is, the part that contains the main business logic and user interface.
[0099] It can be understood that after creating a plug-in installation package as a dynamic module of an application and a non-plug-in installation package as a host module of an application, since the above plug-in installation package and the non-plug-in installation package belong to the modules of the same application, the host module is associated with the dynamic module. For example, the plug-in installation package as a dynamic module can be loaded at runtime as part of the application, can contain some additional functions or resources of the application, and can realize on-demand updates and expansions of the application through dynamic loading. The non-plug-in installation package as a host module is responsible for loading and managing these dynamic modules and interacting with them.
[0100] like Figure 4 As shown in the figure, the non-plug-in installation package can store all the installation files of the application, such as Dex files, So library files, component configuration files and resource files. The plug-in installation package can be used as a dynamic module or sub-package Apk, which only stores part of the installation files of the application, such as Figure 4The plug-in installation package shown in only contains the component configuration file of the application, so that the plug-in installation package can be used as a dynamic module of the application. Subsequently, the component configuration files inside the plug-in installation package can be dynamically updated and dynamically loaded without affecting the host module.
[0101] Step 202: During the running of the application, the component configuration file is updated to obtain an updated component configuration file and an updated plug-in class installation package.
[0102] It can be understood that since the component configuration file exists in the plug-in installation package of the dynamic module, when the component configuration information in the component configuration file is updated, it will not affect the non-plug-in installation package and application that serve as the host module. Therefore, the component configuration file can be updated during the application update process.
[0103] Regarding modifying component configuration information, taking adding an Activity component as an example, you can first declare a new Activity component in the AndroidManifest.xml file. <application>Add a tag inside <activity>Tag, and set the properties of the component, for example: android:name is the class name of the component, and android:label is the name of the component. Then create an Activity class, create a class in the Java code, inherit from the Android Activity class, rewrite the methods in it, and implement the functions of the component. When you start the Activity component in the code later, you can use the Intent object to specify the class name of the Activity component to be started, and call the startActivity() method to start the Activity component.
[0104] It should be noted that the key to the method of the present application is that it can dynamically modify and update the component configuration information in the component configuration file in the form of a plug-in. This embodiment does not limit the specific modification type and content of the component configuration information.
[0105] Optionally, before step 202, the method of the embodiment of the present application may further include:
[0106] Launching the installation package, and extracting the installation file of the application from the non-plug-in installation package and the plug-in installation package;
[0107] Parsing the installation file, and synchronizing the parsed installation information to the target package object of the non-plug-in installation package;
[0108] Based on the installation information, installing the non-plug-in installation package to obtain the application;
[0109] The target package object is synchronized to the package object management server.
[0110] like Figure 5 As shown, when installing the installation package, the non-plug-in installation package and the plug-in installation package will be installed synchronously, so that the component configuration file in the plug-in installation package as a dynamic module will also be automatically loaded into the non-plug-in installation package as a host module, thereby ensuring that the corresponding component configuration information can also find the files required to load the component in the non-plug-in installation package to achieve normal registration, dynamic loading and operation of the component. After the application is installed, the target package object (Pac kage object) used in the installation process can be synchronized to the package object management server (PackageManagerService, PMS) to facilitate other subsequent devices to obtain the target package object from the package object management server to quickly install the application.
[0111] Optionally, step 202 may include the following steps:
[0112] Get updated component information;
[0113] Replacing the component information with the updated component information to obtain the updated component configuration file;
[0114] The updated component configuration files are packaged into the updated plug-in class installation package.
[0115] The updated component information may be the modified component configuration information. In some embodiments, the component configuration information may be modified by modifying the component code, directly adding or deleting a new component, etc. For details, please refer to the description of adding a new Activity component in step 202. It can be understood that after obtaining the updated component configuration file, it can be packaged into the plug-in class installation package of the dynamic module, so as to implement the extension update of the component configuration file at the plug-in level.
[0116] Optionally, the step of "obtaining updated component information" includes:
[0117] Obtaining a configuration mode of the component information, wherein the configuration mode includes multi-process configuration, theme configuration, and startup mode configuration;
[0118] The component information is modified in the configuration mode to obtain the updated component information.
[0119] It can be understood that, as mentioned above, since the method of the present application can directly modify the component configuration information of the component configuration file in the plug-in installation package in the form of a plug-in, this method, compared with the existing Hook pre-creation and proxy mode methods, can further support diversified configuration modes and properties on the basis of zero Hook and no system compatibility issues.
[0120] Taking the multi-process configuration mode as an example, you can directly configure it in the AndroidManifest.xml file <application>The android:process attribute is added to the tag. This attribute specifies the process name that the application is to run. Multiple components can use the same process name, so that they will run in the same process. Accordingly, the operation of theme configuration and startup mode configuration is the same as the principle of multi-process configuration, and can also be implemented by directly modifying the component configuration information in the plug-in installation package of this application.
[0121] Step 203: Install the updated plug-in installation package in the application.
[0122] It is understandable that after obtaining the updated plug-in installation package, since the updated plug-in installation package contains updated component information, the updated plug-in installation package can be installed into the application first, so that the updated component information can be dynamically loaded later.
[0123] Optionally, step 203 may include:
[0124] Downloading the updated plug-in installation package into the application to replace the plug-in installation package;
[0125] Installing the updated plug-in class installation package, and extracting the updated component configuration file from the updated plug-in class installation package;
[0126] The updated component configuration file is parsed, and the updated component information is synchronized to the non-plug-in installation package to update the installation file in the non-plug-in installation package.
[0127] like Figure 6 As shown, the application can download the updated plug-in installation package during operation and replace the original plug-in installation package with the downloaded updated plug-in installation package. During this download and replacement process, the non-plug-in installation package as the host module is not affected in any way. Later, it is only necessary to parse the updated component information from the updated plug-in installation package and synchronize it to the non-plug-in installation package, so that the non-plug-in installation package and the application can be dynamically updated without reinstalling.
[0128] Step 204: Load the updated component configuration file in the updated plug-in installation package to update the component function corresponding to the updated component information into the application.
[0129] It is understandable that after installing the updated plug-in installation package in the application, although the updated component information has been synchronized to the non-plug-in installation package, the above updated component information still needs to be loaded into the application to add the updated component function to the application.
[0130] Optionally, step 204 may include:
[0131] Creating a loader for the updated component configuration file in the non-plug-in installation package;
[0132] The non-plug-in installation package is restarted to load the updated component information through the loader.
[0133] It can be understood that in order to ensure that the non-plug-in installation package can smoothly load the updated component configuration file, a loader for loading the updated component configuration file can be created. Without the need to reinstall the non-plug-in installation package, the updated component information can be dynamically loaded into the corresponding application by simply restarting the non-plug-in installation package.
[0134] Optionally, the method of the embodiment of the present application may further include:
[0135] Restart the non-plug-in installation package;
[0136] The updated component information of the plug-in installation package is called through the non-plug-in installation package to start the component corresponding to the updated component information and update the corresponding component function into the application.
[0137] In another implementation, the non-plug-in installation package can be restarted to call the updated component information, thereby achieving the effect of dynamically loading the updated component information into the corresponding application without reinstalling the non-plug-in installation package, just by restarting the non-plug-in installation package.
[0138] It can be seen that, by using the embodiment of the present application, the installation package of the application can be obtained first. Since the installation package contains a plug-in installation package that packages the component configuration file, the updated component configuration file can be dynamically and directly configured into the plug-in installation package later. The application can download the updated plug-in installation package to achieve dynamic update of the component configuration file. And after obtaining the updated plug-in installation package, the application does not need to be reinstalled, that is, the updated component configuration file can be dynamically loaded in a plug-in manner to update the component function corresponding to the updated component information into the application.
[0139] In this way, not only can the updated component configuration file be dynamically updated and dynamically loaded into the application in a targeted manner, but the application can be updated without reconfiguring and loading all the files of the application. In addition, no Hook solution is used in the whole process to avoid any system incompatibility issues. Since the embodiment of the present application directly modifies the component configuration information in the component configuration file, it can also support a variety of flexible information configuration modes. Based on the above points, the method of the embodiment of the present application can significantly improve the efficiency, compatibility and flexibility of application updates.
[0140] Among them, another specific process of the above application update method is as follows, refer to Figure 3 , the method further comprises the following steps:
[0141] Step 301: Obtain the installation package of the application, declare the plug-in installation package as a dynamic module, and the non-plug-in installation package as a host module;
[0142] Step 302: Install the installation package of the application to obtain the application;
[0143] Step 303: Obtain updated component information;
[0144] Step 304: Use the updated component information to replace the component information of the component configuration file, and obtain an updated component configuration file and an updated plug-in class installation package;
[0145] Step 305: Send the updated plug-in installation package to the installation package;
[0146] Step 306: Install the plug-in installation package, parse the updated component configuration file, and synchronize the updated component information to the non-plug-in installation package;
[0147] Step 307: restart the non-plug-in installation package and load the updated component configuration file to update the updated component function into the application.
[0148] The method described in the above embodiment will be further described in detail below.
[0149] like Fig. 9 FIG. 1 is a schematic diagram of a structure of an application updating device provided in an embodiment of the present application, wherein the device includes:
[0150] The installation package acquisition unit 401 is used to acquire an installation package of an application, wherein the installation package includes a plug-in installation package, the plug-in installation package includes a component configuration file of the application, and the component configuration file includes component information of the application;
[0151] An installation package updating unit 402 is used to update the component configuration file during the running of the application program to obtain an updated component configuration file and an updated plug-in class installation package;
[0152] An installation package installation unit 403, used to install the updated plug-in installation package in the application;
[0153] The application updating unit 404 is used to load the updated component configuration file in the updated plug-in class installation package to update the component function corresponding to the updated component information into the application.
[0154] Optionally, the installation package updating unit 402 includes:
[0155] A component information updating subunit, used to obtain updated component information;
[0156] A component information replacement subunit, used to replace the component information with the updated component information to obtain the updated component configuration file;
[0157] The component information packaging subunit is used to package the updated component configuration files into the updated plug-in class installation package.
[0158] Optionally, the installation package further includes a non-plug-in installation package, the non-plug-in installation package includes the installation file of the application, and the installation package installation unit 403 is further specifically used to:
[0159] Downloading the updated plug-in installation package into the application to replace the plug-in installation package;
[0160] Installing the updated plug-in class installation package, and extracting the updated component configuration file from the updated plug-in class installation package;
[0161] The updated component configuration file is parsed, and the updated component information is synchronized to the non-plug-in installation package to update the installation file in the non-plug-in installation package.
[0162] Optionally, the installation package installation unit 403 is further specifically used for:
[0163] Creating a loader for the updated component configuration file in the non-plug-in installation package;
[0164] The non-plug-in installation package is restarted to load the updated component information through the loader.
[0165] Optionally, the installation package installation unit 403 is further specifically used for:
[0166] Obtaining a configuration mode of the component information, wherein the configuration mode includes multi-process configuration, theme configuration, and startup mode configuration;
[0167] The component information is modified in the configuration mode to obtain the updated component information.
[0168] Optionally, the application program updating device further includes:
[0169] An installation package restarting unit, used to restart the non-plug-in installation package;
[0170] The component information calling unit is used to call the updated component information of the plug-in installation package through the non-plug-in installation package to start the component corresponding to the updated component information and update the corresponding component function into the application.
[0171] Optionally, the installation package obtaining unit 401 includes:
[0172] An installation file acquisition subunit, configured to acquire an installation file of the application, wherein the installation file includes component information of the application;
[0173] An installation file packaging subunit, used to package the installation file of the application into the non-plug-in installation package, and to package the component information into the plug-in installation package;
[0174] The module declaration subunit is used to declare that the plug-in installation package is an independent dynamic module of the application and the non-plug-in installation package is a host module of the dynamic module.
[0175] Optionally, the application program updating device further includes:
[0176] An installation package starting unit, used to start the installation package and extract the installation file of the application from the non-plug-in installation package and the plug-in installation package;
[0177] An installation file parsing unit, used to parse the installation file and synchronize the parsed installation information to the target package object of the non-plug-in installation package;
[0178] A non-plug-in installation package installation unit, configured to install the non-plug-in installation package based on the installation information to obtain the application program;
[0179] The package object synchronization unit is used to synchronize the target package object to the package object management server.
[0180] It can be seen that, by using the embodiment of the present application, the installation package of the application can be obtained first. Since the installation package contains a plug-in installation package that packages the component configuration file, the updated component configuration file can be dynamically and directly configured into the plug-in installation package later. The application can download the updated plug-in installation package to achieve dynamic update of the component configuration file. And after obtaining the updated plug-in installation package, the application does not need to be reinstalled, that is, the updated component configuration file can be dynamically loaded in a plug-in manner to update the component function corresponding to the updated component information into the application.
[0181] In this way, not only can the updated component configuration file be dynamically updated and dynamically loaded into the application in a targeted manner, but the application can be updated without reconfiguring and loading all the files of the application. In addition, no Hook solution is used in the whole process to avoid any system incompatibility issues. Since the embodiment of the present application directly modifies the component configuration information in the component configuration file, it can also support a variety of flexible information configuration modes. Based on the above points, the method of the embodiment of the present application can significantly improve the efficiency, compatibility and flexibility of application updates.
[0182] The present application also provides an electronic device, which may be a terminal, a server, or other device. Fig.10 As shown, it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application, specifically:
[0183] The electronic device may include one or more processors 501 of processing cores, one or more computer-readable storage media memories 502, a power supply 503, an input unit 504, and a communication unit 505. Those skilled in the art will appreciate that Fig.10 The electronic device structure shown in the figure does not limit the electronic device, and may include more or less components than shown in the figure, or combine some components, or arrange the components differently.
[0184] The processor 501 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or units stored in the memory 502, and calling data stored in the memory 502. In some embodiments, the processor 501 may include one or more processing cores; in some embodiments, the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 501.
[0185] The memory 502 can be used to store software programs and units. The processor 501 executes various functional applications and data processing by running the software programs and units stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
[0186] The electronic device also includes a power supply 503 for supplying power to various components. In some embodiments, the power supply 503 can be logically connected to the processor 501 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 503 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0187] The electronic device may further include an input unit 504, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0188] The electronic device may further include a communication unit 505. In some embodiments, the communication unit 505 may include a wireless unit. The electronic device may perform short-range wireless transmission through the wireless unit of the communication unit 505, thereby providing the user with wireless broadband Internet access. For example, the communication unit 505 may be used to help the user send and receive emails, browse web pages, and access streaming media.
[0189] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 501 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 502 according to the following instructions, and the processor 501 will run the application programs stored in the memory 502, thereby realizing various functions, as follows:
[0190] Obtaining an installation package of the application, wherein the installation package includes a plug-in installation package, the plug-in installation package includes a component configuration file of the application, and the component configuration file includes component information of the application;
[0191] During the running of the application, the component configuration file is updated to obtain an updated component configuration file and an updated plug-in class installation package;
[0192] Installing the updated plug-in installation package in the application;
[0193] The updated component configuration file in the updated plug-in class installation package is loaded to update the component function corresponding to the updated component information into the application.
[0194] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0195] From the above, it can be seen that the technical solution of the present application does not require a trusted third party to participate in the collection and management of the data to be classified. It converts the data to be classified in each data terminal into the matrix required for classification calculation, and performs encryption, element position change, random number addition and other processing on the matrix through different data terminals during the classification process. This makes it impossible for any data terminal to completely obtain or tamper with the data from other data terminals, thereby avoiding the leakage and tampering of the data to be classified and improving the efficiency, accuracy and security of data classification.
[0196] Therefore, the update method of the application of the present application can solve the technical problems that in the existing data classification process, a large amount of feature data of the data to be classified needs to be obtained from different data sources, which may lead to data leakage and tampering, and it is difficult to find a safe and reliable trusted third party, which reduces the efficiency, accuracy and security of data classification.
[0197] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any application update method provided in the embodiment of the present application. For example, the instructions can execute the following steps:
[0198] Obtaining an installation package of the application, wherein the installation package includes a plug-in installation package, the plug-in installation package includes a component configuration file of the application, and the component configuration file includes component information of the application;
[0199] During the running of the application, the component configuration file is updated to obtain an updated component configuration file and an updated plug-in class installation package;
[0200] Installing the updated plug-in installation package in the application;
[0201] The updated component configuration file in the updated plug-in class installation package is loaded to update the component function corresponding to the updated component information into the application.
[0202] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0203] It can be seen that, by using the embodiment of the present application, the installation package of the application can be obtained first. Since the installation package contains a plug-in installation package that packages the component configuration file, the updated component configuration file can be dynamically and directly configured into the plug-in installation package later. The application can download the updated plug-in installation package to achieve dynamic update of the component configuration file. And after obtaining the updated plug-in installation package, the application does not need to be reinstalled, that is, the updated component configuration file can be dynamically loaded in a plug-in manner to update the component function corresponding to the updated component information into the application.
[0204] In this way, not only can the updated component configuration file be dynamically updated and dynamically loaded into the application in a targeted manner, but the application can be updated without reconfiguring and loading all the files of the application. In addition, no Hook solution is used in the whole process to avoid any system incompatibility issues. Since the embodiment of the present application directly modifies the component configuration information in the component configuration file, it can also support a variety of flexible information configuration modes. Based on the above points, the method of the embodiment of the present application can significantly improve the efficiency, compatibility and flexibility of application updates.
[0205] Since the instructions stored in the storage medium can execute the steps in the update method of any application provided in the embodiments of the present application, the beneficial effects that can be achieved by the update method of any application provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0206] The above is a detailed introduction to an application update method, device, system, electronic device and computer storage medium provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.< / application> < / activity> < / application>
Claims
1. A method for updating an application, characterized in that: The method comprises: Obtaining an installation package of the application, wherein the installation package includes a plug-in installation package, the plug-in installation package includes a component configuration file of the application, and the component configuration file includes component information of the application; During the running of the application, the component configuration file is updated to obtain an updated component configuration file and an updated plug-in class installation package; Installing the updated plug-in installation package in the application; The updated component configuration file in the updated plug-in class installation package is loaded to update the component function corresponding to the updated component information into the application.
2. The method for updating an application according to claim 1, characterized in that: The updating of the component configuration file to obtain an updated component configuration file and an updated plug-in class installation package includes: Get updated component information; Replacing the component information with the updated component information to obtain the updated component configuration file; The updated component configuration files are packaged into the updated plug-in class installation package.
3. The method for updating an application according to claim 2, characterized in that: The installation package further includes a non-plug-in installation package, the non-plug-in installation package includes the installation file of the application, and the plug-in installation package for installing the update in the application includes: Downloading the updated plug-in installation package into the application to replace the plug-in installation package; Installing the updated plug-in class installation package, and extracting the updated component configuration file from the updated plug-in class installation package; The updated component configuration file is parsed, and the updated component information is synchronized to the non-plug-in installation package to update the installation file in the non-plug-in installation package.
4. The method for updating an application according to claim 2, characterized in that: The step of loading the updated component configuration file in the updated plug-in class installation package includes: Creating a loader for the updated component configuration file in the non-plug-in installation package; The non-plug-in installation package is restarted to load the updated component information through the loader.
5. The method for updating an application according to claim 2, characterized in that: The obtaining of updated component information includes: Obtaining a configuration mode of the component information, wherein the configuration mode includes multi-process configuration, theme configuration, and startup mode configuration; The component information is modified in the configuration mode to obtain the updated component information.
6. The method for updating an application according to claim 1, characterized in that: The method further comprises: Restart the non-plug-in installation package; The updated component information of the plug-in installation package is called through the non-plug-in installation package to start the component corresponding to the updated component information and update the corresponding component function into the application.
7. The method for updating an application according to claim 1, characterized in that: The installation package also includes a non-plug-in installation package, and the installation package of the application is obtained, including: Obtaining an installation file of the application, wherein the installation file includes component information of the application; Packing the installation file of the application into the non-plug-in installation package, and packing the component information into the plug-in installation package; Declare that the plug-in installation package is an independent dynamic module of the application, and the non-plug-in installation package is a host module of the dynamic module.
8. The method for updating an application according to claim 7, characterized in that: In the process of running the application, before updating the component configuration file, the method further includes: Launching the installation package, and extracting the installation file of the application from the non-plug-in installation package and the plug-in installation package; Parsing the installation file, and synchronizing the parsed installation information to the target package object of the non-plug-in installation package; Based on the installation information, installing the non-plug-in installation package to obtain the application; The target package object is synchronized to the package object management server.
9. An application updating device, characterized in that: Applied to a data supplement terminal, the device comprises: An installation package acquisition unit, configured to acquire an installation package of an application, wherein the installation package includes a plug-in installation package, the plug-in installation package includes a component configuration file of the application, and the component configuration file includes component information of the application; An installation package updating unit, used to update the component configuration file during the running of the application program, and obtain an updated component configuration file and an updated plug-in class installation package; An installation package installation unit, used to install the updated plug-in installation package in the application; The application updating unit is used to load the updated component configuration file in the updated plug-in class installation package to update the component function corresponding to the updated component information into the application.
10. An electronic device, characterized in that: include: Processors and storage media; The processor is used to implement each instruction; The storage medium is used to store a plurality of instructions, and the instructions are used for a processor to load and execute the updating method of the application program according to any one of claims 1 to 8.
11. A computer-readable storage medium storing executable instructions, characterized in that: When the executable instructions are executed by a processor, the method for updating the application program according to any one of claims 1 to 8 is implemented.
12. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the method for updating the application program according to any one of claims 1 to 8 is implemented.
