Method for adjusting load weight of back-end server and related device

By obtaining and predicting the load situation of the backend server and dynamically adjusting the load weight, the problem of low intelligence level of load balancing middleware scheduling strategies in the existing technology is solved, and better system performance and user experience are achieved.

CN119537013APending Publication Date: 2025-02-28SHANDONG CVICSE MIDDLEWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411600261.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing load balancing middleware scheduling strategies cannot dynamically adjust the load weight based on the actual load level of the backend server, resulting in low intelligence level and poor system performance and user experience.

Method used

By obtaining the comprehensive load values ​​of multiple target moment points, input them into the pre-trained prediction model, the predicted comprehensive load values ​​of the future moments are generated, and the load weight of the backend server is adjusted based on this value.

Benefits of technology

It realizes dynamic adjustment of the back-end server load weight according to future load conditions, improves the intelligence level of load balancing middleware scheduling strategies, and improves system performance and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537013A_ABST
    Figure CN119537013A_ABST
Patent Text Reader

Abstract

The invention discloses a method for adjusting the load weight of a back-end server and a related device, and relates to the technical field of load balancing. Comprising the following steps: acquiring a comprehensive load value corresponding to each target time point before a current time point as a target data set; inputting the target data set into a pre-trained prediction model, and generating a predicted comprehensive load value at a future moment; and adjusting the load weight of the back-end server based on the predicted comprehensive load value. The target data set in the application represents the actual load level of the back-end server in a past period of time; after the target data set is input into a prediction model, a predicted comprehensive load value capable of representing the actual load capacity of the back-end server at the future moment is generated; based on the predicted comprehensive load value, the load weight of the back-end server can be adjusted in a targeted manner, the intelligent level of a scheduling strategy based on the load balancing middleware is improved, and better system performance and user experience are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of load balancing, and in particular to a method and related device for adjusting the load weight of a back-end server. Background Art

[0002] Load balancing middleware is an important component located between the client and the backend server, receiving requests from the client and distributing these requests to multiple backend servers for processing. Currently, the scheduling strategies based on load balancing middleware, including round-robin, weighted round-robin, minimum number of connections and consistent hashing, do not have the ability to dynamically adjust the load weight of the backend server according to the actual load level of the backend server, resulting in the current scheduling strategy based on load balancing middleware. How to improve the intelligence level of the scheduling strategy and achieve better system performance and user experience has become one of the technical problems that need to be solved in the field of load balancing technology. Summary of the invention

[0003] Based on the above problems, the present application provides a method for adjusting the load weight of a back-end server to improve the intelligence level of the scheduling strategy based on the load balancing middleware and achieve better system performance and user experience.

[0004] The embodiments of the present application disclose the following technical solutions:

[0005] In a first aspect, the present application discloses a method for adjusting the load weight of a backend server, the method being applied to a load balancing middleware, the method comprising:

[0006] Obtaining a comprehensive load value corresponding to each target time point among multiple target time points as a target data set; the comprehensive load value is a value calculated based on the CPU usage, memory usage and network bandwidth usage of the backend server; the target time point is a time point before the current time point;

[0007] Inputting the target data set into a previously trained prediction model to generate a predicted comprehensive load value at a future moment; the future moment is a moment after the current moment;

[0008] Based on the predicted comprehensive load value, the load weight of the backend server is adjusted.

[0009] In an optional implementation, adjusting the load weight of the backend server based on the predicted comprehensive load value includes:

[0010] Determining whether the predicted comprehensive load value is greater than a preset load threshold;

[0011] If the predicted comprehensive load value is greater than or equal to a preset reference threshold, the load weight of the backend server at the current moment is adjusted from a first value to a second value; the first value is greater than the second value;

[0012] If the predicted comprehensive load value is less than the preset reference threshold, the load weight of the backend server is maintained at the first value.

[0013] In an optional implementation, the method for obtaining the comprehensive load value corresponding to the target time point includes:

[0014] Obtaining unused CPU capacity, unused memory, and unused network bandwidth of the backend server at the target time point;

[0015] Normalizing the unused CPU capacity, the unused memory amount, and the unused network bandwidth to obtain a normalized unused CPU capacity, a normalized unused memory amount, and a normalized unused network bandwidth;

[0016] Based on the normalized unused CPU capacity, the normalized unused memory amount, and the normalized unused network bandwidth, a comprehensive load value corresponding to the target time point is generated.

[0017] In an optional implementation, generating the comprehensive load value corresponding to the target time point based on the normalized unused CPU capacity, the normalized unused memory amount, and the normalized unused network bandwidth includes:

[0018] Taking the ratio of the normalized unused CPU capacity to the total CPU capacity of the backend server as the first value;

[0019] Taking the ratio of the normalized unused memory amount to the total memory capacity of the backend server as the second value;

[0020] Taking the ratio of the normalized unused network bandwidth to the total network bandwidth of the backend server as a third value;

[0021] Based on the first value, the second value and the third value, a comprehensive load value corresponding to the target time point is generated.

[0022] In an optional implementation, the normalizing the unused CPU capacity, the unused memory amount, and the unused network bandwidth respectively to obtain the normalized unused CPU capacity, the normalized unused memory amount, and the normalized unused network bandwidth includes:

[0023] Determining from the target data set the maximum unused CPU capacity, the minimum unused CPU capacity, the maximum unused memory amount, the minimum unused memory amount, the maximum unused network bandwidth, and the minimum unused network bandwidth;

[0024] Based on the maximum unused CPU capacity and the minimum unused CPU capacity, normalizing the unused CPU capacity to generate the normalized unused CPU capacity;

[0025] Based on the maximum unused memory amount and the minimum unused memory amount, normalize the unused memory amount to generate the normalized unused memory amount;

[0026] Based on the maximum unused network bandwidth and the minimum unused network bandwidth, a normalization operation is performed on the unused network bandwidth to generate the normalized unused network bandwidth.

[0027] In an optional implementation, the step of training the prediction model includes:

[0028] Obtaining a sample comprehensive load value corresponding to each sample time point in a plurality of sample time points before the first time point as a sample data set;

[0029] Obtaining a sample comprehensive load value corresponding to a second time point after the first time point;

[0030] Inputting the sample data set into the prediction model to be trained to generate a sample prediction comprehensive load value;

[0031] Based on the predicted comprehensive load value and the sample comprehensive load value corresponding to the second moment, the prediction model to be trained is trained to generate a trained prediction model.

[0032] In an optional implementation, the prediction model to be trained is a long short-term memory network.

[0033] The second aspect of the present application discloses a device for adjusting the load weight of a backend server, the device being installed in a load balancing middleware; the device comprising:

[0034] The target data set acquisition module is used to acquire the comprehensive load value corresponding to each target time point among multiple target time points as the target data set; the comprehensive load value is a value calculated based on the CPU usage, memory usage and network bandwidth usage of the backend server; the target time point is a time point before the current time point;

[0035] A predicted comprehensive load value generation module is used to input the target data set into a previously trained prediction model to generate a predicted comprehensive load value;

[0036] The load weight adjustment module is used to adjust the load weight of the back-end server based on the predicted comprehensive load value.

[0037] A third aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method introduced in any implementation manner of the first aspect.

[0038] A fourth aspect of the present application provides an electronic device, including:

[0039] a memory having a computer program stored thereon;

[0040] A processor is used to execute the computer program in the memory to implement the steps of the method introduced in any implementation manner of the first aspect.

[0041] Compared with the prior art, this application has the following beneficial effects:

[0042] The present application discloses a method for adjusting the load weight of a back-end server. The method is applied to a load balancing middleware, and includes: obtaining a comprehensive load value corresponding to each target time point before the current time point as a target data set; inputting the target data set into a previously trained prediction model to generate a predicted comprehensive load value for a future time point; and adjusting the load weight of the back-end server based on the predicted comprehensive load value.

[0043] The comprehensive load value in this application is a value calculated based on the CPU usage, memory usage and network bandwidth usage of the back-end server. The comprehensive load value corresponding to each sample time point represents the actual load level of the back-end server at the sample time point; the target data set represents the actual load level of the back-end server in the past period of time; after the target data set is input into the prediction model, a predicted comprehensive load value is generated that can represent the actual load capacity of the back-end server at a future time; based on the predicted comprehensive load value, the load weight of the back-end server can be adjusted in a targeted manner. In this way, the present application achieves the goal of adaptively adjusting the load weight of the back-end server by referring to the predicted comprehensive load value of the back-end server at a future time, which can improve the intelligence level of the scheduling strategy based on the load balancing middleware and achieve better system performance and user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0045] Figure 1 A flowchart of a method for adjusting the load weight of a backend server provided in an embodiment of the present application;

[0046] Figure 2 A schematic diagram of adjusting the load weight of a backend server through Nginx provided in an embodiment of the present application;

[0047] Figure 3 A schematic diagram of the structure of a device for adjusting the load weight of a back-end server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] Load balancing middleware is an important component located between the client and the backend server, receiving requests from the client and distributing these requests to multiple backend servers for processing. Currently, the scheduling strategies based on load balancing middleware, including round-robin, weighted round-robin, minimum number of connections and consistent hashing, do not have the ability to dynamically adjust the load weight of the backend server according to the actual load level of the backend server, resulting in the current scheduling strategy based on load balancing middleware. How to improve the intelligence level of the scheduling strategy and achieve better system performance and user experience has become one of the technical problems that need to be solved in the field of load balancing technology.

[0049] The present application discloses a method for adjusting the load weight of a back-end server. The method is applied to a load balancing middleware, and includes: obtaining a comprehensive load value corresponding to each target time point before the current time point as a target data set; inputting the target data set into a previously trained prediction model to generate a predicted comprehensive load value for a future time point; and adjusting the load weight of the back-end server based on the predicted comprehensive load value.

[0050] The comprehensive load value in the present application is a value calculated based on the CPU usage, memory usage and network bandwidth usage of the back-end server, so the comprehensive load value corresponding to each sample time point represents the actual load level of the back-end server at that sample time point; the target data set represents the actual load level of the back-end server in the past period of time; after the target data set is input into the prediction model, a predicted comprehensive load value is generated that can represent the actual load capacity of the back-end server at a future time; based on the predicted comprehensive load value, the load weight of the back-end server can be adjusted in a targeted manner.

[0051] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0052] Figure 1 A flow chart of a method for adjusting the load weight of a backend server provided in an embodiment of the present application. Figure 1 As shown, the method for adjusting the load weight of the backend server includes:

[0053] S101, obtaining a comprehensive load value corresponding to each target time point among a plurality of target time points as a target data set.

[0054] The target time point in this application is a time point before the current time point. The comprehensive load value corresponding to each target time point is a value calculated based on the CPU usage, memory usage and network bandwidth usage of the backend server.

[0055] In an optional implementation, the comprehensive load value corresponding to the target time point may be obtained in the following manner. Specifically:

[0056] The first step is to obtain the unused CPU capacity, unused memory, and unused network bandwidth of the backend server at the target time point.

[0057] It is understandable that after obtaining data such as unused CPU capacity, unused memory, and unused network bandwidth of the backend server at the target time point, outliers and missing values ​​in the above data can be screened out to ensure data integrity and consistency.

[0058] The second step is to normalize the unused CPU capacity, unused memory, and unused network bandwidth to obtain the normalized unused CPU capacity, the normalized unused memory, and the normalized unused network bandwidth. Specifically,

[0059] First, the maximum unused CPU capacity, the minimum unused CPU capacity, the maximum unused memory amount, the minimum unused memory amount, the maximum unused network bandwidth, and the minimum unused network bandwidth are determined from the target data set.

[0060] Then, based on the maximum unused CPU capacity and the minimum unused CPU capacity, a normalization operation is performed on the unused CPU capacity to generate a normalized unused CPU capacity.

[0061] For example, the maximum unused CPU capacity can be determined from the target data set and denoted as X max ; The minimum unused CPU capacity determined from the target dataset and is denoted as X min ; The unused CPU capacity corresponding to the target time point is recorded as X; The normalized unused CPU capacity corresponding to the target time point is recorded as X new ; then we can use formula (1) to get X new The formula (1) is:

[0062]

[0063] The meanings of the letters in formula (1) refer to the description of the above embodiment and will not be repeated here.

[0064] Secondly, based on the maximum unused memory amount and the minimum unused memory amount, a normalization operation is performed on the unused memory amount to generate a normalized unused memory amount.

[0065] It is understandable that the amount of unused memory of the backend server at the target time point can be normalized with reference to formula (1) to obtain a normalized amount of unused content.

[0066] Finally, based on the maximum unused network bandwidth and the minimum unused network bandwidth, the unused network bandwidth is normalized to generate a normalized unused network bandwidth.

[0067] It is understandable that the unused network bandwidth of the backend server at the target time can be normalized with reference to formula (1) to obtain the normalized unused network bandwidth.

[0068] In the third step, a comprehensive load value corresponding to the target time point is generated based on the normalized unused CPU capacity, the normalized unused memory amount, and the normalized unused network bandwidth.

[0069] This step specifically includes:

[0070] First, the ratio of the normalized unused CPU capacity of the backend server at the target time point to the total CPU capacity of the backend server is taken as the first value; the first value is recorded as X(cpu) in this application; the first value is called the residual load of the CPU in this application.

[0071] Secondly, the ratio of the normalized unused memory amount of the backend server at the target time point to the total memory capacity of the backend server is taken as the second value; the second value is recorded as X(mem) in this application; the second value is called the residual load of the memory in this application.

[0072] Again, the ratio of the normalized unused network bandwidth of the backend server at the target time point to the total network bandwidth of the backend server is taken as the third value; the third value is denoted as X(net) in this application; the third value is referred to as the residual load of the network bandwidth in this application.

[0073] Finally, based on the first value, the second value and the third value, the comprehensive load value corresponding to the target time point is generated. That is, the first value, the second value and the third value are substituted into formula (2) to generate the comprehensive load value corresponding to the target time point. Formula (2) is:

[0074] Comprehensive load value = first weight × first value + second weight × second value + third weight × third value (2)

[0075] In formula (2), the first weight, the second weight and the third weight represent the importance of the corresponding first value, the second value and the third value respectively. In the present application, the first value, the second value and the third value are all percentage values. In the present application, the sum of the first weight, the second weight and the third weight is 1.

[0076] S102, inputting the target data set into a previously trained prediction model to generate a predicted comprehensive load value at a future moment.

[0077] The future time in this application is a time after the current time.

[0078] The prediction model in the present application is a pre-trained neural network model used to output the predicted comprehensive load value at a future moment.

[0079] In an optional implementation, the following method may be used to obtain a trained prediction model, including:

[0080] The first step is to build the model to be trained.

[0081] In this application, a long short-term memory network is used as a model to be trained. The long short-term memory network can effectively retain and operate information in a long time series, and can decide which information fragments to retain, update or discard by using a gating unit.

[0082] Each unit in the LSTM network is designed to "remember" the relevant information that has passed through the network and "forget" the unimportant parts. This "memory" and "forgetting" is achieved by adding "gate" components to the network architecture; "gates" use different activation functions to control the flow of information.

[0083] There are three key "gates" in the LSTM network, namely the "forget gate", "input gate" and "output gate". These three "gates" work together to regulate how information is stored and transmitted in cells by integrating the hidden state of the previous moment, the current input and possible cell states.

[0084] The input "gate" determines the amount of information written to the internal state from the current input; through the Sigmoid function, the input gate controls which new pieces of information should be added to the unit state.

[0085] The forget "gate" determines the extent to which previous data should be forgotten; through the Sigmoid function, the forget gate controls which information will be discarded from the memory and determines how much past information we should retain.

[0086] The output "gate" determines which output the current internal state will produce, which output will become the next hidden state; through the sigmoid function, the output gate conditionally decides which information will be read from memory.

[0087] Modulation function: Usually a hyperbolic tangent function, as part of the input gate, it regulates the information that the input gate writes to the internal state by introducing nonlinear factors and centering the information.

[0088] At the heart of the LSTM network is a memory cell that controls the storage and retrieval of information through a gate control unit. The memory cell is able to maintain its state for multiple periods of time, while the gate control unit is responsible for regulating the flow of information in and out of the memory cell.

[0089] The function of the input "gate" is to evaluate whether the current state should be covered by new external information. In the long short-term memory network, the operation of the input "gate" is shown in formula (3):

[0090] i t =σ k (Wi x t +U i h t-1 +b i ) (3)

[0091] In formula (3), i t is the input gate vector; σ k is the Sigmoid function; W i is the parameter matrix from the input vector to the input gate; U i is the parameter matrix from the previous hidden state to the input gate; x t is the input vector of the current time step; h t-1 is the output vector of the previous time step; b i is the bias vector for the input gate.

[0092] The output vector determines whether to keep the state of the current unit, and is defined as shown in formula (4):

[0093] o t =σ k (W o x t +U o h t-1 +b o ) (4)

[0094] In formula (4), o t represents the output gate vector; σ k is the Sigmoid function; W o is the parameter matrix from the input vector to the output gate; U o is the parameter matrix from the previous hidden state to the output gate; x t is the input vector of the current time step; h t-1 is the output vector of the previous time step; b o is the bias vector for the output gate.

[0095] The forgetting "gate" in the LSTM network allows the LSTM network model to reset its state, which is defined as shown in formula (5):

[0096] f t =σ k (W f x t +U f h t-1 +b f ) (5)

[0097] In formula (4), f t represents the forget gate vector; σ k is the Sigmoid function; W fis the parameter matrix from the input vector to the forget gate; U f is the parameter matrix from the previous hidden state to the forget gate; x t is the input vector of the current time step; h t-1 is the output vector of the previous time step; b f : Bias vector of forget gate.

[0098] Formula (6) and Formula (7) show how to obtain the cell state and output from the input "gate", forget "gate" and output "gate". The expressions of Formula (6) and Formula (7) are:

[0099] c t =f t ⊙c t-1 +i t ⊙tanh(W f x t +U c h t-1 +b c ) (6)

[0100] h t =o t ⊙σ h (c t )or h t =o t ⊙tanh(c t ) (7)

[0101] Among them, c t is the cell state at the current time step; f t is the forget gate vector; c t-1 is the cell state at the previous time step; i t is the input gate vector; tanh is the hyperbolic tangent activation function, which is used to compress the result of the linear combination into the range of [-1,1]; W f is the parameter matrix from the input vector to the forget gate; x t is the input vector of the current time step; U c is the parameter matrix from the hidden state to the cell state at the previous moment; h t-1 is the output vector of the previous time step; b c is the cell state bias vector; h t is the output vector of the current time step; o t is the output gate vector; σ h and tanh both represent hyperbolic tangent functions; ⊙ represents the Hadamard product.

[0102] The second step is to obtain the sample comprehensive load value corresponding to each sample time point in multiple sample time points before the first time point as a sample data set; and obtain the sample comprehensive load value corresponding to the second time point after the first time point.

[0103] The method for obtaining the sample comprehensive load value corresponding to each sample time point can refer to the method for obtaining the comprehensive load value corresponding to the target time point disclosed in the aforementioned embodiment, which will not be repeated here.

[0104] Similarly, the method for obtaining the sample comprehensive load value corresponding to the second time point will not be described in detail here.

[0105] It should be noted that after obtaining multiple sample data sets and the sample comprehensive load value corresponding to each sample data set, the above content can be divided into a training set, a validation set and a test set.

[0106] It is understandable that the training set is used to train the model to be trained; the validation set is used to tune the hyperparameters; and the test set is used to evaluate the final performance of the model. This application does not elaborate on the relevant contents of this data set, training set, and test set.

[0107] The third step is to input the sample data set into the prediction model to be trained to generate a sample prediction comprehensive load value.

[0108] Specifically, the sample data set is input into the prediction model to be trained constructed in the first step to generate a sample prediction comprehensive load value.

[0109] The fourth step is to train the prediction model to be trained based on the predicted comprehensive load value and the sample comprehensive load value corresponding to the second moment to generate a trained prediction model.

[0110] Specifically, based on the difference between the predicted comprehensive load value and the sample comprehensive load value corresponding to the second moment, the prediction model to be trained is trained through the loss function to generate a trained prediction model.

[0111] Among them, the mean square error (RMSE) and mean absolute percentage error (MAPE) can be used as loss functions. The mean square error is used to measure the average error between the predicted value (predicted comprehensive load value) and the true value (the sample comprehensive load value corresponding to the second moment); the smaller the mean square error, the better the prediction effect of the model; and the mean absolute percentage error is used to evaluate the relative error of the model.

[0112] The mean square error is shown in formula (8):

[0113]

[0114] In formula (8), vestimated is the predicted value (predicted comprehensive load value), vreal is the real value (the sample comprehensive load value corresponding to the second moment), N is the number of samples; j is the jth sample; j∈(1,N).

[0115] In formula (9), vestimated is the predicted value (predicted comprehensive load value), vreal is the real value (the sample comprehensive load value corresponding to the second moment), and N is the number of samples.

[0116] It should be noted that k-fold cross validation (such as 3-fold cross validation) can be used to ensure the generalization ability of the prediction model. By dividing the data into different training and validation sets, the model can be prevented from overfitting on a specific data set.

[0117] After the target input level is input into the trained prediction model, the predicted comprehensive load value at the future moment can be generated.

[0118] S103: Adjust the load weight of the backend server based on the predicted comprehensive load value.

[0119] After obtaining the predicted comprehensive load value at the future moment, it can be determined whether the predicted comprehensive load value is greater than the preset load threshold; if the predicted comprehensive load value is greater than or equal to the preset reference threshold, the load weight of the back-end server at the current moment is adjusted from the first value to the second value; if the predicted comprehensive load value is less than or equal to the preset reference threshold, the load weight of the back-end server is maintained at the first value.

[0120] That is, after obtaining the predicted comprehensive load value at a future time, the load weight of the back-end server can be adjusted based on the relationship between the predicted comprehensive load value and the preset reference threshold; that is, when it is determined that the load of the back-end server will be large in the future, the load weight of the back-end server can be dynamically reduced in advance to reduce access pressure.

[0121] Figure 2 A schematic diagram of adjusting the load weight of a backend server through Nginx is provided in an embodiment of the present application. Figure 2 As shown, the function of Nginx weight adjustment can be extended to automatically receive the weight adjustment information sent by the server and make dynamic adjustments.

[0122] To summarize, the method for adjusting the load weight of the back-end server provided in the present application does not only focus on the real-time data of the back-end server, but is based on the historical system status data of the back-end server, including data such as CPU usage, memory usage, and network bandwidth usage, and the predicted comprehensive load value for future times generated by the trained prediction model. It flexibly adjusts the load weight of the back-end server, improves the intelligence level of the scheduling strategy based on the load balancing middleware, and achieves better system performance and user experience.

[0123] Based on the method for adjusting the load weight of the back-end server disclosed in the aforementioned embodiment, the present application further discloses a device for adjusting the load weight of the back-end server, referred to as the adjusting device. Figure 3 A schematic diagram of a structure of a load weight adjustment device for a backend server provided in an embodiment of the present application. Figure 3 As shown, the regulating device 300 disclosed in the present application includes:

[0124] The target data set acquisition module 301 is used to acquire the comprehensive load value corresponding to each target time point among multiple target time points as the target data set; the comprehensive load value is a value calculated based on the CPU usage, memory usage and network bandwidth usage of the backend server; the target time point is a time point before the current time point;

[0125] A predicted comprehensive load value generating module 302 is used to input the target data set into a previously trained prediction model to generate a predicted comprehensive load value;

[0126] The load weight adjustment module 303 is used to adjust the load weight of the backend server based on the predicted comprehensive load value.

[0127] In an optional implementation, the load weight adjustment module 303 includes:

[0128] A judging unit, used to judge whether the predicted comprehensive load value is greater than a preset load threshold;

[0129] a first adjusting unit, configured to adjust the load weight of the backend server at the current moment from a first value to a second value if the predicted comprehensive load value is greater than or equal to a preset reference threshold; the first value is greater than the second value;

[0130] The second adjustment unit is used to maintain the load weight of the backend server at the first value if the predicted comprehensive load value is less than the preset reference threshold.

[0131] In an optional implementation, the target data set acquisition module 301 includes:

[0132] A first data acquisition unit, used to acquire unused CPU capacity, unused memory and unused network bandwidth of the backend server at the target time point;

[0133] a normalization operation unit, configured to perform normalization operations on the unused CPU capacity, the unused memory amount, and the unused network bandwidth, respectively, to obtain a normalized unused CPU capacity, a normalized unused memory amount, and a normalized unused network bandwidth;

[0134] The comprehensive load value generating unit is used to generate the comprehensive load value corresponding to the target time point based on the normalized unused CPU capacity, the normalized unused memory amount and the normalized unused network bandwidth.

[0135] In an optional implementation, the comprehensive load value generating unit includes:

[0136] a first ratio generating subunit, configured to use a ratio of the normalized unused CPU capacity to the total CPU capacity of the backend server as a first value;

[0137] a second ratio generating subunit, configured to use a ratio of the normalized unused memory amount to the total memory capacity of the backend server as a second value;

[0138] A third ratio generating subunit, configured to use the ratio of the normalized unused network bandwidth to the total network bandwidth of the backend server as a third value;

[0139] The comprehensive load value generating subunit is used to generate the comprehensive load value corresponding to the target time point based on the first value, the second value and the third value.

[0140] In an optional implementation, the normalization operation unit includes:

[0141] A reference data acquisition subunit, configured to determine the maximum unused CPU capacity, the minimum unused CPU capacity, the maximum unused memory amount, the minimum unused memory amount, the maximum unused network bandwidth, and the minimum unused network bandwidth from the target data set;

[0142] a first normalization operation subunit, configured to perform a normalization operation on the unused CPU capacity based on the maximum unused CPU capacity and the minimum unused CPU capacity to generate the normalized unused CPU capacity;

[0143] A second normalization operation subunit, configured to perform a normalization operation on the unused memory amount based on the maximum unused memory amount and the minimum unused memory amount to generate the normalized unused memory amount;

[0144] The third normalization operation subunit is configured to perform a normalization operation on the unused network bandwidth based on the maximum unused network bandwidth and the minimum unused network bandwidth to generate the normalized unused network bandwidth.

[0145] In an optional implementation, the adjustment device 300 further includes a training module, which specifically includes:

[0146] A sample data set acquisition unit, used to acquire a sample comprehensive load value corresponding to each sample time point in a plurality of sample time points before the first time point as a sample data set;

[0147] A sample comprehensive load value acquisition unit, used to acquire a sample comprehensive load value corresponding to a second time point after the first time point;

[0148] A sample prediction comprehensive load value generating unit, used for inputting the sample data set into the prediction model to be trained to generate a sample prediction comprehensive load value;

[0149] The prediction model acquisition unit is used to train the prediction model to be trained based on the predicted comprehensive load value and the sample comprehensive load value corresponding to the second moment, so as to generate a trained prediction model.

[0150] Based on the method and device for adjusting the load weight of the back-end server provided in the aforementioned embodiments, the present application also provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements some or all of the steps in the method for adjusting the load weight of the back-end server mentioned above.

[0151] Based on the method and device for adjusting the load weight of the backend server provided in the above-mentioned embodiment, the present application further provides an electronic device, including:

[0152] a memory having a computer program stored thereon;

[0153] The processor is used to execute the computer program in the memory to implement part or all of the steps in the method for adjusting the load weight of the back-end server provided in the above embodiment.

[0154] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely schematic, in which the unit described as a separate component may or may not be physically separated, and the component prompted as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0155] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application 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 adjusting the load weight of a backend server, characterized in that: The method is applied to load balancing middleware, and the method includes: Obtaining a comprehensive load value corresponding to each target time point among multiple target time points as a target data set; the comprehensive load value is a value calculated based on the CPU usage, memory usage and network bandwidth usage of the backend server; the target time point is a time point before the current time point; Inputting the target data set into a previously trained prediction model to generate a predicted comprehensive load value at a future moment; the future moment is a moment after the current moment; Based on the predicted comprehensive load value, the load weight of the backend server is adjusted.

2. The method according to claim 1, characterized in that The adjusting the load weight of the backend server based on the predicted comprehensive load value includes: Determining whether the predicted comprehensive load value is greater than a preset load threshold; If the predicted comprehensive load value is greater than or equal to a preset reference threshold, the load weight of the backend server at the current moment is adjusted from a first value to a second value; the first value is greater than the second value; If the predicted comprehensive load value is less than the preset reference threshold, the load weight of the backend server is maintained at the first value.

3. The method according to claim 1, characterized in that The method for obtaining the comprehensive load value corresponding to the target time point includes: Obtaining unused CPU capacity, unused memory, and unused network bandwidth of the backend server at the target time point; Normalizing the unused CPU capacity, the unused memory amount, and the unused network bandwidth to obtain a normalized unused CPU capacity, a normalized unused memory amount, and a normalized unused network bandwidth; Based on the normalized unused CPU capacity, the normalized unused memory amount, and the normalized unused network bandwidth, a comprehensive load value corresponding to the target time point is generated.

4. The method according to claim 3, characterized in that The generating, based on the normalized unused CPU capacity, the normalized unused memory amount, and the normalized unused network bandwidth, a comprehensive load value corresponding to the target time point includes: Taking the ratio of the normalized unused CPU capacity to the total CPU capacity of the backend server as the first value; Taking the ratio of the normalized unused memory amount to the total memory capacity of the backend server as the second value; Taking the ratio of the normalized unused network bandwidth to the total network bandwidth of the backend server as a third value; Based on the first value, the second value and the third value, a comprehensive load value corresponding to the target time point is generated.

5. The method according to claim 3, characterized in that: The normalizing operation is performed on the unused CPU capacity, the unused memory amount, and the unused network bandwidth to obtain the normalized unused CPU capacity, the normalized unused memory amount, and the normalized unused network bandwidth, including: Determining from the target data set the maximum unused CPU capacity, the minimum unused CPU capacity, the maximum unused memory amount, the minimum unused memory amount, the maximum unused network bandwidth, and the minimum unused network bandwidth; Based on the maximum unused CPU capacity and the minimum unused CPU capacity, normalizing the unused CPU capacity to generate the normalized unused CPU capacity; Based on the maximum unused memory amount and the minimum unused memory amount, normalize the unused memory amount to generate the normalized unused memory amount; Based on the maximum unused network bandwidth and the minimum unused network bandwidth, a normalization operation is performed on the unused network bandwidth to generate the normalized unused network bandwidth.

6. The method according to claim 1, characterized in that The training step of the prediction model includes: Obtaining a sample comprehensive load value corresponding to each sample time point in a plurality of sample time points before the first time point as a sample data set; Obtaining a sample comprehensive load value corresponding to a second time point after the first time point; Inputting the sample data set into the prediction model to be trained to generate a sample prediction comprehensive load value; Based on the predicted comprehensive load value and the sample comprehensive load value corresponding to the second moment, the prediction model to be trained is trained to generate a trained prediction model.

7. The method according to claim 6, characterized in that The prediction model to be trained is a long short-term memory network.

8. A device for adjusting the load weight of a backend server, characterized in that: The device is installed in the load balancing middleware; the device includes: The target data set acquisition module is used to acquire the comprehensive load value corresponding to each target time point among multiple target time points as the target data set; the comprehensive load value is a value calculated based on the CPU usage, memory usage and network bandwidth usage of the backend server; the target time point is a time point before the current time point; A predicted comprehensive load value generation module is used to input the target data set into a previously trained prediction model to generate a predicted comprehensive load value; The load weight adjustment module is used to adjust the load weight of the back-end server based on the predicted comprehensive load value.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.

10. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 7.