Open source system resource scheduling management method and system based on service traffic prediction
Through the combination of deep neural network model and improved ant colony algorithm, dynamically predict service traffic and optimize resource configuration, the traditional resource scheduling method is solved in the face of complex traffic environments, efficient resource allocation and load balancing are achieved, and the performance and stability of open source systems are improved.
Patent Information
- Application Number
- CN202510713186.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2045-05-30
AI Technical Summary
The existing resource scheduling methods are difficult to adapt to the complex and changeable service traffic environment, resulting in the system's reaction lag when facing burst traffic and the resource preparation is not possible in advance, resulting in a decline in service quality or waste of resources. The traditional load balancing algorithm fails to fully consider the heterogeneity and dynamic change characteristics of service nodes, reducing the system's resource utilization efficiency.
By constructing a deep neural network model, predicting the future traffic of the service node, calculating dynamic weight coefficients based on the computing power parameters, and inputting them into the improved ant colony algorithm, using dynamic weights as heuristic information and resource availability as constraints, generating resource allocation plans 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 CN120238443A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of resource management, and particularly to an open-source system resource scheduling and 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 been widely applied to various Internet services and enterprise applications. These open-source systems usually consist of multiple service nodes that jointly provide resource services such as computing, storage, and networking. During actual operation, the traffic loads faced by each service node often exhibit obvious temporal volatility and unevenness, which pose severe challenges to the efficient scheduling and management of system resources. Traditional resource scheduling and management methods mainly rely on static configurations or simple load balancing strategies and are difficult to adapt to complex and changing service traffic environments.
[0003] Most existing resource scheduling methods rely on the current system state for decision-making and lack the ability to predict future traffic changes, resulting in a lag in the system's response to sudden traffic, an inability to prepare resources in advance, and an easy degradation of service quality or waste of resources.
[0004] Traditional load balancing algorithms usually adopt fixed weights or simple round-robin mechanisms, fail to fully consider the heterogeneity and dynamic change characteristics of service nodes, and are difficult to perform refined resource allocation based on the actual computing capabilities and current load conditions of nodes, reducing the overall resource utilization efficiency of the system.
[0005] Existing resource scheduling strategies often lack a global optimization perspective, fail to simultaneously consider multi-dimensional indicators such as service response time and resource utilization rate, and are difficult to balance the relationship between system performance and resource cost during the resource allocation decision-making process, resulting in the system under high load. Summary of the Invention
[0006] Embodiments of the present invention provide an open-source system resource scheduling and management method and system based on service traffic prediction, which can solve the problems in the prior art.
[0007] In the first aspect of the embodiments of the present invention, historical traffic data of each service node in the open-source system is obtained, and based on the historical traffic data, a deep neural network model is constructed. The traffic of each service node within a future time window is predicted through the deep neural network model to obtain predicted traffic data; According to the predicted traffic data and in combination with the computing capacity parameters of each service node, a dynamic weight coefficient is calculated; The resource status information of each service node in the open-source system is collected in real time, and based on the resource status information, a resource availability index of each service node is calculated; Input the dynamic weight coefficient and the resource availability index into an improved ant colony algorithm, where: use the dynamic weight coefficient as the heuristic information of the ant colony algorithm, use the resource availability index as the constraint condition for path selection, and generate a resource allocation scheme 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 rate; Generate a service migration sequence and resource allocation instructions according to the resource allocation scheme, execute service migration operations in the order of the service migration sequence, and adjust the resource configuration of each service node according to the resource allocation instructions.
[0008] Predict the traffic of each service node within a future time window through the deep neural network model, and the obtained predicted traffic data includes: The deep neural network model includes: an input layer for receiving preprocessed training data; a feature extraction layer that uses a one-dimensional convolutional network to extract time series features; an attention mechanism layer for calculating the feature weights at different time points; a long short-term memory network layer for capturing the long-term dependencies of time series data; a fully connected layer for feature dimensionality reduction and combination; and an output layer for outputting prediction results; Construct training data using the sliding time window method based on the historical traffic data, train the deep neural network model through the training data, update the model parameters using an optimization algorithm with an adaptive learning rate, introduce an early stopping mechanism to prevent overfitting, and determine the optimal model parameters through cross-validation; Set the length of the prediction time window, input the historical traffic data into the trained deep neural network model, and obtain the predicted traffic data within the future time window through the forward propagation of the model.
[0009] The calculation of the dynamic weight coefficient includes: Use the ratio of the predicted traffic data to a preset traffic threshold as the basic weight, and combine the basic weight with the computing power parameter of the service node to determine the dynamic weight coefficient representing the load balancing degree of the service node; Multiply the number of processor cores of the service node by the single-core benchmark performance to obtain the processor performance score; divide the memory capacity by the benchmark memory capacity to obtain the memory performance score; divide the network transmission rate by the benchmark transmission rate to obtain the network performance score; Denote the product of the basic weight and the processor performance score as the first sub-weight; denote the product of the basic weight and the memory performance score as the second sub-weight; denote the product of the basic weight and the network performance score as the third sub-weight; Use the weighted average of the first sub-weight, the second sub-weight, and the third sub-weight as the dynamic weight coefficient representing the load balancing degree of the service node.
[0010] Using the dynamic weight coefficient as the heuristic information of the ant colony algorithm, and using the resource availability index as the constraint condition for path selection, a resource allocation scheme 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 rate, including: Set the initial parameters of the ant colony algorithm, including the number of ants, the initial value of pheromone, the pheromone evaporation coefficient, and the maximum number of iterations; Calculate the path selection probability of each service node: Take the reciprocal of the dynamic weight coefficient of each service node as the heuristic information value; Set the path selection probability of the service node with the available CPU number lower than the first preset threshold or the available memory capacity lower than the second preset threshold or the available network bandwidth lower than the third preset threshold to zero; For the remaining service nodes, divide the product of the pheromone concentration and the heuristic information value by the sum of the products of all optional service nodes to obtain the path selection probability; Allocate the ant colony to start from different nodes, and each ant independently performs the following steps: Record the visited service nodes; Select the next accessible service node based on the path selection probability; Calculate the load variance under the current path; When all service nodes have been visited or the load variance is less than the preset load balancing threshold, complete a path search; Perform the following operations on each search path: Obtain the service response time of each service node on the path, and calculate the average response time; Obtain the resource utilization rate of each service node on the path, and calculate the average resource utilization rate; Calculate the ratio of the average response time to the reference response time to obtain the time evaluation coefficient; Calculate the ratio of the average resource utilization rate to the reference utilization rate to obtain the utilization evaluation coefficient; Calculate the pheromone increment according to the time evaluation coefficient and the utilization evaluation coefficient; Update the pheromone concentration on the path according to the preset pheromone evaporation coefficient, and superimpose the pheromone increment; When the maximum number of iterations is reached or the change in load variance for consecutive multiple iterations is less than the convergence threshold, select the path with the minimum load variance as the resource allocation scheme.
[0011] Calculate the pheromone increment according to the time evaluation coefficient and the utilization evaluation coefficient; Update the pheromone concentration on the path according to the preset pheromone evaporation coefficient, and superimpose the pheromone increment, including: Square the time evaluation coefficient and the utilization evaluation coefficient respectively; Add the squared values of the two evaluation coefficients; Divide the added result by the number of evaluation coefficients; Multiply the calculated result by the preset path expected gain coefficient to obtain the pheromone increment; Obtain the pheromone concentration of the current path; multiply the pheromone concentration by a preset pheromone retention rate; add the pheromone increment to the current pheromone concentration; determine whether the updated pheromone concentration is within a preset range; if it exceeds the preset range, set the pheromone concentration to the boundary value of the range.
[0012] According to the resource allocation scheme, generate a service migration sequence and resource allocation instructions, perform service migration operations in the order of the service migration sequence, and adjust the resource configuration of each service node according to the resource allocation instructions, including: The resource allocation scheme includes a list of source service nodes to be migrated, a list of target service nodes, and the target resource configuration value of each service node; Obtain the resource occupancy of the service instances running on each source service node in the list to be migrated; calculate the remaining available resources of the service nodes in the target service node list; sort the source service nodes according to the resource occupancy of the service instances; sort the target service nodes according to 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 the service nodes that need to be expanded; generate a resource reduction instruction for the service nodes that need to be reduced; form a resource allocation instruction set with the resource expansion instruction and the resource reduction instruction.
[0013] In the second aspect of the embodiments of the present invention, there is provided an open-source system resource scheduling and management system based on service traffic prediction, including: The first unit is used to obtain the historical traffic data of each service node in the open-source system, build a deep neural network model based on the historical traffic data, and predict the traffic of each service node within a future time window through the deep neural network model to obtain predicted traffic data; The second unit is used to calculate a dynamic weight coefficient according to the predicted traffic data in combination with the computing power parameters of each service node; The third unit is used to collect the 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; The fourth unit is used to input the dynamic weight coefficient and the resource availability index into an improved ant colony algorithm, where: use the dynamic weight coefficient as the heuristic information of the ant colony algorithm, use the resource availability index as the constraint condition for path selection, and generate a resource allocation scheme 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 rate; The fifth unit is configured to generate a service migration sequence and resource allocation instructions according to the resource allocation scheme, perform service migration operations in the order of the service migration sequence, and adjust the resource configurations of each service node according to the resource allocation instructions.
[0014] In a third aspect of the embodiments of the present invention, an electronic device is provided, including: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.
[0015] In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described above is implemented.
[0016] The beneficial effects of the present application are as follows: By constructing a deep neural network model to predict the traffic of service nodes and calculating dynamic weight coefficients in combination with computing power parameters, the present invention realizes accurate prediction of system resource requirements, effectively avoiding the problems of resource waste and service quality degradation caused by traditional static resource allocation methods.
[0017] The present invention incorporates dynamic weight coefficients and resource availability indicators into an improved ant colony algorithm, uses dynamic weights as heuristic information and resource availability as a constraint condition, and generates a resource allocation scheme through iterative optimization, improving the flexibility and adaptability of resource scheduling and being able to dynamically adjust resource allocation strategies according to traffic changes.
[0018] Based on the dynamic weight calculation mechanism of predicted traffic and computing power parameters and combined with real-time monitoring of resource status, the present invention realizes efficient allocation of system resources and load balancing, significantly improving the overall performance and stability of the open-source system, reducing the system response time, increasing resource utilization rate, and providing users with a smoother service experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flowchart of the resource scheduling and management method for an open-source system based on service traffic prediction according to an embodiment of the present invention; Figure 2 It is a flowchart of pheromone concentration update and adjustment according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] To make the objectives, 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 with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are only a part rather than all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0021] The technical solutions of the present invention will be described in detail below with specific embodiments. These specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0022] Figure 1 The following is a schematic flowchart of an open-source system resource scheduling and management method based on service traffic prediction according to an embodiment of the present invention, as Figure 1 shown. The method includes: Obtain the historical traffic data of each service node in the open-source system, and based on the historical traffic data, construct a deep neural network model. Predict the traffic of each service node within a future time window through the deep neural network model to obtain predicted traffic data; Calculate dynamic weight coefficients according to the predicted traffic data in combination with the computing power parameters of each service node; Real-time collect the resource status information of each service node in the open-source system, and calculate the resource availability index of each service node based on the resource status information; Input the dynamic weight coefficients and the resource availability index into an improved ant colony algorithm, where: use the dynamic weight coefficients as the heuristic information of the ant colony algorithm, use the resource availability index as the constraint condition for path selection, and generate a resource allocation plan through an iterative optimization process. The pheromone update rule in the iterative optimization process is dynamically adjusted based on service response time and resource utilization rate; Generate a service migration sequence and resource allocation instructions according to the resource allocation plan, execute 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 instructions.
[0023] In an alternative embodiment, predicting the traffic of each service node within a future time window through the deep neural network model to obtain predicted traffic data includes: The deep neural network model includes: an input layer for receiving preprocessed training data; a feature extraction layer that uses a one-dimensional convolutional network to extract temporal 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 temporal 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 training data set is constructed using the sliding time window method. The deep neural network model is trained with this training data set, and an optimization algorithm with an adaptive learning rate 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. Set the length of the prediction time window, and input the historical traffic data into the trained deep neural network model. The predicted traffic data within the future time window is obtained through forward propagation of the model.
[0024] Preprocess the historical traffic data. The preprocessing steps include data cleaning, normalization, and time window partitioning. During data cleaning, outliers are detected and processed. For example, when the traffic value at a certain time point exceeds three times the historical average, it is replaced with the average of the adjacent time points. The normalization process uses the min-max normalization method to map the traffic data into the interval [0, 1]. The calculation formula can be expressed as: subtract the minimum value from the original data and then divide by the difference between the maximum value and the minimum value. For example, if the original traffic data range is [100Mbps, 5000Mbps], the normalized data range is [0, 1].
[0025] Construct a deep neural network model. The model consists of six key layers: an input layer, a feature extraction layer, an attention mechanism layer, a long short-term memory network layer, a fully connected layer, and an output layer. The input layer receives the preprocessed training data, and the input dimension is [batch size, time window length, number of features]. For example, [64, 24, 5] means the batch size is 64, the time window length is 24 hours, and each time point contains 5 features. The feature extraction layer uses a one-dimensional convolutional network with 32 convolutional kernels, a kernel size of 3, a stride of 1, a padding mode of "same", and a ReLU activation function. Temporal features are extracted through one-dimensional convolutional operations to capture local time patterns.
[0026] The attention mechanism layer is used to calculate the feature weights at different time points. This layer calculates attention scores, which represent the correlation between the current prediction and the data at each historical time point. In specific implementation, the input features are mapped to three representation spaces of query, key, and value through a trainable weight matrix. The attention scores are obtained by calculating the similarity between the query and the key, and then the scores are normalized by softmax to obtain the weight coefficients. Finally, the weighted feature representation is obtained by multiplying the weight coefficients with the values. For example, for a 24-hour input sequence, the attention mechanism gives higher weights (such as 0.15 - 0.2) to the data in the recent few hours, and lower weights (such as 0.01 - 0.05) to the data at earlier time points.
[0027] The long short-term memory (LSTM) network layer consists of 128 LSTM units and is used to capture the long-term dependencies in time-series data. The LSTM unit contains three gating mechanisms: an input gate, a forget gate, and an output gate, which can learn the time dependencies in long sequences. The input gate controls the degree to which new information enters the cell state, the forget gate determines how much information from the previous state 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].
[0028] 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 realizes feature dimensionality reduction and combination, mapping the high-dimensional features output by the LSTM layer to a more compact representation space. The output layer is a dense layer with a single neuron and does not use an activation function, directly outputting the predicted flow value.
[0029] Training data is constructed using the sliding time window method based on historical flow data. For example, if the input window length is set to 24 hours and the prediction window length is set to 6 hours, then multiple samples are extracted from the historical data. Each sample contains 24 consecutive hours of data as input, followed by 6 hours of data as the prediction target. The sliding step size is set to 1 hour, that is, a new training sample is created by moving backward 1 hour each time. In this way, about 690 training samples can be generated from one month (720 hours) of historical data.
[0030] The Adam optimization algorithm is used in the training process. The initial learning rate is set to 0.001, and a learning rate adaptive adjustment strategy is implemented. When the validation loss has not improved for 5 consecutive epochs, the learning rate is reduced to 50% of the original. The loss function uses the mean squared error (MSE), and at the same time, 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.
[0031] To prevent overfitting, an early stopping mechanism is introduced, and the patience parameter is set to 15. That is, when the validation loss has not improved for 15 consecutive epochs, the training is stopped and the best model parameters are restored. At the same time, 10-fold cross-validation is used to determine the optimal model parameters. The dataset is randomly divided into 10 parts, and 9 parts are used as the training set and 1 part as the validation set in turn. Finally, the model parameter configuration with the lowest average validation loss is selected.
[0032] In the prediction stage, the length of the prediction time window is set to 6 hours. The historical traffic data of the recent 24 hours is preprocessed and then input into the trained deep neural network model. The predicted traffic data for the next 6 hours is obtained through the forward propagation of the model. In practical applications, the model can update the prediction results every hour to predict the traffic conditions for the next 6 hours in a rolling manner.
[0033] Through experimental verification, the average prediction accuracy of this method on the real service node traffic data reaches 93.5%, and the mean absolute percentage error (MAPE) is 6.5%. Compared with the traditional time series prediction method, the prediction accuracy is improved by 15%, which can effectively support the optimal allocation of network resources and traffic scheduling decisions.
[0034] In an alternative embodiment, the calculation of the dynamic weight coefficient includes: Taking the ratio of the predicted traffic data to the preset traffic threshold as the basic weight, and combining the basic weight with the computing power parameter of the service node to determine the dynamic weight coefficient representing the load balancing degree of the service node; Multiplying the number of processor cores of the service node by the single-core benchmark performance to obtain the processor performance score; dividing the memory capacity by the benchmark memory capacity to obtain the memory performance score; dividing the network transmission rate by the benchmark transmission rate to obtain the network performance score; Denoting the product of the basic weight and the processor performance score as the first sub-weight; denoting the product of the basic weight and the memory performance score as the second sub-weight; denoting the product of the basic weight and the network performance score as the third sub-weight; Taking the weighted average of the first sub-weight, the second sub-weight, and the third sub-weight as the dynamic weight coefficient representing the load balancing degree of the service node.
[0035] A technical solution for determining the dynamic weight coefficient representing the load balancing degree of the service node by taking the ratio of the predicted traffic data to the preset traffic threshold as the basic weight and combining the computing power parameter of the service node.
[0036] Obtain predicted traffic data, which can be obtained through historical traffic analysis, machine learning prediction models, etc. For example, the predicted traffic data of a service node within a specific time period is 800 Mbps. At the same time, a preset traffic threshold, such as 1000 Mbps, is pre-set in the system as the upper limit of the ideal carrying capacity of this service node. The system calculates the ratio of the predicted traffic data to the preset traffic threshold as the basic weight. In this example, the basic weight is 800 / 1000 = 0.8.
[0037] To comprehensively consider the computing power of the service node, the system needs to evaluate three key indicators of the service node: processor performance, memory performance, and network performance. For the evaluation of processor performance, the system obtains the number of processor cores and the single-core benchmark performance of the service node. Assume that this service node is equipped with a 16-core processor and the single-core benchmark performance is 3000 points (based on the standard performance test score), then the processor performance score is calculated as 16×3000 = 48000 points. If the processor benchmark performance in the system is set to 30000 points, then the processor performance score of this node is 48000 / 30000 = 1.6.
[0038] For the evaluation of memory performance, the system obtains the memory capacity of the service node and compares it with the benchmark memory capacity. Assume that this service node is equipped with 64 GB of memory and the benchmark memory capacity set by the system is 32 GB, then the memory performance score is calculated as 64 / 32 = 2.0.
[0039] For the evaluation of network performance, the system obtains the network transmission rate of the service node and compares it with the benchmark transmission rate. Assume that the network transmission rate of this service node is 10 Gbps and the benchmark transmission rate set by the system is 5 Gbps, then the network performance score is calculated as 10 / 5 = 2.0.
[0040] After obtaining the performance scores of each item, the system multiplies the basic weight by the performance scores of each item to obtain three sub-weights. The first sub-weight is the product of the basic weight and the processor performance score, that is, 0.8×1.6 = 1.28. The second sub-weight is the product of the basic weight and the memory performance score, that is, 0.8×2.0 = 1.6. The third sub-weight is the product of the basic weight and the network performance score, that is, 0.8×2.0 = 1.6.
[0041] To comprehensively consider the different influence degrees of the processor, memory, and network on the load capacity of the service node, the system assigns different weight coefficients to the three sub-weights. Assume that through the analysis of business characteristics, the system determines that the influence weights of the processor, memory, and network on the 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: 1.28×0.5 + 1.6×0.3 + 1.6×0.2 = 1.28×0.5 + 1.6×0.5 = 1.44。
[0042] The dynamic weight coefficient 1.44 represents the load balancing ability of the service node under the current predicted traffic and hardware configuration conditions. The system can allocate loads to service nodes according to this coefficient. The higher the coefficient, the stronger the load-bearing capacity of the node, and more request tasks can be allocated.
[0043] In practical applications, the system will regularly update the predicted traffic data and recalculate the dynamic weight coefficient according to the latest data to adapt to traffic changes. For example, when the predicted traffic rises to 900 Mbps, the basic 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, the third sub-weight becomes 0.9×2.0 = 1.8, and 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.
[0044] The system can also adjust the weight coefficients of various performance indicators according to actual business requirements. For example, for compute-intensive applications, the weight of processor performance can be increased to 0.7, and 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, and the weights of processor and network performance can be reduced to 0.3 and 0.1 respectively.
[0045] In this way, the system can comprehensively consider the predicted traffic and the hardware performance of service nodes, dynamically adjust the load balancing strategy, improve resource utilization efficiency, and ensure service quality. This method is particularly suitable for resource scheduling and load balancing scenarios in cloud computing environments and can effectively handle complex situations such as traffic fluctuations and service node heterogeneity.
[0046] In an alternative embodiment, the dynamic weight coefficient is used as the heuristic information of the ant colony algorithm, and the resource availability metric is used as the 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 service response time and resource utilization rate, including: Set the initial parameters of the ant colony algorithm, including the number of ants, the initial value of pheromone, the pheromone evaporation coefficient, and the maximum number of iterations; Calculate the path selection probability of each service node: Take the reciprocal 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 or 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 the pheromone concentration and the heuristic information value by the sum of the products of all optional service nodes to obtain the path selection probability. Allocate the ant colony to start from different nodes, and each ant independently executes the following steps: Record the visited service nodes; Select the next accessible service node based on the path selection probability; Calculate the load variance under the current path; When all service nodes have been visited or the load variance is less than the preset load balancing threshold, complete a path search. Perform the following operations on each search path: Obtain the service response time of each service node on the path and calculate the average response time; Obtain the resource utilization rate of each service node on the path and calculate the average resource utilization rate; Calculate the ratio of the average response time to the reference response time to obtain the time evaluation coefficient; Calculate the ratio of the average resource utilization rate to the reference utilization rate to obtain the utilization rate evaluation coefficient; Calculate the pheromone increment according to the time evaluation coefficient and the utilization rate evaluation coefficient; Update the pheromone concentration on the path according to the preset pheromone evaporation coefficient and superimpose the pheromone increment. When the maximum number of iterations is reached or the change in load variance for consecutive multiple iterations is less than the convergence threshold, select the path with the smallest load variance as the resource allocation plan.
[0047] Use the dynamic weight coefficient as the heuristic information of the ant colony algorithm and use the resource availability index as the constraint condition for path selection, and generate a resource allocation plan through an iterative optimization process.
[0048] During the implementation process, the system first sets the initial parameters of the ant colony algorithm. In a specific embodiment, the number of ants is set to 20, the initial value of the pheromone is set to 0.1, the pheromone evaporation coefficient is set to 0.5, and the maximum number of iterations is set to 100 times. These parameters can be adjusted according to the actual application scenario to obtain better optimization effects.
[0049] When calculating the path selection probability of each service node, the system uses the reciprocal of the dynamic weight coefficient of each service node as the heuristic information value. For example, in a cloud computing environment with 5 service nodes, the dynamic weight coefficients of each node are [0.8, 0.6, 0.9, 0.7, 0.5], then the corresponding heuristic information values are [1.25, 1.67, 1.11, 1.43, 2.00]. The system will check the resource availability of each service node. If the available CPU quantity of a certain node is lower than the first preset threshold (such as the number of CPU cores is less than 2), or the available memory capacity is lower than the second preset threshold (such as the memory is less than 4GB), or the available network bandwidth is lower than the third preset threshold (such as the bandwidth is less than 100Mbps), then the path selection probability of this node will be set to zero, indicating that this node is temporarily not selectable.
[0050] For the remaining selectable service nodes, the system calculates the path selection probability. Assume that after filtering by resource availability, only nodes 1, 3, 4, and 5 are selectable, and node 2 is excluded due to insufficient resources. At this time, the system obtains the pheromone concentrations on these nodes, assumed to be [0.2, 0, 0.15, 0.25, 0.3] (the pheromone value of node 2 does not participate in the calculation). Multiply the pheromone concentration by the heuristic information value to get [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]. Divide these products by the sum of the products of all selectable nodes 0.25 + 0.17 + 0.36 + 0.60 = 1.38 to obtain the path selection probability [0.18, 0, 0.12, 0.26, 0.44].
[0051] When allocating the ant colony to start from different nodes, the system will ensure that the ants are evenly distributed on each selectable starting node. For example, 20 ants will be allocated to 4 selectable nodes, with 5 ants on each node. Each ant independently executes the path search process, records the visited service nodes, and selects the next accessible service node based on the path selection probability.
[0052] During the path search process, the ant will calculate the load variance of the current path. Assume that the loads of 5 nodes on a path are [65%, 0%, 58%, 72%, 80%], then the average load is: (65 + 0 + 58 + 72 + 80) / 5 = 55%; The load variance is: [(65 - 55)²+(0 - 55)²+(58 - 55)²+(72 - 55)²+(80 - 55)²] / 5 = 738.8.
[0053] If the preset load balancing threshold is 500, and the load variance of this path exceeds the threshold, the ant will continue to search. When the ant has visited all service nodes or the load variance is less than the preset load balancing threshold, a path search is completed.
[0054] For each search path, the system performs a pheromone update operation. The system obtains the service response times 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.
[0055] At the same time, the system obtains the resource utilization rates of each service node on the path, such as [65%, 0%, 58%, 72%, 80%], and calculates the average resource utilization rate as (65 + 0 + 58 + 72 + 80) / 5 = 55%.
[0056] The system calculates the ratio of the average response time to the reference response time to obtain the time evaluation coefficient. Assuming the reference response time is 100ms, the time evaluation coefficient is 110 / 100 = 1.1. The system calculates the ratio of the average resource utilization rate to the reference utilization rate to obtain the utilization rate evaluation coefficient. Assuming the reference utilization rate is 60%, the utilization rate evaluation coefficient is 55 / 60 = 0.92.
[0057] According to the time evaluation coefficient and the utilization rate evaluation coefficient, the system calculates the pheromone increment. In one embodiment, the pheromone increment can be expressed as: 1 / (time evaluation coefficient × utilization rate evaluation coefficient) = 1 / (1.1 × 0.92) = 0.99.
[0058] The system updates the pheromone concentration on the path according to the preset pheromone evaporation coefficient of 0.5 and superimposes the pheromone increment.
[0059] The system will continuously iterate the above process. When the maximum number of iterations reaches 100 times, or the change in load variance for consecutive multiple (such as 10 times) iterations is less than the convergence threshold (such as 5%), the system selects the path with the smallest load variance as the final resource allocation scheme.
[0060] In a complete embodiment, after 87 iterations, the system found the optimal path with a load variance of 120.5. The corresponding resource allocation scheme is to allocate tasks to nodes 1, 3, 4, and 5, and the loads of each node are [62%, 0%, 59%, 65%, 64%], the average response time is 95ms, and the average resource utilization rate is 62%, achieving better load balancing and resource utilization efficiency.
[0061] Through the above method, the present invention realizes the dynamic allocation of cloud computing resources based on the ant colony algorithm, effectively improves the load balancing and resource utilization rate of the system, reduces the service response time, and enhances the overall performance and stability of the cloud computing system.
[0062] In an alternative embodiment, the pheromone increment is calculated according to the time evaluation coefficient and the utilization rate evaluation coefficient; the pheromone concentration on the path is updated according to the preset pheromone evaporation coefficient, and the superposition of the pheromone increment includes: Square the time evaluation coefficient and the utilization rate evaluation coefficient respectively; add the squared values of the two evaluation coefficients; divide the added result by the number of evaluation coefficients; multiply the calculation result by the preset path expected gain coefficient to obtain the pheromone increment; Obtain the current pheromone concentration of the path; multiply the pheromone concentration by the preset pheromone retention rate; superimpose the pheromone increment on the current pheromone concentration; determine whether the updated pheromone concentration is within the preset interval; if it exceeds the preset interval, set the pheromone concentration to the interval boundary value.
[0063] In the process of path optimization, it is first necessary to obtain the time evaluation coefficient and the utilization rate evaluation coefficient. The time evaluation coefficient reflects the time efficiency of the path and can be calculated by the ratio of the actual passing time of the path to the ideal passing time. For example, if the actual passing time of a certain path is 30 minutes and the ideal passing time is 20 minutes, the time evaluation coefficient can be calculated as 20 / 30 = 0.67. The utilization rate evaluation coefficient reflects the resource utilization efficiency of the path and can be calculated by the ratio of the actual traffic on the path to the path capacity. For example, if the actual traffic on a certain path is 800 vehicles / hour and the path capacity is 1000 vehicles / hour, the utilization rate evaluation coefficient can be calculated as 800 / 1000 = 0.8.
[0064] After obtaining the evaluation coefficients, it is necessary to calculate the pheromone increment. Square the time evaluation coefficient and the utilization rate evaluation coefficient respectively, that is, square 0.67 to get 0.4489, and square 0.8 to get 0.64. Then add the two squared values to get 0.4489 + 0.64 = 1.0889. Divide the added result by the number of evaluation coefficients, that is, divide by 2, to get 1.0889 / 2 = 0.54445. Finally, multiply the calculation 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.
[0065] After calculating the pheromone increment, it is necessary to update the pheromone concentration on the path. First, obtain the current pheromone concentration on the path. Assume the current pheromone concentration is 20. Multiply the pheromone concentration by the preset pheromone retention rate. Assume the pheromone retention rate is 0.9, then calculate 20×0.9 = 18. Then add the pheromone increment to the current pheromone concentration, getting 18 + 5.4445 = 23.4445.
[0066] After updating the pheromone concentration, it is necessary to determine whether the updated pheromone concentration is within the preset interval. Assume the preset interval is [10, 30]. Since 23.4445 is within the interval [10, 30], no adjustment is required. If the updated pheromone concentration exceeds the preset interval, the pheromone concentration needs to be set to the interval boundary value. For example, if the updated pheromone concentration is 35, exceeding the upper limit of 30, then set the pheromone concentration to 30; if the updated pheromone concentration is 5, lower than the lower limit of 10, then set the pheromone concentration to 10.
[0067] Adjust relevant parameters according to different scenarios. For example, in the optimization of the traffic road network, the expected path gain coefficient can be adjusted according to the road type and traffic flow characteristics. For the main road, a relatively high expected path gain coefficient can be set, such as 15; for the secondary road, a medium expected path gain coefficient can be set, such as 10; for the branch road, a relatively low expected path gain coefficient can be set, such as 5.
[0068] The pheromone retention rate can also be adjusted according to the actual situation. In the scenario where the traffic flow changes rapidly, a relatively low pheromone retention rate can be set, such as 0.8, in order to adapt to the changes in traffic conditions more quickly; in the scenario where the traffic flow is relatively stable, a relatively high pheromone retention rate can be set, such as 0.95, to maintain the stability of path selection.
[0069] The setting of the preset interval also needs to be adjusted according to the actual situation. In the scenario where the road network structure is complex and there are diverse path selections, a relatively wide preset interval can be set, such as [5, 50], to increase the diversity of path selection; in the scenario where the road network structure is simple and the path selections are limited, a relatively narrow preset interval can be set, such as [15, 25], to improve the certainty of path selection.
[0070] Through the above method, the pheromone concentration on the path can be effectively updated, guiding the ant colony algorithm to select a better path in subsequent iterations. In a specific case of traffic road network optimization, after applying this method, the average travel time is reduced by 15%, and the overall utilization rate of the road network is increased by 12%, effectively alleviating the traffic congestion problem.
[0071] This method can also be extended and applied to other fields, such as the optimization of logistics distribution routes, the optimization of communication network routing, etc. In the optimization of logistics distribution routes, the time evaluation coefficient can be calculated based on the distribution time, and the utilization rate evaluation coefficient can be calculated based on the vehicle loading rate. In the optimization of communication network routing, the time evaluation coefficient can be calculated based on the data transmission delay, and the utilization rate evaluation coefficient can be calculated based on the link bandwidth utilization rate.
[0072] This method can also be combined with other optimization algorithms, such as genetic algorithms, particle swarm algorithms, etc., to form a hybrid optimization algorithm, further improving the effect of route optimization. For example, the genetic algorithm can be used to generate an initial set of routes, then this method can be used for route optimization, and finally the particle swarm algorithm can be used for local search, comprehensively utilizing the advantages of various algorithms to obtain a better route solution.
[0073] The path optimization method based on the ant colony algorithm provided by this embodiment can calculate the pheromone increment through the time evaluation coefficient and the utilization rate evaluation coefficient, and update the pheromone concentration on the path according to the preset pheromone evaporation coefficient, which can effectively guide the ant colony algorithm to select a better path and improve the effect of path optimization.
[0074] Figure 2 It is the flowchart of pheromone concentration update and adjustment for the embodiment of the present invention: This figure describes the calculation process of two main steps. The first step is to calculate the pheromone increment: First, the time evaluation coefficient and the utilization rate evaluation coefficient need to be squared respectively, then add these two squared values, divide the sum obtained by the number of evaluation coefficients, and finally multiply this result by the preset path expected gain coefficient to obtain the pheromone increment value. The second step is the update and constraint of the pheromone concentration: It is necessary to obtain the current pheromone concentration value of the path, multiply it by the preset pheromone retention rate, and then add the pheromone increment calculated in the first step to obtain the updated pheromone concentration. After the update is completed, it is also necessary to perform a boundary check to determine whether the new pheromone concentration is within the preset interval range. If it exceeds the preset interval, the pheromone concentration needs to be adjusted to the boundary value of the interval to ensure that the pheromone concentration always remains within a reasonable range. This process reflects the dynamic adjustment mechanism of the pheromone concentration. Through the cooperation of parameters such as evaluation coefficients, gain coefficients, and retention rates, the reasonable update and control of the pheromone concentration are realized.
[0075] In an alternative embodiment, according to the resource allocation scheme, a service migration sequence and resource allocation instructions are generated, the service migration operations are performed in the order of the service migration sequence, and the resource configurations of each service node are adjusted according to the resource allocation instructions, including: The resource allocation scheme includes a list of source service nodes to be migrated, a list of target service nodes, and the target resource configuration values of each service node; Obtain the resource occupancy of service instances running on each source service node to be migrated; calculate the remaining available resources of service nodes in the target service node list; sort the source service nodes according to the resource occupancy of service instances; sort the target service nodes according to 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 the service node that needs to be expanded; generate a resource reduction instruction for the service node that needs to be reduced; form a resource allocation instruction set with the resource expansion instruction and the resource reduction instruction.
[0076] In an implementation manner of service migration and resource allocation, the system generates a service migration sequence and a resource allocation instruction according to the resource allocation plan, executes the service migration operation in the order of the service migration sequence, and adjusts the resource configuration of each service node according to the resource allocation instruction.
[0077] The resource allocation plan includes three key components: the list of source service nodes to be migrated, the list of target service nodes, and the target resource configuration value of 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 value specifies that the CPU configuration of node 1 is 4 cores and the memory is 8GB.
[0078] Obtain the resource occupancy of service instances running on each source service node to be migrated. This step is implemented by calling the resource monitoring interface, which returns the resources such as CPU, memory, storage, and network bandwidth currently occupied by each service instance. For example, service instance A running on node 1 occupies 2 cores of CPU and 4GB of memory, and service instance B occupies 1 core of CPU and 2GB of memory.
[0079] Calculate the remaining available resources of service nodes in the target service node list. This calculation is based on subtracting the allocated resources from the total resource capacity of the target node. For example, if the total resource capacity of node 2 is 8 cores of CPU and 16GB of memory, and the allocated resources are 2 cores of CPU and 4GB of memory, then the remaining available resources are 6 cores of CPU and 12GB of memory.
[0080] Prioritize the source service nodes according to the resource occupancy of the service instances. Multiple strategies can be adopted for sorting, such as sorting in descending order of the total resource occupancy, sorting in descending order of the resource occupancy density, or sorting in descending order of the occupancy of a specific resource type (such as CPU or memory). In practical applications, preferentially migrate the nodes with large resource occupancy to quickly release a large amount of resources. For example, if the service instances on Node 1 altogether occupy 3 cores of CPU and 6 GB of memory, the service instances on Node 3 altogether occupy 2 cores of CPU and 4 GB of memory, and the service instances on Node 5 altogether occupy 4 cores of CPU and 8 GB of memory, then the result of the priority sorting is: Node 5, Node 1, Node 3.
[0081] Prioritize the target service nodes according to the remaining available resource amount. The sorting strategy is to sort in descending order of the total remaining resources or in descending order of the remaining amount of a specific resource type. For example, if the remaining resources of Node 2 are 6 cores of CPU and 12 GB of memory, the remaining resources of Node 4 are 4 cores of CPU and 8 GB of memory, and the remaining resources of Node 6 are 8 cores of CPU and 16 GB of memory, then the result of the priority sorting is: Node 6, Node 2, Node 4.
[0082] The system matches the source node with the highest priority with the target node with the highest priority to generate a migration sequence. In the above example, the first migration operation will be from Node 5 to Node 6. After the migration, the system will update the remaining resource amount of Node 6 and re - perform the priority sorting. Assuming that the remaining resources of Node 6 become 4 cores of CPU and 8 GB of memory after the migration, the new priority sorting of the target nodes becomes: Node 2, Node 6, Node 4. The next migration operation will be from Node 1 to Node 2. This process will continue until all source nodes have been migrated or the resources of the target nodes are not sufficient to accommodate more service instances.
[0083] After generating the migration sequence, the system calculates the difference between the current resource configuration value and the target resource configuration value of each service node. For example, if Node 7 is currently configured with 4 cores of CPU and 8 GB of memory, and the target configuration is 6 cores of CPU and 12 GB of memory, then the difference is 2 cores of CPU and 4 GB of memory.
[0084] For the service nodes that need to be expanded, the system generates resource expansion instructions. These instructions contain the node identifier and the amount of resources that need to be increased. For example, for Node 7, the expansion instruction is: "Add 2 cores of CPU and 4 GB of memory to Node 7".
[0085] For service nodes that require capacity reduction, the system generates resource capacity reduction instructions. These instructions contain node identifiers and the amount of resources to be reduced. For example, if node 8 is currently configured with an 8-core CPU and 16GB of memory, and the target configuration is a 6-core CPU and 12GB of memory, the capacity reduction instruction is: "Reduce 2 cores of CPU and 4GB of memory from node 8".
[0086] The system combines all resource expansion instructions and resource capacity reduction instructions into a resource allocation instruction set. This instruction set will be sent to the resource management system, which will perform the actual resource adjustment operations.
[0087] During the actual execution process, the system will first perform service migration operations, and sequentially migrate services from the source node to the target node according to the generated migration sequence. The migration process includes stopping the service instances on the source node, transferring the status and data of the service instances to the target node, starting the service instances on the target node, and verifying the normal operation of the service instances on the target node.
[0088] After completing all migration operations, the system will execute the resource allocation instructions to adjust the resource configurations of each service node. Resource adjustment involves adjusting the virtual machine specifications, modifying the container resource limits, or upgrading or downgrading the physical server hardware.
[0089] In this way, the system can efficiently complete service migration and resource adjustment according to the resource allocation plan, optimize the overall resource utilization rate, and improve the system performance and reliability.
[0090] In the second aspect of the embodiments of the present invention, an open-source system resource scheduling and management system based on service traffic prediction is provided, including: The first unit is used to obtain the 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 within a future time window through the deep neural network model to obtain predicted traffic data; The second unit is used to calculate dynamic weight coefficients according to the predicted traffic data in combination with the computing power parameters of each service node; The third unit is used to collect the resource status information of each service node in the open-source system in real time, and calculate the resource availability indicators of each service node based on the resource status information; The fourth unit is used to input the dynamic weight coefficients and the resource availability indicators into an improved ant colony algorithm, where: using the dynamic weight coefficients as the heuristic information of the ant colony algorithm, using the resource availability indicators as the constraint conditions for path selection, and generating a resource allocation plan 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 rate; A fifth unit, configured to generate a service migration sequence and resource allocation instructions according to the resource allocation scheme, perform service migration operations in the order of the service migration sequence, and adjust the resource configurations of each service node according to the resource allocation instructions.
[0091] In a third aspect of the embodiments of the present invention, there is provided an electronic device, including: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.
[0092] In a fourth aspect of the embodiments of the present invention, there is provided a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described above is implemented.
[0093] The present invention may be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium, on which computer-readable program instructions for executing various aspects of the present invention are uploaded.
[0094] 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 foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions 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 Including: Obtain the 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 within a future time window through the deep neural network model to obtain predicted traffic data; Calculate the dynamic weight coefficient according to the predicted traffic data in combination with the computing power parameters of each service node; Collect the 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; Input the dynamic weight coefficient and the resource availability index into an improved ant colony algorithm, where: use the dynamic weight coefficient as the heuristic information of the ant colony algorithm, use the resource availability index as the constraint condition for path selection, and generate a resource allocation scheme 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 rate; Generate a service migration sequence and resource allocation instructions according to the resource allocation scheme, execute 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 instructions.
2. The method according to claim 1, wherein Predicting the traffic of each service node within a future time window through the deep neural network model to obtain predicted traffic data includes: The deep neural network model includes: an input layer for receiving preprocessed training data; a feature extraction layer that uses a one-dimensional convolutional network to extract time series features; an attention mechanism layer for calculating the feature weights at different time points; a long short-term memory network layer for capturing the long-term dependencies of time series data; a fully connected layer for feature dimensionality reduction and combination; an output layer for outputting the prediction result; Construct training data based on the historical traffic data using the sliding time window method, train the deep neural network model through the training data, update the model parameters using an optimization algorithm with an adaptive learning rate, introduce an early stopping mechanism to prevent overfitting, and determine the optimal model parameters through cross-validation; Set the length of the prediction time window, input the historical traffic data into the trained deep neural network model, and obtain the predicted traffic data within the future time window through the forward propagation of the model.
3. The method according to claim 1, characterized in that, The calculating the dynamic weight coefficient includes: Use the ratio of the predicted traffic data to a preset traffic threshold as the basic weight, and determine the dynamic weight coefficient representing the load balancing degree of the service node in combination with the basic weight and the computing power parameters of the service node; Multiply the number of processor cores of the service node by the single-core benchmark performance to obtain the processor performance score; divide the memory capacity by the benchmark memory capacity to obtain the memory performance score; divide the network transmission rate by the benchmark transmission rate to obtain the network performance score; Denote the product of the basic weight and the processor performance score as the first sub-weight; denote the product of the basic weight and the memory performance score as the second sub-weight; denote the product of the basic weight and the network performance score as the third sub-weight; Use the weighted average of the first sub-weight, the second sub-weight, and the third sub-weight as the dynamic weight coefficient representing the load balancing degree of the service node.
4. The method according to claim 1, characterized in that Using the dynamic weight coefficient as the heuristic information of the ant colony algorithm and using the resource availability index as the constraint condition for path selection, a resource allocation scheme 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 rate, including: Set the initial parameters of the ant colony algorithm, including the number of ants, the initial value of pheromone, the pheromone evaporation coefficient, and the maximum number of iterations; Calculate the path selection probability of each service node: Take the reciprocal of the dynamic weight coefficient of each service node as the heuristic information value; Set the path selection probability of a service node with the available CPU quantity lower than the first preset threshold or the available memory capacity lower than the second preset threshold or the available network bandwidth lower than the third preset threshold to zero; For the remaining service nodes, divide the product of the pheromone concentration and the heuristic information value by the sum of the products of all optional service nodes to obtain the path selection probability; Allocate the ant colony to start from different nodes, and each ant independently executes the following steps: Record the visited service nodes; Select the next accessible service node based on the path selection probability; Calculate the load variance under the current path; When all service nodes have been visited or the load variance is less than the preset load balancing threshold, complete a path search; Perform the following operations on each search path: Obtain the service response time of each service node on the path and calculate the average response time; Obtain the resource utilization rate of each service node on the path and calculate the average resource utilization rate; Calculate the ratio of the average response time to the reference response time to obtain the time evaluation coefficient; Calculate the ratio of the average resource utilization rate to the reference utilization rate to obtain the utilization evaluation coefficient; Calculate the pheromone increment according to the time evaluation coefficient and the utilization evaluation coefficient; Update the pheromone concentration on the path according to the preset pheromone evaporation coefficient and superimpose the pheromone increment; When the maximum number of iterations is reached or the change in load variance for consecutive multiple iterations is less than the convergence threshold, select the path with the minimum load variance as the resource allocation scheme.
5. The method according to claim 4, characterized in that Calculate the pheromone increment according to the time evaluation coefficient and the utilization evaluation coefficient; Update the pheromone concentration on the path according to the preset pheromone evaporation coefficient and superimpose the pheromone increment, including: Square the time evaluation coefficient and the utilization evaluation coefficient respectively; Add the squared values of the two evaluation coefficients; Divide the added result by the number of evaluation coefficients; Multiply the calculated result by the preset path expected gain coefficient to obtain the pheromone increment; Obtain the current pheromone concentration of the path; Multiply the pheromone concentration by the preset pheromone retention rate; Superimpose the pheromone increment on the current pheromone concentration; Determine whether the updated pheromone concentration is within the preset interval; If it exceeds the preset interval, set the pheromone concentration to the interval boundary value.
6. The method according to claim 1, wherein According to the resource allocation scheme, generate a service migration sequence and resource allocation instructions, execute the service migration operations in the order of the service migration sequence, and adjust the resource configuration of each service node according to the resource allocation instructions, including: The resource allocation scheme includes a list of source service nodes to be migrated, a list of target service nodes, and the target resource configuration value of each service node; Obtain the resource occupancy of service instances running on each source service node to be migrated; calculate the remaining available resources of service nodes in the target service node list; prioritize the source service nodes according to the resource occupancy of service instances; prioritize the target service nodes according to 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 service nodes that need to be expanded; generate a resource reduction instruction for service nodes that need to be reduced; form a resource allocation instruction set with the resource expansion instruction and the resource reduction instruction.
7. An open-source system resource scheduling and management system based on service traffic prediction, which is used to implement the method described in any one of claims 1-6, characterized in that, including: The first unit is used to obtain the 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 within the future time window of each service node through the deep neural network model to obtain predicted traffic data; The second unit is used to calculate the dynamic weight coefficient according to the predicted traffic data in combination with the computing power parameters of each service node; The third unit is used to collect the 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; The fourth unit is used to input the dynamic weight coefficient and the resource availability index into an improved ant colony algorithm, where: use the dynamic weight coefficient as the heuristic information of the ant colony algorithm, use the resource availability index as the constraint condition for path selection, and generate a resource allocation scheme 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 rate; The fifth unit is used to generate a service migration sequence and resource allocation instructions according to the resource allocation scheme, perform service migration operations in the order of the service migration sequence, and adjust the resource configuration of each service node according to the resource allocation instructions.
8. An electronic device, characterized in that, including: a processor; a memory for storing instructions executable by the processor; wherein, the processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Resource prediction and scheduling method in cloud computing
CN111913780A
Cloud resource automatic allocation system
CN118363765A
Communication network optimization method, device and equipment considering power consumption
CN118509336A
Data communication system and method based on future network
CN119065818A
Distributed network resource optimization scheduling method and system under load balancing strategy
CN119232741A