Open source system resource scheduling management method and system based on service traffic prediction
Through the combination of deep neural network model and ant colony algorithm, the traffic of service nodes is predicted and resource configuration is dynamically adjusted, which solves the problem of failure to effectively predict traffic changes and unbalanced resource allocation in the existing technology, and achieves efficient resource management and load balancing, improving system performance and stability.
Patent Information
- Application Number
- CN202510713186.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-05-30
AI Technical Summary
The existing resource scheduling methods lack the ability to predict future traffic changes, resulting in the system's reaction lag when facing sudden traffic and unable to prepare resources in advance, which can easily lead to a decline in service quality or waste of resources. In addition, traditional load balancing algorithms fail to fully consider the heterogeneity and dynamic change characteristics of service nodes, making it difficult to perform refined resource allocation, reducing the overall resource utilization efficiency of the system.
By constructing a deep neural network model, predicting the future traffic of the service node, calculating dynamic weight coefficients based on the calculation capability parameters, and using them as heuristic information of the ant colony algorithm, combining resource availability indexes as constraints for path selection, and generating resource allocation plans through iterative optimization, and dynamically adjusting resource configuration.
It realizes accurate prediction of system resource requirements, avoids resource waste and service quality reduction, improves resource scheduling flexibility and adaptability, improves the overall performance and stability of open source systems, reduces system response time, and improves resource utilization.
Smart Images

Figure CN120238443B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of resource management, and in particular to an open source system resource scheduling management method and system based on service traffic prediction. Background Art
[0002] With the rapid development of cloud computing and distributed systems, open source systems have become widely used in various internet services and enterprise applications. These open source systems typically consist of multiple service nodes that collectively provide computing, storage, and network resources. In actual operation, the traffic load faced by each service node often exhibits significant temporal fluctuations and imbalances, posing a severe challenge to the efficient scheduling and management of system resources. Traditional resource scheduling and management methods, primarily based on static configuration or simple load balancing strategies, are unable to adapt to the complex and changing service traffic environment.
[0003] Most existing resource scheduling methods rely on the current system status to make decisions and lack the ability to predict future traffic changes. This causes the system to react slowly to sudden traffic flows and fail to prepare resources in advance, which can easily lead to a decline in service quality or waste of resources.
[0004] Traditional load balancing algorithms usually adopt fixed weights or simple polling mechanisms, which fail to fully consider the heterogeneity and dynamic change characteristics of service nodes. It is difficult to perform refined resource allocation based on the actual computing power and current load conditions of the nodes, reducing the overall resource utilization efficiency of the system.
[0005] Existing resource scheduling strategies often lack a global optimization perspective and fail to take into account multi-dimensional indicators such as service response time and resource utilization. It is difficult to balance the relationship between system performance and resource cost in the resource allocation decision-making process, resulting in the system under high load conditions. Summary of the Invention
[0006] The embodiments of the present invention provide an open source system resource scheduling management method and system based on service traffic prediction, which can solve the problems in the prior art.
[0007] In a first aspect of an embodiment of the present invention, historical traffic data of each service node in an open source system is obtained, a deep neural network model is constructed based on the historical traffic data, and the traffic of each service node in a future time window is predicted using the deep neural network model to obtain predicted traffic data;
[0008] Calculate a dynamic weight coefficient based on the predicted traffic data and the computing capacity parameters of each service node;
[0009] Collect resource status information of each service node in the open source system in real time, and calculate the resource availability index of each service node based on the resource status information;
[0010] Inputting the dynamic weight coefficient and the resource availability index into an improved ant colony algorithm, wherein: the dynamic weight coefficient is used as heuristic information of the ant colony algorithm, the resource availability index is used as a constraint condition for path selection, and a resource allocation plan is generated through an iterative optimization process, wherein the pheromone update rule in the iterative optimization process is dynamically adjusted based on service response time and resource utilization;
[0011] According to the resource allocation scheme, a service migration sequence and a resource allocation instruction are generated, the service migration operation is performed in the order of the service migration sequence, and the resource configuration of each service node is adjusted according to the resource allocation instruction.
[0012] The deep neural network model is used to predict the traffic flow of each service node in the future time window, and the predicted traffic data obtained includes:
[0013] The deep neural network model includes: an input layer for receiving pre-processed training data; a feature extraction layer that uses a one-dimensional convolutional network to extract time series features; an attention mechanism layer for calculating feature weights at different time points; a long short-term memory network layer for capturing long-term dependencies in time series data; a fully connected layer for feature dimensionality reduction and combination; and an output layer for outputting prediction results.
[0014] Based on the historical traffic data, a sliding time window method is used to construct training data, the deep neural network model is trained using the training data, an adaptive learning rate optimization algorithm is used to update the model parameters, an early stopping mechanism is introduced to prevent overfitting, and the optimal model parameters are determined through cross-validation;
[0015] The length of the prediction time window is set, the historical traffic data is input into the trained deep neural network model, and the predicted traffic data in the future time window is obtained through forward propagation of the model.
[0016] The calculation of the dynamic weight coefficient includes:
[0017] The ratio of the predicted traffic data to the preset traffic threshold is used as a basic weight, and the dynamic weight coefficient representing the load balancing degree of the service node is determined by combining the basic weight with the computing capacity parameter of the service node;
[0018] Multiply the number of processor cores of the service node by the single-core benchmark performance to get the processor performance score; divide the memory capacity by the benchmark memory capacity to get the memory performance score; divide the network transmission rate by the benchmark transmission rate to get the network performance score;
[0019] The product of the basic weight and the processor performance score is recorded as the first sub-weight; the product of the basic weight and the memory performance score is recorded as the second sub-weight; the product of the basic weight and the network performance score is recorded as the third sub-weight;
[0020] A weighted average of the first sub-weight, the second sub-weight, and the third sub-weight is used as a dynamic weight coefficient representing the degree of load balancing of the service node.
[0021] Using the dynamic weight coefficient as heuristic information of the ant colony algorithm and the resource availability index as a constraint condition for path selection, a resource allocation scheme is generated through an iterative optimization process, and the pheromone update rule in the iterative optimization process is dynamically adjusted based on the service response time and resource utilization, including:
[0022] Set the initial parameters of the ant colony algorithm, including the number of ants, the initial value of pheromone, the pheromone volatility coefficient and the maximum number of iterations;
[0023] Calculate the path selection probability of each service node: use the inverse of the dynamic weight coefficient of each service node as the heuristic information value; set the path selection probability of service nodes with available CPU quantity lower than the first preset threshold, available memory capacity lower than the second preset threshold, or available network bandwidth lower than the third preset threshold to zero; for the remaining service nodes, divide the product of pheromone concentration and heuristic information value by the sum of the products of all optional service nodes to obtain the path selection probability;
[0024] Assign ants to different nodes and each ant independently performs the following steps:
[0025] Record the service nodes that have been visited; select the next accessible service node based on the path selection probability; calculate the load variance under the current path; complete a path search when all service nodes have been visited or the load variance is less than the preset load balancing threshold;
[0026] The following operations are performed on each search path: the service response time of each service node on the path is obtained and the average response time is calculated; the resource utilization rate of each service node on the path is obtained and the average resource utilization rate is calculated; the ratio of the average response time to the benchmark response time is calculated to obtain the time evaluation coefficient; the ratio of the average resource utilization rate to the benchmark utilization rate is calculated to obtain the utilization evaluation coefficient; the pheromone increment is calculated based on the time evaluation coefficient and the utilization evaluation coefficient; the pheromone concentration on the path is updated according to the preset pheromone volatilization coefficient and the pheromone increment is superimposed;
[0027] When the maximum number of iterations is reached or the load variance change of multiple consecutive iterations is less than the convergence threshold, the path with the smallest load variance is selected as the resource allocation solution.
[0028] The pheromone increment is calculated based on the time evaluation coefficient and the utilization evaluation coefficient; the pheromone concentration on the path is updated according to the preset pheromone volatility coefficient, and the pheromone increment is superimposed, including:
[0029] Square the time evaluation coefficient and the utilization evaluation coefficient respectively; add the square values of the two evaluation coefficients; divide the addition result by the number of evaluation coefficients; multiply the calculation result by a preset path expected gain coefficient to obtain the pheromone increment;
[0030] Get the current pheromone concentration of the path; multiply the pheromone concentration by the preset pheromone retention rate; add the pheromone increment to the current pheromone concentration; determine whether the updated pheromone concentration is within the preset range; if it exceeds the preset range, set the pheromone concentration to the range boundary value.
[0031] Generating a service migration sequence and a resource allocation instruction according to the resource allocation scheme, performing a service migration operation in the order of the service migration sequence, and adjusting the resource configuration of each service node according to the resource allocation instruction includes:
[0032] The resource allocation plan includes a list of source service nodes to be migrated, a list of target service nodes, and a target resource configuration value for each service node;
[0033] Obtain the resource usage of each service instance running on the source service node list to be migrated; calculate the remaining available resources of the service nodes in the target service node list; prioritize the source service nodes based on the resource usage of the service instances; prioritize the target service nodes based on the remaining available resources; match the source node with the highest priority with the target node with the highest priority to generate a migration sequence;
[0034] Calculate the difference between the current resource configuration value and the target resource configuration value of each service node; generate a resource expansion instruction for a service node that needs to be expanded; generate a resource reduction instruction for a service node that needs to be reduced; and form a resource allocation instruction set with the resource expansion instruction and the resource reduction instruction.
[0035] A second aspect of an embodiment of the present invention provides an open source system resource scheduling and management system based on service traffic prediction, including:
[0036] The first unit is configured to obtain historical traffic data of each service node in the open source system, construct a deep neural network model based on the historical traffic data, and predict the traffic of each service node in a future time window using the deep neural network model to obtain predicted traffic data;
[0037] The second unit is configured to calculate a dynamic weight coefficient based on the predicted traffic data and the computing capacity parameters of each service node;
[0038] The third unit is used to collect resource status information of each service node in the open source system in real time, and calculate the resource availability index of each service node based on the resource status information;
[0039] a fourth unit, configured to input the dynamic weight coefficient and the resource availability index into an improved ant colony algorithm, wherein: the dynamic weight coefficient is used as heuristic information of the ant colony algorithm, the resource availability index is used as a constraint condition for path selection, a resource allocation plan is generated through an iterative optimization process, and the pheromone update rule in the iterative optimization process is dynamically adjusted based on service response time and resource utilization;
[0040] The fifth unit is used to generate a service migration sequence and a resource allocation instruction according to the resource allocation plan, perform the service migration operation in the order of the service migration sequence, and adjust the resource configuration of each service node according to the resource allocation instruction.
[0041] According to a third aspect of an embodiment of the present invention, an electronic device is provided, including:
[0042] processor;
[0043] a memory for storing processor-executable instructions;
[0044] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.
[0045] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described above is implemented.
[0046] The beneficial effects of this application are as follows:
[0047] The present invention predicts service node traffic by constructing a deep neural network model and calculates dynamic weight coefficients in combination with computing power parameters, thereby achieving accurate prediction of system resource requirements and effectively avoiding the resource waste and service quality degradation caused by traditional static resource allocation methods.
[0048] The present invention integrates dynamic weight coefficients and resource availability indicators into an improved ant colony algorithm, uses dynamic weights as heuristic information and resource availability as constraints, and generates resource allocation schemes through iterative optimization, thereby improving the flexibility and adaptability of resource scheduling and being able to dynamically adjust resource allocation strategies according to traffic changes.
[0049] The present invention is based on a dynamic weight calculation mechanism of predicted traffic and computing power parameters, combined with real-time monitoring of resource status, to achieve efficient allocation and load balancing of system resources, significantly improving the overall performance and stability of the open source system, reducing system response time, improving resource utilization, and providing users with a smoother service experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a flow chart of an open source system resource scheduling and management method based on service traffic prediction according to an embodiment of the present invention;
[0051] Figure 2 This is a flow chart of updating and adjusting pheromone concentration according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0053] The following specific embodiments are used to describe the technical solution of the present invention in detail. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0054] Figure 1 FIG. 1 is a flow chart of an open source system resource scheduling management method based on service traffic prediction according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0055] Obtain historical traffic data for each service node in the open source system, build a deep neural network model based on the historical traffic data, and use the deep neural network model to predict the traffic of each service node in a future time window to obtain predicted traffic data;
[0056] Calculate a dynamic weight coefficient based on the predicted traffic data and the computing capacity parameters of each service node;
[0057] Collect resource status information of each service node in the open source system in real time, and calculate the resource availability index of each service node based on the resource status information;
[0058] Inputting the dynamic weight coefficient and the resource availability index into an improved ant colony algorithm, wherein: the dynamic weight coefficient is used as heuristic information of the ant colony algorithm, the resource availability index is used as a constraint condition for path selection, and a resource allocation plan is generated through an iterative optimization process, wherein the pheromone update rule in the iterative optimization process is dynamically adjusted based on service response time and resource utilization;
[0059] According to the resource allocation scheme, a service migration sequence and a resource allocation instruction are generated, the service migration operation is performed in the order of the service migration sequence, and the resource configuration of each service node is adjusted according to the resource allocation instruction.
[0060] In an optional embodiment, the traffic flow in a future time window of each service node is predicted by the deep neural network model, and the predicted traffic flow data obtained includes:
[0061] The deep neural network model includes: an input layer for receiving pre-processed training data; a feature extraction layer that uses a one-dimensional convolutional network to extract time series features; an attention mechanism layer for calculating feature weights at different time points; a long short-term memory network layer for capturing long-term dependencies in time series data; a fully connected layer for feature dimensionality reduction and combination; and an output layer for outputting prediction results.
[0062] Based on the historical traffic data, a sliding time window method is used to construct training data, the deep neural network model is trained using the training data, an adaptive learning rate optimization algorithm is used to update the model parameters, an early stopping mechanism is introduced to prevent overfitting, and the optimal model parameters are determined through cross-validation;
[0063] The length of the prediction time window is set, the historical traffic data is input into the trained deep neural network model, and the predicted traffic data in the future time window is obtained through forward propagation of the model.
[0064] Preprocess historical traffic data. This preprocessing step includes data cleaning, normalization, and time windowing. During data cleaning, outliers are detected and processed. For example, if the traffic value at a certain point in time exceeds three times the historical average, it is replaced with the average value of the previous and subsequent points in time. Normalization uses the minimum-maximum normalization method to map traffic data to the [0, 1] range. The calculation formula can be expressed as: subtract the minimum value from the original data and divide it by the difference between the maximum and minimum values. For example, if the original traffic data range is [100Mbps, 5000Mbps], the normalized data range is [0, 1].
[0065] Build a deep neural network model. This model consists of six key layers: input layer, feature extraction layer, attention mechanism layer, long short-term memory network layer, fully connected layer, and output layer. The input layer receives preprocessed training data. The input dimension is [batch size, time window length, number of features]. For example, [64, 24, 5] indicates a batch size of 64, a time window length of 24 hours, and 5 features at each time point. The feature extraction layer uses a one-dimensional convolutional network with 32 convolution kernels, a kernel size of 3, a stride of 1, padding of "same", and a ReLU activation function. This one-dimensional convolution operation extracts temporal features and captures local temporal patterns.
[0066] The attention mechanism layer is used to calculate feature weights at different time points. This layer calculates an attention score, which represents the correlation between the current prediction and the data at each historical time point. In practice, a trainable weight matrix is used to map input features into three representation spaces: query, key, and value. The similarity between the query and the key is calculated to obtain an attention score, which is then softmax-normalized to obtain a weight coefficient. Finally, the weight coefficient is multiplied by the value to obtain a weighted feature representation. For example, for a 24-hour input sequence, the attention mechanism assigns higher weights to data from the most recent hours (e.g., 0.15-0.2) and lower weights to data from earlier time points (e.g., 0.01-0.05).
[0067] The Long Short-Term Memory (LSTM) network layer consists of 128 LSTM cells, designed to capture long-term dependencies in time series data. The LSTM cell incorporates three gating mechanisms: an input gate, a forget gate, and an output gate, enabling it to learn temporal dependencies in long sequences. The input gate controls the extent to which new information enters the cell state, the forget gate determines how much information from previous states is retained, and the output gate controls the influence of the cell state on the current output. The output dimension of the LSTM layer is [batch size, time window length, 128].
[0068] The fully connected layer consists of two densely connected neural network layers. The first layer contains 64 neurons and uses the ReLU activation function; the second layer contains 32 neurons and also uses the ReLU activation function. The fully connected layer performs feature dimensionality reduction and combination, mapping the high-dimensional features output by the LSTM layer into a more compact representation space. The output layer is a dense layer of a single neuron that does not use an activation function and directly outputs the predicted traffic value.
[0069] Training data is constructed using a sliding time window approach based on historical traffic data. For example, if the input window length is set to 24 hours and the prediction window length is set to 6 hours, multiple samples are extracted from the historical data. Each sample contains 24 consecutive hours of data as input, and the following 6 hours of data as the prediction target. The sliding step is set to 1 hour, that is, a new training sample is created each time the sliding step moves backward by 1 hour. In this way, approximately 690 training samples can be generated from one month (720 hours) of historical data.
[0070] The training process uses the Adam optimization algorithm, with an initial learning rate of 0.001 and an adaptive learning rate adjustment strategy. If the validation loss does not improve after five consecutive epochs, the learning rate is reduced to 50%. The mean squared error (MSE) is used as the loss function, while the mean absolute percentage error (MAPE) is monitored as an evaluation metric. The training batch size is set to 64, and the maximum number of training epochs is 100.
[0071] To prevent overfitting, we introduced an early stopping mechanism and set the patience parameter to 15. This means that if the validation loss does not improve for 15 consecutive epochs, training is stopped and the optimal model parameters are restored. We also used 10-fold cross-validation to determine the optimal model parameters. The dataset was randomly split into 10 parts, with 9 parts used alternately as training and 1 as validation. The model parameter configuration with the lowest average validation loss was selected.
[0072] During the prediction phase, the prediction window is set to 6 hours. The last 24 hours of historical traffic data is preprocessed and fed into the trained deep neural network model. The model then propagates forward to generate predicted traffic data for the next 6 hours. In practice, the model can update its predictions hourly, providing a rolling forecast of traffic conditions for the next 6 hours.
[0073] Through experimental verification, the average prediction accuracy of this method on real service node traffic data reached 93.5%, and the mean absolute percentage error (MAPE) was 6.5%. Compared with traditional time series prediction methods, the prediction accuracy was improved by 15%, and it can effectively support the optimal allocation of network resources and traffic scheduling decisions.
[0074] In an optional embodiment, the calculating the dynamic weight coefficient includes:
[0075] The ratio of the predicted traffic data to the preset traffic threshold is used as a basic weight, and the dynamic weight coefficient representing the load balancing degree of the service node is determined by combining the basic weight with the computing capacity parameter of the service node;
[0076] Multiply the number of processor cores of the service node by the single-core benchmark performance to get the processor performance score; divide the memory capacity by the benchmark memory capacity to get the memory performance score; divide the network transmission rate by the benchmark transmission rate to get the network performance score;
[0077] The product of the basic weight and the processor performance score is recorded as the first sub-weight; the product of the basic weight and the memory performance score is recorded as the second sub-weight; the product of the basic weight and the network performance score is recorded as the third sub-weight;
[0078] A weighted average of the first sub-weight, the second sub-weight, and the third sub-weight is used as a dynamic weight coefficient representing the degree of load balancing of the service node.
[0079] A technical solution is proposed that uses the ratio of predicted traffic data to a preset traffic threshold as a basic weight and combines the computing power parameters of the service node to determine a dynamic weight coefficient that characterizes the load balancing degree of the service node.
[0080] Obtain predicted traffic data, which can be obtained through historical traffic analysis, machine learning prediction models, and other methods. For example, the predicted traffic data for a service node during a specific time period is 800 Mbps. The system also pre-sets a preset traffic threshold, such as 1000 Mbps, as the ideal upper limit of the service node's carrying capacity. The system calculates the ratio of the predicted traffic data to the preset traffic threshold as a base weight. In this example, the base weight is 800 / 1000 = 0.8.
[0081] To comprehensively consider the computing power of a service node, the system evaluates three key metrics: processor performance, memory performance, and network performance. For processor performance evaluation, the system obtains the number of processor cores and the per-core baseline performance of the service node. Assuming the service node is equipped with a 16-core processor and a per-core baseline performance of 3,000 points (based on a standard performance test score), the processor performance score is calculated as 16 × 3,000 = 48,000 points. If the system's processor baseline performance is set at 30,000 points, the node's processor performance score is 48,000 / 30,000 = 1.6.
[0082] For memory performance evaluation, the system obtains the memory capacity of the service node and compares it to the baseline memory capacity. Assuming the service node has 64GB of memory and the system's baseline memory capacity is 32GB, the memory performance score is calculated as 64 / 32 = 2.0.
[0083] For network performance evaluation, the system obtains the network transmission rate of the service node and compares it with the baseline transmission rate. Assuming the network transmission rate of the service node is 10Gbps and the baseline transmission rate set by the system is 5Gbps, the network performance score is calculated as 10 / 5 = 2.0.
[0084] After obtaining each performance score, the system multiplies the base weight by each performance score to obtain three sub-weights. The first sub-weight is the product of the base weight and the processor performance score, which is 0.8 × 1.6 = 1.28. The second sub-weight is the product of the base weight and the memory performance score, which is 0.8 × 2.0 = 1.6. The third sub-weight is the product of the base weight and the network performance score, which is 0.8 × 2.0 = 1.6.
[0085] To comprehensively consider the varying degrees of impact of processors, memory, and networks on the load capacity of service nodes, the system assigns different weight coefficients to the three sub-weights. Assume that, based on business characteristics analysis, the system determines that the weights of processors, memory, and networks on load capacity are 0.5, 0.3, and 0.2, respectively. The system calculates the weighted average of the three sub-weights as the final dynamic weight coefficient:
[0086] 1.28×0.5+1.6×0.3+1.6×0.2=1.28×0.5+1.6×0.5=1.44.
[0087] The dynamic weight coefficient of 1.44 represents the load balancing capability of the service node under the current forecasted traffic and hardware configuration. The system can use this coefficient to distribute load among service nodes. A higher coefficient indicates a stronger load-bearing capacity of the node, and more requests can be assigned to it.
[0088] In practice, the system regularly updates predicted traffic data and recalculates dynamic weight coefficients based on the latest data to adapt to traffic changes. For example, when the predicted traffic increases to 900 Mbps, the base weight becomes 900 / 1000 = 0.9. The corresponding first sub-weight becomes 0.9 × 1.6 = 1.44, the second sub-weight becomes 0.9 × 2.0 = 1.8, and the third sub-weight becomes 0.9 × 2.0 = 1.8. The final dynamic weight coefficient is updated to 1.44 × 0.5 + 1.8 × 0.3 + 1.8 × 0.2 = 1.44 × 0.5 + 1.8 × 0.5 = 1.62.
[0089] The system can also adjust the weighting coefficients of various performance indicators based on actual business needs. For example, for compute-intensive applications, the weight of processor performance can be increased to 0.7, while the weights of memory and network performance can be reduced to 0.2 and 0.1, respectively. For data-intensive applications, the weight of memory performance can be increased to 0.6, while the weights of processor and network performance can be reduced to 0.3 and 0.1, respectively.
[0090] This approach allows the system to dynamically adjust load balancing strategies based on both predicted traffic and the hardware performance of service nodes, improving resource utilization and ensuring service quality. This approach is particularly well-suited for resource scheduling and load balancing in cloud computing environments, effectively addressing complex situations such as traffic fluctuations and heterogeneous service nodes.
[0091] In an optional embodiment, the dynamic weight coefficient is used as heuristic information for the ant colony algorithm, the resource availability index is used as a constraint for path selection, and a resource allocation solution is generated through an iterative optimization process. The pheromone update rule in the iterative optimization process is dynamically adjusted based on the service response time and resource utilization, including:
[0092] Set the initial parameters of the ant colony algorithm, including the number of ants, the initial value of pheromone, the pheromone volatility coefficient and the maximum number of iterations;
[0093] Calculate the path selection probability of each service node: use the inverse of the dynamic weight coefficient of each service node as the heuristic information value; set the path selection probability of service nodes with available CPU quantity lower than the first preset threshold, available memory capacity lower than the second preset threshold, or available network bandwidth lower than the third preset threshold to zero; for the remaining service nodes, divide the product of pheromone concentration and heuristic information value by the sum of the products of all optional service nodes to obtain the path selection probability;
[0094] Assign ants to different nodes and each ant independently performs the following steps:
[0095] Record the service nodes that have been visited; select the next accessible service node based on the path selection probability; calculate the load variance under the current path; complete a path search when all service nodes have been visited or the load variance is less than the preset load balancing threshold;
[0096] The following operations are performed on each search path: the service response time of each service node on the path is obtained and the average response time is calculated; the resource utilization rate of each service node on the path is obtained and the average resource utilization rate is calculated; the ratio of the average response time to the benchmark response time is calculated to obtain the time evaluation coefficient; the ratio of the average resource utilization rate to the benchmark utilization rate is calculated to obtain the utilization evaluation coefficient; the pheromone increment is calculated based on the time evaluation coefficient and the utilization evaluation coefficient; the pheromone concentration on the path is updated according to the preset pheromone volatilization coefficient and the pheromone increment is superimposed;
[0097] When the maximum number of iterations is reached or the load variance change of multiple consecutive iterations is less than the convergence threshold, the path with the smallest load variance is selected as the resource allocation solution.
[0098] The dynamic weight coefficient is used as the heuristic information of the ant colony algorithm, and the resource availability index is used as the constraint condition for path selection. The resource allocation scheme is generated through an iterative optimization process.
[0099] During implementation, the system first sets the initial parameters for the ant colony algorithm. In one specific embodiment, the number of ants is set to 20, the initial pheromone value is set to 0.1, the pheromone volatility coefficient is set to 0.5, and the maximum number of iterations is set to 100. These parameters can be adjusted based on the actual application scenario to achieve better optimization results.
[0100] When calculating the path selection probability for each service node, the system uses the inverse of each service node's dynamic weight coefficient as the heuristic information value. For example, for a cloud computing environment with five service nodes, the dynamic weight coefficients of each node are [0.8, 0.6, 0.9, 0.7, 0.5], and the corresponding heuristic information values are [1.25, 1.67, 1.11, 1.43, 2.00]. The system checks the resource availability of each service node. If a node's available CPU count falls below a first preset threshold (e.g., the number of CPU cores is less than 2), its available memory capacity falls below a second preset threshold (e.g., less than 4GB of memory), or its available network bandwidth falls below a third preset threshold (e.g., less than 100Mbps), the path selection probability for that node is set to zero, indicating that the node is temporarily unavailable for selection.
[0101] For the remaining available service nodes, the system calculates the path selection probability. Assume that after resource availability screening, only nodes 1, 3, 4, and 5 are available, and node 2 is eliminated due to insufficient resources. The system then obtains the pheromone concentrations at these nodes, assuming they are [0.2, 0, 0.15, 0.25, 0.3] (the pheromone value of node 2 is not included in the calculation). Multiplying the pheromone concentrations by the heuristic information value yields [0.2 × 1.25, 0, 0.15 × 1.11, 0.25 × 1.43, 0.3 × 2.00] = [0.25, 0, 0.17, 0.36, 0.60]. Dividing these products by the sum of the products of all available nodes (0.25 + 0.17 + 0.36 + 0.60 = 1.38) yields the path selection probability [0.18, 0, 0.12, 0.26, 0.44].
[0102] When assigning ants to start from different nodes, the system ensures that the ants are evenly distributed across all available starting nodes. For example, 20 ants would be assigned to four available nodes, with five ants per node. Each ant independently performs a path search, records the service nodes it has visited, and selects the next accessible service node based on the path selection probability.
[0103] During the path search process, the ants will calculate the load variance of the current path. Assuming that the loads of the five nodes on a path are [65%, 0%, 58%, 72%, 80%] respectively, the average load is:
[0104] (65+0+58+72+80) / 5=55%;
[0105] The load variance is:
[0106] [(65-55)²+(0-55)²+(58-55)²+(72-55)²+(80-55)²] / 5=738.8.
[0107] If the preset load balancing threshold is 500, the load variance of the path exceeds the threshold and the ant continues searching. A path search is completed when the ant has visited all service nodes or the load variance is less than the preset load balancing threshold.
[0108] For each search path, the system performs a pheromone update operation. The system obtains the service response time of each service node on the path, such as [120ms, 0ms, 150ms, 100ms, 180ms], and calculates the average response time as (120+0+150+100+180) / 5=110ms.
[0109] At the same time, obtain the resource utilization of each service node on the path, such as [65%, 0%, 58%, 72%, 80%], and calculate the average resource utilization as (65+0+58+72+80) / 5=55%.
[0110] The system calculates the ratio of the average response time to the benchmark response time to obtain the time evaluation coefficient. Assuming the benchmark response time is 100ms, the time evaluation coefficient is 110 / 100 = 1.1. The system calculates the ratio of the average resource utilization to the benchmark utilization to obtain the utilization evaluation coefficient. Assuming the benchmark utilization is 60%, the utilization evaluation coefficient is 55 / 60 = 0.92.
[0111] The pheromone increment is calculated based on the time evaluation coefficient and the utilization evaluation coefficient. In one embodiment, the pheromone increment can be expressed as:
[0112] 1 / (time evaluation coefficient × utilization evaluation coefficient) = 1 / (1.1 × 0.92) = 0.99.
[0113] The pheromone concentration on the path is updated according to the preset pheromone volatility coefficient of 0.5, and the pheromone increment is superimposed.
[0114] The system will continue to iterate the above process. When the maximum number of iterations reaches 100, or when the load variance change over multiple consecutive iterations (such as 10) is less than a convergence threshold (such as 5%), the system selects the path with the smallest load variance as the final resource allocation solution.
[0115] In a complete implementation example, after 87 iterations, the system found the optimal path with a load variance of 120.5. The corresponding resource allocation scheme was to distribute tasks to nodes 1, 3, 4, and 5. The loads of each node were [62%, 0%, 59%, 65%, and 64%], respectively. The average response time was 95ms, and the average resource utilization was 62%, achieving good load balancing and resource utilization efficiency.
[0116] Through the above method, the present invention realizes the dynamic allocation of cloud computing resources based on the ant colony algorithm, effectively improves the system's load balancing and resource utilization, reduces service response time, and enhances the overall performance and stability of the cloud computing system.
[0117] In an optional embodiment, calculating the pheromone increment according to the time evaluation coefficient and the utilization evaluation coefficient; updating the pheromone concentration on the path according to the preset pheromone volatility coefficient, and superimposing the pheromone increment includes:
[0118] Square the time evaluation coefficient and the utilization evaluation coefficient respectively; add the square values of the two evaluation coefficients; divide the addition result by the number of evaluation coefficients; multiply the calculation result by a preset path expected gain coefficient to obtain the pheromone increment;
[0119] Get the current pheromone concentration of the path; multiply the pheromone concentration by the preset pheromone retention rate; add the pheromone increment to the current pheromone concentration; determine whether the updated pheromone concentration is within the preset range; if it exceeds the preset range, set the pheromone concentration to the range boundary value.
[0120] During route optimization, the time evaluation coefficient and utilization evaluation coefficient must first be obtained. The time evaluation coefficient reflects the time efficiency of the route and can be calculated by the ratio of the actual travel time to the ideal travel time. For example, if the actual travel time of a route is 30 minutes and the ideal travel time is 20 minutes, the time evaluation coefficient can be calculated as 20 / 30 = 0.67. The utilization evaluation coefficient reflects the resource utilization efficiency of the route and can be calculated by the ratio of the actual flow rate on the route to the route capacity. For example, if the actual flow rate on a route is 800 vehicles / hour and the route capacity is 1000 vehicles / hour, the utilization evaluation coefficient can be calculated as 800 / 1000 = 0.8.
[0121] After obtaining the evaluation coefficients, calculate the pheromone increment. Square the time evaluation coefficient and the utilization evaluation coefficient separately: squaring 0.67 yields 0.4489, and squaring 0.8 yields 0.64. Add these two squared values to obtain 0.4489 + 0.64 = 1.0889. Divide the result by the number of evaluation coefficients (i.e., by 2) to obtain 1.0889 / 2 = 0.54445. Finally, multiply the calculated result by the preset path expected gain coefficient. Assuming the path expected gain coefficient is 10, the pheromone increment is 0.54445 × 10 = 5.4445.
[0122] After calculating the pheromone increment, the pheromone concentration along the path needs to be updated. First, obtain the current pheromone concentration along the path. Suppose the current pheromone concentration is 20. Multiply the pheromone concentration by the preset pheromone retention rate. Assuming the pheromone retention rate is 0.9, the result is 20 × 0.9 = 18. Then, add the pheromone increment to the current pheromone concentration, obtaining 18 + 5.4445 = 23.4445.
[0123] After updating the pheromone concentration, you need to determine whether the updated pheromone concentration is within the preset range. Assuming the preset range is [10, 30], since 23.4445 is within the range, no adjustment is required. If the updated pheromone concentration exceeds the preset range, you need to set the pheromone concentration to the range boundary. For example, if the updated pheromone concentration is 35, which exceeds the upper limit of 30, the pheromone concentration is set to 30. If the updated pheromone concentration is 5, which is below the lower limit of 10, the pheromone concentration is set to 10.
[0124] Adjust relevant parameters based on different scenarios. For example, in traffic network optimization, the expected path gain coefficient can be adjusted based on road type and traffic flow characteristics. For main roads, a higher expected path gain coefficient, such as 15, can be set; for secondary roads, a medium expected path gain coefficient, such as 10, can be set; and for branch roads, a lower expected path gain coefficient, such as 5, can be set.
[0125] The pheromone retention rate can also be adjusted based on actual conditions. In scenarios with rapidly changing traffic flow, a lower pheromone retention rate, such as 0.8, can be set to more quickly adapt to changes in traffic conditions. In scenarios with relatively stable traffic flow, a higher pheromone retention rate, such as 0.95, can be set to maintain the stability of route selection.
[0126] The preset interval setting also needs to be adjusted based on actual conditions. In scenarios with complex road networks and diverse path options, a wider preset interval, such as [5, 50], can be set to increase path diversity. In scenarios with simple road networks and limited path options, a narrower preset interval, such as [15, 25], can be set to increase path selection certainty.
[0127] This method effectively updates pheromone concentrations along a route, guiding the ant colony algorithm to select a more optimal route in subsequent iterations. In a specific case study of traffic network optimization, applying this method reduced average travel time by 15% and increased overall network utilization by 12%, effectively alleviating traffic congestion.
[0128] This method can also be applied to other fields, such as logistics and delivery path optimization and communication network routing optimization. In logistics and delivery path optimization, the time evaluation coefficient can be calculated based on delivery time, and the utilization evaluation coefficient can be calculated based on vehicle loading rate. In communication network routing optimization, the time evaluation coefficient can be calculated based on data transmission delay, and the utilization evaluation coefficient can be calculated based on link bandwidth utilization.
[0129] This method can also be combined with other optimization algorithms, such as genetic algorithms and particle swarm optimization, to form a hybrid optimization algorithm to further improve the effectiveness of path optimization. For example, a genetic algorithm can be used to generate an initial set of paths, followed by path optimization using this method, and finally a particle swarm optimization algorithm for local search, thereby leveraging the advantages of various algorithms to obtain a more optimal path solution.
[0130] The path optimization method based on the ant colony algorithm provided in this embodiment calculates the pheromone increment through the time evaluation coefficient and the utilization evaluation coefficient, and updates the pheromone concentration on the path according to the preset pheromone volatility coefficient. It can effectively guide the ant colony algorithm to select a better path and improve the effect of path optimization.
[0131] Figure 2 This is a flow chart of updating and adjusting pheromone concentration according to an embodiment of the present invention:
[0132] The figure illustrates the calculation process, which involves two main steps. The first step is calculating the pheromone increment: first, the time evaluation coefficient and the utilization evaluation coefficient are squared, then the two squared values are added together, the sum is divided by the number of evaluation coefficients, and finally, the result is multiplied by the preset expected path gain coefficient to obtain the pheromone increment. The second step is updating and constraining the pheromone concentration: the current pheromone concentration of the path is obtained, multiplied by the preset pheromone retention rate, and then the pheromone increment calculated in the first step is added to obtain the updated pheromone concentration. After the update is completed, a boundary check is performed to determine whether the new pheromone concentration is within the preset range. If it is outside the preset range, the pheromone concentration is adjusted to the boundary value of the range to ensure that the pheromone concentration remains within a reasonable range. This process demonstrates the dynamic adjustment mechanism of the pheromone concentration. Through the coordination of parameters such as the evaluation coefficient, gain coefficient, and retention rate, the reasonable update and control of the pheromone concentration is achieved.
[0133] In an optional embodiment, generating a service migration sequence and a resource allocation instruction according to the resource allocation scheme, performing the service migration operation in the order of the service migration sequence, and adjusting the resource configuration of each service node according to the resource allocation instruction includes:
[0134] The resource allocation plan includes a list of source service nodes to be migrated, a list of target service nodes, and a target resource configuration value for each service node;
[0135] Obtain the resource usage of each service instance running on the source service node list to be migrated; calculate the remaining available resources of the service nodes in the target service node list; prioritize the source service nodes based on the resource usage of the service instances; prioritize the target service nodes based on the remaining available resources; match the source node with the highest priority with the target node with the highest priority to generate a migration sequence;
[0136] Calculate the difference between the current resource configuration value and the target resource configuration value of each service node; generate a resource expansion instruction for a service node that needs to be expanded; generate a resource reduction instruction for a service node that needs to be reduced; and form a resource allocation instruction set with the resource expansion instruction and the resource reduction instruction.
[0137] In one implementation of service migration and resource allocation, the system generates a service migration sequence and resource allocation instructions according to a resource allocation plan, executes service migration operations in the order of the service migration sequence, and adjusts resource configuration of each service node according to the resource allocation instructions.
[0138] A resource allocation plan consists of three key components: a list of source service nodes to be migrated, a list of target service nodes, and the target resource configuration for each service node. For example, in a system with 10 service nodes, the source service node list includes nodes 1, 3, and 5, the target service node list includes nodes 2, 4, and 6, and the target resource configuration specifies a 4-core CPU and 8GB of memory for node 1.
[0139] Obtain the resource usage of each service instance running on the source service node to be migrated. This step is implemented by calling the resource monitoring API, which returns the current CPU, memory, storage, and network bandwidth usage of each service instance. For example, service instance A running on node 1 uses 2 CPU cores and 4GB of memory, while service instance B uses 1 CPU core and 2GB of memory.
[0140] Calculate the remaining available resources for the target service nodes in the target service node list. This calculation is based on the target node's total resource capacity minus the allocated resources. For example, if Node 2 has a total resource capacity of 8 CPU cores and 16GB of memory, and has allocated 2 CPU cores and 4GB of memory, the remaining available resources are 6 CPU cores and 12GB of memory.
[0141] Prioritize source service nodes based on the resource usage of service instances. This can be done using a variety of strategies, such as descending order of total resource usage, descending order of resource usage density, or descending order of usage of specific resource types (such as CPU or memory). In practice, nodes with high resource usage are prioritized for migration to quickly free up resources. For example, if the service instances on node 1 collectively utilize 3 CPU cores and 6GB of memory, the service instances on node 3 collectively utilize 2 CPU cores and 4GB of memory, and the service instances on node 5 collectively utilize 4 CPU cores and 8GB of memory, the resulting priority ranking is: node 5, node 1, node 3.
[0142] Prioritize target service nodes based on remaining available resources. Sorting can be done in descending order of total remaining resources or by the remaining amount of a specific resource type. For example, if Node 2 has a 6-core CPU and 12GB of RAM, Node 4 has a 4-core CPU and 8GB of RAM, and Node 6 has an 8-core CPU and 16GB of RAM, the resulting priority ranking is: Node 6, Node 2, Node 4.
[0143] The system matches the highest-priority source node with the highest-priority target node to generate a migration sequence. In the example above, the first migration would be from node 5 to node 6. After the migration, the system updates node 6's remaining resources and re-prioritizes them. Assuming that after the migration, node 6's remaining resources become 4 CPU cores and 8GB of memory, the new target node priority order becomes: node 2, node 6, node 4. The next migration would be from node 1 to node 2. This process continues until all source nodes are migrated or the target node's resources are insufficient to accommodate additional service instances.
[0144] After the migration sequence is generated, the system calculates the difference between the current resource configuration of each service node and the target resource configuration. For example, if node 7 is currently configured with a 4-core CPU and 8GB of memory, and the target configuration is a 6-core CPU and 12GB of memory, the difference is 2 cores and 4GB of memory.
[0145] For service nodes that need capacity expansion, the system generates resource expansion instructions. These instructions contain the node identifier and the amount of resources to be added. For example, for node 7, the expansion instruction might be: "Add 2 CPU cores and 4GB of memory to node 7."
[0146] For service nodes that need to be reduced, the system generates resource reduction instructions. These instructions contain the node identifier and the amount of resources to be reduced. For example, if node 8 is currently configured with 8 CPU cores and 16GB of memory, and the target configuration is 6 CPU cores and 12GB of memory, the reduction instruction would be: "Remove 2 CPU cores and 4GB of memory from node 8."
[0147] The system combines all resource expansion and reduction instructions into a resource allocation instruction set, which is then sent to the resource management system, which performs the actual resource adjustment operations.
[0148] During the actual execution process, the system first performs service migration operations, migrating services from the source node to the target node in sequence according to the generated migration sequence. The migration process includes stopping the service instance on the source node, transferring the service instance's state and data to the target node, starting the service instance on the target node, and verifying the normal operation of the service instance on the target node.
[0149] After all migration operations are complete, the system executes resource allocation instructions to adjust the resource configuration of each service node. Resource adjustments involve adjusting virtual machine specifications, modifying container resource limits, or upgrading or downgrading physical server hardware.
[0150] In this way, the system can efficiently complete service migration and resource adjustment according to the resource allocation plan, optimize overall resource utilization, and improve system performance and reliability.
[0151] A second aspect of an embodiment of the present invention provides an open source system resource scheduling and management system based on service traffic prediction, including:
[0152] The first unit is configured to obtain historical traffic data of each service node in the open source system, construct a deep neural network model based on the historical traffic data, and predict the traffic of each service node in a future time window using the deep neural network model to obtain predicted traffic data;
[0153] The second unit is configured to calculate a dynamic weight coefficient based on the predicted traffic data and the computing capacity parameters of each service node;
[0154] The third unit is used to collect resource status information of each service node in the open source system in real time, and calculate the resource availability index of each service node based on the resource status information;
[0155] a fourth unit, configured to input the dynamic weight coefficient and the resource availability index into an improved ant colony algorithm, wherein: the dynamic weight coefficient is used as heuristic information of the ant colony algorithm, the resource availability index is used as a constraint condition for path selection, a resource allocation plan is generated through an iterative optimization process, and the pheromone update rule in the iterative optimization process is dynamically adjusted based on service response time and resource utilization;
[0156] The fifth unit is used to generate a service migration sequence and a resource allocation instruction according to the resource allocation plan, perform the service migration operation in the order of the service migration sequence, and adjust the resource configuration of each service node according to the resource allocation instruction.
[0157] According to a third aspect of an embodiment of the present invention, an electronic device is provided, including:
[0158] processor;
[0159] a memory for storing processor-executable instructions;
[0160] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.
[0161] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described above is implemented.
[0162] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.
[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An open source system resource scheduling and management method based on service traffic prediction, characterized in that: include: Obtain historical traffic data for each service node in the open source system, build a deep neural network model based on the historical traffic data, and use the deep neural network model to predict the traffic of each service node in a future time window to obtain predicted traffic data; Based on the predicted traffic data and in combination with the computing capacity parameters of each service node, the dynamic weight coefficient is calculated including: The ratio of the predicted traffic data to the preset traffic threshold is used as a basic weight, and the dynamic weight coefficient representing the load balancing degree of the service node is determined by combining the basic weight with the computing capacity parameter of the service node; Multiply the number of processor cores of the service node by the single-core benchmark performance to get the processor performance score; divide the memory capacity by the benchmark memory capacity to get the memory performance score; divide the network transmission rate by the benchmark transmission rate to get the network performance score; The product of the basic weight and the processor performance score is recorded as the first sub-weight; the product of the basic weight and the memory performance score is recorded as the second sub-weight; the product of the basic weight and the network performance score is recorded as the third sub-weight; The weighted average of the first sub-weight, the second sub-weight, and the third sub-weight is used as a dynamic weight coefficient representing the degree of load balancing of the service node; Collect resource status information of each service node in the open source system in real time, and calculate the resource availability index of each service node based on the resource status information; Inputting the dynamic weight coefficient and the resource availability index into an improved ant colony algorithm, wherein: the dynamic weight coefficient is used as heuristic information of the ant colony algorithm, the resource availability index is used as a constraint condition for path selection, and a resource allocation plan is generated through an iterative optimization process, wherein the pheromone update rule in the iterative optimization process is dynamically adjusted based on service response time and resource utilization; According to the resource allocation scheme, a service migration sequence and a resource allocation instruction are generated, the service migration operation is performed in the order of the service migration sequence, and the resource configuration of each service node is adjusted according to the resource allocation instruction.
2. The method according to claim 1, characterized in that The deep neural network model is used to predict the traffic flow of each service node in the future time window, and the predicted traffic data obtained includes: The deep neural network model includes: an input layer for receiving pre-processed training data; a feature extraction layer that uses a one-dimensional convolutional network to extract time series features; an attention mechanism layer for calculating feature weights at different time points; a long short-term memory network layer for capturing long-term dependencies in time series data; a fully connected layer for feature dimensionality reduction and combination; and an output layer for outputting prediction results. Based on the historical traffic data, a sliding time window method is used to construct training data, the deep neural network model is trained using the training data, an adaptive learning rate optimization algorithm is used to update the model parameters, an early stopping mechanism is introduced to prevent overfitting, and the optimal model parameters are determined through cross-validation; The length of the prediction time window is set, the historical traffic data is input into the trained deep neural network model, and the predicted traffic data in the future time window is obtained through forward propagation of the model.
3. The method according to claim 1, characterized in that Using the dynamic weight coefficient as heuristic information of the ant colony algorithm and the resource availability index as a constraint condition for path selection, a resource allocation scheme is generated through an iterative optimization process, and the pheromone update rule in the iterative optimization process is dynamically adjusted based on the service response time and resource utilization, including: Set the initial parameters of the ant colony algorithm, including the number of ants, the initial value of pheromone, the pheromone volatility coefficient and the maximum number of iterations; Calculate the path selection probability of each service node: use the inverse of the dynamic weight coefficient of each service node as the heuristic information value; set the path selection probability of service nodes with available CPU quantity lower than the first preset threshold, available memory capacity lower than the second preset threshold, or available network bandwidth lower than the third preset threshold to zero; for the remaining service nodes, divide the product of pheromone concentration and heuristic information value by the sum of the products of all optional service nodes to obtain the path selection probability; Assign ants to different nodes and each ant independently performs the following steps: Record the service nodes that have been visited; select the next accessible service node based on the path selection probability; calculate the load variance under the current path; complete a path search when all service nodes have been visited or the load variance is less than the preset load balancing threshold; The following operations are performed on each search path: the service response time of each service node on the path is obtained and the average response time is calculated; the resource utilization rate of each service node on the path is obtained and the average resource utilization rate is calculated; the ratio of the average response time to the benchmark response time is calculated to obtain the time evaluation coefficient; the ratio of the average resource utilization rate to the benchmark utilization rate is calculated to obtain the utilization evaluation coefficient; the pheromone increment is calculated based on the time evaluation coefficient and the utilization evaluation coefficient; the pheromone concentration on the path is updated according to the preset pheromone volatilization coefficient and the pheromone increment is superimposed; When the maximum number of iterations is reached or the load variance change of multiple consecutive iterations is less than the convergence threshold, the path with the smallest load variance is selected as the resource allocation solution.
4. The method according to claim 3, characterized in that The pheromone increment is calculated based on the time evaluation coefficient and the utilization evaluation coefficient; the pheromone concentration on the path is updated according to the preset pheromone volatility coefficient, and the pheromone increment is superimposed, including: Square the time evaluation coefficient and the utilization evaluation coefficient respectively; add the square values of the two evaluation coefficients; divide the addition result by the number of evaluation coefficients; multiply the calculation result by a preset path expected gain coefficient to obtain the pheromone increment; Get the current pheromone concentration of the path; multiply the pheromone concentration by the preset pheromone retention rate; add the pheromone increment to the current pheromone concentration; determine whether the updated pheromone concentration is within the preset range; if it exceeds the preset range, set the pheromone concentration to the range boundary value.
5. The method according to claim 1, wherein Generating a service migration sequence and a resource allocation instruction according to the resource allocation scheme, performing a service migration operation in the order of the service migration sequence, and adjusting the resource configuration of each service node according to the resource allocation instruction includes: The resource allocation plan includes a list of source service nodes to be migrated, a list of target service nodes, and a target resource configuration value for each service node; Obtain the resource usage of each service instance running on the source service node list to be migrated; calculate the remaining available resources of the service nodes in the target service node list; prioritize the source service nodes based on the resource usage of the service instances; prioritize the target service nodes based on the remaining available resources; match the source node with the highest priority with the target node with the highest priority to generate a migration sequence; Calculate the difference between the current resource configuration value and the target resource configuration value of each service node; generate a resource expansion instruction for a service node that needs to be expanded; generate a resource reduction instruction for a service node that needs to be reduced; and form a resource allocation instruction set with the resource expansion instruction and the resource reduction instruction.
6. An open source system resource scheduling and management system based on service traffic prediction, used to implement the method according to any one of claims 1 to 5, characterized in that: include: The first unit is configured to obtain historical traffic data of each service node in the open source system, construct a deep neural network model based on the historical traffic data, and predict the traffic of each service node in a future time window using the deep neural network model to obtain predicted traffic data; The second unit is configured to calculate a dynamic weight coefficient based on the predicted traffic data and the computing capacity parameters of each service node; The third unit is used to collect resource status information of each service node in the open source system in real time, and calculate the resource availability index of each service node based on the resource status information; a fourth unit, configured to input the dynamic weight coefficient and the resource availability index into an improved ant colony algorithm, wherein: the dynamic weight coefficient is used as heuristic information of the ant colony algorithm, the resource availability index is used as a constraint condition for path selection, a resource allocation plan is generated through an iterative optimization process, and the pheromone update rule in the iterative optimization process is dynamically adjusted based on service response time and resource utilization; The fifth unit is used to generate a service migration sequence and a resource allocation instruction according to the resource allocation plan, perform the service migration operation in the order of the service migration sequence, and adjust the resource configuration of each service node according to the resource allocation instruction.
7. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Cloud resource automatic allocation system
CN118363765A
Communication network optimization method, device and equipment considering power consumption
CN118509336A