A method, device, equipment and storage medium for quickly starting an application program

By scanning and parsing metadata files during the initialization process of Spring Boot application, and initializing and inserting them in the Spring container, the problem of slow application startup is solved, and faster program startup is achieved.

CN118642781BActive Publication Date: 2025-02-14HANGZHOU NEWGRAND TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411110942.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2025-02-14
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively improve the startup speed of Spring Boot applications, resulting in a long time-consuming startup process.

Method used

By burying the object metadata definition information of the program initialization class, scan the metadata folder under the class path, obtain and parse the target metadata file, initialize it in the Spring container, and use the inserted metadata information based on the inserted metadata information. and Spring objects start the application.

Benefits of technology

Reduces metadata loading and parsing time, as well as object creation time, significantly improving program startup efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118642781B_ABST
    Figure CN118642781B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and storage medium for quick application startup. The method for quick application startup includes: in response to a user-initiated program startup command, in the object metadata definition information embedding point of the program initialization class, scanning the metadata folder under the class path to obtain the target metadata file; parsing the target metadata file, and initializing and inserting the package name, class name and Spring object metadata information of the original instance data in the parsed original instance data into the Spring container; in the container initialization embedding point, based on the Spring container context, inserting the Spring object associated with the Spring container context in the original instance data into the Spring container; and starting the application based on the inserted metadata information and Spring object. The technical solution of the embodiment of the present invention improves the efficiency of application startup.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing technology, and in particular to a method, device, equipment and storage medium for quickly starting an application program. Background Art

[0002] With the popularization of the Internet, microservice architecture has become one of the preferred architectures for Internet application development. Under the microservice architecture, technicians often use the Spring Boot framework to build applications.

[0003] The Spring Boot framework mainly integrates the Spring container and the Tomcat container for rapid development. In the entire startup process, the Spring container is started first, and then the Tomcat container. Since the Spring container will pre-initialize the Java class, create and initialize third-party middleware resources, the Spring Boot application starts more and more slowly.

[0004] In order to improve the efficiency of program startup, the existing technology often uses lazy loading for third-party resources as much as possible. This method relies heavily on the awareness of developers or overall architecture specifications, and cannot stably and reliably achieve fast program startup. How to reliably improve the program startup speed is very important for improving developer work efficiency and ensuring the user experience of the service. Summary of the invention

[0005] The present invention provides a method, device, equipment and storage medium for quickly starting an application program, so as to solve the problem that a large amount of content needs to be loaded during the initialization process of the application program, which takes a long time.

[0006] According to one aspect of the present invention, there is provided a method for quickly starting an application program, comprising:

[0007] In response to a program start command initiated by a user, in the object metadata definition information embedding point of the program initialization class, a metadata folder under the class path is scanned to obtain a target metadata file;

[0008] Parse the target metadata file, and initialize and insert the package name, class name and Spring object metadata information of the original instance data obtained by parsing into the Spring container;

[0009] In the container initialization tracking point, based on the Spring container context, the Spring object associated with the Spring container context in the original instance data is inserted into the Spring container;

[0010] Start the application based on the inserted metadata information and Spring objects.

[0011] According to another aspect of the present invention, there is provided a device for quickly starting an application program, comprising:

[0012] The metadata file acquisition module is used to respond to the program start command initiated by the user, scan the metadata folder under the class path in the object metadata definition information embedding point of the program initialization class, and obtain the target metadata file;

[0013] A metadata insertion module is used to parse the target metadata file and initialize and insert the package name, class name and Spring object metadata information of the original instance data obtained by parsing into the Spring container;

[0014] An object insertion module is used to insert the Spring object associated with the Spring container context in the original instance data into the Spring container based on the Spring container context in the container initialization embedding point;

[0015] The program startup module is used to start the application based on the inserted metadata information and Spring objects.

[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0017] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the application quick start method described in any embodiment of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the application quick startup method described in any embodiment of the present invention when executed.

[0019] According to another aspect of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method for quickly starting an application program according to any embodiment of the present disclosure is implemented.

[0020] The technical solution of the embodiment of the present invention responds to a program start command initiated by a user, scans the metadata folder under the class path in the object metadata definition information embedding point of the program initialization class, obtains the target metadata file, parses the target metadata file, and initializes and inserts the package name, class name and metadata information of the Spring object to which the original instance data in the parsed original instance data belongs into the Spring container. In the container initialization embedding point, based on the Spring container context, the Spring object associated with the Spring container context in the original instance data is inserted into the Spring container. Finally, the application is started based on the inserted metadata information and Spring object, which reduces the metadata loading and parsing time, as well as the object creation time, and improves the program startup efficiency.

[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 is a flowchart of a method for quickly starting an application program according to Embodiment 1 of the present invention;

[0024] Figure 2 is a flowchart of a method for quickly starting an application program provided according to Embodiment 2 of the present invention;

[0025] Figure 3 is a schematic diagram of the structure of a device for quickly starting an application program according to Embodiment 3 of the present invention;

[0026] Figure 4 The present invention is a schematic diagram of the structure of an electronic device for implementing the method for quickly starting an application program according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] Embodiment 1

[0030] Figure 1 A flowchart of a method for quickly launching an application program is provided for the first embodiment of the present invention. This embodiment is applicable to a predetermined situation. The method can be executed by a device for quickly launching an application program. The device for quickly launching the application program can be implemented in the form of hardware and / or software. The device for quickly launching the application program can be configured in various general-purpose computing devices. Figure 1 As shown, the method includes:

[0031] S110. In response to a program start command initiated by a user, in the object metadata definition information embedding point of the program initialization class, a metadata folder under the class path is scanned to obtain a target metadata file.

[0032] The Spring Boot framework mainly integrates the Spring container and the Tomcat container for rapid development. In the entire startup process, the Spring container is started first, and then the Tomcat container. Since the Spring container will pre-initialize the Java class, create and initialize third-party middleware resources, the Spring Boot application starts more and more slowly.

[0033] In the embodiment of the present invention, in order to speed up the initialization process, after the user initiates the program command, the metadata folder under the classpath is scanned in the object metadata definition information embedding point of the program initialization class. The metadata folder includes one or more pre-stored metadata files, each of which contains a piece of original instance data, and the name is defined as process number + snp + creation time. Each piece of original instance data includes the package name to which the original instance data belongs, the class name, the metadata information of the Spring object, the Spring object, and the singleton object.

[0034] Furthermore, based on the name of the metadata file, the creation time of the metadata file can be determined. In order to enable the program initialization process to quickly load metadata information, the target metadata file is determined in the metadata folder based on the creation time. Specifically, the metadata file whose creation time is closest to the current time in the metadata folder can be obtained as the target metadata file. In order to ensure the availability of the target metadata file, a judgment indicator can be added, that is, after obtaining the metadata file whose creation time is closest to the current time in the data folder, it is further determined whether the creation time is within a set time range (for example, within 1 day) from the current time. If so, the metadata file is used as the target metadata file.

[0035] In addition, if the metadata file does not exist or was created more than one day ago, the snapshot acquisition mode is entered to load metadata information by acquiring a snapshot.

[0036] S120, parsing the target metadata file, and initializing and inserting the package name, class name and Spring object metadata information of the original instance data obtained by parsing into the Spring container.

[0037] In the embodiment of the present invention, since the information in the metadata file is serialized, it cannot be used directly. Therefore, after obtaining the target metadata file, it is necessary to parse it to obtain the original instance data, specifically including the package name, class name, metadata information of the Spring object, Spring object and singleton object to which the original instance data belongs. After parsing, the package name, class name and metadata information of the Spring object to which the original instance data belongs are initialized and inserted in the Spring container, which can speed up the loading speed of the metadata information.

[0038] In a specific example, the target metadata file is deserialized, and after parsing, the package name, class name and metadata information of the Spring object to which the original instance data belongs are initialized and inserted into the Spring container. The metadata information can be obtained directly by parsing the target metadata file. Compared with the prior art that loads metadata information sequentially, the initialization efficiency is improved.

[0039] S130. In the container initialization tracking point, based on the Spring container context, the Spring object associated with the Spring container context in the original instance data is inserted into the Spring container.

[0040] In an embodiment of the present invention, in addition to loading metadata information, object creation is also required during the application initialization process. When a large number of objects need to be created, this process seriously affects the efficiency of application startup. Therefore, in the container initialization tracking point, based on the Spring container context, the Spring object associated with the Spring container context in the original instance data is inserted into the Spring container. When an object needs to be created, it can be directly obtained from the Spring container context without having to recreate it one by one, further speeding up the program initialization process.

[0041] S140: Start the application based on the inserted metadata information and Spring objects.

[0042] In the embodiment of the present invention, the application startup process is executed based on the inserted metadata information and Spring object. By preloading all metadata information and Spring objects, the program initialization efficiency is greatly improved, thereby realizing the rapid startup of the application.

[0043] The technical solution of the embodiment of the present invention responds to a program start command initiated by a user, scans the metadata folder under the class path in the object metadata definition information embedding point of the program initialization class, obtains the target metadata file, parses the target metadata file, and initializes and inserts the package name, class name and metadata information of the Spring object to which the original instance data in the parsed original instance data belongs into the Spring container. In the container initialization embedding point, based on the Spring container context, the Spring object associated with the Spring container context in the original instance data is inserted into the Spring container. Finally, the application is started based on the inserted metadata information and Spring object, which reduces the metadata loading and parsing time, as well as the object creation time, and improves the program startup efficiency.

[0044] Embodiment 2

[0045] Figure 2A flowchart of a method for quickly starting an application provided in the second embodiment of the present invention. This embodiment is further refined on the basis of the above embodiment, and provides specific steps for scanning the metadata folder under the class path in the object metadata definition information embedding point of the program initialization class in response to a user-initiated program startup command to obtain a target metadata file, parsing the target metadata file, and initializing and inserting the package name, class name and metadata information of the Spring object to which the original instance data belongs in the parsed original instance data into the Spring container, and specific steps for inserting the Spring object associated with the Spring container context in the original instance data into the Spring container based on the Spring container context in the container initialization embedding point. Figure 2 As shown, the method includes:

[0046] S210. In response to a program start command initiated by a user, in the object metadata definition information embedding point of the program initialization class, a metadata folder under the class path is scanned to obtain the creation time of the metadata file in the metadata folder.

[0047] In order to speed up the application initialization process, customize the program initialization class (AppRunOBJSnapshotInitializer), extend the program initialization class in the Spring container, and complete the Spring container tracking.

[0048] Pre-process the object metadata definition information by obtaining the object metadata registration container (BDR) as the global object of the AppRunOBJSnapshotInitializer class. The BDR container is used to store registered objects.

[0049] In addition, container initialization tracking is required in advance. The processing logic in this tracking is as follows: Step 1: Obtain the metadata information of the original instance data hosted by the object metadata registration container, and insert the metadata information (DFR) and the package name and class name (key) to which the original instance data belongs into the data structure (SNP) of the original instance data as shown in Table 1. It is also necessary to determine whether the hosted metadata information is a singleton object. If so, set the value of the singleton object (SINGLETON);

[0050] Table 1

[0051] Key DFR OBJ SINGLETON Package name.Class name Spring managed object metadata information Spring Objects Singleton Object

[0052] Step 2: Traverse the original instance data, obtain the Spring object in the Spring container context, fill the Spring object (OBJ) based on the data structure of the original instance data, and obtain the complete original instance data.

[0053] After obtaining the complete original instance data, traverse the package name and class name of the original instance data, obtain metadata information, and obtain the parent class name of the original instance data according to the metadata information. If the parent class name contains keywords such as "Spring", delete the original instance data to avoid snapshot loading errors or reliance on third-party resources for initialization.

[0054] After completing the above data sorting process, the sorted original instance data can be serialized, and the serialization operation result can be stored as a metadata file in a pre-created class path for calling when the program starts.

[0055] In an embodiment of the present invention, in response to a user-initiated program startup command, in the object metadata definition information embedding point of the program initialization class, the metadata folder under the class path is scanned to obtain the creation time of the metadata file in the metadata folder. Specifically, the name of the metadata file can be directly parsed to obtain the creation instance of the metadata file contained therein. Exemplarily, the name of the metadata file includes three parts: process number, "SNP" and creation time. By parsing the file name, the file creation time can be obtained.

[0056] S220: Obtain a metadata file whose creation time is closest to the current time as a candidate metadata file.

[0057] In the embodiment of the present invention, in order to ensure that the metadata loaded in the initialization process is the latest metadata stored in the class path, a metadata file whose creation time is closest to the current time is obtained in the metadata folder as a candidate metadata file.

[0058] S230: When the creation time of the candidate metadata file is within a set time period from the current time, the candidate metadata file is used as the target metadata file.

[0059] In the embodiment of the present invention, the difference between the creation time of the candidate metadata file and the current time is calculated. If the difference is within a set time period, the candidate metadata file is used as the target metadata file to ensure the availability of the target metadata file.

[0060] In addition, if there is no metadata file in the metadata folder under the class path or the creation time of the metadata files in the metadata folder is outside the set time range, the snapshot acquisition mode is entered to obtain metadata information through the snapshot. If the metadata folder and metadata files are created under the class path on machine A, and the machine currently executing the program is machine B, the metadata folder can be copied from the class path of machine A to the class path of machine B to achieve fast startup of different servers on different machines.

[0061] Optionally, before scanning the metadata folder under the class path to obtain the target metadata file, it also includes:

[0062] Obtain the metadata information of the Spring object in the object metadata registration container, and insert the metadata information and the package name and class name to which the Spring object belongs into the instance data;

[0063] Based on the package name and class name in the instance data, a Spring object is obtained in the Spring container context, and the instance data is completed based on the Spring object to obtain the original instance data;

[0064] Serialize the Spring objects in the original instance data;

[0065] Perform an overall serialization operation on the original instance data that completes the Spring object serialization operation, and store the resulting metadata file in the metadata folder under the class path.

[0066] In this optional embodiment, the required operations before executing the application startup operation are provided: first, the metadata information of the Spring object is obtained in the object metadata registration container, and the metadata information and the package name and class name to which the Spring object belongs are inserted into the instance data. Further, based on the package name and class name in the instance data, the Spring object is obtained in the Spring container context, and the instance data is completed based on the Spring object to obtain the original instance data. For the convenience of storage and transmission, the Spring object in the original instance data is serialized, and finally the original instance data that completes the Spring object serialization operation is serialized as a whole, and the obtained metadata file is stored in the metadata folder under the class path.

[0067] Optionally, perform serialization operations on the Spring objects in the original instance data, including:

[0068] Extract one original instance data piece by piece as the current instance data, and determine whether the Spring object in the current instance data has implemented the serialization interface;

[0069] In the case where the serialization interface has been implemented, the object binary stream acquisition processing is performed on the Spring object;

[0070] In the case where the serialization interface is not implemented, a map object is created, the attributes and attribute values ​​of the Spring object are used as the keys and values ​​of the map object respectively, and the map object is used to replace the Spring object.

[0071] In this optional embodiment, a specific method for performing serialization operations on the Spring object in the original instance data is provided: extracting one original instance data as the current instance data in turn, and judging whether the Spring object in the current instance data has implemented the serialization interface. In the case where the serialization interface has been implemented, the object binary stream acquisition processing is performed on the Spring object, and the processing result is used to replace the original Spring object; in the case where the serialization interface is not implemented, a map object is created, and the attributes and attribute values ​​of the Spring object are respectively used as the key and value of the map object, and the map object is used to replace the Spring object.

[0072] S240, performing a metadata restoration operation on the target metadata file to obtain original instance data; the original instance data includes the package name, class name, metadata information of the Spring object, the Spring object, and the singleton object to which the original instance data belongs.

[0073] In the embodiment of the present invention, since the original instance data contained in the target metadata file is serialized, a metadata restoration operation needs to be performed before use to obtain the original instance data. Specifically, a deserialization operation is performed on the target metadata file to obtain the package name, class name, metadata information of the Spring object, the Spring object, and the singleton object to which the original instance data belongs.

[0074] Optionally, perform a metadata restoration operation on the target metadata file to obtain the original instance data, including:

[0075] Perform an object binary data deserialization operation on the target metadata file to obtain transition instance data in the target metadata file; the transition instance data includes the package name, class name, metadata information of the Spring object, the Spring object, and the singleton object to which the instance belongs;

[0076] Traverse the transition instance data and determine whether the Spring object in each transition instance data is a map object;

[0077] In the case where the Spring object is a map object, the key and value in the map object are obtained and used as the attribute and attribute value of the Spring object respectively to replace the map object in the transition instance data to obtain the original instance data.

[0078] In this optional embodiment, a specific method for performing a metadata restoration operation on the target metadata file to obtain the original instance data is provided: the metadata restoration operation is the reverse operation of the serialization operation described above. First, the object binary data deserialization operation is performed on the entire target metadata file to obtain the transition instance data in the target metadata file. Among them, the transition instance data includes the package name, class name, metadata information of the Spring object, the Spring object, and the singleton object to which the instance belongs. It is worth noting that the Spring object in the transition instance data may be in the form of a map that has been previously mapped. Therefore, it is necessary to further traverse the transition instance data and determine whether the Spring object in each transition instance data is a map object. In the case where the Spring object is a map object, the key and value in the map object are obtained, and used as the attribute and attribute value of the Spring object respectively to replace the map object in the transition instance data to obtain the original instance data.

[0079] S250: Initialize and insert the package name, class name and metadata information of the Spring object to which the original instance data belongs in the original instance data into the Spring container.

[0080] In the embodiment of the present invention, after performing a metadata restoration operation on the target metadata file, the package name, class name and metadata information of the Spring object to which the original instance data belongs in the original instance data are initialized and inserted in the object metadata registration container (BDR), and initialized and inserted in the Spring container for subsequent program initialization. At this point, the metadata creation of the Spring container is completed, reducing the Spring container parsing all configuration files and obtaining object information through reflection, and improving the efficiency of metadata loading.

[0081] S260. In the container initialization tracking point, the class name of the object to be created is compared with the class name in the original instance data. If the class name that is the same as the class name of the object to be created exists in the original instance data, the Spring object corresponding to the class name is returned.

[0082] In an embodiment of the present invention, in the container initialization tracking point, the class name of the object to be created is compared with the class name in the original instance data. If there is a class name in the original instance data that is the same as the class name of the object to be created, the Spring object corresponding to the class name is directly returned for the operation of the application.

[0083] S270. Based on the Spring container context, insert the Spring object associated with the Spring container context in the original instance data into the Spring container.

[0084] In the embodiment of the present invention, in addition to returning the class name of the current object to be created, the Spring object associated with the Spring container context in the original instance data is inserted into the Spring container according to the Spring container context. When an object needs to be created later, the Spring container context is searched directly according to the class name of the object to be created. If it exists, the Spring object in the Spring container context is directly returned, which reduces the time required for object creation and quickly completes program initialization.

[0085] S280: Start the application based on the inserted metadata information and Spring objects.

[0086] The technical solution of the embodiment of the present invention obtains the target metadata file in the object metadata definition information burying point, and by parsing the target metadata file, the package name, class name and metadata information of the Spring object to which the original instance data belongs are initialized and inserted into the Spring container, thereby accelerating the metadata loading speed. In the container initialization burying point, based on the Spring container context, the Spring object associated with the Spring container context in the original instance data is inserted into the Spring container. In the subsequent program initialization process, there is no need to create objects one by one, and it is only necessary to obtain the Spring object in the Spring container, thereby further improving the program startup efficiency.

[0087] Embodiment 3

[0088] Figure 3 This is a schematic diagram of the structure of a device for quickly launching an application program provided by Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:

[0089] The metadata file acquisition module 310 is used to respond to the program start command initiated by the user, scan the metadata folder under the class path in the object metadata definition information embedding point of the program initialization class, and obtain the target metadata file;

[0090] The metadata insertion module 320 is used to parse the target metadata file and initialize and insert the package name, class name and Spring object metadata information of the original instance data obtained by the parsing into the Spring container;

[0091] The object insertion module 330 is used to insert the Spring object associated with the Spring container context in the original instance data into the Spring container based on the Spring container context in the container initialization embedding point;

[0092] The program startup module 340 is used to start the application based on the inserted metadata information and Spring objects.

[0093] The technical solution of the embodiment of the present invention responds to a program start command initiated by a user, scans the metadata folder under the class path in the object metadata definition information embedding point of the program initialization class, obtains the target metadata file, parses the target metadata file, and initializes and inserts the package name, class name and metadata information of the Spring object to which the original instance data in the parsed original instance data belongs into the Spring container. In the container initialization embedding point, based on the Spring container context, the Spring object associated with the Spring container context in the original instance data is inserted into the Spring container. Finally, the application is started based on the inserted metadata information and Spring object, which reduces the metadata loading and parsing time, as well as the object creation time, and improves the program startup efficiency.

[0094] Optionally, the metadata file acquisition module 310 is specifically used to:

[0095] Scan the metadata folder under the class path to obtain the creation time of the metadata file in the metadata folder;

[0096] Obtain the metadata file whose creation time is closest to the current time as the candidate metadata file;

[0097] When the creation time of the candidate metadata file is within a set time period from the current time, the candidate metadata file is used as the target metadata file.

[0098] Optionally, the metadata insertion module 320 includes:

[0099] The original instance data acquisition unit is used to perform a metadata restoration operation on the target metadata file to obtain the original instance data; the original instance data includes the package name, class name, metadata information of the Spring object, the Spring object and the singleton object to which the original instance data belongs;

[0100] The metadata insertion unit is used to initialize and insert the package name, class name and metadata information of the Spring object to which the original instance data belongs in the original instance data into the Spring container.

[0101] Optionally, the original instance data acquisition unit is specifically used to:

[0102] Performing an object binary data deserialization operation on the target metadata file to obtain transition instance data in the target metadata file; the transition instance data includes a package name, a class name, metadata information of a Spring object, a Spring object, and a singleton object to which the instance belongs;

[0103] Traversing the transition instance data, and determining whether the Spring object in each transition instance data is a map object;

[0104] In the case where the Spring object is a map object, the key and value in the map object are obtained and used as the attribute and attribute value of the Spring object respectively to replace the map object in the transition instance data to obtain the original instance data.

[0105] Optionally, the object insertion module 330 includes:

[0106] An object returning unit, used to compare the class name of the object to be created with the class name in the original instance data in the container initialization tracking point, and if the original instance data contains a class name identical to the class name of the object to be created, return the Spring object corresponding to the class name;

[0107] The object insertion unit is used to insert the Spring object associated with the Spring container context in the original instance data into the Spring container based on the Spring container context.

[0108] Optionally, the application quick launch device also includes:

[0109] The metadata information acquisition module is used to obtain the metadata information of the Spring object in the object metadata registration container before scanning the metadata folder under the class path to obtain the target metadata file, and insert the metadata information and the package name and class name to which the Spring object belongs into the instance data;

[0110] The original instance data acquisition module is used to obtain the Spring object in the Spring container context based on the package name and class name in the instance data, and complete the instance data based on the Spring object to obtain the original instance data;

[0111] A data serialization module, used to perform serialization operations on the Spring objects in the original instance data;

[0112] The metadata file storage module is used to perform overall serialization operations on the original instance data that completes the Spring object serialization operation, and store the obtained metadata files in the metadata folder under the class path.

[0113] Optional, data serialization module, specifically used for:

[0114] Extract one original instance data piece by piece as the current instance data, and determine whether the Spring object in the current instance data has implemented the serialization interface;

[0115] In the case where the serialization interface has been implemented, the object binary stream acquisition processing is performed on the Spring object;

[0116] In the case where the serialization interface is not implemented, a map object is created, the attributes and attribute values ​​of the Spring object are used as the keys and values ​​of the map object respectively, and the map object is used to replace the Spring object.

[0117] The application program quick start device provided in the embodiment of the present invention can execute the application program quick start method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0118] In the technical solution of the present invention, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0119] Embodiment 4

[0120] According to an embodiment of the present invention, the present invention also provides an electronic device, a readable storage medium and a computer program product.

[0121] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, applicators, blade applicators, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0122] like Figure 4As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0123] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0124] The processor 11 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as an application quick launch method.

[0125] In some embodiments, the application quick launch method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the application quick launch method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the application quick launch method in any other appropriate manner (e.g., by means of firmware).

[0126] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0127] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or application.

[0128] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.

[0129] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0130] The systems and techniques described herein may be implemented in a computing system that includes a backend component (e.g., as a data applier), or a computing system that includes a middleware component (e.g., an application applier), or a computing system that includes a frontend component (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0131] A computing system may include a client and an application server. The client and the application server are generally remote from each other and usually interact through a communication network. The relationship between the client and the application server is generated by computer programs running on corresponding computers and having a client-application server relationship with each other. The application server may be a cloud application server, also known as a cloud computing application server or a cloud host, which is a host product in a cloud computing application system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS applications.

[0132] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0133] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for quickly starting an application, characterized in that: include: In response to a program start command initiated by a user, in the object metadata definition information embedding point of the program initialization class, a metadata folder under the class path is scanned to obtain a target metadata file; The metadata folder includes one or more pre-stored metadata files, each metadata file includes multiple pieces of original instance data, and the name is defined as process number + snp + creation time; Parse the target metadata file, and initialize and insert the package name, class name and Spring object metadata information of the original instance data obtained by parsing into the Spring container; In the container initialization tracking point, based on the Spring container context, the Spring object associated with the Spring container context in the original instance data is inserted into the Spring container; Start the application based on the inserted metadata information and Spring objects; The step of scanning the metadata folder under the class path to obtain the target metadata file includes: Scan the metadata folder under the class path to obtain the creation time of the metadata file in the metadata folder; Obtain the metadata file whose creation time is closest to the current time as the candidate metadata file; When the creation time of the candidate metadata file is within a set time period from the current time, the candidate metadata file is used as the target metadata file.

2. The method according to claim 1, characterized in that Parse the target metadata file, and initialize and insert the package name, class name and Spring object metadata information of the original instance data in the parsed original instance data into the Spring container, including: Performing a metadata restoration operation on the target metadata file to obtain original instance data; the original instance data includes the package name, class name, metadata information of the Spring object, the Spring object, and the singleton object to which the original instance data belongs; The package name, class name and metadata information of the Spring object to which the original instance data belongs in the original instance data are initialized and inserted into the Spring container.

3. The method according to claim 2, characterized in that Performing a metadata restoration operation on the target metadata file to obtain original instance data includes: Performing an object binary data deserialization operation on the target metadata file to obtain transition instance data in the target metadata file; the transition instance data includes a package name, a class name, metadata information of a Spring object, a Spring object, and a singleton object to which the instance belongs; Traversing the transition instance data, and determining whether the Spring object in each transition instance data is a map object; In the case where the Spring object is a map object, the key and value in the map object are obtained and used as the attribute and attribute value of the Spring object respectively to replace the map object in the transition instance data to obtain the original instance data.

4. The method according to claim 1, characterized in that: In the container initialization tracking point, based on the Spring container context, the Spring object associated with the Spring container context in the original instance data is inserted into the Spring container, including: In the container initialization tracking point, the class name of the object to be created is compared with the class name in the original instance data. If the class name of the object to be created is the same as the class name of the object to be created in the original instance data, the Spring object corresponding to the class name is returned; Based on the Spring container context, the Spring object associated with the Spring container context in the original instance data is inserted into the Spring container.

5. The method according to claim 1, characterized in that Before scanning the metadata folder under the class path to obtain the target metadata file, it also includes: Obtain metadata information of the Spring object in the object metadata registration container, and insert the metadata information and the package name and class name to which the Spring object belongs into the instance data; Based on the package name and class name in the instance data, a Spring object is obtained in the Spring container context, and the instance data is completed based on the Spring object to obtain the original instance data; Performing serialization operation on the Spring object in the original instance data; Perform an overall serialization operation on the original instance data that completes the Spring object serialization operation, and store the resulting metadata file in the metadata folder under the class path.

6. The method according to claim 5, characterized in that Perform serialization operations on the Spring object in the original instance data, including: Extract one original instance data piece by piece as the current instance data, and determine whether the Spring object in the current instance data has implemented the serialization interface; In the case where the serialization interface has been implemented, the object binary stream acquisition processing is performed on the Spring object; In the case where the serialization interface is not implemented, a map object is created, the attributes and attribute values ​​of the Spring object are used as the keys and values ​​of the map object respectively, and the map object is used to replace the Spring object.

7. A device for quickly launching an application, characterized in that: include: The metadata file acquisition module is used to respond to the program startup command initiated by the user, scan the metadata folder under the class path in the object metadata definition information embedding point of the program initialization class, and obtain the target metadata file; the metadata folder includes one or more pre-stored metadata files, each metadata file includes multiple original instance data, and the name is defined as process number + snp + creation time; A metadata insertion module is used to parse the target metadata file and initialize and insert the package name, class name and Spring object metadata information of the original instance data obtained by parsing into the Spring container; An object insertion module is used to insert the Spring object associated with the Spring container context in the original instance data into the Spring container based on the Spring container context in the container initialization embedding point; The application startup module is used to start the application based on the inserted metadata information and Spring objects; The metadata file acquisition module is specifically used to: Scan the metadata folder under the class path to obtain the creation time of the metadata file in the metadata folder; Obtain the metadata file whose creation time is closest to the current time as the candidate metadata file; When the creation time of the candidate metadata file is within a set time period from the current time, the candidate metadata file is used as the target metadata file.

8. An electronic device, characterized in that: The electronic device comprises: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the application quick start method described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the application quick startup method according to any one of claims 1 to 6 when executed.

Citation Information

Patent Citations

  • Big data point burying method and device of application program, equipment and medium

    CN114185776A

  • Micro-service hot deployment method and system, electronic equipment and storage medium

    CN115658109A