An Adaptive Server Load Balancing Method Based on Machine Learning
Through machine learning algorithms and load prediction models, automated management and adaptive scheduling of server loads are realized, solving the problems of frequent manual operations and insufficient dynamic load adaptability in traditional methods, and improving the stability and response speed of the system.
Patent Information
- Application Number
- CN202411330135.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-09-24
AI Technical Summary
Traditional server load balancing methods are difficult to adapt to dynamic load changes, and require manual settings of parameters and rules, resulting in high operation and maintenance costs, insufficient stability and response speed, and difficult to achieve automated management.
Adaptive server load balancing method based on machine learning is adopted to generate load prediction models through data acquisition, preprocessing, feature extraction and model training, so as to realize automated management and adaptive scheduling of server loads, and reduce manual operations.
It realizes efficient and precise management of server load, improves the stability and response speed of the system, reduces operation and maintenance costs, and enhances the adaptability of the system.
Smart Images

Figure CN118860667B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of Internet technology, and in particular relates to an adaptive server load balancing method based on machine learning. Background Art
[0002] With the advent of the Internet and big data era, the number of servers is increasing, and each server has different workloads. In order to better utilize resources and improve server utilization and availability, an effective load balancing strategy needs to be adopted. Traditional load balancing methods often rely on static rules or manual settings, which makes it difficult to achieve intelligent response to dynamic load conditions. Therefore, an adaptive server load balancing method based on machine learning came into being.
[0003] Although some load balancing technologies have used machine learning algorithms to predict and optimize loads, most methods still rely on static rules, fixed thresholds, or simple models, and ignore the need for real-time performance. In addition, existing methods also require manual setting of parameters and rules, which increases the workload of operation and maintenance personnel. Common load balancing optimization methods include those based on genetic algorithms, neural networks, decision trees, and other models, but these methods cannot fully consider the dynamic characteristics of server loads and complex operating environments.
[0004] Traditional load balancing methods are often based on static rules or simple thresholds, which are difficult to adapt to dynamically changing server load conditions, resulting in performance that cannot be maximized. These rules and thresholds are usually set during the system deployment or configuration phase and rarely or never change during runtime. The limitations of this static rule lead to a series of challenges when the system faces dynamic load changes. Existing methods often require manual setting of parameters or adjustment of rules to cope with load changes, and when a serious failure or performance degradation occurs in the load balancing system, the administrator needs to manually intervene to restore the normal operation of the system. This may involve operations such as identifying the cause of the failure, manually adjusting the configuration, and restarting the service. There will also be load imbalance, that is, some servers are overloaded while other servers are lightly loaded. In this case, the administrator needs to intervene and manually redistribute the load to each server to ensure balanced utilization of resources.
[0005] Therefore, how to achieve automated, efficient and accurate management and operation and maintenance of loads, reduce errors and costs of manual operations, and improve system stability, response speed and adaptability is a technical problem that urgently needs to be solved. Summary of the invention
[0006] The purpose of the present invention is to provide an adaptive server load balancing method based on machine learning to achieve automated, efficient and accurate management and operation of the load, reduce the errors and costs of manual operations, and improve the stability, response speed and adaptability of the system.
[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0008] A method for adaptive server load balancing based on machine learning, comprising the following steps:
[0009] S1: Collect various data of the server: The data collection process is to access the operating system interface of the server in a physical or network manner to obtain the load data of the server;
[0010] S2: Preprocessing and feature extraction of various acquired data: Data preprocessing includes removing noise and outliers, and feature extraction includes extracting features related to the load;
[0011] S3: Generate training dataset: Convert the server load data after preprocessing and feature extraction into a format that can be used for machine learning model training;
[0012] S4: Create a load prediction model and train it based on the training data set;
[0013] S5: Predict the server load, update and optimize the model based on the new data from the server, and provide feedback to the model.
[0014] S6: Perform adaptive scheduling of server load based on predicted server load data.
[0015] Preferably, in step S1, the following specific steps are included:
[0016] S11: Establishing channels connected to each target server and achieving connection with the target server;
[0017] S12: Sending a request to obtain data to each target server through the established channel;
[0018] S13: After receiving the request, the server returns a response;
[0019] S14: Parse the received data content.
[0020] Preferably, the connection channel established in step S11 is in the form of a TCP / IP connection; the request sent in step S12 is a request to obtain the status information of the target server or to obtain the server data information; the corresponding content returned in step S13 includes the server status information and the server data information; and the data content parsing in step S14 is to convert the data information into a form that the program can understand, including a dictionary and an array.
[0021] Preferably, the features related to the server load in step S2 include CPU utilization, memory utilization, disk I / O, network traffic, sensors, databases, network crawling, and data generation algorithms.
[0022] Preferably, step S3 includes the following specific processes:
[0023] S31: Determine data requirements: Determine the type and size of training data required;
[0024] S32: Perform data collection: The collection methods include sensors, databases, web crawling, and data generation algorithms;
[0025] S33: perform data cleaning;
[0026] S34: performing feature extraction and feature selection;
[0027] S35: Data labeling: assign corresponding labels or categories to each sample;
[0028] S36: performing data division;
[0029] S37: Data storage is performed.
[0030] Preferably, the type and scale of the data in step S31 include data characteristics, labels, data volume and data collection method; data cleaning in step S33 includes: removing duplicate data, processing missing values, and processing outliers; data division in step S36 includes dividing the data into a training set, a validation set and a test set; data storage in S37 includes storing the generated training data set in a specified format.
[0031] Preferably, the process of training the machine learning model in step S4 includes the following specific processes:
[0032] S41: prepare data and split the data set, where the data set splitting includes dividing the data set into a training set, a test set, and a validation set;
[0033] S42: creating a load prediction model, and training the load prediction model based on the data set, wherein the model training is to train the candidate model using the training set, including parameter optimization and adjustment, and verifying the trained load prediction model, and executing step S43 after the verification meets the preset requirements;
[0034] S43: Optimize and evaluate the load prediction model, deploy the optimized load prediction model, and establish connections with each server. The evaluation indicators include accuracy, precision, recall, and F1 value. The parameter optimization is to measure the difference between the predicted value of the model and the true label by defining a loss function, and use gradient information to update the parameters of the model. The load prediction model is deployed through an API and embedded in the software.
[0035] Preferably, in step S41, the data preparation includes feature data and corresponding labels, and the data is preprocessed, feature selected and feature scaled;
[0036] The creation of the load prediction model in step S42 includes the following specific processes:
[0037] S421: Determine the type of learning task based on the type and goal of the problem, including classification, regression, clustering, and prediction task goals;
[0038] S422: Analyze the characteristics of the server load data, where the characteristics of the load data include the dimension, distribution, and sparsity of the data;
[0039] S423: Based on the task type and data characteristics, create a load prediction model, evaluate the load prediction model, perform iterative experiments on candidate models, and adjust parameters;
[0040] The load prediction model includes an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer;
[0041] The input layer is set to a two-dimensional 4×7 matrix and a convolution kernel matrix of 2×2;
[0042] The convolution layer is set as a 3-submatrix convolution including two tensors. When the convolution layer performs convolution, it is necessary to add a bias to the result of the convolution. By using a bias in each convolution kernel and output, an independent bias value is assigned to each output channel.
[0043] The pooling layer is set to a 2×2 matrix, and pooling is performed in a 2×2 area. The value of the pooling output position is 6, the stride is 2, and the remaining area is pooled.
[0044] Preferably, predicting the load condition of the server in step S5 includes the following specific process:
[0045] S51: collect the operation data of the server in real time;
[0046] S52: Convert the collected operational data into a feature form acceptable to the machine learning model, including data normalization, missing value filling, and feature encoding;
[0047] S53: input the converted operation data into the trained machine learning model to obtain the prediction effect;
[0048] S54: Convert the prediction results into a form that is easy for operation and maintenance personnel to understand, including grades or percentages;
[0049] The model is updated and optimized based on the new data from the server, and feedback on the model includes the following specific processes: continuously monitoring the server and collecting new data; cleaning the new data and removing abnormal data; using the initial model to evaluate the new data to assess whether the model is still applicable to the new data distribution, including analyzing whether the data has overfitting or underfitting problems, and using cross-validation or adjusting parameters to avoid overfitting or underfitting; the feedback includes model prediction performance and user satisfaction.
[0050] Preferably, step S6 includes the following specific process:
[0051] S61: Number each server, each server is numbered N1, N2, N3...Nn, and create a server load function f , and obtain the load function values y1, y2, y3...yn corresponding to each server numbered N1, N2, N3...Nn, and map each load function value to a point on the interval [0, 1] through a hash mapping algorithm;
[0052] S62: Create a load function value set Y based on the load function values y1, y2, y3...yn, where Y={y1, y2, y3...yn}, and solve the elements in the set according to the hash mapping principle. yi ∈Y’s hash value;
[0053] S63: Create a distance function between servers. , based on the distance function, the corresponding load yi Assign to the server with the shortest distance.
[0054] The beneficial effects of the present invention include:
[0055] The adaptive server load balancing method based on machine learning provided by the present invention first collects various data of the server, then preprocesses and extracts features of the acquired data; and generates a training data set, converts the server load data after preprocessing and feature extraction into a format that can be used for machine learning model training; then creates a load prediction model, and trains the training data set; predicts the load situation of the server; and finally updates and optimizes the model according to the new data of the server, and provides feedback to the model.
[0056] First, this method extracts multidimensional data features based on the operating system that accesses the server physically or through the network, which more comprehensively reflects the operating status of the server. It uses machine learning algorithms to accurately predict the load of the server, and regularly updates and optimizes the model to adapt to the ever-changing working status of the server. It can accurately and efficiently achieve adaptive adjustment of server load balancing.
[0057] Secondly, by establishing a channel connected to each target server and realizing the connection with the target server, a request for obtaining data is sent to each target server through the established channel. After receiving the request, the server returns a response and parses the received data content. By parsing the data content, the current load status of each server can be obtained in real time, thereby providing a data basis for subsequent load scheduling, facilitating the realization of load balancing between servers.
[0058] Thirdly, by creating a load prediction model, the load of each server can be predicted in advance. Based on the predicted load data, the server load can be pre-scheduled in advance, and the server load can be adaptively scheduled based on the predicted server load data and real-time feedback data, further accurately achieving server load balancing.
[0059] The load prediction model is set up to include an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer;
[0060] The input layer is set as a two-dimensional 4×7 matrix and a matrix with a convolution kernel of 2×2; the convolution layer is set as a 3-submatrix convolution including two tensors. When performing convolution, the convolution layer needs to add a bias to the result of the convolution. By using a bias in each convolution kernel and output, an independent bias value is assigned to each output channel; the pooling layer is set as a 2×2 matrix, and pooling is performed in a 2×2 area, the value of the pooling output position is 6, and the stride is 2, and the remaining area is pooled. This allows the server load prediction to be carried out efficiently and accurately, ensuring that the predicted load data has high credibility, providing a data basis for the subsequent implementation of server load balancing, and assisting in improving the adaptive efficiency of load balancing.
[0061] Finally, by creating a server load function, calculating the load function value of each server, and mapping the load function value to the interval based on hash mapping, efficient data search capability is provided, thereby achieving fast data access, data retrieval and data operation, thereby improving the efficiency of subsequent load adaptive scheduling to achieve load balancing. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Picture 1 It is a flow chart of the adaptive server load balancing method based on machine learning of the present invention.
[0063] Picture 2 It is a structural schematic diagram of the load prediction model of the present invention. DETAILED DESCRIPTION
[0064] The following is combined with Picture 1 and Picture 2 The present invention is further described in detail:
[0065] Example 1
[0066] See attached Picture 1 As shown, the adaptive server load balancing method based on machine learning includes the following steps:
[0067] S1: Collect various data of the server: The data collection process is to access the operating system interface of the server in a physical or network manner to obtain the load data of the server;
[0068] S2: Preprocessing and feature extraction of various acquired data: Data preprocessing includes removing noise and outliers, and feature extraction includes extracting features related to the load;
[0069] S3: Generate training dataset: Convert the server load data after preprocessing and feature extraction into a format that can be used for machine learning model training;
[0070] S4: Create a load prediction model and train it based on the training data set;
[0071] S5: Predict the server load, update and optimize the model based on the new data from the server, and provide feedback to the model.
[0072] S6: Perform adaptive scheduling of server load based on predicted server load data.
[0073] When collecting various server data, low-power consumption is used to collect server operation data in real time. The data collection process is the basis for realizing adaptive server load balancing. Only when the collected data is real-time and accurate can timely prediction and allocation of server resources be carried out. In this process, multi-dimensional data features are extracted, which is the key to improving prediction accuracy. The server load is not only related to factors such as CPU usage and memory usage, but also to other factors such as disk read and write speed and network bandwidth occupancy. Therefore, by extracting multi-dimensional features, the operating status of the server can be more comprehensively reflected. By using machine learning algorithms for prediction, the relationship between server load and various factors can be learned from a large amount of historical data, so as to accurately predict future load conditions. Regularly updating and optimizing the model to adapt to the new working state is an important means to ensure the stability of the model. Through the above process, accurate and efficient adaptive balancing adjustment of server load is achieved.
[0074] In the above scheme, in step S1, the following specific steps are included:
[0075] S11: Establishing channels connected to each target server and achieving connection with the target server;
[0076] S12: Sending a request to obtain data to each target server through the established channel;
[0077] S13: After receiving the request, the server returns a response;
[0078] S14: Parse the received data content.
[0079] Among them, the connection channel established in step S11 is in the form of a TCP / IP connection; the request sent in step S12 is a request to obtain the status information of the target server or to obtain the server data information; the corresponding content returned in step S13 includes the server status information and the server data information; the data content parsing in step S14 is to convert the data information into a form that the program can understand, including a dictionary and an array.
[0080] Example 2
[0081] Based on Example 1, the features related to the server load in step S2 include CPU utilization, memory utilization, disk I / O, network traffic, sensors, databases, network crawling, and data generation algorithms.
[0082] Step S3 includes the following specific processes:
[0083] S31: Determine data requirements: Determine the type and scale of training data required, including data characteristics, labels, data volume, and data collection methods;
[0084] S32: Perform data collection: The collection methods include sensors, databases, web crawling, and data generation algorithms;
[0085] S33: Perform data cleaning, including removing duplicate data, processing missing values, and handling outliers;
[0086] S34: performing feature extraction and feature selection;
[0087] S35: Data labeling: assign corresponding labels or categories to each sample;
[0088] S36: Perform data division, dividing the data into a training set, a validation set, and a test set;
[0089] S37: Perform data storage, and store the generated training data set in a specified format.
[0090] The process of training the machine learning model in step S4 includes the following specific processes:
[0091] S41: prepare data and split the data set, where the data set splitting includes dividing the data set into a training set, a test set, and a validation set;
[0092] S42: creating a load prediction model, and training the load prediction model based on the data set, wherein the model training is to train the candidate model using the training set, including parameter optimization and adjustment, and verifying the trained load prediction model, and executing step S43 after the verification meets the preset requirements;
[0093] S43: Optimize and evaluate the load prediction model, deploy the optimized load prediction model, and establish connections with each server. The evaluation indicators include accuracy, precision, recall, and F1 value. The parameter optimization is to measure the difference between the predicted value of the model and the true label by defining a loss function, and use gradient information to update the parameters of the model. The load prediction model is deployed through an API and embedded in the software.
[0094] In step S41, the data preparation includes feature data and corresponding labels, and the data is preprocessed, feature selected and feature scaled;
[0095] The creation of the load prediction model in step S42 includes the following specific processes:
[0096] S421: Determine the type of learning task based on the type and goal of the problem, including classification, regression, clustering, and prediction task goals;
[0097] S422: Analyze the characteristics of the server load data, where the characteristics of the load data include the dimension, distribution, and sparsity of the data;
[0098] S423: Based on the task type and data characteristics, create a load prediction model, evaluate the load prediction model, perform iterative experiments on candidate models, and adjust parameters;
[0099] See also Picture 2 , the load prediction model includes an input layer, a convolutional layer, a pooling layer, a fully connected layer and an output layer;
[0100] The input layer is set to a two-dimensional 4×7 matrix and a convolution kernel matrix of 2×2;
[0101] The convolution layer is set as a 3-submatrix convolution including two tensors. When the convolution layer performs convolution, it is necessary to add a bias to the result of the convolution. By using a bias in each convolution kernel and output, an independent bias value is assigned to each output channel.
[0102] The pooling layer is set as a 2×2 matrix, and the remaining area is pooled by pooling the 2×2 area, with the value of the pooling output position being 6 and the stride being 2. See the model structure for details. Picture 2 The load prediction model structure diagram enables the server load prediction to be performed efficiently and accurately, ensuring that the predicted load data has high credibility, providing a data basis for the subsequent implementation of server load balancing, and assisting in improving the adaptive efficiency of load balancing.
[0103] First, you need to understand the problem type and goal, clarify the type of machine learning task and the specific task goal, in order to narrow the scope of model selection, and analyze the characteristics of the data, including the dimension, distribution, sparsity, etc. Different models have different adaptability to data characteristics. According to different task types and data characteristics, select a set of candidate models, including decision trees, support vector machines, neural networks, and linear regression, and have a deep understanding of each candidate model, including its advantages and disadvantages. And combine the characteristics of the model in terms of interpretability, training time, memory requirements, generalization ability, etc. to select a suitable model. Experiment and compare candidate models on training data according to task requirements and application scenarios, and use appropriate evaluation indicators such as accuracy, precision, recall, and mean square error to evaluate model performance. Model selection is an iterative process that requires multiple experiments and adjustments.
[0104] Splitting the data set in step S43 includes dividing the data set into a training set, a validation set and a test set; the main purpose of splitting the data set into a training set is to train the model, and the model improves its performance by learning the patterns, associations and features in the training set.
[0105] The quality and diversity of the training set directly affect the learning effect of the model. The split validation set is used to evaluate and improve the model during the training process, prevent overfitting, and select the best model configuration. A portion of the data set is reserved as a test set to evaluate the generalization ability of the model. The test set contains data that the model has not seen in the training and validation stages, so it can better reflect the performance of the model in real scenarios. Splitting the data set helps prevent overfitting, that is, the model performs well on the training set but performs poorly on unseen data. By using the validation set to monitor the performance of the model, training can be stopped in time to avoid overfitting of the model on the training set. And evaluate the performance of the model on different data subsets to have a more comprehensive understanding of the performance of the model in different scenarios, so as to better judge whether the model is suitable for practical applications. In summary, splitting the data set is to ensure the independence of model training, validation, and testing, so as to better evaluate the performance and generalization ability of the model, so as to achieve good results in practical applications.
[0106] The model training in step S44 is to train the candidate model using the training set, including the optimization and adjustment of parameters so that the model can learn the patterns and regularities in the data. The model training process involves the optimization and adjustment of parameters so that the model can better fit the training data.
[0107] The evaluation indicators for model evaluation in step S45 include accuracy, precision, recall and F1 value, so as to determine whether the model is overfitting or underfitting, and understand the generalization ability of the model.
[0108] The parameter optimization in step S46 is to measure the difference between the predicted value of the model and the true label by defining a loss function, and use the gradient information to update the parameters of the model to improve the performance and generalization ability of the model. By defining a loss function to measure the difference between the predicted value of the model and the true label, such as the mean square error function, and then using the gradient information to update the parameters of the model, the loss function is gradually reduced, and the formula for parameter update is usually parameter = parameter - learning rate * gradient. The learning rate is a hyperparameter that affects the stride of parameter update. And the process of calculating gradients and updating parameters is repeated until the stop condition is met, such as reaching a predetermined number of iterations or the loss function converges.
[0109] In step S47, the model is deployed by using the trained model to predict new data when the model training meets the requirements, wherein the model is deployed through an API and embedded in the software.
[0110] The prediction of the server load in step S5 includes the following specific processes:
[0111] S51: collect the operation data of the server in real time and at the same time interval to ensure the consistency of the prediction;
[0112] S52: Convert the collected operational data into a feature form acceptable to the machine learning model, including data normalization, missing value filling, and feature encoding;
[0113] S53: Input the converted operation data into the trained machine learning model to obtain a prediction result. The prediction result is usually a continuous value, which indicates the load of the server in the future period of time.
[0114] S54: Convert the prediction result into a form that is easy for operation and maintenance personnel to understand, including levels or percentages, to assist the operation and maintenance personnel in understanding the future load conditions of the server and making corresponding scheduling strategies accordingly.
[0115] The model is updated and optimized based on the new data from the server, and feedback on the model includes the following specific processes: continuously monitoring the server and collecting new data; cleaning the new data and removing abnormal data; using the initial model to evaluate the new data to assess whether the model is still applicable to the new data distribution, including analyzing whether the data has overfitting or underfitting problems, and using cross-validation or adjusting parameters to avoid overfitting or underfitting; the feedback includes model prediction performance and user satisfaction.
[0116] Example 3
[0117] Based on Example 1 or Example 2, step S6 includes the following specific process:
[0118] S61: Number each server, each server is numbered N1, N2, N3...Nn, and create a server load function f , and obtain the load function values y1, y2, y3...yn corresponding to each server numbered N1, N2, N3...Nn, and map each load function value to a point on the interval [0, 1] through a hash mapping algorithm;
[0119] S62: Create a load function value set Y based on the load function values y1, y2, y3...yn, where Y={y1, y2, y3...yn}, and solve the elements in the set according to the hash mapping principle. yi ∈Y’s hash value;
[0120] S63: Create a distance function between servers. , based on the distance function, the corresponding load yi Assign to the server with the shortest distance. wi The weight of a server.
[0121] wi= kcpu (1-( C T / 2 + C T ))+ kmem (1-( M T / 2 + M T ))+ kio (1-( I T / 2 +I T ));
[0122] kcpu , kmem , kio Respectively represent the impact of CPU, memory, and IO on performance. C T / 2 , C T Indicates the CPU usage at time T and T / 2. M T / 2 , M T Respectively represent the memory usage at time T and T / 2, I T / 2 ,I T Respectively represent the utilization rate of IO at time T and T / 2.
[0123] The server load function f= avg (CPU usage + memory usage + disk I / O usage + network I / O usage), calculate the load function value of each server, and map the load function value to the interval based on hash mapping.
[0124] The purpose of the hash map is to provide efficient data search capabilities, thereby achieving fast data access, data retrieval and data operations, thereby improving the efficiency of subsequent load adaptive scheduling to achieve load balancing.
[0125] As the server runs longer, new data may be generated. First, we need to continuously monitor the changes in new data and collect new data to ensure the timeliness and accuracy of model training. New data is used to update and optimize the model to reflect the current working status of the server. Then, we clean the new data and remove obvious outliers. Then, we use the initial model to evaluate the new data to see if the model is still applicable to the new data distribution. We need to consider whether the model has overfitting or underfitting problems. To avoid overfitting, we can use cross-validation to evaluate the performance of the model, or we can adjust the parameters and change the structure of the model, such as increasing the number of hidden layers, changing the activation function, and using different optimizers. Then, we update the model based on the new data. We can either retrain the entire model or update some model parameters in an incremental learning manner, which will help the model better adapt to the new data pattern and improve the prediction accuracy. After the model is optimized, we need to test it with a test set to evaluate whether its performance has improved and ensure that the updated model is more accurate and effective than the original model. Finally, after the model meets the expected performance, it is deployed to the production environment to verify the performance of the model in actual applications.
[0126] Finally, collect model feedback after deployment, including model prediction performance, user satisfaction, etc., and continuously optimize the model update strategy. Through continuous model update and optimization, the model can better adapt to new data and needs.
[0127] In summary, the adaptive server load balancing method based on machine learning provided by the present invention uses a low-power consumption method to collect server operation data in real time: this is the basis for realizing adaptive server load balancing. Only by collecting the server operation data in real time can the server resources be predicted and allocated in time; the method extracts multi-dimensional data features, reflects the operation status of the server more comprehensively, uses machine learning algorithms to accurately predict the load conditions of the server, and regularly updates and optimizes the model to adapt to the constantly changing working status of the server, and can accurately and efficiently realize adaptive adjustment of server load balancing.
Claims
1. An adaptive server load balancing method based on machine learning, characterized in that: The following steps are involved: S1: Collect various data of the server: The data collection process is to access the operating system interface of the server in a physical or network manner to obtain the load data of the server; S2: Preprocessing and feature extraction of various acquired data: Data preprocessing includes removing noise and outliers, and feature extraction includes extracting features related to the load; S3: Generate training dataset: Convert the server load data after preprocessing and feature extraction into a format that can be used for machine learning model training; S4: Create a load prediction model and train it based on the training data set; S5: Predict the server load, update and optimize the model based on the new data from the server, and provide feedback to the model; S6: Adaptively schedule the server load based on the predicted server load data; Wherein, step S6 includes the following specific processes: S61: Number each server, each server is numbered N1, N2, N3...Nn, and create a server load function f , and obtain the load function values y1, y2, y3...yn corresponding to each server numbered N1, N2, N3...Nn, and map each load function value to a point on the interval [0, 1] through a hash mapping algorithm; S62: Create a load function value set Y based on the load function values y1, y2, y3...yn, where Y={y1, y2, y3...yn}, and solve the elements in the set according to the hash mapping principle. yi ∈Y’s hash value; S63: Create a distance function between servers. , based on the distance function, the corresponding load yi Assign to the server with the shortest distance. wi The weight of a server.
2. The method for adaptive server load balancing based on machine learning according to claim 1, characterized in that: In step S1, the following specific steps are included: S11: Establishing channels connected to each target server and achieving connection with the target server; S12: Sending a request to obtain data to each target server through the established channel; S13: After receiving the request, the server returns a response; S14: Parse the received data content.
3. The method for adaptive server load balancing based on machine learning according to claim 2, characterized in that: The connection channel established in step S11 is in the form of a TCP / IP connection; the request sent in step S12 is a request to obtain the status information of the target server or to obtain the server data information; the corresponding content returned in step S13 includes the server status information and the server data information; the data content parsing in step S14 is to convert the data information into a form that the program can understand, including a dictionary and an array.
4. The method for adaptive server load balancing based on machine learning according to claim 1, characterized in that: The features related to the server load in step S2 include CPU utilization, memory utilization, disk I / O, network traffic, sensors, databases, web crawling, and data generation algorithms.
5. The method for adaptive server load balancing based on machine learning according to claim 1, characterized in that: Step S3 includes the following specific processes: S31: Determine data requirements: Determine the type and size of training data required; S32: Perform data collection: The collection methods include sensors, databases, web crawling, and data generation algorithms; S33: perform data cleaning; S34: performing feature extraction and feature selection; S35: Data labeling: assign corresponding labels or categories to each sample; S36: performing data division; S37: Data storage is performed.
6. The method for adaptive server load balancing based on machine learning according to claim 5, characterized in that: The type and size of the data in step S31 include the characteristics, labels, data volume and data collection method of the data; In step S33, data cleaning includes: removing duplicate data, processing missing values, and processing outliers; in step S36, data division includes dividing the data into a training set, a validation set, and a test set; The data storage in S37 is to store the generated training data set in a specified format.
7. The method for adaptive server load balancing based on machine learning according to claim 1, characterized in that: The process of training the machine learning model in step S4 includes the following specific processes: S41: prepare data and split the data set, where the data set splitting includes dividing the data set into a training set, a test set, and a validation set; S42: creating a load prediction model, and training the load prediction model based on the data set, wherein the model training is to train the candidate model using the training set, including parameter optimization and adjustment, and verifying the trained load prediction model, and executing step S43 after the verification meets the preset requirements; S43: Optimize and evaluate the load prediction model, deploy the optimized load prediction model, and establish connections with each server. The evaluation indicators include accuracy, precision, recall, and F1 value. The parameter optimization is to measure the difference between the predicted value of the model and the true label by defining a loss function, and use gradient information to update the parameters of the model. The load prediction model is deployed through an API and embedded in the software.
8. The method for adaptive server load balancing based on machine learning according to claim 7, characterized in that: In step S41, the data preparation includes feature data and corresponding labels, and the data is preprocessed, feature selected and feature scaled; The creation of the load prediction model in step S42 includes the following specific processes: S421: Determine the type of learning task based on the type and goal of the problem, including classification, regression, clustering, and prediction task goals; S422: Analyze the characteristics of the server load data, where the characteristics of the load data include the dimension, distribution, and sparsity of the data; S423: Based on the task type and data characteristics, create a load prediction model, evaluate the load prediction model, perform iterative experiments on candidate models, and adjust parameters; The load prediction model includes an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer; The input layer is set to a two-dimensional 4×7 matrix and a convolution kernel matrix of 2×2; The convolution layer is set as a 3-submatrix convolution including two tensors. When the convolution layer performs convolution, it is necessary to add a bias to the result of the convolution. By using a bias in each convolution kernel and output, an independent bias value is assigned to each output channel. The pooling layer is set to a 2×2 matrix, and pooling is performed in a 2×2 area. The value of the pooling output position is 6, the stride is 2, and the remaining area is pooled.
9. The method for adaptive server load balancing based on machine learning according to claim 1, characterized in that: The prediction of the server load in step S5 includes the following specific processes: S51: collect the operation data of the server in real time; S52: Convert the collected operational data into a feature form acceptable to the machine learning model, including data normalization, missing value filling, and feature encoding; S53: input the converted operation data into the trained machine learning model to obtain the prediction effect; S54: Convert the prediction results into a form that is easy for operation and maintenance personnel to understand, including grades or percentages; The model is updated and optimized based on the new data from the server, and feedback on the model includes the following specific processes: continuously monitoring the server and collecting new data; cleaning the new data and removing abnormal data; using the initial model to evaluate the new data to assess whether the model is still applicable to the new data distribution, including analyzing whether the data has overfitting or underfitting problems, and using cross-validation or adjusting parameters to avoid overfitting or underfitting; the feedback includes model prediction performance and user satisfaction.
Citation Information
Patent Citations
Ranking and updating machine learning models based on data inputs at edge nodes
CN110659740A
Data center load balancing method based on time series prediction
CN111787109A
Cited By
Neural network optimization method for server cluster load prediction
CN122154761A
