Method and device for scheduling cloud native applications
By predicting future resource usage information and using a scheduling model for dynamic decision-making, the problem of resource fragmentation accumulation in cloud-native application scheduling is solved, achieving maximum resource utilization and zero rollback in business performance.
Patent Information
- Application Number
- CN202511629650.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-02-24
AI Technical Summary
Existing technologies employ static decision-making when scheduling cloud-native applications, leading to the accumulation of fragmented resources and resulting in large-scale resource waste.
By predicting resource usage information within future time windows, dynamic decision-making is made using a scheduling model to reduce the future fragmentation rate of the cluster. The deployment of scheduling units is optimized by employing methods such as sequence prediction, resource replay, and future fragmentation rate assessment.
It significantly reduced future fragmentation rates, avoided resource waste, improved resource utilization, reduced resource idleness caused by fragmentation lock-up, and achieved maximum resource utilization and zero rollback in business performance.
Smart Images

Figure CN121560449A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud-native application scheduling technology, and in particular to a method and apparatus for scheduling cloud-native applications. Background Technology
[0002] With the rise of multi-cloud / cloud-edge (cloud-to-edge) collaborative architectures, cloud-native applications are increasingly deployed in heterogeneous environments consisting of public clouds, private clouds, and edge nodes. Cloud-native applications are deployed to cloud nodes in the form of containers, and are scheduled in units of scheduling units. Each scheduling unit includes one or more cloud-native application containers. Cloud integration services such as Kubernetes (k8s) orchestration platforms achieve load distribution and resource isolation by scheduling these scheduling units (Pods).
[0003] The current scheduling scheme for scheduling units is implemented by a built-in scheduler and a third-party scheduling plugin. It mainly relies on the remaining resources of cloud nodes in the cloud environment to make static decisions, ignoring the long-term impact of the arrival sequence of subsequent scheduling units on resource utilization.
[0004] Deploying scheduling units to corresponding cloud nodes may not affect a single scheduling session if it fails to fill the remaining resource capacity in the short term. However, as new scheduling units are continuously deployed, fragmentation will accumulate and lead to large-scale resource waste. When more dimensional resources are introduced, the fragmentation problem becomes particularly serious due to the finer granularity and poorer reusability of resource blocks. Summary of the Invention
[0005] The purpose of this application is to provide a method and apparatus for scheduling cloud-native applications, which solves the problem that static decision-making in cloud-native application scheduling can easily lead to the accumulation of fragmentation and large-scale resource waste in the future.
[0006] In a first aspect, embodiments of this application provide a method for scheduling cloud-native applications, wherein the cloud-native applications are scheduled in units of scheduling units, and the method includes: When a scheduling unit is triggered, the scheduling unit with the earliest time sequence in the list of units to be scheduled that has not yet been scheduled is identified as the unit to be scheduled. Obtain the resource remaining rate of different cloud nodes, and predict the scheduling units generated in the future time window and the corresponding deployed cloud nodes; Based on the resource occupancy information of different cloud nodes at the end of the future time window, the future fragmentation rate of the nodes, which characterizes the degree of fragmentation risk of the cloud nodes, is obtained. The resource remaining rate and future fragmentation rate of different cloud nodes are used as state space data and input into the scheduling model. The scheduling model outputs the target node. The scheduling model is trained by inputting the state space data in the sample into the scheduling model for feature encoding, predicting the selection probability of different cloud nodes and outputting the decision node, with the goal of reducing the future fragmentation rate of the cluster. The state space data in the sample includes the resource remaining rate and future fragmentation rate of different cloud nodes in the sample when the unit to be scheduled arrives. The future fragmentation rate of the cluster is obtained based on the future fragmentation rate of the different cloud nodes in the sample. The unit to be scheduled is deployed to the target node, and the scheduling of the scheduling unit is triggered again until the scheduling of the scheduling units in the list to be scheduled is completed.
[0007] Secondly, embodiments of this application provide an apparatus for scheduling cloud-native applications, wherein the cloud-native applications are scheduled in units of scheduling units, including: The module for determining the scheduling unit is used to determine the scheduling unit with the earliest time sequence and no scheduling in the scheduling list as the scheduling unit when the scheduling of the scheduling unit is triggered. The scheduling prediction module is used to obtain the resource remaining rate of different cloud nodes and predict the scheduling units generated in the future time window and the corresponding deployed cloud nodes. The fragmentation rate prediction module is used to obtain the future fragmentation rate of a node, which characterizes the degree of fragmentation risk of the cloud node, based on the resource occupancy information of different cloud nodes at the end of the future time window. The node decision module is used to input the resource remaining rate and future fragmentation rate of different cloud nodes as state space data into the scheduling model, and output the target node using the scheduling model. Specifically, the scheduling model is trained by inputting the state space data from the sample into the scheduling model for feature encoding, predicting the selection probability of different cloud nodes, and outputting the decision node, with the goal of reducing the future fragmentation rate of the cluster. The state space data in the sample includes the resource remaining rate and future fragmentation rate of different cloud nodes in the sample when the unit to be scheduled arrives. The future fragmentation rate of the cluster is obtained based on the future fragmentation rate of the different cloud nodes in the sample. The scheduling trigger module is used to deploy the unit to be scheduled to the target node and trigger the scheduling of the unit again until the scheduling of the units in the list to be scheduled is completed.
[0008] Thirdly, embodiments of this application provide a device for scheduling cloud-native applications, including at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute the method for scheduling cloud-native applications provided in the first aspect.
[0009] Fourthly, embodiments of this application provide a computer storage medium storing a computer program for causing a computer to execute the method for scheduling cloud-native applications as described in any of the first aspects above.
[0010] The method for scheduling cloud-native applications provided in this application obtains the real-time resource availability rate when the scheduled unit arrives. Through the link of "predicting the sequence of future arriving scheduled units → mapping the resource playback of future arriving scheduled units to nodes → evaluating future fragmentation rate", the state space data is determined at the end of the future time window and input into the scheduling model. This allows the policy network of the scheduling model to "see" both the instantaneously available resources and the predictive fragmentation risk, moving the fragmentation risk forward to be measured before scheduling, so that the current scheduling can minimize the future fragmentation rate of the cluster.
[0011] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0012] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 A flowchart illustrating a method for scheduling cloud-native applications provided in this application embodiment; Figure 2 This is a schematic diagram of the scheduling model training process according to an embodiment of this application; Figure 3 This is a schematic diagram illustrating the network structure used during the training of the scheduling model, which is an example of an embodiment of this application, and the processing performed by each part. Figure 4 A schematic diagram of the device structure for scheduling cloud-native applications provided in this application embodiment; Figure 5This is a device structure diagram for scheduling cloud-native applications provided in an embodiment of this application. Detailed Implementation
[0014] To further illustrate the technical solutions provided in the embodiments of this application, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of this application provide method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on conventional or non-inventive effort. For steps that do not logically have a necessary causal relationship, the execution order of these steps is not limited to the execution order provided in the embodiments of this application. In actual processing or when the control device executes the method, it may be executed sequentially or in parallel according to the method shown in the embodiments or drawings.
[0015] Given that related technologies only consider the remaining resources in the "current state" when scheduling cloud-native applications, lacking prediction of future scheduling unit demands, they are prone to creating unrecoverable fragmentation on critical resources. Although subsequent cloud nodes may have total reserves, they cannot be redistributed due to "holes." This application proposes a method, apparatus, and device for scheduling cloud-native applications. To measure the potential resource waste and scheduling congestion risks in the cloud environment within future time windows, it proposes using the Future Fragmentation Index (FFI) as a unified evaluation metric. This metric is used to train a scheduling model, and the trained scheduling model is used to decide the deployment nodes of scheduling units, thereby completing the scheduling of scheduling units.
[0016] like Figure 1 As shown, this application provides a method for scheduling cloud-native applications. This method is applied to cloud servers in a cloud environment, and can be, but is not limited to, Kubernetes (k8s) platform servers. Cloud-native applications are scheduled in units of scheduling. When applied to Kubernetes (k8s) platform servers, Pods are used as the scheduling unit. The method includes: Step 101: When the scheduling of a scheduling unit is triggered, the scheduling unit with the earliest time sequence in the list of units to be scheduled that has not been scheduled is determined as the unit to be scheduled. Based on the current scheduling requirements of cloud-native applications, new scheduling units are continuously generated and placed into the scheduling list in chronological order until the cloud-native application scheduling is completed. The specific technologies used to generate new scheduling units will not be detailed here.
[0017] Step 102: Obtain the resource remaining rate of different cloud nodes, and predict the scheduling units generated in the future time window and the corresponding deployed cloud nodes; The above resource remaining rate represents the instantaneous available resources. In addition to obtaining the instantaneous available resources, the following also needs to be executed: Sequence prediction: Predicting the sequence of scheduling units generated within a future time window; Resource replay: Predict the cloud nodes deployed corresponding to the scheduling units in the scheduling unit sequence, and update the resource usage information of different cloud nodes when the future time window ends.
[0018] Step 103: Based on the resource occupancy information of different cloud nodes at the end of the future time window, obtain the future fragmentation rate of the node, which characterizes the degree of fragmentation risk of the cloud node. The unified evaluation index FFI proposed in this application includes any cloud node. Future node fragmentation rate Through the above sequence prediction and resource replay, it can be determined that .
[0019] Step 104: Input the resource remaining rate and future fragmentation rate of different cloud nodes as state space data into the scheduling model, and use the scheduling model to output the target node; wherein the scheduling model is trained by inputting the state space data in the sample into the scheduling model for feature encoding, predicting the selection probability of different cloud nodes and outputting the decision node, with the goal of reducing the future fragmentation rate of the cluster. The state space data in the sample includes the resource remaining rate and future fragmentation rate of different cloud nodes in the sample when the unit to be scheduled arrives. The future fragmentation rate of the cluster is obtained based on the future fragmentation rate of different cloud nodes in the sample. The state-space data in the sample includes the resource remaining rate and future fragmentation rate of different cloud nodes when the scheduled unit arrives. The resource remaining rate of different cloud nodes is the instantaneous available resource, and the future fragmentation rate of the nodes is determined through the above sequence prediction and resource replay process. Specifically, this involves predicting the scheduling unit generated within the future time window corresponding to the sample and the corresponding deployed cloud nodes. Based on the resource occupancy information of different cloud nodes at the end of the future time window corresponding to the sample, any cloud node of the sample is obtained. Future node fragmentation rate .
[0020] During scheduling model training, the aforementioned unified evaluation metric FFI also includes the cluster future fragmentation rate (CFFI).
[0021] In some possible implementations, the average future fragmentation rate of different cloud nodes in the sample is determined as the cluster future fragmentation rate (CFFI), specifically expressed by the following formula:
[0022] Where N is the set of cloud nodes, The number of cloud nodes. Represents any node in the set N of cloud nodes. .
[0023] The higher the CFFI value, the lower the overall risk of fragmentation of the cloud environment and the higher the resource utilization rate within the future time window.
[0024] During the training of the scheduling model, after the scheduling model outputs a decision node for the current sample, it simulates deploying the unit to be scheduled to the decision node, updating the state space data and CFFI to obtain a new sample, updating the new sample as the current sample, and executing the next training. During the training process, after outputting the decision node, the change in CFFI is used as an immediate reward. Specifically, the CFFI before the simulated scheduling can be used as a reward. before CFFI after simulation scheduling after The difference is used as the reward value representing the improvement in fragmentation rate:
[0025] After obtaining the above reward values, the scheduling model is adjusted using the reward function with the goal of reducing CFFI.
[0026] Step 105: Deploy the unit to be scheduled to the target node and trigger the scheduling of the unit again until the scheduling of the units in the list to be scheduled is completed.
[0027] In this embodiment, when the unit to be scheduled arrives, the instantaneous resource remaining rate is obtained. Through the "sequence prediction → resource replay → FFI evaluation" link, the state space data is determined, so that the policy network of the scheduling model can "see" the instantaneous available resources and the predictive fragmentation risk at the same time. After the scheduling model decides the target node for the unit to be scheduled, the fragmentation risk is moved forward to be measured before scheduling, so that the current scheduling can minimize the future fragmentation rate of the cluster.
[0028] The implementation methods for the above sequence prediction and resource replay are as follows: Sequence Prediction: Based on the current cluster state and the sequence of scheduling units that have completed scheduling, a time series model is used to predict the scheduling units and resource requirements generated within the future time window. Cloud nodes in the cloud environment belong to at least one cluster. The aforementioned cluster state includes the deployment status of scheduling units and resource occupancy of different cloud nodes in the cloud environment. After determining the cluster state and the sequence of scheduling units that have completed scheduling, time series models such as Multidimensional Markov Chain Monte Carlo (MCMC) (or Transformer-TSP based ensemble detection) can be used to generate... The internally generated scheduling unit sequence and resource requirement information, which can be resource requirement information in multiple dimensions; Resource replay: Based on resource demand information, the default scheduling strategy is used to predict the cloud nodes to be deployed for scheduling units generated in the future time window. Specifically, the default scheduling strategy is used to predict the cloud nodes to be deployed for each scheduling unit in the future time window according to the resource demand information of the scheduling unit, and the resource remaining rate of different cloud nodes is obtained at the end of the future time window.
[0029] After performing sequence prediction and resource replay, The determination method is as follows: based on the resource remaining rate of the cloud node at the end of the future time window, different risk factors related to the fragmentation risk level of the cloud node are obtained; the future fragmentation rate of the node is obtained by weighting and summing the different risk factors using their corresponding weights. .
[0030] The above-mentioned different risk factors can be defined from different perspectives of measuring fragmented risk, and different risk factors can include any of the following factors: Cross-node skewness Δ is used to map the deviation between the resource surplus rate of a cloud node and the global average surplus rate; intra-node dispersion H is used to map the dispersion of the resource surplus rate distribution within a cloud node; and absolute waste M is used to map the absolute resource surplus volume of a cloud node at the end of a future time window.
[0031] When different risk factors include the above three factors, the sum is obtained by weighting the different risk factors according to their corresponding weights. The calculation expression is:
[0032] in, For example, It is 0.4. It is 0.3. It is 0.3.
[0033] Cloud-based environments possess multi-dimensional resources, including any number of resources such as CPU resources, MEM resources, GPU cores (GPUc) resources, and GPU memory (GPUm) resources. The set of resource dimensions is represented as follows: In possible implementations, R may include the following dimensions:
[0034] For any node in the cloud node set N and any dimension in the resource dimension set R ,remember: Node capacity: Any number of nodes In any dimension Total resource capacity; : The resource usage of any node i in any dimension r, where: ; : The resource surplus rate of any node i in any dimension r, where: = , .
[0035] The following is an update based on the end of the aforementioned future time window. Thus, the above implementation methods for cross-node skewness Δ, node internal dispersion H, and absolute waste M are obtained.
[0036] 1) Cross-node skewness Δ
[0037] Determine the resource remaining rate of each cloud node in any dimension, and then take the average resource remaining rate of different cloud nodes in that dimension as the global average remaining rate for that dimension. The specific expression is: ; Determine the deviation between the resource surplus rate of a cloud node in this dimension and the global average surplus rate. Based on the deviations across multiple dimensions, obtain the cross-node skewness Δ of the cloud node, specifically expressed as:
[0038] The cross-node skewness Δ obtained using the above method can reflect whether the cross-node is unbalanced.
[0039] 2) Node internal dispersion H
[0040] Determine the resource availability of cloud nodes in any dimension; Based on the resource remaining rate of the cloud node in this dimension, and the sum of the resource remaining rates of the cloud node in multiple dimensions, the resource remaining percentage of the cloud node in this dimension is obtained. For any node... Internal in any dimension The remaining percentage of resources The expression is as follows: = , ’ This is a smoothing option, which can be set as needed; Based on the Shannon entropy of the residual proportions of cloud nodes in multiple dimensions, the internal dispersion H of the node is obtained, and the expression for H is as follows:
[0041] The internal dispersion H of a node obtained using the above method can measure the degree of dispersion of the resource surplus rate distribution within a cloud node.
[0042] 3) Absolute waste M
[0043] Determine the resource surplus rate of the cloud node in any dimension; based on the sum of the resource surplus rates of the cloud node in multiple dimensions, determine the absolute waste M of the cloud node, and the expression for M is as follows:
[0044] The absolute waste amount M obtained using the above method can characterize the absolute resource waste volume of the cloud node at the end of the future time window.
[0045] Based on the three factors obtained in the above manner, the determination of any node is performed. The expression is as follows:
[0046] Weights can be assigned based on the level of attention given to factors, such as increasing... Greater attention is paid to resource waste, while adding α or β focuses on the feasibility of future scheduling.
[0047] The specific training process of the scheduling model in this embodiment is as follows: Figure 2 As shown, it mainly includes: Step 201: When the scheduling of the unit to be scheduled for the sample is triggered, the state space data of the sample and the future fragmentation rate of the cluster determined at the end of the future time window corresponding to the sample are obtained. The state space data of the sample and the method for determining the future fragmentation rate of the cluster are described above and will not be elaborated here.
[0048] During training, the initial sample of the scheduling model consists of the units to be scheduled and their state space data. These can be the scheduling units and their corresponding state space data that arrived at a certain time in the actual cloud environment, or the scheduling units and their corresponding state space data that arrived at a certain time in the simulation based on the virtual cloud environment. After that, new samples are generated after the units to be scheduled are deployed to the decision nodes in the simulation. The new samples are then updated to the current samples for training the scheduling model.
[0049] Step 202: Input the state space data of the sample into the feature encoding of the scheduling model, predict the selection probability of different cloud nodes and output the decision node; The scheduling model includes a feature extraction layer and a policy network. The policy network includes a reinforcement learning action RLActor network. The feature extraction layer of the scheduling model encodes features of the state space data, the RLActor network predicts the selection probability of different cloud nodes, and the decision node is selected and output based on the prediction results.
[0050] Step 203: Simulate the deployment of the sample's scheduled units to the decision node, update the sample's state space data and the cluster's future fragmentation rate, obtain the reward value of the reward function based on the change in the cluster's future fragmentation rate, and adjust the scheduling model based on the reward function. During model training, the deployment of scheduled units is not actually executed. Instead, the deployment of scheduled units is carried out through simulated scheduling. After scheduling, the cluster state and the historical scheduling unit sequence are also updated. The cluster state includes the deployment status and resource usage of scheduling units of different cloud nodes in the cloud environment. After scheduling, the next scheduling unit in the future time window corresponding to the sample is taken as the scheduled unit. Therefore, after simulated scheduling, the newly arrived scheduled units can be determined and the corresponding state space data and CFFI can be updated. After the update, the scheduling of the newly arrived scheduled units is triggered, thereby generating new samples for scheduling model training. When a sample is obtained, the future time window after the scheduling time of the scheduled unit of the sample is determined as the future time window corresponding to the sample.
[0051] Step 204: After adjustment, the next scheduling unit in the future time window corresponding to the sample is taken as the scheduling unit to be scheduled and scheduling is triggered until the model training end condition is met.
[0052] The training termination condition for the above model can be the convergence of the policy network reward. Based on the reward function, the loss function can be further determined, and the convergence of the policy network reward can be determined based on the loss function. By iterating through the loop until the policy network reward converges, a scheduling model that can dynamically minimize the Free Fission Index (FFI) is obtained. The cloud integration service uses this scheduling model to schedule cloud-native applications.
[0053] In some possible embodiments, the policy network of the above scheduling model further includes a Weight-Self-Tuning (WST) layer. The WST layer is used to output risk factor weights online. The method for outputting risk factor weights online using the WST layer is as follows: based on a global feature vector, it outputs the weights corresponding to different risk factors, where the global feature vector is a vector obtained by encoding and aggregating the features of the input state space data. During the training and application of the scheduling model, the future fragmentation rate of nodes is determined. Previously, it also included obtaining the weights corresponding to different risk factors output by the WST layer based on the global feature vector when acquiring the above scheduling, and then using the obtained weights corresponding to different risk factors to perform a weighted summation of different risk factors to obtain... During the training of the scheduling model, the reward function also includes a weight penalty term determined by the risk factor weights output online by the WST layer. When adjusting the parameters of the scheduling model, the penalty value of the reference weight penalty term is further considered to adjust the model parameters, so that the node risk factor weights can be automatically adjusted with the running state without manual reconfiguration.
[0054] During the training of the scheduling model, the weights corresponding to different risk factors in the current and previous outputs are regularized using the WST layer. The KL divergence value obtained after regularization is determined as the weight penalty term and the regularization term of the loss function. The reward function participates in the calculation of the loss function according to the corresponding rules. In the calculation expression of the loss function in this embodiment, in addition to the calculation term in which the reward function participates, a regularization term is further included.
[0055] The WST layer above outputs the weights corresponding to the different risk factors in the following manner: The variances corresponding to different risk factors within the most recent time period are calculated, and the sum of these variances is smoothed and mapped to temperature using a smoothing function. The duration of the most recent time period can be the duration of a future time window. In practice, for the above three factors, the cross-node skewness corresponding to all cloud nodes within the most recent time period is calculated. Node internal dispersion and absolute waste variance The larger the variance value, the higher the risk activity of the risk factor in the cluster. Then, the sum of the three variances is smoothed by a smoothing function and mapped to temperature according to the following expression. :
[0056] in, The expression yields ; Based on global feature vectors Output a multidimensional vector corresponding to different risk factors. This multidimensional vector is the unnormalized prediction score vector logits, represented as a vector. ; after obtaining the global feature vector Then, the output vector is generated using the following expression. : ,in , Adjustment parameters belonging to the WST layer; Using activation functions based on multidimensional vectors and temperature The weights corresponding to different risk factors are obtained and output. The activation function mentioned above is based on temperature. right After processing and normalization, the specific expressions for the weights corresponding to the above three factors are as follows:
[0057] When the variance of a certain risk factor increases, Get smaller The sharper the risk factor, the greater its corresponding weight will be; conversely, it will tend to be more balanced.
[0058] After using the WST layer to output the weights at the current time t online, the weights corresponding to different risk factors in the current and previous outputs are regularized. The KL divergence value obtained after regularization is determined as the weight penalty term. The specific expressions for the weights corresponding to the above three factors are as follows:
[0059] in These are adjustment parameters belonging to the scheduling model.
[0060] To prevent drastic weight fluctuations, the aforementioned KL divergence value is further used as a regularization term in the loss function. For example, if within two hours... Then improve By suppressing jumps, the KL divergence value serves as a parameter that simultaneously guides the scheduling strategy and weight adjustment. It propagates end-to-end back through the same computation graph, enabling dynamic weight adjustment, such as when the risk of GPU memory fragmentation increases. It will automatically increase; when resource skew between nodes becomes a bottleneck. It will automatically increase in size.
[0061] Based on the reward function determined using the above-described implementation method, and considering the differences in network latency, bandwidth, and management strategies across public clouds and edge nodes in related technologies, simple "minimum remaining" or "as balanced as possible" strategies are insufficient to simultaneously minimize global fragmentation and balance performance overhead. Therefore, further improvements can be made by incorporating the network topology latency of cloud nodes into the state space data during scheduling model training and application, and by using the cluster's network topology latency increment as a network latency penalty value in the reward function during scheduling model training. Specifically, during scheduling model training, when a sample unit arrives, the network topology latency of different cloud nodes and the cluster's network topology latency are determined, and these latency values are input into the scheduling model as state space data. After simulating the deployment of the sample unit to the decision node, the cluster's network topology latency is updated. Based on the change in the cluster's network topology latency, the network topology latency increment is determined as the network latency penalty value. Specifically, the network topology latency increment is determined based on the difference between the cluster's network topology latency after scheduling and before scheduling. The cluster's network topology latency is determined based on the network topology latency of different cloud nodes; however, it can be, but is not limited to, averaging the network topology latency of all cloud nodes to obtain the cluster's network topology latency.
[0062] After introducing network topology delay, the state space data of the scheduling model training and application in this embodiment of the application are as follows: Any cloud node The state-space data at a certain scheduling time t is represented as follows: Specifically, it refers to the vector obtained by concatenating the normalized dimensions of the three types of original data shown in the table below:
[0063] After obtaining the vector of a single cloud node, the vectors of all cloud nodes of the same dimension are concatenated to obtain the input vector, which is then input into the scheduling model for model training.
[0064] The state space design described above enables the policy network to simultaneously focus on the current resource fill rate and the risk of future fragmentation, laying the information foundation for the subsequent self-consistent weight learning of the WST layer, thereby obtaining a scheduling model that can dynamically minimize the future fragmentation rate while taking into account business latency.
[0065] Furthermore, a migration penalty value can be introduced into the reward function. This simulates deploying the sample's scheduled unit to the decision node and determining whether a cross-cloud migration occurs based on whether the sample's scheduled unit is a re-deployed scheduled unit and the location of the decision node. The migration penalty value is then calculated based on this determination. Specifically, if the sample's scheduled unit is not a re-deployed scheduled unit, cross-cloud migration is determined, and the migration penalty value is 0. If the sample's scheduled unit is a re-deployed scheduled unit, the location of the pre-deployed cloud node and the target node determines whether a cross-cloud migration occurs. If a cross-cloud migration occurs, the migration penalty value is 1; otherwise, it is 0.
[0066] In some possible embodiments, a weighted self-adjusting WST mechanism is introduced based on the "future fragmentation rate decrease" reward, so that... The three-factor weights [α, β, The reward function for scheduling time t is obtained by automatically adjusting according to the running state and combining network topology delay and migration penalty value. :
[0067] The first term represents the fragmentation rate improvement; the second term represents the network latency penalty, used to suppress the dispatch of low-latency scheduling units to remote nodes; the third term represents the cross-cloud migration penalty, used to suppress cross-cloud migration; the fourth term, the KL divergence value, is a weight penalty, representing the weight stability penalty. The more severe the weight jumps, the larger the corresponding weight stability penalty, thereby limiting the fluctuation of the WST layer in adjacent hours and maintaining policy stability. , , The set coefficient.
[0068] In the training and application of the scheduling model in this embodiment, the RLActor network executes deployment node decisions based on the action space. The deployment nodes include the aforementioned target nodes and decision nodes. One possible scenario is using cloud nodes in the cloud environment as the action space. Another possible scenario is that, to ensure the scheduling model's policy network has sufficient exploration space while also eliminating inevitably failing options in real time, the action space is further optimized through candidate cloud node filtering. Specifically, the action of executing deployment node decisions using the RLActor network is divided into two stages: cloud node candidate set filtering → probabilistic decision-making, effectively combining Kubernetes native constraints with FFI-driven intelligent sorting, wherein: First step: Cloud node candidate set filtering Before predicting the selection probability, cloud nodes that meet the preset hard filtering conditions are selected to obtain a candidate set of cloud nodes. The hard filtering conditions are denoted as Hard Filter, and meeting the hard filtering conditions is denoted as Pass Hard Filter. When a scheduling unit arrives, before predicting the selection probability of a cloud node, the RLActor network first searches for cloud nodes that pass the Hard Filter based on the Hard Filter to obtain the candidate set of cloud nodes C(t). Taking the scheduling unit as a Pod as an example, the specific expression is as follows: This indicates the Pod that arrives at scheduling time t.
[0069] The above-mentioned hard filter conditions include at least one of the following: Sufficient resources; affinity / anti-affinity capabilities meet requirements; GPU driver and resource requirement information match driver requirements; security domains meet requirements; network latency thresholds meet requirements.
[0070] If C(t) = If so, the rollback process will begin.
[0071] Second stage of the process: Probabilistic decision-making
[0072] Using the candidate set of cloud nodes as the optimized action space, the selection probability of cloud nodes in the candidate set is predicted, and the node deployment decision is made based on the selection probability, with the output as the result. For the candidate set of cloud nodes C(t), the RLActor network outputs the decision for any node in the action space S(t). Selection probability: ,in , This represents the probability of performing an action under the current model parameter adjustment state, and: =1.
[0073] In this embodiment, during the training of the scheduling model, based on the action space determined by any of the above methods, the RLActor network of the scheduling model is used to execute action a based on the action space. t The exploration and state utilization are balanced using a random selection factor ε-harmonic method, including: Predict the selection probability of different cloud nodes in the action space; based on the random selection factor ε, determine whether to use the random selection method according to the corresponding probability. The random selection factor ε is an adjustment parameter of the adjustment model; if the random selection method is determined to be used, randomly select a cloud node as the target node; otherwise, determine the cloud node with the highest selection probability as the target node. The specific expression is as follows:
[0074] The ε(t) value gradually decreases during the training process by cosine annealing, for example, from 0.15 to 0.02.
[0075] In some possible embodiments, to accelerate convergence, the RLActor network utilizes [a certain method / mechanism] before performing actions. The selection probability of the prediction is optimized by weighting. The specific process is as follows: predict the selection probability of different cloud nodes; weight and normalize the selection probability of cloud nodes using a bias factor to obtain the soft bias selection probability. The bias factor is the index corresponding to the future fragmentation rate of the cloud node, where the larger the future fragmentation rate of the node, the smaller the index; select and output the target node according to the soft bias selection probability of different cloud nodes.
[0076] The above bias factor is an exponential. Then any cloud node The selection probability of soft bias The expression is as follows:
[0077] κ∈[0,5] is the temperature coefficient. When the exponent corresponding to the future fragment of node A is higher than that of B, the selection probability of A is weakened by the exponent, so that the policy network tries more cloud nodes with low FFI, but still retains the opportunity to explore.
[0078] The RLActor network performs the action a of selecting and outputting the target node according to the above method, based on the selection probability of different cloud node soft biases. t Action a t Once the Kubernetes scheduling framework is entered, the process of updating state space data and evaluating reward functions begins.
[0079] During training, the aforementioned scheduling model employs an Actor-Critic model that includes an action head and an evaluation head. The action head is used to predict the selection probability of different cloud nodes and decide on the actions to deploy nodes. The specific process of executing actions using the RLActor network is described in the implementation method above. Additionally, the evaluation head utilizes global feature vectors... , evaluate action a t Post-execution state value And based on the change in state value before and after the action is executed ( Determine the advantage estimate ; Adjusting the scheduling model based on the reward function includes: adjusting the scheduling model based on the reward function. and advantage estimate Determine the loss function and use it to adjust the scheduling model.
[0080] The scheduling model provided in this application, in terms of its network structure and the processing performed by each part, mainly includes a feature encoding layer, a global aggregation layer, a WST layer, and a dual-head (Actor Head + Critic Head) output. The feature encoding layer includes an embedding layer and a two-level attention network GAT layer. The global aggregation layer includes an average pooling layer, a max pooling layer, and a convergence layer. The convergence layer includes a concat function, a fully connected function, and an activation function. The node-level feature vectors are encoded by the feature encoding layer. The global aggregation layer aggregates the node-level feature vectors to obtain a global feature vector. The WST layer outputs weights based on the global feature vectors according to the above implementation method, and determines the weight penalty term and regularization term. The Actor Head performs actions in the action space based on the node-level feature vectors according to the above implementation method. The Critic Head evaluates the state value after the action is performed based on the global feature vectors, and determines the advantage estimate based on the change in state value. Thus, after performing an action, the loss function is determined using the reward function, the regularization term, and the advantage estimate. The scheduling model is adjusted using the loss function, and the next iteration is executed.
[0081] The following provides an example of the network structure used during training of the scheduling model and the processing of each part, such as... Figure 3 As shown, it specifically includes: 1) Input layer: A 6-dimensional input vector is obtained from the original data of the state space data, and the 6-dimensional input vector is input into the feature encoding layer; 2) Embedding layer: includes FC6+ ReLU+LayerNorm. The 6-dimensional input vector is processed into 48-dimensional data by a 6-head fully connected FC function. This 48-dimensional data is then processed by the activation function ReLU and the normalization function LayerNorm and encoded into 48-dimensional feature data. The 48-dimensional feature data is then input into the first-level GAT layer. 3) First-level GAT layer: It is a 4-head 48 network structure, that is, the size of the weight matrix is 48. 4. The weight matrix is used to map the input 48-dimensional feature data into 64-dimensional feature data. The 64-dimensional feature data output from the first-level GAT layer is input into the second-level GAT layer. 4) Second-level GAT layer: It is a 4-head 48 network structure, that is, the size of the weight matrix is 48. 4. Using this weight matrix, the 64-dimensional feature data is mapped to 64-dimensional feature data and then embedded into nodes. After node embedding, a 64-dimensional node-level feature vector is obtained. 5) Average pooling layer + max pooling layer: The average pooling layer is used to perform average pooling on the node-level feature vectors, and the max pooling layer is used to perform max pooling on the node-level feature vectors. 7) Concat function + FC128 + ReLU activation function: Feature data processed by average pooling and max pooling are input to the Concat function of the pooling layer for aggregation. After aggregation, the FC function with 128 heads outputs 128-dimensional feature data. This 128-dimensional feature data is then processed by the ReLU activation function to obtain a 128-dimensional global feature vector. ; 8) WST layer (including Softplus + Softmax functions): converts the global feature vector The input is fed into the WST layer, which then outputs the risk factor weights α, β, and α according to the above implementation method. And determine the weight penalty term and the regularization term of the loss function; 9) Actor Head (including Softmax for predicting selection probabilities + FFI Bias for soft bias of selection probabilities): Based on node-level feature vectors, it performs actions in the action space according to the above implementation method; 10) Critic Head: Based on global feature vectors Evaluate the state value after the action is performed. And according to the change in state value ( Determine the advantage estimate .
[0082] The Critic Head consists of two fully connected full-function (FC) connections, one of which is based on... The executed actions result in a 128-dimensional vector, which the next fully connected (FC) process into a 1-dimensional state value. And based on the change in state value before and after the action is executed ( Determine the advantage estimate .
[0083] The state value after the above assessment actions are performed The state value function in related technologies can be used to determine the value based on changes in state value. and reward function The advantage estimate is determined using the advantage estimation function of relevant technologies. This will not be elaborated upon here.
[0084] Based on the above predicted selection probability and the obtained reward function Dominance estimate With the regularization term, the loss function expression is determined as follows: ; The above To set coefficients, The discount factor is used. The Actor Head, Critic Head and WST layer share an integrated computation graph. Gradients are synchronously backpropagated and iterated until the policy benefit converges (the loss function L is less than a certain value), thus obtaining a scheduling model that can dynamically minimize future fragmentation rate, take into account business latency and suppress migration.
[0085] The method for scheduling cloud-native applications provided in this application has the following beneficial effects: 1) By adopting the "sequence prediction → resource replay → FFI evaluation" link, the fragmentation risk is measured before scheduling, which significantly reduces the future fragmentation rate and avoids resource waste; 2) Through the WST layer and bias (FFI-SoftBias) The policy network prioritizes filling nodes with low future fragmentation rates and actively suppresses holes in GPU memory and cores, improving the utilization of GPU, CPU, and memory, significantly reducing resource idleness caused by "fragmentation lock-up", thereby improving the utilization of GPU and general resources. 3) The two-layer graph attention encoder, combined with topological edge weights, enables the policy network to simultaneously perceive node proximity and cross-domain bandwidth overhead; the weights output by the WST layer are automatically tilted according to real-time activity, which can adjust scheduling preferences in real time in scenarios such as GPU congestion, network bottlenecks, or cross-cloud migration, reducing the proportion of cross-cloud migration and achieving cross-cloud / edge adaptive scheduling. 4) The entire process is end-to-end fine-tunable. Through the dynamic weight self-consistent algorithm of the WST layer in this application, there is no need for manual parameter tuning, thus enabling autonomous evolution and low operation and maintenance costs. 5) The three risk factors and their weights have clear physical meanings and can be directly used for operation and maintenance visualization. If new resource dimensions (such as network card bandwidth and FPGA (Field-Programmable Gate Array)) are subsequently managed, the overall architecture can be reused simply by expanding the corresponding dimensions in the evaluation module. Therefore, it is interpretable and easy to expand.
[0086] Based on the above data and characteristics, the embodiments of this application achieve "maximum resource utilization, minimum future fragmentation, and zero service performance rollback" in a multi-cloud-edge hybrid environment, and have significant engineering application value and market promotion potential.
[0087] Based on the same inventive concept, embodiments of this application also provide a device for scheduling cloud-native applications, such as... Figure 4 As shown, it includes: The scheduling unit determination module 401 is used to determine the scheduling unit with the earliest time sequence and which has not been scheduled in the scheduling list as the scheduling unit when the scheduling of the scheduling unit is triggered. The scheduling prediction module 402 is used to obtain the resource remaining rate of different cloud nodes and predict the scheduling units generated in the future time window and the corresponding deployed cloud nodes. The fragmentation rate prediction module 403 is used to obtain the future fragmentation rate of a node, which characterizes the degree of fragmentation risk of the cloud node, based on the resource occupancy information of different cloud nodes at the end of the future time window. The node decision module 404 is used to input the resource remaining rate and future fragmentation rate of different cloud nodes as state space data into the scheduling model, and output the target node using the scheduling model. Specifically, the scheduling model is trained by inputting the state space data from the sample into the scheduling model for feature encoding, predicting the selection probability of different cloud nodes, and outputting the decision node, with the goal of reducing the future fragmentation rate of the cluster. The state space data in the sample includes the resource remaining rate and future fragmentation rate of different cloud nodes in the sample when the unit to be scheduled arrives. The future fragmentation rate of the cluster is obtained based on the future fragmentation rate of the different cloud nodes in the sample. The scheduling trigger module 405 is used to deploy the unit to be scheduled to the target node and trigger the scheduling of the unit again until the scheduling of the units in the list to be scheduled is completed.
[0088] The implementation methods of the above-described device for scheduling cloud-native applications are the same as those of the corresponding methods described above, and will not be detailed here.
[0089] Having introduced the method and apparatus for scheduling cloud-native applications according to exemplary embodiments of this application, we will now introduce an apparatus for scheduling cloud-native applications according to another exemplary embodiment of this application.
[0090] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."
[0091] In some possible implementations, the device for scheduling cloud-native applications according to this application may include at least one processor and at least one memory. The memory stores program code that, when executed by the processor, causes the processor to perform the steps of the method for scheduling cloud-native applications described above.
[0092] The following reference Figure 5 This describes a device 150 for scheduling cloud-native applications according to this embodiment of the application. Figure 5 The device 150 shown, which schedules cloud-native applications, is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0093] like Figure 5 As shown, the device 150 for scheduling cloud-native applications is represented in the form of a general-purpose electronic device. The components of the device 150 for scheduling cloud-native applications may include, but are not limited to: at least one processor 151, at least one memory 152, and a bus 153 connecting different system components (including memory 152 and processor 151).
[0094] Bus 153 represents one or more of several bus structures, including a memory bus or memory controller, peripheral bus, processor, or local bus using any of the various bus structures.
[0095] The memory 152 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 1521 and / or cache memory 1522, and may further include read-only memory (ROM) 1523.
[0096] The memory 152 may also include a program / utility 1525 having a set (at least one) of program modules 1524, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0097] The device 150 that schedules cloud-native applications can also communicate with one or more external devices 154 (e.g., keyboards, pointing devices, etc.), one or more devices that enable users to interact with the device 150, and / or any device that enables the device 150 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). This communication can be performed via input / output (I / O) interface 155. Furthermore, the device 150 that schedules cloud-native applications can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapter 156. Figure 5As shown, network adapter 156 communicates with other modules of device 150 used for scheduling cloud-native applications via bus 153. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with device 150 for scheduling cloud-native applications, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0098] In some possible implementations, various aspects of the method for scheduling cloud-native applications provided in this application can also be implemented as a program product, which includes program code that, when the program product is run on a computer device, causes the computer device to perform the steps of the method for scheduling cloud-native applications according to the various exemplary embodiments of this application described above.
[0099] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0100] The program product for scheduling cloud-native applications according to embodiments of this application can be a portable compact disk read-only memory (CD-ROM) and include program code, and can run on an electronic device. However, the program product of this application is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0101] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0102] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0103] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's electronic device, partially on the user's device, as a standalone software package, partially on the user's electronic device and partially on a remote electronic device, or entirely on a remote electronic device or server. In cases involving remote electronic devices, the remote electronic device can be connected to the user's electronic device via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external electronic device (e.g., via the Internet using an Internet service provider).
[0104] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.
[0105] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0106] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0107] This application is described with reference to flowchart illustrations and block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block and / or segment of the flowchart illustrations and block diagrams, as well as combinations of blocks and segments in the flowchart illustrations and block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to generate a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0108] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium generate an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and boxes Figure 1 The function specified in one or more boxes.
[0109] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and boxes Figure 1 The steps of the function specified in one or more boxes.
[0110] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0111] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for scheduling cloud-native applications, wherein the cloud-native applications are scheduled in units of scheduling units, characterized in that, The method includes: When a scheduling unit is triggered, the scheduling unit with the earliest time sequence in the list of units to be scheduled that has not yet been scheduled is identified as the unit to be scheduled. Obtain the resource remaining rate of different cloud nodes, and predict the scheduling units generated in the future time window and the corresponding deployed cloud nodes; Based on the resource occupancy information of different cloud nodes at the end of the future time window, the future fragmentation rate of the nodes, which characterizes the degree of fragmentation risk of the cloud nodes, is obtained. The resource remaining rate and future fragmentation rate of different cloud nodes are used as state space data and input into the scheduling model. The scheduling model outputs the target node. The scheduling model is trained by inputting the state space data in the sample into the scheduling model for feature encoding, predicting the selection probability of different cloud nodes and outputting the decision node, with the goal of reducing the future fragmentation rate of the cluster. The state space data in the sample includes the resource remaining rate and future fragmentation rate of different cloud nodes in the sample when the unit to be scheduled arrives. The future fragmentation rate of the cluster is obtained based on the future fragmentation rate of the different cloud nodes in the sample. The unit to be scheduled is deployed to the target node, and the scheduling of the scheduling unit is triggered again until the scheduling of the scheduling units in the list to be scheduled is completed.
2. The method according to claim 1, characterized in that, The state space data also includes the network topology delays of the different cloud nodes.
3. The method according to claim 1, characterized in that, The step of obtaining the future fragmentation rate of a node based on the resource occupancy information of different cloud nodes at the end of the future time window includes: Based on the resource remaining rate of the cloud node at the end of the future time window, different risk factors related to the fragmentation risk level of the cloud node are obtained. The future fragmentation rate of a node is obtained by summing the different risk factors using their corresponding weights.
4. The method according to claim 3, characterized in that, The scheduling model includes a weighted self-consistent learning mechanism (WST) layer, and the method further includes: When obtaining the above schedule, the WST layer outputs the weights corresponding to the different risk factors based on the global feature vector, wherein the global feature vector is a vector obtained by encoding and aggregating the features of the input state space data.
5. The method according to any one of claims 3 to 4, characterized in that, The different risk factors include any of the following: Cross-node skewness is used to map the deviation between the resource remaining rate of cloud nodes and the global average remaining rate. Intra-node discreteness is used to map the degree of discreteness of the distribution of resource surplus rate within cloud nodes; Used to map the absolute amount of wasted resources remaining in a cloud node at the end of a future time window.
6. The method according to claim 5, characterized in that, The resource is a multi-dimensional resource, and the cross-node skewness is determined using the following method: Determine the resource availability of cloud nodes in any dimension; The average resource remaining rate of different cloud nodes in this dimension is determined as the global average remaining rate of this dimension. Determine the deviation between the resource remaining rate of the cloud node in this dimension and the global average remaining rate, and obtain the cross-node skewness of the cloud node based on the deviations in multiple dimensions.
7. The method according to claim 5, characterized in that, The resource is a multi-dimensional resource, and the internal dispersion of the node is determined using the following method: Determine the resource availability of cloud nodes in any dimension; Based on the resource remaining rate of the cloud node in this dimension, and the sum of the resource remaining rates of the cloud node in multiple dimensions, the remaining percentage of the cloud node in this dimension is obtained. The internal dispersion of a node is obtained by using the Shannon entropy of the remaining proportion of the cloud node in the multiple dimensions.
8. The method according to claim 5, characterized in that, The resource is a multi-dimensional resource, and the absolute waste amount is determined using the following method: Determine the resource availability of cloud nodes in any dimension; The absolute waste of the cloud node is determined based on the sum of the resource surplus rates of the cloud node in multiple dimensions.
9. The method according to any one of claims 1 to 4, characterized in that, The step of using the scheduling model to output the target node includes: The scheduling model is used to encode the features of the state space data to obtain node-level feature vectors; Select cloud nodes that meet the preset hard filtering conditions to obtain a candidate set of cloud nodes; Based on the node-level feature vector, the selection probability of cloud nodes in the cloud node candidate set is predicted, and the target node is selected and output according to the selection probability.
10. The method according to any one of claims 1 to 4, characterized in that, The step of using the scheduling model to output the target node includes: The scheduling model is used to encode the features of the state space data to obtain node-level feature vectors; Based on the node-level feature vectors, predict the selection probability of the different cloud nodes; The selection probability of the cloud node is weighted and normalized using a bias factor to obtain a soft-biased selection probability. The bias factor is an index corresponding to the future fragmentation rate of the cloud node, wherein the larger the future fragmentation rate of the node, the smaller the corresponding index. Based on the selection probability of different cloud node soft biases, the target node is selected and output.
11. The method according to any one of claims 1 to 4, characterized in that, The scheduling units generated within the predicted future time window and the corresponding deployed cloud nodes include: Based on the current cluster status and the sequence of scheduling units that have completed scheduling, the scheduling units and resource requirements generated in the future time window are predicted using a time series model. Based on the resource demand information, the default scheduling strategy is used to predict the cloud nodes to be deployed corresponding to the scheduling units generated within the future time window.
12. The method according to any one of claims 1 to 4, characterized in that, The process of inputting state-space data from the samples into the scheduling model for feature encoding, predicting the selection probability of different cloud nodes, and outputting the decision node, with the goal of reducing future cluster fragmentation, to train the scheduling model includes: When the scheduling of a sample's scheduled unit is triggered, the state space data of the sample and the future fragmentation rate of the cluster determined at the end of the future time window corresponding to the sample are obtained. After inputting the state space data of the sample into the feature encoding of the scheduling model, the selection probability of different cloud nodes is predicted and the decision node is output. The simulation deploys the scheduled units of the sample to the decision node, updates the state space data of the sample and the future fragmentation rate of the cluster, obtains the reward value of the reward function based on the change of the future fragmentation rate of the cluster, and adjusts the scheduling model according to the reward function. After adjustment, the next scheduling unit within the future time window corresponding to the sample is taken as the scheduling unit to be scheduled and scheduling is triggered until the model training end condition is met.
13. The method according to claim 12, characterized in that, When the scheduling model includes a weighted self-consistent learning mechanism (WST) layer, the reward function further includes a weighted penalty term, and the method further includes: Based on the global feature vector obtained by encoding and aggregating the state space data features of the samples, the weights corresponding to different risk factors are output. The weights corresponding to the different risk factors in the current and previous outputs are regularized, and the KL divergence value obtained after regularization is determined as the weight penalty term and the regularization term of the loss function.
14. The method according to claim 12, characterized in that, The scheduling model is an Actor-Critic model that includes an action head and an evaluation head. The action head is used to predict the selection probability of different cloud nodes and output the action of the decision node. The method also includes: The evaluation head is used to evaluate the state value after an action is performed based on the global feature vector obtained by encoding and aggregating the state space data features of the sample, and the advantage estimate is determined based on the change in state value before and after the action is performed. The step of adjusting the scheduling model according to the reward function includes: The loss function is determined based on the reward function and the advantage estimate, and the scheduling model is adjusted using the loss function.
15. The method according to claim 12, characterized in that, The reward function further includes at least one of a network latency penalty value and a migration penalty value, and the method further includes at least one of the following steps: After the simulation deploys the scheduled units of the sample to the decision node, it updates the network topology latency of the cluster. The network topology latency of the cluster is determined according to the network topology latency of different cloud nodes. Based on the change in the network topology latency of the cluster, the network topology latency increment is determined as the network latency penalty value. After simulating the deployment of the sample's scheduled unit to the decision node, the system determines whether it is a cross-cloud migration based on whether the sample's scheduled unit is a re-deployed scheduled unit and the location of the decision node. Based on the determination result of whether it is a cross-cloud migration, a migration penalty value is obtained.
16. The method according to claim 12, characterized in that, The process of predicting the selection probability of different cloud nodes and outputting the decision node includes: Predict the selection probability of the different cloud nodes; Based on the random selection factor, it is determined whether to use the random selection method according to the corresponding probability. The random selection factor is an adjustment parameter during the training of the adjustment model. When it is determined that a random selection method is to be used, a cloud node is randomly selected as the target node; otherwise, the cloud node with the highest selection probability is determined as the target node.
17. An apparatus for scheduling cloud-native applications, wherein the cloud-native applications are scheduled in units of scheduling units, characterized in that, include: The module for determining the scheduling unit is used to determine the scheduling unit with the earliest time sequence and no scheduling in the scheduling list as the scheduling unit when the scheduling of the scheduling unit is triggered. The scheduling prediction module is used to obtain the resource remaining rate of different cloud nodes and predict the scheduling units generated in the future time window and the corresponding deployed cloud nodes. The fragmentation rate prediction module is used to obtain the future fragmentation rate of a node, which characterizes the degree of fragmentation risk of the cloud node, based on the resource occupancy information of different cloud nodes at the end of the future time window. The node decision module is used to input the resource remaining rate and future fragmentation rate of different cloud nodes as state space data into the scheduling model, and output the target node using the scheduling model. Specifically, the scheduling model is trained by inputting the state space data from the sample into the scheduling model for feature encoding, predicting the selection probability of different cloud nodes, and outputting the decision node, with the goal of reducing the future fragmentation rate of the cluster. The state space data in the sample includes the resource remaining rate and future fragmentation rate of different cloud nodes in the sample when the unit to be scheduled arrives. The future fragmentation rate of the cluster is obtained based on the future fragmentation rate of the different cloud nodes in the sample. The scheduling trigger module is used to deploy the unit to be scheduled to the target node and trigger the scheduling of the unit again until the scheduling of the units in the list to be scheduled is completed.