A container cloud resource intelligent scheduling system based on delay perception and a working method thereof
By using a latency-aware container cloud resource intelligent scheduling system, combined with resource profiling and an improved GRU model, low-latency agile control and efficient resource scheduling in IIoT scenarios are achieved. This solves the problems of latency sensitivity and low load prediction accuracy in existing technologies, and improves resource utilization and scheduling efficiency.
Patent Information
- Application Number
- CN202410507430.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-25
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2044-04-25
AI Technical Summary
Existing cloud computing resource scheduling strategies cannot meet the latency-sensitive industrial production needs in IIoT scenarios. They suffer from low load prediction accuracy, insufficient resource scheduling efficiency and utilization, and cannot achieve low latency and elastic agile scheduling in both horizontal and vertical dimensions.
A latency-aware intelligent scheduling system for container cloud resources is adopted. It utilizes a resource profiling module, a GRU cloud load prediction module, a latency-aware module, and a dynamic scheduling module, combined with HPA and VPA strategies. The GRU model is optimized through an exponentially weighted average quantile algorithm and an improved spider-bee algorithm to perform fine-grained resource specification recommendation and dynamic scheduling.
It achieves low-latency and agile control in IIoT scenarios, improves resource scheduling efficiency and utilization, solves the problems of low load prediction accuracy and insufficient resource utilization, and meets the comprehensive scheduling requirements of multiple resource indicators.
Smart Images

Figure CN118331738B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent cloud resource scheduling technology, and in particular to a latency-aware intelligent scheduling system and method for container cloud resources. Background Technology
[0002] Thanks to the rapid development of the internet and communication technologies, and the gradual improvement of cloud computing infrastructure, the Industrial Internet of Things (IIoT) technology, which enables intelligent manufacturing, has received widespread attention and research from digital enterprises that are increasingly migrating to the cloud. IIoT is based on industrial production equipment and supported by IoT and information resource management technologies. It efficiently collects and processes large amounts of data, schedules computing and production resources, and ultimately achieves low-latency, remote, and agile control in industrial settings. However, current cloud computing resource scheduling strategies have not been fully optimized for IIoT latency-sensitive scenarios. Different needs exist for resource scheduling balance, low-latency transmission response, and elastic resource matching in different production scenarios. Therefore, there is an urgent need to propose a fine-grained, latency-aware, container cloud resource intelligent scheduling method.
[0003] Currently, most research on container cloud resource scheduling optimization schemes relies on Kubernetes (K8s), the open-source container orchestration system released by Google. K8s provides a threshold-based reactive scheduling method and has a built-in HPA (Horizontal Pod Autoscaler) horizontal pod elastic scheduling strategy, which can achieve fast scheduling of cloud resources to a certain extent. Existing container cloud resource scheduling schemes based on K8s have been researched based on the advantage of customizable scheduling algorithms. Some schemes optimize scheduling efficiency by combining traditional load forecasting methods with HPA strategies, while others use machine learning methods combined with custom-designed VPA (Vertical Pod Autoscaler) vertical pod elastic scheduling strategies to achieve cloud resource scheduling and flexible scaling.
[0004] Because IIoT technology is widely used in latency-sensitive industrial applications such as collecting production data from industrial sites, precisely controlling production equipment and processes, and remotely monitoring production sites, the original K8s scheduling scheme based on preset thresholds cannot meet the real-time requirements of rapidly changing loads. The resource specification configuration method based on experience and manual input is inefficient. Improved scheduling schemes that use traditional mathematics or machine learning for load prediction have problems such as low prediction accuracy and difficulty in selecting hyperparameters. At the same time, the scheduling strategy has the disadvantage of not being able to meet the comprehensive scheduling of multiple resource indicators. There is still no perfect solution in the IIoT scenario that can achieve low latency and elastic agile scheduling in both horizontal and vertical dimensions. There are significant shortcomings in terms of latency control and resource utilization in scheduling. Summary of the Invention
[0005] Based on the aforementioned issues in IIoT scenarios, such as high overall network latency hindering agile control at the industrial field level, low load prediction accuracy, and low resource scheduling efficiency and utilization, this invention provides a latency-aware intelligent resource scheduling system and method for container clouds. This invention primarily utilizes a quantile-based algorithm with exponential weighted average to provide recommended resource specifications at the container level, employs a GRU model optimized based on an improved spider-bee algorithm to predict dynamic load changes in the cluster, designs a latency calculation method to measure the latency generated by Pod scheduling, and finally combines HPA and VPA strategies to achieve agile scheduling and flexible scaling of resources in IIoT scenarios.
[0006] The technical means employed in this invention are as follows:
[0007] A latency-aware intelligent scheduling system for container cloud resources includes: a resource profiling module, a GRU cloud load prediction module, a latency-aware module, a dynamic scheduling module, and a hybrid scaling module, wherein:
[0008] The resource profiling module is connected to the GRU cloud load prediction module. It is used to assign weights to observation points by combining the exponential weighted moving average method with the quantile algorithm based on the characteristics of historical application resource consumption, and to make the recommended value adaptively adjusted according to the scheduling situation by combining the quantile algorithm.
[0009] The GRU cloud load prediction module is connected to the resource profiling module at one end and the latency perception module at the other end. It is used to optimize the hyperparameters of the GRU load prediction model. At the same time, it adopts a reverse learning strategy to optimize the initial population of the spider-bee algorithm, enhance the diversity of the population and expand the search range of the algorithm. The obtained optimal solution is used as the hyperparameters of the prediction model.
[0010] The latency perception module is connected to the GRU cloud load prediction module at one end and the dynamic scheduling module at the other end. It is used to combine the comprehensive latency of the system's smallest logical scheduling unit, the Pod, obtained through perception and calculation, based on differentiated business needs.
[0011] The dynamic scheduling module is connected to the latency awareness module at one end and the hybrid scaling module at the other end. It is used to improve multiple resource indicators based on the comprehensive latency of the location of the smallest logical scheduling unit Pod in the system, and select the scheduling scheme with the least latency among the nodes that meet the user application resource requirements.
[0012] The hybrid scaling module is connected to the dynamic scheduling module and is used to adopt a working mechanism that combines the automatic scaling mechanism HPA and VPA. The HPA strategy is responsible for increasing or decreasing the number of Pods based on three resource indicators: network I / O, disk I / O, and bandwidth utilization, to complete the horizontal dynamic scaling of resources. The VPA strategy is responsible for the vertical dynamic scaling of CPU and memory resource limits, and utilizes resource fragments to run non-real-time tasks.
[0013] This invention also includes a working method for a latency-aware intelligent scheduling system for container cloud resources, the specific steps of which include:
[0014] S1. Collect historical application resource consumption characteristics, calculate the β quantile value of the system's smallest logical scheduling unit Pod, and use the exponential weighted moving average method to calculate the recommended β quantile value of the g-th container in the Pod at time t for a certain resource with index z.
[0015] S2. Determine the hyperparameters of the GRU model to be optimized, and use a reverse learning strategy to optimize the initial population of spider wasps; the optimized new population goes through the hunting stage, nest building stage and mating stage of spider wasps to update the population, and obtain a set of optimal solutions as the hyperparameters of the GRU model, and set the GRU model.
[0016] S3. Establish a Pod latency-aware mathematical model to determine whether a Pod is working on a cloud central node, and calculate the combined latency of Pods on cloud central nodes and edge cloud nodes.
[0017] S4. Set the priority of the Pod, the filtering rules for the pre-selection stage, the node resource availability score for the optimization stage, and the node latency score for the optimization stage, respectively, and derive the evaluation function for the node in the optimization stage.
[0018] S5. Set the monitoring period T, predict the load of the next period based on the historical load data of the monitoring period, and output the Pod resource configuration suggestions for the current period and the next period, and modify the resource request amount of the Pod to the recommended value.
[0019] Further, step S1 specifically includes:
[0020] S11. Calculate the observation window length L using the β quantile algorithm, and obtain the data from time tL to time t-1, represented as [x t-L x t-(l-1) , ..., x t-1 ];
[0021] S12. Calculate the β quantile value of Pod resources based on historical data; after arranging these L historical data points in ascending order, define X(h) as the h-th number in the sorted sequence, and calculate the β quantile value as follows:
[0022] (L+1)×β×100%=h+φ
[0023] Where h is the integer part and φ is the fractional part, the required number of β quantiles is:
[0024]
[0025] Where, x β This represents the beta quantile value of the Pod resource.
[0026] S13. Suppose that the containers in a Pod can request z types of resources. After obtaining q β quantile values, arrange them in chronological order as [v t-q v t-(q-1) , ..., v t-1 The moving average of the β quantile demand value of the g-th container in the Pod for resource index z at time t is calculated as follows:
[0027]
[0028] Among them, M β,g,z (t, q) represents the first-order moving average of the β quantile demand value of the g-th container in the Pod for resource number z at time t.
[0029] S14. Calculate the β quantile recommendation value of the g-th container in the Pod with resource number z at time t using the exponentially weighted moving average method.
[0030] Using smoothing coefficient Calculate the predicted value v at time t β,g,z (t, a), i.e., v β,g,z (t, q) = αM g,z (t, q) + (1-α)v t-1
[0031] S15. Calculate the β quantile recommendation value of the Pod for resource number z at time t:
[0032]
[0033] Among them, Vβ,z (t, q) represents the β quantile recommendation value of the Pod for resource number z at time t, and m represents the total number of containers.
[0034] Further, step S2 specifically includes:
[0035] S21. Determine the hyperparameters of the GRU model to be optimized, and use the learning rate, the number of hidden layer neurons, and the batch size in the GRU model as the targets for improving the Spider-Bee optimization algorithm.
[0036] S22. Optimize the initial population of spider wasps using a reverse learning strategy. The original population is represented by the following formula:
[0037]
[0038] in, Let τ represent a random solution in the search space, τ represent the population index, and Ω (Ω = 1, 2, ..., N) represent the population size index. This represents the upper bound of the initial parameters. This indicates the lower bound of the initial parameters. Represents a random number between 0 and 1;
[0039] The initial population is optimized using a reverse learning strategy to generate a reverse population of the initial population:
[0040]
[0041] The reverse population is merged with the initial population. The fitness of the merged population with respect to the objective function is calculated. The N best data points are selected as the initial solutions to form a new population.
[0042] S23. Optimize the new population in S22 using the spider-bee algorithm, updating the population through the hunting, nest-building, and mating stages of the spider-bee algorithm;
[0043] S24. Using a preservation strategy, the optimal solution of each generation of the population is passed on to the next generation, and the total population size is dynamically updated in the following way:
[0044] N = N min +(NN min )×η
[0045] Where N is the population size, H min This represents the minimum population size, preventing the optimization process from getting trapped in local minima.
[0046] S25. After the termination condition is met, a set of optimal solutions is obtained as the hyperparameters of the GRU model, and the GRU neural network model is set.
[0047] The IIoT cloud workload data is acquired and preprocessed. The data is then divided into training and testing sets. The structure of the GRU neural network is determined to be three layers, and the network parameters are initialized. The optimal solutions obtained, namely the learning rate, the number of hidden layer neurons, and the batch size, are used as network hyperparameters to construct the GRU neural network model. The constructed GRU neural network model is then trained on the training set.
[0048] Furthermore, step S23 specifically includes:
[0049] S231. The hunting phase of spider wasps includes a searching phase and a mining phase; during the searching phase, the initial search process location update of female spider wasps includes two cases.
[0050] The first scenario occurs when the female spider wasp searches for prey at a steady pace, as described by the following formula:
[0051]
[0052] Where μ1 is the search speed factor of the spider wasp, r1 is a random number between 0 and 1, and rn is a normally distributed random number. and These are two random solutions in the current population. This represents a solution in the population of generation τ+1 in the first case;
[0053] The second scenario involves the female spider wasp searching for prey, and the prey falling from the web. The mathematical model for this is as follows:
[0054]
[0055] in, This indicates that a random solution in the current population represents a fallen spider. Let be a random vector between 0 and 1, and l be a random number between -1 and 2. B represents a solution in the population of generation τ+1 in the second case; B represents a random number.
[0056] The mathematical model for the location during the spider-wasp search phase is summarized as follows:
[0057]
[0058] Among them, r3 and r4 are random numbers between 0 and 1;
[0059] S232. The mining stage includes the spider wasp's pursuit and capture of prey after spotting it, as well as the prey's escape. The mathematical description of the spider wasp's approach, pursuit, and capture of prey is as follows:
[0060]
[0061]
[0062] Where r5 and r6 are numbers randomly generated between 0 and 1 in a uniform distribution; τ is the current population index, τ max The maximum population size;
[0063] The mathematical description of the prey's gradual escape and position updates during the chase is as follows:
[0064]
[0065] in, It is any numerical vector generated by a normal distribution between -η and η, and the mathematical description of η is:
[0066]
[0067] The mathematical model of the location of the spider wasp during the mining stage is summarized as follows:
[0068]
[0069] Let p be a random number generated from 0 to 1 in a uniform distribution. If p < η, then The location is updated using a search mechanism; otherwise, a mining mechanism is used.
[0070] S233. During the nest-building stage, the spider wasp pulls the preyed spider into the nest, including two cases. The first case is to use a pre-existing nest to pull the spider into the optimal location of the spider wasp, which is mathematically described as follows:
[0071]
[0072] in, This represents the current optimal solution;
[0073] The second scenario involves randomly selecting a female spider wasp within the population to create a new nest, while ensuring that no two nests are duplicated. The mathematical description is as follows:
[0074]
[0075] Where γ is a random value chosen by Levi for flight. A vector whose value is either 0 or 1, by Decide whether to use additional step size;
[0076]
[0077] Among them, r5 and r4 are vectors randomly generated from 0 to 1 in a uniform distribution;
[0078] During the optimization process, each solution is updated. The mathematical model of the rotation mechanism for the spider wasp to select a nest during the nesting stage is synthesized as follows:
[0079]
[0080] During the optimization process, hunting and nesting behaviors are rotated. If Ω < N×η, the position is updated using the hunting behavior; otherwise, the position is updated using the nesting behavior.
[0081] S234. The mathematical description of the mating stage of the spider wasp is as follows:
[0082]
[0083] Among them, is a vector representing the female spider wasp, is a vector representing the male spider wasp. Crossover() is a uniform crossover operator applied to and with a certain probability. Cr represents the crossover rate.
[0084] The male and female spider wasps are identified through the following formula:
[0085]
[0086] Among them, and are two numbers randomly selected from the normal distribution, and are two vectors generated by the following formula:
[0087]
[0088]
[0089] Among them, are three solutions randomly selected from the population, and a ≠ b ≠ c; Crossover() is used to recombine the genetic material of the parental spider wasps to produce offspring with the same characteristics as the parents.
[0090] Furthermore, the specific steps of step S3 include:
[0091] S31. Assume that there is a set of C Pods in the Kubernetes cluster in the IIoT environment. The Pod set is represented as Each gives the corresponding resource requirements through the resource profiling module, which is represented as a vector Among them These represent the recommended resource profile values for CPU, memory, network bandwidth, and disk I / O required to complete the application tasks deployed in the Pod;
[0092] S32. Utilize the cluster network communication mechanism to determine whether the Pod is working on the Cloud Node. A Kubernetes cluster consists of one Master Node and several worker nodes. The worker node cluster is further divided into Cloud Nodes at the cloud computing layer and Edge Nodes at the edge computing layer. The Master Node's API Server sends location confirmation signals to the Kube-proxy of all nodes, and each node responds with its location information. The Master Node determines whether the Pod is on the Cloud Node. If the Pod is on the Cloud Node, proceed to S33; otherwise, proceed to S34.
[0093] S33. Assume a certain user u in IIoT t The application is f(u) t ), f(u t ) is assigned to worker node n i Podc on ∈N j Deployed and run in China, f(u t The data size is f d (u t The overall latency of a Pod on a Cloud Node includes the processing latency incurred by running user applications, denoted as D. p (u t c j n i (and network latency D caused by pulling, downloading, transferring, and storing Pod images). n (u t c j n i );
[0094] The overall latency D of cloud center Pods c (u t c j n i The specific calculation formula is as follows:
[0095]
[0096] Among them, D n u t c j n i The first item in the table represents the amount of data transferred for the application and the Podc that runs the application. j The time required to process the container image data volume, where f is the time required.d (p j ) indicates the Podc running the application. j The size of the container image data, D n (u t c j n i The second item in the equation represents the time required to store and bind the application to the Pod;
[0097] S34, Overall latency D of Pods on Edge Cloud Nodes l (u t c j n i The specific calculation formula is as follows:
[0098]
[0099] Where RTT represents the round-trip time of data communication from the Master Node to the worker nodes, and the overall latency D(u) of the output node Pod is... t c j n i ).
[0100] Furthermore, step S4 specifically includes:
[0101] S41. Set the priority of the Pod according to the restart rules of the Pod itself. The Pod restart rules are divided into three levels: Always, OnFailure, and Never. Always is the highest priority, which means that the Pod should be restarted first regardless of the reason for being evicted; OnFailure is the middle priority, which means that the Pod will be restarted if it is terminated due to abnormal conditions; Never is the lowest priority, which means that the Pod will not be restarted after being terminated.
[0102] After Pods are arranged in order of priority, the scheduling module pulls queue information of Pods to be scheduled from the API Server and pulls Pods in order of priority as input for the pre-selection phase of the scheduling algorithm.
[0103] S42. Using the five default filtering rules of Kubernetes, check whether the communication port of the Pod to be scheduled has been occupied by other Pods on the node, whether the node has sufficient resources to run the Pod to be scheduled, whether the node has storage volume conflicts, whether the Pod's label information has a node that matches NodeSelectors, and whether the HostName set by the Pod has a specified matching node.
[0104] S43. Calculate and score the availability of each type of resource for all candidate Nodes obtained after filtering by pre-selection rules. Combined with the mathematical model set by the aforementioned latency-aware module, calculate the deployment and operation user u. k Application Podc j The required resources are at work node n i The availability score is:
[0105]
[0106] Among them, a(u t c j n i k) represents the working node n i The remaining availability of available resource k is given above, where k takes values of {1, 2, 3, 4, 5}, representing CPU, memory, network bandwidth, disk I / O, and network I / O, respectively. ν is the score weight for resource availability, and T(u t c j n i k) represents the working node n i The total amount of resource k in the middle;
[0107] S44. Based on the combined latency of Pods among all candidate nodes obtained in S3, sorted in ascending order of latency, the node latency score is:
[0108]
[0109] Where μ is the score weight for node Pod latency;
[0110] Based on the node latency score, calculate the new evaluation function for the Node in the optimization phase:
[0111]
[0112] The node with the highest score will be deployed as the optimal node for the Pod to be scheduled.
[0113] Further, step S5 specifically includes:
[0114] S51. Set the monitoring period T. Set the cooling flag for vertical expansion / reduction to V_flag and the horizontal flag to H_flag. The initial value is 1, indicating that expansion / reduction will occur after cooling is complete. Calculate the vertical expansion cooling time V_SCT, the vertical reduction cooling time V_RCT, the horizontal expansion cooling time H_SCT, and the horizontal reduction cooling time H_RCT respectively:
[0115]
[0116] Where DT is the deadline of the task application service running in the Pod, LV is the frequency of load change, θ and ε are the task deadline weights, SCT represents the expansion cooldown time, and RCT represents the shrinkage cooldown time.
[0117] After each expansion / shrink operation is completed, the flag is set to 0, and the timer count restarts. When the count reaches 0, the flag is automatically set to 1. When the flag is 0, expansion / shrink operations cannot be performed.
[0118] S52. In each monitoring period T, the historical load data of ξ resource indicators of all replicas of the application are obtained through the monitoring module and input into the combined prediction model to obtain the load prediction value for the next period T.
[0119] Calculate the expected number of replicas ext_P for the next period based on the predicted resource load metric values, and simultaneously calculate the expected number of replicas E of the system at the current moment. The method for calculating the expected number of Pod replicas is as follows:
[0120]
[0121] Where currentMetricValue is the current resource metric value in the cluster, desireMetricValue is the expected resource metric value of the cluster, and C_pod is the number of replicas of the current Pod.
[0122] Determine whether H_flag or V_flag is 1. If either H_flag or V_flag is 1, continue to step S53; otherwise, end the process.
[0123] S53. If H_flag is 1, execute the HPA scaling strategy process; obtain the number of currently deployed Pod replicas C_pod, compare C_pod with the number of ext_P, if the numbers are different, use the value of ext_P as the output, input the output to the RC controller, execute the Pod number increase / decrease operation, and set H_flag to 0. If V_flag is 1, execute S54;
[0124] S54 and VPA Recommender output Pod resource configuration suggestions for the current and next periods based on the current resource status, resource utilization, and the load forecast value for the next period given by the prediction model; and modify the Pod's resource request amount to the recommended value when the Pod is rebuilt.
[0125] S55. The Updater compares the suggested value with the current value. If they match, the interruption protection mechanism is run, so that the original Pod is not immediately evicted but continues to run. After resetting the resource specifications of the new Pod and ensuring that the new Pod runs to a state where it can take over the original Pod to ensure service operation, the eviction operation is then performed. The new Pod modified by the VPA Admission Controller according to the suggested value is deployed and run to the working state of the original Pod. The Updater evicts the original Pod and sets V_flag to 0.
[0126] If the Updater compares the suggested value with the current value, the process ends.
[0127] Compared with the prior art, the present invention has the following advantages:
[0128] 1. The present invention provides a latency-aware intelligent scheduling system and working method for container cloud resources, which automatically recommends resource specifications based on Pod load type and status, supports hyperparameter optimization of prediction models and highly accurate prediction of cloud load changes, meets the low-latency and agile control requirements of industrial production, and optimizes IIoT container cloud resource scheduling to maximize the utilization of fragmented resources.
[0129] 2. This invention provides a latency-aware intelligent scheduling system and method for container cloud resources. Addressing the low management efficiency caused by the manual input of Pod resource specifications in existing systems, and the problems of excessive resource reservation leading to load fluctuations in upstream and downstream links, or potential jitter and latency risks due to setting resource upper and lower limits based on experience, this invention proposes a quantile-based algorithm using exponential weighted average to provide users with a fine-grained, automated, and accurate profile of Pod resource specifications, indirectly improving resource scheduling efficiency.
[0130] 3. The present invention provides a container cloud resource intelligent scheduling system and working method based on latency awareness. Due to the problems of unreasonable hyperparameter settings, slow model convergence speed and low load prediction accuracy of existing container cloud load prediction models based on neural networks, the resource scheduling module based on prediction results has poor performance. The present invention proposes a GRU prediction model based on improved spider bee optimization. By improving the spider bee intelligent optimization algorithm to optimize the hyperparameters of the GRU model, the load prediction accuracy and generalization ability of the prediction model are improved.
[0131] 4. This invention provides a latency-aware intelligent scheduling system and method for container cloud resources. To meet the needs of IIoT applications such as latency-sensitive control, multiple resource requirements, and dynamic load changes, and to solve the problems of low resource utilization and lagging elastic scheduling in existing solutions, a latency-aware scheduling and hybrid scaling method is proposed. By quantitatively sensing the comprehensive latency of Pods running on different nodes, and combining the availability of multiple resource indicators to improve the filtering rules in the scheduling optimization stage, the optimal working node is selected for Pod deployment. Finally, using the current load status and prediction results, a hybrid scaling strategy based on HPA and VPA is adopted to cope with load changes and improve resource utilization.
[0132] 5. This invention provides a latency-aware intelligent scheduling system and method for container cloud resources. In the resource profiling module, an exponentially weighted average quantile algorithm is proposed. This algorithm combines the applicability of exponentially weighted moving average to non-periodic changing data with the statistical advantages of quantile algorithms. It can automatically output resource specification ranges based on historical data and the types of loads within Pods, effectively improving the scheduling efficiency of container cloud resources.
[0133] 6. The present invention provides a latency-aware intelligent scheduling system and working method for container cloud resources. In the GRU load prediction module based on the improved spider-bee algorithm, the population diversity of the spider-bee algorithm is improved by using a reverse learning strategy, which enhances the global optimization capability of the algorithm. Then, the improved spider-bee algorithm is used to optimize the hyperparameters of the GRU load prediction model, which effectively improves the convergence speed and accuracy of the prediction model.
[0134] 7. This invention provides a latency-aware intelligent scheduling system and method for container cloud resources. In the latency-aware scheduling and hybrid scaling module, a quantitative perception method for the comprehensive latency of Pods running on nodes at different levels is proposed, optimizing the latency-sensitive scheduling process in IIoT scenarios. A dynamic scheduling method based on latency awareness and multiple resource indicators is designed, improving the scoring function of the optimal stage of the scheduling algorithm by combining resource availability and latency scores, thus achieving low-latency container cloud resource scheduling. A hybrid scaling method of VPA and HPA for low-latency control in IIoT is proposed. By managing different resource indicators and combining the advantages of both horizontal and vertical directions, the resource utilization of the cluster is improved, the latency of resource scaling is shortened, and agile resource scaling scheduling is achieved.
[0135] Based on the above reasons, this invention can be widely promoted in the field of intelligent cloud resource scheduling technology. Attached Figure Description
[0136] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0137] Figure 1 This is a schematic diagram of the architecture of the latency-aware intelligent scheduling system for container cloud resources in this invention.
[0138] Figure 2 This is a flowchart of the GRU cloud load prediction process based on the improved spider bee algorithm in this invention.
[0139] Figure 3 This is a diagram of the GRU neural network model in this invention.
[0140] Figure 4 This is a flowchart of the hybrid scaling strategy of VPA and HPA for low-latency control of IIoT in this invention. Detailed Implementation
[0141] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0142] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0143] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0144] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of the invention. It should also be understood that, for ease of description, the dimensions of the various parts shown in the drawings are not drawn to actual scale. Techniques, methods, and devices known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the specification. In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0145] In the description of this invention, it should be understood that the orientation or positional relationship indicated by directional terms such as "front, back, up, down, left, right", "horizontal, vertical, horizontal" and "top, bottom" is generally based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing this invention and simplifying the description. Unless otherwise stated, these directional terms do not indicate or imply that the device or element referred to must have a specific orientation or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on the scope of protection of this invention. The directional terms "inner" and "outer" refer to the inner and outer contours relative to the outline of each component itself.
[0146] For ease of description, spatial relative terms such as "above," "over," "on the upper surface of," "above," etc., are used herein to describe the spatial positional relationship of a device or feature as shown in the figures to other devices or features. It should be understood that spatial relative terms are intended to encompass different orientations in use or operation besides the orientation of the device as described in the figures. For example, if the device in the figures is inverted, a device described as "above" or "above" other devices or structures would subsequently be positioned as "below" or "under" other devices or structures. Thus, the exemplary term "above" can include both "above" and "below." The device may also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatial relative descriptions used herein will be interpreted accordingly.
[0147] Furthermore, it should be noted that the use of terms such as "first" and "second" to define components is merely for the purpose of distinguishing the corresponding components. Unless otherwise stated, the above terms have no special meaning and therefore should not be construed as limiting the scope of protection of this invention.
[0148] like Figure 1As shown, this invention provides a latency-aware intelligent scheduling system for container cloud resources, comprising: a resource profiling module, a GRU cloud load prediction module, a latency-aware module, a dynamic scheduling module, and a hybrid scaling module, wherein:
[0149] The resource profiling module is connected to the GRU cloud load prediction module. It is used to assign weights to observation points by combining the exponential weighted moving average method with the quantile algorithm based on the characteristics of historical application resource consumption, and to make the recommended value adaptively adjusted according to the scheduling situation by combining the quantile algorithm.
[0150] During implementation, Kubernetes' experience-based, manual resource specification configuration is inefficient and cannot meet the high real-time management requirements of IIoT scenarios. Furthermore, administrators typically reserve a significant amount of resources to handle load fluctuations in upstream and downstream links, leading to container request configurations far exceeding actual resource utilization. Insufficient specifications, on the other hand, can introduce potential stability and latency risks to the application. Therefore, a resource profiling module was designed to analyze historical application resource consumption characteristics, including cluster resources such as CPU, memory, network I / O, bandwidth, and disk I / O.
[0151] The GRU cloud load prediction module is connected to the resource profiling module at one end and the latency perception module at the other end. It is used to optimize the hyperparameters of the GRU load prediction model. At the same time, it adopts a reverse learning strategy to optimize the initial population of the spider-bee algorithm, enhance the diversity of the population and expand the search range of the algorithm. The obtained optimal solution is used as the hyperparameters of the prediction model.
[0152] During implementation, in response to the problems of low prediction accuracy, long model training cycle and unreasonable hyperparameter settings in existing container cloud load prediction models, which lead to poor performance of resource scheduling and elastic scaling based on load prediction and thus fail to meet the agile scheduling of IIoT resources, the GRU cloud load prediction module was designed.
[0153] The latency perception module is connected to the GRU cloud load prediction module at one end and the dynamic scheduling module at the other end. It is used to combine the comprehensive latency of the system's smallest logical scheduling unit, the Pod, obtained through perception and calculation, based on differentiated business needs.
[0154] The dynamic scheduling module is connected to the latency awareness module at one end and the hybrid scaling module at the other end. It is used to improve multiple resource indicators based on the comprehensive latency of the location of the smallest logical scheduling unit Pod in the system, and select the scheduling scheme with the least latency among the nodes that meet the user application resource requirements.
[0155] The hybrid scaling module is connected to the dynamic scheduling module and is used to adopt a working mechanism that combines the automatic scaling mechanism HPA and VPA. The HPA strategy is responsible for increasing or decreasing the number of Pods based on three resource indicators: network I / O, disk I / O, and bandwidth utilization, to complete the horizontal dynamic scaling of resources. The VPA strategy is responsible for the vertical dynamic scaling of CPU and memory resource limits, and utilizes resource fragments to run non-real-time tasks.
[0156] This invention also provides a working method for a latency-aware intelligent scheduling system for container cloud resources, the specific steps of which include:
[0157] S1. Collect historical application resource consumption characteristics, calculate the β quantile value of the system's smallest logical scheduling unit Pod, and use the exponential weighted moving average method to calculate the recommended β quantile value of the g-th container in the Pod at time t for a certain resource with index z.
[0158] S2. Determine the hyperparameters of the GRU model to be optimized, and use a reverse learning strategy to optimize the initial population of spider wasps; the optimized new population goes through the hunting stage, nest building stage and mating stage of spider wasps to update the population, and obtain a set of optimal solutions as the hyperparameters of the GRU model, and set the GRU model.
[0159] S3. Establish a Pod latency-aware mathematical model to determine whether a Pod is working on a cloud central node, and calculate the combined latency of Pods on cloud central nodes and edge cloud nodes.
[0160] S4. Set the priority of the Pod, the filtering rules for the pre-selection stage, the node resource availability score for the optimization stage, and the node latency score for the optimization stage, respectively, and derive the evaluation function for the node in the optimization stage.
[0161] S5. Set the monitoring period T, predict the load of the next period based on the historical load data of the monitoring period, and output the Pod resource configuration suggestions for the current period and the next period, and modify the resource request amount of the Pod to the recommended value.
[0162] In a specific implementation, as a preferred embodiment of the present invention, step S1 specifically includes:
[0163] S11. Calculate the observation window length L using the β quantile algorithm, and obtain the data from time tL to time t-1, represented as [x t-L x t-(l-1) , ..., x t-1 ];
[0164] S12. Calculate the β quantile value of Pod resources based on historical data; after arranging these L historical data points in ascending order, define X(h) as the h-th number in the sorted sequence, and calculate the β quantile value as follows:
[0165] (L+1)×β×100%=h+φ
[0166] Where h is the integer part and φ is the fractional part, the required number of β quantiles is:
[0167]
[0168] Where, x β This represents the beta quantile value of a Pod resource.
[0169] S13. Suppose that the containers in a Pod can request z types of resources. After obtaining g beta quantile values, arrange them in chronological order as [v t-q v t-(q-1) , ..., v t-1 The moving average of the β quantile demand value of the g-th container in the Pod for resource index z at time t is calculated as follows:
[0170]
[0171] Among them, M β,g,z (t, a) represents the first-order moving average of the β quantile demand value of the g-th container in the Pod for resource number z at time t.
[0172] S14. Calculate the β quantile recommendation value of the g-th container in the Pod with resource number z at time t using the exponentially weighted moving average method.
[0173] Using smoothing coefficient Calculate the predicted value v at time t β,g,z (t, q), i.e., v β,g,z (t, q) = αM g,z (t,a)+(1-α)v t-1
[0174] S15. Calculate the β quantile recommendation value of the Pod for resource number z at time t:
[0175]
[0176] Among them, V β,z (t, q) represents the β quantile recommendation value of the Pod for resource number z at time t, and m represents the total number of containers.
[0177] In a specific implementation, as a preferred embodiment of the present invention, step S2 specifically includes:
[0178] S21. Determine the hyperparameters of the GRU model to be optimized, and use the learning rate, the number of hidden layer neurons, and the batch size in the GRU model as the targets for improving the Spider-Bee optimization algorithm.
[0179] S22. Optimize the initial population of spider wasps using a reverse learning strategy. The original population is represented by the following formula:
[0180]
[0181] in, Let τ represent a random solution in the search space, τ represent the population index, and Ω (Ω = 1, 2, ..., N) represent the population size index. This represents the upper bound of the initial parameters. This indicates the lower bound of the initial parameters. Represents a random number between 0 and 1;
[0182] The initial population is optimized using a reverse learning strategy to generate a reverse population of the initial population:
[0183]
[0184] The reverse population is merged with the initial population. The fitness of the merged population with respect to the objective function is calculated. The N best data points are selected as the initial solutions to form a new population.
[0185] S23. Optimize the new population in S22 using the spider-bee algorithm, updating the population through the hunting, nest-building, and mating stages of the spider-bee algorithm;
[0186] S24. Using a preservation strategy, the optimal solution of each generation of the population is passed on to the next generation, and the total population size is dynamically updated in the following way:
[0187] N = N min +(NN min )×η
[0188] Where N is the population size, N min This represents the minimum population size to prevent the optimization process from getting stuck in local minima. In practice, the preservation strategy means passing the best solution of each generation to the next generation, that is, comparing the best solutions of each generation and replacing the solutions of the previous generation with the better solutions.
[0189] S25. After the termination condition is met, a set of optimal solutions is obtained as the hyperparameters of the GRU model, and the GRU neural network model is set.
[0190] The IIoT cloud workload data is acquired and preprocessed. The data is then divided into training and testing sets. The structure of the GRU neural network is determined to be three layers, and the network parameters are initialized. The optimal solutions obtained, namely the learning rate, the number of hidden layer neurons, and the batch size, are used as network hyperparameters to construct the GRU neural network model. The constructed GRU neural network model is then trained on the training set.
[0191] In a specific implementation, as a preferred embodiment of the present invention, step S23 specifically includes:
[0192] S231. The hunting phase of spider wasps includes a searching phase and a mining phase; during the searching phase, the initial search process location update of female spider wasps includes two cases.
[0193] The first scenario occurs when the female spider wasp searches for prey at a steady pace, as described by the following formula:
[0194]
[0195] Where μ1 is the search speed factor of the spider wasp, r1 is a random number between 0 and 1, and rn is a normally distributed random number. and These are two random solutions in the current population. This represents a solution in the population of generation τ+1 in the first case;
[0196] The second scenario involves the female spider wasp searching for prey, and the prey falling from the web. The mathematical model for this is as follows:
[0197]
[0198] in, This indicates that a random solution in the current population represents a fallen spider. Let be a random vector between 0 and 1, and l be a random number between -1 and 2. B represents a solution in the population of generation τ+1 in the second case; B represents a random number.
[0199] The mathematical model for the location during the spider-wasp search phase is summarized as follows:
[0200]
[0201] Among them, r3 and r4 are random numbers between 0 and 1;
[0202] S232. The mining stage includes the spider wasp's pursuit and capture of prey after spotting it, as well as the prey's escape. The mathematical description of the spider wasp's approach, pursuit, and capture of prey is as follows:
[0203]
[0204]
[0205] Where r5 and r6 are numbers randomly generated between 0 and 1 in a uniform distribution; τ is the current population index, τ max The maximum population size;
[0206] The mathematical description of the prey's gradual escape and position updates during the chase is as follows:
[0207]
[0208] in, It is any numerical vector generated by a normal distribution between -η and η, and the mathematical description of η is:
[0209]
[0210] The mathematical model of the location of the spider wasp during the mining stage is summarized as follows:
[0211]
[0212] Let p be a random number generated from 0 to 1 in a uniform distribution. If p < η, then The location is updated using a search mechanism; otherwise, a mining mechanism is used.
[0213] During implementation, in the hunting phase, the algorithm uses a random rotation system to switch between the search and mining mechanisms.
[0214] S233. During the nest-building stage, the spider wasp pulls the preyed spider into the nest, including two cases. The first case is to use a pre-existing nest to pull the spider into the optimal location of the spider wasp, which is mathematically described as follows:
[0215]
[0216] in, This represents the current optimal solution;
[0217] The second scenario involves randomly selecting a female spider wasp within the population to create a new nest, while ensuring that no two nests are duplicated. The mathematical description is as follows:
[0218]
[0219] Where γ is a random value chosen by Levi for flight. A vector whose value is either 0 or 1, by Decide whether to use additional step size;
[0220]
[0221] Among them, r5 and r4 are vectors randomly generated from 0 to 1 in a uniform distribution;
[0222] Each solution is updated during optimization, and the mathematical model for the rotation mechanism of the spider-wasp choosing a nest during the nest-building phase is summarized as follows:
[0223]
[0224] During the optimization period, hunting and nesting behaviors are rotated. If Ω < N×η, the hunting behavior is used to update the position; otherwise, the nesting behavior is used to update the position.
[0225] S234. The mathematical description of the mating stage of spider wasps is as follows:
[0226]
[0227] Among them, is a vector representing female spider wasps, is a vector representing male spider wasps. Crossover() is an uniform crossover operator applied to and with a certain probability. Cr represents the crossover rate.
[0228] Male and female spider wasps are identified through the following formula:
[0229]
[0230] Among them, and are two numbers randomly selected from the normal distribution, and are two vectors generated by the following formula:
[0231]
[0232]
[0233] Among them, are three solutions randomly selected from the population, and a ≠ b ≠ c; Crossover() is used to recombine the genetic material of the parental spider wasps to produce offspring with the same characteristics as the parents.
[0234] In specific implementation, as a preferred implementation manner of the present invention, the step S3 specifically includes:
[0235] S31. Assume that there is a set of Pods with a quantity of C in the Kubernetes cluster in the IIoT environment. The Pod set is represented as Each gives the corresponding resource requirement through the resource profiling module, which is represented as a vector Among them respectively represent the resource profiling recommended values of CPU, memory, network bandwidth, and disk I / O required to complete the application tasks deployed in the Pod; for example
[0236] S32. Utilize the cluster network communication mechanism to determine whether the Pod is working on the Cloud Node. A Kubernetes cluster consists of one Master Node and several worker nodes. The worker node cluster is further divided into Cloud Nodes at the cloud computing layer and Edge Nodes at the edge computing layer. The Master Node's API Server sends location confirmation signals to the Kube-proxy of all nodes, and each node responds with its location information. The Master Node determines whether the Pod is on the Cloud Node. If the Pod is on the Cloud Node, proceed to S33; otherwise, proceed to S34.
[0237] S33. Assume a certain user u in IIoT t The application is f(u) t ), f(u t ) is assigned to worker node n i Podc on ∈N j Deployed and run in China, f(u t The data size is f d (u t The overall latency of a Pod on a Cloud Node includes the processing latency incurred by running user applications, denoted as D. p (u t c j n i (and network latency D caused by pulling, downloading, transferring, and storing Pod images). n (u t c j n i );
[0238] The overall latency D of cloud center Pods c (u t c j n i The specific calculation formula is as follows:
[0239]
[0240] Among them, D n (u t c j n i The first item in the table represents the amount of data transferred for the application and the Podc that runs the application. j The time required to process the container image data volume, where f is the time required. d (p j ) indicates the Podc running the application. j The size of the container image data, Dn (u t c j n i The second item in the equation represents the time required to store and bind the application to the Pod;
[0241] In implementation, the overall latency of Pods on Edge Cloud Nodes includes not only the overall latency of Pods on Cloud Nodes but also the RTT (Round-Trip Time) of network communication from the Master Node to worker nodes in Kubernetes. This time is calculated statistically by the monitoring module. Since Pods on Cloud Nodes are closer to the Master Node, which is also located in the cloud computing layer, their RTT is negligible.
[0242] S34, Overall latency D of Pods on Edge Cloud Nodes l (u t c j n i The specific calculation formula is as follows:
[0243]
[0244] Where RTT represents the round-trip time of data communication from the Master Node to the worker nodes, and the overall latency D(u) of the output node Pod is... t c j n i ).
[0245] In a specific implementation, as a preferred embodiment of the present invention, step S4 specifically includes:
[0246] S41. Set the priority of the Pod according to the restart rules of the Pod itself. The Pod restart rules are divided into three levels: Always, OnFailure, and Never. Always is the highest priority, which means that the Pod should be restarted first regardless of the reason for being evicted; OnFailure is the middle priority, which means that the Pod will be restarted if it is terminated due to abnormal conditions; Never is the lowest priority, which means that the Pod will not be restarted after being terminated.
[0247] After Pods are arranged in order of priority, the scheduling module pulls queue information of Pods to be scheduled from the API Server and pulls Pods in order of priority as input for the pre-selection phase of the scheduling algorithm.
[0248] S42. Using the five default filtering rules of Kubernetes, check whether the communication port of the Pod to be scheduled has been occupied by other Pods on the node, whether the node has sufficient resources to run the Pod to be scheduled, whether the node has storage volume conflicts, whether the Pod's label information has a node that matches NodeSelectors, and whether the HostName set by the Pod has a specified matching node.
[0249] S43. Calculate and score the availability of each type of resource for all candidate Nodes obtained after filtering by pre-selection rules. Combined with the mathematical model set by the aforementioned latency-aware module, calculate the deployment and operation user u. k Application Podc j The required resources are at work node n i The availability score is:
[0250]
[0251] Among them, a(u t c j n i k) represents the working node n i The remaining availability of available resource k is given above, where k takes values of {1, 2, 3, 4, 5}, representing CPU, memory, network bandwidth, disk I / O, and network I / O, respectively. ν is the score weight for resource availability, and T(u t c j n i k) represents the working node n i The total amount of resource k in the middle;
[0252] S44. Based on the combined latency of Pods among all candidate nodes obtained in S3, sorted in ascending order of latency, the node latency score is:
[0253]
[0254] Where μ is the score weight for node Pod latency;
[0255] Based on the node latency score, calculate the new evaluation function for the Node in the optimization phase:
[0256]
[0257] The node with the highest score will be deployed as the optimal node for the Pod to be scheduled.
[0258] In a specific implementation, as a preferred embodiment of the present invention, step S5 specifically includes:
[0259] S51. Set the monitoring period T. Set the cooling flag for vertical expansion / shrinkage to V_flaa and the horizontal flag to H_flag. The initial value is 1, indicating that expansion / shrinkage will occur after cooling is complete. Calculate the vertical expansion cooling time V_SCT, the vertical shrinkage cooling time V_RCT, the horizontal expansion cooling time H_SCT, and the horizontal shrinkage cooling time H_RCT respectively:
[0260]
[0261] Where DT is the deadline of the task application service running in the Pod, LV is the frequency of load change, θ and ε are the task deadline weights, SCT represents the expansion cooldown time, and RCT represents the shrinkage cooldown time.
[0262] During implementation, the expansion / shrinkage cooldown time is controlled by a timer. After each expansion / shrinkage operation is completed, the flag bit is set to 0, and the timer count restarts. When the count reaches 0, the flag bit is automatically set to 1. When the flag bit is 0, expansion / shrinkage operations cannot be performed.
[0263] S52. In each monitoring period T, the historical load data of ξ resource indicators of all replicas of the application are obtained through the monitoring module and input into the combined prediction model to obtain the load prediction value for the next period T.
[0264] Calculate the expected number of replicas ext_P for the next period based on the predicted resource load metric values, and simultaneously calculate the expected number of replicas E of the system at the current moment. The method for calculating the expected number of Pod replicas is as follows:
[0265]
[0266] Where currentMetricValue is the current resource metric value in the cluster, desireMetricValue is the expected resource metric value of the cluster, and C_pod is the number of replicas of the current Pod.
[0267] During implementation, the monitoring module and resource data metrics of the Metrics Server are used to calculate the current number of target Pods and resource utilization of VPA scaling.
[0268] Determine whether H_flag or V_flag is 1. If either H_flag or V_flag is 1, continue to step S53; otherwise, end the process.
[0269] S53. If H_flag is 1, execute the HPA scaling strategy process; obtain the number of currently deployed Pod replicas C_pod, compare C_pod with the number of ext_P, if the numbers are different, use the value of ext_P as the output, input the output to the RC controller, execute the Pod number increase / decrease operation, and set H_flag to 0; if V_flag is 1, execute S54.
[0270] S54 and VPA Recommender output Pod resource configuration suggestions for the current and next periods based on the current resource status, resource utilization, and the load forecast value for the next period given by the prediction model; and modify the Pod's resource request amount to the recommended value when the Pod is rebuilt.
[0271] In implementation, VPA mainly consists of two components: VPA Controller and VPA Admission Controller. The VPA Controller includes a Recommender that makes suggestions on adjusting Pod resources and an Updater that evicts Pods based on conditions. The VPA Admission Controller is responsible for modifying the resource request amount of the Pod to the recommended value when the Pod is rebuilt.
[0272] S55. The Updater compares the suggested value with the current value. If they match, the interruption protection mechanism is run, so that the original Pod is not immediately evicted but continues to run. After resetting the resource specifications of the new Pod and ensuring that the new Pod runs to a state where it can take over the original Pod to ensure service operation, the eviction operation is then performed. The new Pod modified by the VPA Admission Controller according to the suggested value is deployed and run to the working state of the original Pod. The Updater evicts the original Pod and sets V_flag to 0.
[0273] During implementation, an interruption protection mechanism was designed to address the issue that VPA policies can cause service interruptions due to the eviction of original Pods, the restart of new Pods, and the rescheduling and re-deployment of new Pods after resetting Pod resource limits.
[0274] If the Updater compares the suggested value with the current value, the process ends.
[0275] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions 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. A latency-aware intelligent scheduling system for container cloud resources, characterized in that, include: The module includes a resource profiling module, a GRU cloud load prediction module, a latency awareness module, a dynamic scheduling module, and a hybrid scaling module, among which: The resource profiling module, connected to the GRU cloud load prediction module, is used to assign weights to observation points based on the characteristics of historical application resource consumption, using a combination of exponentially weighted moving average and quantile algorithm, and to adaptively adjust the recommended value according to the scheduling situation using the quantile algorithm; specifically including: according to Quantile algorithm calculates the observation window length L Get from time arrive Data at time point, represented as ; Calculate Pod resources based on historical data Quantile value; after arranging these L historical data points in ascending order, define... For the sorted sequence, the first... h Number, Quantile values are calculated as follows: in, h The integer part If it is the decimal part, then the required value is... The number of quantile values is: in, Represents Pod resources Quantile values; Suppose that the containers in a Pod can request z types of resources. When obtaining... q indivual The quantile values are then arranged in chronological order and represented as follows: ,but t The first in Moments Pod g The container pairs have resource sequence numbers. z of The first moving average of the quantile demand values is calculated as follows: in, express t The first in Moments Pod g A container for resource sequence number z A moving average of the quantile demand values; Calculate using the exponentially weighted moving average method t The first in Moments Pod g The container pairs have resource sequence numbers. z of Recommended quantile value; Using smoothing coefficient calculate t Time prediction value , ,Right now: calculate t The Pod at any given time has a resource sequence number of 1. z of Recommended quantile values: in, express t The Pod at any given time has a resource sequence number of 1. z of Percentage recommendation value m Indicates the total number of containers; The GRU cloud load prediction module is connected to the resource profiling module at one end and the latency perception module at the other end. It is used to optimize the hyperparameters of the GRU load prediction model. At the same time, it adopts a reverse learning strategy to optimize the initial population of the spider-bee algorithm, enhance the diversity of the population and expand the search range of the algorithm. The obtained optimal solution is used as the hyperparameters of the prediction model. The latency awareness module is connected to the GRU cloud load prediction module at one end and the dynamic scheduling module at the other end. It is used to determine the comprehensive latency based on differentiated business needs, combined with the perceived and calculated location of the system's smallest logical scheduling unit, the Pod. Specifically, it includes: S31. Assume there is a set of C Pods in a Kubernetes cluster under an IIoT environment. The Pod set is represented as... each The resource profiling module provides the corresponding resource requirements as a vector. ,in , , , These represent the recommended resource profile values for CPU, memory, network bandwidth, and disk I / O required to complete the application tasks deployed in the Pod; S32. Utilize the cluster network communication mechanism to determine whether a Pod is working on a Cloud Node. A Kubernetes cluster consists of a Master Node and several worker nodes. The worker node cluster is further divided into Cloud Nodes at the cloud computing layer and Edge Nodes at the edge computing layer. The Master Node's API Server sends location confirmation signals to the Kube-proxy of all nodes. Each node responds with its location information. The Master Node determines whether the Pod is on the Cloud Node. If the Pod is on the Cloud Node, proceed to S33; otherwise, proceed to S34. S33, Assuming a certain user of IIoT The application is , Assigned to a work node On Deployed and running in China The size of the data is The overall latency of a Pod on a Cloud Node includes the processing latency incurred by running user applications, expressed as... And network latency caused by pulling, downloading, transferring, and storing Pod images. ; Overall latency of cloud center Pods The specific calculation formula is as follows: in, The first item in the table represents the amount of data transferred by the application and the amount of data used to run the application. The time required for the container image data volume, in the formula Indicates that the application is running The size of the container image data. The second item in the table represents the time required to store and bind the application to the Pod; S34, Overall latency of Pods on Edge Cloud Nodes The specific calculation formula is as follows: RTT represents the round-trip time of data communication from the Master Node to the worker nodes, and the overall latency of the output node Pod. ; The dynamic scheduling module, connected to the latency awareness module at one end and the hybrid scaling module at the other, is used to improve multiple resource metrics based on the overall latency of the location of the system's smallest logical scheduling unit, the Pod; specifically, it includes: The priority of a Pod is set according to its own restart rules. Pod restart rules are divided into three levels: Always, OnFailure, and Never. Always is the highest priority, which means that the Pod should be restarted regardless of the reason for being evicted. OnFailure is the middle priority, which means that the Pod will be restarted if it is terminated due to abnormal conditions. Never is the lowest priority, which means that the Pod will not be restarted after being terminated. After Pods are arranged in order of priority, the scheduling module pulls queue information of Pods to be scheduled from the API Server and pulls Pods in order of priority as input for the pre-selection phase of the scheduling algorithm. Using Kubernetes' default five filtering rules, we check whether the communication port of the Pod to be scheduled is occupied by other Pods on the same node, whether the node has sufficient resources to run the Pod to be scheduled, whether there is a storage volume conflict on the node, whether the Pod's label information has a node that matches NodeSelectors, and whether the HostName set by the Pod has a specified matching node. The availability of each type of resource for all candidate Nodes obtained after filtering by pre-selection rules is calculated and scored. Combined with the mathematical model set by the aforementioned latency-aware module, the availability of deployed and running users is calculated. application's The required resources at the work nodes The availability score is: in, Represents working node The remaining availability of the usable resource k in the above example, where k takes the value of k. The values of k represent CPU, memory, network bandwidth, disk I / O, and network I / O, respectively. As the score weight for resource availability, Represents working node The total amount of resource k in the middle; Based on the combined latency of Pods across all candidate nodes, sorted in ascending order of latency, the node latency score is: in, The score weights for node Pod latency; Based on the node latency score, calculate the new evaluation function for the Node in the optimization phase: The node with the highest score will be deployed as the optimal node for the Pod to be scheduled. The hybrid scaling module, connected to the dynamic scheduling module, employs a combined HPA and VPA (Automatic Power Allocation) scaling mechanism. The HPA strategy controls the increase or decrease of the number of Pods based on three resource metrics: network I / O, disk I / O, and bandwidth utilization, achieving horizontal dynamic scaling. The VPA strategy controls the vertical dynamic scaling of CPU and memory resource limits, utilizing resource fragmentation to run non-real-time tasks. Specifically, it includes: Set the monitoring period T, and set the cooling flag for vertical expansion / contraction as follows: The horizontal marker is The initial value is 1 by default, indicating that expansion and contraction will occur after cooling is complete. The cooling time for vertical expansion is calculated separately. Vertical volume reduction cooling time Horizontal expansion cooling time and horizontal volume reduction cooling time : Where DT is the deadline for the application service running within the Pod, and LV is the frequency of load changes. , The task deadline weights are SCT, which represents expansion cooldown time, and RCT, which represents reduction cooldown time. After each expansion / shrink operation is completed, the flag is set to 0, and the timer count restarts. When the count reaches 0, the flag is automatically set to 1. When the flag is 0, the expansion / shrink operation cannot be performed. In each monitoring period T, the monitoring module retrieves the data of all application replicas. The historical load data of each resource indicator is input into the combined forecast model to obtain the load forecast value for the next period T. Calculate the expected number of replicas for the next cycle based on the predicted resource load metric. Simultaneously, calculate the expected number of replicas E of the system at the current moment. The method for calculating the expected number of Pod replicas is as follows: in, This represents the current resource metric value in the cluster. This represents the expected resource metrics for the cluster. This represents the number of replicas of the current Pod. judge or Is it 1? If or If any value is 1, proceed to the next step; otherwise, end the process. like If the value is 1, execute the HPA scaling strategy process; obtain the number of currently deployed Pod replicas. ,Compare and The quantity size, if the quantities are different, then The value is used as the output, and the output is input to the RC controller to perform the increase or decrease operation of the number of Pods, while setting... If it is 0; If the value is 1, proceed to the next step; VPA Recommender outputs Pod resource configuration suggestions for the current and next periods based on the current resource status, resource utilization, and the load forecast value for the next period given by the prediction model; and modifies the Pod's resource request amount to the recommended value when the Pod is rebuilt. The Updater compares the recommended values with the current values. If they match, it runs an interruption protection mechanism, preventing the original Pod from being immediately evicted but allowing it to continue running. After resetting the resource specifications of the new Pod and ensuring it's ready to take over the original Pod to guarantee service continuity, the eviction operation is then performed. The new Pod, modified according to the recommended values by the VPA Admission Controller, is deployed and runs until the original Pod is in a working state. The Updater then evicts the original Pod and sets... =0; If the Updater finds that the recommended value is inconsistent with the current value, the process ends.
2. A working method of the latency-aware intelligent scheduling system for container cloud resources as described in claim 1, characterized in that, The specific steps include: S1. Collect historical application resource consumption characteristics and calculate the minimum logical scheduling unit (Pod) of the system. Quantile value, calculated using the exponentially weighted moving average method, for the g-th container in a Pod at time t with respect to a resource of index z. Recommended quantile value; S2. Determine the hyperparameters of the GRU model to be optimized, and use a reverse learning strategy to optimize the initial population of spider wasps; the optimized new population goes through the hunting stage, nest building stage and mating stage of spider wasps to update the population, and obtain a set of optimal solutions as the hyperparameters of the GRU model, and set the GRU model. S3. Establish a Pod latency-aware mathematical model to determine whether a Pod is working on a cloud central node, and calculate the combined latency of Pods on cloud central nodes and edge cloud nodes. S4. Set the priority of the Pod, the filtering rules for the pre-selection stage, the node resource availability score for the optimization stage, and the node latency score for the optimization stage, respectively, and derive the evaluation function for the node in the optimization stage. S5. Set the monitoring period T, predict the load of the next period based on the historical load data of the monitoring period, and output the Pod resource configuration suggestions for the current period and the next period, and modify the resource request amount of the Pod to the recommended value.
3. The working method of the latency-aware intelligent scheduling system for container cloud resources according to claim 2, characterized in that, Step S2 specifically includes: S21. Determine the hyperparameters of the GRU model to be optimized, and use the learning rate, the number of hidden layer neurons, and the batch size in the GRU model as the targets for improving the Spider-Bee optimization algorithm. S22. Optimize the initial population of spider wasps using a reverse learning strategy. The original population is represented by the following formula: in, This represents a random solution in the search space. Represents the population index. Indicates the population size index. , This represents the upper bound of the initial parameters. This indicates the lower bound of the initial parameters. Represents a random number between 0 and 1; The initial population is optimized using a reverse learning strategy to generate a reverse population of the initial population: Merge the reverse population with the initial population, calculate the fitness of the merged population with respect to the objective function, and select the optimal one. N These data points are used as initial solutions to form a new population. ; S23. Optimize the new population in S22 using the spider-bee algorithm, updating the population through the hunting, nest-building, and mating stages of the spider-bee algorithm; S24. Using a preservation strategy, the optimal solution of each generation of the population is passed on to the next generation, and the total population size is dynamically updated in the following way: in, N It is the population size. This represents the minimum population size, preventing the optimization process from getting trapped in local minima. S25. After the termination condition is met, a set of optimal solutions is obtained as the hyperparameters of the GRU model, and the GRU neural network model is set. The IIoT cloud workload data is acquired and preprocessed. The data is then divided into training and testing sets. The structure of the GRU neural network is determined to be three layers, and the network parameters are initialized. The optimal solutions obtained, namely the learning rate, the number of hidden layer neurons, and the batch size, are used as network hyperparameters to construct the GRU neural network model. The constructed GRU neural network model is then trained on the training set.
4. The working method of the latency-aware intelligent scheduling system for container cloud resources according to claim 3, characterized in that, Step S23 specifically includes: S231. The hunting phase of spider wasps includes a searching phase and a mining phase; during the searching phase, the initial search process location update of female spider wasps includes two cases. The first scenario occurs when the female spider wasp searches for prey at a steady pace, as described by the following formula: in, The search speed factor for spider wasps. It is a random number between 0 and 1. These are normally distributed random numbers. and These are two random solutions in the current population. When referring to the first case A solution in a generational population; The second scenario involves the female spider wasp searching for prey, and the prey falling from the web. The mathematical model for this is as follows: in, This indicates that a random solution in the current population represents a fallen spider. A random vector between 0 and 1. A random number between -1 and 2. When indicating the second case A solution in a generational population; B Represents a random number; The mathematical model for the location during the spider-wasp search phase is summarized as follows: in, and It is a random number between 0 and 1; S232. The mining stage includes the spider wasp's pursuit and capture of prey after spotting it, as well as the prey's escape. The mathematical description of the spider wasp's approach, pursuit, and capture of prey is as follows: in, A number randomly generated between 0 and 1 in a uniform distribution; For the current population index, The maximum population size; The mathematical description of the prey's gradual escape and position updates during the chase is as follows: in, Therefore, it is normally distributed in - arrive Any numerical vector generated between them, The mathematical description is as follows: The mathematical model of the location of the spider wasp during the mining stage is summarized as follows: set up p A random number generated from 0 to 1 in a uniform distribution. ,but The location is updated using a search mechanism; otherwise, a mining mechanism is used. S233. During the nest-building stage, the spider wasp pulls the preyed spider into the nest, including two cases. The first case is to use a pre-existing nest to pull the spider into the optimal location of the spider wasp, which is mathematically described as follows: in, This represents the current optimal solution; The second scenario involves randomly selecting a female spider wasp within the population to create a new nest, while ensuring that no two nests are duplicated. The mathematical description is as follows: in, It's a random value chosen by Levi during flight. A vector whose value is either 0 or 1, by Decide whether to use additional step size; in, , A vector randomly generated from 0 to 1 in a uniform distribution; Each solution is updated during optimization, and the mathematical model for the rotation mechanism of the spider-wasp choosing a nest during the nest-building phase is summarized as follows: During the optimization period, hunting and nest-building behaviors were alternated. < If the location is not found, the hunting behavior will be used to update the location; otherwise, the nesting behavior will be used to update the location. S234. The mathematical description of the mating stage of spider wasps is as follows: in, Let the vector represent the female spider wasp. The vector representing the male spider wasp. It is applied to and A consistent crossover operator with a certain probability. Cr Indicates the crossover rate; Male and female spider wasps can be distinguished using the following formula: in, and These are two numbers randomly selected from a normal distribution. and These are two vectors generated by the following formula: in, , , These are three solutions randomly selected from the population, and ; Genetic material from parent spider wasps is used to recombine the genetic material of the offspring to produce offspring with the same characteristics as their parents.
Citation Information
Patent Citations
Monitoring component elastic telescoping method and device based on Kubernetes cluster and controlled terminal
CN110262899A
K8S container scheduling method and system based on monitoring perception
CN117729204A