Application loading method and device, equipment, medium and product

By recording and storing application request data and performing hot loading based on the loading database, the problem of unstable and efficient hot loading of application instances is solved, the loading accuracy and efficiency are improved, and manual operation costs are reduced.

CN118779028APending Publication Date: 2024-10-15CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411123207.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

In the existing technology, hot loading of application instances is not stable and efficient enough, resulting in excessive CPU load and affecting response time. Manual hot loading requires manual operations, is costly, and increases the burden of the application change process.

Method used

By recording the application's request data in the production environment and storing it in the loading database, and when it is detected that the application status is starting, data collection is performed based on the loading database to obtain simulated request data, and the application is hot loaded and modified if successful. The application status is startup completed and application services are provided.

Benefits of technology

It improves the accuracy and efficiency of application loading, solves the problem of instability and efficiency of hot loading, reduces manual operation costs, and simplifies the application change process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779028A_ABST
    Figure CN118779028A_ABST
Patent Text Reader

Abstract

The invention discloses an application loading method and device, equipment, a medium and a product, and relates to the technical field of hot loading.The method comprises the steps that request data of an application in a production environment is recorded, and the request data is stored in a loading database; when it is detected that the application state of the application is in the starting state, data collection is conducted on the basis of the loading database, simulation request data are obtained, hot loading is conducted on the application through the simulation request data, and a loading result is obtained; and if the loading result is that the loading is successful, modifying the application state of the application to start completion, and providing a corresponding application service. Therefore, the problem that hot loading of the application instance is not stable and efficient enough in the prior art is solved, and the accuracy of application loading is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of thermal loading technology, and in particular to an application loading method, device, equipment, medium and product. Background Art

[0002] In the prior art, the response time is slow within 1 minute after the application instance is put into production or restarted, resulting in upstream system call timeout. During the application startup, the C2 compiler thread (C2 Compiler Thread) is in interpreted execution mode because all codes are in interpreted execution mode when the JVM is started. When certain codes are executed to a certain threshold number of times, the hot code will be compiled into machine code by the C2 Compiler, and the execution efficiency will be greatly improved, occupying a large amount of CPU resources. However, compiling hot code requires frequent use of CPU resources, resulting in excessive CPU load, which in turn affects the response time of the application.

[0003] In the existing technology, the above problem is solved by increasing the number of compiler threads, using automated testing tools to simulate real requests after the instance is started, and hot loading the interface. However, these methods still have some defects. For example, increasing the number of threads will also increase the CPU load, and it is impossible to increase the compilation speed while ensuring CPU stability.

[0004] In addition, the existing manual hot loading requires manual isolation of the real business traffic of the instance and manual triggering of the automated verification tool to simulate the request initiation. At the same time, the instance IP is unstable after the application is changed, and the correct instance IP needs to be identified. The manual operation cost is high, which increases the burden of the application change process.

[0005] Therefore, further research is needed on how to achieve automatic hot loading after application instance changes more efficiently and stably.

[0006] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0007] The main purpose of the present application is to provide an application loading method, device, equipment, medium and product, aiming to solve the technical problems of insufficient stability and efficiency during hot loading of application instances in the prior art.

[0008] To achieve the above objectives, the present application proposes an application loading method, which includes:

[0009] Record the request data of the application in the production environment, and store the request data in the loading database;

[0010] When it is detected that the application state of the application is starting, data collection is performed based on the loading database to obtain simulation request data, and hot loading is performed on the application through the simulation request data to obtain a loading result;

[0011] If the loading result is that the loading is successful, the application state of the application is modified to startup completed, and the corresponding application service is provided.

[0012] In one embodiment, the step of storing the request data in a loading database comprises:

[0013] Selecting a downsampling strategy corresponding to the requested data according to a preset loading requirement and the data volume of the requested data;

[0014] After downsampling the request data based on the downsampling strategy, the request data is stored in the loading database.

[0015] In one embodiment, after the step of downsampling the request data based on the downsampling strategy and storing the downsampling data in the loading database, the method further includes:

[0016] Regularly cleaning up the loading database based on a preset cleaning strategy;

[0017] The request data in the loaded database is preserved through a data pipeline tool.

[0018] In one embodiment, after the step of downsampling the request data based on the downsampling strategy and storing the downsampling data in the loading database, the method further includes:

[0019] Analyzing the loaded database to obtain service information of the application;

[0020] Performing a hot loading simulation based on the service information to obtain the system load and service complexity;

[0021] A threshold is set based on the system load and service complexity to obtain a timeout threshold, and the timeout threshold is used to detect whether the hot loading of the application is successful.

[0022] In one embodiment, when it is detected that the application state of the application is starting, data collection is performed based on the loading database to obtain simulation request data, and the application is hot loaded through the simulation request data to obtain the loading result, and the step includes:

[0023] Based on the application life cycle event ApplicationStartedEvent, real-time status detection is performed on the application;

[0024] When it is detected that the application state of the application is starting, data is collected from the loading database through the service hot loading extension point to obtain simulated request data;

[0025] Hot-load the application based on the simulated request data, and perform real-time status detection on the application through the ApplicationStartedEvent;

[0026] If it is detected within the timeout threshold that the application state of the application is running, the output loading result is that the startup is successful.

[0027] In one embodiment, the step of collecting data from the loading database through the service hot loading extension point to obtain simulated request data includes:

[0028] Analyze the service characteristics and interface information of the application to obtain a loading configuration of the application, where the loading configuration includes one or more of a lightweight configuration and a refined configuration;

[0029] Based on the loading configuration, data is collected from the loading database through the service hot loading extension point to obtain simulated request data.

[0030] In addition, to achieve the above-mentioned purpose, the present application also proposes an application loading device, the application loading device comprising:

[0031] A storage module, used to record request data of an application in a production environment and store the request data in a loading database;

[0032] A loading module, configured to collect data based on the loading database to obtain simulation request data when detecting that the application state of the application is starting, and hot load the application through the simulation request data to obtain a loading result;

[0033] The service module is used to modify the application status of the application to startup completion if the loading result is successful, and provide corresponding application services.

[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes an application loading device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the application loading method described above.

[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the application loading method described above are implemented.

[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the application loading method described above are implemented.

[0037] One or more technical solutions proposed in this application have at least the following technical effects:

[0038] The embodiment of the present application proposes an application loading method, device, equipment, storage medium and computer program product, which records the request data of the application in the production environment and stores the request data in the loading database; when it is detected that the application state of the application is starting, data collection is performed based on the loading database to obtain simulated request data, and the application is hot loaded with the simulated request data to obtain the loading result; if the loading result is that the loading is successful, the application state of the application is modified to startup completed, and the corresponding application service is provided. Thus, the request data of the application when it is running is recorded, and the request data is stored in the loading database, and then when it is detected that the application state of the application is starting, the application is hot loaded based on the loading database to obtain the loading result, and finally, when the loading is successful, the corresponding application service is provided. The problem of insufficient stability and efficiency when hot loading application instances in the prior art is solved, and the accuracy of application loading is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0041] Figure 1 A flowchart of the first embodiment of the method for loading an application of the present invention is provided;

[0042] Figure 2 A schematic diagram of data collection and storage for an application involving the application loading method of this application;

[0043] Figure 3 A flowchart of the second embodiment of the method for loading an application of the present invention is provided;

[0044] Figure 4 A schematic diagram of hot loading of an application involving the application loading method of the present application;

[0045] Figure 5 A brief flowchart of the application loading method provided in Example 2 of the present application;

[0046] Figure 6 This is a schematic diagram of the module structure of the loading device used in the embodiment of the present application;

[0047] Figure 7 A schematic diagram of the device structure of the hardware operating environment involved in the application loading method in the embodiment of the present application.

[0048] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0050] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0051] The main solution of the embodiment of the present application is: according to the preset loading requirements and the data volume of the request data, select the downsampling strategy corresponding to the request data; after downsampling the request data based on the downsampling strategy, store it in the loading database. The loading database is cleaned regularly based on the preset cleaning strategy; the request data in the loading database is preserved through the data pipeline tool. The service information of the application is obtained by analyzing the loading database; the system load and service complexity are obtained by performing hot loading simulation based on the service information; the timeout threshold is set based on the system load and service complexity to obtain the timeout threshold, and the timeout threshold is used to detect whether the hot loading of the application is successful. Based on the application life cycle event ApplicationStartedEvent, the application is detected in real time; when the application status of the application is detected to be in startup, the loading database is collected through the service hot loading extension point to obtain simulated request data; the application is hot loaded based on the simulated request data, and the application is detected in real time through the ApplicationStartedEvent; if the application status of the application is detected to be running within the timeout threshold, the output loading result is a successful startup. The service characteristics and interface information of the application are analyzed to obtain the loading configuration of the application, and the loading configuration includes one or more of lightweight configuration and refined configuration; based on the loading configuration, data is collected from the loading database through the service hot loading extension point to obtain simulated request data. Thus, the problem of insufficient stability and efficiency when the application instance is hot loaded in the prior art is solved, the loading of the application is realized, and the efficiency of application loading is improved. Based on the scheme of the present invention, from the fact that manual hot loading requires manual isolation of the real business traffic of the instance, and artificial triggering of the automated verification tool to simulate the request initiation, and the instance IP after the drifting application is changed is unstable, and the correct instance IP needs to be identified, the manual operation cost is high, and the burden of the application change process is increased, thereby the problem of low efficiency, an application loading method is designed, and the effectiveness of the application loading method of the present invention is verified when the application is loaded. Finally, the efficiency of application loading by the method of the present invention is significantly improved.

[0052] In this embodiment, for ease of description, the following description is made with the application loading device as the execution subject.

[0053] Due to the slow response time within 1 minute after the application instance is put into production or restarted in the prior art, the upstream system call times out. During the application startup, the C2 compiler thread (C2 Compiler Thread) occupies a large amount of CPU resources because all codes are in interpreted execution mode when the JVM is started. When certain codes are executed to a certain threshold number of times, the hot code will be compiled into machine code by the C2 Compiler, and the execution efficiency will be greatly improved. However, compiling hot code requires frequent CPU resource occupation, resulting in excessive CPU load, which in turn affects the response time of the application. Although there are some methods to achieve this, such as increasing the number of compiler threads, using automated testing tools to simulate real requests after the instance is started, and hot loading the interface, these methods still have some defects, such as: increasing the number of threads will also increase the CPU load, and the compilation speed cannot be increased while ensuring CPU stability, and the efficiency will also decrease.

[0054] The present application provides a solution, which records the request data when the application is running, and stores the request data in a loading database. Then, when it is detected that the application status of the application is starting, the application is hot loaded based on the loading database to obtain the loading result. Finally, if the loading is successful, the corresponding application service is provided to provide users with better service.

[0055] It can be seen from the above embodiments that the present application records the request data of the application in the production environment and stores the request data in the loading database; when it is detected that the application state of the application is starting, data collection is performed based on the loading database to obtain simulated request data, and the application is hot-loaded through the simulated request data to obtain a loading result; if the loading result is a successful loading, the application state of the application is modified to startup completed, and the corresponding application service is provided. Thus, the request data of the application when it is running is recorded, and the request data is stored in the loading database, and then when it is detected that the application state of the application is starting, the application is hot-loaded based on the loading database to obtain a loading result, and finally, when the loading is successful, the corresponding application service is provided. The problem of insufficient stability and efficiency when hot-loading application instances in the prior art is solved, and the accuracy of application loading is improved.

[0056] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, an intention device device, etc. that can realize the above functions. The following takes the application loading device as an example to illustrate this embodiment and the following embodiments.

[0057] Based on this, the present application embodiment provides an application loading method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the application loading method of the present application.

[0058] In this embodiment, the application loading method includes steps S01 to S03:

[0059] Step S01, recording request data of an application in a production environment, and storing the request data in a loading database;

[0060] Before the present embodiment is described, it should be clear that in the prior art, the application instance usually responds slowly within 1 minute after being put into production or restarted, which will cause the upstream system call to time out. During the application startup, the C2 compiler thread is in the interpreted execution mode when the JVM is started. When some codes are executed to a certain threshold number of times, the hot code will be compiled into machine code by the C2Compiler, and the execution efficiency will be greatly improved, which will occupy a large amount of CPU resources. However, compiling hot code requires frequent CPU resource occupation, resulting in excessive CPU load, which in turn affects the response time of the application.

[0061] At present, the solution to the above problem is usually to increase the number of compiler threads. After the instance is started, an automated testing tool is used to simulate real requests and hot load the interface. However, the above method has the problem that the increase in the number of threads will increase the CPU load and cannot improve the compilation speed while ensuring the stability of the CPU. Therefore, it is necessary to further study how to achieve automatic hot loading after the application instance is changed more efficiently and stably;

[0062] In this embodiment, the request data of the application is first recorded and stored in the loading database. It should be clear that the application in this embodiment refers to an actual business application, such as a credit card application for business processing, a communication application for chatting, and a camera software for video recording, etc., and the corresponding request data is determined based on the specific application instances of the above applications. When some applications develop new application instances, the first loading will be slow, so the request data received by the application is preferentially stored in the loading database to facilitate subsequent hot loading of the application.

[0063] Step S02, when it is detected that the application state of the application is starting, data collection is performed based on the loading database to obtain simulation request data, and hot loading is performed on the application through the simulation request data to obtain a loading result;

[0064] The request data of the application is recorded in real time. In actual use, the request data of the application is recorded in real time, so that the specific request data can be recorded even after the application is updated. After the request data is recorded, the application status of the application will be detected. When it is detected that the application status is starting, the application needs to be hot loaded to increase the startup speed of the application and provide users with better services. In this embodiment, the application is hot loaded by loading the simulated request data in the database to obtain the loading result, wherein the simulated request data in the database is determined based on the actual traffic data. For example, when the user sees the corresponding information prompt on the notification box, he may click it. At this time, since there is a corresponding data record before, the data corresponding to such information can be used as simulated request data to hot load the application to obtain the loading result.

[0065] Step S03: If the loading result is successful, the application state of the application is modified to startup completed, and the corresponding application service is provided.

[0066] After confirming that the loading result is successful, the application status of the application can be changed to startup completed, registered with the service center, connected to real business traffic, and provide query services. The query service provides users with corresponding application services based on the actual application instance of the application.

[0067] Specifically, the above step S01, the step of recording the request data of the application in the production environment and storing the request data in the loading database includes:

[0068] Step S011, selecting a downsampling strategy corresponding to the requested data according to a preset loading requirement and the data volume of the requested data;

[0069] Step S012: downsampling the request data based on the downsampling strategy and storing the downsampling data in the loading database.

[0070] In this embodiment, a specific recording scheme of the request data is also included. In order to make the application loading efficiency higher, this embodiment is as follows. Figure 2 As shown, the request data of the application in the actual production environment is recorded. After the application is updated and a new application instance is added, the received request data will be recorded synchronously;

[0071] Then, based on the preset loading requirements and the data volume of the requested data, a corresponding downsampling strategy is selected, wherein the specific downsampling strategy is to select a suitable downsampling strategy according to the data volume and storage requirements. In this embodiment, the downsampling strategy may be selected by time window, by request volume, or by other methods based on business requirements;

[0072] After selecting the downsampling strategy, the request data can be downsampled based on the downsampling strategy. After the downsampling is completed, the downsampled request data is stored in the loading database. Downsampling is a process of reducing the data sampling rate. This process is usually used to reduce the amount of data, reduce processing complexity, or meet specific data processing requirements.

[0073] The specific steps of downsampling the logs and storing them in the database may include:

[0074] (1) Data collection: First, we need to obtain the request data corresponding to the application from the actual business scenario;

[0075] (2) Downsampling processing:

[0076] 2.1 Determine the sampling rate: Determine the reduced sampling rate based on the requirements. For example, downsampling can be performed based on time windows (e.g., hourly, daily), event frequency (e.g., retain one event for every 100 events), and other appropriate strategies.

[0077] 2.2 Implement downsampling: Apply the selected downsampling strategy to the request data and retain or discard the corresponding request data entries;

[0078] (3) Data storage:

[0079] 3.1 Select a database: Choose a suitable database according to project requirements. Common choices include relational databases (such as MySQL, PostgreSQL), document databases (such as MongoDB), and time series databases (such as InfluxDB).

[0080] 3.2 Design database schema: Design a database table structure suitable for storing downsampled log data, which usually includes fields such as date and time stamp, downsampled request data content, event type, and other identifiers;

[0081] 3.3 Storing data: inserting the downsampled log data into the database table.

[0082] More specifically, after the step S013 of downsampling the request data based on the downsampling strategy and storing the downsampling data in the loading database, the method further includes:

[0083] Step S013, regularly cleaning up the loading database based on a preset cleaning strategy;

[0084] Step S014: preserve the request data in the loaded database through a data pipeline tool.

[0085] It should be clear that in actual application scenarios, in order to improve the efficiency of application loading, the data in the loaded database needs to be cleaned and preserved regularly;

[0086] The cleaning strategy in this embodiment is pre-set and can be set according to actual business needs to meet the user's needs for application hot loading. For example, the current application is a chat software, so its data update is frequent. In this case, a 12-hour cleaning strategy should be adopted;

[0087] The data pipeline tool in this embodiment plays a key role in data management, helping to ensure the freshness, accuracy, and consistency of data. The functions of the data pipeline tool are:

[0088] (1) Data flow and synchronization: Data pipeline tools can effectively manage data flow, ensure timely transmission and synchronization of data from source to destination, and prevent data delay or loss;

[0089] (2) ETL (extraction, transformation, loading) process: Data pipeline tools usually support the extraction, cleansing, transformation, and loading (ETL) process of data. These steps help improve the quality and consistency of data, making it suitable for analysis, reporting, or business applications;

[0090] (3) Automated task scheduling: Data pipeline tools usually support scheduled task scheduling and automated processes, such as using Cron or built-in scheduling functions to ensure that data updates and processing tasks are automatically executed as planned;

[0091] (4) Monitoring and alarming: Some advanced data pipeline tools provide monitoring and alarming functions, which can promptly detect problems or anomalies in data processing and ensure the stability and reliability of data flow;

[0092] (5) Scalability and flexibility: Data pipeline tools are usually designed to be scalable and flexibly configurable, and can adapt to data processing tasks of different scales and requirements, ensuring that they can still operate efficiently when the amount of data increases or business needs change;

[0093] For data preservation in actual business scenarios, such as cleaning up expired log data once a day, week, or month, you can also determine the data retention period based on business needs and regulatory requirements, and clean up old log data in the database accordingly. During the cleaning process, use automated cleaning procedures and write automated programs or scripts to perform regular cleaning operations. This can be achieved through scheduling tools such as cron to ensure the automation and reliability of the cleaning process. In addition, backup and archiving are also an important part of the preservation process. Before cleaning, ensure that there are necessary backup and archiving strategies. As needed, archive some historical log data to long-term storage for possible future audit or analysis needs.

[0094] In addition to preserving the data, this embodiment also needs to set a corresponding timeout threshold to determine whether the hot loading of the application is normal. Therefore, after the above step S013, after downsampling the request data based on the downsampling strategy and storing it in the loading database, the method further includes:

[0095] Step S015, analyzing the loaded database to obtain service information of the application;

[0096] Step S016, performing a heat loading simulation based on the service information to obtain the system load and service complexity;

[0097] Step S017: setting a threshold based on the system load and service complexity to obtain a timeout threshold, wherein the timeout threshold is used to detect whether the hot loading of the application is successful.

[0098] Hot loading is to improve the response speed of the application, but the loading time also needs to be controlled accordingly. This embodiment simulates different preheating time scenarios (10S, 20S, 40S, 50S) in the performance test environment, observes and compares the interface response time, timeout traffic ratio and CPU usage rate of the service in the initial service startup in different scenarios, and finally concludes that when the application preheating time reaches 20S, the hot code of the service has been fully executed, and the interface response time and timeout traffic ratio are 0, indicating that the problem of interface timeout in the initial service startup is effectively avoided (a preheating time greater than 20S can also solve the interface timeout problem, but because the preheating time affects the service startup time, the shortest time is the best). However, different timeout thresholds may be required in different scenarios. Therefore, this embodiment reserves the possibility of dynamically adjusting the timeout time, which can be adapted according to the service complexity and system load;

[0099] The service information in this embodiment is the specific application service that the application can provide, which includes the system load and service complexity of providing this application service. By analyzing it, the specific timeout threshold can be obtained. It can be understood that in the above test, once the 20-second hot loading phase is completed, the service status will be automatically updated to startup completion, and the service registration will be performed to receive and process real business request traffic. When faced with changes in loading times or time, the system has the ability to flexibly adjust strategies and can dynamically adapt to these changes to maintain service stability and efficiency.

[0100] This embodiment adopts the above scheme, specifically by recording the request data of the application in the production environment, and storing the request data in the loading database; when it is detected that the application status of the application is starting, data collection is performed based on the loading database to obtain simulated request data, and the application is hot-loaded by the simulated request data to obtain the loading result; if the loading result is that the loading is successful, the application status of the application is modified to startup completed, and the corresponding application service is provided. Thus, the request data of the application when it is running is recorded, and the request data is stored in the loading database, and then when it is detected that the application status of the application is starting, the application is hot-loaded based on the loading database to obtain the loading result, and finally, when the loading is successful, the corresponding application service is provided. The problem of insufficient stability and efficiency when hot-loading application instances in the prior art is solved, and the accuracy of application loading is improved.

[0101] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 In step S02, when it is detected that the application state of the application is starting, data collection is performed based on the loading database to obtain simulation request data, and the application is hot loaded through the simulation request data to obtain the loading result. The application loading method further includes steps S021 to S024:

[0102] Step S021, based on the application life cycle event ApplicationStartedEvent, perform real-time status detection on the application;

[0103] Step S022, when it is detected that the application state of the application is starting, data collection is performed on the loading database through the service hot loading extension point to obtain simulation request data;

[0104] Step S023, hot loading the application based on the simulated request data, and performing real-time status detection on the application through the ApplicationStartedEvent;

[0105] Step S024: if it is detected within the timeout threshold that the application state of the application is running, then the loading result is output as startup success.

[0106] After the request data is stored in the loading database, the application can be hot loaded. In this embodiment, the application generates a periodic event ApplicationStartedEvent to perform real-time status detection on the application to obtain the current running status of the application. The ApplicationStartedEvent in this embodiment is an event class in the Spring Framework, which indicates an event that the application has been started. Specifically, it is a subclass of ApplicationEvent, which is used to notify the listener to execute specific logic or operations after the application is started. In the Spring application, when the application is started, the Spring container will publish a series of application events, including ApplicationStartedEvent. This event is usually used to perform initialization work that needs to be performed after the application is fully started, such as initialization of database connections, loading of caches, starting of scheduled tasks, etc. To listen to and respond to ApplicationStartedEvent events in Spring applications, you can implement ApplicationListener <applicationstartedevent>Interface or use @EventListener annotation to mark the corresponding method;

[0107] When it is detected that the application status of the application is starting, data is collected from the loading database through the service hot loading extension point to obtain simulated request data for hot loading, where the simulated request data simulates the traffic data when the application is actually used;

[0108] Then, the application is hot loaded based on the simulated request data, and the ApplicationStartedEvent is used to detect the application status in real time. If the application status of the application is detected to be running within the above timeout threshold, the output loading result is successful startup.

[0109] The specific heat loading in this embodiment is as follows Figure 4 As shown, the normally detected application status includes normal service status and starting application status. When the application status is starting, the loading database is queried to obtain simulated request data (simulated request traffic) for hot loading, and then hot loading is performed. The application status is synchronously detected during loading. If the application status is normal service status, the output loading result is successful startup.

[0110] In this embodiment, the service hot loading extension point is generally used in software systems, especially those systems that need to dynamically load and unload plug-ins or extensions. These extension points allow the system to add, update or remove functional modules at runtime (that is, without stopping the entire application), thereby achieving system flexibility and scalability. This extension point allows business applications to perform customized hot loading processing based on their own specific service characteristics and interface information. After different business applications introduce this extension point, they support configuration or secondary development to adapt to the hot loading requirements of the service itself. When the service release reaches the startup state, hot loading is automatically triggered.

[0111] Specifically, the above step S022, collecting data from the loading database through the service hot loading extension point to obtain the simulated request data, includes:

[0112] Step S0221, analyzing the service characteristics and interface information of the application to obtain a loading configuration of the application, wherein the loading configuration includes one or more of a lightweight configuration and a refined configuration;

[0113] Step S0222: Based on the loading configuration, data is collected from the loading database through the service hot loading extension point to obtain simulated request data.

[0114] The simulated request data in this embodiment supports collection based on actual application requirements. The specific hot loading request data source supports highly flexible configuration, including multiple storage methods such as configuration text, database, and Elasticsearch (ES). For different business scenarios, this embodiment provides a flexible data source configuration strategy. For those applications with low hot loading requirements and simple business, we provide lightweight configuration to allow fast loading. For complex business environments with high concurrency and a large number of interfaces, we focus on refined collection and prioritize loading hot data with the largest number of requests. This strategy can effectively optimize startup performance, especially when a large number of hot requests need to be processed. The selection of the data source is completely customized by the application itself, ensuring that the SDK has wide applicability and functional versatility. In this way, the efficiency of data input is ensured to adapt to hot loading scenarios of various business needs.

[0115] In addition, this embodiment uses multi-threading technology to perform traffic playback on the service instance to accelerate service startup. In this process, an intelligent filtering mechanism is specially designed. For example, by filtering data with method GET, non-query requests such as management operations or status updates are distinguished and excluded, so as to avoid some maintenance requests during the hot loading process from affecting the actual business data, so as to ensure that the core query function of the service is not interfered with, thereby achieving non-invasive hot loading. This non-invasiveness is reflected in that only query operations directly related to the core business logic of the service are reproduced, without involving other behaviors that may change the service status.

[0116] This embodiment uses the above scheme, specifically based on the application life cycle event ApplicationStartedEvent, to perform real-time status detection on the application; when it is detected that the application status of the application is starting, the loading database is collected through the service hot loading extension point to obtain simulated request data; the application is hot loaded based on the simulated request data, and the real-time status of the application is detected through the ApplicationStartedEvent; if the application status of the application is detected to be running within the timeout threshold, the output loading result is a successful startup. Thus, the request data when the application is running is recorded, and the request data is stored in the loading database, and then when it is detected that the application status of the application is starting, the application is hot loaded based on the loading database to obtain the loading result, and finally, when the loading is successful, the corresponding application service is provided. The problem of insufficient stability and efficiency when hot loading application instances in the prior art is solved, and the accuracy of application loading is improved.

[0117] For example, to help understand the implementation process of the application loading method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 5 , Figure 5 A brief flowchart of an application loading method is provided, specifically:

[0118] The present embodiment adopts an automatic preheating flow chart based on the credit card customer information query service CICQ scenario, and the specific process is as follows:

[0119] In actual business scenarios, business request data is received and specific business processing is performed. At this time, business traffic logs are collected and sent to the database for storage through Kafka. At the same time, the data in the database is cleaned up regularly through the management program.

[0120] Subsequently, when the application releases a new function (application instance) or restarts the application, it is detected in real time that the current state of the application is starting. At this time, the simulated request data in the database is collected for hot loading. After the hot loading is completed, specific business processing can be performed through the application.

[0121] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the loading method applied in the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0122] This application also provides an application loading device, please refer to Figure 6 , the application loading device comprises:

[0123] The storage module 10 is used to record the request data of the application in the production environment and store the request data in the loading database;

[0124] The loading module 20 is used to collect data based on the loading database to obtain simulation request data when detecting that the application state of the application is starting, and hot load the application through the simulation request data to obtain a loading result;

[0125] The service module 30 is used to modify the application status of the application to startup completion if the loading result is successful, and provide corresponding application services.

[0126] The application loading device provided by the present application adopts the application loading method in the above embodiment, which can solve the technical problem of instability and inefficiency in hot loading of application instances in the prior art. Compared with the prior art, the beneficial effects of the application loading device provided by the present application are the same as those of the application loading method provided by the above embodiment, and other technical features in the application loading device are the same as those disclosed in the above embodiment method, which will not be described in detail here.

[0127] The present application provides an application loading device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the application loading method in the above-mentioned embodiment 1.

[0128] Reference below Figure 7 , which shows a schematic diagram of the structure of an application loading device suitable for implementing the embodiment of the present application. The application loading device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The application loading device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0129] like Figure 7 As shown, the application loading device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the application loading device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the application loading device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an application loading device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0130] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0131] The application loading device provided by the present application adopts the application loading method in the above embodiment, which can solve the technical problem of instability and inefficiency in hot loading of application instances in the prior art. Compared with the prior art, the beneficial effects of the application loading device provided by the present application are the same as the beneficial effects of the application loading method provided by the above embodiment, and the other technical features in the application loading device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0132] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0133] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0134] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the application loading method in the above-mentioned embodiment.

[0135] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0136] The computer-readable storage medium may be included in the application loading device; or may exist independently without being assembled into the application loading device.

[0137] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the application loading device, the application loading device: records the request data of the application in the production environment, and stores the request data in the loading database; when it is detected that the application status of the application is starting, data collection is performed based on the loading database to obtain simulated request data, and the application is hot loaded through the simulated request data to obtain a loading result; if the loading result is a successful loading, the application status of the application is modified to startup completed, and the corresponding application service is provided.

[0138] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0139] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0140] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0141] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned application loading method, and can solve the technical problems of the prior art that the application instance is not stable and efficient during hot loading. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the application loading method provided by the above-mentioned embodiment, and will not be repeated here.

[0142] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned application loading method when executed by a processor.

[0143] The computer program product provided by this application can solve the technical problem of instability and inefficiency in hot loading of application instances in the prior art. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as those of the application loading method provided by the above embodiment, which will not be elaborated here.

[0144] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.< / applicationstartedevent>

Claims

1. An application loading method, characterized in that: The method comprises: Record the request data of the application in the production environment, and store the request data in the loading database; When it is detected that the application state of the application is starting, data collection is performed based on the loading database to obtain simulation request data, and hot loading is performed on the application through the simulation request data to obtain a loading result; If the loading result is that the loading is successful, the application state of the application is modified to startup completed, and the corresponding application service is provided.

2. The method according to claim 1, characterized in that The step of storing the request data in a loading database comprises: Selecting a downsampling strategy corresponding to the requested data according to a preset loading requirement and the data volume of the requested data; After downsampling the request data based on the downsampling strategy, the request data is stored in the loading database.

3. The method according to claim 2, characterized in that After the step of downsampling the request data based on the downsampling strategy and storing the downsampling data in the loading database, the method further includes: Regularly cleaning up the loading database based on a preset cleaning strategy; The request data in the loaded database is preserved through a data pipeline tool.

4. The method according to claim 2, characterized in that After the step of downsampling the request data based on the downsampling strategy and storing the downsampling data in the loading database, the method further includes: Analyzing the loaded database to obtain service information of the application; Performing a hot loading simulation based on the service information to obtain the system load and service complexity; A threshold is set based on the system load and service complexity to obtain a timeout threshold, and the timeout threshold is used to detect whether the hot loading of the application is successful.

5. The method according to claim 4, characterized in that The step of collecting data based on the loading database to obtain simulated request data when detecting that the application state of the application is starting, and hot loading the application through the simulated request data to obtain the loading result comprises: Based on the application life cycle event ApplicationStartedEvent, real-time status detection is performed on the application; When it is detected that the application state of the application is starting, data is collected from the loading database through the service hot loading extension point to obtain simulated request data; Hot-load the application based on the simulated request data, and perform real-time status detection on the application through the ApplicationStartedEvent; If it is detected within the timeout threshold that the application state of the application is running, the output loading result is that the startup is successful.

6. The method according to claim 5, characterized in that The step of collecting data from the loading database through the service hot loading extension point to obtain simulated request data includes: Analyze the service characteristics and interface information of the application to obtain a loading configuration of the application, where the loading configuration includes one or more of a lightweight configuration and a refined configuration; Based on the loading configuration, data is collected from the loading database through the service hot loading extension point to obtain simulated request data.

7. An application loading device, characterized in that: The device comprises: A storage module, used to record request data of an application in a production environment and store the request data in a loading database; A loading module, configured to collect data based on the loading database to obtain simulation request data when detecting that the application state of the application is starting, and hot load the application through the simulation request data to obtain a loading result; The service module is used to modify the application status of the application to startup completion if the loading result is successful, and provide corresponding application services.

8. An application loading device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the application loading method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the application loading method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the application loading method according to any one of claims 1 to 6 are implemented.