Capacity adjustment method and device supporting cross-cluster, equipment and medium
By constructing a cross-cluster load prediction model and capacity adjustment strategy, the problems of response lag and uneven resource allocation in traditional methods are solved, achieving more efficient cluster capacity adjustment and resource utilization.
Patent Information
- Application Number
- CN202511064148.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-11-04
AI Technical Summary
Traditional cluster capacity adjustment methods cannot predict load changes in advance, have delayed response, and fixed preset thresholds are difficult to adapt to complex and ever-changing business scenarios. Furthermore, independent cluster adjustments lead to uneven resource allocation.
By acquiring historical load data from multiple clusters, a load prediction model is constructed through joint modeling to predict future load data. Based on a global perspective, a capacity adjustment strategy is determined to achieve collaborative capacity adjustment for single or cross-cluster clusters.
Significantly reduces response latency, adapts to complex and ever-changing business scenarios, improves resource utilization and load balancing, and enhances the response speed and adaptability of cluster capacity adjustments to business scenarios.
Smart Images

Figure CN120896853A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of computer technology, and particularly relate to a cross-cluster capacity adjustment method, device, equipment and medium. BACKGROUND
[0002] Kubernetes (also known as K8s) can be understood as a container orchestration and management platform, which is widely used in micro-service deployment and management in a multi-cluster environment. In the kubernetes environment, as the dynamic change of business load, capacity adjustment such as expansion or contraction of the cluster needs to be performed to ensure the cluster performance and resource utilization.
[0003] The traditional cluster capacity adjustment method can monitor the indicators related to capacity adjustment in real time, and trigger capacity adjustment when the indicators exceed the preset threshold. This scheme may have the following problems: relying on real-time monitoring indicators, unable to predict load changes in advance, resulting in delayed response; fixed preset threshold is difficult to adapt to complex and variable business scenarios; each cluster makes independent expansion and contraction decisions, which easily causes uneven resource allocation. SUMMARY
[0004] The present application provides a cross-cluster capacity adjustment method, device, equipment and medium, which can improve the response speed, business scenario adaptability and resource utilization of cluster capacity adjustment.
[0005] In a first aspect, the embodiments of the present application provide a cross-cluster capacity adjustment method, comprising:
[0006] Obtaining historical load data of a plurality of clusters, the historical load data comprising historical node load data and historical container group unit load data;
[0007] Joint modeling based on each of the historical load data to obtain a load prediction model, deploying the load prediction model to each cluster, so that each cluster uses the load prediction model in combination with the current load data of each cluster to predict future load data, and reports the future load data;
[0008] Determining a capacity adjustment strategy according to each of the future load data, the capacity adjustment strategy comprising a single-cluster capacity adjustment strategy and a cross-cluster collaborative capacity adjustment strategy;
[0009] Transmitting a capacity adjustment instruction corresponding to the capacity adjustment strategy to a to-be-adjusted cluster in each cluster, so that the to-be-adjusted cluster performs capacity adjustment based on the capacity adjustment instruction.
[0010] In a second aspect, the embodiments of the present application provide a cross-cluster capacity adjustment device, comprising:
[0011] The acquisition module is configured to acquire historical load data of multiple clusters, wherein the historical load data comprises historical node load data and historical container group unit load data.
[0012] The prediction module is configured to perform joint modeling based on the historical load data to obtain a load prediction model, deploy the load prediction model to each cluster, and enable each cluster to predict future load data by combining the load prediction model and current load data of each cluster, and report the future load data.
[0013] The determination module is configured to determine a capacity adjustment strategy according to the future load data, wherein the capacity adjustment strategy comprises a single-cluster capacity adjustment strategy and a cross-cluster collaborative capacity adjustment strategy.
[0014] The adjustment module is configured to transmit a capacity adjustment instruction corresponding to the capacity adjustment strategy to a to-be-adjusted cluster in each cluster, so that the to-be-adjusted cluster performs capacity adjustment based on the capacity adjustment instruction.
[0015] In a third aspect, an electronic device is provided, comprising:
[0016] at least one processor; and
[0017] a memory in communication with the at least one processor; and
[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the method of the first aspect.
[0019] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program executable by a processor, and the program is executed by the processor to implement the method of the first aspect.
[0020] The technical solution of the embodiments of the present application collects historical load data and current load data of multiple clusters, performs global modeling to obtain a load prediction model, and predicts future load data of each cluster, which can predict load changes in advance, significantly reduce response delay, and adapt to complex and variable business scenarios. By collecting future load data of multiple clusters, determining a capacity adjustment strategy based on a global perspective, and issuing a capacity adjustment instruction to a corresponding to-be-adjusted cluster, single-cluster capacity adjustment or cross-cluster collaborative capacity adjustment is realized, which can comprehensively evaluate the resource distribution of multiple clusters and realize resource sharing and load balancing of multiple clusters. This solution integrates data collection, load prediction, collaborative decision-making, and automatic execution, coordinates capacity adjustment of multiple clusters, and can improve the response speed, business scenario adaptability, and resource utilization rate of cluster capacity adjustment.
[0021] It is to be understood that the details set forth herein do not limit the scope of the application to the one embodiment described. Rather, the scope of the present application is defined by the appended claims. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiments description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative effort based on these drawings.
[0023] Figure 1 is a flow chart of a method for supporting cross-cluster capacity adjustment according to an embodiment of the present application;
[0024] Figure 2 is a flow chart of a method for supporting cross-cluster capacity adjustment according to an embodiment of the present application;
[0025] Figure 3 is a structural schematic diagram of a device for supporting cross-cluster capacity adjustment according to an embodiment of the present application;
[0026] Figure 4 is a structural schematic diagram of an electronic device for implementing an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the technical personnel in the art better understand the present application, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort should be within the scope of protection of the present application.
[0028] It should be noted that the terms "first", "second", and the like in the present application are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0029] Embodiment one
[0030] Figure 1 This is a flowchart illustrating a method for supporting cross-cluster capacity adjustment according to Embodiment 1 of the present invention. This embodiment is applicable to situations where cluster capacity needs to be adjusted. The method can be executed by a device supporting cross-cluster capacity adjustment, which can be implemented in software and / or hardware and integrated into an electronic device. Furthermore, the electronic device includes, but is not limited to, computers, laptops, servers, etc.
[0031] The cluster in this embodiment of the invention can be a container cluster. A container cluster can be a cluster deployed in a Kubernetes environment. A container cluster can include multiple nodes, and each node can deploy container units (also known as Pods). A Pod is the smallest deployable unit in Kubernetes.
[0032] The electronic device in this embodiment of the invention can be considered as the central control node of multiple clusters. The central control node can interact with multiple clusters and coordinate the capacity adjustment of multiple clusters.
[0033] like Figure 1 As shown, the method includes:
[0034] S110. Obtain historical load data from multiple clusters, including historical node load data and historical container group unit load data.
[0035] For each cluster, its corresponding load data can be considered a key indicator reflecting the cluster's working status and resource usage, which is of great significance for cluster performance monitoring, resource optimization, and scaling decisions. The load data for each cluster can include node load data and container unit load data. Node load data can reflect the load of nodes in the cluster, and may include, but is not limited to, data such as node Central Processing Unit (CPU) utilization, memory utilization, and request latency. Container unit load data can reflect the load of Pods in the cluster, and may include, but is not limited to, Pod CPU utilization, memory utilization, and request latency.
[0036] For each cluster, its historical load data can be considered as the cluster's load data over a historical period. Historical load data can include historical node load data and historical container group unit load data.
[0037] In this step, the central control node can interact with multiple clusters to collect historical load data of each cluster at a set time interval, such as ten seconds, and add corresponding timestamps and cluster labels to the collected historical load data for subsequent identification. The way of collecting historical load data is not limited, such as through customizing a component for load data collection in the Kubernetes environment, or through an open source data collection tool.
[0038] Optionally, the historical load data of each cluster needs to be preprocessed before subsequent application. For example, data cleaning, which can specifically remove abnormal values (such as abnormal values with CPU utilization exceeding 100%); or filling in missing historical load data in the time series; or mapping different dimension indicators of historical load data to a unified format. Data preprocessing can be performed on the central control node or locally on each cluster, and the purpose is to ensure the quality of historical load data for subsequent model building.
[0039] S120, based on each of the historical load data, a joint modeling is performed to obtain a load prediction model, and the load prediction model is deployed to each cluster, so that each cluster predicts future load data by combining the current load data of each cluster using the load prediction model, and reports the future load data.
[0040] The load prediction model can be a model for predicting future load data of a cluster. In this step, a centralized training architecture can be used to jointly use the historical load data of each cluster to build and train a neural network model capable of processing time series data to obtain a load prediction model. The neural network model capable of processing time series data is not limited.
[0041] In one embodiment, based on each of the historical load data, a joint modeling is performed to obtain a load prediction model, including: in each of the historical load data, taking first historical load data of a first time window as input and taking second historical load data of a second time window as output, and jointly modeling to obtain a load prediction model; wherein the first time window and the second time window are adjacent and the first time window is before the second time window.
[0042] Taking a certain historical time as an example, the first time window can include N time window units forward from the historical time, and N can be one or more. For example, the length of a time window unit is 10 seconds, and N is 12, then the first time window can be a time window of 2 minutes forward from the historical time. The historical load data corresponding to the first time window is the first historical load data.
[0043] For example, at a certain historical moment, the second time window can include M time window units backward from the historical moment, and M can be one or more. For example, if the length of a time window unit is 10 seconds and N is 6, the second time window can be a time window of 1 minute backward from the historical moment. The historical load data corresponding to the second time window is the second historical load data. It should be noted that the number of N and M is not limited, and the length of the time window unit is not limited.
[0044] Based on the historical load data of each cluster, a plurality of training samples are constructed, each training sample taking the first historical load data as input and the second historical load data corresponding to the first historical load data as output. Through model training on the plurality of training samples, a prediction value of the second historical load data of the future M time window units is predicted from the first historical load data of the past N time window units, and the model parameters are iteratively updated through the difference between the prediction value and the second historical load data. The load prediction model with cross-cluster generalization ability is trained, including model structure definition (such as network layer number, activation function, etc.), model parameter file, inference interface packaging, etc. It should be noted that the load prediction model obtained by training is not only suitable for load prediction of the trained cluster, but also can adapt to the preliminary load prediction demand of the newly added cluster.
[0045] Based on the modeling of the load prediction model, the central control node can deploy the load prediction model or its lightweight version to the inference engine locally in each cluster. In addition, the central control node can update the model weight regularly and synchronize the updated load prediction model to each cluster in a timely manner. Among them, the load prediction model can be automatically deployed through the application deployment and management framework in the Kubernetes environment, ensuring the consistency of the deployment of each cluster.
[0046] In the case of deploying the load prediction model in the inference engine locally in each cluster, the load prediction model locally in the cluster can have the ability to predict the future load data based on the current load data locally, and report the predicted future load data to the central control node. Among them, the current load data can be the load data of N time window units forward from the current moment, and the future load data can be the predicted load data of M time window units backward from the current moment.
[0047] S130, determining a capacity adjustment strategy according to each of the future load data, the capacity adjustment strategy including a single-cluster capacity adjustment strategy and a cross-cluster collaborative capacity adjustment strategy.
[0048] The capacity adjustment strategy can be a strategy for capacity adjustment, i.e., scaling out or scaling in, and a specific manner of scaling out or scaling in, which can refer to how many quantities of Pods are to be added or reduced on a node of a certain cluster. The single-cluster capacity adjustment strategy is a capacity adjustment strategy that does not require cross-cluster coordination, and capacity adjustment can be achieved through a single cluster, i.e., a cluster corresponding to the future load data currently being processed. The cross-cluster coordinated capacity adjustment strategy is a capacity adjustment strategy that requires cross-cluster coordination.
[0049] The central control node determines the capacity adjustment strategy based on the future load data reported by each cluster. Specifically, for each future load data, it is determined whether the cluster corresponding to the future load data needs capacity adjustment, i.e., whether scaling out or scaling in is needed. If so, it is further determined whether the capacity adjustment of the cluster needs to be achieved through cross-cluster coordination, i.e., whether the idle resources of other clusters need to be borrowed or the capacity of the cluster that has borrowed idle resources in the past needs to be reduced. If the capacity adjustment needs to be achieved through cross-cluster coordination, the capacity adjustment strategy is determined to be the cross-cluster coordinated capacity adjustment strategy, and the strategy indicates which cluster needs to be coordinated for capacity adjustment, whether the cluster needs to be scaled out or scaled in, and the specific manner of scaling out or scaling in. If the capacity adjustment does not need to be achieved through cross-cluster coordination, the capacity adjustment strategy is determined to be the single-cluster capacity adjustment strategy, and the strategy indicates whether the cluster needs to be scaled out or scaled in, and the specific manner of scaling out or scaling in.
[0050] Optionally, the process of determining the capacity adjustment strategy can use linear programming, genetic algorithm, or reinforcement learning, etc. optimization algorithm to solve the optimal solution, which is not limited here.
[0051] S140, transmitting a capacity adjustment instruction corresponding to the capacity adjustment strategy to a to-be-adjusted cluster in each cluster, so that the to-be-adjusted cluster performs capacity adjustment based on the capacity adjustment instruction.
[0052] For each future load data, if the capacity adjustment strategy corresponding to the future load data is the cross-cluster coordinated capacity adjustment strategy, a capacity adjustment instruction is generated based on the strategy, the capacity adjustment instruction indicates whether the cluster that needs to be coordinated for capacity adjustment, i.e., the to-be-adjusted cluster, needs to be scaled out or scaled in, and the specific manner of scaling out or scaling in, and the capacity adjustment instruction is transmitted to the to-be-adjusted cluster, so that the to-be-adjusted cluster performs corresponding capacity adjustment. If the capacity adjustment strategy corresponding to the future load data is the single-cluster capacity adjustment strategy, a capacity adjustment instruction is generated based on the strategy, the capacity adjustment instruction indicates whether the cluster corresponding to the future load data, i.e., the to-be-adjusted cluster, needs to be scaled out or scaled in, and the specific manner of scaling out or scaling in, and the capacity adjustment instruction is transmitted to the to-be-adjusted cluster, so that the to-be-adjusted cluster performs corresponding capacity adjustment.
[0053] Optionally, the capacity adjustment instruction can be transmitted to the to-be-adjusted cluster in each cluster through an application programming interface or a custom controller in the kubernetes environment, and the format of the capacity adjustment instruction is not limited, and the capacity adjustment instruction is convenient for parsing and execution.
[0054] Optionally, in the execution of the cross-cluster collaborative capacity adjustment strategy, the capacity adjustment instruction generated based on the strategy can also indicate that the to-be-adjusted cluster can allow cross-cluster migration of service instances.
[0055] The technical scheme of the embodiment of the application collects historical load data and current load data of multiple clusters, globally models to obtain a load prediction model, and predicts future load data of each cluster, so that load changes can be predicted in advance, response delay is significantly reduced, and complex and changeable business scenarios can be adapted. By collecting future load data of multiple clusters, a capacity adjustment strategy is determined based on a global perspective, and a capacity adjustment instruction is issued to the corresponding to-be-adjusted cluster, so that single-cluster capacity adjustment or cross-cluster collaborative capacity adjustment is realized. The resource distribution of multiple clusters can be comprehensively evaluated, and resource sharing and load balancing of multiple clusters can be realized. The scheme integrates data collection, load prediction, collaborative decision-making and automatic execution, coordinates capacity adjustment of multiple clusters, and can improve the response speed, business scenario adaptability and resource utilization rate of cluster capacity adjustment.
[0056] Embodiment two
[0057] Figure 2 is a flowchart of a capacity adjustment method supporting cross-cluster provided by the embodiment two of the application. The embodiment is based on the above-mentioned embodiment one, and further refines the determination of the capacity adjustment strategy according to each future load data, as shown in the figure, the method comprises the following steps. Figure 2
[0058] S110, historical load data of multiple clusters is obtained, and the historical load data comprises historical node load data and historical container group unit load data.
[0059] S120, joint modeling is performed based on each historical load data to obtain a load prediction model, and the load prediction model is deployed to each cluster, so that each cluster uses the load prediction model to predict future load data in combination with local current load data, and reports the future load data.
[0060] S131, each future load data is taken as to-be-processed load data, a first load average of to-be-processed node load data in the to-be-processed load data is determined, and a second load average of to-be-processed container group unit load data in the to-be-processed load data is determined.
[0061] The future load data is taken as the to-be-processed load data respectively, and the to-be-processed node load data included in the to-be-processed load data is averaged. Specifically, the CPU utilization, memory utilization and the like of each node in the cluster corresponding to the to-be-processed load data can be mapped to a unified format, and a first load average is obtained by using a weighted average method.
[0062] The to-be-processed container group unit load data included in the to-be-processed load data is averaged. Specifically, the CPU utilization, memory utilization and the like of each Pod in the cluster corresponding to the to-be-processed load data can be mapped to a unified format, and a second load average is obtained by using a weighted average method.
[0063] In S132, a capacity adjustment strategy is determined based on the first load average, the second load average, the expansion threshold and the contraction threshold. The capacity adjustment strategy includes a single-cluster capacity adjustment strategy and a cross-cluster collaborative capacity adjustment strategy.
[0064] In this step, the second load average can be compared with the expansion threshold to determine whether the cluster corresponding to the to-be-processed load data needs to increase Pods. If so, the first load average is compared with the expansion threshold, and the need for Pod increase is combined to determine whether to expand within the cluster or to expand collaboratively across clusters, and then the capacity adjustment strategy is determined.
[0065] In this step, the second load average can be compared with the contraction threshold to determine whether the cluster corresponding to the to-be-processed load data needs to reduce Pods. If so, it is determined whether the cluster corresponding to the to-be-processed load data has ever borrowed resources from other clusters, whether to contract within the cluster or to contract collaboratively across clusters, and then the capacity adjustment strategy is determined.
[0066] In this step, the second load average can be compared with the expansion threshold and the contraction threshold. If it is indicated that the cluster corresponding to the to-be-processed load data does not need to be expanded or contracted, no processing is performed.
[0067] The expansion threshold and the contraction threshold are not limited, and can be set according to actual application needs.
[0068] In one embodiment, based on the first load average, the second load average, the expansion threshold and the contraction threshold, the capacity adjustment strategy is determined, including:
[0069] In the case where the second load average exceeds the expansion threshold, if the first load average does not exceed the expansion threshold and meets the container group unit expansion demand, the cluster corresponding to the to-be-processed load data is expanded by using the single-cluster capacity adjustment strategy.
[0070] If the first load average exceeds the expansion threshold or does not exceed the expansion threshold but does not meet the container group unit expansion requirement, expansion is performed by borrowing resources from other clusters through a cross-cluster collaborative capacity adjustment strategy, the other clusters being clusters that meet the container group unit expansion requirement other than the cluster corresponding to the to-be-processed load data.
[0071] That is, in the case where the second load average exceeds the expansion threshold, it is determined that the cluster corresponding to the to-be-processed load data needs to increase Pods; if the first load average does not exceed the expansion threshold and meets the container group unit expansion requirement, expansion is performed on the cluster corresponding to the to-be-processed load data through a single-cluster capacity adjustment strategy, and the number of Pods to be increased is indicated; if the first load average exceeds the expansion threshold or does not exceed the expansion threshold but does not meet the container group unit expansion requirement, expansion is performed by borrowing resources from other clusters that meet the container group unit expansion requirement through a cross-cluster collaborative capacity adjustment strategy, and the number of Pods to be increased is indicated. The container group unit expansion requirement can be determined based on the part of the second load average that exceeds the expansion threshold.
[0072] In one embodiment, based on the first load average, the second load average, the expansion threshold, and the contraction threshold, a capacity adjustment strategy is determined, including:
[0073] In the case where the second load average is lower than the contraction threshold, if the cluster corresponding to the to-be-processed load data does not have a corresponding borrowed expansion cluster, contraction is performed on the cluster corresponding to the to-be-processed load data through a single-cluster capacity adjustment strategy;
[0074] If the cluster corresponding to the to-be-processed load data has a corresponding borrowed expansion cluster, contraction is performed on the borrowed expansion cluster through a cross-cluster collaborative capacity adjustment strategy.
[0075] That is, in the case where the second load average is lower than the contraction threshold, it is determined that the cluster corresponding to the to-be-processed load data needs to decrease Pods; if the cluster corresponding to the to-be-processed load data does not have a corresponding borrowed expansion cluster, i.e., it has not borrowed resources from other clusters for expansion, contraction is performed on the cluster corresponding to the to-be-processed load data through a single-cluster capacity adjustment strategy, and the number of Pods to be decreased is indicated; if the cluster corresponding to the to-be-processed load data has a corresponding borrowed expansion cluster, i.e., it has borrowed resources from other clusters for expansion, contraction is performed on the borrowed expansion cluster through a cross-cluster collaborative capacity adjustment strategy, and the number of Pods to be decreased is indicated.
[0076] In one embodiment, based on the first load average, the second load average, the expansion threshold, and the contraction threshold, a capacity adjustment strategy is determined, including:
[0077] If the second load average is between the scaling-in threshold and the scaling-out threshold, then the capacity of the cluster corresponding to the to-be-processed load data is maintained.
[0078] That is, if the second load average is between the scaling-in threshold and the scaling-out threshold, it is determined that the cluster corresponding to the to-be-processed load data does not need to increase or decrease the Pods, and the capacity of the cluster corresponding to the to-be-processed load data is maintained.
[0079] S140, transmitting the capacity adjustment instruction corresponding to the capacity adjustment strategy to a to-be-adjusted cluster in each cluster, so that the to-be-adjusted cluster performs capacity adjustment based on the capacity adjustment instruction.
[0080] In one embodiment, the method further comprises:
[0081] Obtaining an adjustment log of the capacity adjustment of the to-be-adjusted cluster, so as to optimize the load prediction model and the capacity adjustment strategy through the adjustment log.
[0082] That is, when the to-be-adjusted cluster performs capacity adjustment based on the capacity adjustment instruction, an adjustment log in the capacity adjustment process can be recorded, and the adjustment log is fed back to the central control node; the central control node optimizes the load prediction model and the capacity adjustment strategy through analysis of the received adjustment log.
[0083] The present application trains a load prediction model capable of recognizing load trends by introducing an artificial intelligence driven neural network model and combining historical load data of multiple clusters, and predicts the resource demand changes of each cluster in the future through the load prediction model. Based on the prediction result, the scaling-in or scaling-out decision can be made before the load reaches the critical value, thereby realizing forward-looking scheduling, significantly improving the response ability of cluster capacity adjustment, and enhancing the stability and service quality in high concurrency or burst scenarios.
[0084] The present application receives future load data predicted by each cluster through the central control node, performs resource scheduling and strategy calculation based on the future load data of each cluster from a global perspective, issues capacity adjustment instructions to the corresponding cluster for execution, and obtains the execution result of the corresponding cluster, continuously corrects the strategy based on the execution result, and forms a closed loop control. Compared with the traditional resource scheduling mode, the resource utilization rate in the multi-cluster environment is optimized, the load balancing of multiple clusters is realized, and the service interruption risk caused by load imbalance is reduced.
[0085] The present application trains and distributes the inference mechanism in a centralized manner, expands the training sample space through multi-cluster data fusion in the training stage, so that the model can learn more extensive behavior patterns, and improves the model generalization ability and prediction accuracy; in the inference stage, distributed inference is used to ensure low delay execution.
[0086] The application designs an intelligent capacity expansion and contraction system integrating data collection, load prediction, collaborative decision-making and automatic execution, coordinates the capacity expansion and contraction behaviors of multiple clusters through a central control node, and realizes a closed-loop control process from data collection, load prediction, collaborative decision-making to final execution. The intelligent capacity expansion and contraction system not only improves the adaptive ability, but also reduces the need for manual intervention, greatly improves the operation and maintenance efficiency and the intelligent level.
[0087] In summary, the application introduces the prediction ability driven by artificial intelligence, constructs a unified load prediction model across clusters, realizes a collaborative scheduling mechanism, and establishes an integrated intelligent scheduling framework, effectively solving the problems of response lag, resource waste, low prediction accuracy and fragmented scheduling in multi-cluster capacity adjustment, and having significant technical progress and practical application value.
[0088] Embodiment three
[0089] Figure 3 It is a structural schematic diagram of a capacity adjustment device supporting cross-cluster provided by the embodiment three of the application. The embodiment can be applied to the case of adjusting the capacity of a cluster. As shown in the figure, the specific structure of the device includes: Figure 3
[0090] The acquisition module 31 is configured to acquire historical load data of multiple clusters, wherein the historical load data includes historical node load data and historical container group unit load data.
[0091] The prediction module 32 is configured to perform joint modeling based on each historical load data to obtain a load prediction model, deploy the load prediction model to each cluster, so that each cluster predicts future load data by combining the load prediction model with current load data of each cluster, and reports the future load data.
[0092] The determination module 33 is configured to determine a capacity adjustment strategy according to each future load data, wherein the capacity adjustment strategy includes a single-cluster capacity adjustment strategy and a cross-cluster collaborative capacity adjustment strategy.
[0093] The adjustment module 34 is configured to transmit a capacity adjustment instruction corresponding to the capacity adjustment strategy to a to-be-adjusted cluster in each cluster, so that the to-be-adjusted cluster performs capacity adjustment based on the capacity adjustment instruction.
[0094] The support cross-cluster capacity adjustment device provided by the embodiment comprises: a obtaining module, configured to obtain historical load data of a plurality of clusters, wherein the historical load data comprises historical node load data and historical container group unit load data; a prediction module, configured to perform joint modeling based on each of the historical load data to obtain a load prediction model, and deploy the load prediction model to each cluster, so that each cluster uses the load prediction model to predict future load data in combination with current load data of each cluster locally, and reports the future load data; a determination module, configured to determine a capacity adjustment strategy according to each of the future load data, wherein the capacity adjustment strategy comprises a single-cluster capacity adjustment strategy and a cross-cluster collaborative capacity adjustment strategy; and an adjustment module, configured to transmit a capacity adjustment instruction corresponding to the capacity adjustment strategy to a to-be-adjusted cluster in each cluster, so that the to-be-adjusted cluster performs capacity adjustment based on the capacity adjustment instruction. The scheme integrates data collection, load prediction, collaborative decision-making and automatic execution, coordinates capacity adjustment of a plurality of clusters, and can improve the response speed, business scenario adaptability and resource utilization rate of cluster capacity adjustment.
[0095] Further, the prediction module 32 is specifically configured to:
[0096] In each of the historical load data, the first historical load data of the first time window is taken as input, and the second historical load data of the second time window is taken as output, and joint modeling is performed to obtain a load prediction model; wherein the first time window and the second time window are adjacent and the first time window is before the second time window.
[0097] Further, the determination module 33 comprises:
[0098] The load mean value determination unit is configured to take each of the future load data as to-be-processed load data, determine a first load mean value of to-be-processed node load data in the to-be-processed load data, and a second load mean value of to-be-processed container group unit load data in the to-be-processed load data.
[0099] The adjustment strategy determination unit is configured to determine a capacity adjustment strategy based on the first load mean value, the second load mean value, the capacity expansion threshold and the capacity reduction threshold.
[0100] Further, the adjustment strategy determination unit is specifically configured to:
[0101] In the case where the second load mean value exceeds the capacity expansion threshold, if the first load mean value does not exceed the capacity expansion threshold and meets the container group unit capacity expansion demand, the to-be-processed load data corresponding cluster is expanded through the single-cluster capacity adjustment strategy.
[0102] If the first load average exceeds the expansion threshold or does not exceed the expansion threshold but does not meet the container group unit expansion requirement, expansion is performed by a cross-cluster collaborative capacity adjustment strategy by borrowing other clusters, which are clusters other than the cluster corresponding to the to-be-processed load data and meet the container group unit expansion requirement.
[0103] Further, the adjustment strategy determination unit is specifically configured to:
[0104] If the second load average is lower than the shrinkage threshold, if the cluster corresponding to the to-be-processed load data does not have a corresponding borrowed expansion cluster, shrinkage is performed on the cluster corresponding to the to-be-processed load data by a single-cluster capacity adjustment strategy;
[0105] If the cluster corresponding to the to-be-processed load data has a corresponding borrowed expansion cluster, shrinkage is performed on the borrowed expansion cluster by a cross-cluster collaborative capacity adjustment strategy.
[0106] Further, the adjustment strategy determination unit is specifically configured to:
[0107] If the second load average is between the shrinkage threshold and the expansion threshold, the capacity of the cluster corresponding to the to-be-processed load data is maintained.
[0108] Further, the device further comprises:
[0109] The adjustment log acquisition module is configured to acquire an adjustment log of capacity adjustment of the to-be-adjusted cluster, so as to optimize the load prediction model and the capacity adjustment strategy by using the adjustment log.
[0110] The device for supporting cross-cluster capacity adjustment provided in the embodiments of the present application can perform the method for supporting cross-cluster capacity adjustment provided in any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of performing the method.
[0111] Embodiment four
[0112] Figure 4 is a structural schematic diagram of an electronic device for implementing the embodiments of the present application. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are merely examples and are not intended to limit the implementations described and / or claimed in this document.
[0113] As Figure 4As shown, the electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., communicatively connected to the at least one processor 11, where the memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 12 or loaded into the random access memory (RAM) 13 from the storage unit 18. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0114] Various components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, a speaker, etc., a storage unit 18, such as a magnetic disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0115] The processor 11 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the method of supporting capacity adjustment across clusters.
[0116] In some embodiments, the method of supporting capacity adjustment across clusters can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method of supporting capacity adjustment across clusters described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the method of supporting capacity adjustment across clusters by any other appropriate means, such as by means of firmware.
[0117] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0118] Computer programs used to implement the processes of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program, when executed, can cause instructions defined in the flow charts and / or block diagrams to be implemented. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a standalone software package and partially on a remote machine or entirely on a remote machine or server.
[0119] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0120] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0121] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0122] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0123] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be executed in parallel, executed in sequence, or executed in a different order, as long as the desired results of the present disclosure are achieved, and the present disclosure is not limited herein.
[0124] The specific embodiments described above are not intended to be limiting, and persons skilled in the art will appreciate that various modifications, combinations, sub-combinations and alternatives can be made to the specific embodiments without departing from the spirit and principles of the disclosure. Accordingly, the disclosure is not limited to the specific embodiments described above, but only by the scope of the appended claims.
Claims
1. A method for supporting cross-cluster capacity adjustment, the method comprising: The method comprises the following steps: acquiring historical load data of multiple clusters, the historical load data comprising historical node load data and historical container group unit load data; jointly modeling based on each of the historical load data to obtain a load prediction model, and deploying the load prediction model to each cluster, so that each cluster uses the load prediction model to predict future load data in combination with current load data locally of each cluster, and reports the future load data; determining a capacity adjustment strategy according to each of the future load data, the capacity adjustment strategy comprising a single-cluster capacity adjustment strategy and a cross-cluster collaborative capacity adjustment strategy; transmitting a capacity adjustment instruction corresponding to the capacity adjustment strategy to a to-be-adjusted cluster in each cluster, so that the to-be-adjusted cluster performs capacity adjustment based on the capacity adjustment instruction.
2. The method of claim 1, wherein, The jointly modeling based on each of the historical load data to obtain a load prediction model comprises: in each of the historical load data, taking first historical load data of a first time window as input and taking second historical load data of a second time window as output, and jointly modeling to obtain a load prediction model; wherein the first time window and the second time window are adjacent and the first time window is before the second time window.
3. The method of claim 1, wherein, The determining a capacity adjustment strategy according to each of the future load data comprises: taking each of the future load data as to-be-processed load data, determining a first load average of to-be-processed node load data in the to-be-processed load data, and a second load average of to-be-processed container group unit load data in the to-be-processed load data; determining a capacity adjustment strategy based on the first load average, the second load average, an expansion threshold and a contraction threshold.
4. The method of claim 3, wherein, The determining a capacity adjustment strategy based on the first load average, the second load average, an expansion threshold and a contraction threshold comprises: in a case where the second load average exceeds the expansion threshold, if the first load average does not exceed the expansion threshold and satisfies a container group unit expansion demand, expanding a cluster corresponding to the to-be-processed load data through a single-cluster capacity adjustment strategy; if the first load average exceeds the expansion threshold or does not exceed the expansion threshold but does not satisfy the container group unit expansion demand, expanding through a cross-cluster collaborative capacity adjustment strategy by borrowing other clusters, the other clusters being clusters other than the cluster corresponding to the to-be-processed load data and satisfying the container group unit expansion demand.
5. The method of claim 3, wherein, The determining a capacity adjustment strategy based on the first load average, the second load average, an expansion threshold and a contraction threshold comprises: in a case where the second load average is lower than the contraction threshold, if the cluster corresponding to the to-be-processed load data does not have a corresponding borrowed expansion cluster, contracting the cluster corresponding to the to-be-processed load data through a single-cluster capacity adjustment strategy; if the cluster corresponding to the to-be-processed load data has a corresponding borrowed expansion cluster, contracting the borrowed expansion cluster through a cross-cluster collaborative capacity adjustment strategy.
6. The method of claim 3, wherein, The determining a capacity adjustment strategy based on the first load average, the second load average, an expansion threshold and a contraction threshold comprises: In a case where the second load average is between the shrinkage threshold and the expansion threshold, the capacity of the cluster corresponding to the to-be-processed load data is maintained.
7. The method of claim 1, wherein, Further comprising: an adjustment log of the to-be-adjusted cluster for capacity adjustment is acquired to optimize the load prediction model and the capacity adjustment strategy through the adjustment log.
8. A capacity adjustment device supporting cross-cluster operation, characterized in that, Further comprising: an acquisition module configured to acquire historical load data of a plurality of clusters, the historical load data including historical node load data and historical container group unit load data; a prediction module configured to jointly model based on each of the historical load data to obtain a load prediction model, and deploy the load prediction model to each cluster, so that each cluster predicts future load data in combination with current load data of each cluster locally using the load prediction model, and reports the future load data; a determination module configured to determine a capacity adjustment strategy according to each of the future load data, the capacity adjustment strategy including a single-cluster capacity adjustment strategy and a cross-cluster collaborative capacity adjustment strategy; an adjustment module configured to transmit a capacity adjustment instruction corresponding to the capacity adjustment strategy to a to-be-adjusted cluster in each cluster, so that the to-be-adjusted cluster performs capacity adjustment based on the capacity adjustment instruction.
9. An electronic device, comprising: Further comprising: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method of any one of claims 1-7. The program is executed by the processor to implement the method of any one of claims 1-7.
Citation Information
Cited By
Cluster data adaptive sampling method and device
CN122309289A