Resource pool control method and device, electronic equipment and storage medium
By predicting the load status of the operating system resource pool and calculating the target pooling parameters, and dynamically adjusting the resource pool, the problem of insufficient complexity and adaptability of pooling parameter tuning in the existing technology is solved, and the system performance and stability are improved.
Patent Information
- Application Number
- CN202411761790.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art has complexity, lack of universality and dependence experience in pooling parameter tuning, resulting in low resource utilization, unstable performance, and difficult to adapt to dynamic load changes.
By obtaining pooling parameters, predict the load status of the operating system resource pool in the future time interval, calculate the target pooling parameters based on the load status, and dynamically adjust the resource pool to optimize system performance and resource utilization.
It realizes automatic adjustment of pooling parameters based on actual load, improves system performance and stability, enhances system adaptability and intelligence, reduces operation and maintenance costs, and improves user experience.
Smart Images

Figure CN119883597A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of resource pool control methods, and in particular to a resource pool control method, a resource pool control device, an electronic device and a computer-readable storage medium. Background Art
[0002] As a common method to optimize system resource utilization, pooling technology has been widely used in modern software development. By pre-creating and managing a group of resources (such as threads, database connections, memory blocks, etc.), pooling technology can reduce the creation and destruction overhead of resources and improve system performance.
[0003] Parameter tuning is a key link in the application of pooling technology. Pooling technology usually involves multiple parameters, such as maximum pool size, minimum pool size, core pool size, timeout, etc. The settings of these parameters directly affect the performance, stability and resource utilization of the system. Summary of the invention
[0004] The embodiments of the present invention provide a resource pool control method, device, electronic device and computer-readable storage medium to overcome the above problems or at least partially solve the above problems.
[0005] An embodiment of the present invention discloses a resource pool control method, comprising:
[0006] Obtaining pooling parameters; the pooling parameters are used to control the resource pool running on the operating system;
[0007] Predicting the load of the resource pool of the operating system within a future preset time interval by using the pooling parameters;
[0008] Calculate a target pooling parameter for the resource pool based on the load condition;
[0009] The target pooling parameters are used to control the resource pool.
[0010] The embodiment of the present invention further discloses a resource pool control device, including:
[0011] A pooling parameter acquisition module, used to acquire pooling parameters; the pooling parameters are used to control the resource pool running on the operating system;
[0012] A load condition prediction module, used to predict the load condition of the resource pool of the operating system within a future preset time interval through the pooling parameters;
[0013] A target pooling parameter calculation module, used to calculate a target pooling parameter for the resource pool based on the load condition;
[0014] The resource pool control module is used to control the resource pool by using the target pooling parameter.
[0015] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0016] The memory is used to store computer programs;
[0017] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.
[0018] The embodiment of the present invention further discloses a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to execute the method described in the embodiment of the present invention.
[0019] The embodiments of the present invention include the following advantages:
[0020] In an embodiment of the present invention, pooling parameters are obtained; the pooling parameters are used to control a resource pool running on an operating system; the load condition of the resource pool of the operating system within a future preset time interval is predicted by the pooling parameters; target pooling parameters for the resource pool are calculated based on the load condition; and the resource pool is controlled by using the target pooling parameters, so that parameters can be automatically adjusted according to actual conditions, thereby optimizing system performance, improving adjustment efficiency of the pooling parameters, and improving control efficiency for the resource pool.
[0021] Furthermore, the following beneficial effects are achieved:
[0022] 1. Improve system performance: By dynamically adjusting pooling parameters, system resources can be more fully utilized to avoid resource waste. Reduce system bottlenecks and improve the system's response speed to user requests. Enhance stability by predicting and preventing system overload or crashes, thereby improving system stability.
[0023] 2. Enhance system adaptability: The system can automatically adjust parameters according to real-time load conditions to adapt to changing business needs. It can quickly respond to emergencies such as traffic peaks and system failures.
[0024] 3. Improve the intelligence level of the system: Based on historical data and real-time feedback, data-driven intelligent decision-making can be achieved. Through machine learning models, prediction and optimization of system behavior can be achieved. Automated operation and maintenance: Reduce manual intervention and achieve automated operation and maintenance of the system.
[0025] 4. Reduce operation and maintenance costs: Automated parameter adjustment reduces the workload of operation and maintenance personnel. Reduce system failures and reduce maintenance costs.
[0026] 5. Improve user experience: Users can get services faster. The user experience is smoother, with fewer freezes and errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 is a flow chart of the steps of a resource pool control method provided in an embodiment of the present invention;
[0028] Figure 2 It is a schematic diagram of an artificial intelligence pooling parameter tuning architecture provided in an embodiment of the present invention;
[0029] Figure 3 is a flow chart of a resource pool control method provided in an embodiment of the present invention;
[0030] Figure 4 is a structural block diagram of a resource pool control device provided in an embodiment of the present invention;
[0031] Figure 5 is a hardware structure block diagram of an electronic device provided in an embodiment of the present invention;
[0032] Figure 6 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0034] In the field of computer software, with the rapid development of information technology, the demand for efficient, stable and scalable software systems is growing. Performance optimization and effective resource utilization of software systems are the key to achieving these requirements. In most cases, the creation and destruction of system resources are very time-consuming and expensive operations. Therefore, pooling technology has become one of the common methods to solve this problem. For example, thread pools, connection pools, and memory pools are used to manage threads, connections, and memory in services.
[0035] These pooling technologies are similar in nature, and most of them have the following parameters: maximum value, minimum value, core value, timeout, management strategy, etc. However, how to properly allocate these parameters is a huge challenge for developers. This is because the adjustment of parameters will affect many aspects of the system, such as memory, CPU, interface response time, system throughput, etc., showing the characteristics of a single move affecting the entire system.
[0036] Pooling technology parameters are difficult to tune:
[0037] Complexity of parameter settings: The setting of pooling parameters requires comprehensive consideration of multiple factors, such as system load, resource limitations, business requirements, etc. Improper parameter settings may lead to resource waste, performance bottlenecks, or system instability.
[0038] Lack of universality: Different systems and different business scenarios have different requirements for pooling parameters. There is no one-size-fits-all parameter setting method that is applicable to all scenarios.
[0039] Empirical parameter tuning: Currently, pooling parameter tuning mainly relies on the experience and trial and error of developers, lacking a scientific and systematic tuning method.
[0040] Dynamic adjustment of parameters: System load changes dynamically, and statically configured pooling parameters may not be able to adapt to load changes, resulting in low resource utilization or degraded system performance.
[0041] Complexity of the tuning process: Parameter tuning affects many aspects of the system, such as response time, throughput, memory usage, etc. The evaluation of the effect of parameter adjustment requires comprehensive consideration of multiple indicators.
[0042] Reference Figure 1 , shows a flow chart of the steps of a resource pool control method provided in an embodiment of the present invention, which may specifically include the following steps:
[0043] Step 101, obtaining pooling parameters; the pooling parameters are used to control the resource pool running on the operating system;
[0044] Step 102, predicting the load of the resource pool of the operating system within a future preset time interval by using the pooling parameters;
[0045] Step 103, calculating a target pooling parameter for the resource pool based on the load condition;
[0046] Step 104: Use the target pooling parameters to control the resource pool.
[0047] In an embodiment of the present invention, a pooling parameter may be obtained; the pooling parameter is used to control a resource pool running on an operating system;
[0048] Resource Pool can be understood as a shared resource collection that can be used by multiple users or applications. It is like a large pool filled with various resources, such as CPU, memory, disk space, network bandwidth, etc. When a new task needs to be executed, the system will allocate the required resources from the resource pool. After the task is completed, the resources will be returned to the resource pool for use by other tasks.
[0049] The purpose of using resource pools is to:
[0050] Improve resource utilization: Multiple tasks share resources, avoiding resource idleness.
[0051] Simplify resource management: Centralize resource management to reduce management complexity.
[0052] Improve system stability: By allocating resources reasonably, avoid a single task taking up too many resources and causing the system to crash.
[0053] Pooling parameters
[0054] Pooling parameters are a set of parameters used to control the behavior of resource pools. Different resource pools have different pooling parameters, but generally speaking, pooling parameters involve the following aspects:
[0055] Pool size: The maximum number or total capacity of resources in the pool.
[0056] Allocation strategy: The strategy for allocating resources when multiple tasks request resources at the same time (such as first come first served, priority allocation, etc.).
[0057] Recycling strategy: The strategy for how to recycle resources after they are used up (such as immediate recycling, delayed recycling, etc.).
[0058] Timeout setting: The timeout period for resource allocation. If this period is exceeded, the resources will be automatically released.
[0059] Growth strategy: The strategy for increasing resources when resources in the resource pool are insufficient.
[0060] Reduction strategy: The strategy for reducing resources when there are too many resources in the resource pool.
[0061] Examples of pooling parameters are as follows:
[0062] Thread pool: corePoolSize (number of core threads), maximumPoolSize (maximum number of threads), keepAliveTime (thread idle time), workQueue (task queue), etc.
[0063] Connection pool: initialSize (initial number of connections), maxActive (maximum number of connections), maxIdle (maximum number of idle connections), etc.
[0064] Properly setting the pooling parameters is crucial to the performance and stability of the system. If the parameters are set too small, it may lead to insufficient resources and affect system performance; if the parameters are set too large, it will cause a waste of resources.
[0065] Resource pool and pooling parameters are important concepts in resource management. By properly setting pooling parameters, you can effectively manage system resources and improve system performance and stability.
[0066] In an embodiment of the present invention, the pooling parameters can be used to predict the load conditions of the resource pool of the operating system within a preset time interval in the future; in order to understand the configuration status of the current resource pool, baseline construction can be achieved, basic data can be provided for subsequent load prediction and parameter adjustment, a benchmark can be provided for subsequent comparison and analysis, and at the same time, input can be provided for prediction. The current pooling parameters are one of the inputs of the prediction model, which is used to predict future load conditions.
[0067] The load of the operating system is simply a measure of how busy the system is. It reflects the amount of tasks the system is processing, the resource usage, and the overall operating status of the system.
[0068] Performance under high load:
[0069] Slow response: User operations or program execution speed slows down.
[0070] High resource usage: CPU, memory, disk I / O and other resource utilization rates are very high.
[0071] System instability: Frequent freezes and crashes.
[0072] Performance under low load:
[0073] System Idle: Resource utilization is low and the system responds quickly.
[0074] Load indicators:
[0075] Load Average:
[0076] Indicates the average number of processes in the system that are in a runnable or uninterruptible state over a period of time.
[0077] It is usually expressed in terms of average load over 1 minute, 5 minutes, and 15 minutes.
[0078] The larger the load value, the busier the system is.
[0079] CPU Utilization:
[0080] Indicates the CPU usage.
[0081] Under heavy load, CPU utilization is usually high.
[0082] Memory usage:
[0083] Indicates memory usage.
[0084] Under heavy load, memory usage may be high.
[0085] Disk I / O:
[0086] Indicates the read and write status of the disk.
[0087] Under heavy load, disk I / O may be high.
[0088] Network traffic:
[0089] Indicates the amount of data transmitted on the network.
[0090] Under heavy load, network traffic may be high.
[0091] Factors affecting load:
[0092] Number of running processes: The more processes there are, the higher the load will generally be.
[0093] Process type: CPU-intensive processes and I / O-intensive processes occupy different amounts of system resources.
[0094] Hardware configuration: The performance of hardware such as CPU, memory, and disk directly affects the system load.
[0095] Network conditions: Network bandwidth, latency, etc. affect network I / O, which in turn affects system load.
[0096] Software configuration: operating system kernel parameters, application configuration, etc. will affect the system load.
[0097] How to view the load:
[0098] Linux:
[0099] uptime: View system uptime and average load.
[0100] top: Displays system processes, CPU utilization, memory usage, and other information in real time.
[0101] htop: An interactive process viewer that is more beautiful and more powerful than top.
[0102] vmstat: Displays virtual memory statistics.
[0103] iostat: Displays I / O statistics.
[0104] Windows:
[0105] Task Manager: View the usage of CPU, memory, disk and other resources.
[0106] Performance Monitor: Provides more detailed system performance data.
[0107] The load of the operating system is an important indicator of the system's operating status. By understanding the load, you can better manage the system and improve system performance and stability.
[0108] In an embodiment of the present invention, the target pooling parameters for the resource pool can be calculated based on the load conditions; the load conditions of the resource pool in the future can be predicted so that adjustments can be made in advance, thereby achieving early warning, and potential over- or under-load conditions can be discovered in advance so that corresponding measures can be taken; and resource utilization can be optimized. Through prediction, resource allocation can be adjusted in advance to improve resource utilization; and resource bottlenecks can be avoided. By predicting the load in advance, the occurrence of resource bottlenecks can be avoided and the stability of the system can be ensured.
[0109] In an embodiment of the present invention, the target pooling parameters can be used to control the resource pool so that the calculated target pooling parameters can be applied to the resource pool to achieve dynamic adjustment of resources, thereby improving resource utilization. By dynamically adjusting the pooling parameters, system resources can be fully utilized and the service quality is guaranteed, ensuring that the system can provide stable services under various load conditions.
[0110] In an embodiment of the present invention, pooling parameters are obtained; the pooling parameters are used to control a resource pool running on an operating system; the load condition of the resource pool of the operating system within a future preset time interval is predicted by the pooling parameters; target pooling parameters for the resource pool are calculated based on the load condition; and the resource pool is controlled by the target pooling parameters, thereby improving the adjustment efficiency of the pooling parameters and also improving the control efficiency of the resource pool.
[0111] Based on the above embodiment, a variant embodiment of the above embodiment is proposed. It should be noted that in order to make the description concise, only the differences from the above embodiment are described in the variant embodiment.
[0112] In an optional embodiment of the present invention, the step of obtaining pooling parameters includes:
[0113] Get pooling parameters and system operation parameters.
[0114] In a specific implementation, the embodiment of the present invention may first perform data collection, and the pooling parameters may be real-time pooling parameters and / or historical pooling parameters;
[0115] In addition to pooling parameters, system operation parameters also need to be collected, such as, but not limited to, system resource usage (CPU, memory, disk I / O), network traffic, task queue length, etc.
[0116] In the process of pooling parameter tuning, in addition to pooling parameters, it is also necessary to collect a variety of system operation parameters. The main purpose is to:
[0117] Build a more comprehensive system model: Pooled parameters alone cannot fully reflect the operating status of the system. By collecting other system parameters, a more complete and accurate system model can be built, providing a more solid foundation for subsequent load prediction and parameter tuning.
[0118] Improved prediction accuracy: Different system parameters affect load to different degrees. For example, high CPU utilization may mean a high system load, while the task queue length reflects the number of pending tasks. By taking multiple parameters into account, future load conditions can be predicted more accurately.
[0119] Discover potential problems: By analyzing the system operating parameters, some potential problems can be discovered. For example, excessive disk I / O may cause slow system response, and abnormal network traffic may affect system stability.
[0120] Optimize parameter tuning strategy: Different system parameters have different effects on the adjustment of pooling parameters. By analyzing the relationship between these parameters, a more scientific and effective parameter tuning strategy can be formulated.
[0121] The benefits of obtaining pooling parameters and system operating parameters include:
[0122] Improve system performance: Through more accurate load prediction and parameter tuning, resource allocation can be optimized and system performance can be improved.
[0123] Enhance system stability: timely detect and resolve potential problems to avoid system failures.
[0124] Reduce operation and maintenance costs: Through intelligent operation and maintenance, reduce manual intervention and reduce operation and maintenance costs.
[0125] Improve user experience: The optimized system can provide more stable and faster response, improving user experience.
[0126] Specific examples:
[0127] CPU utilization: reflects the usage of system computing resources and is an important indicator for measuring system load.
[0128] Memory usage: reflects the usage of system memory resources. Excessive memory usage may lead to system performance degradation.
[0129] Disk I / O: reflects the frequency and speed of disk read and write operations. Excessive disk I / O may cause slow system response.
[0130] Network traffic: reflects the amount of data transmitted over the network. Excessive network traffic may affect system performance.
[0131] Task queue length: reflects the number of tasks to be processed and can be used as an important indicator to predict changes in system load.
[0132] By collecting a variety of system operating parameters, a more comprehensive system model can be established, the accuracy of load prediction can be improved, and a more reliable basis can be provided for the dynamic adjustment of pooling parameters, thereby realizing intelligent management of the system.
[0133] In an optional embodiment of the present invention, the step of predicting the load condition of the resource pool of the operating system in a future preset time interval by using the pooling parameters includes:
[0134] Obtaining a training set and determining an initial target model; the training set includes training pooling parameters;
[0135] Training an initial target model based on the training pooling parameters to generate a target model to determine a mapping relationship between the initial target model and a target load condition;
[0136] Based on the mapping relationship, a load condition corresponding to the pooling parameter and the system operation parameter is predicted.
[0137] In a specific implementation, an embodiment of the present invention can obtain a training set and determine an initial target model, and use the training set to provide the model with sample data for learning, so that the model can learn the relationship between the pooling parameters and the system load, and define the prediction target. The initial target model is the basis of the prediction. It determines the type and accuracy of the load that the model can predict, thereby providing data support for the model. Sufficient and high-quality training data is a prerequisite for accurate model prediction; and the prediction direction is determined. The initial target model clarifies the prediction target and provides direction for subsequent training and prediction.
[0138] Data Collection: Collect historical data, including:
[0139] Pooling parameters: Pooling parameters at different time points (such as maximum number of connections, minimum number of idle connections, etc.).
[0140] System operating parameters: CPU utilization, memory usage, disk I / O, network traffic, task queue length, etc.
[0141] Load status: The actual load of the operating system, which can be CPU load, memory usage, response time, etc.
[0142] Data cleaning: Process missing values and outliers to ensure data quality.
[0143] Feature engineering: extract features that are useful for prediction, such as time features, periodic features, trend features, etc.
[0144] Determine the initial target model: Select an appropriate model based on the characteristics of the data and the prediction objectives.
[0145] Common models include:
[0146] Linear regression: Applicable to data with linear relationships.
[0147] Decision tree: can handle nonlinear relationships and is suitable for classification and regression problems.
[0148] Support Vector Machine (SVM): Suitable for high-dimensional data and non-linear classification.
[0149] Neural networks: specifically recurrent neural networks (RNNs) and long short-term memory networks (LSTMs), suitable for time series data.
[0150] 2. Based on the training pooling parameters, the initial target model is trained to generate a target model to determine the mapping relationship between the initial target model and the target load condition. Through training, the model learns the complex relationship between the pooling parameters and the load, so that the corresponding load can be predicted according to the given pooling parameters; thus, the prediction basis is determined. The first target model establishes the mapping relationship between the pooling parameters and the load, providing a basic model for subsequent predictions. It also provides a basis for model optimization. By evaluating the prediction effect of the first target model, the model structure, parameters, etc. can be adjusted to improve the prediction accuracy.
[0151] Divide the data set: Divide the data into training set, validation set and test set.
[0152] Training model: Use the training set to train the initial target model and learn the mapping relationship between pooling parameters and load.
[0153] Model evaluation: Use the validation set to evaluate the performance of the model and adjust the model hyperparameters until satisfactory results are achieved.
[0154] 3. Predict the load based on the mapping relationship. Use the trained model to input the pooling parameters and system operation parameters into the model to obtain the predicted load situation, thereby providing a basis for resource management. The predicted load situation can provide a reference for the allocation and scheduling of system resources, avoid waste or shortage of resources, and realize intelligent operation and maintenance. Through prediction, the load change trend of the system can be predicted in advance, and active resource management can be carried out to improve system performance and stability.
[0155] Input data: The pooling parameters and system operation parameters are used as input to the trained model.
[0156] Model prediction: The model predicts the system load in the future based on the input data.
[0157] Output results: The output of the model is the predicted load situation, which can be a specific value or a probability distribution of the load.
[0158] By obtaining a training set and determining an initial target model; the training set includes training pooling parameters; training the initial target model based on the training pooling parameters to generate a target model to determine the mapping relationship between the initial target model and the target load condition; based on the mapping relationship, predicting the load condition corresponding to the pooling parameters and the system operating parameters. These three steps together constitute a complete load prediction process. By obtaining historical data, training models, and establishing mapping relationships, the prediction of future loads is ultimately achieved. The purpose of this process is to establish a model that can accurately predict system loads and provide decision support for system resource management.
[0159] Exemplarily, in the load prediction stage, the embodiment of the present invention can predict the load condition of the system in the future period of time based on the current pooling parameters, as follows.
[0160] Data collection: In addition to pooling parameters, other relevant data also needs to be collected, such as system resource usage (CPU, memory, disk I / O), network traffic, task queue length, etc.
[0161] Feature engineering: Process the collected data to extract features that are useful for load forecasting. For example, historical data can be normalized and smoothed to extract features such as periodicity and trend.
[0162] Initial target model selection: Select a suitable forecasting model. Considering the characteristics of time series data, ARIMA, SARIMA, LSTM, GRU and other models are commonly used.
[0163] Model training: Use historical data as a training set to train the initial target model, obtain the target model, and establish a mapping relationship between the target model and the load.
[0164] Model training can be implemented in the following ways:
[0165] Determine the target variable: Identify the target to be predicted, such as system load, resource utilization, etc.
[0166] Divide the data set: Divide the data into training set, validation set and test set. The training set is used to train the model, the validation set is used to adjust the model hyperparameters, and the test set is used to evaluate the generalization ability of the model.
[0167] Select loss function: Select an appropriate loss function according to the characteristics of the prediction problem, such as mean square error (MSE), mean absolute error (MAE), etc.
[0168] Train model: Use the selected model and loss function to train the model using the training set.
[0169] Model evaluation: Use the validation set to evaluate the performance of the model and adjust the model hyperparameters until satisfactory results are achieved.
[0170] Establish the mapping relationship between the model and the load:
[0171] Model output: The trained target model can predict future loads based on input features.
[0172] Mapping relationship: A mapping relationship is established between the output of the target model and the actual load, that is, the target model can predict the corresponding load value based on the input features.
[0173] Prediction: Input the pooling parameters and system operation parameters into the trained target model to obtain the load prediction results of the system in the future.
[0174] In an optional embodiment of the present invention, the step of calculating the target pooling parameter for the resource pool based on the load condition includes:
[0175] Determine load thresholds;
[0176] Calculate the initial target pooling parameters based on the load conditions and load threshold;
[0177] When the initial target pooling parameter meets the preset condition, it is determined as the target pooling parameter.
[0178] In a specific implementation, the embodiment of the present invention can set the target pooling parameters in the following manner.
[0179] 1. Determine the load threshold:
[0180] Purpose:
[0181] Divide load intervals: Divide different load levels into different intervals so that different pooling strategies can be adopted for different load levels.
[0182] Trigger parameter adjustment: When the system load exceeds or falls below the set threshold, the pooling parameters are adjusted.
[0183] Determining the load threshold is a critical step in resource pool management, which directly affects the performance and stability of the system. Here are some common methods for determining the load threshold:
[0184] Historical data analysis:
[0185] Peak analysis: Analyze the peak load of the system in historical data and use the peak load as a reference point for the threshold.
[0186] Average load analysis: Calculate the average load over a period of time and set a threshold higher than the average load to cope with sudden loads.
[0187] Standard Deviation Analysis: Calculate the standard deviation of the load data and set a threshold several standard deviations above the average load to cope with load fluctuations.
[0188] Performance Testing:
[0189] Load testing: Gradually increase the system load, observe changes in system performance, and determine the maximum load the system can withstand.
[0190] Stress testing: By simulating extreme load conditions, the stability of the system under high load is tested to determine the system's collapse point.
[0191] Resource utilization monitoring:
[0192] CPU utilization: Set a CPU utilization threshold. When the CPU utilization exceeds the threshold, it indicates that the system load is high.
[0193] Memory usage: Set a memory usage threshold. When the memory usage exceeds the threshold, it indicates that the system memory resources are insufficient.
[0194] Disk I / O: Set a disk I / O threshold. When the disk I / O is too high, it means that the disk becomes the bottleneck of the system.
[0195] Network traffic: Set a network traffic threshold. When the network traffic is too high, it means that the network has become the bottleneck of the system.
[0196] Business indicator monitoring:
[0197] Response time: Set a response time threshold. When the response time exceeds the threshold, it indicates that the system performance has deteriorated.
[0198] Error rate: Set an error rate threshold. When the error rate exceeds the threshold, it indicates that there is a problem with the system.
[0199] Throughput: Set a throughput threshold. When the throughput is lower than the threshold, it indicates that the system processing capacity is insufficient.
[0200] Empirical judgment: Based on past experience and understanding of the system, manually set a reasonable threshold.
[0201] Machine Learning:
[0202] Anomaly detection: Use machine learning algorithms to analyze historical data, identify abnormal load conditions, and set corresponding thresholds.
[0203] Factors that affect load threshold setting include:
[0204] System type: Different system types have different load bearing capabilities.
[0205] Business characteristics: Different businesses have different requirements on system load.
[0206] Hardware configuration: The level of hardware configuration determines the processing power of the system.
[0207] Software configuration: The degree of optimization of software configuration affects the performance of the system.
[0208] Dynamic adjustment: The load threshold is not static and needs to be adjusted dynamically according to the system's operating conditions.
[0209] Comprehensive consideration: Determining the load threshold requires comprehensive consideration of multiple factors and cannot rely solely on a single indicator.
[0210] Leave margin: To cope with unexpected events, you can leave a certain margin when setting the threshold.
[0211] Beneficial effects:
[0212] Refined management: Adopt different pooling strategies for different load scenarios to improve resource utilization.
[0213] Avoid over-adjustment: Avoid frequent adjustment of pooling parameters to reduce system jitter.
[0214] 2. Calculate the initial target pooling parameters based on the load conditions and load threshold:
[0215] Purpose:
[0216] Determine the adjustment direction: Determine the direction of pooling parameter adjustment (increase, decrease, or remain unchanged) based on the current load conditions and the set threshold.
[0217] Calculate target values: Calculate the initial target pooling parameters that match the current load conditions.
[0218] Beneficial effects:
[0219] Real-time response: Dynamically adjust pooling parameters according to the real-time system load to improve system adaptability.
[0220] Optimize resource allocation: Optimize resource allocation and improve system performance by adjusting pooling parameters.
[0221] 3. When the initial target pooling parameters meet the preset conditions, they are determined as the target pooling parameters:
[0222] Purpose:
[0223] Ensure parameter stability: Prevent frequent fluctuations in pooling parameters that affect system stability.
[0224] Avoid over-tuning: Avoid over-tuning pooling parameters, which can lead to a waste of system resources.
[0225] Beneficial effects:
[0226] Improve system stability: Reduce the frequent adjustment of pooling parameters and improve system stability.
[0227] Reduce system overhead: Reduce unnecessary parameter adjustments and reduce system overhead.
[0228] In practical applications, the initial target pooling parameters are determined as the final target pooling parameters without readjustment, and the following conditions need to be met:
[0229] 1. High prediction accuracy:
[0230] Model evaluation indicators are good: Use appropriate evaluation indicators (such as mean square error, mean absolute error, etc.) to evaluate the model's prediction results. If the prediction error is small, it means that the model has a high accuracy in predicting the load.
[0231] High consistency with actual load: Compare the predicted results with the actual system load. If the two are highly consistent, it means that the model's prediction results are reliable.
[0232] 2. Good system stability:
[0233] Small parameter adjustment: After multiple consecutive predictions, the adjustment of the pooling parameters is small, indicating that the system has reached a stable state.
[0234] Reasonable system resource utilization: After the pooling parameters are adjusted, the utilization of the system's CPU, memory, disk and other resources remains within a reasonable range, and there is no resource bottleneck or resource waste.
[0235] 3. Business needs met:
[0236] Response time meets requirements: the system can respond to user requests within the specified time.
[0237] Throughput meets requirements: The system can handle the expected business volume.
[0238] Low error rate: The error rate of the system remains within an acceptable range.
[0239] 4. Strong interpretability:
[0240] The logic of parameter adjustment is clear: The adjustment logic of the pooling parameters is clear and explainable, and you can understand why such adjustments are made.
[0241] The reason for parameter adjustment can be traced back: when a problem occurs, the reason for the parameter adjustment that caused the problem can be traced back.
[0242] 5. Strong robustness:
[0243] Insensitive to noise: The model is insensitive to the noise of the input data and can suppress the impact of noise to a certain extent.
[0244] Strong adaptability to environmental changes: The model can adapt to changes in the system environment, such as sudden changes in load, changes in hardware configuration, etc.
[0245] 6. Other conditions:
[0246] Comply with system design constraints: The setting of pooling parameters needs to comply with the system's hardware limitations, software architecture and other constraints.
[0247] Comply with business demand constraints: The setting of pooling parameters needs to meet the business requirements for system performance, stability, etc.
[0248] The process of determining the initial target pooling parameters as the final target pooling parameters is generally as follows:
[0249] Training model: Use historical data to train the model and establish a mapping relationship between pooling parameters and system load.
[0250] Model evaluation: Use the validation set to evaluate the performance of the model and select the model with the best performance.
[0251] Online verification: Deploy the model to the production environment, perform online verification, and observe the prediction effect of the model.
[0252] Parameter adjustment: Fine-tune the model parameters based on the online verification results.
[0253] Stability test: Conduct a long-term stability test on the system to observe the system's operating status.
[0254] Determine after conditions are met: If the model prediction is accurate, the system is stable, and business requirements are met, the current pooling parameters will be determined as the final target pooling parameters.
[0255] Optionally, dynamic adjustments can also be made: even if the target pooling parameters are determined, they still need to be monitored and adjusted regularly to adapt to changes in the system environment.
[0256] Feedback mechanism: Establish a sound feedback mechanism to identify problems and make adjustments in a timely manner.
[0257] Continuous optimization: As the system continues to develop, the model needs to be continuously optimized to improve the performance and stability of the system.
[0258] Determining the initial target pooling parameters as the final target pooling parameters is a comprehensive judgment process that requires comprehensive consideration of multiple factors such as the prediction accuracy of the model, system stability, business requirements, interpretability, robustness, etc. Only when the model can meet these conditions can it be determined as the final target pooling parameters to ensure the long-term stable operation of the system.
[0259] In the embodiment of the present invention, a load threshold is determined; an initial target pooling parameter is calculated according to the load condition and the load threshold; when the initial target pooling parameter meets the preset conditions, it is determined as the target pooling parameter. These three steps together constitute a complete pooling parameter adjustment process. By setting a reasonable load threshold and dynamically adjusting the pooling parameters according to the load condition, refined management of system resources can be achieved, and system performance and stability can be improved.
[0260] Exemplarily, in the target pooling parameter calculation stage, the embodiment of the present invention can calculate the target pooling parameters that are most suitable for the system according to the predicted load conditions, as follows.
[0261] Load threshold setting: Set different load thresholds to correspond to different pooling parameter configurations. For example, when the load exceeds a certain threshold, increase the pool size; when the load is below a certain threshold, reduce the pool size.
[0262] Optimization algorithm: Optimization algorithms such as reinforcement learning and genetic algorithms can be used to search for the optimal combination of pooling parameters based on the predicted load and current pooling parameters.
[0263] Adaptive adjustment: Based on the prediction results and actual load conditions, the pooling parameters are continuously adjusted to achieve dynamic balance.
[0264] Specific implementation steps:
[0265] Data preparation: Collect historical data and real-time data, and perform cleaning and preprocessing.
[0266] Feature engineering: Extract load-related features, such as historical load data, system resource usage, and external factors (such as holidays and promotions).
[0267] Model training: Select a suitable model, train it using historical data, and evaluate model performance.
[0268] Real-time prediction: Input real-time data into the trained model to obtain load prediction results for a period of time in the future.
[0269] Parameter calculation: Calculate the target pooling parameters based on the prediction results and the preset load threshold.
[0270] Parameter adjustment: Apply the calculated target pooling parameters to the system.
[0271] Feedback mechanism: monitor the actual operation of the system, feed new data back to the model, and continuously optimize the model.
[0272] Precautions
[0273] Model selection: Choosing a suitable model is crucial to prediction accuracy. You need to choose a suitable model based on the characteristics of the data and the prediction target.
[0274] Feature Engineering: The quality of feature engineering directly affects the performance of the model. Features need to be carefully selected and extracted.
[0275] Parameter tuning: The parameters of the model need to be fine-tuned to achieve the best results.
[0276] Feedback mechanism: timely feedback on system operation status, continuous optimization of the model, and improvement of prediction accuracy.
[0277] Challenges and Optimization
[0278] Data quality: The quality of data directly affects the accuracy of prediction. Data needs to be cleaned and preprocessed.
[0279] Model complexity: An overly complex model may lead to overfitting and reduce the generalization ability of the model.
[0280] Real-time: Real-time prediction requires low latency.
[0281] Robustness: The model needs to be robust to noise and abnormal data.
[0282] By predicting pooling parameters and calculating target pooling parameters, dynamic management of system resources can be achieved to improve system performance and stability. However, this requires comprehensive consideration of multiple factors, including data quality, model selection, parameter tuning, etc.
[0283] In an optional embodiment of the present invention, after the step of obtaining the pooling parameters and the system operation parameters, the method further includes:
[0284] Perform data cleaning and preprocessing operations, and / or time series analysis operations, and / or anomaly detection operations, and / or clustering analysis operations, and / or correlation analysis operations on the acquired pooling parameters and the system operation parameters.
[0285] In a specific implementation, the embodiment of the present invention can perform in-depth analysis on the collected pooling parameters and system operation parameters to discover potential patterns and trends and provide support for subsequent prediction models.
[0286] Specific steps:
[0287] 1. Data cleaning and preprocessing:
[0288] Missing value handling: Fill missing values using methods such as interpolation, deletion, or prediction.
[0289] Outlier detection: Use box plots, Z-score and other methods to detect and process outliers.
[0290] Data conversion: normalize and standardize the data to make it meet the requirements of the model.
[0291] Feature selection: Select features that are more closely related to the target variable (such as system load) from a large number of features.
[0292] 2. Time Series Analysis:
[0293] Stationarity test: Determine whether the time series is stationary. If not, perform differentiation or transformation.
[0294] Trend analysis: Analyze the long-term trend of the time series to determine the overall change trend of the system load.
[0295] Seasonal analysis: Analyze seasonal fluctuations in time series, such as daily, weekly, monthly, and other periodic changes.
[0296] Periodicity analysis: Discover periodic components in time series, such as business peaks and troughs.
[0297] 3. Anomaly Detection:
[0298] Statistical methods: Z-score, box plot and other methods to detect outliers.
[0299] Machine learning-based methods: Isolation Forest, One-Class SVM and other methods are used to detect anomalies.
[0300] Rule-based approach: Set thresholds based on business knowledge to detect anomalies.
[0301] 4. Cluster analysis:
[0302] K-means clustering: cluster similar data points into one category to discover the inherent structure in the data.
[0303] Hierarchical clustering: Build a hierarchical structure based on the similarity of data and discover the hierarchical relationship between data.
[0304] Density Clustering: Finds clusters of arbitrary shapes, suitable for non-convex datasets.
[0305] 5. Correlation analysis:
[0306] Pearson correlation coefficient: calculates the linear correlation between different variables.
[0307] Spearman correlation coefficient: Calculates the rank correlation between different variables.
[0308] Mutual Information: Measures the interdependence between variables.
[0309] Specific analysis of pooling parameters and system operation parameters
[0310] The relationship between pooling parameters and system load:
[0311] Analyze the utilization of system resources such as CPU, memory, and I / O under different pooling parameter settings.
[0312] Explore the relationship between pooling parameters and system response time and throughput.
[0313] Periodic changes in system operating parameters:
[0314] Analyze the periodic changes in system load within a day, a week, or a month.
[0315] Find cyclical patterns associated with business activities.
[0316] Impact of abnormal events:
[0317] Analyze the impact of abnormal events such as system failures and network failures on pooling parameters and system load.
[0318] The effects of different pooling strategies:
[0319] Compare the impact of different pooling strategies (such as fixed size, dynamic adjustment, etc.) on system performance.
[0320] Through in-depth analysis of historical data, we can discover the complex relationship between pooling parameters and system operating parameters, and extract valuable information to support subsequent prediction models. This information can help us better understand the behavior of the system, thereby optimizing pooling parameters and improving system performance and stability.
[0321] Specifically, the purpose of performing the above operations is to:
[0322] Understand system behavior: understand how the system performs under different loads; discover the periodic patterns of system operation; identify anomalies in the system.
[0323] Optimize pooling parameters: find the pooling parameter settings that best suit the current system load; improve system resource utilization; and reduce system response time.
[0324] Predict the future state of the system: predict the peak and valley values of system load; provide early warning of potential system problems.
[0325] Improve system design: discover system design flaws; provide suggestions for optimizing system design; the specific role of each operation.
[0326] Data cleaning and preprocessing: ensure data quality, remove noise and outliers, and provide a reliable data foundation for subsequent analysis.
[0327] Time series analysis: Discovering trends, seasonality, periodicity, and other patterns in data helps us understand how the system changes over time.
[0328] Anomaly detection: Identify abnormal events in the system, such as failures, attacks, etc., so that timely measures can be taken.
[0329] Cluster analysis: clustering similar data points into one category to discover the inherent structure in the data and help us understand the different operating states of the system.
[0330] Correlation analysis: Find the correlation between pooling parameters and system operating parameters, and understand the impact of parameter adjustment on system performance.
[0331] In an optional embodiment of the present invention, the step of controlling the resource pool by using the target pooling parameter includes:
[0332] When it is determined through the load condition that the CPU utilization is greater than a preset utilization threshold, increasing the thread pool size based on the target pooling parameter;
[0333] When it is determined through the load condition that the memory usage is greater than a preset usage threshold, the connection pool size is reduced based on the target pooling parameter.
[0334] Exemplarily, controlling the resource pool using target pooling parameters may be achieved in the following manner.
[0335] 1. Real-time monitoring of system load: continuously collect key performance indicators such as CPU utilization, memory usage, network traffic, etc. and pre-process the collected data, such as denoising and smoothing.
[0336] 2. Load forecasting: Select appropriate forecasting models (such as ARIMA, LSTM, Prophet, etc.) based on historical data and business characteristics. Use historical data to train the forecasting model so that it can accurately predict future system loads. Input the real-time collected data into the trained model to obtain the forecast value of the system load in the future.
[0337] 3. Compare predicted values with thresholds: Preset thresholds for CPU utilization and memory usage as conditions for triggering parameter adjustments. Compare the predicted CPU utilization and memory usage with the preset thresholds.
[0338] 4. Adjust pooling parameters based on prediction results: When the CPU utilization rate exceeds the preset utilization rate threshold as determined by the load situation, the thread pool size is increased based on the target pooling parameters to improve the concurrent processing capability of the system. When the memory usage rate exceeds the preset utilization rate threshold as determined by the load situation, the connection pool size is reduced based on the target pooling parameters to release memory resources. Depending on different pooling strategies and system requirements, other pooling parameters may also need to be adjusted, such as the database connection pool size, cache pool size, etc.
[0339] 5. Feedback mechanism: Evaluate the effect of parameter adjustment by comparing the system performance indicators before and after adjustment. According to the feedback results, optimize the prediction model to improve the prediction accuracy.
[0340] Combined with the specific scenario given, the above steps can be concretized as follows:
[0341] Scenario 1: CPU usage is too high
[0342] Trigger condition: The predicted CPU utilization exceeds 80%.
[0343] Tuning Action: Increase the thread pool size from 10 to 15.
[0344] Expected effect: Improve the system's concurrent processing capabilities and reduce task response time.
[0345] Scenario 2: Memory usage is too high
[0346] Trigger condition: Predicted memory usage exceeds 90%.
[0347] Tuning action: Reduce the database connection pool size from 50 to 40.
[0348] Expected effect: Release some memory resources to prevent the system from memory overflow.
[0349] Optionally:
[0350] Threshold setting: The setting of thresholds requires comprehensive consideration of the system's hardware resources, business requirements, and fault tolerance.
[0351] Parameter adjustment range: The parameter adjustment range should not be too large to avoid causing system instability.
[0352] Feedback mechanism: Establish a perfect feedback mechanism and adjust parameters in time to ensure that the system is always in the best condition.
[0353] In this way, we can achieve dynamic adjustment of pooling parameters, so that the system can adaptively adjust resource allocation according to load changes, thereby improving system performance and stability.
[0354] Optionally, after the step of controlling the resource pool by using the target pooling parameter, the method further includes:
[0355] Obtaining performance indicators of the operating system;
[0356] The target model is updated using the performance indicator and the target pooling parameter.
[0357] The embodiment of the present invention can establish a closed feedback loop, so that the system can continuously adjust and optimize itself according to the operation results.
[0358] Specifically, it can be achieved in the following ways.
[0359] Data collection: After each parameter adjustment, continuously collect various performance indicators of the system, such as response time, error rate, resource utilization, etc.
[0360] Log analysis: Analyze system logs and extract key information, such as abnormal situations, bottlenecks, etc.
[0361] Data analysis and comparison:
[0362] Comparative analysis: Compare the performance indicators after adjustment with the system operating parameters before adjustment to analyze the effect of parameter adjustment.
[0363] Anomaly detection: Detect whether new anomalies occur.
[0364] Model updates can be done in the following ways:
[0365] Data feedback: Feedback new performance metrics and target pooling parameters to the target model.
[0366] Target model training: Retrain the model using new performance metrics and target pooling parameters to update the parameters of the target model.
[0367] Model validation: Validate the updated model to ensure its predictive accuracy.
[0368] The parameter adjustment strategy optimization method is as follows:
[0369] Strategy evaluation: Evaluate whether the current parameter adjustment strategy is effective and whether there is room for improvement.
[0370] Strategy adjustment: Adjust parameter adjustment strategies based on feedback data, such as adjusting thresholds, adding new adjustment rules, etc.
[0371] Optimization example:
[0372] Scenario: After multiple parameter adjustments, the system finds that the prediction model has a large error in predicting peak load.
[0373] Optimization measures:
[0374] Add features: Add more features to the model, such as historical load change trends, seasonal factors, etc.
[0375] Adjust model structure: Try using more complex models such as LSTM or GRU to better capture the characteristics of time series data.
[0376] Tuning hyperparameters: Adjust the hyperparameters of the model, such as learning rate, number of hidden layers, etc.
[0377] The beneficial effects of parameter adjustment strategy optimization include:
[0378] Improve forecast accuracy: Through continuous feedback and optimization, the model can better adapt to system changes and improve forecast accuracy.
[0379] Enhance system adaptability: The system can automatically adjust parameters according to actual operating conditions to improve system adaptability.
[0380] Improve system performance: By optimizing parameter adjustment strategies, the performance of the system can be continuously improved.
[0381] Reduce manual intervention: Reduce manual intervention and improve the automation level of the system.
[0382] System feedback and optimization are important parts of realizing intelligent systems. By establishing a closed feedback loop, the system can continuously learn and improve, thereby achieving better performance. This process is a process of continuous optimization and iteration.
[0383] In order to enable those skilled in the art to better understand the embodiments of the present invention, a complete example is used below to illustrate the embodiments of the present invention.
[0384] refer to Figure 2 and Figure 3 , Figure 2 It is a schematic diagram of an artificial intelligence pooling parameter tuning architecture provided in an embodiment of the present invention; Figure 3 is a flow chart of a resource pool control method provided in an embodiment of the present invention;
[0385] The pooling parameter tuning architecture of artificial intelligence includes the following modules:
[0386] 1. Application service module:
[0387] As the executor of pooling parameters, the application service module is responsible for executing various operations of pooling parameters. This module plays a key role in dynamically adjusting pooling parameters and is suitable for software services such as thread pools in Java services.
[0388] The system changes generated by the application service module will be fed back to the algorithm module through the acquisition module, forming an adaptive closed-loop system. This closed-loop system can intelligently and in real time adjust the pooling parameters to adapt to the ever-changing system operating environment.
[0389] 2. Collection module:
[0390] The acquisition module is the starting point of the present invention, responsible for real-time acquisition of various system parameters, including CPU utilization, memory usage, interface response time, system throughput, etc., and also collects hardware information related to the system environment. These data are used as inputs to the algorithm module to analyze the system status and make corresponding optimization suggestions.
[0391] The collection module can use external services, based on agent collection + message queue reporting, to complete data collection without interfering with the original service. This non-intrusive data collection method can ensure the stable operation of the system.
[0392] 3. Algorithm module:
[0393] The algorithm module is the core of this system and plays an important role in the artificial intelligence model. It receives the real-time pooling parameters passed in by the acquisition module, judges the current state of the system through intelligent analysis, and intelligently derives the optimal pooling parameters. These optimal parameters will be transmitted to the parameter injection module to achieve dynamic adjustment of the pooling parameters.
[0394] (1) Real-time algorithm:
[0395] According to the current operating state of the system, its most recent parameters are calculated. In the early stages of system operation, the algorithm module can be systematically trained according to the characteristics and needs of specific industry fields. After running for a period of time, the application status feedback of the best parameters previously output can be obtained to continuously correct the output of the current algorithm model. Through systematic training, the model can more accurately determine the best pooling parameters and provide more targeted suggestions for optimizing system performance.
[0396] (2) Prediction algorithm:
[0397] The algorithm model can not only make judgments based on the current system status, but also make predictions with the help of historical data from the same period. For example, at a certain time of day, the system may have a large number of scheduled tasks to execute, resulting in high system resource consumption. The algorithm model can predict this situation in advance and adjust the pooling parameters accordingly to prepare resources for the system. Similarly, during certain major promotional events each year (such as 618 and Double 11), system resource requirements will also increase, and the model can pre-adjust parameters to meet the needs of high resource consumption, thereby ensuring system stability and performance.
[0398] The prediction algorithm model can be based on the following:
[0399] a. Data collection and storage: First, a complete data collection and storage mechanism needs to be built to capture and store historical and current system operation data. These data should include but are not limited to system performance indicators such as CPU usage, memory occupancy, disk I / O, network I / O, and the specific execution status of various tasks. This step ensures that the algorithm model has sufficient data resources for subsequent analysis and optimization.
[0400] b. Data processing and analysis: In-depth processing and analysis of the collected historical data for the same period aims to discover the patterns and trends hidden in the data. This may involve statistical methods and machine learning algorithms such as time series analysis, anomaly detection, and cluster analysis. Through these analyses, the usage patterns and trends of system resources in similar time periods can be extracted to provide a basis for subsequent predictions.
[0401] c. Model construction and training: Based on the processed historical data of the same period, a forecasting model can be constructed, such as autoregressive integrated moving average model (ARIMA), support vector machine (SVM), neural network, etc. Then the historical data is used for model training to optimize the model parameters to improve the accuracy of the forecast.
[0402] d. Prediction: During system operation, the data collection module continuously collects the current system parameters and provides them as input to the trained model for real-time prediction. These prediction results will reveal the future resource usage trend of the system and provide decision support for the subsequent parameter adjustment.
[0403] e. Dynamic parameter adjustment: Based on the real-time prediction results, the algorithm module can dynamically adjust the pooling parameters. For example, if the prediction results show that the CPU usage will increase in the future, the thread pool size can be appropriately increased to avoid performance degradation due to insufficient CPU resources. Similarly, if the memory usage is predicted to increase, the process pool size can be adjusted to maintain the responsiveness of the system.
[0404] f. System feedback and optimization: After each parameter adjustment, the execution effect of the application service module will be fed back in real time through the data collection module. These feedback data can be used as further input for the optimization model to help the model correct the prediction results and parameter adjustment strategy. In this way, the system can continuously optimize its performance during operation.
[0405] 4. Parameter injection module:
[0406] The parameter injection module receives the optimal parameters calculated by the algorithm module and uses the corresponding software technology to dynamically change the pooling parameters in the application service module. The system changes caused by these changes in the application service module will be fed back to the algorithm module through the acquisition module, and finally a self-regulating closed-loop system will be realized.
[0407] 5. Management module:
[0408] The management module can interact directly with the above modules and is an important means of manual intervention in the entire system. It allows manual adjustment of some parameters to meet the needs of the system in specific situations. For example, when the system fails or an abnormal situation occurs, the management module can respond quickly and take corresponding measures to ensure the stability and availability of the system.
[0409] The design and implementation of the management module needs to take into account many factors, including but not limited to the scale, complexity, reliability, etc. of the system. It needs to have the following functions:
[0410] 1) Parameter configuration: The management module allows manual configuration of various parameters in the system, such as thread pool size, process pool size, task priority, etc. These parameters can be adjusted according to actual needs to meet different business scenarios and performance requirements.
[0411] 2) Fault handling: When the system fails or anomalies occur, the management module can respond quickly and take appropriate measures. For example, when a service fails, the management module can manually switch to other available service nodes to ensure the availability and stability of the system.
[0412] 3) Downgrade plan: When the algorithm module or other modules fail, the management module can be used as a downgrade plan to ensure the availability of the system. It can manually adjust parameters or take other measures to avoid system crashes or other serious problems.
[0413] 4) Monitoring and reporting: The management module can also monitor the operating status of the system, collect relevant system indicators and log information, and report and analyze them. This helps to promptly discover and solve problems in the system and provide corresponding data support to help optimize the performance and stability of the system.
[0414] The management module is an important means of manual intervention in the entire system. It can meet specific business needs, provide flexible parameter configuration, handle system failures and abnormal situations, and serve as a degradation plan to ensure system availability and stability. At the same time, it can also monitor the system's operating status and provide relevant data support and analysis results to help optimize system performance and stability.
[0415] Optimize thread pool parameters:
[0416] Assuming there is a Java Web application, in which a thread pool is used to process HTTP requests, the method of the present invention can be applied to optimize thread pool parameters to better adapt to real-time system load conditions.
[0417] 1) Application scenarios:
[0418] The web application's thread pool manages HTTP request processing.
[0419] The preset thread pool parameters may not be adequate for a particular load situation.
[0420] 2) Operation steps:
[0421] The application service module receives the real-time system parameters provided by the acquisition module.
[0422] The algorithm module analyzes the parameters and calculates the optimal thread pool parameters.
[0423] The parameter injection module dynamically injects the best parameters into the thread pool to achieve real-time adjustment.
[0424] 3) Effect:
[0425] Thread pool parameters are dynamically adjusted according to system load to improve system resource utilization.
[0426] Without having to deeply understand the principles of thread pools, developers can easily optimize thread pool effects.
[0427] Optimize the database connection pool:
[0428] Suppose there is a large database application and the database connection pool needs to be optimized to adapt to different database access requirements.
[0429] 1) Application scenarios:
[0430] Database applications use connection pools to access databases.
[0431] Database access requirements vary in different time periods.
[0432] 2) Operation steps:
[0433] The acquisition module collects real-time database connection request status and database performance parameters.
[0434] The algorithm module determines the current database load based on the collected data and gives the optimal connection pool parameters.
[0435] The parameter injection module injects the best parameters into the database connection pool.
[0436] 3) Effect:
[0437] Database connection pool parameters are optimized in real time to adapt to different database access requirements.
[0438] Improve database access efficiency and reduce database access waiting time.
[0439] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0440] Reference Figure 4 , shows a structural block diagram of a resource pool control device provided in an embodiment of the present invention, which may specifically include the following modules:
[0441] The pooling parameter acquisition module 401 is used to acquire pooling parameters; the pooling parameters are used to control the resource pool running on the operating system;
[0442] A load condition prediction module 402, configured to predict the load condition of the resource pool of the operating system within a future preset time interval by using the pooling parameters;
[0443] A target pooling parameter calculation module 403, configured to calculate a target pooling parameter for the resource pool based on the load condition;
[0444] The resource pool control module 404 is used to control the resource pool by using the target pooling parameter.
[0445] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0446] In addition, an embodiment of the present invention further provides an electronic device, such as Figure 5As shown, it includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.
[0447] Memory 503, used for storing computer programs;
[0448] The processor 501 is configured to implement the resource pool control method described in any one of the above embodiments when executing the program stored in the memory 503:
[0449] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0450] The communication interface is used for communication between the above terminal and other devices.
[0451] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0452] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0453] like Figure 6As shown, in another embodiment provided by the present invention, a computer-readable storage medium 601 is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the resource pool control method described in the above embodiment.
[0454] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
[0455] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0456] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0457] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0458] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0459] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0460] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0461] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A resource pool control method, characterized in that: include: Obtaining pooling parameters; the pooling parameters are used to control the resource pool running on the operating system; Predicting the load of the resource pool of the operating system within a future preset time interval by using the pooling parameters; Calculate a target pooling parameter for the resource pool based on the load condition; The target pooling parameters are used to control the resource pool.
2. The method according to claim 1, characterized in that The step of obtaining pooling parameters comprises: Get pooling parameters and system operation parameters.
3. The method according to claim 2, characterized in that The step of predicting the load of the resource pool of the operating system within a future preset time interval by using the pooling parameters includes: Obtaining a training set and determining an initial target model; the training set includes training pooling parameters; Training an initial target model based on the training pooling parameters to generate a target model to determine a mapping relationship between the initial target model and a target load condition; Based on the mapping relationship, a load condition corresponding to the pooling parameter and the system operation parameter is predicted.
4. The method according to claim 3, characterized in that The step of calculating the target pooling parameter for the resource pool based on the load condition comprises: Determine load thresholds; Calculate the initial target pooling parameters based on the load conditions and load threshold; When the initial target pooling parameter meets the preset condition, it is determined as the target pooling parameter.
5. The method according to claim 1, characterized in that After the step of obtaining the pooling parameters and the system operation parameters, the method further includes: Perform data cleaning and preprocessing operations, and / or time series analysis operations, and / or anomaly detection operations, and / or clustering analysis operations, and / or correlation analysis operations on the acquired pooling parameters and the system operation parameters.
6. The method according to claim 1, characterized in that The step of controlling the resource pool by using the target pooling parameter comprises: When it is determined through the load condition that the CPU utilization is greater than a preset utilization threshold, increasing the thread pool size based on the target pooling parameter; When it is determined through the load condition that the memory usage is greater than a preset usage threshold, the connection pool size is reduced based on the target pooling parameter.
7. The method according to claim 4, characterized in that After the step of controlling the resource pool by using the target pooling parameter, the method further includes: Obtaining performance indicators of the operating system; The target model is updated using the performance indicator and the target pooling parameter.
8. A resource pool control device, characterized in that: include: A pooling parameter acquisition module, used to acquire pooling parameters; the pooling parameters are used to control the resource pool running on the operating system; A load condition prediction module, used to predict the load condition of the resource pool of the operating system within a future preset time interval through the pooling parameters; A target pooling parameter calculation module, used to calculate a target pooling parameter for the resource pool based on the load condition; A resource pool control module is used to control the resource pool by using the target pooling parameter.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 7 when executing the program stored in the memory.
10. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 7.