Application program running method and device, equipment, storage medium and program product
By loading and updating functional component information when the application starts, the problem of the conflict between customization functions and product code logic is solved, and the normal operation of the application and independent code updates are achieved.
Patent Information
- Application Number
- CN202510006187.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-04-04
AI Technical Summary
When developing customized functions, existing applications are prone to logical conflicts with product code, resulting in application operation problems.
By loading the original functional component information and customized functional component information when the application starts, and updating the original functional component information based on the customized functional component information, target functional component information is generated to avoid code that couples the original and customized functions.
It realizes the normal operation of the application, avoids the impact of customized functions on the original code, and supports the update, upgrade and maintenance of their respective codes.
Smart Images

Figure CN119759453A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an application program running method, apparatus, device, storage medium and program product. Background Art
[0002] In order to meet the different needs of different customers or different projects, applications often need to be customized or developed. However, customized functional codes often have an impact on the product code of the project itself.
[0003] Currently, different branches are often pulled from product codes, and customized functions are developed based on each branch. However, the customized function code developed based on the code branch is prone to logical conflicts with the product code, causing problems in the operation of the application. Summary of the invention
[0004] In view of the above defects or deficiencies in the prior art, it is desirable to provide an application running method, apparatus, device, storage medium and program product, which can realize independence in the codes of original functions and customized functions, couple in functional components, avoid coupling the codes of original functions and customized functions, and ensure the normal operation of the application. At the same time, it will not affect the update, upgrade, maintenance and other operations of the respective codes.
[0005] In a first aspect, the present application provides a method for running an application program. The method comprises: When the application is started, the original program package of the application is loaded and parsed to obtain the original functional component information of the application; Loading the customized function package of the application in the extension file corresponding to the application, parsing to obtain the customized function component information of the application; The original functional component information is updated based on the customized functional component information to obtain the target functional component information, and each functional component in the target functional component information is run.
[0006] In combination with the first aspect, in a possible implementation method, the original functional component information is updated based on the customized functional component information to obtain the target functional component information, including: matching each customized functional component in the customized functional component information with each original functional component in the original functional component information, if there is an original functional component in the original functional component information that matches the customized functional component, replacing the original functional component with the corresponding customized functional component; determining the functional component information that exists in the customized functional component information and does not exist in the original functional component information, and adding the customized functional component corresponding to the functional component information to the original functional component information to obtain the target functional component information.
[0007] In combination with the first aspect, in a possible implementation manner, the execution priority of the customized functional component in the target functional component information is higher than that of the original functional component.
[0008] In combination with the first aspect, in a possible implementation method, when the operating system of the application is a Linux system, the customized function package of the application is loaded, and the customized function component information of the application is parsed, including: creating a class loading tool; using the class loading tool to load the customized function package of the application, and parsing and initializing the class files in the customized function package to obtain class objects corresponding to each type of file; the class objects represent the customized function components.
[0009] In combination with the first aspect, in a possible implementation method, the original functional component information is updated based on the customized functional component information to obtain the target functional component information, including: creating a spring container; the spring container matches the names of various objects in the customized functional component information with the names of various objects in the original functional component information, and if there is a class object with a matching name, the class object in the original functional component information is replaced with the matching class object in the customized functional component information; determining the class object that exists in the customized functional component information and does not exist in the original functional component information, and adding the class object to the original functional component information to obtain the target functional component information.
[0010] In combination with the first aspect, in a possible implementation method, before starting the application, the application running method also includes: packaging the code corresponding to the original functional component, obtaining the original functional component program package, and deploying the original functional component program package; creating an extension file in the extension directory of the application; packaging the code corresponding to the customized functional component, obtaining the customized functional component program package, and storing the customized functional component program package in the extension file.
[0011] In combination with the first aspect, in a possible implementation, after generating the target functional component information, the application running method also includes: sending a package loading completion message, the loading completion message is used to instruct the operating system to execute auxiliary operations for the application running; the auxiliary operations are used to process the data generated when the application is running.
[0012] In a second aspect, the present application also provides an application program running device. The device includes: The first loading module is used to load the original program package of the application program when the application program is started, and parse and obtain the original functional component information of the application program; The second loading module is used to load the customized function package of the application program in the extension file corresponding to the application program, and parse and obtain the customized function component information of the application program; The update module is used to update the original functional component information based on the customized functional component information, obtain the target functional component information, and run each functional component in the target functional component information.
[0013] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0014] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0015] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0016] The embodiment of the present application provides an application running method, device, equipment, storage medium and program product. When the application is started, the original program package of the application is first loaded, and the original functional component information of the application is parsed to obtain the original functional component information of the application; then the customized functional program package of the application is loaded from the extension file corresponding to the application, and the customized functional component information of the application is parsed. Then, the original functional component information is updated based on the customized functional component information, and the target functional component information including the original functional component information and the customized functional component information is obtained, and each functional component in the target functional component information is run. The method provided by the embodiment of the present application packages and deploys the original code and the customized code of the application respectively, and then loads them separately when the application is started, and based on the original functional component and the customized functional component obtained by loading, by coupling the two into one file, the operating system can realize the original function and customized function of the application by running the file. That is, the present application realizes independence in the code of the original function and the customized function, and couples in the functional component, avoids coupling the code of the original function and the customized function, and ensures the normal operation of the application. At the same time, it will not affect the update, upgrade, maintenance and other operations of each code. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings: Figure 1 A schematic diagram of a flow chart of a method for running an application program in one embodiment; Figure 2 Another schematic diagram of a flow chart of a method for running an application program in one embodiment; Figure 3 Another schematic diagram of a flow chart of a method for running an application program in one embodiment; Figure 4 Another schematic diagram of a flow chart of a method for running an application program in one embodiment; Figure 5 Another schematic diagram of a flow chart of a method for running an application program in one embodiment; Figure 6 Another schematic diagram of a flow chart of a method for running an application program in one embodiment; Figure 7 Another schematic diagram of a flow chart of a method for running an application program in one embodiment; Figure 8 It is a structural block diagram of an application program running device in one embodiment; Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0018] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.
[0019] It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. In addition, the term "and / or" herein is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of objects.
[0020] The functions of software products are often general functions with universal applicability. As customers' requirements for the functionality of software products increase, in order to meet the different needs of different customers or different projects, software products often need to be customized or developed. However, customized function codes often have an impact on the code of the product itself.
[0021] At present, different branches are often pulled from the original code of the product, and customized functions are developed based on each branch. However, the customized function code developed based on the original code branch is prone to logical conflicts with the original code of the product, causing problems in the operation of the application; or completely independent customized function code is set up, but the original code and the independent customized code still have interaction or coupling requirements when the program is loaded and the code is upgraded, and there is a problem of mutual influence.
[0022] To solve the above problems, an embodiment of the present application provides an application running method, which can avoid the coupling between the original code and customized code of the application and ensure the normal operation of the application.
[0023] In one embodiment, a method for running an application is provided, which is applied to a server or a server cluster. Figure 1 As shown, the method comprises the following steps: Step 101: When the application is started, the original program package of the application is loaded and the original functional component information of the application is obtained by parsing.
[0024] In an embodiment of the present application, before the application is run, the original code and customized code of the application are packaged and deployed separately, and the program packages of the original code and the program packages of the customized code are stored at different addresses.
[0025] The customized code package may be stored in an extension file of the application.
[0026] When an application is started, for example, a user clicks to start the application, or the application starts automatically when certain conditions are met, the operating system first loads the original package of the application from the corresponding address, and parses the original functional component information of the application during the loading process. For example, when the operating system is Linux, the package is parsed to obtain a class object, that is, a bean instance.
[0027] Step 102: Load the customized function package of the application program in the extension file corresponding to the application program, and parse to obtain the customized function component information of the application program.
[0028] After the original program package of the application is loaded, the customized function program package is loaded from the extension file corresponding to the application, and the customized function component information of the application is parsed during the loading process.
[0029] Step 103: Update the original functional component information based on the customized functional component information to obtain target functional component information, and run each functional component in the target functional component information.
[0030] After loading the original function package and the customized function package in sequence and obtaining the original function component information and the customized function component information, the original function component information can be updated based on the customized function component information, so that the updated original function component information (i.e., the target function component information) includes the customized function component in the customized function component information, so that after starting the application, the original function and customized function of the application can be realized by running the function components in the target function component information.
[0031] To ensure accurate execution of customized functions, for original function components and customized function components with the same name, the execution priority of the customized function component in the target function component information can be set higher than that of the original function component.
[0032] Under this priority setting mode, the operating system gives priority to executing the corresponding customized functional components instead of the corresponding original functional components for functional components with the same name.
[0033] The application running method provided by the embodiment of the present application first loads the original program package of the application when the application is started, and parses to obtain the original functional component information of the application; then loads the customized functional program package of the application from the extension file corresponding to the application, and parses to obtain the customized functional component information of the application. Then, based on the customized functional component information, the original functional component information is updated to obtain the target functional component information including the original functional component information and the customized functional component information, and each functional component in the target functional component information is run. The method provided by the embodiment of the present application packages and deploys the original code and customized code of the application respectively, and then loads them respectively when the application is started, and based on the original functional component and customized functional component obtained by loading, by coupling the two into one file, the operating system can realize the original function and customized function of the application by running the file. That is, the present application realizes independence in the code of the original function and the customized function, and couples in the functional component, avoids coupling the code of the original function and the customized function, and ensures the normal operation of the application. At the same time, it will not affect the update, upgrade, maintenance and other operations of each code.
[0034] In one embodiment, to ensure the realization of the customized function, the uniqueness of the customized function can be ensured by replacement. That is, the aforementioned "updating the original functional component information based on the customized functional component information to obtain the target functional component information" may include: Figure 2 Steps shown: Step 201: Match each customized functional component in the customized functional component information with each original functional component in the original functional component information. If there is an original functional component in the original functional component information that matches the customized functional component, replace the original functional component with the corresponding customized functional component.
[0035] Step 202: determine the functional component information that exists in the customized functional component information and does not exist in the original functional component information, and add the customized functional component corresponding to the functional component information to the original functional component information to obtain the target functional component information.
[0036] In the embodiment of the present application, the original functional component information obtained by loading the original program package includes multiple original functional components, and the customized functional component information obtained by loading the customized functional program package includes multiple customized functional components.
[0037] Each customized functional component in the customized functional component information is matched with each original functional component in the original functional component information to determine the matched original functional components and customized functional components, for example, to determine the original functional components and customized functional components with the same function name. The matched original functional components in the original functional component information are deleted, and the matched customized functional components are added to the original functional component information to replace the matched customized functional components.
[0038] At the same time, it is necessary to add the remaining customized functional components in the customized functional component information (except for the customized functional components that match the original functional components), that is, the functional component information that exists in the customized functional component information but does not exist in the original functional component information, to the original functional component information to obtain the target functional component information.
[0039] The method provided in the embodiment of the present application can match each customized functional component in the customized functional component information with each original functional component in the original functional component information, replace the original functional component that matches in the original functional component information based on the customized functional component that matches in the customized functional component information, and directly add the functional component that does not match in the customized functional component information to the original functional component information. The method provided in the embodiment of the present application updates the original functional component information by replacing and adding customized functional components with different matching results, avoids the impact of duplicate functional components on program operation, and improves the reliability of the application program operation method.
[0040] Taking the Linux system as an example, the running process of the application with customized functions is explained.
[0041] In one embodiment, when the operating system of the application is a Linux system, the loading process of the program package includes the following steps: Figure 3 Steps shown: Step 301: Create a class loading tool.
[0042] Step 302: Use a class loading tool to load the customized function package of the application, parse and initialize the class files in the customized function package, and obtain class objects corresponding to each type of file.
[0043] Among them, the class object represents the customized functional component.
[0044] In the embodiment of the present application, when the operating system of the application is a Linux system, the Java virtual machine, i.e., JVM, will be first run when the application is run, and then the class file Java class will be loaded into the JVM through the class loader tool Class Loader for running. However, considering that the class loader tool that comes with the JVM can only load class files from the local, therefore, for the customized function package stored in the extension file, it is necessary to create a corresponding class loader tool, and use the created class loader tool to load the customized function package.
[0045] Specifically, the created class loading tool is used to parse and initialize the class files (such as .class files) in the program package to obtain class objects corresponding to various files, where different class objects can represent different customized functional components.
[0046] It is understandable that the original program package can be parsed and initialized through the class loading tool provided by the JVM to obtain class objects corresponding to various files in the original program package. Different class objects represent different original functional components.
[0047] Furthermore, under the Linux operating system, the update of the original functional component can be achieved through the spring container, and the update process may include the following: Figure 4 Steps shown: Step 401: Create a spring container.
[0048] Step 402, the spring container matches the names of various objects in the customized functional component information with the names of various objects in the original functional component information. If there is a class object with a matching name, the class object in the original functional component information is replaced with the matching class object in the customized functional component information.
[0049] Step 403: Determine the class object that exists in the customized functional component information and does not exist in the original functional component information, and add the class object to the original functional component information to obtain the target functional component information.
[0050] In an embodiment of the present application, a spring container is first created. After the class file in the original program package is parsed and initialized to obtain the class object, the spring container can first create a bean instance based on the various objects in the original functional component information using the refresh() function; after the class file in the customized program package is parsed and initialized to obtain the class object, the spring container then creates a bean instance based on the various objects in the customized functional component information.
[0051] Next, the spring container can match the bean instance corresponding to the original functional component with the bean instance corresponding to the customized functional component, and for the matched bean instances, replace the bean instance corresponding to the original functional component based on the bean instance corresponding to the customized functional component.
[0052] Specifically, Figure 5 As shown, when the spring container creates a bean instance corresponding to a customized functional component, it can determine whether there is a bean instance in the created bean instance that is the same as the currently created bean instance. If so, the corresponding created bean instance is replaced based on the bean instance corresponding to the currently created customized functional component.
[0053] In a possible implementation, after the target functional component information is generated, a program package loading completion message may be sent to instruct the operating system to perform auxiliary operations for running the application.
[0054] Among them, auxiliary operations are used to process data generated when the application is running, for example, monitoring running data, clearing cache files generated during running, and other operations.
[0055] In the Linux operating system, auxiliary operations can include Figure 6 In the operation, such as registering container enhancer, executing container enhancer, registering bean enhancer, initializing internationalization files, initializing event broadcaster, executing some other operations in the container creation process, registering event listeners, completing container initialization, completing container creation, clearing the cache generated during the operation, etc. It should be noted that the above spring container creation and updating bean instance have been completed in the "container initialization work" in the figure.
[0056] The method provided in the embodiment of the present application realizes the loading of customized program packages by creating a class loading tool under the Linux operating system, and realizes the update of original functional components based on customized functional components through the spring container, thereby ensuring the normal operation of the program.
[0057] The above-mentioned embodiment provides a solution for packaging and deploying the original code and customized code of the application program respectively. In another embodiment of the present application, the above process is executed before the application program is started, specifically including the following steps: Figure 7 Steps shown: Step 501: Pack the code corresponding to the original functional component to obtain the original functional component program package, and deploy the original functional component program package.
[0058] Step 502: Create an extension file in the extension directory of the application.
[0059] Step 503: Pack the code corresponding to the customized functional component to obtain a customized functional component program package, and store the customized functional component program package in an extension file.
[0060] In the embodiment of the present application, the code corresponding to the original functional component is packaged to obtain the original functional component program package, and the original functional component program package is deployed to the local file of the target server. Then, an extension file is created in the extension directory of the application, and the code corresponding to the customized functional component is packaged to obtain a customized functional component program package, and deployed in the extension file of the above-created application, which is equivalent to establishing a connection between the customized functional component program package and the original functional component program package to ensure that the application is accurately loaded into the corresponding customized functional component program package when it is running.
[0061] The method provided in the embodiment of the present application creates an extension file in the extension directory of the application and deploys the customized functional component package in the extension file to ensure the accurate loading of the customized functional component package, thereby ensuring the normal operation of the application.
[0062] It should be noted that although the operations of the method of the present invention are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flow chart can be performed in a different order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0063] In one embodiment, Figure 8 As shown, an application running device is provided, including: a first loading module 601, a second loading module 602 and an update module 603, wherein: The first loading module 601 is used to load the original program package of the application when the application is started, and parse to obtain the original functional component information of the application.
[0064] The second loading module 602 is used to load the customized function package of the application program in the extension file corresponding to the application program, and parse to obtain the customized function component information of the application program.
[0065] The updating module 603 is used to update the original functional component information based on the customized functional component information, obtain the target functional component information, and run each functional component in the target functional component information.
[0066] In one embodiment, the update module 603 is specifically used to match each customized functional component in the customized functional component information with each original functional component in the original functional component information. If there is an original functional component matching the customized functional component in the original functional component information, the original functional component is replaced with the corresponding customized functional component; the functional component information that exists in the customized functional component information and does not exist in the original functional component information is determined, and the customized functional component corresponding to the functional component information is added to the original functional component information to obtain the target functional component information.
[0067] In one embodiment, the execution priority of the customized functional component in the target functional component information is higher than that of the original functional component.
[0068] In one embodiment, when the operating system of the application is a Linux system, the second loading module 602 is specifically used to create a class loading tool; use the class loading tool to load the customized function package of the application, and parse and initialize the class files in the customized function package to obtain class objects corresponding to each type of file; the class object represents the customized function component.
[0069] In one embodiment, the second loading module 602 is also used to create a spring container; the spring container matches the names of various objects in the customized functional component information with the names of various objects in the original functional component information, and if there is a class object with a matching name, the class object in the original functional component information is replaced with the matching class object in the customized functional component information; the class object that exists in the customized functional component information but does not exist in the original functional component information is determined, and the class object is added to the original functional component information to obtain the target functional component information.
[0070] In one embodiment, the application running device also includes a packaging module, which is used to package the code corresponding to the original functional component before starting the application, obtain the original functional component program package, and deploy the original functional component program package; create an extension file in the extension directory of the application; package the code corresponding to the customized functional component, obtain the customized functional component program package, and store the customized functional component program package in the extension file.
[0071] In one embodiment, the application running device also includes an auxiliary module, which is used to send a package loading completion message after generating the target functional component information. The loading completion message is used to instruct the operating system to execute auxiliary operations for the application running; the auxiliary operations are used to process data generated when the application is running.
[0072] It should be understood that the units or modules recorded in the application program running device are the same as those in the reference Figure 1The various steps in the described method correspond to each other. Therefore, the operations and features described above for the method are also applicable to the application running device and the units contained therein, and will not be repeated here. The application running device can be pre-implemented in the browser or other security applications of the electronic device, and can also be loaded into the browser or its security application of the electronic device by downloading or other means. The corresponding units in the application running device can cooperate with the units in the electronic device to implement the solution of the embodiment of the present application.
[0073] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device or server suitable for implementing an embodiment of the present application.
[0074] like Fig. 9 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0075] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0076] In particular, according to the embodiments of the present disclosure, the above reference Figure 1 The described processes may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising a computer program for executing Figure 1 In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 709 and / or installed from the removable medium 711.
[0077] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium such as a computer-readable storage medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0078] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0079] The units or modules involved in the embodiments described in the present application may be implemented by software or hardware. The units or modules described may also be arranged in a processor. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.
[0080] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the computer device described in the above embodiment, or may exist independently without being installed in the computer device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the method described in the present application. For example, it can be executed Figure 1 to Figure 7 The individual steps of the method are shown.
[0081] The present application embodiment provides a computer program product, which includes instructions. When the instructions are executed, the method described in the present application embodiment is executed. For example, Figure 1 to Figure 7 The individual steps of the method are shown.
[0082] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0083] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the present application.
Claims
1. A method for running an application, characterized in that: The method comprises: When the application is started, the original program package of the application is loaded and the original functional component information of the application is obtained by parsing; Loading the customized function package of the application in the extension file corresponding to the application, and parsing to obtain the customized function component information of the application; The original functional component information is updated based on the customized functional component information to obtain target functional component information, and each functional component in the target functional component information is run.
2. The method according to claim 1, characterized in that The updating of the original functional component information based on the customized functional component information to obtain target functional component information includes: Matching each customized functional component in the customized functional component information with each original functional component in the original functional component information, and if there is an original functional component in the original functional component information that matches the customized functional component, replacing the original functional component with the corresponding customized functional component; Determine the functional component information that exists in the customized functional component information and does not exist in the original functional component information, and add the customized functional component corresponding to the functional component information to the original functional component information to obtain the target functional component information.
3. The method according to claim 1, characterized in that The execution priority of the customized functional component in the target functional component information is higher than that of the original functional component.
4. The method according to any one of claims 1 to 3, characterized in that: When the operating system of the application is a Linux system, the loading of the customized function program package of the application and the parsing to obtain the customized function component information of the application include: Create a class loading tool; The customized function program package of the application is loaded by using the class loading tool, and the class files in the customized function program package are parsed and initialized to obtain class objects corresponding to each class file; the class objects represent the customized function components.
5. The method according to claim 4, characterized in that The updating of the original functional component information based on the customized functional component information to obtain target functional component information includes: Create a spring container; The spring container matches the names of various objects in the customized functional component information with the names of various objects in the original functional component information. If there is a class object with a matching name, the class object in the original functional component information is replaced with the matching class object in the customized functional component information. Determine a class object that exists in the customized functional component information and does not exist in the original functional component information, and add the class object to the original functional component information to obtain the target functional component information.
6. The method according to claim 1, characterized in that Before starting the application, the method further includes: Packing the code corresponding to the original functional component to obtain the original functional component program package, and deploying the original functional component program package; Create an extension file in the application's extension directory; The codes corresponding to the customized functional components are packaged to obtain the customized functional component program package, and the customized functional component program package is stored in the extension file.
7. The method according to claim 1, characterized in that After generating the target functional component information, the method further includes: A program package loading completion message is sent, wherein the loading completion message is used to instruct the operating system to execute an auxiliary operation for the running of the application program; the auxiliary operation is used to process data generated when the application program is running.
8. An application program running device, characterized in that: The device comprises: A first loading module is used to load the original program package of the application program when the application program is started, and parse and obtain the original functional component information of the application program; A second loading module is used to load the customized function program package of the application program in the extension file corresponding to the application program, and parse to obtain the customized function component information of the application program; An updating module is used to update the original functional component information based on the customized functional component information, obtain target functional component information, and run each functional component in the target functional component information.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.