CN108595246B - Method, device and equipment for running application - Google Patents

Method, device and equipment for running application Download PDF

Info

Publication number
CN108595246B
CN108595246B CN201810215743.9A CN201810215743A CN108595246B CN 108595246 B CN108595246 B CN 108595246B CN 201810215743 A CN201810215743 A CN 201810215743A CN 108595246 B CN108595246 B CN 108595246B
Authority
CN
China
Prior art keywords
plug
target application
class
applications
data packet
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
CN201810215743.9A
Other languages
Chinese (zh)
Other versions
CN108595246A (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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201810215743.9A priority Critical patent/CN108595246B/en
Publication of CN108595246A publication Critical patent/CN108595246A/en
Application granted granted Critical
Publication of CN108595246B publication Critical patent/CN108595246B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

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

Abstract

The present specification discloses a method, an apparatus, and a device for running an application, in which a target application does not run directly on a virtual machine, but runs on a container, the container provides mutually independent class loaders to load plug-ins and/or other applications that depend on running the target application, and the container loads the plug-ins and other applications that depend on the target application in a manner that mutually independent different class loaders load different plug-ins or applications, so that classes that the target application depends on do not conflict with each other, and normal running of the target application can be ensured.

Description

Method, device and equipment for running application
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for running an application.
Background
Currently, Java-based applications are widely used, and generally run on a Java Virtual Machine (JVM).
In practical applications, Java-based applications often introduce a lot of dependencies, i.e., the running of one Java application often depends on other Java classes (i.e., methods of other applications or plug-ins). When a Java application runs directly on the JVM, if the classes on which the Java application depends conflict, the Java application cannot run normally.
Based on the prior art, a method for ensuring normal operation of an application is needed.
Disclosure of Invention
The present specification provides a method for running an application, which is used to solve the problem that the prior art cannot ensure that the application can run normally.
The present specification provides a method of running an application, comprising:
starting the container;
the container analyzes the data packet corresponding to the target application to determine the plug-ins and/or other applications which the target application depends on;
the container loads plug-ins and/or other applications which the target application depends on in a mode that different plug-ins or applications are loaded by different class loaders through a plurality of mutually independent class loaders;
and the container runs the service code corresponding to the target application contained in the data packet based on the loaded plug-in and/or other applications.
This specification provides an apparatus for running an application, comprising:
the analysis module is used for analyzing the data packet corresponding to the target application so as to determine the plug-in and/or other applications which the target application depends on;
the loading module loads plug-ins and/or other applications which the target application depends on in a mode that different plug-ins or applications are loaded by different class loaders through a plurality of mutually independent class loaders;
and the operation module is used for operating the service code corresponding to the target application contained in the data packet based on the loaded plug-in and/or other applications.
The present specification provides an apparatus for running an application, comprising one or more memories and a processor, the memories storing a program and configured to perform the following steps by the one or more processors:
starting the container;
the container analyzes the data packet corresponding to the target application to determine the plug-ins and/or other applications which the target application depends on;
the container loads plug-ins and/or other applications which the target application depends on in a mode that different plug-ins or applications are loaded by different class loaders through a plurality of mutually independent class loaders;
and the container runs the service code corresponding to the target application contained in the data packet based on the loaded plug-in and/or other applications.
The technical scheme adopted by the specification can achieve the following beneficial effects:
in one or more embodiments of the present specification, the target application no longer runs directly on the virtual machine, but runs on a container, the container provides mutually independent class loaders to load plug-ins and/or other applications on which the target application depends, and since the container loads the plug-ins and other applications on which the target application depends in a manner that different mutually independent class loaders load different plug-ins or applications, classes on which the target application depends do not conflict, and normal operation of the target application can be ensured.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the specification and not to limit the specification in a non-limiting sense. In the drawings:
FIG. 1 is a schematic diagram of a process for running an application provided herein;
FIG. 2 is a schematic diagram of a class lookup process provided herein;
FIG. 3 is a schematic diagram of an apparatus for running an application provided herein;
FIG. 4 is a schematic diagram of an apparatus for running an application provided herein;
fig. 5 is a schematic structural view of a container provided in the present specification.
Detailed Description
Since many current virtual machines (such as JVM) do not provide a mechanism for distinguishing versions, if a more complex class loader architecture is used, version conflicts are likely to occur when multiple versions of a certain packet or class occur. For example, if a Java application depends on plug-in a and plug-in B, while plug-in a depends on version 1 of plug-in C and plug-in B depends on version 2 of plug-in C, if a class loader architecture with branching is used, when both the parent class loader and the child class loader have plug-in C in the search range, the parent class loader is caused to load version 1 of plug-in C preferentially, so that plug-in B cannot load normally, and the Java application cannot run normally.
The core thought of the specification is as follows: the target application is enabled to not run on the virtual machine directly, but run on the container, and the container loads the plug-ins and/or other applications depending on the target application in a mode of loading different plug-ins or applications through different class loaders which are independent from each other, so that the purpose of class isolation is achieved, and normal running of the applications is guaranteed.
In order to make those skilled in the art better understand the technical solutions in one or more embodiments of the present disclosure, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in one or more embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
Fig. 1 is a schematic process diagram for running an application provided in this specification, and specifically includes the following steps:
s100: the container is started.
In this specification, the container is used to run a target application, provide class loaders for loading plug-ins and/or other applications on which the target application depends, and manage these class loaders, plug-ins, and other applications. The container runs on a virtual machine.
The following is merely an example of the target application being Java, and it should be understood by those skilled in the art that the following is merely an exemplary description of Java and is not a limitation of the present application, and any function that is the same or similar to that implemented in other computer languages is within the scope of the present application.
A Java application (target application) runs on the JVM, and when the Java application is started, the container described in this specification needs to be started first. Specifically, the code corresponding to the container may be written into the Java application, that is, the data packet corresponding to the target application includes the code corresponding to the container, and when the Java application is run, the code corresponding to the container included in the data packet may be directly run, and the container is started.
Further, when starting an application, the virtual machine first needs to find the entry method corresponding to the data packet of the application, so that when writing the code corresponding to the container into the target application, the entry method corresponding to the data packet of the target application may be modified as follows: the corresponding inlet method of the container. When the target application is started, the entry method corresponding to the data packet of the target application found by the virtual machine is actually the entry method corresponding to the container written in the data packet, and then the code corresponding to the container included in the data packet can be run according to the entry method.
S102: the container parses the data packet corresponding to the target application to determine the plug-ins and/or other applications that the target application depends on.
S104: the container loads the plug-ins and/or other applications depended by the target application through a plurality of mutually independent class loaders in a mode that different plug-ins or applications are loaded by different class loaders.
In this embodiment, the data packet corresponding to the target application may include two types.
First, the data packet may include, in addition to the code corresponding to the container, a service code corresponding to the target application itself, and an identifier of a plug-in and/or other application on which the target application depends. When the data package corresponding to the target application is parsed, the container may determine the plug-ins and/or other applications depended on by the target application according to the identifiers of the plug-ins and/or other applications depended on by the target application, which are contained in the data package, and when the plug-ins and/or other applications depended on by the target application are loaded through the class loader, the plug-ins and/or other applications depended on by the target application may be downloaded or locally searched for and loaded according to the identifiers of the plug-ins and/or other applications depended on by the target application.
Second, the data packet may include, in addition to the code corresponding to the container, a service code corresponding to the target application itself, and a data packet corresponding to a plug-in that the target application depends on and/or a data packet corresponding to another application. When the target application is a Java application, the second data packet is a Fat Jar packet.
When the data packet corresponding to the target application is the second type of data packet, the container can directly load the data packet corresponding to the target application, which includes the data packet corresponding to the plug-in that the target application depends on, through the class loader and/or the data packet corresponding to the target application, which includes the data packet corresponding to the other application that the target application depends on, after analyzing the data packet. It is clear that the second type of data package facilitates the deployment of the application developer more than the first type of data package.
It should be noted that the target application depends on the plug-in and/or other applications, and is essentially a class that the target application depends on the plug-in and/or other application derived classes. For a plug-in developer, the code of one or several classes may be written, and the code cannot constitute an application, so that the plug-in developer can pack the classes into a format which can be parsed and loaded by a container by using a specified tool, and the plug-in developer becomes a plug-in or plug-in of the classes. That is, the insert described in the present application refers to: and packing a plurality of classes into a data packet in a format which can be analyzed and loaded by the container through a specified tool.
Similarly, for an application developer, written classes of the application developer may form an application, but the class derived from the application needs to be depended on by a target application, so the application developer may also package the application into a format that can be parsed and loaded by a container using a specified tool, and since the application needs to be depended on by the target application, the application does not need to run on a separate container but needs to run on the same container as the target application, and therefore, when packaging the application, a data package corresponding to the application does not contain a code corresponding to the container. That is, other applications on which the target application described herein depends refer to: and packaging the other applications into a data packet in a format which can be analyzed and loaded by the container through a specified tool, wherein the data packet corresponding to the other applications does not contain codes corresponding to the container.
Of course, for the developer of the target application, it also uses a specified tool to package the target application into a format that can be parsed and loaded by the container, and the difference from other applications that the target application depends on is that, because the target application is not depended on by other applications, the target application needs to run on the container independently, and therefore, the tool packages the code corresponding to the container into the data package of the target application in addition to the service code of the target application itself, the plug-in and/or other applications that the target application depends on into the data package of the target application, so as to start the container by the method described in step S100 above.
Since the plug-ins and/or containers on which the target application depends are no longer directly loaded by the class loader of the virtual machine itself, but are loaded by the class loader provided by the container, the container can jump out of the limit of the virtual machine itself without distinguishing between versions, different plug-ins or other applications are loaded using different class loaders, there is no distinction at a level (parent-child level, upper-lower level, etc.) between the classes loader provided by the container, but rather class loaders that are independent of each other, that is, different and independent class loaders are used for loading as long as different plug-ins or applications are used. The different inserts or applications described in this application refer to: any two identify different plug-ins or applications.
In addition, when loading the plug-ins and/or other applications that the target application depends on, the container can preferentially load the plug-ins that the target application depends on, and then load the other applications that the target application depends on, when loading the plug-ins, the plug-ins can be sequentially loaded according to the priority of the plug-ins that the target application depends on, and when loading the other applications, the other applications can also be sequentially loaded according to the priority of the other applications that the target application depends on. The priority of each plug-in and other applications can be set as desired.
S106: and the container runs the service code corresponding to the target application contained in the data packet based on the loaded plug-in and/or other applications.
Just because the container runs on the virtual machine, the container jumps out of the virtual machine and provides mutually independent class loaders without providing a mechanism for distinguishing versions, so that different plug-ins and/or other applications depending on the target application running on the container can be loaded by mutually independent different class loaders, so that version conflict does not occur, and normal running of the target application can be ensured.
In this embodiment of the present specification, the container may manage the loaded plug-ins and applications through the class export table, and specifically, after the plug-ins depended on by the target application are loaded, record the identifications of the plug-ins and the class identifications of the classes exported after the plug-ins are loaded (i.e., the classes that the plug-ins can export) in the class export table; after loading other applications on which the target application depends, the identities of the other applications and the class identities of the classes derived after loading the other applications (i.e., the classes that the other applications can derive) are recorded in a class derivation table.
When the container loads the plug-in and/or other applications that the target application depends on, the plug-in and/or other applications may also depend on other plug-ins or applications, so when the container loads the plug-in, the class that the plug-in depends on is determined to be loaded according to the configuration file of the plug-in, the other plug-ins that derive the determined class are searched in the recorded class derivation table, and finally the plug-in is loaded based on the searched other plug-ins. The configuration file of the plug-in may be contained in a data packet corresponding to the plug-in. Similarly, when loading an application, the class on which the application depends may be determined, and other plug-ins or applications deriving the determined class may be looked up in the recorded class derivation table, and finally the application may be loaded based on the other plug-ins or applications found.
After the plug-ins and/or other applications depended on by the target application are loaded, the container can determine the class depended on by the service codes corresponding to the running target application, and judge whether the class depended on by the service codes corresponding to the running target application is a pre-specified class, if so, the class is searched and loaded in the service codes corresponding to the target application so as to run the service codes corresponding to the target application based on the loaded class, otherwise, the plug-ins or other applications of the class are searched and derived in the class derivation table, and the service codes corresponding to the target application are run based on the searched plug-ins or other applications which are loaded.
Wherein, the specified classes are: developers developing a target application do not want to prioritize loading of plug-ins or other application-derived classes, but rather classes that the target application itself contains.
It should be noted that the method for loading other applications, on which the target application depends, by the container through the class loader is the same as the method for running the target application by the container, and details are not described here.
Of course, when the container loads the plug-in and/or other applications that the target application depends on, the class derived by these plug-ins and/or other applications may also be the virtual machine itself or the base class of the container itself, and therefore, when the container loads the plug-in that the target application depends on, the class derived by the plug-in may be first searched in the base class of the virtual machine (if found, the base class of the virtual machine is directly loaded), then the class derived by the plug-in may be searched in the base class of the container (if found, the base class of the container is directly loaded), and finally the plug-in is searched in the data packet of the target application and loaded. Similarly, when the container runs the target application or loads another application that the target application depends on, the container may first search for the class derived from the application in the base class of the virtual machine (if the class derived from the application is found, the base class of the virtual machine is directly loaded), then search for the class derived from the application in the base class of the container (if the class derived from the application is found, the base class of the container is directly loaded), then determine whether the class is the specified class (if the class derived from the application is found, the class is directly searched and loaded in the code corresponding to the application), and finally search and load the class in the data packet of the application, as shown in fig. 2.
It can be seen that if the class export table is omitted, compared with the class loader provided by the JVM itself, the class loaders provided by the container described in the present application are completely independent from each other, and the class loaders provided by the JVM have parent-child relationships and are not independent, so that the class loader provided by the container described in the present application can provide a class isolation mechanism to ensure that there is no conflict between classes on which the target application depends. Furthermore, in combination with the above class export table, the class loaders provided by the container according to the present application may further depend on each other through the class export table, and the dependency relationship of the originally independent class loaders implemented through the class export table is a mesh relationship, and is completely different from the parent-child relationship (corresponding to the upper-level and lower-level relationships) between the class loaders of the JVM. Therefore, the class loaders provided by the application can be mutually dependent while providing a class isolation mechanism, and ensure that the target application can normally run based on normal dependence.
Based on the same idea, the present specification also provides a corresponding apparatus for running an application, as shown in fig. 3.
The analysis module 301 analyzes the data packet corresponding to the target application to determine the plug-ins and/or other applications that the target application depends on;
a loading module 302, which loads plug-ins and/or other applications that the target application depends on in a manner that different plug-ins or applications are loaded by different class loaders through a plurality of mutually independent class loaders;
the running module 303 runs the service code corresponding to the target application included in the data packet based on the loaded plug-in and/or other applications.
The data packet corresponding to the target application comprises a data packet corresponding to a plug-in which the target application depends; and/or
The data packet corresponding to the target application comprises data packets corresponding to other applications which the target application depends on, and the data packets corresponding to the other applications do not comprise codes corresponding to the device;
the loading module 302 is configured to load a data packet corresponding to the target application, where the data packet includes a data packet corresponding to a plug-in that the target application depends on; and/or loading the data packet corresponding to the target application, wherein the data packet corresponding to the other application depended by the target application is contained.
The loading module 302 determines the class on which the plug-in is loaded according to the configuration file of the plug-in; looking up other plug-ins in a recorded class export table for exporting the determined class; and loading the plug-in based on the other found plug-ins.
The device further comprises:
the management module 304 records the identification of the plug-in and the class identification of the class exported after the plug-in is loaded in a class export table after the plug-in depended by the target application is loaded by the loading module 302; after the loading module 302 loads other applications on which the target application depends, the identifications of the other applications and the class identifications of the classes exported after the other applications are loaded are recorded in a class export table.
The running module 303 determines a class on which a service code corresponding to the target application is running; judging whether the class on which the service code corresponding to the target application is operated depends is a pre-specified class or not; if so, searching the class in the service code corresponding to the target application and loading the class so as to run the service code corresponding to the target application based on the loaded class; otherwise, searching and exporting the plug-in or other applications of the class in the class export table, and running the service code corresponding to the target application based on the loaded found plug-in or other applications.
The specification also correspondingly provides a device for information recommendation, and the device is shown in fig. 4. The apparatus includes one or more memories and a processor, the memories storing programs and configured to perform the following steps by the one or more processors:
starting the container;
the container analyzes the data packet corresponding to the target application to determine the plug-ins and/or other applications which the target application depends on;
the container loads plug-ins and/or other applications which the target application depends on in a mode that different plug-ins or applications are loaded by different class loaders through a plurality of mutually independent class loaders;
and the container runs the service code corresponding to the target application contained in the data packet based on the loaded plug-in and/or other applications.
In addition, the present specification also provides a container running on a virtual machine, as shown in fig. 5.
Fig. 5 is a schematic structural view of a container provided in the present specification.
The starting module is mainly responsible for initializing the container and preparing resources and services for starting the container.
The parsing module (equivalent to the parsing module in fig. 3) is responsible for parsing plug-ins and/or other applications that the target application depends on.
And the plug-in loading module loads plug-ins depended by the target application in sequence according to the priority.
And the application loading module sequentially loads other applications which the target application depends on according to the priority (the plug-in loading module and the application loading module are equivalent to the loading module in the figure 3).
And the management module comprises a class loader management module, a plug-in service management module, an application management module and an application service management module. The class loader management module is used for managing mutually independent class loaders which can be provided by the container. The plug-in management module is used for managing plug-ins loaded by the container, and the plug-in management module records the identification of the plug-ins and the class identification of the exported classes in the class export table after the plug-ins are loaded. The plug-in service management module is used for providing the class exported by the loaded plug-in for the outside, and is equivalent to providing the service of the plug-in loaded by the container for the outside. The application management module is used for managing the applications (other applications depended by the target application) loaded by the container, and comprises a step of recording the identification of the applications and the class identification of the exported classes in a class export table after the plug-in is loaded. The application service management module is used for providing the class exported by the loaded application to the outside, and is equivalent to providing the service of the application loaded by the container to the outside.
And the basic class management module is used for managing the basic classes of the virtual machines and/or the containers.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to one or more embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is merely one or more embodiments of the present disclosure and is not intended to limit the present disclosure. Various modifications and alterations to one or more embodiments of the present description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of one or more embodiments of the present specification should be included in the scope of the claims of the present specification.

Claims (12)

1. A method of running an application, comprising:
starting the container;
the container analyzes the data packet corresponding to the target application to determine the plug-ins and/or other applications which the target application depends on;
the container loads plug-ins and/or other applications which the target application depends on in a mode that different plug-ins or applications are loaded by different class loaders through a plurality of mutually independent class loaders;
the container runs the service code corresponding to the target application contained in the data packet based on the loaded plug-in and/or other applications;
loading the plug-in on which the target application depends, specifically comprising:
determining a class on which the plug-in is loaded according to the configuration file of the plug-in;
looking up other plug-ins in a recorded class export table for exporting the determined class;
and loading the plug-in based on the other found plug-ins.
2. The method of claim 1, wherein the data packet corresponding to the target application comprises a code corresponding to the container;
the starting container specifically comprises:
and executing the code corresponding to the container contained in the data packet to start the container.
3. The method of claim 2, wherein the ingress method for the packet is: the inlet method corresponding to the container;
executing the code corresponding to the container contained in the data packet, specifically comprising:
and running codes corresponding to the containers contained in the data packet according to the entry method corresponding to the data packet.
4. The method of claim 1, wherein the data packet corresponding to the target application comprises a data packet corresponding to a plug-in on which the target application depends; and/or
The data packet corresponding to the target application comprises data packets corresponding to other applications which the target application depends on, and the data packets corresponding to the other applications do not comprise codes corresponding to the container;
loading the plug-in and/or other applications on which the target application depends, specifically including:
loading a data packet corresponding to the target application, wherein the data packet comprises a data packet corresponding to a plug-in which the target application depends; and/or
And loading the data packet corresponding to the target application, wherein the data packet corresponding to the other applications depended by the target application is contained.
5. The method of claim 1, after loading a plug-in on which the target application depends, the method further comprising:
recording the identification of the plug-in and the class identification of the class exported after the plug-in is loaded in a class export table;
after loading other applications on which the target application depends, the method further comprises:
and recording the identifications of the other applications and the class identifications of the classes exported after the other applications are loaded in a class export table.
6. The method according to claim 5, wherein the container runs the service code corresponding to the target application included in the data packet based on the loaded plug-in and/or other application, and specifically includes:
the container determines a class on which a service code corresponding to the target application is operated;
judging whether the class on which the service code corresponding to the target application is operated depends is a pre-specified class or not;
if so, searching the class in the service code corresponding to the target application and loading the class so as to run the service code corresponding to the target application based on the loaded class;
otherwise, searching and exporting the plug-in or other applications of the class in the class export table, and running the service code corresponding to the target application based on the loaded found plug-in or other applications.
7. The method of any one of claims 1 to 6, wherein the target application is a Java application, the container runs on a Java virtual machine, and the data package comprises a Fat Jar package.
8. An apparatus for running an application, comprising:
the analysis module is used for analyzing the data packet corresponding to the target application so as to determine the plug-in and/or other applications which the target application depends on;
the loading module loads plug-ins and/or other applications which the target application depends on in a mode that different plug-ins or applications are loaded by different class loaders through a plurality of mutually independent class loaders;
the running module runs the service code corresponding to the target application contained in the data packet based on the loaded plug-in and/or other applications;
the loading module determines the class on which the plug-in is loaded according to the configuration file of the plug-in; looking up other plug-ins in a recorded class export table for exporting the determined class; and loading the plug-in based on the other found plug-ins.
9. The apparatus according to claim 8, wherein the data packet corresponding to the target application includes a data packet corresponding to a plug-in on which the target application depends; and/or
The data packet corresponding to the target application comprises data packets corresponding to other applications which the target application depends on, and the data packets corresponding to the other applications do not comprise codes corresponding to the device;
the loading module loads a data packet corresponding to the target application, wherein the data packet comprises a data packet corresponding to a plug-in which the target application depends; and/or loading the data packet corresponding to the target application, wherein the data packet corresponding to the other application depended by the target application is contained.
10. The apparatus of claim 9, the apparatus further comprising:
the management module records the identification of the plug-in and the class identification of the class exported after the plug-in is loaded in a class export table after the plug-in depended by the target application is loaded by the loading module; after the loading module loads other applications depended by the target application, recording the identifications of the other applications and the class identifications of the classes exported after the other applications are loaded in a class export table.
11. The apparatus of claim 10, the execution module to determine a class on which a service code corresponding to the target application is executed depends; judging whether the class on which the service code corresponding to the target application is operated depends is a pre-specified class or not; if so, searching the class in the service code corresponding to the target application and loading the class so as to run the service code corresponding to the target application based on the loaded class; otherwise, searching and exporting the plug-in or other applications of the class in the class export table, and running the service code corresponding to the target application based on the loaded found plug-in or other applications.
12. An apparatus for running an application, the apparatus comprising one or more memories and a processor, the memories storing programs and configured to perform the following steps by the one or more processors:
starting the container;
the container analyzes the data packet corresponding to the target application to determine the plug-ins and/or other applications which the target application depends on;
the container loads plug-ins and/or other applications which the target application depends on in a mode that different plug-ins or applications are loaded by different class loaders through a plurality of mutually independent class loaders;
the container runs the service code corresponding to the target application contained in the data packet based on the loaded plug-in and/or other applications;
loading the plug-in on which the target application depends, specifically comprising:
determining a class on which the plug-in is loaded according to the configuration file of the plug-in;
looking up other plug-ins in a recorded class export table for exporting the determined class;
and loading the plug-in based on the other found plug-ins.
CN201810215743.9A 2018-03-15 2018-03-15 Method, device and equipment for running application Active CN108595246B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810215743.9A CN108595246B (en) 2018-03-15 2018-03-15 Method, device and equipment for running application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810215743.9A CN108595246B (en) 2018-03-15 2018-03-15 Method, device and equipment for running application

Publications (2)

Publication Number Publication Date
CN108595246A CN108595246A (en) 2018-09-28
CN108595246B true CN108595246B (en) 2022-03-04

Family

ID=63626393

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810215743.9A Active CN108595246B (en) 2018-03-15 2018-03-15 Method, device and equipment for running application

Country Status (1)

Country Link
CN (1) CN108595246B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124525A (en) * 2018-10-31 2020-05-08 北京国双科技有限公司 Website function implementation method and device
CN111273965B (en) * 2020-02-17 2021-10-29 支付宝(杭州)信息技术有限公司 Container application starting method, system and device and electronic equipment
CN112052044A (en) * 2020-08-14 2020-12-08 深圳市欢太科技有限公司 Application loading method and device, storage medium and electronic equipment
CN114661376A (en) * 2022-03-29 2022-06-24 杭州安恒信息技术股份有限公司 System function expanding method, device, equipment and medium
CN117193874A (en) * 2023-09-05 2023-12-08 北京基调网络股份有限公司 Plug-in processing method and device, storage medium and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8499311B2 (en) * 2006-12-29 2013-07-30 Sap Ag Web container extension classloading
CN103294455A (en) * 2012-02-27 2013-09-11 杭州勒卡斯广告策划有限公司 Software service implementation method and system, as well as Java platform
CN105335174B (en) * 2014-07-15 2018-11-20 阿里巴巴集团控股有限公司 A kind of java application of non-OSGi calls the method and device of OSGi service
CN105404524B (en) * 2014-09-15 2019-01-15 阿里巴巴集团控股有限公司 Class load partition method and device in Java application

Also Published As

Publication number Publication date
CN108595246A (en) 2018-09-28

Similar Documents

Publication Publication Date Title
CN108595246B (en) Method, device and equipment for running application
CN107545030B (en) Method, device and equipment for processing data blood relationship
KR101736650B1 (en) Method and embedded device for loading driver
CN107045438B (en) Application top view processing method, device and component
CN111885082B (en) Web application package processing method, device and equipment
CN110245279B (en) Dependency tree generation method, device, equipment and storage medium
CN107391101B (en) Information processing method and device
CN108268289B (en) Parameter configuration method, device and system for web application
CN108279940B (en) Module loading method and device in web container
CN111400681B (en) Data authority processing method, device and equipment
CN112631684B (en) Executable program running method and device, electronic equipment and computer storage medium
CN116185532B (en) Task execution system, method, storage medium and electronic equipment
CN112307509A (en) Desensitization processing method, equipment, medium and electronic equipment
CN111273965B (en) Container application starting method, system and device and electronic equipment
CN114547024A (en) SQL statement risk detection method, device, equipment and medium
US20120159515A1 (en) Sharing object representations
CN111190692A (en) Monitoring method and system based on Roc processor and readable medium
CN111459573B (en) Method and device for starting intelligent contract execution environment
CN111090425B (en) Program packaging method and device and electronic equipment
CN109976769B (en) Method, device and equipment for determining server identification corresponding to application installation package
CN109409037B (en) Method, device and equipment for generating data confusion rule
CN116432185B (en) Abnormality detection method and device, readable storage medium and electronic equipment
CN113556260A (en) Flow monitoring method and device, storage medium and electronic equipment
CN116108498A (en) Program execution method, program execution device, storage medium and electronic equipment
CN110659105A (en) Virtualized resource processing method, device, 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
TA01 Transfer of patent application right

Effective date of registration: 20201021

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201021

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant