Adaptive adjustment method and device for session number threshold, equipment and storage medium
Through the session threshold prediction model trained by machine learning algorithm, dynamically adjusts the number of sessions thresholds of the financial system, solving the performance bottlenecks and resource waste problems caused by fixed thresholds in traditional methods, and achieving efficient and stable operation of the system under different load conditions.
Patent Information
- Application Number
- CN202411185432.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-17
AI Technical Summary
Traditional financial system session management methods rely on fixed thresholds and cannot dynamically adjust the session number threshold, resulting in performance bottlenecks or resource waste under high load conditions.
By collecting historical session performance indicator data, it is divided into positive and negative samples, using machine learning algorithms to train the session threshold prediction model, monitor the current data in real time, dynamically adjust the session threshold, and adjust the mode according to system load and resource utilization.
Prevent performance bottlenecks under high load conditions, improve resource utilization, ensure the best performance and stable operation of the system under different load conditions, and reduce operation and maintenance costs.
Smart Images

Figure CN119155180A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data and machine learning technology, and in particular to a method, device, equipment and storage medium for adaptively adjusting a session number threshold. Background Art
[0002] In the modern financial services industry, as digital transformation deepens, financial institutions rely on large-scale online transaction systems to process massive customer requests and transaction data. These systems usually need to support high-concurrency, multi-user access scenarios, such as online banking, mobile payments, financial trading platforms, etc. In such an environment, how to effectively manage and optimize the system's session processing capabilities to ensure that the system can still maintain stable and efficient operation under high load is a crucial technical challenge.
[0003] Traditional financial system session management methods usually rely on preset fixed thresholds, which are often based on historical experience or static configuration. However, as the complexity and dynamism of financial services increase, fixed thresholds can no longer meet the needs of real-time adjustment. For example, during market fluctuations or emergencies, the number of user requests may increase dramatically, causing the system to overload, resulting in performance bottlenecks or even system crashes. Conversely, during business downturns, system resources may not be fully utilized, resulting in resource waste and increased operating costs.
[0004] In order to meet the above challenges, the financial sector urgently needs an intelligent session management and adjustment method that can dynamically adjust the system's session number threshold based on real-time data to ensure that the system can maintain optimal performance under different load conditions. This can not only improve the system's processing efficiency and user experience, but also effectively reduce operation and maintenance costs and resource waste.
[0005] With the rapid development of big data analysis and machine learning technologies, financial institutions have begun to try to apply these technologies to session management. Through in-depth analysis of historical session data, combined with key performance indicators such as system load and resource utilization, a prediction model is established to adjust the session number threshold in real time, which can respond to changes in business needs more accurately. This data-driven adaptive adjustment method is expected to address the limitations of traditional methods and provide a more intelligent and efficient solution for the stable operation of financial systems. Summary of the invention
[0006] The main purpose of the present invention is to provide a method, device, equipment and storage medium for adaptively adjusting the session number threshold, aiming to solve the technical problem that the prior art relies on a fixed threshold for session management and cannot dynamically adjust the session number threshold, resulting in performance bottlenecks or resource waste.
[0007] To achieve the above object, the present invention provides a method for adaptively adjusting a session number threshold, comprising:
[0008] Collect historical session performance indicator data, including database performance indicators, server hardware configuration indicators, system load indicators, and business flow indicators;
[0009] Dividing the historical session performance indicator data into positive samples and negative samples, and selecting key feature variables related to session performance from the historical session performance indicator data according to a feature analysis method;
[0010] Based on the key feature variables, positive samples and negative samples, the initial model is trained using a machine learning algorithm to obtain a session threshold prediction model;
[0011] The current session performance indicator data is monitored in real time, and based on the key feature variables and the session threshold prediction model, the session number threshold is adaptively generated and dynamically adjusted.
[0012] In one embodiment, based on the key feature variables, positive samples and negative samples, a machine learning algorithm is used to train the initial model to obtain a session threshold prediction model, including:
[0013] Based on the key feature variables, positive samples and negative samples, the initial model is trained using a random forest algorithm;
[0014] During the training process, the hyperparameters of the initial model are optimized by grid search or random search method;
[0015] After the training is completed, a verification model is obtained, and the accuracy of the verification model is evaluated;
[0016] If the accuracy is not greater than the first preset threshold, it is determined that the verification model does not meet the session threshold prediction condition, and the key feature variables related to the session performance are reselected to perform model training again;
[0017] If the accuracy is greater than a first preset threshold, the recall rate of the verification model is evaluated; if the recall rate is greater than a second preset threshold, the verification model is used as the session threshold prediction model.
[0018] In one embodiment, the historical session performance indicator data is divided into positive samples and negative samples, including:
[0019] Define response time thresholds, resource utilization threshold ranges, and error rate thresholds;
[0020] The data in the historical session performance indicator data whose response time is less than or equal to the response time threshold, whose resource utilization is within the resource utilization threshold range, and whose error rate is less than or equal to the error rate threshold is taken as the positive sample;
[0021] The data in the historical session performance indicator data other than the positive samples are used as the negative samples.
[0022] In one embodiment, selecting key feature variables related to session performance from the historical session performance indicator data according to a feature analysis method includes:
[0023] Evaluate the Pearson correlation coefficient between each feature in the historical session performance indicator data and the target session performance indicator, and select a feature whose absolute value of the Pearson correlation coefficient is greater than a first threshold as a first candidate key feature variable;
[0024] Performing a linear regression analysis on each feature in the historical session performance indicator data, taking the target session performance indicator as the dependent variable and each feature as the independent variable, calculating the regression coefficient, and selecting the feature whose regression coefficient is greater than the second threshold as the second candidate key feature variable;
[0025] Applying a principal component analysis method to each feature in the historical session performance indicator data, extracting principal components, calculating a characteristic value of each principal component, selecting principal components whose characteristics are greater than a third threshold, and using the corresponding features as third candidate key feature variables;
[0026] A final key feature variable is determined based on the first candidate key feature variable, the second candidate key feature variable, and the third candidate key feature variable.
[0027] In one embodiment, the current session performance indicator data is monitored in real time, and based on the key feature variables and the session threshold prediction model, the session number threshold is adaptively generated and dynamically adjusted, including:
[0028] Monitor current session performance indicator data in real time, input the monitored data into the session threshold prediction model, and generate an initial session number threshold using the session threshold prediction model based on the key feature variables;
[0029] Monitor system load and resource utilization, and determine a threshold adjustment mode based on the monitoring results, wherein the threshold adjustment mode includes a conservative mode, an aggressive mode, and an adaptive mode;
[0030] generating a final session number threshold according to the initial session number threshold and the threshold adjustment mode;
[0031] When changes in session performance indicator data are monitored, the session number threshold is dynamically adjusted.
[0032] In one embodiment, generating a final session number threshold according to the initial session number threshold and the threshold adjustment mode includes:
[0033] Based on the initial session number threshold and the threshold adjustment mode, a minimum threshold, a maximum threshold and a warning threshold are set for different types of operations according to importance and resource consumption;
[0034] Monitor the current system load, and dynamically adjust the minimum threshold, the maximum threshold, and the warning threshold based on the monitoring results;
[0035] If the current number of sessions is lower than a minimum threshold, increase resource allocation to raise the number of sessions to the minimum threshold;
[0036] If the number of sessions is higher than the maximum threshold, the current limiting mechanism is triggered to limit new session requests and limit the number of sessions to within the maximum threshold;
[0037] If the number of sessions reaches the warning threshold, resources are allocated to key operations first, and the resource allocation ratio for non-key operations is reduced.
[0038] In one embodiment, after setting the minimum threshold, the maximum threshold and the warning threshold for different types of operations according to importance and resource consumption based on the initial session number threshold and the threshold adjustment mode, the method further includes:
[0039] At every preset time period, collect and analyze the current number of sessions and system resource utilization;
[0040] When the current number of sessions is greater than a preset ratio of the maximum threshold, an emergency response is triggered;
[0041] When the system resource utilization exceeds a preset critical value, the backup resources are enabled to share the current system load.
[0042] Furthermore, to achieve the above object, the present invention also provides a session number threshold adaptive adjustment device, comprising:
[0043] The data collection module collects historical session performance indicator data. The session performance indicators include database performance indicators, server hardware configuration indicators, system load indicators, and business flow indicators.
[0044] A feature selection module, which divides the historical session performance indicator data into positive samples and negative samples, and selects key feature variables related to session performance from the historical session performance indicator data according to a feature analysis method;
[0045] A model training module, based on the key feature variables, positive samples and negative samples, uses a machine learning algorithm to train the initial model to obtain a session threshold prediction model;
[0046] The threshold adjustment module monitors the current session performance indicator data in real time, and based on the key feature variables and the session threshold prediction model, adaptively generates and dynamically adjusts the session number threshold.
[0047] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a session number threshold adaptive adjustment device, which includes a memory, a processor, and a session number threshold adaptive adjustment program stored in the memory and executable on the processor, and the session number threshold adaptive adjustment program, when executed by the processor, implements the steps of the session number threshold adaptive adjustment method as described above.
[0048] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a computer storage medium, on which a session number threshold adaptive adjustment program is stored, and when the session number threshold adaptive adjustment program is executed by a processor, the steps of the session number threshold adaptive adjustment method described above are implemented.
[0049] Beneficial effects: The present invention relates to a method for adaptively adjusting the threshold value of the number of sessions, which collects historical session performance indicator data, which covers aspects such as database performance, server hardware configuration, system load and business traffic; divides the collected data into positive samples and negative samples, and uses feature analysis methods to extract key feature variables related to session performance; based on these key feature variables and sample data, uses a machine learning algorithm to train the initial model to obtain a session threshold prediction model. The current session performance data is monitored in real time, and the key features and prediction models determined previously are used to automatically generate a suitable threshold value for the number of sessions, and the threshold value is adjusted at any time according to changes in real-time data. The present invention can prevent performance bottlenecks under high loads, while improving resource utilization under low loads, ensuring optimal performance and stable operation of the system under different working conditions, and is particularly suitable for high-concurrency scenarios in the financial field. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0051] Figure 1 It is a flow chart of an embodiment of a method for adaptively adjusting the session number threshold of the present invention;
[0052] Figure 2 This is a functional module diagram of a preferred embodiment of the session number threshold adaptive adjustment device of the present invention;
[0053] Figure 3 It is a structural schematic diagram of the device hardware operating environment involved in the embodiment of the session number threshold adaptive adjustment device of the present invention. DETAILED DESCRIPTION
[0054] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0055] It should be noted that in the modern financial services industry, as digital transformation deepens, financial institutions rely on large-scale online transaction systems to process massive customer requests and transaction data. These systems usually need to support high-concurrency, multi-user access scenarios, such as online banking, mobile payments, financial trading platforms, etc. In such an environment, how to effectively manage and optimize the system's session processing capabilities to ensure that the system can maintain stable and efficient operation under high load is a crucial technical challenge.
[0056] Traditional financial system session management methods usually rely on preset fixed thresholds, which are often based on historical experience or static configuration. However, as the complexity and dynamism of financial services increase, fixed thresholds can no longer meet the needs of real-time adjustment. For example, during market fluctuations or emergencies, the number of user requests may increase dramatically, causing the system to overload, resulting in performance bottlenecks or even system crashes. Conversely, during business downturns, system resources may not be fully utilized, resulting in resource waste and increased operating costs.
[0057] In order to meet the above challenges, the financial sector urgently needs an intelligent session management and adjustment method that can dynamically adjust the system's session number threshold based on real-time data to ensure that the system can maintain optimal performance under different load conditions. This can not only improve the system's processing efficiency and user experience, but also effectively reduce operation and maintenance costs and resource waste.
[0058] With the rapid development of big data analysis and machine learning technologies, financial institutions have begun to try to apply these technologies to session management. Through in-depth analysis of historical session data, combined with key performance indicators such as system load and resource utilization, a prediction model is established to adjust the session number threshold in real time, which can respond to changes in business needs more accurately. This data-driven adaptive adjustment method is expected to address the limitations of traditional methods and provide a more intelligent and efficient solution for the stable operation of financial systems.
[0059] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of a method for adaptively adjusting a session number threshold provided by the present invention. It should be noted that although a logical sequence is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0060] like Figure 1 As shown, the session number threshold adaptive adjustment method proposed by the present invention includes the following steps:
[0061] S10, collecting historical session performance indicator data, where the session performance indicators include database performance indicators, server hardware configuration indicators, system load indicators, and business flow indicators;
[0062] In this embodiment, historical session performance indicator data refers to various types of performance data recorded by the system during past operations. These data are used to analyze and predict the behavior of the system. The collected performance indicator data covers multiple dimensions, including database performance indicators (such as query response time, transaction processing time), server hardware configuration indicators (such as CPU utilization, memory occupancy), system load indicators (such as concurrent sessions, network bandwidth utilization) and business traffic indicators (such as transactions per second, user visits). For example, the query response time in the database performance indicator can be set to the average value of multiple samples per second, the CPU utilization can be monitored in real time based on the number of cores and threads of the server, and the data collection frequency can be set according to business needs, such as collecting every 5 seconds or 10 seconds.
[0063] Database performance indicators: These indicators are used to evaluate the health and performance level of the database system.
[0064] Response time: For example, the system records the average time it takes for a user request to be queried, processed, and returned to the database. If the query response time exceeds 200ms, the system may trigger performance optimization measures.
[0065] Throughput: The system monitors the number of database transactions processed per second, for example, the processing capacity is 1000 transactions per second.
[0066] Resource utilization: If the CPU utilization exceeds 85%, the system may remind the administrator to optimize.
[0067] Lock wait time: When multiple transactions are executed concurrently, if the lock wait time exceeds 50ms, the system will record the event for optimization.
[0068] Cache hit rate: If the cache hit rate is less than 90%, the system will recommend increasing the cache or optimizing the query.
[0069] Index usage efficiency: Regularly analyze index usage. If the usage rate of an index is less than 50%, the index may need to be optimized.
[0070] Number of database connections: If the number of connections exceeds 1,000, the system may limit new connection requests.
[0071] Error rate: For example, if the system detects that the database query error rate is 5%, which exceeds the set threshold of 3%, the error handling process will be triggered.
[0072] Server hardware configuration indicators: These indicators reflect the hardware status and operating capabilities of the server.
[0073] CPU: For example, the system monitors the CPU usage of the server and finds that the CPU usage of a server remains above 90% for a long time, indicating that the processing capacity may need to be increased.
[0074] Memory: The system monitors memory usage. If memory usage exceeds 80%, the system may warn of potential memory bottlenecks.
[0075] Storage: Monitors the read and write speeds of storage devices. For example, when the read and write speeds of an SSD drop below 300MB / s, the system may recommend replacing or optimizing the storage device.
[0076] Network Interface: Monitors the speed of the network interface. When the network bandwidth usage exceeds 70%, the system may recommend upgrading the network device.
[0077] Expansion slots: The system monitors the usage of expansion slots. If the slot usage reaches 80%, the system may recommend adding an expansion slot.
[0078] Power supply: The system monitors the power output of the power supply. If the power output is unstable, the system will prompt a possible power failure.
[0079] Cooling system: When the cooling system cannot control the temperature within a safe range (such as below 75°C), the system will remind you that cooling optimization is needed.
[0080] System load indicators: These indicators are used to measure the overall system load.
[0081] CPU usage: For example, when CPU usage exceeds 90%, the system will enter performance optimization mode.
[0082] Memory usage: If memory usage exceeds 85%, the system may suggest freeing up some resources or expanding memory.
[0083] Disk I / O performance: When the disk I / O wait time exceeds 10ms, the system may record this situation and suggest optimizing I / O operations.
[0084] Network bandwidth usage: When the network bandwidth usage reaches 80%, the system will suggest reducing bandwidth usage or upgrading the network.
[0085] Number and status of processes: The system monitors the status of processes. If a process is blocked for a long time, the system will trigger an alarm.
[0086] System average load: When the system average load exceeds the set threshold, for example, the average load within 5 minutes exceeds 5.0, the system will prompt that the load is too high.
[0087] Number of context switches: If the context switch frequency exceeds 1000 times per second, the system may recommend optimizing process management.
[0088] Number of interruptions: When the number of system interruptions exceeds 500 per second, the system may record this abnormality.
[0089] Business flow indicators: These indicators are used to evaluate the operating efficiency of business systems and user behavior.
[0090] Number of visits: The system records the number of visits per hour. If the number of visits surges during a certain period of time (such as more than 5,000 visits), the system will prompt a traffic peak.
[0091] Number of unique visitors: The system monitors the number of unique visitors. If it exceeds 10,000 in a day, the system may recommend increasing server processing capacity.
[0092] Page views: The system records the number of views of each page. If a page has more than 10,000 views, the system may recommend optimizing the page.
[0093] Dwell time: When a user stays on a page for less than 30 seconds, the system may recommend optimizing the page content.
[0094] Bounce rate: If the bounce rate exceeds 70%, the system will prompt that there may be problems with page design or content.
[0095] Conversion rate: For example, if the system detects that the conversion rate is less than 3%, it may recommend adjusting the marketing strategy.
[0096] Traffic sources: The system analyzes traffic sources. When a certain channel accounts for more than 50% of the traffic, the system may recommend diversifying traffic sources.
[0097] Popular pages: The system monitors and records the most frequently visited pages. If a page is in the top 10 in terms of visits for a long time, the system will prompt you to optimize the content or performance of the page.
[0098] Traffic peaks and valleys: The system monitors traffic peaks and valleys. If it finds a surge in traffic at 12 noon on a certain day, the system may recommend adjusting the server configuration to cope with peak traffic.
[0099] Geographic distribution: The system analyzes the geographic distribution of access traffic. If there is a surge in traffic in a certain area, the system may recommend adding server nodes in that area.
[0100] In one specific implementation, in a financial transaction system, the core business system of a bank needs to process a large number of customer transaction requests. The collection of historical session performance indicator data can be obtained from multiple channels such as database logs, server monitoring systems, and network traffic monitoring tools. The bank system regularly collects key performance data such as database query response time, CPU utilization, number of concurrent users, and number of transactions per second, and stores these data on a big data platform. By analyzing these data, the performance bottlenecks of the system under different load conditions can be identified, and the session number threshold of the system can be dynamically adjusted according to key characteristic variables. For example, during business peak hours, the highest possible load can be predicted based on historical data, and the session number threshold of the system can be adjusted in advance to avoid overload.
[0101] Through the above steps, the session number threshold can be dynamically adjusted according to the real-time load conditions, which greatly improves the responsiveness and resource utilization efficiency in different business scenarios. Especially in high-concurrency scenarios in the financial field, it can effectively avoid system overload or resource waste, and ensure service stability and efficiency.
[0102] S20, dividing the historical session performance indicator data into positive samples and negative samples, and selecting key feature variables related to session performance from the historical session performance indicator data according to a feature analysis method;
[0103] In this embodiment, the collected historical session performance indicator data is classified according to its performance so that the subsequent machine learning model can learn data features more effectively. Positive samples usually refer to session data with good performance, such as short response time, high throughput, and reasonable resource utilization; negative samples refer to session data with poor performance, such as long response time, long lock waiting time, and high resource utilization. For example, session data with a response time of less than 200ms can be marked as a positive sample, while session data with a response time of more than 500ms can be marked as a negative sample.
[0104] Through statistical and analytical methods, variables that have a significant impact on session performance are identified from historical session performance indicator data. These variables are called key features. Common feature analysis methods include Pearson correlation coefficient analysis, linear regression analysis, principal component analysis, etc. For example, by calculating the Pearson correlation coefficient between each performance indicator and the system response time, variables such as CPU usage and memory usage that have a greater impact on response time can be identified as key features. These features will be used to train the session threshold prediction model to improve the prediction accuracy of the model.
[0105] In one specific implementation, in an insurance company's online claims system, the system classifies historical session performance indicator data by processing time and user feedback. The system first marks records with short processing time and satisfactory user feedback as positive samples, and records with long processing time and unsatisfactory user feedback as negative samples. Then, the system reduces the dimension of the collected performance indicator data through the principal component analysis method to extract the features that have the greatest impact on the processing time. Finally, the system selects user access volume, network bandwidth usage, and cache hit rate as key feature variables to train the session number threshold prediction model and optimize the system's performance adjustment strategy.
[0106] By dividing historical session performance indicator data into positive samples and negative samples and using a feature analysis method to select key feature variables, the present invention can effectively improve the accuracy of the session threshold prediction model.
[0107] S30, training the initial model using a machine learning algorithm based on the key feature variables, positive samples, and negative samples to obtain a session threshold prediction model;
[0108] In this embodiment, the initial model is trained by a machine learning algorithm based on the key feature variables, positive samples, and negative samples selected in the previous step. The machine learning algorithm establishes a mapping relationship between feature variables and session performance by learning the feature patterns in these sample data. Common machine learning algorithms include decision trees, random forests, support vector machines (SVMs), and neural networks. For example, the random forest algorithm can improve the generalization ability and prediction accuracy of the model by integrating multiple decision trees. During the training process, the algorithm will continuously adjust the model parameters to minimize errors and prevent overfitting of the model through methods such as cross-validation.
[0109] Through training, a model that can predict the session number threshold is obtained. Based on the input real-time system data (such as key characteristic variables such as CPU utilization and response time), the model predicts the current optimal session number threshold to ensure system performance and stability. The accuracy and reliability of the model directly affect the system's ability to adjust under different load conditions.
[0110] In one specific implementation, in a financial risk control system, the system collects and classifies risk assessment data from the past two years, and identifies memory usage, disk I / O performance, and network bandwidth usage as key feature variables. The initial model is trained using a support vector machine (SVM) algorithm, and the system uses the SVM algorithm to find an optimal classification boundary in a high-dimensional space to maximize the classification interval between positive and negative samples. Through repeated iterations and parameter adjustments, the resulting session threshold prediction model can accurately predict the optimal session number threshold that the system should take in high-risk operations to prevent system overload and potential risk exposure.
[0111] By training the initial model using machine learning algorithms based on key feature variables, positive samples, and negative samples, an efficient and accurate session threshold prediction model can be generated. The session number threshold can be predicted and adjusted in real time according to the actual operation status of the system to ensure that the system always maintains optimal performance under different load conditions. This is particularly important in high-concurrency transactions, real-time risk control, and customer service scenarios in the financial field. It can effectively avoid system overload, resource waste, or service interruption, and improve the stability and responsiveness of the overall system.
[0112] S40, monitoring the current session performance indicator data in real time, and adaptively generating and dynamically adjusting the session number threshold based on the key feature variables and the session threshold prediction model.
[0113] In this embodiment, the system collects and monitors the current session performance indicator data in real time. These indicators may include but are not limited to response time, CPU utilization, memory usage, number of database connections, network bandwidth usage, etc. This process ensures that the system can obtain the latest performance data in a timely manner for subsequent session number threshold calculation. For example, the system may collect CPU utilization and memory utilization data once a second, and input these data into the prediction model for analysis.
[0114] The session threshold prediction model obtained through previous training is combined with the key characteristic variables monitored in real time to calculate the most suitable session number threshold for the current time. This threshold refers to the maximum number of concurrent sessions that the system can efficiently handle under the current load conditions. The calculated session number threshold can be dynamically adjusted according to the current operating status of the system to ensure stable operation of the system. For example, if the real-time monitored CPU usage rate is continuously higher than 85%, the model may recommend lowering the session number threshold to prevent system overload.
[0115] During operation, the system continuously monitors the current session performance indicator data and inputs this data into the previously trained prediction model. Based on the real-time monitoring data, the system adaptively generates the session number threshold and dynamically adjusts this threshold according to changes in the situation to adapt to the current system load.
[0116] In one specific implementation, in the real-time transaction system of the bank, the system continuously monitors the current session performance indicator data, including CPU utilization, number of database connections, and response time. The system inputs these data into the trained session threshold prediction model in real time, and the model calculates the current session number threshold based on these key feature variables. For example, when the system detects that the CPU utilization exceeds 90% and the number of database connections reaches the critical value, the model will recommend reducing the session number threshold by 10% to avoid performance bottlenecks and service interruptions in the system. This dynamic adjustment process ensures the stability and efficiency of the bank's transaction system under high concurrency. In addition, the system monitors the response time, server load and other indicators of the session every 5 seconds, and inputs these data into the session threshold prediction model. The system generates an initial session number threshold based on the prediction results, and selects conservative or aggressive mode to adjust the threshold based on the current load situation to ensure that the system is neither overloaded nor too conservative, and maintains efficient operation.
[0117] Through the above steps, the session number threshold can be dynamically adjusted according to the actual operating status of the system to ensure the stability and efficiency of the system under high load conditions. This can not only effectively prevent system overload and performance bottlenecks, but also improve the utilization of system resources.
[0118] The present invention relates to a method for adaptively adjusting the threshold value of the number of sessions. The method collects historical session performance index data, which covers aspects such as database performance, server hardware configuration, system load and business traffic. The collected data is divided into positive samples and negative samples, and a feature analysis method is used to extract key feature variables related to session performance. Based on these key feature variables and sample data, a machine learning algorithm is used to train the initial model to obtain a session threshold prediction model. The current session performance data is monitored in real time, and the key features and prediction models determined previously are used to automatically generate a suitable threshold value of the number of sessions, and the threshold value is adjusted at any time according to the changes in real-time data. The present invention can prevent performance bottlenecks under high loads, and improve resource utilization under low loads, thereby ensuring the optimal performance and stable operation of the system under different working conditions, and is particularly suitable for high-concurrency scenarios in the financial field.
[0119] In one embodiment, the above S30 includes:
[0120] S301, training the initial model using a random forest algorithm based on the key feature variables, positive samples and negative samples;
[0121] S302, during the training process, optimizing the hyperparameters of the initial model by grid search or random search method;
[0122] S303, after the training is completed, a verification model is obtained, and the accuracy of the verification model is evaluated;
[0123] S304: If the accuracy is not greater than the first preset threshold, it is determined that the verification model does not meet the session threshold prediction condition, and key feature variables related to session performance are reselected to perform model training again;
[0124] S305: If the accuracy is greater than a first preset threshold, the recall rate of the verification model is evaluated; if the recall rate is greater than a second preset threshold, the verification model is used as the session threshold prediction model.
[0125] In this embodiment, the initial model is trained using the random forest algorithm. Random forest is an ensemble learning method that improves the accuracy and robustness of the model by building multiple decision trees and combining their prediction results. This method trains each decision tree by randomly selecting samples and features to avoid the overfitting problem of a single model. The samples used in training are divided into positive samples (session data with excellent performance) and negative samples (session data with poor performance), and during the training process, the system automatically adjusts the weights and splitting criteria of each tree.
[0126] Hyperparameter optimization is a key step in model training. Grid search and random search are two commonly used hyperparameter optimization methods. Grid search finds the optimal parameter configuration by exhaustively enumerating all possible parameter combinations; random search searches for the optimal parameters in the parameter space by random sampling. These two methods can improve the prediction performance of the model and avoid overfitting or underfitting of the model.
[0127] After training is complete, the system will get a validation model. The validation model is used to evaluate the performance of the model, especially its accuracy, on a new data set other than the training data. Accuracy refers to the ratio of the number of samples correctly predicted by the model to the total number of samples, which is used to measure the overall prediction ability of the model. If the accuracy of the validation model is high, it means that the model performs well on new data.
[0128] If the accuracy of the validation model fails to reach the first preset threshold (e.g. 99%), it indicates that the model's predictive performance is insufficient and cannot accurately predict the session threshold. In this case, the system will re-evaluate the key feature variables previously selected, and may need to select new features or add features to improve the model's predictive ability, and then retrain the model.
[0129] If the accuracy of the validation model is higher than the preset threshold, the system will further evaluate the recall rate of the model. The recall rate refers to the ratio of the number of positive samples correctly predicted by the model to the number of actual positive samples, and is mainly used to measure the ability of the model in identifying positive samples. If the recall rate is higher than the second preset threshold (for example, 99%), it indicates that the model performs well in identifying positive samples and can be used as the final session threshold prediction model.
[0130] Through the above steps, this embodiment can dynamically predict the optimal session number threshold according to the actual operation status of the system, thereby ensuring the stability and efficiency of the system under different load conditions.
[0131] In one embodiment, in the above S20, dividing the historical session performance indicator data into positive samples and negative samples includes:
[0132] S201, defining a response time threshold, a resource utilization threshold range, and an error rate threshold;
[0133] S202: taking data in the historical session performance indicator data whose response time is less than or equal to the response time threshold, whose resource utilization is within the resource utilization threshold range, and whose error rate is less than or equal to the error rate threshold as the positive sample;
[0134] S203: Use the data in the historical session performance indicator data other than the positive samples as the negative samples.
[0135] In this embodiment, the historical session performance indicator data is classified into positive samples with good performance and negative samples with poor performance. The purpose of this classification is to train the machine learning model so that it can identify and predict the optimal session number threshold of the system under different conditions.
[0136] Before data classification, several key performance indicator thresholds need to be defined:
[0137] Response time threshold: refers to the upper limit of the time from when the system receives a request to when it completes processing, usually in milliseconds (ms). Records with response times less than or equal to this threshold are considered to be good performance samples.
[0138] Resource utilization threshold range: refers to the utilization rate of system resources (such as CPU, memory) should be within a reasonable range, this range can be set according to historical data or system design standards. For example, the CPU utilization rate between 40% and 70% is considered to be a good resource utilization state.
[0139] Error rate threshold: refers to the upper limit of the error rate when the system processes requests. Records with an error rate less than or equal to this threshold are considered good samples. For example, the error rate threshold may be set to 1%, indicating that only records with an error rate less than or equal to 1% will be considered positive samples.
[0140] After defining the above thresholds, the system will filter historical data according to these criteria. All data records that meet the following three conditions: response time is less than or equal to the defined threshold, resource utilization is within the set range, and error rate is less than or equal to the defined threshold will be classified as positive samples. These positive samples represent the state of good system operation and are suitable as the basis for model learning.
[0141] Corresponding to positive samples, data records that fail to meet the above three conditions will be considered negative samples. Negative samples usually represent poor system performance, such as long response time, high resource utilization, or excessive error rate. By learning these negative samples, the model can identify the factors that lead to system performance degradation, and predict and optimize them.
[0142] Through the above steps, this embodiment can effectively separate the session data with good performance from the data with poor performance. This classification method enables the model to accurately learn the key factors that lead to good or poor system performance, so as to dynamically adjust the session number threshold in actual operation, ensuring the stability and efficiency of the system under various load conditions, especially in scenarios with high requirements for system performance such as financial transactions and customer service.
[0143] In one embodiment, in the above S20, selecting key feature variables related to session performance from the historical session performance indicator data according to a feature analysis method includes:
[0144] S204, evaluating the Pearson correlation coefficient between each feature in the historical session performance indicator data and the target session performance indicator, and selecting a feature whose absolute value of the Pearson correlation coefficient is greater than a first threshold as a first candidate key feature variable;
[0145] S205, performing linear regression analysis on each feature in the historical session performance indicator data, taking the target session performance indicator as the dependent variable and each feature as the independent variable, calculating the regression coefficient, and selecting the feature whose regression coefficient is greater than the second threshold as the second candidate key feature variable;
[0146] S206, applying a principal component analysis method to each feature in the historical session performance indicator data, extracting principal components, calculating a characteristic value of each principal component, selecting principal components whose characteristics are greater than a third threshold, and using the corresponding features as third candidate key feature variables;
[0147] S207 , determining a final key feature variable based on the first candidate key feature variable, the second candidate key feature variable, and the third candidate key feature variable.
[0148] In this embodiment, through a variety of statistical and analytical methods, the variables that have the most significant impact on session performance (i.e., key feature variables) are extracted from a large amount of historical session performance indicator data. These key feature variables will be used in subsequent machine learning model training to improve the prediction accuracy and reliability of the model.
[0149] In the first step of feature analysis, the system evaluates the linear relationship between each performance indicator and the target session performance (such as response time, throughput, etc.) by calculating the Pearson correlation coefficient between them. The larger the absolute value of the Pearson correlation coefficient, the closer the relationship between the feature and the target performance indicator. The system sets a first threshold (for example, 0.7) and selects the features with an absolute value of the correlation coefficient greater than the threshold as the first candidate key feature variable.
[0150] In the second step, the system further screens features through linear regression analysis. In linear regression analysis, the target session performance index is used as the dependent variable, and each feature is used as the independent variable. The system calculates the contribution of each feature to the target performance through a regression model. The regression coefficient indicates the degree of influence of the feature on the target performance. The system sets a second threshold (for example, 0.5) and selects features with a regression coefficient greater than the threshold as the second candidate key feature variable.
[0151] In the third step, the system uses the principal component analysis (PCA) method to reduce the dimensionality of all features and extract the principal components that contribute most to the data variance. The eigenvalue of each principal component represents its contribution to the data variance. The system sets a third threshold (for example, 1.0) and selects the original features corresponding to the principal components whose eigenvalues are greater than the threshold as the third candidate key feature variables.
[0152] In the last step, the system conducts a comprehensive analysis of the candidate key feature variables screened in the above three steps and finally determines the most important key feature variables. These variables will be used as input features in subsequent model training to improve the prediction accuracy and stability of the model.
[0153] The system scores each candidate feature based on its performance in three analysis steps. Specifically:
[0154] For the first candidate key feature variable selected in the Pearson correlation coefficient analysis, the system will score it according to the absolute value of the correlation coefficient. For example, the larger the absolute value of the Pearson correlation coefficient, the higher the importance score of the feature.
[0155] For the second candidate key feature variable selected in the linear regression analysis, the system will score it according to the size of the regression coefficient. The larger the regression coefficient, the more significant the impact of the feature on the target session performance, and the higher the score.
[0156] For the third candidate key feature variable selected in the principal component analysis, the system will score it according to the eigenvalue of the principal component. The larger the eigenvalue, the greater the proportion of variance explained by the feature in the data, and the higher the score.
[0157] For each candidate feature variable, the system weights and combines its scores in the three steps to obtain an overall importance score. The weighting coefficient can be set according to the system's trust in different analysis methods and practical application experience, for example:
[0158] The Pearson correlation coefficient score was weighted at 30%.
[0159] The linear regression coefficient score has a weight of 40%.
[0160] The principal component analysis scores were weighted at 30%.
[0161] The weighted scoring formula is: comprehensive score = 0.3 × Pearson score + 0.4 × regression analysis score + 0.3 × principal component analysis score.
[0162] In addition, the system can further evaluate the contribution of each candidate feature to the model through cross-validation technology. Specifically, the system can use k-fold cross-validation to divide the historical data into k subsets, train the model on each subset and evaluate the performance of the feature.
[0163] During the cross-validation process, the system records the performance of each candidate feature variable on different subsets, including its contribution to model accuracy, recall rate, F1 score and other indicators.
[0164] Based on the comprehensive score and cross-validation results, the system ranks the final candidate feature variables. For the top-ranked features, the system further analyzes the correlation between them.
[0165] If there is a high correlation between certain features (for example, the correlation coefficient is greater than 0.9), the system may retain one of the features with higher importance and remove other features with higher correlation but smaller contribution to avoid redundancy and overfitting problems of the model.
[0166] Finally, the system selects several most representative and predictive features as the final key feature variables based on the comprehensive score, cross-validation results, and correlation between features. These finalized key feature variables will be used as input to the machine learning model to help the model predict the session number threshold more accurately.
[0167] Through the above steps, this embodiment can effectively filter out key feature variables closely related to session performance from historical session performance indicator data. These variables can improve the training effect and prediction accuracy of the machine learning model, and ensure that the system can dynamically adjust the session number threshold according to key features in actual operation, thereby optimizing system performance.
[0168] In one embodiment, the above S40 includes:
[0169] S401, monitoring the current session performance indicator data in real time, inputting the monitored data into the session threshold prediction model, and generating an initial session number threshold using the session threshold prediction model based on the key feature variables;
[0170] S402, monitoring system load and resource utilization, and determining a threshold adjustment mode based on the monitoring result, wherein the threshold adjustment mode includes a conservative mode, an aggressive mode, and an adaptive mode;
[0171] S403, generating a final session number threshold according to the initial session number threshold and the threshold adjustment mode;
[0172] S404: When a change in the session performance indicator data is monitored, dynamically adjust the session number threshold.
[0173] In this embodiment, the current session performance index is monitored in real time, and the session threshold prediction model obtained by previous training is used to calculate the current session number threshold based on key feature variables. This threshold is intended to optimize system resource utilization and performance and ensure system stability under different load conditions.
[0174] The system will continuously monitor the current session performance indicator data, such as response time, CPU usage, memory usage, etc. The monitored data will be input into the trained session threshold prediction model in real time. The model will analyze and calculate based on the previously selected key feature variables to generate a preliminary session number threshold. This initial threshold reflects the maximum number of concurrent sessions that the current system can handle under the existing load.
[0175] After generating the initial session count threshold, the system will further monitor and evaluate the overall system load and resource utilization. Based on these monitoring results, the system will determine an appropriate threshold adjustment mode:
[0176] Conservative mode: When the system load is close to the limit or the resource utilization is high, the system will select conservative mode to lower the session number threshold to reduce system pressure.
[0177] Aggressive mode: When the system load is low or the resource utilization is low, the system can select the aggressive mode to increase the session number threshold to fully utilize system resources and increase concurrent processing capabilities.
[0178] Adaptive mode: In most cases, the system selects the adaptive mode to dynamically adjust the session number threshold based on changes in the current load and resource utilization, balancing it between conservative and aggressive to ensure efficient operation of the system.
[0179] After determining the threshold adjustment mode, the system will further adjust the initial session number threshold based on the mode to generate the final session number threshold. For example, in conservative mode, the system may reduce the initial session number threshold by a certain percentage, while in aggressive mode, it may be appropriately increased. The final session number threshold is the maximum number of concurrent sessions that the system can safely handle under the current load conditions, and is used to guide the system's actual session processing strategy.
[0180] The system continuously monitors session performance data (such as response time, resource utilization, etc.). When these data change significantly, the system dynamically adjusts the previously determined session number threshold to ensure that the system can adapt to the new load conditions or performance requirements.
[0181] In one specific implementation, in a real-time transaction system of a bank, the system monitors current session performance indicator data, including response time, CPU usage, and number of database connections. The system inputs these data into a session threshold prediction model in real time and generates an initial session number threshold based on these key feature variables. Subsequently, the system further monitors the overall system load and resource utilization. If it is detected that the CPU usage continues to be above 80%, the system selects a conservative mode and reduces the initial session number threshold by 10% to ensure the stability of the system under high load. Finally, the system generates an adjusted session number threshold according to the conservative mode and applies it to actual transaction processing to ensure that transactions can proceed smoothly under high concurrency. When it is detected that certain key performance indicators (such as response time) have increased significantly or the system load is close to the limit, the system will automatically adjust the session number threshold. For example, if the response time suddenly increases, the system may reduce the session number threshold to reduce the load and prevent the system from being overloaded.
[0182] Through the above steps, this embodiment can effectively prevent system overload and performance bottlenecks under high load conditions, and can also improve the system's processing capacity when resource utilization is low, ensuring that the system always maintains the best operating state under various load conditions.
[0183] In one embodiment, the above S403 includes:
[0184] S4031, based on the initial session number threshold and the threshold adjustment mode, setting a minimum threshold, a maximum threshold and a warning threshold for different types of operations according to importance and resource consumption;
[0185] S4032, monitoring the current system load, and dynamically adjusting the minimum threshold, the maximum threshold, and the warning threshold based on the monitoring result;
[0186] S4033, if the current number of sessions is lower than the minimum threshold, increase resource allocation to increase the number of sessions to the minimum threshold;
[0187] S4034, if the number of sessions is higher than the maximum threshold, the current limiting mechanism is triggered to limit new session requests and limit the number of sessions to within the maximum threshold;
[0188] S4035: If the number of sessions reaches the warning threshold, resources are allocated to key operations first, and the resource allocation ratio for non-key operations is reduced.
[0189] In this embodiment, based on the generation of the initial session number threshold, combined with the threshold adjustment mode (such as conservative mode, aggressive mode and adaptive mode), the session number threshold of the system is finally determined by setting and dynamically adjusting the thresholds of different operation types. This process is intended to ensure the stability and resource optimization of the system under various load conditions.
[0190] The system sets a series of thresholds for different types of operations in the system, based on the initial session count threshold and the selected threshold adjustment mode:
[0191] Minimum threshold: refers to the minimum number of sessions that the system can withstand under a specific operation type. If the actual number of sessions is lower than this threshold, it may mean that system resources are not fully utilized.
[0192] Maximum threshold: refers to the maximum number of sessions that the system can withstand under a specific operation type. If the actual number of sessions exceeds this threshold, it may cause system overload and affect performance.
[0193] Warning threshold: refers to the critical point when the number of sessions approaches the maximum threshold. Reaching this threshold means that the system is close to the maximum load and resources need to be allocated preferentially to ensure the smooth progress of key operations.
[0194] The system sets appropriate minimum thresholds, maximum thresholds, and warning thresholds for each operation type based on its importance (e.g., transaction operations are usually more important than logging operations) and resource consumption (e.g., data processing operations usually consume more CPU and memory resources). For example, operations with high importance and high resource consumption usually have higher warning thresholds to ensure that they get priority in system resources.
[0195] In actual operation, the system will continuously monitor the current system load, including CPU usage, memory usage, network bandwidth usage, etc. Based on these monitoring results, the system will dynamically adjust the previously set minimum threshold, maximum threshold, and warning threshold to adapt to the current system status. For example, when the system load increases, the maximum threshold and warning threshold may need to be lowered to avoid system overload; when the system load is low, these thresholds may need to be raised to make full use of system resources.
[0196] If the number of monitored current sessions is lower than the set minimum threshold, the system will consider that resource allocation is insufficient and may adjust the resource allocation strategy to increase the resources (such as CPU, memory, etc.) allocated to this operation type, thereby improving the system's processing capacity and making the number of sessions reach the minimum threshold. This adjustment ensures the effective use of system resources and avoids resource waste.
[0197] If the current number of sessions exceeds the set maximum threshold, the system will trigger the current limiting mechanism to limit new session requests from entering the system. This mechanism can be implemented by rejecting new requests or queuing them, thereby limiting the current number of sessions to within the maximum threshold to avoid system overload and performance degradation.
[0198] When the current number of sessions reaches the warning threshold, the system considers that it is close to the maximum load, and resources need to be allocated preferentially. The system will prioritize resource allocation for key operations (such as transaction processing and real-time risk control), and may reduce the resource allocation ratio for non-key operations (such as logging and data backup) to ensure that key operations proceed smoothly under high load conditions.
[0199] Through the above steps, this embodiment can accurately control the session processing capability of the system. Under different load conditions, the system can automatically adjust resource allocation to ensure that key operations are prioritized while preventing system overload and resource waste.
[0200] In one embodiment, after the above S4031, the method further includes:
[0201] S4041, collecting and analyzing the current number of sessions and system resource utilization at every preset time period;
[0202] S4042, when the current number of sessions is greater than a preset ratio of the maximum threshold, triggering an emergency response;
[0203] S4043: When the system resource utilization exceeds a preset critical value, enable backup resources to share the current system load.
[0204] In this embodiment, after setting the minimum, maximum and warning thresholds, the system will also regularly monitor the current number of sessions and resource utilization, and perform further operations based on preset trigger conditions to ensure the stability and efficiency of the system under high load conditions.
[0205] The system will regularly collect the current number of sessions and system resource utilization (such as CPU, memory, and network bandwidth usage) at preset time intervals (for example, every 5 seconds or every minute). These data will be analyzed in real time to determine whether the current system status is within a safe range. If the number of sessions or resource utilization changes significantly, the system can respond in a timely manner and adjust the operation strategy.
[0206] The system will monitor the changes in the current number of sessions and compare it with the previously set maximum number of sessions. If the current number of sessions exceeds a certain preset ratio of the maximum threshold (such as 90% or 95%), the system will immediately trigger emergency response measures. These measures may include increasing system resources, limiting the flow, or notifying the administrator to intervene to avoid system overload leading to performance degradation or service interruption.
[0207] In addition to monitoring the number of sessions, the system also monitors resource utilization. When resource utilization (such as CPU or memory usage) exceeds a preset critical value (for example, 90%), the system will automatically enable backup resources. These backup resources may include additional server nodes, cloud computing resources, or reserved memory and bandwidth to share the current system load and prevent system overload.
[0208] In one specific implementation, in the bank's online trading system, the system sets the minimum, maximum and warning thresholds for different operations such as real-time trading and background processing based on the initial session number threshold and aggressive mode. After that, the system collects the current number of sessions and system resource utilization every 5 seconds. If it is detected that the current number of sessions exceeds 95% of the maximum threshold, the system will immediately trigger an emergency response, including notifying the administrator and temporarily reducing the number of new sessions to relieve system pressure. At the same time, if the system detects that the CPU usage exceeds 90%, the system will automatically enable backup server resources to share the load and ensure the continuity and stability of the trading system.
[0209] Through the above steps, this embodiment can effectively prevent the system from crashing or performance degradation under high load conditions. It can dynamically adjust system resource allocation to ensure the stability and efficiency of the system when the load changes, which is particularly suitable for high-concurrency processing scenarios in the fields of finance, insurance, etc., providing higher reliability and service quality.
[0210] The present invention also provides a session number threshold adaptive adjustment device, referring to Figure 2 , Figure 2This is a functional module diagram of a preferred embodiment of the session number threshold adaptive adjustment device of the present invention. The session number threshold adaptive adjustment device comprises:
[0211] The data collection module collects historical session performance indicator data. The session performance indicators include database performance indicators, server hardware configuration indicators, system load indicators, and business flow indicators.
[0212] A feature selection module, which divides the historical session performance indicator data into positive samples and negative samples, and selects key feature variables related to session performance from the historical session performance indicator data according to a feature analysis method;
[0213] A model training module, based on the key feature variables, positive samples and negative samples, uses a machine learning algorithm to train the initial model to obtain a session threshold prediction model;
[0214] The threshold adjustment module monitors the current session performance indicator data in real time, and based on the key feature variables and the session threshold prediction model, adaptively generates and dynamically adjusts the session number threshold.
[0215] The specific implementation of the session number threshold adaptive adjustment device of the present invention is basically the same as the embodiments of the session number threshold adaptive adjustment method described above, and will not be repeated here.
[0216] The present invention also provides a session number threshold adaptive adjustment device, such as Figure 3 As shown, the session number threshold adaptive adjustment device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0217] Those skilled in the art will understand that Figure 3 The hardware structure of the session number threshold adaptive adjustment device shown in the figure does not constitute a limitation of the session number threshold adaptive adjustment device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0218] like Figure 3As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a session number threshold adaptive adjustment program. The operating system is a program for managing and controlling the session number threshold adaptive adjustment device and software resources, and supports the operation of the network communication module, the user interface module, the session number threshold adaptive adjustment program, and other programs or software; the network communication module is used to manage and control the network interface 1004; and the user interface module is used to manage and control the user interface 1003.
[0219] exist Figure 3 In the hardware structure of the session number threshold adaptive adjustment device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the client and communicate data with the client; the processor 1001 can call the session number threshold adaptive adjustment program stored in the memory 1005, and perform the same operation as the session number threshold adaptive adjustment method.
[0220] The specific implementation of the session number threshold adaptive adjustment device of the present invention is basically the same as the embodiments of the session number threshold adaptive adjustment method described above, and will not be repeated here.
[0221] In addition, an embodiment of the present invention further provides a computer storage medium on which a session number threshold adaptive adjustment program is stored. When the session number threshold adaptive adjustment program is executed by a processor, the steps of the session number threshold adaptive adjustment method described above are implemented.
[0222] The specific implementation of the computer storage medium of the present invention is basically the same as the embodiments of the above-mentioned session number threshold adaptive adjustment method, and will not be repeated here.
[0223] 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 methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment 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 equivalent structures or equivalent process changes made using the contents of the specification and drawings of the present invention, or directly or indirectly used in other related technical fields, are protected by the present invention.
[0224] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0225] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for adaptively adjusting the session number threshold, characterized in that: The following steps are involved: Collect historical session performance indicator data, including database performance indicators, server hardware configuration indicators, system load indicators, and business flow indicators; Dividing the historical session performance indicator data into positive samples and negative samples, and selecting key feature variables related to session performance from the historical session performance indicator data according to a feature analysis method; Based on the key feature variables, positive samples and negative samples, the initial model is trained using a machine learning algorithm to obtain a session threshold prediction model; The current session performance indicator data is monitored in real time, and based on the key feature variables and the session threshold prediction model, the session number threshold is adaptively generated and dynamically adjusted.
2. The method for adaptively adjusting the session number threshold according to claim 1, characterized in that: Based on the key feature variables, positive samples and negative samples, the initial model is trained using a machine learning algorithm to obtain a session threshold prediction model, including: Based on the key feature variables, positive samples and negative samples, the initial model is trained using a random forest algorithm; During the training process, the hyperparameters of the initial model are optimized by grid search or random search method; After the training is completed, a verification model is obtained, and the accuracy of the verification model is evaluated; If the accuracy is not greater than the first preset threshold, it is determined that the verification model does not meet the session threshold prediction condition, and the key feature variables related to the session performance are reselected to perform model training again; If the accuracy is greater than a first preset threshold, the recall rate of the verification model is evaluated; if the recall rate is greater than a second preset threshold, the verification model is used as the session threshold prediction model.
3. The method for adaptively adjusting the session number threshold according to claim 1, characterized in that: The historical session performance indicator data is divided into positive samples and negative samples, including: Define response time thresholds, resource utilization threshold ranges, and error rate thresholds; The data in the historical session performance indicator data whose response time is less than or equal to the response time threshold, whose resource utilization is within the resource utilization threshold range, and whose error rate is less than or equal to the error rate threshold is taken as the positive sample; The data in the historical session performance indicator data other than the positive samples are used as the negative samples.
4. The method for adaptively adjusting the session number threshold according to claim 1, characterized in that: Selecting key feature variables related to session performance from the historical session performance indicator data according to a feature analysis method includes: Evaluate the Pearson correlation coefficient between each feature in the historical session performance indicator data and the target session performance indicator, and select a feature whose absolute value of the Pearson correlation coefficient is greater than a first threshold as a first candidate key feature variable; Performing a linear regression analysis on each feature in the historical session performance indicator data, taking the target session performance indicator as the dependent variable and each feature as the independent variable, calculating the regression coefficient, and selecting the feature whose regression coefficient is greater than the second threshold as the second candidate key feature variable; Applying a principal component analysis method to each feature in the historical session performance indicator data, extracting principal components, calculating a characteristic value of each principal component, selecting principal components whose characteristics are greater than a third threshold, and using the corresponding features as third candidate key feature variables; The final key feature variable is determined based on the first candidate key feature variable, the second candidate key feature variable and the third candidate key feature variable.
5. The method for adaptively adjusting the session number threshold as claimed in claim 1, characterized in that: Monitor the current session performance indicator data in real time, and based on the key feature variables and the session threshold prediction model, adaptively generate and dynamically adjust the session number threshold, including: Monitor current session performance indicator data in real time, input the monitored data into the session threshold prediction model, and generate an initial session number threshold using the session threshold prediction model based on the key feature variables; Monitor system load and resource utilization, and determine a threshold adjustment mode based on the monitoring results, wherein the threshold adjustment mode includes a conservative mode, an aggressive mode, and an adaptive mode; generating a final session number threshold according to the initial session number threshold and the threshold adjustment mode; When changes in session performance indicator data are monitored, the session number threshold is dynamically adjusted.
6. The method for adaptively adjusting the session number threshold according to claim 5, characterized in that: Generating a final session number threshold according to the initial session number threshold and the threshold adjustment mode includes: Based on the initial session number threshold and the threshold adjustment mode, a minimum threshold, a maximum threshold and a warning threshold are set for different types of operations according to importance and resource consumption; Monitor the current system load, and dynamically adjust the minimum threshold, the maximum threshold, and the warning threshold based on the monitoring results; If the current number of sessions is lower than a minimum threshold, increase resource allocation to raise the number of sessions to the minimum threshold; If the number of sessions is higher than the maximum threshold, the current limiting mechanism is triggered to limit new session requests and limit the number of sessions to within the maximum threshold; If the number of sessions reaches the warning threshold, resources are allocated to key operations first, and the resource allocation ratio for non-key operations is reduced.
7. The method for adaptively adjusting the session number threshold according to claim 6, characterized in that: After setting the minimum threshold, the maximum threshold and the warning threshold for different types of operations according to importance and resource consumption based on the initial session number threshold and the threshold adjustment mode, the method further includes: At every preset time period, collect and analyze the current number of sessions and system resource utilization; When the current number of sessions is greater than a preset ratio of the maximum threshold, an emergency response is triggered; When the system resource utilization exceeds a preset critical value, the backup resources are enabled to share the current system load.
8. A session number threshold adaptive adjustment device, characterized in that: The session number threshold adaptive adjustment device comprises: The data collection module collects historical session performance indicator data. The session performance indicators include database performance indicators, server hardware configuration indicators, system load indicators, and business flow indicators. A feature selection module, which divides the historical session performance indicator data into positive samples and negative samples, and selects key feature variables related to session performance from the historical session performance indicator data according to a feature analysis method; A model training module, based on the key feature variables, positive samples and negative samples, uses a machine learning algorithm to train the initial model to obtain a session threshold prediction model; The threshold adjustment module monitors the current session performance indicator data in real time, and based on the key feature variables and the session threshold prediction model, adaptively generates and dynamically adjusts the session number threshold.
9. A device for adaptively adjusting the session number threshold, characterized in that: The session number threshold adaptive adjustment device includes a memory, a processor, and a session number threshold adaptive adjustment program stored in the memory and executable on the processor. When the session number threshold adaptive adjustment program is executed by the processor, the steps of the session number threshold adaptive adjustment method as described in any one of claims 1 to 7 are implemented.
10. A computer storage medium, characterized in that: The storage medium stores a session number threshold adaptive adjustment program, which, when executed by the processor, implements the steps of the session number threshold adaptive adjustment method according to any one of claims 1 to 7.
