A method and device for scheduling Internet of Things load balancing tasks based on LSTM-SVM
By adopting the LSTM-SVM load balancing task scheduling method in the Internet of Things, the problem of long response time and low throughput caused by the static load balancing algorithm, and achieve a more efficient task scheduling and a better service experience.
Patent Information
- Application Number
- CN202411690259.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-11-25
AI Technical Summary
Existing static load balancing algorithms lead to longer average response time and lower cluster throughput and request response success rates.
Adopt the LSTM-SVM-based IoT load balancing task scheduling method. Through receiving task requests, obtain comprehensive performance indicators and load indicators, predict the number of connections to request, calculate the number of edge node requests, determine whether the threshold is exceeded, and wait for the time model to wait through the task waiting time model Screening the best marginal node for task deployment.
The throughput and request response success rate of the edge node cluster has been increased, and the average waiting time of concurrent requests is shortened, which provides a better service experience.
Smart Images

Figure CN119179564B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a method and device for scheduling load balancing tasks of an Internet of Things based on LSTM-SVM. Background Art
[0002] Static load balancing algorithm refers to distributing requests in a certain proportion without considering the real-time load status of the server, only using some statistical values or mathematical functions, mainly including polling scheduling algorithm, weighted polling scheduling algorithm, address hash scheduling algorithm and consistent hashing algorithm. At present, the average response time of traditional static load balancing algorithms is long, and the cluster throughput and request response success rate are low.
[0003] In order to solve the above problems, the present invention develops an Internet of Things load balancing task scheduling method based on LSTM-SVM to solve the above problems. Summary of the invention
[0004] The present invention proposes an Internet of Things load balancing task scheduling method and device based on LSTM-SVM to solve the problems of long average response time, low cluster throughput and low request response success rate of the existing static load balancing algorithm.
[0005] The present invention achieves the above-mentioned purpose through the following technical solutions:
[0006] On the one hand, the present invention provides an Internet of Things load balancing task scheduling method based on LSTM-SVM, comprising:
[0007] Receive task requests;
[0008] Obtaining the comprehensive performance index requirements and comprehensive load index requirements of the task request;
[0009] Obtain the comprehensive performance indicators, comprehensive load indicators, and current number of requested connections of edge node clusters and edge nodes;
[0010] Determine whether the task request specifies an edge node in the edge node cluster as a designated edge node, if so, deploy the task corresponding to the task request through the designated edge node, if not, proceed to the next step;
[0011] According to the comprehensive performance index requirement and the comprehensive load index requirement, set the comprehensive performance index maximum value, the comprehensive load index maximum value, the comprehensive performance index threshold, the comprehensive load index threshold and the requested connection number threshold of the edge node;
[0012] Determine whether the current number of requested connections exceeds the requested connection number threshold, and if not, input the current number of requested connections into a requested connection number prediction model to predict the number of requested connections of the edge node at the next moment, wherein the requested connection number prediction model is a model constructed by an LSTM algorithm;
[0013] Calculate the edge node request connection number based on the weighted algorithm according to the current request connection number and the next moment request connection number;
[0014] Determine whether the number of edge node connection requests exceeds the threshold value of the number of connection requests, if not, determine whether the comprehensive performance index exceeds the maximum value of the comprehensive performance index, if not, proceed to the next step;
[0015] Determine whether the comprehensive load index exceeds the maximum value of the comprehensive load index, if not, proceed to the next step;
[0016] Determine whether the comprehensive performance indicator requirement exceeds the comprehensive performance indicator threshold, if not, proceed to the next step;
[0017] Determine whether the comprehensive load index requirement exceeds the comprehensive load index threshold, if not, proceed to the next step;
[0018] Inputting the comprehensive performance index, comprehensive load index and number of connection requests of the edge node into a task waiting time model, and outputting a prediction result, wherein the prediction result includes the task waiting time of each edge node, and the task waiting time model is a model constructed by a PSO-SVM algorithm;
[0019] The prediction results are sorted, and the edge node with the shortest task waiting time among all the edge nodes is screened out to obtain the best edge node, and the task corresponding to the task request is deployed through the best edge node.
[0020] Furthermore, the edge node cluster is obtained, including:
[0021] Get the original edge node cluster;
[0022] Screening out all original edge nodes that meet the deployment condition in the original edge node cluster to form a new edge node cluster, wherein the deployment condition is to determine whether the original edge node has hardware and software resources capable of deploying the task corresponding to the task request;
[0023] The new edge node cluster is used as the edge node cluster.
[0024] Specifically, the request connection number prediction model is constructed by using the LSTM algorithm, including:
[0025] Build an LSTM model based on the LSTM algorithm;
[0026] Constructing an input matrix according to the historical data of the number of requested connections of the edge node and the specific time;
[0027] Performing standardization processing on the input matrix to obtain standardized data;
[0028] Dividing the standardized data into a training set and a test set;
[0029] The LSTM model is trained according to the training set. During the training process, the ReLU function is used as the activation function of the LSTM model, Hyperopt is used to adjust the model parameters of the LSTM model, the Dropout method is used to optimize the inter-layer overfitting degree of the LSTM model, and the Adam method is used to optimize the LSTM model to obtain the request connection number prediction model.
[0030] Hyperopt is a python library for hyperparameter optimization, Dropout method is a discarding method, Dropout method is a regularization technique for deep learning neural networks, aimed at preventing overfitting, and Adam method is a gradient descent-based optimization algorithm used to solve nonlinear equations.
[0031] Specifically, the input matrix is normalized to obtain normalized data, including:
[0032] Calculating the mean of the input matrix;
[0033] Calculating the variance of the input matrix;
[0034] Calculating the difference between the input matrix and the mean;
[0035] The ratio of the difference to the variance is calculated to obtain the standardized data.
[0036] Specifically, the task waiting time model is constructed by the PSO-SVM algorithm, including:
[0037] Build an SVM model based on the SVM algorithm;
[0038] The PSO algorithm is used to optimize the SVM model;
[0039] Using the performance index historical data, load index historical data and request connection number historical data of the edge node as model input;
[0040] The optimized SVM model is trained according to the model input to obtain the task waiting time model.
[0041] Furthermore, the PSO algorithm is used to optimize the SVM model, including:
[0042] Initialize a particle swarm, where each particle represents a set of SVM model parameters, the position of the particle represents the penalty coefficient of the SVM model, and the velocity of the particle represents the kernel function of the SVM model;
[0043] Update the position and velocity of the particle, use the predicted average error value g[γ(t)] as the objective function fitness value for determining the optimal position of the particle, optimize the SVM model parameters, and calculate the predicted average error value as follows:
[0044] ,
[0045] M error is the error of the predicted time data, M totai is the number of predicted data;
[0046] The particle position update formula is:
[0047] ,
[0048] P i Substitute (t+1) into the particle swarm algorithm iteration formula:
[0049] ,
[0050] ,
[0051] P i (t) represents the position of particle i at the current moment, P i (t+1) represents the position of particle i at the next moment, g[γ(t+1)] represents the average prediction error value at the next moment, and g[P i (t)] represents the current fitness value of particle i, γ(t+1) represents the parameter to be optimized at the next moment, where w is the inertia weight factor, c1 and c2 are acceleration factors; r 1j (t), r 2j (t) is a random function that varies relatively independently between [0,1], x ij (t) represents the position of particle i in the j-dimensional space at time t, x ij (t+1) represents the position of particle i in the j-dimensional space at time t+1, v ij (t) represents the velocity of particle i in the j-dimensional space at time t, that is, the distance the particle moves in each iteration, v ij (t+1) represents the velocity of particle i in the j-dimensional space at time t+1, P ij (t) is the historical optimal solution of a single particle i under the optimized jth parameter, Pgj (t) represents the historical optimal solution of all particles in the optimized jth parameter;
[0052] The particle position and velocity are continuously iterated and updated according to the particle swarm algorithm iteration formula until the preset stop condition is reached, and finally the optimal SVM model parameters are obtained.
[0053] Furthermore, the comprehensive performance index and comprehensive load index of the edge node are obtained, including:
[0054] Obtaining CPU utilization, hard disk utilization, memory utilization, and bandwidth utilization of the edge node;
[0055] The comprehensive performance index of the edge node is calculated based on the CPU utilization, hard disk utilization, memory utilization and bandwidth utilization of the edge node based on the priority graph method;
[0056] Obtain the CPU size, hard disk size, memory size, and bandwidth size of the edge node;
[0057] The comprehensive load index of the edge node is obtained based on the priority graph method according to the CPU size, hard disk size, memory size and bandwidth size of the edge node.
[0058] Furthermore, the method for scheduling Internet of Things load balancing tasks based on LSTM-SVM of the present invention further includes evaluating the prediction results, and the step of evaluating the prediction results includes:
[0059] Obtaining the task waiting time of each edge node in the edge node cluster after the task is deployed on the optimal edge node;
[0060] Calculating the average task waiting time of the edge node cluster according to the task waiting time of each edge node in the edge node cluster;
[0061] It is determined whether the average task waiting time does not exceed a preset threshold, where the preset threshold is the average task waiting time under load balancing of the edge node cluster.
[0062] Specifically, calculating the edge node request connection number based on a weighted algorithm according to the current request connection number and the next moment request connection number includes:
[0063] Sorting the current number of requested connections and the number of requested connections at the next moment in order of importance;
[0064] Calculate a first weight of the current request connection number and a second weight of the next moment request connection number based on a priority graph method according to the sorted current request connection number and the next moment request connection number;
[0065] The edge node requested connection number is obtained by weighted calculation according to the first weight, the second weight, the current requested connection number and the next moment requested connection number.
[0066] On the other hand, the present invention also provides an Internet of Things load balancing task scheduling device based on LSTM-SVM, the device comprising:
[0067] A receiving module, wherein the receiving module is used to receive a task request;
[0068] A first acquisition module, the first acquisition module is used to obtain the comprehensive performance index requirement and the comprehensive load index requirement of the task request;
[0069] A second acquisition module, the second acquisition module is used to obtain the comprehensive performance index, comprehensive load index and current request connection number of the edge node cluster and the edge node;
[0070] A first judgment module, wherein the first judgment module is used to judge whether the task request specifies an edge node in the edge node cluster as a designated edge node, and if so, deploy the task corresponding to the task request through the designated edge node; if not, proceed to the next step;
[0071] A setting module, the setting module is used to set the comprehensive performance index maximum value, the comprehensive load index maximum value, the comprehensive performance index threshold, the comprehensive load index threshold and the requested connection number threshold of the edge node according to the comprehensive performance index requirement and the comprehensive load index requirement;
[0072] a second judgment module, wherein the second judgment module is used to judge whether the current number of requested connections exceeds the threshold value of the number of requested connections, and if not, input the current number of requested connections into a prediction model of the number of requested connections to predict the number of requested connections of the edge node at the next moment, wherein the prediction model of the number of requested connections is a model constructed by an LSTM algorithm;
[0073] A calculation module, the calculation module is used to calculate the edge node request connection number based on the weighted algorithm according to the current request connection number and the next moment request connection number;
[0074] A third judgment module, the third judgment module is used to judge whether the number of edge node request connections exceeds the request connection number threshold, if not, judge whether the comprehensive performance index exceeds the comprehensive performance index maximum value, if not, proceed to the next step;
[0075] A fourth judgment module, the fourth judgment module is used to judge whether the comprehensive load index exceeds the comprehensive load index maximum value, if not, proceed to the next step;
[0076] A fifth judgment module, the fifth judgment module is used to judge whether the comprehensive performance index requirement exceeds the comprehensive performance index threshold, if not, proceed to the next step;
[0077] A sixth judgment module, the sixth judgment module is used to judge whether the comprehensive load index requirement exceeds the comprehensive load index threshold, if not, proceed to the next step;
[0078] A prediction module, wherein the prediction module is used to input the comprehensive performance index, comprehensive load index and number of connection requests of the edge node into a task waiting time model, and output a prediction result, wherein the prediction result includes the task waiting time of each edge node, and the task waiting time model is a model constructed by a PSO-SVM algorithm;
[0079] A screening module is used to sort the prediction results, screen out the edge node with the shortest task waiting time among all the edge nodes, obtain the best edge node, and deploy the task corresponding to the task request through the best edge node.
[0080] The beneficial effects of the present invention are:
[0081] The IoT load balancing task scheduling method based on LSTM-SVM proposed in the present invention comprehensively considers the performance indicators of edge nodes, real-time load information and traffic burstiness of servers, solves the pressure brought by high concurrent requests to edge nodes, and provides users with a better service experience. Compared with traditional load balancing solutions, the load balancing solution proposed in this paper not only improves the edge node cluster throughput and request response success rate, but also greatly shortens the average waiting time of concurrent requests. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Figure 1 It is a flow chart of the load balancing method in an embodiment of the present invention. DETAILED DESCRIPTION
[0083] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0084] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0085] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0086] In the description of the present invention, it should be understood that the terms "upper", "lower", "inside", "outside", "left", "right", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, or are directions or positional relationships in which the product of the invention is usually placed when in use, or are directions or positional relationships commonly understood by those skilled in the art. These directions or positional relationships are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.
[0087] Furthermore, the terms “first”, “second”, etc. are merely used for distinguishing descriptions and should not be understood as indicating or implying relative importance.
[0088] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms such as "setting" and "connection" should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0089] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings.
[0090] like Figure 1 As shown, a method for scheduling Internet of Things load balancing tasks based on LSTM-SVM includes:
[0091] Receive task requests;
[0092] Obtaining the comprehensive performance index requirements and comprehensive load index requirements of the task request;
[0093] Obtaining comprehensive performance indicators, comprehensive load indicators, and current number of requested connections of the edge node cluster and the edge node;
[0094] Determine whether the task request specifies an edge node in the edge node cluster as a designated edge node, if so, deploy the task corresponding to the task request through the designated edge node, if not, proceed to the next step;
[0095] According to the comprehensive performance index requirement and the comprehensive load index requirement, set the comprehensive performance index maximum value, the comprehensive load index maximum value, the comprehensive performance index threshold, the comprehensive load index threshold and the requested connection number threshold of the edge node;
[0096] Determine whether the current number of requested connections exceeds the requested connection number threshold, and if not, input the current number of requested connections into a requested connection number prediction model to predict the number of requested connections of the edge node at the next moment, wherein the requested connection number prediction model is a model constructed by an LSTM algorithm;
[0097] Calculate the edge node request connection number based on the weighted algorithm according to the current request connection number and the next moment request connection number;
[0098] Determine whether the number of edge node connection requests exceeds the threshold value of the number of connection requests, if not, determine whether the comprehensive performance index exceeds the maximum value of the comprehensive performance index, if not, proceed to the next step;
[0099] Determine whether the comprehensive load index exceeds the maximum value of the comprehensive load index, if not, proceed to the next step;
[0100] Determine whether the comprehensive performance indicator requirement exceeds the comprehensive performance indicator threshold, if not, proceed to the next step;
[0101] Determine whether the comprehensive load index requirement exceeds the comprehensive load index threshold, if not, proceed to the next step;
[0102] Inputting the comprehensive performance index, comprehensive load index and number of connection requests of the edge node into a task waiting time model, and outputting a prediction result, wherein the prediction result includes the task waiting time of each edge node, and the task waiting time model is a model constructed by a PSO-SVM algorithm;
[0103] The prediction results are sorted, and the edge node with the shortest task waiting time among all the edge nodes is screened out to obtain the best edge node, and the task corresponding to the task request is deployed through the best edge node.
[0104] Current number of request connections: This is a direct factor that directly affects the current load of the edge node. If the current number of request connections is high, it means that the edge node needs more resources to process these requests, otherwise it may cause service delays or interruptions. Prediction of the number of request connections at the next moment: By predicting the number of request connections in the future, the edge node can prepare and optimize resource allocation in advance. For example, if it is predicted that a large number of requests will pour in at the next moment, the edge node can increase resource allocation in advance to ensure that the service can smoothly handle these requests and avoid service degradation due to insufficient resources. In summary, the number of request connections of the edge node is not only affected by the current request, but also needs to predict the request at the next moment.
[0105] The advantages of the above judgment process sequence provided by the present invention are:
[0106] 1. Improve processing efficiency:
[0107] Comparing each element to the threshold directly can be very time-consuming. If you determine the maximum value first, you can quickly determine whether the entire data set is likely to exceed a certain threshold. If the maximum value is less than the threshold, there is no need to compare the remaining elements one by one, thus saving a lot of computing resources.
[0108] 2. Logical clarity:
[0109] Determining the maximum value first can help us better understand the distribution of the data. Knowing the maximum value of the data can provide us with an intuitive reference point, making it easier to set a reasonable threshold. In addition, this order is also in line with the intuition of human beings in dealing with problems, that is, to understand the overall situation first and then make specific judgments.
[0110] 3 Reduce the misjudgment rate:
[0111] Comparing each element directly to the threshold may result in a high false positive rate. If there are a large number of outliers in the data, these values may falsely trigger the threshold condition. By first determining the maximum value, we can more accurately identify these outliers and give them special treatment when necessary, thereby reducing the false positive rate.
[0112] 4. Support parallel processing:
[0113] Determining the maximum value first can be used as a preprocessing step to provide useful information for subsequent parallel processing. Each node can first calculate the maximum value of local data, and then aggregate these maximum values to the central node to calculate the global maximum value. In this way, subsequent threshold judgments can be made based on the global maximum value, thereby supporting more efficient parallel processing.
[0114] like Figure 1As shown, in some embodiments, obtaining an edge node cluster includes:
[0115] Get the original edge node cluster;
[0116] Screening out all original edge nodes that meet the deployment condition in the original edge node cluster to form a new edge node cluster, wherein the deployment condition is to determine whether the original edge node has hardware and software resources capable of deploying the task corresponding to the task request;
[0117] The new edge node cluster is used as the edge node cluster.
[0118] The edge nodes that do not meet the deployment conditions are first eliminated, thereby reducing the subsequent data processing amount of this method.
[0119] In some embodiments, the request connection number prediction model is constructed by using an LSTM algorithm, including:
[0120] Build an LSTM model based on the LSTM algorithm;
[0121] Constructing an input matrix according to the historical data of the number of requested connections of the edge node and the specific time;
[0122] Performing standardization processing on the input matrix to obtain standardized data;
[0123] Dividing the standardized data into a training set and a test set;
[0124] The LSTM model is trained according to the training set. During the training process, the ReLU function is used as the activation function of the LSTM model, Hyperopt is used to adjust the model parameters of the LSTM model, the Dropout method is used to optimize the inter-layer overfitting degree of the LSTM model, and the Adam method is used to optimize the LSTM model to obtain the request connection number prediction model.
[0125] In some embodiments, the input matrix is normalized to obtain normalized data, including:
[0126] Calculating the mean of the input matrix;
[0127] Calculating the variance of the input matrix;
[0128] Calculating the difference between the input matrix and the mean;
[0129] The ratio of the difference to the variance is calculated to obtain the standardized data.
[0130] In some embodiments, the task waiting time model is constructed by the PSO-SVM algorithm, including:
[0131] Build an SVM model based on the SVM algorithm;
[0132] The PSO algorithm is used to optimize the SVM model;
[0133] Using the performance index historical data, load index historical data and request connection number historical data of the edge node as input for building the model;
[0134] The PSO-SVM model is trained according to the model input to obtain the task waiting time model.
[0135] The SVM model is used to predict the node task waiting time. The SVM model is created based on the knowledge of high-dimensional feature space to transform the input variable x nonlinearly. The data in is mapped to a high-dimensional feature space F. The basic structure of the nonlinear mapping is:
[0136] ,
[0137] ,
[0138] Then the objective function y=f(x)=wφ(x)+b, where y is the final predicted value, w and b are the parameter vectors of the function; φ(x) represents the nonlinear transformation function, and the predicted value is obtained by solving the following optimal problem.
[0139] Assume that the training data set is (x i ,y i ),in, Where N is the number of samples, x i is the input quantity, ,in The element of the input quantity.
[0140] Here we select the performance index of edge nodes P(N i )Node load L(N i ) and the edge node request connection number Rank(N i ) as the input of the SVM model, that is, Indicates. i ,y j are all class labels, y i ,y j The unit of α is milliseconds (ms). i and α j are Lagrange multipliers, σ(t) is the kernel function, and C(t) is the penalty coefficient. γ(t) is the value of the parameter optimization process of the parameter to be optimized during the iteration process. The radial kernel function is selected, and γ(t) is substituted into it to construct and solve the following optimal problem:
[0141] ,
[0142] ,
[0143] ,
[0144] Obtain a set of Lagrange multiplier coefficient solutions . Select a positive component 0 < α in α * <C(t), and calculate the threshold b based on this i * : * :
[0145] ,
[0146] Thus, a decision function, i.e., a regression function (objective function), can be constructed
[0147] ,
[0148] According to this objective function, the task waiting time can be solved
[0149] In some embodiments, the SVM model is optimized using the PSO algorithm, including:
[0150] Initialize the particle swarm. Each particle represents a set of SVM model parameters. The position of the particle represents the penalty coefficient of the SVM model, and the velocity of the particle represents the kernel function of the SVM model
[0151] Update the position and velocity of the particle. Use the predicted average error value g[γ(t)] as the objective function fitness value for determining the optimal position of the particle, and optimize the SVM model parameters. The calculation formula of the predicted average error value is as follows:
[0152] ,
[0153] M error is the error of the predicted time data, and M totai is the number of predicted data
[0154] The position update formula of the particle is:
[0155] ,
[0156] Substitute P i (t + 1) into the particle swarm algorithm iteration formula:
[0157] ,
[0158] ,
[0159] P i (t) represents the position of particle i at the current moment, P i (t+1) represents the position of particle i at the next moment, g[γ(t+1)] represents the average prediction error value at the next moment, and g[P i (t)] represents the current fitness value of particle i, γ(t+1) represents the parameter to be optimized at the next moment, where w is the inertia weight factor, c1 and c2 are acceleration factors; r 1j (t), r 2j (t) is a random function that varies relatively independently between [0,1], x ij (t) represents the position of particle i in the j-dimensional space at time t, x ij (t+1) represents the position of particle i in the j-dimensional space at time t+1, v ij (t) represents the velocity of particle i in the j-dimensional space at time t, that is, the distance the particle moves in each iteration, v ij (t+1) represents the velocity of particle i in the j-dimensional space at time t+1, P ij (t) is the historical optimal solution of a single particle i under the optimized jth parameter, P gj (t) represents the historical optimal solution of all particles in the optimized jth parameter;
[0160] The particle position and velocity are continuously iterated and updated according to the particle swarm algorithm iteration formula until the preset stop condition is reached, and finally the optimal SVM model parameters are obtained.
[0161] In order to evaluate the present invention, the following four formulas are used as evaluation criteria:
[0162] ,
[0163] ,
[0164] ,
[0165] ,
[0166] Among them U i is the actual value, is the actual mean value, is the model prediction value, is the simulated value of the variable in the statistical model; N is the sample size. The model performance rating criteria are shown in Table 1.
[0167] Table 1
[0168] Performance Rating <![CDATA[R 2 ]]> NSE very good <![CDATA[0.75<R 2 <=1.00]]> 0.75<NSE<=1.00 good <![CDATA[0.65<R 2 <=0.75]]> 0.65<NSE<=0.75 Meet the requirements <![CDATA[0.50<R 2 <=0.65]]> 0.50<NSE<=0.65 Not meeting the requirements <![CDATA[R 2 <=0.50]]> NSE<=0.50
[0169] The closer the mean absolute error (MAE) and mean square error (RMSE) are to 0, the better the performance of the model; the efficiency coefficient (NSE) and determination coefficient ( ) is closer to 1, the better the performance of the model.
[0170] In some embodiments, obtaining the comprehensive performance index and the comprehensive load index of the edge node includes:
[0171] Obtaining CPU utilization, hard disk utilization, memory utilization, and bandwidth utilization of the edge node;
[0172] The comprehensive performance index of the edge node is calculated based on the CPU utilization, hard disk utilization, memory utilization and bandwidth utilization of the edge node based on the priority graph method;
[0173] Obtain the CPU size, hard disk size, memory size, and bandwidth size of the edge node;
[0174] The comprehensive load index of the edge node is obtained based on the priority graph method according to the CPU size, hard disk size, memory size and bandwidth size of the edge node.
[0175] Different priority levels are assigned to the influencing parameters of different task types. CPU-intensive tasks have the highest CPU priority, while bandwidth-intensive tasks have the highest bandwidth priority.
[0176] In some embodiments, the step further includes evaluating the prediction result, and the step of evaluating the prediction result includes:
[0177] Obtaining the task waiting time of each edge node in the edge node cluster after the task is deployed on the optimal edge node;
[0178] Calculating the average task waiting time of the edge node cluster according to the task waiting time of each edge node in the edge node cluster;
[0179] It is determined whether the average task waiting time does not exceed a preset threshold, where the preset threshold is the average task waiting time under load balancing of the edge node cluster.
[0180] Assume that there are N edge nodes in the edge cluster, and the task waiting time of the edge node is T(N i ), then the average task waiting time of all edge nodes is The smaller the task waiting time, the greater the possibility of assigning the task request. The task waiting time is proportional to the performance of the edge node. The performance index of the edge node P(N i) is higher, the more requests can be processed. However, as the edge node runs for a long time, the remaining performance of the server will become less and less, and this indicator will be limited. Therefore, we introduce the real-time load L(N) of the edge node. i ), the load of edge nodes is inversely proportional to the task waiting time. The higher the load, the fewer requests the edge nodes can process. In addition, different edge nodes have different performances. Processing the same number of requests may only occupy a small part of the resources for high-performance edge nodes, but for low-performance edge nodes, it may have occupied most of the resources, which is also load imbalance. Therefore, this invention introduces the indicator of request connection number, which is inversely proportional to the task waiting time. In summary, we use the average task waiting time of the edge node cluster to evaluate the load balancing of the edge node cluster.
[0181] The load balancing of edge node clusters mainly focuses on how to reasonably distribute tasks or data traffic to multiple computing resources in order to improve system performance, increase system reliability, and provide scalability. The average task waiting time, as an indicator for evaluating the effect of load balancing, can reflect the efficiency and fairness of the system's task allocation. If the average task waiting time is short, it means that tasks can be quickly and evenly distributed to each node, thus achieving better load balancing. On the contrary, if the average task waiting time is long, it may mean that some nodes are overloaded while other nodes are idle, which indicates that there is a problem with load balancing.
[0182] In some embodiments, calculating the edge node request connection number based on the weighted algorithm according to the current request connection number and the next moment request connection number includes:
[0183] Sorting the current number of requested connections and the number of requested connections at the next moment in order of importance;
[0184] Calculate a first weight of the current request connection number and a second weight of the next moment request connection number based on a priority graph method according to the sorted current request connection number and the next moment request connection number;
[0185] The edge node requested connection number is obtained by weighted calculation according to the first weight, the second weight, the current requested connection number and the next moment requested connection number.
[0186] SVM model feature vector selection, the present invention selects the edge node performance index P(N i ), load index L(N i ) and the edge node request connection number Rank(N i )These three edge node features are used as input feature vectors.
[0187] in ,
[0188] a1+a2+a3+a4=1, where a1 is Cs i The weight of a2 is Ds i The weight of a3 is Ms i The weight of a4 represents Bs i The weight of
[0189] L(N i )=b1Cu+b2Du+b3Mu+b4Bu,
[0190] b1+b2+b3+b4=1, where b1 is the weight of Cu, b2 is the weight of Du, b3 is the weight of Mu, and b4 is the weight of Bu;
[0191] Among them, Cu represents CPU utilization, Du represents hard disk utilization, Mu represents memory utilization, Bu represents bandwidth utilization, and Cs i Indicates the CPU size, Ds i Indicates the hard disk size, Ms i Indicates memory size, Bs i Indicates the bandwidth size.
[0192] The number of edge node connection requests is not only related to the number of connections at the next moment, q t+1 (N i ) and the number of connections q at the current moment t (N i ) has a great relationship, so the edge node request connection number Rank (N i )for:
[0193] ,
[0194] c1+c2=1;
[0195] The weight setting is determined by the priority diagram method. Both the AHP and the priority diagram method are subjective weighting methods. These two methods use the size information of the data to calculate the weights. The principle of the priority diagram method is to use a matrix diagram to compare and analyze the importance of each factor to the target. Since the AHP method often encounters the problem that the judgment matrix cannot pass the consistency test in practical applications, the priority diagram method is easier to understand, simple to operate, and has a higher credibility of results. The process of the priority diagram method is as follows:
[0196] The importance of system indicators X1, X2, ... Xn is ranked (taking node performance indicators as an example). Different types of tasks have different rankings. For CPU-intensive tasks, CPU>bandwidth>disk>memory, for disk IO-intensive tasks, disk>memory>CPU>bandwidth, and for network IO-intensive tasks, bandwidth>CPU>disk>memory. The following takes CPU-intensive tasks as an example.
[0197] Draw a chessboard diagram and compare them pairwise. Experts compare the indicators pairwise. If the indicator Xi is more important than the indicator Xj, Xi gets 1 point; if they are equally important, Xi gets 0.5 points; if the indicator Xj is more important than the indicator Xi, Xi gets 0 points. The comparison results are shown in Table 2:
[0198] Table 2
[0199] CPU bandwidth disk Memory Index score CPU 0.5 1 1 1 3.5 bandwidth 0 0.5 1 1 2.5 disk 0 0 0.5 1 1.5 Memory 0 0 0 0.5 0.5
[0200] Determination of indicator weights:
[0201] The CPU weight is , the bandwidth weight is , the disk weight is , the memory weight is .
[0202] In summary, for CPU-intensive tasks, , .
[0203] The calculation principles of the number of requested connections and load indicator weights of other edge nodes are the same as above.
[0204] The priority graph method is used to calculate the weights of edge node performance indicators and load indicators. Different indicator weights are used for different task types, which greatly improves the data processing speed and accuracy.
[0205] The embodiment of the present invention further provides an Internet of Things load balancing task scheduling device based on LSTM-SVM, characterized in that the device comprises:
[0206] A receiving module, wherein the receiving module is used to receive a task request;
[0207] A first acquisition module, the first acquisition module is used to obtain the comprehensive performance index requirement and the comprehensive load index requirement of the task request;
[0208] A second acquisition module, the second acquisition module is used to obtain the comprehensive performance index, comprehensive load index and current request connection number of the edge node cluster and the edge node;
[0209] A first judgment module, wherein the first judgment module is used to judge whether the task request specifies an edge node in the edge node cluster as a designated edge node, and if so, deploy the task corresponding to the task request through the designated edge node; if not, proceed to the next step;
[0210] A setting module, the setting module is used to set the comprehensive performance index maximum value, the comprehensive load index maximum value, the comprehensive performance index threshold, the comprehensive load index threshold and the requested connection number threshold of the edge node according to the comprehensive performance index requirement and the comprehensive load index requirement;
[0211] a second judgment module, wherein the second judgment module is used to judge whether the current number of requested connections exceeds the threshold value of the number of requested connections, and if not, input the current number of requested connections into a prediction model of the number of requested connections to predict the number of requested connections of the edge node at the next moment, wherein the prediction model of the number of requested connections is a model constructed by an LSTM algorithm;
[0212] A calculation module, the calculation module is used to calculate the edge node request connection number based on the weighted algorithm according to the current request connection number and the next moment request connection number;
[0213] A third judgment module, the third judgment module is used to judge whether the number of edge node request connections exceeds the request connection number threshold, if not, judge whether the comprehensive performance index exceeds the comprehensive performance index maximum value, if not, proceed to the next step;
[0214] A fourth judgment module, the fourth judgment module is used to judge whether the comprehensive load index exceeds the comprehensive load index maximum value, if not, proceed to the next step;
[0215] A fifth judgment module, the fifth judgment module is used to judge whether the comprehensive performance index requirement exceeds the comprehensive performance index threshold, if not, proceed to the next step;
[0216] A sixth judgment module, the sixth judgment module is used to judge whether the comprehensive load index requirement exceeds the comprehensive load index threshold, if not, proceed to the next step;
[0217] A prediction module, wherein the prediction module is used to input the comprehensive performance index, comprehensive load index and number of connection requests of the edge node into a task waiting time model, and output a prediction result, wherein the prediction result includes the task waiting time of each edge node, and the task waiting time model is a model constructed by a PSO-SVM algorithm;
[0218] A screening module is used to sort the prediction results, screen out the edge node with the shortest task waiting time among all the edge nodes, obtain the best edge node, and deploy the task corresponding to the task request through the best edge node.
[0219] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for scheduling Internet of Things load balancing tasks based on LSTM-SVM, characterized in that: include: Receive task requests; Obtaining the comprehensive performance index requirements and comprehensive load index requirements of the task request; Obtain the comprehensive performance indicators, comprehensive load indicators, and current number of requested connections of edge node clusters and edge nodes; Determine whether the task request specifies an edge node in the edge node cluster as a designated edge node, if so, deploy the task corresponding to the task request through the designated edge node, if not, proceed to the next step; According to the comprehensive performance index requirement and the comprehensive load index requirement, set the comprehensive performance index maximum value, the comprehensive load index maximum value, the comprehensive performance index threshold, the comprehensive load index threshold and the requested connection number threshold of the edge node; Determine whether the current number of requested connections exceeds the requested connection number threshold, and if not, input the current number of requested connections into a requested connection number prediction model to predict the number of requested connections of the edge node at the next moment, wherein the requested connection number prediction model is a model constructed by an LSTM algorithm; Calculate the edge node request connection number based on the weighted algorithm according to the current request connection number and the next moment request connection number; Determine whether the number of edge node connection requests exceeds the threshold value of the number of connection requests, if not, determine whether the comprehensive performance index exceeds the maximum value of the comprehensive performance index, if not, proceed to the next step; Determine whether the comprehensive load index exceeds the maximum value of the comprehensive load index, if not, proceed to the next step; Determine whether the comprehensive performance indicator requirement exceeds the comprehensive performance indicator threshold, if not, proceed to the next step; Determine whether the comprehensive load index requirement exceeds the comprehensive load index threshold, if not, proceed to the next step; Inputting the comprehensive performance index, comprehensive load index and number of connection requests of the edge node into a task waiting time model, and outputting a prediction result, wherein the prediction result includes the task waiting time of each edge node, and the task waiting time model is a model constructed by a PSO-SVM algorithm; The prediction results are sorted, and the edge node with the shortest task waiting time among all the edge nodes is screened out to obtain the best edge node, and the task corresponding to the task request is deployed through the best edge node.
2. According to a method for scheduling Internet of Things load balancing tasks based on LSTM-SVM according to claim 1, it is characterized in that: Get the edge node cluster, including: Get the original edge node cluster; Screening out all original edge nodes that meet the deployment condition in the original edge node cluster to form a new edge node cluster, wherein the deployment condition is to determine whether the original edge node has hardware and software resources capable of deploying the task corresponding to the task request; The new edge node cluster is used as the edge node cluster.
3. The method for scheduling Internet of Things load balancing tasks based on LSTM-SVM according to claim 1, characterized in that: The request connection number prediction model is constructed by using the LSTM algorithm, including: Build an LSTM model based on the LSTM algorithm; Constructing an input matrix according to the historical data of the number of requested connections of the edge node and the specific time; Performing standardization processing on the input matrix to obtain standardized data; Dividing the standardized data into a training set and a test set; The LSTM model is trained according to the training set. During the training process, the ReLU function is used as the activation function of the LSTM model, Hyperopt is used to adjust the model parameters of the LSTM model, the Dropout method is used to optimize the inter-layer overfitting degree of the LSTM model, and the Adam method is used to optimize the LSTM model to obtain the request connection number prediction model.
4. The method for scheduling Internet of Things load balancing tasks based on LSTM-SVM according to claim 3 is characterized in that: The input matrix is normalized to obtain normalized data, including: Calculating the mean of the input matrix; Calculating the variance of the input matrix; Calculating the difference between the input matrix and the mean; The ratio of the difference to the variance is calculated to obtain the standardized data.
5. The method for scheduling Internet of Things load balancing tasks based on LSTM-SVM according to claim 1, characterized in that: The task waiting time model is constructed using the PSO-SVM algorithm, including: Build an SVM model based on the SVM algorithm; The PSO algorithm is used to optimize the SVM model; Using the performance index historical data, load index historical data and request connection number historical data of the edge node as model input; The optimized SVM model is trained according to the model input to obtain the task waiting time model.
6. The method for scheduling Internet of Things load balancing tasks based on LSTM-SVM according to claim 5, characterized in that: The PSO algorithm is used to optimize the SVM model, including: Initialize a particle swarm, where each particle represents a set of SVM model parameters, the position of the particle represents the penalty coefficient of the SVM model, and the velocity of the particle represents the kernel function of the SVM model; Update the position and velocity of the particle, use the predicted average error value g[γ(t)] as the objective function fitness value for determining the optimal position of the particle, optimize the SVM model parameters, and calculate the predicted average error value as follows: , M error is the error of the predicted time data, M totai is the number of predicted data; The particle position update formula is: , P i Substitute (t+1) into the particle swarm algorithm iteration formula: , , P i (t) represents the position of particle i at the current moment, P i (t+1) represents the position of particle i at the next moment, g[γ(t+1)] represents the average prediction error value at the next moment, and g[P i (t)] represents the current fitness value of particle i, γ(t+1) represents the parameter to be optimized at the next moment, where w is the inertia weight factor, c1 and c2 are acceleration factors; r 1j (t), r 2j (t) is a random function that varies relatively independently between [0,1], x ij (t) represents the position of particle i in the j-dimensional space at time t, x ij (t+1) represents the position of particle i in the j-dimensional space at time t+1, v ij (t) represents the velocity of particle i in the j-dimensional space at time t, that is, the distance the particle moves in each iteration, v ij (t+1) represents the velocity of particle i in the j-dimensional space at time t+1, P ij (t) is the historical optimal solution of a single particle i under the optimized jth parameter, P gj (t) represents the historical optimal solution of all particles in the optimized jth parameter; The particle position and velocity are continuously iterated and updated according to the particle swarm algorithm iteration formula until the preset stop condition is reached, and finally the optimal SVM model parameters are obtained.
7. The method for scheduling Internet of Things load balancing tasks based on LSTM-SVM according to claim 1, characterized in that: Obtaining comprehensive performance indicators and comprehensive load indicators of the edge node, including: Obtaining CPU utilization, hard disk utilization, memory utilization, and bandwidth utilization of the edge node; The comprehensive performance index of the edge node is calculated based on the CPU utilization, hard disk utilization, memory utilization and bandwidth utilization of the edge node based on the priority graph method; Obtain the CPU size, hard disk size, memory size, and bandwidth size of the edge node; The comprehensive load index of the edge node is obtained based on the priority graph method according to the CPU size, hard disk size, memory size and bandwidth size of the edge node.
8. The method for scheduling Internet of Things load balancing tasks based on LSTM-SVM according to claim 1, characterized in that: The step of evaluating the prediction result includes: Obtaining the task waiting time of each edge node in the edge node cluster after the task is deployed on the optimal edge node; Calculating the average task waiting time of the edge node cluster according to the task waiting time of each edge node in the edge node cluster; It is determined whether the average task waiting time does not exceed a preset threshold, where the preset threshold is the average task waiting time under load balancing of the edge node cluster.
9. The method for scheduling Internet of Things load balancing tasks based on LSTM-SVM according to claim 1, characterized in that: Calculating the edge node request connection number based on the weighted algorithm according to the current request connection number and the next moment request connection number, including: Sorting the current number of requested connections and the number of requested connections at the next moment in order of importance; Calculate a first weight of the current request connection number and a second weight of the next moment request connection number based on a priority graph method according to the sorted current request connection number and the next moment request connection number; The edge node requested connection number is obtained by weighted calculation according to the first weight, the second weight, the current requested connection number and the next moment requested connection number.
10. An Internet of Things load balancing task scheduling device based on LSTM-SVM, characterized in that: The device comprises: A receiving module, wherein the receiving module is used to receive a task request; A first acquisition module, the first acquisition module is used to obtain the comprehensive performance index requirement and the comprehensive load index requirement of the task request; A second acquisition module, the second acquisition module is used to obtain the comprehensive performance index, comprehensive load index and current request connection number of the edge node cluster and the edge node; A first judgment module, wherein the first judgment module is used to judge whether the task request specifies an edge node in the edge node cluster as a designated edge node, and if so, deploy the task corresponding to the task request through the designated edge node; if not, proceed to the next step; A setting module, the setting module is used to set the comprehensive performance index maximum value, the comprehensive load index maximum value, the comprehensive performance index threshold, the comprehensive load index threshold and the requested connection number threshold of the edge node according to the comprehensive performance index requirement and the comprehensive load index requirement; a second judgment module, wherein the second judgment module is used to judge whether the current number of requested connections exceeds the threshold value of the number of requested connections, and if not, input the current number of requested connections into a prediction model of the number of requested connections to predict the number of requested connections of the edge node at the next moment, wherein the prediction model of the number of requested connections is a model constructed by an LSTM algorithm; A calculation module, the calculation module is used to calculate the edge node request connection number based on the weighted algorithm according to the current request connection number and the next moment request connection number; A third judgment module, the third judgment module is used to judge whether the number of edge node request connections exceeds the request connection number threshold, if not, judge whether the comprehensive performance index exceeds the comprehensive performance index maximum value, if not, proceed to the next step; A fourth judgment module, the fourth judgment module is used to judge whether the comprehensive load index exceeds the comprehensive load index maximum value, if not, proceed to the next step; A fifth judgment module, the fifth judgment module is used to judge whether the comprehensive performance index requirement exceeds the comprehensive performance index threshold, if not, proceed to the next step; A sixth judgment module, the sixth judgment module is used to judge whether the comprehensive load index requirement exceeds the comprehensive load index threshold, if not, proceed to the next step; A prediction module, wherein the prediction module is used to input the comprehensive performance index, comprehensive load index and number of connection requests of the edge node into a task waiting time model, and output a prediction result, wherein the prediction result includes the task waiting time of each edge node, and the task waiting time model is a model constructed by a PSO-SVM algorithm; A screening module is used to sort the prediction results, screen out the edge node with the shortest task waiting time among all the edge nodes, obtain the best edge node, and deploy the task corresponding to the task request through the best edge node.
Citation Information
Patent Citations
Identification analysis node load balancing device based on machine learning
CN111930511A
Edge cloud dynamic service scheduling system and method based on LSTM
CN117931390A