Method, device and equipment for resource initialization and readable medium

By obtaining and assigning the preheating configuration files of the target application, initializing and warming up the application resources in advance, solving the service jitter problem caused by the incomplete initialization of the resource after application deployment, and improving service performance and user experience.

CN119847625APending Publication Date: 2025-04-18BEIJING JINGDONG YUANSHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311345047.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-17
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

After the application is deployed, since the resources are not fully initialized, the service is prone to jitter and timeout problems when receiving a large number of call requests, which affects the user experience.

Method used

By obtaining the preheating configuration file of the target application, assigning configuration parameters based on user input, and initializing the resources before the application is deployed, including the warm-up of the business processing thread pool, network communication thread pool and cache.

Benefits of technology

It realizes full initialization and preheating of application resources, improves service performance and stability, reduces service jitter phenomenon, and improves application availability and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847625A_ABST
    Figure CN119847625A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a resource initialization method and device, equipment and a readable medium. The method comprises the steps that a preheating configuration file for a target application is obtained, the preheating configuration file comprises at least one configuration parameter, and the at least one configuration parameter corresponds to at least one resource needed by operation of the target application; assigning at least one configuration parameter based on user input; and initializing at least one resource of the target application based on the at least one assigned configuration parameter before the target application is deployed. In this way, the resources of the application can be fully initialized based on the flexibly-configured parameters, and the application is fully preheated before being actually deployed, so that the performance and stability of the service are improved, the service jitter phenomenon is reduced, and the usability of the application and the user experience are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Example embodiments of the present disclosure generally relate to the field of computer technology, and more particularly, to methods, apparatuses, devices, and computer-readable storage media for resource initialization. Background Art

[0002] With the rapid development of information technology, more and more applications (also called "services") are being used by users, bringing many conveniences to users. Applications with different functions can provide different services to users. After the application is deployed, some resources associated with the exposed services (such as internal cache, thread pool, etc.) have not been fully initialized. After the service goes online, it receives a large number of call requests instantly, which is prone to service jitter, upstream caller timeout and other problems. This will affect the user experience of the application. Summary of the invention

[0003] In a first aspect of the present disclosure, a method for resource initialization is provided. The method comprises: obtaining a preheating configuration file for a target application, the preheating configuration file comprising at least one configuration parameter, the at least one configuration parameter corresponding to at least one resource required for the operation of the target application; assigning a value to the at least one configuration parameter based on user input; and before the target application is deployed, initializing at least one resource of the target application based on the at least one assigned configuration parameter.

[0004] In a second aspect of the present disclosure, a device for resource initialization is provided. The device includes: a file acquisition module, configured to acquire a preheating configuration file for a target application, the preheating configuration file includes at least one configuration parameter, and the at least one configuration parameter corresponds to at least one resource required for the operation of the target application; a parameter assignment module, configured to assign a value to the at least one configuration parameter based on user input; and an initialization module, configured to initialize at least one resource of the target application based on the at least one assigned configuration parameter before the target application is deployed.

[0005] In a third aspect of the present disclosure, an electronic device is provided. The electronic device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit, and when the instructions are executed by the at least one processing unit, the electronic device executes the method of the first aspect of the present disclosure.

[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to perform the method according to the first aspect of the present disclosure.

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

[0008] In the following, in conjunction with the accompanying drawings and with reference to the following detailed description, the above and other features, advantages and aspects of various implementations of the present disclosure will become more apparent. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0009] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;

[0010] Figure 2 A flowchart showing a process for resource initialization according to some embodiments of the present disclosure is shown;

[0011] Figure 3A A schematic diagram showing an example of at least one parameter in a preheating configuration file according to some embodiments of the present disclosure;

[0012] Figure 3B A schematic diagram showing an example of a cache preheating method according to some embodiments of the present disclosure;

[0013] Figure 3C A schematic diagram showing an example of a cache preheating method according to some other embodiments of the present disclosure;

[0014] Figure 4 A schematic diagram showing an example of a process for resource initialization according to some embodiments of the present disclosure;

[0015] Figure 5 A schematic structural block diagram of an apparatus for resource initialization according to some embodiments of the present disclosure is shown; and

[0016] Figure 6 A block diagram of a computing device is shown in which one or more embodiments of the present disclosure may be implemented. DETAILED DESCRIPTION

[0017] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0018] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.

[0019] It should be noted that the acquisition, storage and application of user personal information involved in the technical solution of the present disclosure are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0020] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0021] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information, so that the user can independently choose whether to provide personal information to software or hardware such as electronic devices, applications, servers or storage media that execute operations of the technical solution of the present disclosure based on the prompt message.

[0022] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information is sent to the user in a manner such as a pop-up window, in which the prompt information can be presented in text form. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0023] As discussed above, after the application is deployed, if some resources of the service (such as internal cache, thread pool, etc.) have not been fully initialized, the service may experience service jitter, upstream caller timeout, etc. after receiving a large number of call requests instantly after the service goes online. In order to alleviate such problems, one way is to initialize the resources to be used by the application in advance. Initializing the application is also called preheating the application or service. In this article, "initialization" and "preheating" are used interchangeably, and "application" and "service" are also used interchangeably.

[0024] Traditionally, the methods for preheating applications mainly include small-scale trial runs and solutions based on recording and playback. The small-scale trial run solution sets a preheating weight for the application, which means that after the application goes online, a small-scale trial run is performed first, and then the full call request is accepted after preheating. This solution cannot fully preheat the resources, and when the full online request is received, the application will still have jitter problems due to resource initialization. The solution based on recording and playback will record the online traffic based on recording and playback. After the application goes online, the recorded process will be replayed to the application for preheating, and the online call request will be officially accepted after the preheating is sufficient. Although this solution allows resources to be fully preheated, this solution is only applicable to read requests, and will cause dirty data problems online for write requests.

[0025] In view of this, an embodiment of the present disclosure provides a method for resource initialization. The method includes: obtaining a preheating configuration file for a target application, the preheating configuration file includes at least one configuration parameter, and the at least one configuration parameter corresponds to at least one resource required for the operation of the target application; assigning a value to the at least one configuration parameter based on user input; and before the target application is deployed, initializing at least one resource of the target application based on the at least one assigned configuration parameter. In this way, the resources of the application can be fully initialized based on flexibly configurable parameters, and sufficient preheating can be achieved before the application is actually deployed, so as to improve the performance and stability of the service, reduce the occurrence of service jitter, and improve the availability of the application and user experience.

[0026] Figure 1 1 is a schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented. Figure 1 As shown, environment 100 may include electronic device 110 .

[0027] The electronic device 110 is at least configured to preheat the application 125 to be deployed. The application 125 can be any type of application, including but not limited to social applications, chat applications, shopping applications, reading applications, audio / video playback applications, etc. In the embodiment of the present disclosure, in order to preheat the application 125, before the application 125 is deployed, the user can perform a series of configurations on the application 125 through the electronic device 110 to initialize the resources included in the application 125.

[0028] In some embodiments, the application 125 to be preheated can be deployed in the server 120. The electronic device 110 can communicate with the server 120 to obtain data and / or files required to initialize the application 125 from the server 120. The server 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, and big data and artificial intelligence platforms. The server 120 may include, for example, a computing system / server, such as a mainframe, an edge computing node, a computing device in a cloud environment, and the like.

[0029] A communication connection may be established between the server 120 and the electronic device 110. The communication connection may be established in a wired manner or a wireless manner. The communication connection may include, but is not limited to, a Bluetooth connection, a mobile network connection, a Universal Serial Bus (USB) connection, a Wireless Fidelity (WiFi) connection, etc., and the embodiments of the present disclosure are not limited in this respect. In the embodiments of the present disclosure, the server 120 and the electronic device 110 may implement signaling interaction through the communication connection between the two.

[0030] The electronic device 110 may include any computing system with computing capabilities, such as various computing devices / systems, terminal devices, server devices, etc. The terminal device may be any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet, a handheld computer, a portable game terminal, a VR / AR device, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio receiver, an electronic book device, a game device or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. It can be understood that although the electronic device 110 and the server 120 are two independent electronic devices in the figure, in some embodiments, the electronic device 110 and the server 120 can also be the same electronic device.

[0031] It should be understood that the structure and function of the various elements in the environment 100 are described for exemplary purposes only and do not imply any limitation on the scope of the present disclosure.

[0032] Some example embodiments of the present disclosure will be described below with continued reference to the accompanying drawings.

[0033] Figure 2 FIG. 2 is a flowchart of a process 200 for resource initialization according to some embodiments of the present disclosure. The process 200 may be implemented at the electronic device 110. For ease of discussion, reference will be made to FIG. Figure 1 The process 200 is described with reference to the environment 100 of FIG.

[0034] In block 210 , the electronic device 110 obtains a preheating configuration file for a target application (eg, the application 125 ), where the preheating configuration file includes at least one configuration parameter corresponding to at least one resource required for running the target application.

[0035] In some embodiments, the electronic device 110 may obtain a preheating configuration file for the target application corresponding to the user input in response to the user input. Such a "user" refers to the developer, operation and maintenance personnel and other related backstage staff of the target application. In some embodiments, the electronic device 110 may also obtain a preheating configuration file for the target application from other electronic devices through a communication connection. The present disclosure does not limit the specific acquisition method.

[0036] The preheating configuration file here can be, for example, a file in any format, such as a preheating Jar package. The preheating configuration file includes at least one configuration parameter corresponding to at least one resource required for the operation of the target application. The target application can be any application, such as Figure 1 Application 125 shown. Exemplarily, if the operation of the target application requires resource A, resource B, and resource C, the preheating configuration file may include configuration parameters A, configuration parameter B, and configuration parameter C corresponding to the three resources, respectively. It can be understood that for all resources required for the operation of the target application, the preheating configuration file includes at least one configuration parameter corresponding to some of the resources. Exemplarily, if the operation of the target application requires resource D, resource E, and resource F, the preheating configuration file may also include configuration parameter E and configuration parameter F corresponding to resource E and resource F, respectively, of the three resources, but does not include the configuration parameter corresponding to resource D.

[0037] In some embodiments, at least one resource required for the operation of the target application includes a thread pool and a cache. The thread pool here may include at least one of a business processing thread pool and a network communication thread pool. In some embodiments, it can also be said that at least one resource includes at least one of a business processing thread and a network communication thread. The cache here can be, for example, a high-speed cache. Accordingly, in some embodiments, at least one configuration parameter includes at least one of a business processing thread parameter, a network communication thread parameter, and a cache interface parameter. Exemplarily, the target application can be designed and run based on a distributed service framework (such as a JSF service framework). In this example, the business processing thread parameter can be, for example, a parameter associated with a JSF business thread, and the network communication thread parameter can be, for example, a parameter associated with a Netty network thread. The cache interface parameter here can be, for example, a parameter associated with an interface that needs to be cached. For the purpose of explanation, the following embodiments are mainly described using the JSF service framework as an example, but it should be understood that the embodiments of the present disclosure can also be similarly used in other service frameworks.

[0038] In some embodiments, in addition to configuration parameters, the preheating configuration file may also include, for example, an enablement parameter. The value of the enablement parameter may be used to indicate whether to preheat the service, that is, the value of the enablement parameter may indicate whether to initialize the resource. It is understood that the preheating configuration file may also include any other appropriate parameters that may be used to initialize the resource, and the present disclosure does not limit the specific parameters included in the preheating configuration file.

[0039] Figure 3A FIG. 4 is a schematic diagram showing an example of at least one parameter in a preheating configuration file 300 according to some embodiments of the present disclosure. Figure 3A As shown, in some embodiments, the preheating profile 300 may include an enabling parameter, such as a parameter enablePreheat, which may also be referred to as a preheating switch. This parameter, for example, may correspond to only two states: an off state (false) and an on state (true). When the value of the parameter enablePreheat is false, the electronic device 110 determines that the state of the parameter is an off state, i.e., no resource initialization is required. When the value of the parameter enablePreheat is true, the electronic device 110 determines that the state of the parameter is an on state, i.e., resource initialization is required.

[0040] In some embodiments, the preheating configuration file 300 may also include a business processing thread parameter, such as the parameter jsfBizThreads. The value of this parameter may be used to configure the number of business processing threads that need to be preheated. When the business processing thread is a JSF business thread, it may be used to configure the number of JSF business threads that need to be preheated.

[0041] In some embodiments, the preheating configuration file 300 may also include a network communication thread parameter, such as a parameter jsfNettyThreads. The value of this parameter may be used to configure the number of network communication threads that need to be preheated, and in the case where the network communication thread is a Netty network thread, it may be used to configure the number of Netty network threads that need to be preheated.

[0042] In some embodiments, the preheating configuration file 300 may also include a cache interface parameter, such as a parameter jsfProviderConfigFilepath. This parameter may be used, for example, to configure a target cache interface for the cache. In the case where the service is a JSF service, the parameter may be used to configure a JSF provider configuration file path (also referred to as a package path).

[0043] In some embodiments, the preheat configuration file 300 may further include an extended parameter, such as a parameter preheatCallback. This parameter may be used, for example, to customize the extended preheat pre-processing / post-processing.

[0044] At block 220 , the electronic device 110 assigns a value to at least one configuration parameter based on the user input.

[0045] In some embodiments, the electronic device 110 may obtain user input for at least one resource of the target application. This user input may be used to assign a value to a parameter corresponding to the resource. In some embodiments, the specific value of this assignment may be determined based on a historical value or a value of a similar application and / or a similar service, for example. For example, if the observation result obtained by the user's daily observation indicates that the target application requires 500 business processing threads, the user may assign a value of 500 to the business processing thread parameter.

[0046] In some embodiments, for an enabling parameter, the electronic device 110 may determine whether the enabling parameter is in an on state or an off state based on user input. Figure 3A As shown, if the user input for the parameter enablePreheat is true, the electronic device 110 can determine that the state of the parameter enablePreheat is the on state based on the user input. The electronic device 110 can then determine that the resource needs to be preheated. It can be understood that the electronic device 110 assigns a value to at least one configuration parameter only when it is determined that the state of the enable parameter is the on state.

[0047] In some embodiments, for the business processing thread parameter, the electronic device 110 may determine, based on user input, that the business processing thread parameter is assigned a first value to indicate a first number of business processing threads to be created. Figure 3A As shown, if the user input for the parameter jsfBizThreads is 500, the electronic device 110 can determine based on the user input that the parameter jsfBizThreads is assigned a value of 500. The electronic device 110 can further determine that the number of JSF business threads that need to be preheated (ie, the first number) is 500.

[0048] In some embodiments, for the network communication thread parameter, the electronic device 110 may determine, based on user input, that the network communication thread parameter is assigned a second value to indicate a second number of network communication thread parameters to be created. Figure 3A As shown, if the user input for the parameter jsfNettyThreads is 200, the electronic device 110 can determine based on the user input that the parameter jsfNettyThreads is assigned a value of 200. The electronic device 110 can further determine that the number of Netty network threads that need to be preheated (ie, the second number) is 200.

[0049] In some embodiments, for the cache interface parameters, the electronic device 110 may cache the target cache interface corresponding to the cache interface parameters based on user input. Figure 3A As shown, if the user input for the parameter jsfProviderConfigFilepath is spring / jsf-provider.xml, the electronic device 110 can determine the value corresponding to the parameter jsfProviderConfigFilepath is spring / jsf-provider.xml based on the user input. The electronic device 110 can determine that the JSF provider configuration file path (ie, the target cache interface) needs to be spring / jsf-provider.xml.

[0050] In block 230 , the electronic device 110 initializes at least one resource of the target application based on the assigned at least one configuration parameter before the target application is deployed.

[0051] Before the application is deployed, that is, in the development phase, testing phase, fine-tuning phase, etc. of the application, which are between the deployment phases of the application, the electronic device 110 can initialize at least one resource of the target application based on the assigned preheating configuration file (that is, based on at least one assigned configuration parameter). Corresponding to the at least one configuration parameter included in the preheating configuration file, the at least one resource of the target application includes at least one of a business processing thread, a network communication thread, and a cache.

[0052] In some embodiments, for business processing threads, the electronic device 110 can create a first number of business processing threads for the target application in the business processing thread pool before the target application is deployed to initialize the business processing thread pool. Exemplarily, if the business processing thread parameter jsfBizThreads is assigned a value of 500, the electronic device 110 can create 500 business processing threads (such as JSF business threads) for the target application in the business processing thread pool. It is understood that the electronic device 110 can create business processing threads in any appropriate manner.

[0053] In some embodiments, for network communication threads, the electronic device 110 can create a second number of network communication threads for the target application in the network communication thread pool before the deployment of the target application to initialize the network communication thread pool. Exemplarily, if the network communication thread parameter jsfNettyThreads is assigned a value of 200, the electronic device 110 can create 200 network communication threads (e.g., Netty network threads) for the target application in the network communication thread pool. It is understood that the electronic device 110 can create network communication threads in any appropriate manner.

[0054] It should be understood that the number of service threads and the number of network communication threads given here are only examples, and any appropriate number can be flexibly configured according to the needs of specific applications.

[0055] In some embodiments, the above-mentioned business processing thread pool and network communication thread pool can be locally deployed. In this case, the business processing thread and the network communication thread can be created directly locally. In some embodiments, the above-mentioned business processing thread pool can be locally deployed, but the network communication thread pool can be remotely deployed. In this case, the business processing thread can be created directly locally, but the network communication thread cannot be created directly locally. In this case, the electronic device 110 can create a second number of network communication threads by submitting a thread creation task to a network communication thread pool deployed at a remote end (e.g., the cloud). In some embodiments, the electronic device 110 can also submit a second number of thread creation tasks, each task indicating the creation of a network communication thread. Exemplarily, the electronic device 110 can submit 200 thread creation tasks to the network communication thread pool to indicate the creation of 200 network communication threads. In some embodiments, the electronic device 110 can only submit a third number of thread creation tasks, the third number is less than the second number, and each thread creation task here indicates the creation of at least one network communication thread. For example, a certain thread creation task can indicate the creation of multiple network communication threads.

[0056] To better understand some embodiments of the present disclosure, the following describes the initialization process of the business processing thread by taking the case where the target application is based on the JSF service framework and the business processing thread is a JSF business thread as an example.

[0057] Step 1: The electronic device 110 obtains the JSF ServerBean from the Spring container.

[0058] Step 2: The electronic device 110 starts the JSF ServerBean.

[0059] Step 3: The electronic device 110 obtains the JSF Server from the JSF ServerBean.

[0060] Step 4: The electronic device 110 obtains the JSF Server TransportConfig from the JSF Server.

[0061] Step 5: The electronic device 110 obtains a reference to the JSF service thread pool from the JSF Server TransportConfig.

[0062] Step 6: The electronic device 110 sets the number of core threads in the JSF service thread pool through the setCorePoolsize method provided by the thread pool ThreadPoolExecutor. The specific number of core threads to be set can be determined by checking the number of JSF service threads during daily stable operation of the system through the jstack command.

[0063] Step 7: The electronic device 110 pre-creates enough threads according to the number of core threads through the prestartAllCoreThreads method provided by the thread pool ThreadPoolExecutor.

[0064] The above step 6 may be, for example, the electronic device 110 obtaining a user input indicating that the JSF business thread parameter jsfBizThreads is assigned a first value (i.e., the number of core threads). The above step 7 may be, for example, the electronic device 110 creating a first number (i.e., the number of core threads) of JSF business threads based on the assigned parameter jsfBizThreads.

[0065] To better understand some embodiments of the present disclosure, the following describes the initialization process of the network communication thread by taking the target application based on the JSF service framework and the network communication thread being the Netty network thread as an example.

[0066] Step 1: The electronic device 110 obtains the JSF ServerBean from the Spring container.

[0067] Step 2: The electronic device 110 starts the JSF ServerBean.

[0068] Step 3: The electronic device 110 obtains the JSF Server from the JSF ServerBean.

[0069] Step 4: The electronic device 110 obtains the JSF Server TransportConfig from the JSF Server.

[0070] Step 5: The electronic device 110 obtains the Netty network thread pool NioEventLoopGroup from the JSF Server TransportConfig.

[0071] Step 6. The electronic device 110 submits tasks to the NioEventLoopGroup thread pool in a multi-threaded concurrent manner. The number of submitted tasks can also be determined by checking the number of Netty network threads during the daily stable operation of the system through the istack command.

[0072] The above step six, for example, may be that the electronic device 110 may submit a certain number of thread creation tasks to the network communication thread pool to instruct the creation of network communication threads.

[0073] In this way, the electronic device 110 can preheat both the JSF business thread pool and the Netty network thread pool to the number of threads required for daily operation of the system, so that when a large number of call requests are received at the moment the service goes online, business and network processing can be performed directly, saving a lot of performance loss caused by the creation of thread resources.

[0074] In some embodiments, it can be found through the source code of the application service that the local cache is used in the encoding and decoding process of the input and output parameters of the service interface, and these caches can be initialized in advance. This can further improve the interface performance and reduce service jitter. In view of this, the electronic device 110 can also initialize the cache (such as a cache). In some embodiments, for the cache, the electronic device 110 can determine the input parameters and output parameters associated with the target cache interface. The input parameters here can include, for example, data input through the target cache interface, and the output parameters here can include, for example, data output through the target cache result. Before the deployment of the target application, the electronic device 110 can perform initialization operations on the input parameters and output parameters. The initialization operation here includes at least one of the encoding and decoding operations and the serialization and deserialization operations. The input parameters and output parameters can be collectively referred to as input and output parameter objects. These input and output parameter objects can be encoded data or serialized data before being initialized. The electronic device 110 can initialize the input and output parameter objects by performing a reverse decoding operation or encoding operation on the encoded or decoded data. The electronic device 110 can also initialize the input and output parameter objects by performing a reverse deserialization operation or serialization operation on the serialized or deserialized data. Initializing the input and output parameter objects of the target cache interface is to initialize the target cache interface.

[0075] In some embodiments, the electronic device 110 may first scan all input and output parameter objects according to the specified packet path (i.e., the target cache interface). The electronic device 110 may then determine the type of the input and output parameter object (e.g., whether it is an input and output parameter object associated with a JSF service or an input and output parameter object associated with Fastjson). The electronic device 110 may initialize the input and output parameter object based on the determined type of the input and output parameter object using a corresponding initialization method.

[0076] For example, if the input parameter of the target cache interface is "xx.xxx.demo.Request", if the input parameter is an input parameter associated with the JSF service, the electronic device 110 can Figure 3B The input parameter is initialized by the preheating method shown in FIG. If the input parameter is an input parameter associated with Fastjson, the electronic device 110 can initialize the input parameter by Figure 3CThe warm-up method shown initializes this input parameter.

[0077] In this way, during the system startup process, the electronic device 110 can initialize the JSF thread pool and pre-allocate appropriate thread pool resources to avoid the host load increase caused by the initialization of the JSF thread after the high concurrent business traffic request, and the business processing performance decay. During the system startup process, the electronic device 110 can also initialize the Netty thread pool and pre-allocate appropriate thread pool resources to avoid the host load increase caused by the initialization of the Netty thread after the high concurrent network traffic request, and the business processing performance decay. During the system startup process, the electronic device 110 can also initialize the JSF business request input and output parameter parsing format, cache the input and output parameter message format, and avoid a large number of repeated parsings in the case of input and output parameter message format cache misses after the high concurrent business traffic request, and the business processing performance decay. The electronic device 110 can initialize the JSF thread pool, initialize the Netty thread pool, and initialize the JSF business request parameter parsing format to directly operate the thread pool and cache. The electronic device 110 can initialize the thread pool resources and local cache required for the service in advance to eliminate the problem of a large number of requests entering the instant service jitter after the application is deployed.

[0078] Figure 4 FIG. 4 is a schematic diagram showing an example of a process 400 for resource initialization according to some embodiments of the present disclosure. The process 400 may be implemented at the electronic device 110. For ease of discussion, reference will be made to FIG. Figure 1 The process 400 is described with reference to the environment 100. Note that Figure 4 The specific threads shown in FIG. 1 are merely examples for illustrative purposes and do not indicate any limitations.

[0079] In block 410, the electronic device 110 determines whether the state of the enabling parameter in the preheating profile for the target application is on or off based on the user input. The electronic device 110 determines whether to turn on preheating based on the determination result.

[0080] In response to the state of the enabling parameter being the on state, the electronic device 110 determines to start preheating, and in block 420, the electronic device 110 performs preheating preprocessing on the target application. The preheating preprocessing here may be any appropriate processing operation, which is not limited in the present disclosure.

[0081] In box 430, the electronic device 110 performs a preheating for the cache based on the user input. Specifically, the electronic device 110 may determine the target interface based on the user input. In box 432, the electronic device 110 may perform a codec cache preheating. The electronic device 110 may perform a reverse codec operation on the input and output parameter objects of the target interface being encoded and decoded. In box 434, the electronic device 110 may perform a serialization and deserialization preheating. The electronic device 110 may perform a reverse serialization and deserialization operation on the input and output parameter objects of the target interface being serialized and deserialized.

[0082] In box 440, the electronic device 110 performs preheating for the thread pool based on user input. The thread pool includes a business processing thread pool (e.g., a JSF business thread pool) and a network communication thread pool (e.g., a Netty network thread pool). In box 442, the electronic device 110 can perform JSF business thread pool preheating by creating a first number of JSF business threads in the JSF business thread pool based on user input. In box 444, the electronic device 110 can perform Netty network thread pool preheating by creating a second number of Netty network threads in the Netty network thread pool based on user input.

[0083] It should be noted that the above-mentioned preheating of the cache and the preheating of the thread pool do not affect each other, that is, the electronic device 110 can synchronously execute the operations described in box 432, box 433, box 442 and box 444.

[0084] In block 450, the electronic device 110 performs a post-preheating process on the target application. The post-preheating process operation here may be any appropriate process operation, which is not limited in the present disclosure.

[0085] Through the above resource initialization scheme, the thread pool and local cache can be directly operated when the application starts, the corresponding number of threads can be created according to the number of business threads during daily application operation, the local cache can be initialized according to all service input and output parameters defined by the application, and the thread pool and local cache can be fully preheated. Preheating does not perform simulated calls, but directly operates the thread pool and cache, initializes on demand, and is applicable to both read and write requests.

[0086] In summary, the embodiments of the present disclosure can fully initialize the resources of the application based on flexibly configurable parameters, and fully preheat the application before it is actually deployed, so as to improve the performance and stability of the service, reduce the occurrence of service jitter, and improve the availability of the application and user experience.

[0087] The embodiments of the present disclosure also provide corresponding devices for implementing the above methods or processes. Figure 5A schematic structural block diagram of an apparatus 500 for classification according to some embodiments of the present disclosure is shown. The apparatus 500 may be implemented as or included in the electronic device 110. Each module / component in the apparatus 500 may be implemented by hardware, software, firmware or any combination thereof.

[0088] like Figure 5 As shown, the device 500 includes a file acquisition module 510, which is configured to acquire a preheating configuration file for a target application, the preheating configuration file includes at least one configuration parameter, and the at least one configuration parameter corresponds to at least one resource required for the operation of the target application. The device 500 also includes a parameter assignment module 520, which is configured to assign a value to the at least one configuration parameter based on user input. The device 500 also includes an initialization module 530, which is configured to initialize at least one resource of the target application based on the at least one assigned configuration parameter before the target application is deployed.

[0089] In some embodiments, the at least one configuration parameter includes at least one of the following: a business processing thread parameter, a network communication thread parameter, and a cache interface parameter.

[0090] In some embodiments, at least one resource includes a business processing thread, and the parameter assignment module 520 includes: a first assignment module configured to determine, based on user input, that a business processing thread parameter is assigned a first value to indicate a first number of business processing threads to be created.

[0091] In some embodiments, the initialization module 530 includes: a first initialization module configured to create a first number of business processing threads for the target application in the business processing thread pool before the target application is deployed.

[0092] In some embodiments, at least one resource includes a network communication thread, and the parameter assignment module 520 includes: a second assignment module configured to determine, based on user input, that the network communication thread parameter is assigned a second value to indicate a second number of network communication threads to be created.

[0093] In some embodiments, the initialization module 530 includes: a second initialization module configured to create a second number of network communication threads for the target application in the network communication thread pool before the target application is deployed.

[0094] In some embodiments, the network communication thread pool is remotely deployed, and the second initialization module includes: a task submission module configured to create a second number of network communication threads by submitting thread creation tasks to the network communication thread pool.

[0095] In some embodiments, at least one resource includes a cache, and the parameter assignment module 520 includes: a third assignment module configured to determine a target cache interface corresponding to the cache interface parameter based on user input.

[0096] In some embodiments, the initialization module 530 includes: a parameter determination module, configured to determine input parameters and output parameters associated with a target cache interface; and a third initialization module, configured to perform initialization operations on the input parameters and output parameters before the target application is deployed, the initialization operations including at least one of encoding and decoding operations and serialization and deserialization operations.

[0097] In some embodiments, the preheating profile also includes an enablement parameter, and the parameter assignment module 520 includes: a state determination module, configured to determine whether the state of the enablement parameter is an on state or an off state based on user input; and an assignment module, configured to assign a value to at least one configuration parameter if it is determined that the state of the enablement parameter is an on state.

[0098] The units and / or modules included in the device 500 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units and / or modules can be implemented using software and / or firmware, such as machine executable instructions stored on a storage medium. In addition to or as an alternative to machine executable instructions, some or all of the units and / or modules in the device 500 can be implemented at least in part by one or more hardware logic components. As an example and not limitation, exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0099] It should be understood that one or more steps in the above method can be performed by a suitable electronic device or a combination of electronic devices. Such an electronic device or a combination of electronic devices may include, for example, Figure 1 The electronic device 110 in.

[0100] Figure 6 1 shows a block diagram of an electronic device 600 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 6 The electronic device 600 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein. Figure 6 The electronic device 600 shown can be used to implement Figure 1 An electronic device 110.

[0101] like Figure 6As shown, the electronic device 600 is in the form of a general electronic device. The components of the electronic device 600 may include, but are not limited to, one or more processors or processing units 610, a memory 620, a storage device 630, one or more communication units 640, one or more input devices 650, and one or more output devices 660. The processing unit 610 may be an actual or virtual processor and is capable of performing various processes according to a program stored in the memory 620. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the electronic device 600.

[0102] The electronic device 600 typically includes a plurality of computer storage media. Such media can be any available media accessible to the electronic device 600, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 620 can be a volatile memory (e.g., registers, caches, random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory) or some combination thereof. The storage device 630 can be a removable or non-removable medium, and can include a machine-readable medium, such as a flash drive, a disk, or any other medium, which can be used to store information and / or data and can be accessed within the electronic device 600.

[0103] The electronic device 600 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 6 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. The memory 620 may include a computer program product 625 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.

[0104] The communication unit 640 implements communication with other electronic devices through a communication medium. Additionally, the functions of the components of the electronic device 600 can be implemented with a single computing cluster or multiple computing machines that can communicate through a communication connection. Therefore, the electronic device 600 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.

[0105] The input device 650 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device 660 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 600 may also communicate with one or more external devices (not shown) through the communication unit 640 as needed, such as a storage device, a display device, etc., communicate with one or more devices that allow a user to interact with the electronic device 600, or communicate with any device that allows the electronic device 600 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).

[0106] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.

[0107] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0108] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0109] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0110] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse 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 realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.

[0111] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the various implementations disclosed herein.

Claims

1. A method for resource initialization, comprising: Acquire a preheating configuration file for a target application, wherein the preheating configuration file includes at least one configuration parameter, and the at least one configuration parameter corresponds to at least one resource required for running the target application; assigning a value to the at least one configuration parameter based on user input; as well as Before the target application is deployed, the at least one resource of the target application is initialized based on the at least one assigned configuration parameter.

2. The method according to claim 1, wherein the at least one configuration parameter comprises at least one of the following: Business processing thread parameters, Network communication thread parameters, and Cache interface parameters.

3. The method according to claim 2, wherein the at least one resource comprises a business processing thread, and assigning a value to the at least one configuration parameter comprises: Based on the user input, it is determined that the service processing thread parameter is assigned a first value to indicate a first number of service processing threads to be created.

4. The method according to claim 3, wherein initializing the at least one resource of the target application comprises: Before the target application is deployed, the first number of business processing threads are created for the target application in a business processing thread pool.

5. The method of claim 2, wherein the at least one resource comprises a network communication thread, and assigning a value to the at least one configuration parameter comprises: Based on the user input, it is determined that the network communication thread parameter is assigned a second value to indicate a second number of network communication threads to be created.

6. The method according to claim 5, wherein initializing the at least one resource of the target application comprises: Before the target application is deployed, the second number of network communication threads is created for the target application in a network communication thread pool.

7. The method of claim 6, wherein the network communication thread pool is remotely deployed, and wherein creating the second number of network communication threads comprises: The second number of network communication threads is created by submitting a thread creation task to the network communication thread pool.

8. The method of claim 2, wherein the at least one resource comprises a cache, and assigning a value to the at least one configuration parameter comprises: A target cache interface corresponding to the cache interface parameter is determined based on the user input.

9. The method according to claim 8, wherein initializing the at least one resource of the target application comprises: Determining input parameters and output parameters associated with the target cache interface; as well as Before the target application is deployed, an initialization operation is performed on the input parameter and the output parameter, wherein the initialization operation includes at least one of an encoding and decoding operation and a serialization and deserialization operation.

10. The method of claim 1, wherein the preheat configuration file further comprises an enablement parameter, and wherein assigning a value to the at least one configuration parameter comprises: Determining whether the state of the enabling parameter is an on state or an off state based on the user input; as well as If it is determined that the state of the enabling parameter is the on state, a value is assigned to the at least one configuration parameter.

11. A device for resource initialization, comprising: A file acquisition module is configured to acquire a preheating configuration file for a target application, wherein the preheating configuration file includes at least one configuration parameter, and the at least one configuration parameter corresponds to at least one resource required for the operation of the target application; a parameter assignment module, configured to assign a value to the at least one configuration parameter based on a user input; as well as The initialization module is configured to initialize the at least one resource of the target application based on the at least one assigned configuration parameter before the target application is deployed.

12. An electronic device comprising: at least one processing unit; as well as At least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the electronic device to perform the method according to any one of claims 1 to 10.

13. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 10.