[go: up one dir, main page]

CN115129348B - Resource updating method, device and equipment of application program and readable storage medium - Google Patents

Resource updating method, device and equipment of application program and readable storage medium

Info

Publication number
CN115129348B
CN115129348B CN202210788001.1A CN202210788001A CN115129348B CN 115129348 B CN115129348 B CN 115129348B CN 202210788001 A CN202210788001 A CN 202210788001A CN 115129348 B CN115129348 B CN 115129348B
Authority
CN
China
Prior art keywords
class
loader
class loader
target
loading
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210788001.1A
Other languages
Chinese (zh)
Other versions
CN115129348A (en
Inventor
刘鸿达
郭润增
王少鸣
张志强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210788001.1A priority Critical patent/CN115129348B/en
Publication of CN115129348A publication Critical patent/CN115129348A/en
Application granted granted Critical
Publication of CN115129348B publication Critical patent/CN115129348B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

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

Abstract

本申请提供了一种应用程序的资源更新方法、装置;方法包括:在应用程序运行过程中,获取应用程序的更新资源包,更新资源包中包括更新资源及可执行文件;基于可执行文件,创建更新资源包对应的插件类加载器,并生成包括至少一个非插件类加载器的类加载器集合;在应用程序对应的类加载器链中,获取宿主类加载器,并将宿主类加载器的父类加载器替换为插件类加载器,得到目标类加载器链;基于类加载器集合、目标类加载器链中至少之一,确定用于加载更新资源归属的目标类的目标类加载器;通过目标类加载器加载目标类,并基于更新资源,运行目标类对应的功能。通过本申请,能够在程序运行中,实现应用程序的更新,提高应用程序的更新效率。

The present application provides a method and device for updating resources of an application; the method includes: during the operation of the application, obtaining an update resource package of the application, wherein the update resource package includes update resources and an executable file; based on the executable file, creating a plug-in class loader corresponding to the update resource package, and generating a class loader set including at least one non-plug-in class loader; in the class loader chain corresponding to the application, obtaining the host class loader, and replacing the parent class loader of the host class loader with the plug-in class loader to obtain a target class loader chain; based on at least one of the class loader set and the target class loader chain, determining the target class loader for loading the target class to which the update resource belongs; loading the target class through the target class loader, and running the function corresponding to the target class based on the update resource. Through the present application, it is possible to implement the update of the application during program operation and improve the update efficiency of the application.

Description

Resource updating method, device and equipment of application program and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, a computer readable storage medium, and a computer program product for updating resources of an application program.
Background
With the popularity of computer technology, there are more and more applications in computers. In the actual use process, various functions of the application program can be continuously perfected through updating.
However, in the related art, the application program needs to repackage, test, change the installation package in the corresponding channel, prompt the user for upgrade, and perform the overlay installation after the user upgrade, no matter how much content is updated. The updating process for the application program is complex, excessive manpower and cost are required to be consumed, meanwhile, when the application program is updated, the application program is required to be restarted, and in application scenes such as live broadcast, payment and the like, the executing business process is forced to be interrupted, the man-machine interaction experience is poor, and the updating efficiency of the application program is low.
Disclosure of Invention
The embodiment of the application provides a resource updating method, device and equipment of an application program, a computer readable storage medium and a computer program product, which can realize the updating of the application program and improve the updating efficiency of the application program in the running of the application program.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a resource updating method of an application program, which comprises the following steps:
In the running process of an application program, acquiring an update resource package of the application program, wherein the update resource package comprises update resources and executable files;
Creating a plug-in class loader corresponding to the update resource package based on the executable file, and generating a class loader set comprising at least one non-plug-in class loader;
acquiring a host class loader from a class loader chain corresponding to the application program, and replacing a parent class loader of the host class loader with the plug-in class loader to obtain a target class loader chain;
Determining a target class loader for loading a target class to which the updated resource belongs based on at least one of the class loader set and the target class loader chain;
and loading the target class through the target class loader, and running the function corresponding to the target class based on the updated resource.
The embodiment of the application provides a resource updating device of an application program, which comprises the following components:
The system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring an update resource package of an application program in the running process of the application program, and the update resource package comprises update resources and executable files;
The generation module is used for creating a plug-in class loader corresponding to the update resource package based on the executable file and generating a class loader set comprising at least one non-plug-in class loader;
the replacing module is used for acquiring a host class loader from a class loader chain corresponding to the application program, and replacing a parent class loader of the host class loader with the plug-in class loader to obtain a target class loader chain;
the searching module is used for determining a target class loader for loading the target class to which the updated resource belongs based on at least one of the class loader set and the target class loader chain;
and the operation module is used for loading the target class through the target class loader and operating the function corresponding to the target class based on the updated resource.
In the above scheme, the searching module is further configured to determine, based on class loaders corresponding to each node in the target class loader chain, a target class loader for loading a target class to which the updated resource belongs;
Determining the target class loader based on various types of loaders in the class loader set when the target class loader is not determined based on the target class loader chain;
wherein class loaders in the target class loader chain have a hierarchical relationship, and class loaders in the class loader set do not have a hierarchical relationship.
In the above scheme, the searching module is further configured to determine a sub-hierarchy relationship taking the plug-in class loader as a lowest hierarchy based on a hierarchy relationship between various loaders in the target class loader chain;
obtaining class loading paths of class loaders of all levels in the sub-level relation from the plug-in class loader;
obtaining a target class loading path of the target class, and comparing the target class loading path with each class loading path to obtain a comparison result;
And when the comparison result represents that the target class loading path is different from any class loading path, taking the plug-in class loader as a target class loader of the target class.
In the above scheme, the searching module is further configured to obtain class loading paths of various classes of loaders in the class loader set;
obtaining a target class loading path of the target class, and searching the target class loading path in class loading paths of various loaders to obtain a searching result;
When the search result represents that the target class loading path exists in the class loading paths of the various classes of loaders, the class loader to which the class loading path belongs is used as the target class loader.
In the above scheme, the searching module is further configured to identify a type of the target class to which the updated resource belongs, where the type includes a host class and a plug-in class;
The host class is a class loaded by a host class loader when the application program is installed, and the plug-in class is a class loaded by a plug-in class loader when the application program is operated;
In the above solution, the searching module is further configured to determine, when the type is a host class, a target class loader for loading the target class from at least one non-plug-in class loader in the class loader set;
when the type is a plug-in class, acquiring a reference class identifier set corresponding to the plug-in class loader, and determining a target class loader for loading the target class based on one of the class loader set and the target class loader chain and the reference class identifier set;
Wherein the reference class identifier is a class identifier of other classes referenced in the plug-in class loader.
In the above scheme, the searching module is further configured to match the class identifier of the target class with various identifiers in the reference class identifier set, so as to obtain a matching result;
when the matching result represents that the class identifier of the target class belongs to the reference class identifier set, determining a target class loader for loading the target class based on the class loader set;
and determining a target class loader for loading the target class based on the target class loader chain when the matching result characterizes that the class identifier of the target class does not belong to the reference class identifier set.
In the above scheme, the running module is further configured to obtain a resource loading path of the updated resource and a resource loader of the application program;
before the original resource loading path of the application program in the resource loader, inserting the resource loading path to obtain a target resource loading path;
and loading the updated resources into the memory space of the application program according to the loading sequence indicated by the target resource loading path.
In the above solution, the operation module is further configured to, when, based on at least one of the class loader set and the target class loader chain, determine a target class loader of the target class, obtain a class loading path of the target class, and control the target class loader, and execute a loading operation for the target class based on the class loading path;
And in the process of executing the loading operation, acquiring the updated resource from the memory space of the application program based on the resource identification of the updated resource, and running the function corresponding to the target class after resource updating based on the updated resource when the loading operation is completed.
In the above solution, the operation module is further configured to control the plug-in class loader to capture exception information and generate error prompt information based on the exception information when the target class loader of the target class cannot be determined based on at least one of the class loader set and the target class loader chain;
when the function corresponding to the target class is operated, displaying the error prompt information;
The error prompt information is used for representing failure of updating operation of the application program based on the updating resource package.
In the above scheme, the acquiring module is further configured to receive an update notification sent by a server in an application running process, where the update notification is used to indicate that an update resource packet exists in the application;
And downloading the update resource package to a local storage space according to the update notification, and notifying the process of the application program so that the process obtains the update resource package from the local storage space.
In the above scheme, the generating module is further configured to parse the executable file to obtain at least one class to be loaded included in the update resource package;
Creating a plug-in class loader for loading the at least one class to be loaded;
the generating a class loader set including at least one non-plug-in class loader includes:
and acquiring at least one non-plug-in class loader corresponding to the application program, and generating a class loader set comprising at least one non-plug-in class loader and other plug-in class loaders except the plug-in class loader.
An embodiment of the present application provides an electronic device, including:
A memory for storing executable instructions;
and the processor is used for realizing the resource updating method of the application program provided by the embodiment of the application when executing the executable instructions stored in the memory.
The embodiment of the application provides a computer readable storage medium which stores executable instructions for causing a processor to execute, thereby realizing the resource updating method of the application program provided by the embodiment of the application.
The embodiment of the application provides a computer program product, which comprises a computer program or instructions for realizing the resource updating method of the application program provided by the embodiment of the application when the computer program or instructions are used for causing a processor to execute.
The embodiment of the application has the following beneficial effects:
By applying the embodiment of the application, in the running process of an application program, an update resource package for the application program is obtained, a plug-in class loader corresponding to the update resource package is created, and then a parent class loader of a host class loaded in a class loader chain of the application program is replaced by the plug-in class loader to obtain a target class loader chain, so that the target class to which the update resource belongs can be loaded by the plug-in class loader preferentially when resource update is performed, meanwhile, the target class loader is determined by combining the target class loader chain and a class loader set, the accuracy of the target class loader can be ensured, the searching efficiency of the target class loader is improved, the target class is loaded by adopting the target class loader, and functions related to the update resource are operated, so that the update of the application program can be realized and the update efficiency of the application program is improved in the running process of the program.
Drawings
FIG. 1 is a schematic diagram of a resource update system of an application program according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an electronic device 500 for updating resources of an application program according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for updating resources of an application according to an embodiment of the present application;
FIG. 4 is a diagram illustrating a determination of a target class loader according to an embodiment of the present application;
FIG. 5 is a flow chart of a method for determining a target class loader based on a target class loader chain provided by an embodiment of the application;
FIG. 6 is a flow chart of a method for determining a target class loader based on a set of class loaders provided by an embodiment of the application;
FIG. 7 is a flow chart of a method for determining a target class loader based on the type of the target class according to an embodiment of the present application;
FIG. 8 is a flowchart of a method for loading updated resources according to an embodiment of the present application;
FIG. 9 is a flowchart of a method for loading a target class and updated resources according to an embodiment of the present application;
FIG. 10 is a flowchart of a method for obtaining an update package for an application according to an embodiment of the present application;
FIG. 11 is a flowchart of a method for obtaining an update package for an application according to an embodiment of the present application;
FIG. 12 is a flow chart of loading for updated resources provided in the related art;
FIG. 13 is a flow chart of loading updated resources according to an embodiment of the present application;
FIG. 14 is a flow chart of the manner in which resource load references are provided in the related art;
FIG. 15 is a flow chart of a manner in which resource loading references are provided by an embodiment of the present application;
FIG. 16 is a flow chart of a method for dynamically loading classes provided by an embodiment of the present application;
FIG. 17 is a class loading approach flow chart provided in the related art;
FIG. 18 is a flow chart of a loading manner for a class referenced by an update resource package provided by an embodiment of the present application;
FIG. 19 is a schematic diagram of a method for dynamically loading classes based on multiple update packages according to an embodiment of the present application.
Detailed Description
The present application will be further described in detail with reference to the accompanying drawings, for the purpose of making the objects, technical solutions and advantages of the present application more apparent, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
If a similar description of "first/second" appears in the application document, the following description is added, in which the terms "first/second/third" are merely distinguishing between similar objects and not representing a particular ordering of the objects, it being understood that the "first/second/third" may be interchanged with a particular order or precedence, if allowed, so that embodiments of the application described herein may be practiced otherwise than as illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
Before describing embodiments of the present application in further detail, the terms and terminology involved in the embodiments of the present application will be described, and the terms and terminology involved in the embodiments of the present application will be used in the following explanation.
1) Patch Package-files for repairing vulnerabilities or errors in applications, the size of the patch Package is typically much smaller than the size of an application Android Package (APK). The existing patch package schemes are based on function replacement or function hook, are generally used for carrying out logic modification on a small number of function methods in an application program, and do not allow modification on function method names, parameter numbers and sequences when carrying out modification.
2) Dex (Dalvik execution, dalvik VM execute) file: executable file on android platform, file suffix name. Dex. In general, the application APK includes a Dex file, where the Dex file includes all classes corresponding to the application, and each class includes a corresponding function method for implementing various functions of the application.
3) The parent delegation mechanism is that if a class loader receives a class loading request, the parent class loader does not load the class loading request first, but delegates the request to a parent class loader for execution, if the parent class loader still exists the parent class loader, further delegation is carried out upwards, the requests are sequentially recursively transmitted to a top-level boot class loader, if the parent class loader can complete a class loading task, successful return is achieved, if the parent class loader cannot complete the loading task, a child loader tries to unload the parent class loader, namely the parent delegation mechanism, the parent class loader allocates tasks downwards layer by layer, if the child class loader can load the parent class loader, the parent class loader loads the parent class loader, and if the parent class loader cannot load the parent class loader, the child class loader throws out exception.
4) Plug-in, namely an app compressed package of an android terminal without installation, which usually has the formats of dex, apk, zip and the like
5) The hot deployment is that a new code modification characteristic can be dynamically loaded into the process memory and can normally run under the condition that the process is not required to be restarted, thereby replacing the original old code characteristic
6) An Zhuozi source android apk contains code dex, dynamic link library so, an Zhuozi source and configuration file, an Zhuozi source contains picture resource and resource configuration file.
Based on the above explanation of terms and terminology involved in the embodiments of the present application, a resource update system of an application program provided by the embodiments of the present application is described below. Referring to fig. 1, fig. 1 is a schematic architecture diagram of a resource update system of an application program according to an embodiment of the present application, in order to support an exemplary application, a terminal (a terminal 400-1 and a terminal 400-2 are shown in an exemplary manner) are connected to a server 200 through a network 300, where the network 300 may be a wide area network or a local area network, or a combination of the two, and data transmission is implemented using a wireless or wired link.
The terminal (such as terminal 400-1 and terminal 400-2) installs and runs the client with the application program, and is configured to receive the update notification issued by the server during the running process of the application program, download the update resource package corresponding to the application program from the server, store the update resource package in the local storage space (such as SD card of the mobile terminal), and notify the process of the application program, so that the process obtains the update resource package from the local storage space.
The terminal (such as the terminal 400-1 and the terminal 400-2) is further configured to obtain an update resource package of the application program in an application program running process, wherein the update resource package includes update resources and executable files, create a plug-in class loader corresponding to the update resource package based on the executable files and generate a class loader set including at least one non-plug-in class loader, obtain a host class loader in a class loader chain corresponding to the application program, replace a parent class loader of the host class loader with the plug-in class loader to obtain a target class loader chain, determine a target class loader for loading a target class to which the update resources belong based on at least one of the class loader set and the target class loader chain, load the target class through the target class loader, and run functions corresponding to the target class based on the update resources.
The server 200 is configured to receive an update resource package of an application program uploaded by a development end during an application program running process, send an update notification to a terminal installed with the application program to notify each terminal that the application program has the update resource package, and simultaneously receive a download request for the update resource package of the application program sent by the terminal, and send the update resource package to the terminal (such as the terminal 400-1 and the terminal 400-2) sending the download request.
In some embodiments, the server 200 may be a stand-alone physical server, a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs, content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal 400 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal and the server may be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiment of the present application.
The embodiment of the application can be realized by means of Cloud Technology (Cloud Technology), wherein the Cloud Technology refers to a hosting Technology for integrating serial resources such as hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data.
The cloud technology is a generic term of network technology, information technology, integration technology, management platform technology, application technology and the like based on cloud computing business model application, can form a resource pool, and is flexible and convenient as required. Cloud computing technology will become an important support. Background services of technical network systems require a large amount of computing and storage resources. Along with the high development and application of the internet industry, each article possibly has an own identification mark in the future, the identification mark needs to be transmitted to a background system for logic processing, data of different levels can be processed separately, and various industry data needs strong system rear shield support and can be realized through cloud computing.
Referring to fig. 2, fig. 2 is a schematic structural diagram of an electronic device 500 for updating resources of an application program according to an embodiment of the present application. In practical applications, the electronic device 500 may be a server or a terminal shown in fig. 1, and the electronic device 500 is an electronic device for updating resources of an application program according to an embodiment of the present application, where the electronic device 500 is an example of a domain name resolution node shown in fig. 1, and the electronic device 500 provided in the embodiment of the present application includes at least one processor 510, a memory 550, at least one network interface 520, and a user interface 530. The various components in electronic device 500 are coupled together by bus system 540. It is appreciated that the bus system 540 is used to enable connected communications between these components. The bus system 540 includes a power bus, a control bus, and a status signal bus in addition to the data bus. The various buses are labeled as bus system 540 in fig. 2 for clarity of illustration.
The Processor 510 may be an integrated circuit chip having signal processing capabilities such as a general purpose Processor, such as a microprocessor or any conventional Processor, a digital signal Processor (DSP, digital Signal Processor), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like.
The user interface 530 includes one or more output devices 531 that enable presentation of media content, including one or more speakers and/or one or more visual displays. The user interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard drives, optical drives, and the like. Memory 550 may optionally include one or more storage devices physically located remote from processor 510.
Memory 550 includes volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. The non-volatile Memory may be a Read Only Memory (ROM) and the volatile Memory may be a random access Memory (RAM, random Access Memory). The memory 550 described in embodiments of the present application is intended to comprise any suitable type of memory.
In some embodiments, memory 550 is capable of storing data to support various operations, examples of which include programs, modules and data structures, or subsets or supersets thereof, as exemplified below.
An operating system 551 including system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and handling hardware-based tasks;
Network communication module 552 for accessing other computing devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 include Bluetooth, wireless compatibility authentication (WiFi), universal serial bus (USB, universal Serial Bus), and the like;
A presentation module 553 for enabling presentation of information (e.g., a user interface for operating a peripheral device and displaying content and information) via one or more output devices 531 (e.g., a display screen, speakers, etc.) associated with the user interface 530;
The input processing module 554 is configured to detect one or more user inputs or interactions from one of the one or more input devices 532 and translate the detected inputs or interactions.
In some embodiments, the resource updating device of the application program provided by the embodiments of the present application may be implemented in a software manner, fig. 2 shows the resource updating device 555 of the application program stored in the memory 550, which may be software in the form of a program, a plug-in, and the like, and includes software modules including an acquisition module 5551, a generation module 5552, a replacement module 5553, a search module 5554, and an operation module, which are logical, so that any combination or further splitting may be performed according to the implemented functions, and the functions of the respective modules will be described below.
In other embodiments, the resource updating device of the Application program provided in the embodiments of the present application may be implemented by combining software and hardware, and by way of example, the resource updating device of the Application program provided in the embodiments of the present application may be a processor in the form of a hardware decoding processor that is programmed to perform resource updating of the Application program provided in the embodiments of the present application, for example, the processor in the form of a hardware decoding processor may employ one or more Application specific integrated circuits (ASICs, application SPECIFIC INTEGRATED circuits), DSPs, programmable logic devices (PLDs, programmable Logic Device), complex Programmable logic devices (CPLDs, complex Programmable Logic Device), field-Programmable gate arrays (FPGAs), field-Programmable GATE ARRAY), or other electronic components.
Based on the above description of the application resource updating system and the electronic device provided by the embodiments of the present application, the following describes a method for updating the application resource provided by the embodiments of the present application. In some embodiments, the method for updating the resources of the application program provided by the embodiment of the present application may be implemented by the server or the terminal alone or in conjunction with the server and the terminal, and the method for updating the resources of the application program provided by the embodiment of the present application is described below by taking the terminal implementation as an example.
Referring to fig. 3, fig. 3 is a flowchart of a method for updating resources of an application program according to an embodiment of the present application, where the method for updating resources of an application program according to an embodiment of the present application includes:
In step 101, during the running process of an application program, a terminal obtains an update resource package of the application program, where the update resource package includes update resources and executable files.
In practical implementation, the application program may be an android desktop application based on an android system (i.e., a system of the terminal is an android system), the terminal is deployed with the application program, and in the running process of the application program, the terminal may obtain an update resource package (may also be referred to as a plug-in package, a patch package, etc.) corresponding to the application program through a network downloading manner, etc., so as to implement hot deployment for the application program. The hot deployment mode for the application program comprises code repair, resource repair and the like. The principle of code repair is class replacement, and it can be understood that the class in the application program is updated by using the class in the update resource package, where updating can include replacing the class loaded in the application program by using the class in the update resource package, and can also include adding the class in the update resource package in the application program. The replacement of classes is mainly performed by the use of class loaders (classloader), based on which dynamic loading of code is achieved. The obtained update resource package adopts an apk format, the update resource package contains executable files, and the android virtual machine in the terminal dynamically loads various types (dynamic loading of codes) in the update resource package through the dex files.
In step 102, a plug-in class loader corresponding to the update resource package is created based on the executable file, and a class loader set including at least one non-plug-in class loader is generated.
In actual implementation, the virtual machine of the terminal parses an executable file (such as a dex file of an android system) in an update resource package, and creates a class loader (i.e., a plug-in class loader) for dynamically loading the executable file (the code includes all classes included in the update of the application program). And generating a class loader set corresponding to the non-plug-in class loader, wherein the class loader set comprises one or more non-plug-in class loaders and plug-in class loaders of other plug-in classes. It should be noted that, each type of loader in the class loader set is independent from each other and does not have a hierarchical relationship.
By way of example, taking an application program as an example based on android application and an execution file as a dex file as an example, all classes of the update resource package are included in the dex file, and each class contains a respective corresponding function method for realizing various functions of the application program.
In step 103, in the class loader chain corresponding to the application program, a host class loader is obtained, and a parent class loader of the host class loader is replaced by a plug-in class loader, so as to obtain a target class loader chain.
In practical implementation, since loading for classes in the terminal is implemented based on the parent delegation mechanism. When class loading is performed based on the host class loader, the parent class loader of the host class loader is entrusted to perform loading (the same class cannot be repeatedly loaded based on the class loading process of the parent delegation mechanism, namely, each class is loaded only once), and in order to load the update resource package preferentially, the plug-in class loader for loading the class in the update resource package can be directly used as the parent (class) loader of the host class loader. Thus, when the function corresponding to the update resource package is operated, the plug-in class loader is preferentially used for loading.
First, a class loader of the running application (i.e., a host class loader) and a class loader chain in which the host class loader is located are obtained. The class loader chain is composed of a plurality of class loaders, parent-child relations are arranged between adjacent class loaders, and each class loader is used for loading different classes. The implementation process may be that a getClassLoader method of a class provided by an android system is called to obtain a class loader (host class loader) of an running application program, and then a getParent method provided by a system class loader is called to obtain a father (class) loader of the host class loader and a class loader chain containing the host class loader, wherein various class loaders in the class loader chain have a hierarchical relationship, and the top layer is the system class loader.
Illustratively, taking the example of loading an update resource package in the android system, the class loader chain for loading the classes of the application program is BaseClassLoader (application class loader) - > BootClassLoader (startup class loader), i.e. the parent class loader of BaseClassLoader is BootClassLoader. Taking the example of loading an update resource package in a java system, a class loader chain for loading classes of an application program is UserClassLoader (user-defined class loader) - > Application ClassLoader (application program class loader) - > ExtentionClassLoader (extended class loader) - > BootstrapClassLoader (startup class loader).
In step 104, a target class loader for loading a target class to which the updated resource belongs is determined based on at least one of the set of class loaders and the target class loader chain.
In practical implementation, according to the parent delegation mechanism of the class loader, the system preferably uses the principle that the host loader belongs to the class loader of the parent class loader in the class loader chain for class loading. If the parent class loader can complete the class loading task, the method returns successfully, if the parent class loader cannot complete the loading task, the child loader tries to load by itself, the parent class loader allocates tasks layer by layer, if the child class loader can load the tasks, the child class loader also can not load the tasks, and if the loading task is allocated to the system class loader, the exception is thrown (a certain function of the application program has an exception, a crash and other fields when the function is used). Based on the method, in order to ensure normal running of the program, a class loader for loading and updating the class in the resource package can be searched in a class loader set corresponding to the plug-in class loader, so that the occurrence of a crash condition when the application program runs to a corresponding function is avoided.
In some embodiments, referring to fig. 4, fig. 4 is a determination manner of the target class loader according to the embodiment of the present application, based on fig. 3, step 104 may be implemented by steps 1041-1042:
In step 1041, the terminal determines, based on class loaders corresponding to the nodes in the target class loader chain, a target class loader for loading a target class to which the updated resource belongs.
Wherein class loaders in the target class loader chain have a hierarchical relationship.
In actual implementation, the loading process for the class is based on a parent delegation mechanism, a parent class loader of a host class loader in a target class loader chain is a plug-in class loader corresponding to an update resource package, when the host loader receives a class loading request for at least one class used in the update resource package in the running process of an application program, the parent class loader is delegated to the plug-in class loader to execute preferentially, if the parent class loader still exists in the target loader chain, the plug-in class loader further delegates upwards, recursion is performed sequentially until the request reaches the top-level guide class loader, and if the parent class loader can complete a class loading task, the parent class loader returns successfully, and at the moment, the parent class loader is the target class loader for loading the target class to which the update resource belongs.
In some embodiments, referring to fig. 5, fig. 5 is a flowchart of a method for determining a target class loader based on a target class loader chain according to an embodiment of the present application, and is described in connection with steps 201a-204a shown in fig. 5:
In step 201a, a sub-hierarchy relationship with the plug-in class loader as the lowest hierarchy is determined based on the hierarchy relationship between the classes of loaders in the target class loader chain.
In actual implementation, a hierarchical relationship exists among various types of loaders in a target class loader chain, namely, a sub-class of a plug-in class loader is a host class loader, and a sub-hierarchical relationship taking the plug-in class loader as the lowest hierarchy is determined, so that when the host class loader receives a class loading request aiming at a class contained in an update resource package, the class loading request is directly entrusted to the plug-in class loader in the sub-hierarchical relationship for execution, and the plug-in class loader determines various types of class loaders in the update resource package based on a parent delegation mechanism.
Step 202a, starting from a plug-in class loader, obtaining class loading paths of class loaders of each level in the sub-level relationship.
In actual implementation, each class loader corresponds to a class loading path which can be loaded and is used for representing the class path of the class which can be loaded by the current class loader. The terminal analyzes the executable file in the update program package, determines the class loading path of the class applied in the update resource package, and matches the class loading path of the class loader of each level in the sub-level relation, so that the class loader corresponding to the class referenced by the update resource package can be determined.
Step 203a, obtaining a target class loading path of the target class, and comparing the target class loading path with various loading paths to obtain a comparison result.
In actual implementation, the class path of the class to be loaded is matched with at least one class loading path in the class loader, when the matching is successful, the class to be loaded can be characterized as being already loaded by the current class loader, and the class to be loaded can not be loaded again under the condition that the application program is not restarted.
And 204a, when the comparison result shows that the loading path of the target class is different from any type of loading path, taking the plug-in class loader as the target class loader of the target class.
In actual implementation, comparing the target class loading path with class loading paths corresponding to various classes of loaders included in the sub-hierarchy relationship, when the target class loading path is different from any class loading path, indicating that the target class is not loaded in the currently running application program, and taking the plug-in class loader as the class loader of the target class for loading the target class.
In step 1042, when the target class loader cannot be determined based on the target class loader chain, the target class loader is determined based on the classes of loaders in the class loader set.
Wherein class loaders in the class loader set do not have a hierarchical relationship.
In actual implementation, when the plug-in class loader is used as the target class loader of the target class, if the plug-in class loader cannot load the target class, the target class is described as the class in other update package resources or as the installed class in the application program. In order to avoid program crash, a class loader for loading the target class can be searched in a class loader set corresponding to the plug-in class loader. The class loader set corresponding to the plug-in class loader comprises a host class loader and other class loaders except the plug-in class loader. It should be noted that, the host class loader in the class loader set is used to load the related classes in the update resource package preferentially. Thus, the problem that the class is not loaded can be effectively avoided.
In some embodiments, referring to fig. 6, fig. 6 is a flowchart of a method for determining a target class loader based on a class loader set according to an embodiment of the present application, and is described with reference to steps 201b-203b shown in fig. 6:
in step 201b, the terminal obtains class loading paths of various class loaders in the class loader set.
In actual implementation, when the target class loader is not determined based on various classes of loaders in the target class loader chain, the search for the target class loader set based on the class loader set may continue. The class loader set has the function of continuously searching the target class loader for the second time in the class loader set when the target class loader cannot be determined in the target class loader chain based on the parent delegation mechanism, so that the target class is determined to be loaded, the loading of the target class is realized, and the conditions of breakdown and the like in the running process of an application program are avoided. Therefore, the terminal acquires class loading paths which can be loaded by various classes of loaders in the class loader set so as to complete the searching process based on the class loading paths.
Step 202b, obtaining a target class loading path of the target class, and searching the target class loading path in class loading paths of various loaders to obtain a searching result.
In actual implementation, the terminal acquires class loading paths of various classes of loaders in the class loader set, and searches for a target class loading path in the class loading paths.
Step 203b, when the search result represents that the class loading paths of the classes of loaders have target class loading paths, the class loader to which the class loading paths belong is used as the target class loader.
In practical implementation, the class loading path of the target class is matched with class loading paths corresponding to various classes of loaders in the class loader set, the class loader corresponding to the class loading path identical to the target class loading path is used as the target class loader, it should be noted that the class loading path can include information such as class name, class identifier, etc., and if the class name of the target class is identical to the class name in the current class loading path, it cannot be said that the class loading class path of the target class is matched with the current class loading path.
In some embodiments, referring to fig. 7, fig. 7 is a flowchart of a method for determining a target class loader based on a type of a target class according to an embodiment of the present application, and based on fig. 3, step 104 may be implemented by steps 1041b-1044 b:
In step 1041b, the terminal identifies the type of the target class to which the updated resource belongs, where the type includes a host class and a plug-in class.
Wherein the host class is a class loaded by a host class loader when the application program is installed, the plug-in class is a class loaded by a plug-in class loader when an application is run.
In actual implementation, in order to improve the searching efficiency of the target class loader, the type of the target class can be firstly determined, and whether the target class loader is determined by adopting a target class loader chain or a class loader set is determined according to the type, so that secondary searching is not needed, and the efficiency of determining the target class loader can be effectively improved. It should be noted that the types of the classes can be classified into a host class and a plug-in class. The host class is understood to be a class loaded by a host class loader when an application program is installed, and the plug-in class is understood to be a class loaded by a plug-in class loader when the application program is running.
In step 1042b, when the type is a host class, a target class loader for loading the target class is determined from at least one non-plug-in class loader in the class loader set.
In actual implementation, when the type is a host class, the target class loader can be directly determined in the class loader set corresponding to the plug-in class loader. Therefore, the method can be used for searching in various types of loaders in the target type loader chain, and the searching efficiency is effectively improved.
In step 1043b, when the type is a plug-in class, a set of reference class identifiers corresponding to the plug-in class loader is obtained, where the reference class identifiers are the class identifiers of other classes referenced in the plug-in class loader.
In practical implementation, when the type is a plug-in class, the target class loader needs to be determined further according to the class identifier of the target class. The terminal further judges whether to determine the target class loader based on the target class loader chain where the plug-in class loader is located or determine the target class loader by using other plug-in class loaders in the class loader set according to the class identifier of the target class.
Step 1044b, determining a target class loader for loading the target class based on one of the set of class loaders and the target class loader chain, and the set of reference class identifications.
In actual implementation, the target class loader is determined from the class loader set or the target class loader chain according to the reference class identifier in the reference class identifier set.
In some embodiments, the terminal can determine the target class loader based on the type of the target class by matching the class identifier of the target class with various identifiers in the reference class identifier set to obtain a matching result, determining the target class loader for loading the target class based on the class loader set when the matching result characterizes that the class identifier of the target class belongs to the reference class identifier set, and determining the target class loader for loading the target class based on the target class loader chain when the matching result characterizes that the class identifier of the target class does not belong to the reference class identifier set.
In actual implementation, firstly, the class identifier of the target class is matched with various identifiers in a reference class identifier set, if the class identifier of the target class can be found in the reference class identifier set, the target class is characterized as the reference class of the class obtained based on executable file analysis and can not be loaded through a plug-in class loader, therefore, the target class loader for loading the target class is determined based on the class loader set corresponding to the plug-in class loader, and if the class identifier of the target class can not be found in the reference class identifier set, the target class is characterized as not the reference class, and the target class loader can be determined based on the target class loader chain corresponding to the plug-in class loader.
In step 105, the target class is loaded by the target class loader, and based on the updated resource, the function corresponding to the target class is operated.
In actual implementation, a target class loader chain of a parent delegation mechanism and a class loader set corresponding to a plug-in class loader are adopted to determine a target class loader for loading a class corresponding to an update resource, and the class corresponding to the update resource is loaded based on the target class loader, so that hot repair operation of codes of an application program is realized. And based on a resource manager corresponding to the application program, loading the updated resources to the memory allocated by the terminal for the application program so as to realize the hot deployment of the resources of the application program. It can be understood that based on the update resource package, the hot update or hot deployment for the application program is realized, the server of the application program issues a plug-in resource package, after the terminal downloads the resource package, the application process of the application program is notified in a broadcast mode, and the application process loads the corresponding resource package through a class loader after receiving the broadcast notification, specifically, the terminal copies the update resource package to a designated plug-in installation catalog allocated for the application program; the method comprises the steps of loading an update resource package through a resource adding method of a reflection resource manager, loading a class corresponding to the update resource through a parent delegation mechanism (namely a target class loader chain) and a custom class loader list (namely a class loader set) adopted during class loading, dynamically replacing a father node of a host class loader during the operation of an application program through adjusting a parent delegation chain node (class loader chain) of the host class loader, namely replacing the father class of the host class loader with a plug-in class loader, and thus completing the automatic effect of the update resource package of the application program, and the whole update process does not need to restart the process of the application program.
In some embodiments, referring to fig. 8, fig. 8 is a flowchart of a resource loading method for updating a resource according to an embodiment of the present application, based on fig. 3, after step 105, further may be performed:
Step 301, the terminal obtains a resource loading path of the updated resource and a resource loader of the application program.
In actual implementation, after acquiring the update resource package, the terminal acquires a resource loading path of the update resource in the update resource package, where the update resource is a resource that needs to be added or replaced in the application program.
Illustratively, taking an android system as an example, the android resources are loaded by using a resource manager ASSETMANAGER, and then the resources are referenced and used in a class by a resource identifier.
Step 302, before the original resource loading path of the application program in the resource loader, the resource loading path is inserted, so as to obtain the target resource loading path.
In actual implementation, to be able to load preferentially to updated resources, the resource loading path may be inserted before the original resource loading path of the application in the resource loader. In this way, it can be ensured that
Step 303, loading the updated resources into the memory space of the application program according to the loading sequence indicated by the target resource loading path.
In actual implementation, similar to class loading, the android virtual machine performs resource loading according to the loading sequence indicated by the modified resource loading path (the resource is updated first and then the resource corresponding to the original application program), so that the resource is added in the original application program or replaced in the original application program.
By inserting the resource loading path of the updated resource before the resource loading path of the original application program, the updated resource in the updated resource package is loaded preferentially when the system virtual machine loads the resource, so that the resource is added to the original application program or replaced in the original application program.
In some embodiments, referring to fig. 9, fig. 9 is a flowchart of a loading method of a target class and an update resource according to an embodiment of the present application, based on fig. 3, after step 105, the method may further include:
In step 401, when the terminal can determine the target class loader of the target class based on at least one of the class loader set and the target class loader chain, the terminal obtains the class loading path of the target class.
In actual implementation, after the target class loader of the target class is determined, the loading operation of the target class is realized by determining the class loading path of the target class.
Step 402, controlling a target class loader to execute a loading operation for a target class based on a class loading path.
In actual implementation, the terminal controls the target class loader, and takes the class loading path of the target class as a parameter to realize loading operation for the target class.
In an android system, for example, loading the target class a, the android system invokes a loadClass method in the target class loader classloader to load the target class. The parameter of the loadClass method is the class loading path of the target class A.
Step 403, in the process of executing the loading operation, based on the resource identifier of the updated resource, acquiring the updated resource from the memory space of the application program.
In actual implementation, when the class corresponding to the updated resource is loaded, if the class has a reference to the resource, the updated resource can be obtained from the memory space of the application program according to the resource identifier of the updated resource.
Step 404, when the loading operation is completed, based on the updated resource, the function corresponding to the target class after the resource update is operated.
In practical implementation, the terminal controls the process of the application program, and after the dynamic loading of each type in the update resource package is completed according to the executable file, the parent delegation mechanism is combined, so that when each type in the update resource package is loaded in a priority manner, the resource is updated according to the resource loading path of each update resource in the update resource package and the reference condition of each type in the update resource package to each update resource based on the resource identifier, and the hot deployment of the application program is completed based on the update resource package.
In some embodiments, when the target class loader corresponding to the target class is not determined, the terminal may further display error prompt information, wherein when the target class loader of the target class cannot be determined based on at least one of the class loader set and the target class loader chain, the plug-in class loader is controlled to capture the abnormal information and generate error prompt information based on the abnormal information, and when the function corresponding to the target class is operated, the error prompt information is displayed, and the error prompt information is used for representing that the update operation of the application program based on the update resource package fails.
In actual implementation, when the class loader corresponding to the target class cannot be determined based on the target class loader chain or the class loader set, the plug-in class loader corresponding to the update resource package captures abnormal information that the corresponding class cannot be loaded successfully or the class loader cannot find, and displays error prompt information in a visual mode.
By taking an android system as an example, when a plug-in class loader captures an abnormality that a class does not find, error prompt information such as "function a is in perfection" can be popped up in an interface for displaying an application program.
In some embodiments, referring to fig. 10, fig. 10 is a flowchart of a method for obtaining an update resource package of an application program according to an embodiment of the present application, based on fig. 3, after step 105, further may be performed:
In step 501, the terminal receives an update notification sent by the server during the running process of the application program, where the update notification is used to indicate that the application program has an update resource package.
In actual implementation, the application program can receive the update notification issued by the server in real time in the running process. In addition, the application may also actively send an update request to the server to request an update resource package from the server.
Illustratively, the terminal, while running application a, presents "current application has an update, whether it is updated", and when an update is selected, sends an update request for application a to the server.
Step 502, downloading the update resource package to the local storage space according to the update notification.
In actual implementation, the terminal downloads an update resource package of the application program from the server to the local storage space according to the received update notification. And e.g. the android terminal downloads the update package of the application program to the local memory card.
In step 503, the process of the application program is notified, so that the process obtains the update resource package from the local storage space.
In actual implementation, after the terminal downloads the update resource package of the application program to the local, the update resource package downloaded by the terminal from the server is obtained from the local storage space by controlling the running process of the application program.
In some embodiments, referring to fig. 11, fig. 11 is a flowchart of a method for obtaining an update resource package of an application program according to an embodiment of the present application, based on fig. 3, after step 105, further may be performed:
In step 601, the terminal parses the executable file to obtain at least one class to be loaded included in the update resource package.
In practical implementation, for an operating application program, one update may be performed by a plurality of different functional modules, that is, the update resource package includes each class to be loaded, where one class to be loaded may represent one functional module, that is, one functional module corresponds to one class to be loaded.
Taking an android application as an example, in the running process of an application program a, when the application program a runs to a function B, a terminal detects an update resource package aiming at the function B issued by a server, and the android system analyzes the update resource package to obtain a class a to be loaded, a class B to be loaded and a class c to be loaded, wherein the class a to be loaded refers to the class B to be loaded and the class c to be loaded, and the class a to be loaded, the class B to be loaded and the class c to be loaded respectively correspond to different functions.
At step 602, a plug-in class loader for loading at least one class to be loaded is created.
In actual implementation, the terminal creates a plug-in class loader for loading classes to be loaded, and the plug-in class loader is used for realizing loading operation aiming at various classes in the update resource package.
The android system creates a plug-in class loader 1, a plug-in class loader 2 and a plug-in class loader 3 for loading the class a to be loaded, the class b to be loaded and the class c to be loaded.
Step 603, obtaining at least one non-plug-in class loader corresponding to the application program, and generating a class loader set including at least one non-plug-in class loader and other plug-in class loaders except for the plug-in class loader.
In the above example, when loading the class a to be loaded by the plug-in class loader 1, a target class loader chain corresponding to the class a to be loaded is determined based on the plug-in class loader 1, and a class loader set S corresponding to the plug-in class loader 1 is generated, wherein the S includes all class loaders, such as the plug-in class loader 2 and the plug-in class loader 3, required by other application programs in running, except for the plug-in class loader 1, and the class loaders are independent from each other and do not have a hierarchical relationship.
By applying the embodiment of the application, in the running process of an application program, a plug-in class loader corresponding to an update resource package is created, and a parent class loader of a host class loaded in a class loader chain of the application program is replaced by the plug-in class loader to obtain a target class loader chain, so that the target class to which the update resource belongs can be loaded by preferentially using the plug-in class loader when the resource is updated, meanwhile, the target class loader is determined by combining the target class loader chain and a class loader set, the accuracy of determining the target class loader can be ensured, the searching efficiency of the target class loader is improved, the target class is loaded by adopting the target class loader, and the function related to updating the resource is operated, so that the dynamic replacement resource identification can be realized in a mode of dynamically replacing the class loader in the running process of the program, and the updating of the resource can be realized without restarting the application process.
In the following, an exemplary application of the embodiment of the present application in a practical application scenario will be described.
The method comprises the steps that resource dynamic in android plug-in is only effective in the industry, for example, the existing hot repair in the industry is realized, the APP must be restarted in a hot update scheme to realize repair, hot repair is performed, hot update 'means that the whole package update of the APP is not needed, bug repair can be realized directly by issuing a repair package and then restarting the APP, and hot deployment' means that the APP does not need to update the whole package of the APP nor restart the APP, new resource application can be realized after the current process must be killed and restarted after resource dynamic update, in the mobile terminal face-brushing payment process, the APP process exists for 24 hours due to the APP use scene facing a service (ToB), experience influence is caused to the face-brushing payment flow if the APP is restarted, for example, the process restart needs to drag the speed of the face-brushing for the first time, the process restart can have an interrupt influence on the face-brushing of the merchant, and the face-brushing of the merchant can be perceived to cause the change of the face-receiving application of the merchant.
Based on the above, the embodiment of the application provides an updating method of an application program, which aims at a scheme that the dynamic effect of resources can be achieved without restarting a process under the special service scene, namely a hot deployment effect scheme of the android terminal resource level.
Next, a specific explanation will be given of an update method of an application program (i.e., a resource-level hot deployment is effective) provided by the embodiment of the present application.
In practical implementation, the loading of the resources in the android system is carried out by a resource manager (ASSETMANAG ER), and then the resources are referenced and used in a resolved manner through resource identification (used for representing the uniqueness of the resources) in code (class) implementation. Thus, for a resource dynamic update (i.e., resource hot deployment), on the one hand, the update resources (e.g., pictures, files, animations, etc.) of the update resource package may be loaded by the resource manager. On the other hand, because the field hot deployment in the code is effective, besides loading the updated resource package into the memory, the reference to the old resource identifier in the code is dynamically replaced, in practical application, the dynamic replacement of the resource identifier in the code (namely, the code repair is realized through the plug-in class loader) can be realized by adopting a mode of loading the class by an independent class loader (plug-in class loader), and the hot deployment of the android resource can be effective through the combination of the two modes. That is, the method for updating the application program provided by the embodiment of the application at least comprises two functional modules, namely 1) loading the updated resources based on the resource manager, namely loading the resources in the updated resource package into the terminal memory through the resource manager, and 2) loading the classes in the updated resource package based on the independent class loader, namely dynamically replacing the resource identifiers referenced by the codes in the updated resource package through the independent class loader.
Next, a process of loading updated resources based on the resource manager will be described. The updated resources in the updated resource package are loaded into the terminal memory through the resource manager. In practical implementation, refer to FIG. 12, FIG. 12 is a schematic flow chart of loading update Resources provided in the related art, in which the process of loading update Resources is as follows, a terminal executes step 1. A new resource manager ASSETSMANAGER object is recreated through reflection, then step 2 is executed, a resource loading interface is called through reflection, then step 3 is executed, corresponding plug-in Resources (i.e. update Resources such as host apk Resources, package apk Resources and plug-in apk Resources) are loaded into a storage space by calling an assayManager.addassetPath method, then step 4 is executed, whether a resource package is loaded or not is judged, if yes, step 4.1 is executed without repeated loading, and the loaded resource package index is directly returned, if no step 4.2 is executed, and then step 5 is executed, a system class ResourcesManager, a reflection LoadedApk class and a reflection Context system class are respectively reflected, finally, step 6 is executed, the update of resource objects in ResourcesImpl and the update of resource in the update LoadedApk, that is, all the update objects in the places in the update window can be guaranteed, that the update of the resource is, the resource in the application is updated by three places (i.e. the update of the resource objects in the view of the application is, the update of the resource is guaranteed).
Based on this, referring to fig. 13, fig. 13 is a schematic flow chart of loading for update resources according to an embodiment of the present application. Analyzing ResourcesManager kinds of source codes can determine that all Resources objects in the application program are stored in ResourcesManager (such as ResourcesImpl, resourcesRef, activityResourcesRef), obtaining all ASSETSMANAGER objects by traversing the attributes of the Resources, and adding plug-in Resources to updated Resources by a ADDASSETPATH method of ASSETSMANAGER. Therefore, the resource loading method in fig. 12 is modified, in fig. 13, steps 1-4 are the same as the steps in fig. 12, and step 5 is performed for the terminal by the modified resource loading method, and the system class is reflected ResourcesManager, and other system classes are not required to be reflected, so that the system overhead can be reduced, the performance is improved, step 6 is performed, all ResourcesManager objects are acquired, and step 7 is performed, and all ResourcesManager objects are loaded by calling an assmant.
Next, a procedure of loading the class in the update resource package based on the independent class loader will be described. That is, the resource identification referenced in the code is dynamically replaced based on the independent class loader. Referring to fig. 14, fig. 14 is a flowchart of a manner of loading references to resources provided in the related art, in which, taking loading resources in an android system as an example, in the android system, loading resources through step 1.Assetmanager, then executing step 2, calling an application class loader BaseClassLoader to load classes, then executing step 3, searching for referenced resource Identifications (IDs) in class codes, executing step 4 after finding the resource identifications, acquiring loaded resources in ASSETMANAGER according to the resource identifications, and finally executing step 5, analyzing the resources and using the resources. In practical implementation, the resource loading reference mode implemented based on fig. 14 needs to replace the resource identifiers one by one, the granularity of the resource identifiers is too small, the computing resource consumption for the system is large, and other functions can be abnormal, that is, the replacement resource identifiers have no realizability, and even the replacement from the granularity of the class has no realizability.
Based on this, referring to fig. 15, fig. 15 is a flowchart of a manner of loading references to resources provided by an embodiment of the present application. In the method, the dynamic replacement Class is modified into the dex where the dynamic replacement Class is located, and the dynamic replacement dex is realized by using a dynamic loading third-party dex method provided by the android system, so that the dynamic replacement Class (Class) is realized, and the dynamic replacement resource identification is realized. In the figure, loading resources in an android system is taken as an example, the resources are loaded through a step 1.AssetManager in the android system, then a step 2 is executed, a third party class loader is called to load classes, then a step 3 is executed, whether the classes are loaded successfully or not is judged, if the classes are not found, the step 4 is executed, the classes are called BaseClassLoader to load, then a step 5 is executed, resource identifiers are searched from the replaced classes, if the step 3 is judged to be loaded successfully, a step 6 is executed, the resource identifiers are searched from the new classes, finally a target resource identifier is found based on the step 5 or 6, and a step 7 is executed, and loaded resources are obtained in ASSETMANAGER according to the resource identifiers.
In practical implementation, the loading of the class is realized by adopting a parent delegation mechanism, namely, when the current class loader receives a class loading request for the class, the parent class is delegated to the own parent class for loading, based on the fact, a class corresponding to the update resource package can be loaded preferentially, an independent class loader can be created, the independent class loader is taken as the parent class loader of the current class loader, specifically, referring to fig. 16, fig. 16 is a flow chart of a dynamic loading class method provided by the embodiment of the application, the dynamic loading process in the diagram is as follows, the system executes step 1, an application program is started, 2, an application class loader BaseClassLoader for loading the class is created, 3, the class in the application program is loaded through BaseClassLoader, when the new class is loaded dynamically, step 4, a new class loader is created, step 5, the new class is loaded through the new class loader, step 6 is executed, a parent node (namely, the class loader) of BaseClassLoader is determined, step 7 is executed, then the step 7 is set as the parent node of the new loader is set, and step 34 is set as the parent node of the new parent node is created, and step 34 is set as the parent node of the new loader is created. By replacing the parent class loader, dynamic loading of the classes is realized, and thus, information in the update resource package can be ensured to be loaded preferentially always.
In practical implementation, referring to fig. 17, fig. 17 is a flow chart of a Class loading mode provided in the related art, in the drawing, for a Class loading mode adopting a parent delegation mechanism, execution starts in step 1. When an application Class loader BaseClassLoader receives a Class loading request for a Class, execution starts in step 2. Whether the Class is loaded by itself is judged, if yes, execution starts in step 5. The Class loading is indicated to be successful, if not, execution starts in step 3, the Class loader BootClassLoader (the Class loader corresponding to the starting Class) is delegated to load, execution starts in step 4. Judgment is made in step BootClassLoader as to whether the Class is loaded, if yes, execution starts in step 5. The Class loading is indicated to be successful, and if no execution starts in step 6. The Class loader corresponding to the Class loading failure application is indicated. In practical implementation, based on the mode of fig. 17, if only the parent delegates to load the Class of the plug-in, the plug-in Class can be loaded in the host apk, but the host Class cannot be loaded in the plug-in apk, and other plug-in classes cannot be loaded in the plug-in apk, so that ClassNotFoundException exception is encountered, and the hot deployment cannot be effectively implemented naturally. Based on this, referring to fig. 18, fig. 18 is a flowchart of a loading manner of a class referenced for an update resource package according to an embodiment of the present application. In the figure, each third party class loader ClassLoader is used as a node in a chain of the parent delegation class loaders, firstly, class is unloaded through a parent delegation mode, if the class is not loaded, a class loader set (comprising an application class loader BaseClassLoader, a third party class loader 1, a third party class loader 2) is stored in the third party class loader, then ClassNotFoundException is captured in the third party class loader and is downgraded into the class loader set to continue loading the class, so that a host apk can be realized, a plug-in apk can be used for randomly loading the class of the other party, by the class loading mechanism, dynamic replacement of a resource ID is realized, and the method of dynamically replacing the parent of the ClassLoader can be realized without restarting, so that the new resource ID is realized without restarting, hot deployment of the resource ID is realized, and dynamic loading of the resource package to a memory is realized by combining a ADDASSETPATH interface of ASSETMANAGER, and android hot deployment is realized on the whole.
In actual implementation, when there are multiple update resource packages to update, a class loader for loading the resource packages to be updated may be used as a parent (class) loader of the current loader of the application program. Referring to fig. 19, fig. 19 is a schematic diagram of a method for dynamically loading classes based on multiple update resource packages according to an embodiment of the present application, in which class loaders corresponding to two update resource packages are respectively a third party ClassLoader1 and a third party ClassLoader2, a parent class loader of BaseClassLoader is replaced with the third party ClassLoader1 to implement deployment for the update resource package 1, and then the parent class loader of BaseClassLoader is replaced with the third party ClassLoader2 to implement deployment for the update resource package 2. The whole process does not need to restart the process, and the resource update effect can be realized only by replacing the ClassLoader of the parent.
In the above embodiment, the dynamic replacement of the Dex is realized by adopting a combination of the parent delegation loading and the cache list ClassLoader loading based on the independent ClassLoader, so that the process can realize the hot deployment effect of the android resource without restarting.
By applying the embodiment of the application, when the terminal needs to change the Zhuozi source, the whole package APK does not need to be updated, a resource package (which can contain pictures, layout configuration and the like) needing to be updated is directly issued, the resource package is downloaded at the terminal, and then the APP process of the terminal can be realized without restarting by loading the resource package through the scheme.
It will be appreciated that in the embodiments of the present application, related data such as user information is involved, and when the embodiments of the present application are applied to specific products or technologies, user permissions or agreements need to be obtained, and the collection, use and processing of related data need to comply with relevant laws and regulations and standards of relevant countries and regions.
Continuing with the description below of an exemplary architecture of the application resource updating device 555 implemented as a software module provided by embodiments of the present application, in some embodiments, as shown in fig. 2, the software modules stored in the application resource updating device 555 of the memory 550 may include:
The obtaining module 5551 is configured to obtain an update resource package of an application program during an application program running process, where the update resource package includes update resources and executable files;
a generating module 5552, configured to create a plug-in class loader corresponding to the update resource package based on the executable file, and generate a class loader set including at least one non-plug-in class loader;
A replacing module 5553, configured to obtain a host class loader from a class loader chain corresponding to the application program, and replace a parent class loader of the host class loader with the plug-in class loader, to obtain a target class loader chain;
A lookup module 5554, configured to determine, based on at least one of the class loader set and the target class loader chain, a target class loader for loading a target class to which the updated resource belongs;
And the operation module 5555 is configured to load the target class through the target class loader, and operate a function corresponding to the target class based on the updated resource.
In some embodiments, the searching module is further configured to determine, based on class loaders corresponding to nodes in the target class loader chain, a target class loader for loading a target class to which the updated resource belongs, and determine, when the target class loader cannot be determined based on the target class loader chain, the target class loader based on each class loader in the class loader set, wherein class loaders in the target class loader chain have a hierarchical relationship, and class loaders in the class loader set do not have a hierarchical relationship.
In some embodiments, the search module is further configured to determine a sub-hierarchy relationship taking the plug-in class loader as a lowest hierarchy based on a hierarchy relationship between various loaders in the target class loader chain, obtain class loading paths of class loaders of each hierarchy in the sub-hierarchy relationship from the plug-in class loader, obtain a target class loading path of the target class, compare the target class loading path with each class loading path to obtain a comparison result, and when the comparison result characterizes that the target class loading path is different from any class loading path, use the plug-in class loader as a target class loader of the target class.
In some embodiments, the searching module is further configured to obtain class loading paths of various classes of loaders in the class loader set, obtain a target class loading path of the target class, search the target class loading path in the class loading paths of the various classes of loaders to obtain a search result, and when the search result characterizes that the target class loading path exists in the class loading paths of the various classes of loaders, use a class loader to which the class loading path belongs as the target class loader.
In some embodiments, the searching module is further configured to identify a type of a target class to which the updated resource belongs, where the type includes a host class and a plug-in class, where the host class is a class loaded by a host class loader when the application is installed, and the plug-in class is a class loaded by a plug-in class loader when the application is running;
In some embodiments, the lookup module is further configured to determine, when the type is a host class, a target class loader for loading the target class from at least one non-plug-in class loader in the class loader set, obtain, when the type is a plug-in class, a reference class identifier set corresponding to the plug-in class loader, and determine, based on one of the class loader set and the target class loader chain and the reference class identifier set, a target class loader for loading the target class, where the reference class identifier is a class identifier of another class referenced in the plug-in class loader.
In some embodiments, the search module is further configured to match a class identifier of the target class with each type of identifier in the reference class identifier set to obtain a matching result, determine, based on the class loader set, a target class loader for loading the target class when the matching result indicates that the class identifier of the target class belongs to the reference class identifier set, and determine, based on the target class loader chain, a target class loader for loading the target class when the matching result indicates that the class identifier of the target class does not belong to the reference class identifier set.
In some embodiments, the running module is further configured to obtain a resource loading path of the updated resource and a resource loader of the application program, insert the resource loading path before an original resource loading path of the application program in the resource loader to obtain a target resource loading path, and load the updated resource into a memory space of the application program according to a loading sequence indicated by the target resource loading path.
In some embodiments, the running module is further configured to, when the target class loader of the target class can be determined based on at least one of the class loader set and the target class loader chain, obtain a class loading path of the target class, control the target class loader, and execute a loading operation for the target class based on the class loading path, and in a process of executing the loading operation, obtain the updated resource from a memory space of the application program based on a resource identifier of the updated resource, and when the loading operation is completed, run a function corresponding to the target class after resource update based on the updated resource.
In some embodiments, the running module is further configured to control the plug-in class loader to capture exception information and generate error prompt information based on the exception information when a target class loader of the target class cannot be determined based on at least one of the class loader set and the target class loader chain, and when a function corresponding to the target class is run, display the error prompt information, where the error prompt information is used to characterize that an update operation for the application program based on the update resource package fails.
In some embodiments, the obtaining module is further configured to receive an update notification sent by the server during an application running process, where the update notification is used to indicate that an update resource package exists in the application, and download the update resource package to a local storage space according to the update notification, and notify a process of the application, so that the process obtains the update resource package from the local storage space.
In some embodiments, the generating module is further configured to parse the executable file to obtain at least one class to be loaded included in the update resource package, create a plug-in class loader for loading the at least one class to be loaded, obtain at least one non-plug-in class loader corresponding to the application program, and generate a class loader set including at least one non-plug-in class loader and other plug-in class loaders except for the plug-in class loader.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the resource updating method of the application program according to the embodiment of the present application.
An embodiment of the present application provides a computer-readable storage medium storing executable instructions, where the executable instructions are stored, which when executed by a processor, cause the processor to perform a resource updating method of an application program provided by the embodiment of the present application, for example, a resource updating method of an application program as shown in fig. 3.
In some embodiments, the computer readable storage medium may be FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM, or various devices including one or any combination of the above.
In some embodiments, the executable instructions may be in the form of programs, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and they may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
As an example, executable instructions may, but need not, correspond to files in a file system, may be stored as part of a file that holds other programs or data, such as in one or more scripts in a hypertext markup language (HTML, hyper Text Markup Language) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices located at one site or distributed across multiple sites and interconnected by a communication network.
In summary, the embodiment of the application realizes dynamic resource replacement, thereby realizing the effect of hot deployment of resources without restarting the process.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (17)

1. A method for updating resources of an application program, the method comprising:
In the running process of an application program, acquiring an update resource package of the application program, wherein the update resource package comprises update resources and executable files;
Creating a plug-in class loader corresponding to the update resource package based on the executable file, and generating a class loader set comprising at least one non-plug-in class loader;
acquiring a host class loader from a class loader chain corresponding to the application program, and replacing a parent class loader of the host class loader with the plug-in class loader to obtain a target class loader chain;
Determining a target class loader for loading a target class to which the updated resource belongs based on at least one of the class loader set and the target class loader chain;
loading the target class through the target class loader, and running the function corresponding to the target class based on the updated resource;
wherein the determining, based on at least one of the class loader set and the target class loader chain, a target class loader for loading the target class to which the updated resource belongs includes:
Determining a target class loader for loading the target class to which the updated resource belongs based on class loaders corresponding to all nodes in the target class loader chain;
When the target class loader is not determined based on the target class loader chain, determining the target class loader based on various classes of loaders in the class loader set, wherein the class loaders in the target class loader chain have a hierarchical relationship, and the class loaders in the class loader set do not have a hierarchical relationship.
2. The method of claim 1, wherein the determining, based on the class loader corresponding to each node in the target class loader chain, the target class loader for loading the target class to which the updated resource belongs comprises:
Determining a sub-hierarchy relationship taking the plug-in class loader as the lowest hierarchy based on the hierarchy relationship among various loaders in the target class loader chain;
obtaining class loading paths of class loaders of all levels in the sub-level relation from the plug-in class loader;
obtaining a target class loading path of the target class, and comparing the target class loading path with each class loading path to obtain a comparison result;
And when the comparison result represents that the target class loading path is different from any class loading path, taking the plug-in class loader as a target class loader of the target class.
3. The method of claim 1, wherein the determining the target class loader based on each class loader in the set of class loaders comprises:
Acquiring class loading paths of various classes of loaders in the class loader set;
obtaining a target class loading path of the target class, and searching the target class loading path in class loading paths of various loaders to obtain a searching result;
When the search result represents that the target class loading path exists in the class loading paths of the various classes of loaders, the class loader to which the class loading path belongs is used as the target class loader.
4. The method of claim 1, wherein the method further comprises:
Identifying the type of the target class to which the updated resource belongs, wherein the type comprises a host class and a plug-in class;
The host class is a class loaded by a host class loader when the application program is installed, and the plug-in class is a class loaded by a plug-in class loader when the application program is operated;
the determining, based on at least one of the class loader set and the target class loader chain, a target class loader for loading the target class to which the updated resource belongs, includes:
when the type is a host class, determining a target class loader for loading the target class from at least one non-plug-in class loader in the class loader set;
when the type is a plug-in class, acquiring a reference class identifier set corresponding to the plug-in class loader, and determining a target class loader for loading the target class based on one of the class loader set and the target class loader chain and the reference class identifier set;
Wherein the reference class identifier is a class identifier of other classes referenced in the plug-in class loader.
5. The method of claim 4, wherein the determining a target class loader for loading the target class based on the set of reference class identifiers and one of the set of class loaders and the target class loader chain comprises:
Matching the class identifier of the target class with various identifiers in the reference class identifier set to obtain a matching result;
when the matching result represents that the class identifier of the target class belongs to the reference class identifier set, determining a target class loader for loading the target class based on the class loader set;
and determining a target class loader for loading the target class based on the target class loader chain when the matching result characterizes that the class identifier of the target class does not belong to the reference class identifier set.
6. The method of claim 1, wherein prior to running the function corresponding to the target class based on the updated resource, the method further comprises:
acquiring a resource loading path of the updated resource and a resource loader of the application program;
before the original resource loading path of the application program in the resource loader, inserting the resource loading path to obtain a target resource loading path;
and loading the updated resources into the memory space of the application program according to the loading sequence indicated by the target resource loading path.
7. The method of claim 6, wherein loading the target class by the target class loader comprises:
When a target class loader of the target class can be determined based on at least one of the class loader set and the target class loader chain, acquiring a class loading path of the target class, controlling the target class loader, and executing loading operation for the target class based on the class loading path;
the running the function corresponding to the target class based on the updated resource comprises the following steps:
And in the process of executing the loading operation, acquiring the updated resource from the memory space of the application program based on the resource identification of the updated resource, and running the function corresponding to the target class after resource updating based on the updated resource when the loading operation is completed.
8. The method of claim 1, wherein the method further comprises:
when the target class loader of the target class cannot be determined based on at least one of the class loader set and the target class loader chain, controlling the plug-in class loader to capture abnormal information, and generating error prompt information based on the abnormal information;
when the function corresponding to the target class is operated, displaying the error prompt information;
The error prompt information is used for representing failure of updating operation of the application program based on the updating resource package.
9. The method of claim 1, wherein the obtaining, during the running of the application, the updated resource package of the application comprises:
in the running process of an application program, receiving an update notification issued by a server, wherein the update notification is used for indicating that an update resource package exists in the application program;
And downloading the update resource package to a local storage space according to the update notification, and notifying the process of the application program so that the process obtains the update resource package from the local storage space.
10. The method of claim 1, wherein creating a plug-in class loader corresponding to the update package based on the executable file comprises:
analyzing the executable file to obtain at least one class to be loaded, which is included in the update resource package;
Creating a plug-in class loader for loading the at least one class to be loaded;
the generating a class loader set including at least one non-plug-in class loader includes:
and acquiring at least one non-plug-in class loader corresponding to the application program, and generating a class loader set comprising at least one non-plug-in class loader and other plug-in class loaders except the plug-in class loader.
11. A resource updating apparatus for an application program, the apparatus comprising:
The system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring an update resource package of an application program in the running process of the application program, and the update resource package comprises update resources and executable files;
The generation module is used for creating a plug-in class loader corresponding to the update resource package based on the executable file and generating a class loader set comprising at least one non-plug-in class loader;
the replacing module is used for acquiring a host class loader from a class loader chain corresponding to the application program, and replacing a parent class loader of the host class loader with the plug-in class loader to obtain a target class loader chain;
The searching module is used for determining a target class loader for loading the target class to which the updated resource belongs based on at least one of the class loader set and the target class loader chain; the searching module is used for determining a target class loader for loading the target class to which the updated resource belongs based on class loaders corresponding to all nodes in the target class loader chain, and determining the target class loader based on various classes of loaders in the class loader set when the target class loader cannot be determined based on the target class loader chain, wherein the class loaders in the target class loader chain have a hierarchical relationship and the class loaders in the class loader set do not have a hierarchical relationship;
and the operation module is used for loading the target class through the target class loader and operating the function corresponding to the target class based on the updated resource.
12. The apparatus of claim 11, wherein the device comprises a plurality of sensors,
The search module is further configured to determine a sub-hierarchy relationship taking the plug-in class loader as a lowest hierarchy based on a hierarchy relationship between various loaders in the target class loader chain, obtain class loading paths of class loaders of each hierarchy in the sub-hierarchy relationship from the plug-in class loader, obtain a target class loading path of the target class, compare the target class loading path with each class loading path to obtain a comparison result, and when the comparison result characterizes that the target class loading path is different from any class loading path, use the plug-in class loader as the target class loader of the target class.
13. The apparatus of claim 11, wherein the device comprises a plurality of sensors,
The searching module is further configured to obtain class loading paths of various classes of loaders in the class loader set, obtain a target class loading path of the target class, search the target class loading path in the class loading paths of the various classes of loaders to obtain a searching result, and when the searching result characterizes that the target class loading path exists in the class loading paths of the various classes of loaders, use a class loader to which the class loading path belongs as the target class loader.
14. The apparatus of claim 11, wherein the device comprises a plurality of sensors,
The searching module is further configured to identify a type of a target class to which the updated resource belongs, where the type includes a host class and a plug-in class, the host class is a class loaded by a host class loader when the application is installed, the plug-in class is a class loaded by a plug-in class loader when the application is running, when the type is the host class, a target class loader for loading the target class is determined from at least one non-plug-in class loader in the class loader set, when the type is the plug-in class, a reference class identifier set corresponding to the plug-in class loader is obtained, and a target class loader for loading the target class is determined based on one of the class loader set and the target class loader chain and the reference class identifier set, where the reference class identifier is a class identifier of another class referenced in the plug-in class loader.
15. An electronic device, the electronic device comprising:
A memory for storing executable instructions;
A processor for implementing the resource updating method of an application program according to any one of claims 1 to 10 when executing executable instructions stored in said memory.
16. A computer readable storage medium storing executable instructions which when executed by a processor implement the method of resource updating of an application of any of claims 1 to 10.
17. A computer program product comprising a computer program or instructions which, when executed by a processor, implements the method of resource updating of an application program of any of claims 1 to 10.
CN202210788001.1A 2022-07-04 2022-07-04 Resource updating method, device and equipment of application program and readable storage medium Active CN115129348B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210788001.1A CN115129348B (en) 2022-07-04 2022-07-04 Resource updating method, device and equipment of application program and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210788001.1A CN115129348B (en) 2022-07-04 2022-07-04 Resource updating method, device and equipment of application program and readable storage medium

Publications (2)

Publication Number Publication Date
CN115129348A CN115129348A (en) 2022-09-30
CN115129348B true CN115129348B (en) 2025-07-29

Family

ID=83381802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210788001.1A Active CN115129348B (en) 2022-07-04 2022-07-04 Resource updating method, device and equipment of application program and readable storage medium

Country Status (1)

Country Link
CN (1) CN115129348B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116610387B (en) * 2023-07-17 2023-10-03 杭州比智科技有限公司 Channel docking and data analysis method based on dynamic loading and bitmap
CN119201188A (en) * 2024-09-13 2024-12-27 中电金信软件有限公司 A plug-in dynamic loading method, device, electronic device and storage medium
CN120215996B (en) * 2025-05-28 2025-08-26 杭州新中大科技股份有限公司 Java program dynamic updating method, device, equipment, medium and product

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108491216A (en) * 2018-03-05 2018-09-04 北京指掌易科技有限公司 A kind of method of android system unaware application installation upgrading
CN111625256A (en) * 2020-05-15 2020-09-04 广东浪潮大数据研究有限公司 Application program upgrading method, system, equipment and computer storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7434215B2 (en) * 2003-09-11 2008-10-07 International Business Machines Corporation Mechanism for loading plugin classes at an appropriate location in the class loader hierarchy
US7721277B1 (en) * 2004-06-08 2010-05-18 Oracle America, Inc. Hot deployment of shared modules in an application server
CN102402427B (en) * 2010-09-09 2015-09-02 阿里巴巴集团控股有限公司 A kind of update method of java application and device
US8910138B2 (en) * 2012-05-23 2014-12-09 Oracle International Corporation Hot pluggable extensions for access management system
CN112035153B (en) * 2019-05-14 2021-08-24 腾讯科技(深圳)有限公司 Application updating method, device, terminal and storage medium
CN113656057A (en) * 2021-08-26 2021-11-16 深圳市天天来玩科技有限公司 JAVA file updating method, network equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108491216A (en) * 2018-03-05 2018-09-04 北京指掌易科技有限公司 A kind of method of android system unaware application installation upgrading
CN111625256A (en) * 2020-05-15 2020-09-04 广东浪潮大数据研究有限公司 Application program upgrading method, system, equipment and computer storage medium

Also Published As

Publication number Publication date
CN115129348A (en) 2022-09-30

Similar Documents

Publication Publication Date Title
CN115129348B (en) Resource updating method, device and equipment of application program and readable storage medium
EP3441876B1 (en) Patch upgrade-based file processing method and device, terminal, and storage medium
RU2421785C2 (en) Automated control of device drivers
US8245217B2 (en) Management of software and operating system updates required for the process of creating a virtual machine facsimile of an existing physical or virtual machine
CN105657191B (en) Application increment upgrading method and system based on Android system
EP2791850B1 (en) Identifying application resources through implicit application models
CN106020873B (en) Patch package loading method and device
JP2021002317A (en) Method, apparatus, device and storage medium for upgrading application
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
CN109614167B (en) Method and system for managing plug-ins
KR101368550B1 (en) Terminal Having Module Protecting Function and Module Managing Method Using The Same
CN114077423A (en) Airport APP development container architecture based on mobile cross-platform
US11144292B2 (en) Packaging support system and packaging support method
CN101694625A (en) Method and device for upgrading client software based on encryption sever management
CN112256989B (en) Page loading method, device, terminal equipment and storage medium based on offline package
CN110765394B (en) Method and device for loading so files, storage medium and terminal equipment
CN113760339A (en) Vulnerability repair method and device
CN111427594A (en) Application program running method and device
WO2021223544A1 (en) Application starting method and related device
CN117688551A (en) Startup path white list updating method and device, electronic equipment and storage medium
CN115185644A (en) Detection method, system, equipment and storage medium based on container interactive application
CN102216901B (en) Component extension method and device
CN117170640A (en) A component management method, device and readable storage medium for a low-code platform
US12236224B2 (en) Systems and methods for managing workspaces in a heterogeneous workspace environment
CN120216056B (en) Cross-terminal service framework implementation method and device, electronic equipment and storage medium

Legal Events

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