Middleware startup time optimization method, device and readable storage medium

By reordering and parallel processing of middleware startup items, combining multi-threaded synchronization and JVM configuration optimization, the problem of too long middleware startup time is solved, and customer experience and development efficiency is improved.

CN114064141BActive Publication Date: 2024-11-05YONYOU NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111231778.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-22
Publication Date
2024-11-05
Estimated Expiration
2041-10-22

AI Technical Summary

Technical Problem

The middleware startup time is too long, resulting in an increase in the wait time of developers, reducing customer satisfaction and user experience.

Method used

By obtaining the startup timing and dependencies of middleware startup items, reordering and parallel processing, using locking to achieve multi-threaded synchronization, optimize the startup sequence of middleware startup items, including early loading of metadata and delaying startup of active components, and adopting multi-threaded parallel loading and adjust the JVM configuration.

Benefits of technology

Significantly shortens the startup time of middleware, improves software usage, reduces human capital, and improves customer experience and satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114064141B_ABST
    Figure CN114064141B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and readable storage medium for optimizing the startup time of middleware. The method for optimizing the startup time of middleware includes obtaining the startup timing of multiple startup items and the dependency relationship of the multiple startup items when the middleware is started; reordering the startup timing of the multiple startup items according to the dependency relationship of the multiple startup items, starting the startup items with dependencies according to the dependencies, starting the startup items without dependencies in parallel, and realizing multi-threaded synchronization through locking when each startup item is started. The technical solution of the present invention significantly shortens the startup time of the middleware by reordering and parallel processing the startup timing of the startup items in the middleware, thereby improving the utilization rate of the software, reducing human capital, improving customer experience, and increasing customer satisfaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device and readable storage medium for optimizing middleware startup duration. Background Art

[0002] In enterprise management software (for example, UFIDA NC products or UFIDA NCC products), it takes a lot of time, usually more than 10 minutes, to start the middleware once. For developers or implementation personnel who need to restart the middleware many times a day, they have to spend time waiting for the middleware to start every day, which increases human capital.

[0003] It takes a while to start a WAS cluster (IBM websphere for application cluster). During the waiting time, the customer system cannot be used, which reduces customer satisfaction.

[0004] After the middleware is restarted, it takes nearly two minutes to log into the system for the first time, which makes the customer experience worse. Summary of the invention

[0005] The present invention aims to solve or improve at least one of the above-mentioned technical problems.

[0006] To this end, a first objective of the present invention is to provide a method for optimizing middleware startup duration.

[0007] A second objective of the present invention is to provide a device for optimizing the startup duration of middleware.

[0008] A third object of the present invention is to provide a readable storage medium.

[0009] To achieve the first purpose of the present invention, the technical solution of the present invention provides a method for optimizing the startup duration of a middleware, including: obtaining the startup timing of multiple startup items and the dependency relationship of the multiple startup items when the middleware is started; reordering the startup timing of the multiple startup items according to the dependency relationship of the multiple startup items, starting the startup items with dependencies according to the dependency relationship, starting the startup items without dependencies in parallel, and achieving multi-threaded synchronization through locking when each startup item is started.

[0010] This technical solution significantly shortens the startup time of the middleware by reordering and parallelizing the startup timing of the startup items in the middleware, thereby improving the utilization rate of the software, reducing human capital, improving customer experience, and increasing customer satisfaction. In this technical solution, multi-thread synchronization is achieved through locking when each startup item is started, which can ensure the reliability of the timing.

[0011] In addition, the technical solution provided by the present invention may also have the following additional technical features:

[0012] In the above technical solution, the middleware startup time optimization method further includes: after starting the data source and multiple basic activity components, starting the web application service (web context) in parallel.

[0013] In any of the above technical solutions, the middleware startup time optimization method also includes: setting metadata that needs to be loaded in advance; for the metadata loaded in advance, loading it before the startup of each module (modules) class of the product is completed and the http protocol connector (http connector) is started.

[0014] In any of the above technical solutions, the middleware startup time optimization method also includes: setting a delayed startup activity component; for the delayed startup activity component, starting it after the http connector is started and the response is opened.

[0015] In any of the above technical solutions, the method for optimizing the middleware startup time further includes: when logging into the software, logging in using a set language.

[0016] In any of the above technical solutions, the method for optimizing the startup time of the middleware also includes: using multi-threaded parallel loading for the classes under the modules to reduce the granularity of the lock when the class loader loads the class.

[0017] In any of the above technical solutions, the method for optimizing the startup time of the middleware further includes: the tomcat web container adopts multi-threaded parallel loading of the web context through the chain of responsibility mode.

[0018] In any of the above technical solutions, the middleware startup duration optimization method further includes: after the startup timing of multiple startup items is reordered, based on multi-threaded startup, adjusting the encapsulation of the class.

[0019] In any of the above technical solutions, the method for optimizing the startup time of the middleware further includes: adjusting the configuration parameters in the Java virtual machine to reduce the startup time of the middleware.

[0020] To achieve the third purpose of the present invention, the technical solution of the present invention provides a middleware startup duration optimization device, including: a memory and a processor, the memory stores a program or instruction, and the processor executes the program or instruction; wherein, when the processor executes the program or instruction, it implements the steps of the middleware startup duration optimization method as any technical solution of the present invention.

[0021] The middleware startup duration optimization device provided by the technical solution implements the steps of the middleware startup duration optimization method of any technical solution of the present invention, and thus it has all the beneficial effects of the middleware startup duration optimization method of any technical solution of the present invention, which will not be repeated here.

[0022] To achieve the fourth purpose of the present invention, the technical solution of the present invention provides a readable storage medium, which stores a program or instruction. When the program or instruction is executed, the steps of the middleware startup duration optimization method of any of the above technical solutions are implemented.

[0023] The readable storage medium provided by this technical solution implements the steps of the middleware startup duration optimization method as in any technical solution of the present invention, and thus has all the beneficial effects of the middleware startup duration optimization method as in any technical solution of the present invention, which will not be repeated here.

[0024] Additional aspects and advantages of the present invention will become apparent from the following description or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0026] Figure 1 This is a flow chart of a method for optimizing the startup time of middleware according to an embodiment of the present invention;

[0027] Figure 2 This is a second flow chart of a method for optimizing the startup duration of middleware according to an embodiment of the present invention;

[0028] Figure 3 This is a third flow chart of a method for optimizing the startup duration of middleware according to an embodiment of the present invention;

[0029] Figure 4 This is a fourth flow chart of a method for optimizing the startup time of middleware according to an embodiment of the present invention;

[0030] Figure 5 This is a fifth flow chart of a method for optimizing the startup duration of middleware according to an embodiment of the present invention;

[0031] Figure 6 This is a sixth flow chart of a method for optimizing the startup duration of middleware according to an embodiment of the present invention;

[0032] Figure 7 This is a seventh flow chart of a method for optimizing the startup duration of middleware according to an embodiment of the present invention;

[0033] Figure 8This is a flow chart eight of a method for optimizing the startup duration of middleware according to an embodiment of the present invention;

[0034] Fig. 9 This is a ninth flow chart of a method for optimizing the startup duration of middleware according to an embodiment of the present invention;

[0035] Fig.10 A schematic diagram of the composition of a device for optimizing the startup duration of middleware according to an embodiment of the present invention;

[0036] Fig.11 This is one of the stack diagrams captured during a downtime according to an embodiment of the present invention;

[0037] Fig.12 The second schematic diagram of the stack captured during a downtime according to an embodiment of the present invention;

[0038] Fig.13 A schematic diagram of a null pointer exception according to an embodiment of the present invention.

[0039] in, Fig.10 The corresponding relationship between the reference numerals and the component names is as follows:

[0040] 200: middleware startup duration optimization device, 210: memory, 220: processor. DETAILED DESCRIPTION

[0041] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0042] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0043] Refer to the following Figures 1 to 13 The invention describes a method, an apparatus and a readable storage medium for optimizing the startup duration of middleware according to some embodiments of the invention.

[0044] Embodiment 1:

[0045] like Figure 1 As shown, this embodiment provides a method for optimizing the startup time of middleware, comprising the following steps:

[0046] Step S102, obtaining the startup sequence of multiple startup items and the dependency relationship of the multiple startup items when the middleware is started;

[0047] Step S104, reordering the startup sequence of the multiple startup items according to the dependencies between the multiple startup items, starting the startup items with dependencies according to the dependencies, and starting the startup items without dependencies in parallel, and realizing multi-thread synchronization through locking when starting each startup item.

[0048] In the related art, the main process of starting the middleware of the enterprise management software (for example, UFIDA NC products or UFIDA NCC products, including UFIDA NC6.3 products, UFIDA NC6.5 products, UFIDA NCC1909 products, UFIDA NCC2005 products, UFIDA NCC for EPM products, etc.) is only loaded by a single thread. The startup sequence of the NC / NCC middleware is to first scan the prop.xml core configuration information of nchome, load the tomcat web container, EJB (Enterprise Java Beans) container and data source, and then start scanning and loading the interface classes under the modules in a listener of the tomcat web, and finally continue to load each web context. The above processes are all single-threaded, so the whole cycle takes a long time, increases human capital, and reduces customer satisfaction.

[0049] For larger projects, such as those with a large number of modules and a large amount of customer data, or there are a large number of unfinished tasks in the IUFO (internet User Friend Office, NC report) computing queue in the cluster scheduler, and there are warnings and background tasks to be executed in the UAP (Unified Application Platform, UAP) scheduler, the middleware startup will consume a lot of time in the module loading link, increase human capital, and reduce customer satisfaction.

[0050] For example, this embodiment can be used in NC or NCC to optimize the middleware startup time.

[0051] In this embodiment, first, the startup sequence of multiple startup items and the dependency relationship of the multiple startup items when the middleware is started are obtained, and then the original timing structure is disassembled to allow each link to be started in parallel as much as possible. According to the dependency relationship of the multiple startup items, the startup sequence of the multiple startup items is reordered, and the startup items with dependencies are started according to the dependencies, and the startup items without dependencies are started in parallel. When each startup item is started, multi-threaded synchronization is achieved through locking.

[0052] This embodiment significantly shortens the startup time of the middleware by reordering and parallelizing the startup sequence of startup items in the middleware, thereby increasing software utilization, reducing human capital, improving customer experience, and increasing customer satisfaction.

[0053] In this embodiment, multi-thread synchronization is achieved through locking when each startup item is started, so that the reliability of the timing can be guaranteed.

[0054] Embodiment 2:

[0055] like Figure 2 As shown, this embodiment provides a method for optimizing the startup duration of middleware. In addition to the technical features of the above embodiment, this embodiment further includes the following technical features:

[0056] The middleware startup time optimization method also includes the following steps:

[0057] Step S202, after starting the data source and multiple basic activity components, start the web context in parallel.

[0058] In this embodiment, the data source and multiple basic activity components need to be loaded at the first time, and the web context can be loaded in parallel later. The threads of the above parts are synchronized through locking to ensure reliable timing.

[0059] Embodiment 3:

[0060] like Figure 3 As shown, this embodiment provides a method for optimizing the startup duration of middleware. In addition to the technical features of the above embodiment, this embodiment further includes the following technical features:

[0061] The middleware startup time optimization method also includes the following steps:

[0062] Step S302, setting metadata that needs to be loaded in advance;

[0063] Step S304: Load the pre-loaded metadata after the modules class is started and before the http connector is started.

[0064] In this embodiment, according to the actual situation, the metadata that needs to be loaded in advance is set. The metadata that needs to be loaded in advance is loaded after the modules class is loaded and before the http connector is opened to minimize the waiting time for the first user login.

[0065] Embodiment 4:

[0066] like Figure 4 As shown, this embodiment provides a method for optimizing the startup duration of middleware. In addition to the technical features of the above embodiment, this embodiment further includes the following technical features:

[0067] The middleware startup time optimization method also includes the following steps:

[0068] Step S402, setting a delayed start activity component;

[0069] Step S404, for the delayed start active component, start it after the http connector is started and the response is opened.

[0070] In this embodiment, according to the actual situation, active components that can be loaded lazily are set. For example, active components that can be loaded lazily can be search services, early warning and background tasks, time services, cluster messages, etc. For active components that are started lazily, they are started after the http connector is started and the response is opened.

[0071] In this embodiment, for the computing queue scheduled by the cluster, there is no need to delay loading to prevent the waiting user from requesting the IUFO computing service at the first time, because when the middleware is loaded in parallel with multiple threads, an asynchronous thread will not have a great impact.

[0072] Embodiment 5:

[0073] like Figure 5 As shown, this embodiment provides a method for optimizing the startup duration of middleware. In addition to the technical features of the above embodiment, this embodiment further includes the following technical features:

[0074] The middleware startup time optimization method also includes the following steps:

[0075] Step S502, when logging into the software, the set language is used for logging in.

[0076] In the related art, the multilingual framework design is cumbersome, causing most non-multilingual users to bear the unnecessary resource loading of a few multilingual users. In this embodiment, the multilingual processing related to login is streamlined, and the setting language information is directly provided without searching for multilingual resources, which can further reduce the startup time of the middleware.

[0077] The multilingual framework originally set in the general product will require a lot of work if it is to be modified. Based on the needs of most users, this embodiment can directly use the set language for logging in, and optimizes the startup time of the middleware without incurring almost any cost.

[0078] Embodiment 6:

[0079] like Figure 6 As shown, this embodiment provides a method for optimizing the startup duration of middleware. In addition to the technical features of the above embodiment, this embodiment further includes the following technical features:

[0080] The middleware startup time optimization method also includes the following steps:

[0081] Step S602: Multi-threaded parallel loading is adopted for classes under modules to reduce the granularity of locks when the class loader performs class loading.

[0082] In this embodiment, the class loading under modules uses multi-threaded parallelism, which will consume a lot of time and CPU and disk resources. The new parallel and small lock granularity loading method of ClassLoader (Java class loader) of Java7 and later versions can be adopted to further improve the parallel loading efficiency of product components.

[0083] Embodiment 7:

[0084] like Figure 7 As shown, this embodiment provides a method for optimizing the startup duration of middleware. In addition to the technical features of the above embodiment, this embodiment further includes the following technical features:

[0085] The middleware startup time optimization method also includes the following steps:

[0086] Step S702: The tomcat web container uses a multi-threaded parallel loading of the web context through a chain of responsibility model.

[0087] In this embodiment, when the tomcat web container loads each web context through the chain of responsibility mode, multi-threaded parallel loading can be adopted, thereby reducing the startup time of the middleware.

[0088] Embodiment 8:

[0089] like Figure 8 As shown, this embodiment provides a method for optimizing the startup duration of middleware. In addition to the technical features of the above embodiment, this embodiment further includes the following technical features:

[0090] The middleware startup time optimization method also includes the following steps:

[0091] Step S802: After the startup timings of the plurality of startup items are reordered, the encapsulation of the class is adjusted based on multi-threaded startup.

[0092] In this embodiment, after the multi-threaded transformation, the original class encapsulation may need to be adjusted to adapt to the new structure so that the middleware can start smoothly. For example, when the two abstract classes AbstractContainer and AbstractGenericContainer load each module container in parallel through the thread pool, each thread forms a new implementation class object after the multi-threaded transformation. The private components that the public components depend on may not be found in the map of AbstractGenericContainer, which leads to the failure of loading related active components, such as the failure of scheduling background tasks. Therefore, after the startup sequence of multiple startup items is reordered, the class encapsulation is adjusted based on multi-threaded startup, and the map of AbstractGenericContainer is changed to static, thereby solving the above problem.

[0093] Embodiment 9:

[0094] like Fig. 9 As shown, this embodiment provides a method for optimizing the startup duration of middleware. In addition to the technical features of the above embodiment, this embodiment further includes the following technical features:

[0095] The middleware startup time optimization method also includes the following steps:

[0096] Step S902: Adjust the configuration parameters in the Java virtual machine to reduce the startup time of the middleware.

[0097] In this embodiment, JVM (Java virtual machine) tuning configuration can be performed. For example, the parameters can be modified to: -XX:PretenureSizeThreshold=8000000, -Xmn512m, -XX:+UseConcMarkSweepGC. By adding the above parameters, the startup time of the middleware can be further optimized.

[0098] For metadata and some basic archive caches, the above objects do not need to be copied (COPY) multiple times in the young generation and can go directly to the old generation.

[0099] In this embodiment, a CMS (Concurrent Mark Sweep) garbage collector may be used, which is more effective than the default ps+po garbage collector of Java 6 and Java 8, and has a shorter STW time.

[0100] Embodiment 10:

[0101] like Fig.10As shown, this embodiment provides a middleware startup duration optimization device 200, including: a memory 210 and a processor 220, the memory 210 stores a program or instruction, and the processor 220 executes the program or instruction; wherein, when the processor 220 executes the program or instruction, it implements the steps of the middleware startup duration optimization method as in any embodiment of the present invention.

[0102] Embodiment 11:

[0103] This embodiment provides a readable storage medium, which stores a program or instruction. When the program or instruction is executed by a processor, the steps of the middleware startup duration optimization method of any of the above embodiments are implemented. Specific embodiment:

[0105] The following problems exist in the related technologies: (1) The main process started by the NC / NCC middleware is only loaded in a single thread. (2) The scanning time of the ejb directory in the development environment is too long. (3) The serial scanning and class loading of hundreds of modules in the modules directory is slow. (4) The web context resources of a large number of web applications are loaded slowly. (5) The multilingual framework design is cumbersome, making 99% of non-multilingual users bear the unnecessary resource loading of 1% of multilingual users. (6) The loading timing of metadata and basic archives needs to be adjusted.

[0106] In order to solve or improve at least one of the above technical problems, the present embodiment provides a method for optimizing the startup time of the middleware. In view of the problem that the middleware waits for a long time when logging into the NC client for the first time after restarting, a solution of pre-loading the metadata cache and optimizing some multilingual resources is adopted. The present embodiment makes an overall coordinated adjustment to the combined dependency relationship and startup timing between the NC module, WEB container, and EJB container, and greatly improves the startup speed while ensuring the functionality. The present embodiment performs parallel processing on the class loading of the NC module. The present embodiment reduces the granularity of the lock when the class loader ClassLoader is loaded, so that the efficiency of parallel loading of product components is further improved. The present embodiment performs parallel loading on the web context in the tomcat web container. The present embodiment performs delayed loading on active components (such as search services, warnings and background tasks, time services, and cluster messages). The present embodiment makes appropriate adjustments to the JVM parameters.

[0107] Specifically, a method for optimizing the startup time of middleware includes:

[0108] (1) In the related art, the startup sequence of the NC / NCC middleware is to first scan the prop.xml core configuration information of nchome to load the tomcat web container, EJB container and data source, then start scanning and loading the interface classes under the modules in a listener of the tomcat web, and finally continue to load each web context. The above process is single-threaded, so the whole cycle is very long.

[0109] For larger projects, such as those with a large number of modules and a large amount of customer data, or a large number of unfinished tasks in the IUFO computing queue in the cluster scheduler and warnings and background tasks to be executed in the UAP scheduler, the middleware startup will consume a lot of time in the module loading stage.

[0110] Therefore, the overall optimization idea of ​​this embodiment is to dismantle the original timing structure and start each link in parallel as much as possible. For example, the data source and more than 30 basic activity components need to be loaded at the first time, and the web context can be loaded later and in parallel. The threads of each part are synchronized through locking to ensure reliable timing.

[0111] The metadata that needs to be loaded in advance is loaded after the modules class is loaded and before the http connector is opened, so as to minimize the waiting time for the first user to log in. This embodiment simplifies the multilingual processing related to login and directly provides Chinese information without searching for multilingual resources. If general products transform the multilingual framework, the workload is relatively large.

[0112] Active components that can be loaded lazily can be started after the http connector opens the response. As for the computing queues scheduled by the cluster, they can be loaded lazily to prevent waiting users from requesting IUFO computing services at the first opportunity, because when the middleware is loaded in parallel with multiple threads, an asynchronous thread will not have much impact.

[0113] (2) Class loading under modules should be done in parallel using multiple threads, as this will consume a lot of time and CPU and disk resources. In addition, the new parallel loading method with small lock granularity of ClassLoader of Java 7 and later versions should be used as much as possible. For NC63 middleware, two versions, Java 6 and Java 7, are provided. Because Java 6 does not support small lock granularity, when multiple threads load classes in parallel, lock contention is more serious and the effect is relatively poor.

[0114] Changing the custom class loader to parallel mode can bring more benefits, such as making object serialization and deserialization faster so that garbage collection will not be blocked.

[0115] like Fig.11 and Fig.12 As shown in the figure, this is the stack captured when the NCC2005 project crashed during report query. It can be seen that object serialization triggers class loading, and the class loader (ending with B338) holds a large-grained classloader object lock, causing all related WEB threads to be blocked by this lock. As a result, objects held by a large number of threads cannot be recycled, resulting in memory overflow (OOM, Out Of Memory).

[0116] (3) Tomcat web container can also load multiple web contexts in parallel through the chain of responsibility model. However, due to the lower version of Tomcat in NC63, there may be problems in parallel. There is no problem with Tomcat in NC65. Therefore, the NC63 version for Java6 still uses the NC63 Tomcat, and the NC63 version for Java7 uses the NC65 Tomcat. You need to pay attention to changing the Tomcat version.

[0117] (4) After the multi-threaded transformation, the original class encapsulation may need to be adjusted to adapt to the new structure. For example, the two abstract classes, AbstractContainer and AbstractGenericContainer, will bring new problems when loading each module container in parallel through the thread pool. After the multi-threaded transformation, each thread will form a new implementation class object. The private components that the public components depend on may not be found in the map of AbstractGenericContainer, which will lead to the failure of loading related active components. For example, the scheduling of background tasks fails. To address the above problem, changing the map of AbstractGenericContainer to static can solve it.

[0118] There are also other problems caused by the transformation. These problems may need to be re-adjusted in the new environment. Some problems may trigger bugs in the product, although the bugs have been adjusted in the original product. For example, in the shared development environment of NC65, web page initialization will cause problems in servlet (short for Java Servlet); and for example, the loading of NC63 entity metadata (VOMeta) cannot be earlier than the loading of the class, otherwise the statistical information in VOMeta will not be loaded, which will cause a null pointer exception in the metadata attribute processing, so the class should be loaded as soon as possible, such as Fig.13 shown.

[0119] (5)Configure the JVM, for example, -XX:PretenureSizeThreshold=8000000-Xmn512m-XX:NewSize=512m-XX:+UseConcMarkSweepGC. Adding the above parameters can improve performance by a few seconds. Metadata and some basic archive caches, these objects do not need to be copied multiple times in the young generation, and can be directly put into the old generation. The CMS garbage collector will be better than the default ps+po garbage collector of java6-java8, and the STW time of the CMS garbage collector is shorter.

[0120] In this embodiment, after the original time sequence structure is disassembled, the time sequence after reordering may be:

[0121] (1) Read the core configuration information of prop.xml and load the data source, tomcat web container, and EJB container in parallel.

[0122] (2) Read the nc.bs.framework.server.server.xml basic service component configuration and load the services therein.

[0123] (3) Scan the configuration files and load class files in each folder of the product module in parallel.

[0124] (4) Parallel loading of listeners and servlets in web applications.

[0125] (5) Load metadata service.

[0126] (6) Open the listening port of the http protocol connector, indicating that the application service has been started.

[0127] (7) Delayed loading of active components such as background tasks, early warning services, and report calculation services.

[0128] This embodiment reduces the startup time of the middleware to 1 / 8 to 1 / 10 of the previous time by disassembling and reorganizing the components of the middleware, optimizing the process, and performing parallel processing, thereby greatly improving the daily work efficiency of a large number of NC engineers.

[0129] After the middleware in this embodiment is restarted, the first login time is shortened from nearly two minutes to about 10 seconds.

[0130] In the present invention, the terms "first", "second", and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance; the term "plurality" refers to two or more, unless otherwise clearly defined. The terms "installed", "connected", "connected", "fixed", etc. should be understood in a broad sense. For example, "connected" can be a fixed connection, a detachable connection, or an integral connection; "connected" can be a direct connection or an indirect connection through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0131] In the description of the present invention, it is necessary to understand that the directions or positional relationships indicated by terms such as “upper”, “lower”, “left”, “right”, “front” and “back” are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or unit referred to must have a specific direction, be constructed and operated in a specific orientation, and therefore, cannot be understood as a limitation on the present invention.

[0132] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0133] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for optimizing the startup time of middleware, characterized in that: include: Obtaining the startup sequence of multiple startup items and the dependency relationship of the multiple startup items when the middleware is started; According to the dependencies of the multiple startup items, the startup timings of the multiple startup items are reordered, the startup items with dependencies are started according to the dependencies, the startup items without dependencies are started in parallel, and multi-thread synchronization is achieved through locking when each startup item is started; After the startup timings of the multiple startup items are reordered, the encapsulation of the class is adjusted based on multi-threaded startup.

2. The method for optimizing the middleware startup duration according to claim 1, characterized in that: Also includes: After starting the data source and multiple basic activity components, start the web application service in parallel.

3. The method for optimizing the middleware startup duration according to claim 1, characterized in that: Also includes: Set the metadata that needs to be loaded in advance; The metadata loaded in advance is loaded before each module class of the product is started and before the http protocol connector is started.

4. The method for optimizing the middleware startup duration according to claim 1, characterized in that: Also includes: Set delayed start of active components; The delayed-start active component is started after the http protocol connector is started and the response is opened.

5. The method for optimizing the middleware startup duration according to claim 1, characterized in that: Also includes: When logging into the software, use the set language to log in.

6. The method for optimizing the middleware startup duration according to claim 1, characterized in that: Also includes: Multi-threaded parallel loading is used for classes under each module of the product to reduce the lock granularity when the class loader loads the class.

7. The method for optimizing the middleware startup duration according to claim 1, characterized in that: Also includes: The tomcat web container uses multi-threaded parallel loading of web application services through the chain of responsibility model.

8. The method for optimizing the middleware startup duration according to any one of claims 1 to 7, characterized in that: Also includes: The configuration parameters in the Java virtual machine are adjusted to reduce the startup time of the middleware.

9. A middleware startup duration optimization device (200), characterized in that: include: A memory (210) storing programs or instructions; A processor (220) for executing the program or instruction; Wherein, when executing the program or instruction, the processor (220) implements the steps of the middleware startup duration optimization method as described in any one of claims 1 to 8.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the middleware startup duration optimization method according to any one of claims 1 to 8 are implemented.