Method and device for dynamically setting connection pool parameters and computer device

CN115967965BActive Publication Date: 2026-09-25E SURFING IOT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211738462.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-09-25
Estimated Expiration
2042-12-30

AI Technical Summary

Benefits of technology

[0031]上述连接池参数的动态设置方法、装置、计算机设备和存储介质从日志服务器上获取到历史用户调用量的信息,通过隐马尔科夫模型进行对下个时间段用户使用量进行预测,可以提前通过用户使用量动态地设置连接池中线程池个数,从而减缓阻塞和死机现象,同时也充分利用硬件性能,在一定场景环境中提高了连接池的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115967965B_ABST
    Figure CN115967965B_ABST
Patent Text Reader

Abstract

The application relates to a dynamic setting method and device of connection pool parameters, computer equipment and a storage medium, wherein the method comprises the following steps: obtaining original monitoring data from an ElasticSearch server; preprocessing the original monitoring data; statistically analyzing and normalizing the original monitoring data as model input data; constructing a hidden Markov model; inputting the model input data into the hidden Markov model to calculate a state transition matrix and model parameters to obtain state data; and setting the number of thread pools in the connection pool according to the state data output by the hidden Markov model, including the minimum number of threads of the connection pool, the current number of threads and the maximum number of threads. The application can dynamically set the number of thread pools in the connection pool in advance according to the user usage, so as to slow down the blocking and dead machine phenomenon.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet information technology, and in particular to a method, apparatus, computer device, and storage medium for dynamically setting connection pool parameters. Background Technology

[0002] With the rapid development of 5G technology and the advancement of IoT technology, building a 5G IoT SIM card connectivity management platform is imperative. As the number of enterprise users using 5G IoT SIM cards continues to increase, a large number of cross-platform and cross-service calls are required. How to more effectively improve the efficiency of cross-service calls, fully utilize computer hardware performance, avoid service congestion during peak user periods, and improve customer service quality remains a challenge to be solved.

[0003] Currently, traditional connection pool thread count settings primarily involve pre-setting a fixed initial thread count and a maximum thread count. The thread count is then increased incrementally as the number of tasks in the blocking queue reaches a certain threshold. However, this approach can lead to the connection pool being unable to handle a large number of tasks within a very short time, resulting in blocking or crashes. Therefore, existing connection pool parameter settings do not fully utilize historical user call volume information, and blocking and server crashes still occur when faced with sudden surges in user calls. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer device, and storage medium for dynamically setting connection pool parameters to address the aforementioned technical problems.

[0005] A method for dynamically setting connection pool parameters, the method comprising:

[0006] Retrieve raw monitoring data from the ElasticSearch server;

[0007] The raw monitoring data is preprocessed, and statistical analysis and standardization are performed on the raw monitoring data to be used as model input data.

[0008] Construct a hidden Markov model, and input the model input data into the hidden Markov model to calculate the state transition matrix and model parameters to obtain the state data;

[0009] The number of threads in the connection pool is set based on the state data output by the Hidden Markov Model, including the minimum number of threads, the current number of threads, and the maximum number of threads.

[0010] In one embodiment, after the steps of preprocessing the raw monitoring data, performing statistical analysis on the raw monitoring data, and normalizing the raw monitoring data as model input data, the method further includes:

[0011] Determine whether the statistically analyzed data can be used as input data for the model. If not, return directly without setting the number of connection pool threads.

[0012] In one embodiment, the steps of preprocessing the raw monitoring data, performing statistical analysis on the raw monitoring data, and standardizing the raw monitoring data as model input data further include:

[0013] The number of connections is counted within equal time periods, and the current hidden state data is determined as the model input data based on the number of connections obtained in subsequent time periods.

[0014] In one embodiment, the step of constructing a hidden Markov model and inputting the model input data into the hidden Markov model to calculate the state transition matrix and model parameters to obtain state data includes:

[0015] The observation probability matrix and state transition matrix are calculated using the Baum-Welch algorithm based on historical observation data and state data.

[0016] Predict the current state data using the current observation data, and use the predicted state data as a parameter for setting the number of connection pool threads.

[0017] In one embodiment, the step of setting the number of threads in the connection pool based on the state data output by the Hidden Markov Model, including the minimum number of threads, the current number of threads, and the maximum number of threads in the connection pool, includes:

[0018] A state-thread count mapping table is pre-set, and the current state data is mapped to the corresponding current thread count according to the state-thread count mapping table;

[0019] Set the maximum number of threads to twice the current number of threads, and set the minimum number of threads to half the current number of threads.

[0020] A device for dynamically setting connection pool parameters, the device comprising:

[0021] The data acquisition module is used to obtain raw monitoring data from the ElasticSearch server;

[0022] The data preprocessing module is used to preprocess the raw monitoring data, perform statistical analysis on the raw monitoring data, and standardize the raw monitoring data as model input data.

[0023] The model processing module is used to construct a hidden Markov model, and input the model input data into the hidden Markov model to calculate the state transition matrix and model parameters to obtain state data.

[0024] The connection pool setting module is used to set the number of threads in the connection pool according to the state data output by the hidden Markov model, including the minimum number of threads, the current number of threads, and the maximum number of threads.

[0025] In one embodiment, the device further includes a determining module, the determining module being used to:

[0026] Determine whether the statistically analyzed data can be used as input data for the model. If not, return directly without setting the number of connection pool threads.

[0027] In one embodiment, the data preprocessing module is further configured to:

[0028] The number of connections is counted within equal time periods, and the current hidden state data is determined as the model input data based on the number of connections obtained in subsequent time periods.

[0029] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.

[0030] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above methods.

[0031] The above-mentioned method, device, computer equipment, and storage medium for dynamically setting connection pool parameters obtain historical user call volume information from the log server, and use a hidden Markov model to predict user usage in the next time period. This allows for the dynamic setting of the number of threads in the connection pool in advance based on user usage, thereby mitigating blocking and crashes. It also makes full use of hardware performance and improves the efficiency of the connection pool in certain scenarios. Attached Figure Description

[0032] Figure 1 This is a technical architecture diagram of a method for dynamically setting connection pool parameters in one embodiment;

[0033] Figure 2 This is a flowchart illustrating a method for dynamically setting connection pool parameters in one embodiment;

[0034] Figure 3 This is a flowchart illustrating a method for dynamically setting connection pool parameters in another embodiment;

[0035] Figure 4 This is a flowchart illustrating a method for dynamically setting connection pool parameters in another embodiment;

[0036] Figure 5 This is a structural block diagram of a device for dynamically setting connection pool parameters in one embodiment;

[0037] Figure 6 This is a structural block diagram of a device for dynamically setting connection pool parameters in another embodiment;

[0038] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0040] Currently, existing connection pool parameter setting methods do not fully utilize historical user call volume information, and blockage and server crashes still occur when faced with sudden surges in user calls. Therefore, this invention proposes a dynamic connection pool parameter setting method. By analyzing monitoring log data and predicting future user call volume, the method dynamically sets the connection pool thread size, thereby improving connection pool call efficiency and avoiding cross-service call blocking during peak user service periods.

[0041] Specifically, refer to Figure 1 The diagram illustrates the technical architecture of a dynamic connection pool parameter setting method. This invention's architecture primarily includes a data acquisition module, a data preprocessing module, a model processing module, and a connection pool setting module. This technology fully utilizes historical user call information to predict the number of user calls in the next time period, pre-setting the number of threads in the connection pool. This effectively improves the efficiency of cross-service calls within the connection pool and avoids call blocking during peak service periods.

[0042] In one embodiment, such as Figure 2 As shown, a method for dynamically setting connection pool parameters is provided, the method including:

[0043] Step 202: Obtain raw monitoring data from the ElasticSearch server;

[0044] Step 204: Preprocess the raw monitoring data by performing statistical analysis and standardizing the raw monitoring data as input data for the model.

[0045] Step 206: Construct a Hidden Markov Model by inputting the model input data into the Hidden Markov Model to calculate the state transition matrix and model parameters to obtain the state data.

[0046] Step 208: Set the number of threads in the connection pool based on the state data output by the Hidden Markov Model, including the minimum number of threads, the current number of threads, and the maximum number of threads.

[0047] In this embodiment, a method for dynamically setting connection pool parameters is provided. The technical architecture of this method is shown in Figure 1, which mainly includes a data acquisition module, a data preprocessing module, a model processing module, and a connection pool setting module.

[0048] Specifically, the data acquisition module primarily obtains the number of client connections from the log monitoring server. Since clients using the Feign connection pool input each call's information into the logs, which are then processed by ELK and aggregated in the Elasticsearch server. Because the logs record the time information during input, data is typically collected over a time period.

[0049] Data preprocessing module: The data obtained by the data acquisition module cannot be directly used as input data for the model. Further processing is required to standardize the data before it can be used as input data. Specifically, this involves counting the number of connections over equal time intervals and determining the current hidden state data based on the statistical counts obtained in subsequent time intervals, which will then be used as input data for the model.

[0050] Model processing module: Using the connection counts and state data obtained from the data preprocessing module over multiple time periods as input data, a Hidden Markov Model (HMM) is used to predict the state of the next time period. Specifically, the HMM calculates the state transition matrix and probability matrix based on historical observation data and its state data, then predicts the current state value using the current observation data. Finally, the predicted state is used as a crucial parameter for setting the number of threads in the connection pool.

[0051] Connection pool settings module: Based on the state data predicted by the model processing module, the number of threads in the Feign connection pool is set accordingly. The connection pool includes a minimum number of threads, a current number of threads, and a maximum number of threads. Specifically, a state-thread number mapping table is first manually pre-set, then the currently obtained state value is mapped to the current thread data, and the maximum number of threads is set to twice the current number of threads and the minimum number of threads is set to half the current number of threads.

[0052] In this embodiment, historical user call volume information is obtained from the log server, and the user usage volume for the next time period is predicted by using a hidden Markov model. The number of threads in the connection pool can be dynamically set in advance based on the user usage volume, thereby alleviating blocking and crashes. At the same time, it makes full use of hardware performance and improves the efficiency of the connection pool in certain scenarios.

[0053] In one embodiment, a method for dynamically setting connection pool parameters is provided. This method, after preprocessing the raw monitoring data and performing statistical analysis and normalization on the raw monitoring data as model input data, further includes:

[0054] Determine whether the statistically analyzed data can be used as input data for the model. If not, return directly without setting the number of connection pool threads.

[0055] refer to Figure 3 The flowchart shown illustrates a method for dynamically setting connection pool parameters. This method includes the following steps:

[0056] First, monitoring data is retrieved from the log monitoring server. Next, the monitoring data is preprocessed, primarily through statistical analysis, to obtain relevant data as input to the model. If the data obtained from the statistical analysis can be used as model input, the Hidden Markov Model (HMM) construction step is performed; otherwise, the process returns directly without setting the connection pool thread count. Finally, the HMM is constructed, using the obtained data as input, and the model is trained to obtain the model output data, which is then used as the connection pool thread count.

[0057] In this embodiment, the original monitoring data needs to be processed and converted into data that can be used as model input. The Hidden Markov Model is then used to perform calculations on the data to obtain model output data. The model output data is then used as Feign connection pool thread parameters to modify the number of connection pool threads.

[0058] In one embodiment, such as Figure 4 As shown, a method for dynamically setting connection pool parameters is provided, which further includes:

[0059] Step 402: Calculate the observation probability matrix and state transition matrix using the Baum-Welch algorithm based on historical observation data and state data;

[0060] Step 404: Predict the current state data using the current observation data, and use the predicted state data as a parameter for setting the number of connection pool threads;

[0061] Step 406: Pre-set a state-thread number mapping table, and map the current state data to the corresponding current thread number according to the state-thread number mapping table;

[0062] Step 408: Set the maximum number of threads to twice the current number of threads, and set the minimum number of threads to half the current number of threads.

[0063] In this embodiment, the implementation process of each step is described in detail as follows:

[0064] First, the raw monitoring data is retrieved from the ElasticSearch server, and a simple statistical analysis is performed on the raw monitoring data, which is formalized as follows:

[0065]

[0066] Where t represents time, o t This represents the number of connections at that moment.

[0067] Next, the raw monitoring data is preprocessed to obtain the model input data.

[0068] Because counting the number of connections based on time dimension would result in an excessive amount of data and uneven time intervals between adjacent data, it is necessary to count the number of connections within equal time intervals.

[0069]

[0070] Where j represents the j-th time period [t] j ,t j+1 ], o j This represents the number of connections counted in the j-th time period, where o j The calculation method is as follows:

[0071] o j =sum({o k |k∈[t j ,t j+1 )})

[0072] `sum` is the summation function.

[0073] In a specific example, calculated at 3-minute intervals, some of the data is as follows:

[0074]

[0075] Since the data being connected may be fragmented, it is rounded to the nearest integer.

[0076] Then, based on the principles of Hidden Markov Models, the state transition matrix and model parameters are calculated to obtain the state data.

[0077] Specifically, the principle of Hidden Markov Models: Let Q be the set of all possible states, and V be the set of all possible observations:

[0078] Q = {q1,q2,…,q} N}

[0079] V = {v1, v2, ..., v} M}

[0080] Where N is the number of possible states and M is the number of possible observations. In this example, the number of connection states can be divided into five categories: low, medium, slightly high, high, and very high.

[0081] I is a state sequence of length T, and O is the corresponding observation sequence:

[0082] I = {i1, i2, ..., i} T}

[0083] O = {o1, o2, ..., o} T}

[0084] A is the state transition probability matrix:

[0085] A = [a ij ] N×N

[0086] in:

[0087] a ij =P(i t+1 =q j |i t =q i ), i=1,2,…,N; j=1,2,…,N

[0088] At time t, the state is q. i Under the condition that the transition occurs at time t+1 to q j The probability of.

[0089] B is the observation probability matrix:

[0090] B = [b] j (k)] N×M

[0091] in,

[0092] b j (k)=P(o t =v k |i t =q j ),k=1,2,…,M; j=1,2,…,N

[0093] At time t, the state is q.j v is generated under the condition k The probability of.

[0094] π is the initial state probability vector:

[0095] π=(π i )

[0096] in

[0097] π i =P(i1=q i ), i = 1, 2, ..., N

[0098] At time t=1, the state is q. i probability

[0099] A Hidden Markov Model (HMM) consists of an initial state probability vector π, a state transition probability matrix A, and an observation probability matrix B. π and A determine the state sequence, while B determines the observation sequence. Therefore, the HMM λ can be represented using ternary notation, i.e.

[0100] λ = (A, B, π)

[0101] As can be seen from the definition, Hidden Markov Models make two basic assumptions:

[0102] (1) The homogeneous Markov property assumption, that is, the assumption that the state of the hidden Markov chain at any time t depends only on the state at the previous time, and is independent of the state at other times and the observations, and is also independent of time t:

[0103] P(i t |i t-1 ,o t-1 ,…,i1,o1)=P(i t |i t-1 )

[0104] (2) Observation independence assumption: It is assumed that an observation at any time depends only on the state of the Markov chain at that time and is independent of other observations and states.

[0105] P(o t |i t i t-1 ,o t-1 ,…,i1,o1)=P(o t |i t )

[0106] Currently, the main problem is the learning problem, given the observation sequence O = (o1, o2, ..., o T Estimate the parameters of the model λ=(A,B,π) to maximize the probability P(O|λ) of the observed sequence under the model, i.e., estimate the parameters using the Baum-Welch algorithm.

[0107] The Baum-Welch algorithm is an unsupervised algorithm that uses observed data and initial model parameter estimates λ. 0 Using this as initial input data, the EM algorithm is then applied step-by-step to estimate the λ parameter values, ultimately yielding the convergent value. Since only the algorithm steps are given, the specific algorithm is as follows:

[0108]

[0109] Predicting data for the next time period:

[0110]

[0111] Among them, o t+1 The number of connections predicted for the next time period can be calculated using the observation probability matrix and the state transition matrix, which are obtained by the Baum-Welch algorithm and will not be shown here.

[0112] Finally, calculate the maximum and minimum number of threads in the connection pool:

[0113] pt max =o t+1 ×2

[0114] pt cur =o t+1

[0115] pt min =o t+1 / 2

[0116] Hidden Markov Models can be used to predict connection data for the next time period. Based on this connection data, the current connection pool thread count (pt) can be set. cur For this predicted data o t+1 Set the minimum number of connection pool threads to half the predicted data, and set the maximum number of connection pool threads to twice the predicted data.

[0117] In this embodiment, the web service internal connection pool parameter dynamic setting technology based on log monitoring and hidden Markov model makes full use of historical user call information to predict the number of user calls in the next time period and pre-set the number of threads in the connection pool, which effectively improves the efficiency of Feign connection pool in cross-service calls and avoids call blocking during peak service periods.

[0118] It should be understood that, although Figure 1-4The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1-4 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0119] In one embodiment, such as Figure 5 As shown, a dynamic setting device 500 for connection pool parameters is provided, the device comprising:

[0120] Data acquisition module 501, the data acquisition module is used to obtain raw monitoring data from the ElasticSearch server;

[0121] Data preprocessing module 502 is used to preprocess the raw monitoring data, perform statistical analysis on the raw monitoring data and standardize it as model input data;

[0122] Model processing module 503 is used to construct a hidden Markov model, and input the model input data into the hidden Markov model to calculate the state transition matrix and model parameters to obtain state data.

[0123] The connection pool setting module 504 is used to set the number of threads in the connection pool according to the state data output by the hidden Markov model, including the minimum number of threads, the current number of threads, and the maximum number of threads.

[0124] In one embodiment, such as Figure 6 As shown, a dynamic setting device 500 for connection pool parameters is provided. This device further includes a judgment module 505, which is used for:

[0125] Determine whether the statistically analyzed data can be used as input data for the model. If not, return directly without setting the number of connection pool threads.

[0126] In one embodiment, the data preprocessing module 502 is further configured to: count the number of connections within equal time periods, and determine the current hidden state data as model input data based on the number of statistics obtained in subsequent time periods.

[0127] In one embodiment, the model processing module 503 is further configured to: calculate the observation probability matrix and the state transition matrix based on historical observation data and their state data using the Baum-Welch algorithm; predict the state data at the current moment using the observation data at the current moment; and use the predicted state data as a parameter for setting the number of connection pool threads.

[0128] In one embodiment, the connection pool setting module 504 is further configured to: pre-set a state-thread number correspondence table, map the current state data to the corresponding current thread number according to the state-thread number correspondence table; set the maximum thread number to twice the current thread number, and set the minimum thread number to half of the current thread number.

[0129] For specific limitations on the dynamic setting device for connection pool parameters, please refer to the limitations on the dynamic setting method for connection pool parameters mentioned above, which will not be repeated here.

[0130] In one embodiment, a computer device is provided, the internal structure of which can be shown as follows: Figure 7 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a method for dynamically setting connection pool parameters.

[0131] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0132] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the various method embodiments described above.

[0133] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the various method embodiments described above.

[0134] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0135] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0136] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for dynamically setting connection pool parameters, the method comprising: Retrieve raw monitoring data from the ElasticSearch server; The original monitoring data is preprocessed, statistically analyzed and standardized, and the number of connections is counted within equal time periods. The current hidden state data is determined as the model input data based on the number of connections obtained in subsequent time periods. A hidden Markov model is constructed. The input data of the model is input into the hidden Markov model to calculate the state transition matrix and model parameters to obtain state data. The state data is divided into five states: low, medium, slightly high, high and very high. The number of threads in the connection pool is set based on the state data output by the Hidden Markov Model, including the minimum number of threads, the current number of threads, and the maximum number of threads in the connection pool. The step of setting the number of threads in the connection pool based on the state data output by the Hidden Markov Model, including the minimum number of threads, the current number of threads, and the maximum number of threads in the connection pool, includes: A state-thread count mapping table is pre-set, and the current state data is mapped to the corresponding current thread count according to the state-thread count mapping table; Set the maximum number of threads to twice the current number of threads, and set the minimum number of threads to half the current number of threads.

2. The method for dynamically setting connection pool parameters according to claim 1, characterized in that, After the steps of preprocessing the raw monitoring data, performing statistical analysis on the raw monitoring data, and standardizing the raw monitoring data as model input data, the method further includes: Determine whether the statistically analyzed data can be used as input data for the model. If not, return directly without setting the number of connection pool threads.

3. The method for dynamically setting connection pool parameters according to claim 1, characterized in that, The steps of constructing a Hidden Markov Model, which involve inputting the model input data into the Hidden Markov Model to calculate the state transition matrix and model parameters to obtain state data, include: The observation probability matrix and state transition matrix are calculated using the Baum-Welch algorithm based on historical observation data and state data. Predict the current state data using the current observation data, and use the predicted state data as a parameter for setting the number of connection pool threads.

4. A device for dynamically setting connection pool parameters, characterized in that, The dynamic setting device for the connection pool parameters includes: The data acquisition module is used to obtain raw monitoring data from the ElasticSearch server; The data preprocessing module is used to preprocess the raw monitoring data, perform statistical analysis and standardization on the raw monitoring data, count the number of connections within equal time periods, and determine the current hidden state data as model input data based on the number of statistics obtained in subsequent time periods. The model processing module is used to construct a hidden Markov model. The model input data is input into the hidden Markov model to calculate the state transition matrix and model parameters to obtain state data. The state data is divided into five states: low, medium, slightly high, high and very high. A connection pool setting module is used to set the number of threads in the connection pool according to the state data output by the hidden Markov model, including the minimum number of threads, the current number of threads, and the maximum number of threads in the connection pool. Specifically, the connection pool setting module is used for: A state-thread count mapping table is pre-set, and the current state data is mapped to the corresponding current thread count according to the state-thread count mapping table; Set the maximum number of threads to twice the current number of threads, and set the minimum number of threads to half the current number of threads.

5. The dynamic setting device for connection pool parameters according to claim 4, characterized in that, The device further includes a judgment module, the judgment module being used for: Determine whether the statistically analyzed data can be used as input data for the model. If not, return directly without setting the number of connection pool threads.

6. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method for predicting state of software system based on hidden Markov model

    CN104699606A

  • Dynamic resizing of webserver connection pool size

    US20200358713A1