CN112052044A - Application loading method and device, storage medium and electronic equipment - Google Patents
Application loading method and device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN112052044A CN112052044A CN202010819784.6A CN202010819784A CN112052044A CN 112052044 A CN112052044 A CN 112052044A CN 202010819784 A CN202010819784 A CN 202010819784A CN 112052044 A CN112052044 A CN 112052044A
- Authority
- CN
- China
- Prior art keywords
- party
- package
- application
- loader
- 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.)
- Pending
Links
- 238000011068 loading method Methods 0.000 title claims abstract description 98
- 230000001419 dependent effect Effects 0.000 claims abstract description 146
- 238000000034 method Methods 0.000 claims abstract description 34
- 238000004806 packaging method and process Methods 0.000 claims description 25
- 238000004590 computer program Methods 0.000 claims description 7
- 230000006870 function Effects 0.000 description 14
- 238000002955 isolation Methods 0.000 description 14
- 238000011161 development Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 239000003795 chemical substances by application Substances 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012858 packaging process Methods 0.000 description 2
- 238000012856 packing Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 239000012141 concentrate Substances 0.000 description 1
- 238000009795 derivation Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000012536 packaging technology Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000010897 surface acoustic wave method Methods 0.000 description 1
- 238000013024 troubleshooting Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4406—Loading of operating system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
Abstract
The application provides an application loading method, an application loading device, a storage medium and electronic equipment, wherein the method comprises the following steps: obtaining at least one third party dependency package that a target application depends on; creating a third-party loader corresponding to each third-party dependent package; and respectively loading the third-party dependent packages corresponding to the third-party loaders through the third-party loaders. By adopting the embodiment of the application, the problem of class conflict errors caused by the fact that different third parties rely on different versions of the same class library can be solved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to an application loading method and apparatus, a storage medium, and an electronic device.
Background
With the increasing use of various computer languages in the internet and related fields, a large number of basic libraries written based on computer languages are presented for selection of various application programs. Each application can hardly avoid relying on a large number of third party dependent packages. In addition, the content contained in the current project is more and more complex and richer in function, and modular development of multi-team cooperation is needed. With the development and popularization of microservices, various framework and middleware technologies are widely applied to various large companies. With the development of the technologies, an application program faces a very urgent problem, that is, different third party dependent packages may depend on different versions of the same class library, and a class conflict error may occur during running, so that the application program is abnormal and cannot provide services.
Disclosure of Invention
In order to solve the above problem, embodiments of the present application provide an application loading method, an application loading apparatus, a storage medium, and an electronic device, which can avoid a conflict-like error occurring during program running. The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides an application loading method, including the following steps:
obtaining at least one third party dependency package that a target application depends on;
creating a third-party loader corresponding to each third-party dependent package;
and respectively loading the third-party dependent packages corresponding to the third-party loaders through the third-party loaders.
In a second aspect, an embodiment of the present application provides an application loading apparatus, including:
the package obtaining unit is used for obtaining at least one third-party dependent package which is dependent on the target application;
the loader creating unit is used for creating a third-party loader corresponding to each third-party dependent package;
and the package loading unit is used for respectively loading the third-party dependent packages corresponding to the third-party loaders through the third-party loaders.
In a third aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of any one of the above methods.
In a fourth aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of any one of the above methods when executing the program.
Different versions of the same class library may be depended on among different third-party dependent packages, and when a plurality of third-party dependent packages are loaded by the same loader, class conflict errors may occur during operation. In the embodiment of the application, each third-party dependent package is loaded by the third-party loader corresponding to each third-party dependent package, so that the error problem of class conflict caused by the fact that different third-party dependent packages depend on different versions of the same class library can be avoided.
Drawings
Fig. 1 is a schematic flowchart of an application loading method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another application loading method according to an embodiment of the present application;
FIG. 3 is a schematic flowchart illustrating container startup and class loading according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an application loading apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The present application is further described with reference to the following figures and examples.
In the following description, the terms "first" and "second" are used for descriptive purposes only and are not intended to indicate or imply relative importance. The following description provides embodiments of the present application, where different embodiments may be substituted or combined, and thus the present application is intended to include all possible combinations of the same and/or different embodiments described. Thus, if one embodiment includes feature A, B, C and another embodiment includes feature B, D, then this application should also be considered to include an embodiment that includes one or more of all other possible combinations of A, B, C, D, even though this embodiment may not be explicitly recited in text below.
The following description provides examples, and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made in the function and arrangement of elements described without departing from the scope of the disclosure. Various examples may omit, substitute, or add various procedures or components as appropriate. For example, the described methods may be performed in an order different than the order described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.
Different versions of the same class library may be depended on by different third-party dependency packages, and class conflict errors may occur at the time of operation. To solve the above problem, a centralized dependency management method for the project may be adopted. Each third party dependency package only maintains one version in the project, and the leader defines the list of versions for which the project uses the dependency package, and all modules must comply with this rule. The main disadvantages of the above solution are: the workload of unified management dependence is very large, and the versions of the third-party dependent packages on which the modules depend are not compatible, so that the modules need to modify own codes because the versions of the dependent packages are updated, and the time cost for communicating and unifying the versions of the dependent packages is too expensive; every time a module is added or the module is updated, the version checking work of the third-party dependence package needs to be done again, except for time cost, the quality of software is difficult to guarantee, and abnormity is likely to occur during operation.
The class conflict problem caused by referencing multiple third party dependent packages can also be solved in the following manner. And each third-party module modifies the package name of the dependent package and repacks the dependent package by using the packaging plug-in. This avoids the appearance of classes and packages of the same name. The main disadvantages of the above solution are: the third-party dependent packages are renamed to cause that the dependency management is very confused, and after some basic third-party dependent package names are modified, packages which depend on the third-party dependent packages by an upper layer have to be repackaged, recursive packaging operations are performed, items are very confused, and the availability and maintainability are completely not guaranteed.
Based on the analysis, the embodiment of the application provides an application loading scheme, the scheme can conveniently realize lightweight class isolation, projects do not need to maintain the same dependent version list any more, and each application module uses the version required by the application module, so that the application module is simple and stable without mutual influence. Referring to fig. 1, fig. 1 is a schematic flowchart of an application loading method provided in an embodiment of the present application, where the method includes:
s101, obtaining at least one third party dependency package depended by the target application.
The third party dependent package on which the target application depends is a third party dependent package which needs to be loaded or called in the running process of the target application. The third party dependency packages may include code packages, middleware packages, framework packages, etc. that perform particular functions.
The third-party dependent package depended by the target application can be obtained based on the code of the target application, and the third-party dependent package depended by the target application can also be obtained based on the code package packed by the target application. The method for obtaining the third-party dependency package depended on by the target application is not limited in the embodiment of the application.
And S102, creating a third-party loader corresponding to each third-party dependent package.
The number of third party loaders is the same as the number of third party dependent packages. The third-party loader and the third-party dependency packages are in one-to-one correspondence.
The loader is used for loading the program and placing the loaded program in the memory to enable the program to start running. The step of loading the program includes reading the executable file, writing the contents of the executable file to memory, and performing other required preparatory tasks. After the loading is completed, the operating system will give control to the loaded program to let the program start to operate.
S103, respectively loading the third-party dependent packages corresponding to the third-party loaders through the third-party loaders.
And loading the third-party dependent packages corresponding to the third-party dependent packages by the third-party loader corresponding to each third-party dependent package. The method comprises the following steps of enabling each third-party dependent package to be loaded in an isolated state by using at least one third-party loader, and solving the problem of class conflict.
Further, S103 may include:
respectively loading a first type of third-party dependent packages corresponding to each third-party loader through the third-party loaders, wherein the first type of third-party dependent packages correspond to loaded classes;
and/or loading a second type of third-party dependent packages corresponding to each third-party loader through the third-party loaders respectively, wherein the second type of third-party dependent packages correspond to classes in a software development kit;
and/or loading a third type of third-party dependent package corresponding to each third-party loader through the third-party loader respectively, wherein the third type of third-party dependent package corresponds to a class in other third-party dependent packages called by the third-party dependent package;
and/or respectively loading a fourth type of third-party dependent package corresponding to each third-party loader through the third-party loader, wherein the fourth type of third-party dependent package corresponds to the class of the third-party dependent package;
and/or loading a fifth type of third-party dependent packages corresponding to each third-party loader through the third-party loaders respectively, wherein the fifth type of third-party dependent packages correspond to the classes in the language agent module.
The third party dependency packages may include the first type of third party dependency package, the second type of third party dependency package, the third type of third party dependency package, the fourth type of third party dependency package, and the fifth type of third party dependency package described above. By separating the third party dependent packages into different categories of code packages, the loading process of the third party dependent packages may be made more efficient.
Further, S103 may include:
and loading the third-party dependent packages corresponding to each third-party loader through the third-party loaders respectively according to the sequence of the first-class third-party dependent packages, the second-class third-party dependent packages, the third-class third-party dependent packages, the fourth-class third-party dependent packages and the fifth-class third-party dependent packages.
The third party dependency packages may include the first type of third party dependency package, the second type of third party dependency package, the third type of third party dependency package, the fourth type of third party dependency package, and the fifth type of third party dependency package described above. By dividing the third-party dependent packages into different types of code packages and sequentially loading the code packages in sequence, the running speed of the target application can be increased, and system resources are saved.
Further, the method further comprises:
creating an application loader;
and loading the code package of the target application through the application loader.
The code of the target application may call a class library that is a different version of the class library referenced in the third-party dependency package than the class library called by the target application. Alternatively, multiple classes may be defined in the code package of the target application, and the names of the classes in the target application may be the same as the names of the classes in the multiple third-party dependency packages. Thus, a class conflict problem may also arise if the same loader is used to load the third party dependent packages and the code packages of the target application.
In the embodiment of the application, different loaders are adopted to load the code packet and the third-party dependent packet of the target application respectively, so that the problem of conflict between the class called or defined in the target application and the class in the third-party dependent packet can be solved.
Further, the loading, by the application loader, the code package of the target application includes:
loading, by the application loader, a first class of application code package, the first class of application code package corresponding to a loaded class;
and/or loading a second type of application code package through the application loader, the second type of application code package corresponding to a class in a software development kit;
and/or loading a third type of application code package through the application loader, wherein the third type of application code package corresponds to a class in other third party dependent packages;
and/or loading a fourth type of application code package through the application loader, wherein the fourth type of application code package corresponds to a class in a module of the fourth type of application code package;
and/or loading a fifth type of application code package through the application loader, wherein the fifth type of application code package corresponds to a class in the language agent module.
The code packages of the target application can comprise the first type of application code package, the second type of application code package, the third type of application code package, the fourth type of application code package and the fifth type of application code package. By separating the code packages of the target application into different classes of code packages, the loading process of the code packages of the target application can be made more efficient.
Further, the loading, by the application loader, the code package of the target application includes:
and loading the code packet of the target application through the application loader according to the sequence of the first type application code packet, the second type application code packet, the third type application code packet, the fourth type application code packet and the fifth type application code packet.
The code packages of the target application can comprise the first type of application code package, the second type of application code package, the third type of application code package, the fourth type of application code package and the fifth type of application code package. The code packets of the target application are divided into different types of code packets and sequentially loaded, so that the running speed of the target application can be increased, and system resources are saved.
According to the program loading method provided by the embodiment of the application, each third-party dependent package is loaded through the third-party loader corresponding to each third-party dependent package, the problem of class conflict errors caused by the fact that different third-party dependent packages depend on different versions of the same class library can be avoided, and smooth execution of target application is guaranteed.
Referring to fig. 2, fig. 2 is a schematic flowchart of another application loading method provided in the embodiment of the present application, where the method includes:
s201, obtaining at least one third party dependency package depended by the target application.
The method of the embodiment of the application can be applied to an application developer who applies a third-party dependency package to develop projects. At least one third party dependency package on which the target application depends is obtained. The third party dependent package may have a specific format to facilitate the following packaging process of step S202.
Further, the third party relying package provider can be a middleware developer or an independent business module developer, or the like. These providers may reference a class isolation container packaging tool in the project to package the code into a package in a first format during the project packaging phase.
The class isolation container packaging tool is a package that can be used by the third party dependent package provider to package the relevant code into a first format.
S202, packaging the code of the target application and the at least one third-party dependent package into a code package with a preset format.
The developer of the target application may package the code of the target application and the third party dependent package acquired in step S201 into a code package of a predetermined second format.
It should be noted that the code package in the first format and the code package in the second format may have the same format or different formats, so that the packaging purpose of the embodiment of the present application can be achieved, and the third party dependent package on which the target application depends may be obtained through the following S203.
Further, a developer of the target application may reference a class isolation container packaging tool in the project engineering to package code of the target application into a package in a second format during a project packaging phase.
The class isolation container packaging tool may also be used for developers of the above-described target applications to package related code into packages of a second format.
S203, acquiring at least one third party dependent package dependent on the target application based on the code package with the preset format.
And S204, creating a third-party loader corresponding to each third-party dependent package.
S205, respectively loading the third-party dependent packages corresponding to the third-party loaders through the third-party loaders.
In the application loading method provided by the embodiment of the application, a packing method is provided, which can pack the target application into a predetermined format, so that when the target application runs, different third party dependent packages on which the target application depends can be loaded by using a plurality of independent loaders through the packages in the predetermined format, thereby avoiding the possibility of class conflict and conveniently and efficiently solving the problem of class conflict.
The embodiment of the application further provides a packing method, which comprises the following steps:
and packaging a third-party module into a third-party dependent package in a first preset format, wherein the third-party code package is used for being packaged with codes of a target application into a code package in a second preset format, the code package in the second preset format is used for obtaining at least one third-party dependent package depended by the target application, and each third-party loader is loaded through a third-party loader corresponding to each third-party dependent package.
The packaging method provided by the embodiment of the application can be applied to the third-party dependent package provider. The third party relying package provider can be a middleware developer or an independent business module developer, etc. These providers may refer to a class isolation container packaging tool in the project to package the code into a third party dependent package in the first format during the project packaging phase.
Further, the third party relying package provider can be a middleware developer or an independent business module developer, or the like. These providers may reference a class isolation container packaging tool in the project to package the code into a package in a first format during the project packaging phase.
The class isolation container packaging tool is a package that can be used to package the relevant code into a first format for the third party dependent package provider described above.
The application developer can perform packaging processing based on the third party dependent package with the first format and package the third party dependent package into the code package with the second format. In the project operation stage, different third-party dependent packages which the target application depends on can be obtained based on the code package in the second format, and a plurality of independent loaders are used for loading, so that the problem of class conflict is avoided.
To facilitate understanding of the method of the embodiments of the present application, a specific implementation is explained in java. The scheme of the embodiment of the application introduces the concept of a class isolation Container (Container), and provides a modular development scheme based on a loader (Classloader). The method can be widely applied to project development depending on a plurality of modules.
For example, in a micro-service-based architecture, applications often depend on independent modules such as a service framework and a database middleware, and package-dependent conflicts are likely to exist between the service dependence and each middleware module.
Users of the solution of the embodiments of the present application may include module developers and application developers.
A module developer, such as a middleware developer or an independent service module developer, quotes a class isolation container packaging tool in project engineering, packages codes into a jar package in a required first format in a project packaging stage, and automatically completes the packaging process by the tool, so that a user has no development workload.
In the development stage, a third party in a specific format, which is finished by an application developer, relies on the jar package for development, and introduces the jar package of the class isolation container, and a packaging tool provided by the class isolation container is used for packaging codes and dependencies into the jar package in the second format.
The application developer can start the process corresponding to the jar packet in the second format by using the program starting mode, and automatically realize the function of isolated loading of each third-party dependent packet in the second format if inputting a command of java-jar application. The implementation of the whole class isolation loading is transparent to users, and an application developer does not need to modify codes.
Fig. 3 is a schematic flowchart of container startup and class loading according to an embodiment of the present application. As shown in fig. 3, the detailed flow of the operation inside the class isolation container is as follows:
step 1, after a container is started, scanning all third-party dependent packages in a class path, and finding out all third-party dependent packages (Plugin) generated by using a specific packaging technology;
step 2, creating a PluginClassLoader for each third-party dependent package, loading the class exported outside in the third-party dependent package by using the ClassLoader, and storing the class into a SharedClassLoader;
and 3, generating a BizClassLoader for the service code, wherein the BizClassLoader is used for loading the class of the service and other third-party dependent packages called by the service.
The class loading order is: class in this Classloader's cache- > class in the JDK class library- > derivation class of Plugin- > class in this Plugin package- > JavaAgent class.
The Plugin module is used for exporting the third party dependency package or other classes called in the target application. The Biz module is used to derive classes in the third party dependency package or in the native module in the target application.
The method provided by the embodiment of the application can enable the service developer to concentrate on service correlation without worrying about class conflicts among different modules. The method has the advantages of reducing communication coordination cost of developers, reducing the possibility of abnormity during operation, reducing difficulty in troubleshooting of the developers, and improving service stability.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an application loading device according to an embodiment of the present application. As shown in fig. 4, the application loading apparatus includes:
a package obtaining unit 401, configured to obtain at least one third-party dependent package on which the target application depends;
a loader creating unit 402, configured to create a third-party loader corresponding to each third-party dependent package;
a package loading unit 403, configured to load, by the third-party loader, the third-party dependent packages corresponding to each third-party loader respectively.
Further, the package loading unit 403 is specifically configured to:
respectively loading a first type of third-party dependent packages corresponding to each third-party loader through the third-party loaders, wherein the first type of third-party dependent packages correspond to loaded classes;
and/or loading a second type of third-party dependent packages corresponding to each third-party loader through the third-party loaders respectively, wherein the second type of third-party dependent packages correspond to classes in a software development kit;
and/or loading a third type of third-party dependent package corresponding to each third-party loader through the third-party loader respectively, wherein the third type of third-party dependent package corresponds to a class in other third-party dependent packages called by the third-party dependent package;
and/or respectively loading a fourth type of third-party dependent package corresponding to each third-party loader through the third-party loader, wherein the fourth type of third-party dependent package corresponds to the class of the third-party dependent package;
and/or loading a fifth type of third-party dependent packages corresponding to each third-party loader through the third-party loaders respectively, wherein the fifth type of third-party dependent packages correspond to the classes in the language agent module.
Further, the package loading unit 403 is specifically configured to:
and loading the third-party dependent packages corresponding to each third-party loader through the third-party loaders respectively according to the sequence of the first-class third-party dependent packages, the second-class third-party dependent packages, the third-class third-party dependent packages, the fourth-class third-party dependent packages and the fifth-class third-party dependent packages.
Further, the apparatus further comprises:
an application loading unit 404 for creating an application loader;
and loading the code package of the target application through the application loader.
Further, the application loading unit 404 is specifically configured to:
loading, by the application loader, a first class of application code package, the first class of application code package corresponding to a loaded class;
and/or loading a second type of application code package through the application loader, the second type of application code package corresponding to a class in a software development kit;
and/or loading a third type of application code package through the application loader, wherein the third type of application code package corresponds to a class in other third party dependent packages;
and/or loading a fourth type of application code package through the application loader, wherein the fourth type of application code package corresponds to a class in a module of the fourth type of application code package;
and/or loading a fifth type of application code package through the application loader, wherein the fifth type of application code package corresponds to a class in the language agent module.
Further, the application loading unit 404 is specifically configured to:
and loading the code packet of the target application through the application loader according to the sequence of the first type application code packet, the second type application code packet, the third type application code packet, the fourth type application code packet and the fifth type application code packet.
Further, the apparatus further comprises:
a packaging unit 405, configured to obtain at least one third-party dependency package on which the target application depends;
packaging the code of the target application and the at least one third-party dependent package into a code package with a preset format;
the packet obtaining unit 401 is specifically configured to:
and acquiring at least one third-party dependent package which the target application depends on based on the code package with the preset format.
It is clear to a person skilled in the art that the solution according to the embodiments of the present application can be implemented by means of software and/or hardware. The "unit" and "module" in this specification refer to software and/or hardware that can perform a specific function independently or in cooperation with other components, where the hardware may be, for example, an FPGA (Field-Programmable Gate Array), an IC (Integrated Circuit), or the like.
Each processing unit and/or module in the embodiments of the present application may be implemented by an analog circuit that implements the functions described in the embodiments of the present application, or may be implemented by software that executes the functions described in the embodiments of the present application.
The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of the application loading method. The computer-readable storage medium may include, but is not limited to, any type of disk including floppy disks, optical disks, DVD, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.
Referring to fig. 5, a schematic structural diagram of an electronic device according to an embodiment of the present application is shown, where the electronic device may be used to implement the application loading method provided in the foregoing embodiment. Specifically, the method comprises the following steps:
the memory 1020 may be used to store software programs and modules, and the processor 1080 executes various functional applications and data processing by operating the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal device, and the like. Further, the memory 1020 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 1020 may also include a memory controller to provide access to memory 1020 by processor 1080 and input unit 1030.
The input unit 1030 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 1030 may include a touch-sensitive surface 1031 (e.g., a touch screen, a touchpad, or a touch frame). The touch-sensitive surface 1031, also referred to as a touch display screen or a touch pad, may collect touch operations by a user (such as operations by a user on or near the touch-sensitive surface 1031 using any suitable object or attachment, such as a finger, a stylus, etc.) on or near the touch-sensitive surface 1031 and drive the corresponding connection device according to a preset program. Optionally, the touch sensitive surface 1031 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 1080, and can receive and execute commands sent by the processor 1080. In addition, the touch-sensitive surface 1031 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves.
The display unit 1040 may be used to display information input by or provided to a user and various graphical user interfaces of the terminal device, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 1040 may include a Display panel 1041, and optionally, the Display panel 1041 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 1031 may overlay the display panel 1041, and when a touch operation is detected on or near the touch-sensitive surface 1031, the touch operation is transmitted to the processor 1080 for determining the type of the touch event, and the processor 1080 then provides a corresponding visual output on the display panel 1041 according to the type of the touch event. Although the touch-sensitive surface 1031 and the display panel 1041 may be two separate components that implement input and output functions, in some embodiments, the touch-sensitive surface 1031 may be integrated with the display panel 1041 that implements input and output functions.
The processor 1080 is a control center of the terminal device, connects various parts of the whole terminal device by using various interfaces and lines, and executes various functions of the terminal device and processes data by operating or executing software programs and/or modules stored in the memory 1020 and calling data stored in the memory 1020, thereby monitoring the whole terminal device. Optionally, processor 1080 may include one or more processing cores; processor 1080 may integrate an application processor that handles operating system, user interfaces, applications, etc. and a modem processor that handles wireless communications. It is to be appreciated that the modem processor described above may not be integrated into processor 1080.
Specifically, in this embodiment, the display unit of the terminal device is a touch screen display, the terminal device further includes a memory and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include steps for implementing the application loading method.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
All functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims (10)
1. An application loading method, characterized in that the method comprises:
obtaining at least one third party dependency package that a target application depends on;
creating a third-party loader corresponding to each third-party dependent package;
and respectively loading the third-party dependent packages corresponding to the third-party loaders through the third-party loaders.
2. The method according to claim 1, wherein the loading, by the third-party loader, the third-party dependent packages corresponding to each third-party loader respectively comprises:
respectively loading a first type of third-party dependent packages corresponding to each third-party loader through the third-party loaders, wherein the first type of third-party dependent packages correspond to loaded classes;
and/or loading a second type of third-party dependent packages corresponding to each third-party loader through the third-party loaders respectively, wherein the second type of third-party dependent packages correspond to classes in a software development kit;
and/or loading a third type of third-party dependent package corresponding to each third-party loader through the third-party loader respectively, wherein the third type of third-party dependent package corresponds to a class in other third-party dependent packages called by the third-party dependent package;
and/or respectively loading a fourth type of third-party dependent package corresponding to each third-party loader through the third-party loader, wherein the fourth type of third-party dependent package corresponds to the class of the third-party dependent package;
and/or loading a fifth type of third-party dependent packages corresponding to each third-party loader through the third-party loaders respectively, wherein the fifth type of third-party dependent packages correspond to the classes in the language agent module.
3. The method according to claim 2, wherein the loading, by the third-party loader, the third-party dependent package corresponding to each third-party loader respectively comprises:
and respectively loading the third-party dependent packages corresponding to each third-party loader through the third-party loaders according to the sequence of the first-class third-party dependent packages, the second-class third-party dependent packages, the third-class third-party dependent packages, the fourth-class third-party dependent packages and the fifth-class third-party dependent packages.
4. The method of claim 1, further comprising:
creating an application loader;
and loading the code package of the target application through the application loader.
5. The method of claim 4, wherein said loading, by said application loader, a code package for said target application comprises:
loading, by the application loader, a first class of application code package, the first class of application code package corresponding to a loaded class;
and/or loading a second type of application code package through the application loader, the second type of application code package corresponding to a class in a software development kit;
and/or loading a third type of application code package through the application loader, wherein the third type of application code package corresponds to a class in other third party dependent packages;
and/or loading a fourth type of application code package through the application loader, wherein the fourth type of application code package corresponds to a class in a module of the fourth type of application code package;
and/or loading a fifth type of application code package through the application loader, wherein the fifth type of application code package corresponds to a class in the language agent module.
6. The method of claim 2, wherein said loading, by said application loader, a code package for said target application comprises:
and loading the code packet of the target application through the application loader according to the sequence of the first type application code packet, the second type application code packet, the third type application code packet, the fourth type application code packet and the fifth type application code packet.
7. The method of claim 1, further comprising:
obtaining at least one third party dependency package that the target application depends on;
packaging the code of the target application and the at least one third-party dependent package into a code package with a preset format;
the obtaining of the at least one third-party dependency package depended on by the target application includes:
and acquiring at least one third-party dependent package which the target application depends on based on the code package with the preset format.
8. An application loading apparatus, comprising:
the package obtaining unit is used for obtaining at least one third-party dependent package which is dependent on the target application;
the loader creating unit is used for creating a third-party loader corresponding to each third-party dependent package;
and the package loading unit is used for respectively loading the third-party dependent packages corresponding to the third-party loaders through the third-party loaders.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1-7 are implemented when the program is executed by the processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010819784.6A CN112052044A (en) | 2020-08-14 | 2020-08-14 | Application loading method and device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010819784.6A CN112052044A (en) | 2020-08-14 | 2020-08-14 | Application loading method and device, storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112052044A true CN112052044A (en) | 2020-12-08 |
Family
ID=73599115
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010819784.6A Pending CN112052044A (en) | 2020-08-14 | 2020-08-14 | Application loading method and device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112052044A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6513158B1 (en) * | 1999-11-15 | 2003-01-28 | Espial Group Inc. | Method and apparatus for running multiple java applications simultaneously |
CN105404524A (en) * | 2014-09-15 | 2016-03-16 | 阿里巴巴集团控股有限公司 | Class loading and isolating method and apparatus in Java application |
CN108595246A (en) * | 2018-03-15 | 2018-09-28 | 阿里巴巴集团控股有限公司 | A kind of method, apparatus and equipment of operation application |
-
2020
- 2020-08-14 CN CN202010819784.6A patent/CN112052044A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6513158B1 (en) * | 1999-11-15 | 2003-01-28 | Espial Group Inc. | Method and apparatus for running multiple java applications simultaneously |
CN105404524A (en) * | 2014-09-15 | 2016-03-16 | 阿里巴巴集团控股有限公司 | Class loading and isolating method and apparatus in Java application |
CN108595246A (en) * | 2018-03-15 | 2018-09-28 | 阿里巴巴集团控股有限公司 | A kind of method, apparatus and equipment of operation application |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5602597B2 (en) | Method, computer program, and system for memory optimization of virtual machine code by segmenting foreign information | |
US8418169B2 (en) | Management method for managing software module and information processor | |
US8438577B2 (en) | Method and system for extending scripting languages | |
CN109240697B (en) | Call processing method and device and storage medium | |
CN112463123B (en) | Task compiling method, device, network node, system and storage medium | |
CN111740948B (en) | Data packet issuing method, dynamic updating method, device, equipment and medium | |
US11741002B2 (en) | Test automation systems and methods using logical identifiers | |
CN113032273B (en) | Application program debugging method and device, computer equipment and storage medium | |
JP2006048645A (en) | Method and system for embedding context information in document | |
CN107861742A (en) | The operation method and terminal device of a kind of program | |
JP7048663B2 (en) | Code execution methods, devices, rendering devices, storage media, and programs | |
CN110688145A (en) | Android MVP code automatic generation method, device, medium and electronic equipment | |
KR102337962B1 (en) | System and method for executing application based on microservice architecture and computer program for the same | |
CN108228266B (en) | Method and device for starting Fragment component between different plug-ins under Android plug-in framework | |
JP2021068414A (en) | Wrapping method, registration method, device, rendering device, and program | |
KR20180131009A (en) | System and method for converting large scale application | |
CN112052044A (en) | Application loading method and device, storage medium and electronic equipment | |
CN111158777A (en) | Component calling method and device and computer readable storage medium | |
CN111796865B (en) | Byte code file modification method, device, terminal equipment and medium | |
CN111782196A (en) | MVP architecture-based development method and device | |
CN113778451A (en) | File loading method and device, computer system and computer readable storage medium | |
CN106775608A (en) | The implementation method and device of autonomous system process | |
CN112506492B (en) | Visual point burying method supporting dynamic scene configuration | |
CN113064596B (en) | Event registration method, compiling method and device of application program, and electronic equipment | |
CN115048098A (en) | Process automation method, device, system 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 |