Resource configuration method and server cluster
Patent Information
- Application Number
- CN202610719877.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-22
- Publication Date
- 2026-09-18
AI Technical Summary
[0003]现有技术中,一般依赖运维人员手动配置,资源配置成本较高,且经常出现资源设置于任务需求不匹配现象
或者,监测最近M次采集的第一占用信息满足紧急告警条件的情况下,触发至少一个计算单元进入调试状态,M为大于等于1的整数。
Smart Images

Figure CN122777291A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of server technology, and in particular to a resource configuration method and a server cluster. Background Technology
[0002] With the widespread adoption of cloud computing and containerization technologies, enterprise applications tend to be deployed in virtual machines or containers. However, the normal operation of virtual machines or containers requires the configuration of hardware resources, such as CPU (Central Processing Unit) and memory.
[0003] In existing technologies, configuration typically relies on manual setup by maintenance personnel, resulting in high resource allocation costs and frequent mismatches between resource settings and task requirements. Therefore, how to configure hardware resources to achieve a balance between resource utilization and supply is a pressing technical problem that needs to be solved. Summary of the Invention
[0004] This application provides a resource allocation method and a server cluster. When the server cluster is in a stable state, model parameters are executed; when the server cluster is in a debugging state, hardware resources are adjusted. This two-state design enables efficient resource allocation and better balances resource usage and supply.
[0005] According to a first aspect of the embodiments of this application, a resource allocation method is provided, applied to a controller of a server cluster, the server cluster including at least one computing unit, the method comprising: Collect first occupancy information of at least one computing unit, the first occupancy information being used to represent the overall hardware resource usage of at least one computing unit; Based on the first occupancy information, if at least one computing unit is determined to be in a stable state, a preset load prediction model is trained to obtain the trained load prediction model. If, based on the first occupancy information, it is determined that at least one computing unit is in a debugging state, the load prediction model obtained through training is used to predict the second occupancy information of at least one computing unit at a preset future time, and the hardware resources corresponding to at least one computing unit are adjusted according to the second occupancy information.
[0006] Specifically, a monitoring program deployed on the controller can collect initial occupancy information for at least one computing unit. This initial occupancy information can refer to the sum of the initial occupancy information for all computing units.
[0007] In this embodiment, when collecting first occupancy information of at least one computing unit, the first occupancy information is used to represent the overall hardware resource usage of at least one computing unit, achieving unified collection of relevant information on resource usage. The first occupancy information is then used to determine whether the operating state of at least one computing unit is stable. In a stable state, a preset load prediction model is trained to obtain the trained load prediction model, achieving model training and parameter updates. In a stable state, the focus is on parameter learning and model updates, enabling the load prediction model to adapt to environmental changes in a timely manner, maintain high prediction accuracy, and avoid model drift. In a debugging state, the load prediction model is used to predict the second occupancy information of at least one computing unit at a preset future time, achieving proactive hardware resource pre-configuration, completing resource adjustments in advance and smoothly, effectively avoiding negative phenomena such as resource waste or resource exhaustion caused by inconsistencies between supply and demand, improving business processing performance, and effectively ensuring higher service quality. Therefore, by performing different processes in stable and debugging states, this embodiment maintains both autonomous learning and model optimization when the load is stable and dynamic resource adjustment when the load fluctuates, achieving automated and refined resource management.
[0008] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, a preset load prediction model is trained to obtain a trained load prediction model, including: Collect historical data of at least one computing unit. The historical data includes multiple training samples obtained by sampling at least one computing unit multiple times within a sliding window. The training samples include feature data and label data. The feature data includes at least one historical first occupancy information. The label data includes the actual occupancy information corresponding to at least one historical first occupancy information. Based on historical data, determine at least one set of hyperparameters for the preset load prediction model; For each set of hyperparameters, historical data is used to determine the learnable model parameters in the preset load prediction model; Based on the model parameters corresponding to each set of hyperparameters, the effect of each set of hyperparameters on the load prediction model is determined, and the set of hyperparameters with the highest effect is determined as the target hyperparameters of the load prediction model.
[0009] In this embodiment, when training the load prediction model, training data, i.e., historical data of at least one computing unit, is first acquired. Based on the acquired historical data, at least one set of hyperparameters is determined. Then, the learnable model parameters under each set of hyperparameters are trained one by one to obtain the load prediction model corresponding to each hyperparameter. The performance of the load prediction models corresponding to each set of hyperparameters is then evaluated, and the target hyperparameter with the highest performance is selected. This achieves a two-layer optimization based on hyperparameters and learnable parameters, effectively selecting the load prediction model with the highest performance, improving the accuracy and generalization ability of the load prediction model, thereby reducing prediction bias and providing more accurate model support for subsequent accurate prediction of resource occupancy and resource scheduling.
[0010] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, at least one set of hyperparameters of a preset load prediction model is determined based on historical data, including: The stationarity of historical data is verified to obtain the difference order d; Based on the value ranges of the order of the preset moving average term q and the order of the autoregressive term p, sampling is performed to obtain at least one pair of correlation orders (p, d, q). The difference order and each pair of correlation orders are determined as a set of hyperparameters to obtain at least one set of hyperparameters.
[0011] In this embodiment, stationarity verification is performed on historical data to accurately determine the difference order that satisfies the stationarity condition. The difference order is then combined with the correlation order to form a hyperparameter set. This allows for sampling and obtaining each set of hyperparameters based on the data's own fluctuation characteristics. The obtained hyperparameter sets are more adapted to the time-series changes in business operations, improving the overall adaptability and modeling efficiency of the load prediction model's hyperparameters.
[0012] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, for each set of hyperparameters, historical data is used to determine learnable model parameters in a preset load prediction model, including: Iterate through each group of hyperparameters. For the current group of hyperparameters, combine historical data and use the maximum likelihood estimation algorithm to fit the load prediction model to obtain the learnable model parameters in the load prediction model.
[0013] In this embodiment, by traversing each set of hyperparameters, the maximum likelihood estimation algorithm is used to complete the load prediction model fitting solution for the currently selected hyperparameter combination and the collected historical data. This accurately calculates the learnable parameters inside the model, allowing the model parameters to fully fit the time-series change patterns of historical data, reducing fitting bias, and obtaining a more accurate load prediction model.
[0014] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, determining the effect of each set of hyperparameters on the load prediction model based on the model parameters corresponding to each set of hyperparameters includes: Based on the model parameters corresponding to each set of hyperparameters, determine the maximum likelihood value corresponding to each set of hyperparameters; Based on the preset Akaike information criterion, and combining the current group order and the maximum likelihood value corresponding to the current group order, the AIC value of the current group order is calculated. The AIC value of each hyperparameter group is determined as the effect of each hyperparameter group on the load prediction model. The set of hyperparameters that yields the best results will be identified as the target hyperparameters for the load forecasting model, including: Based on the AIC value corresponding to each set of hyperparameters, select the order with the smallest AIC value as the target hyperparameter.
[0015] In this embodiment, the model parameters corresponding to each set of hyperparameters are used to determine the maximum likelihood value of each set of hyperparameters. Based on the maximum likelihood value, the AIC value of the current set of orders is calculated using the preset Akaike Information Criterion. The AIC value is used as the evaluation criterion for the effectiveness of the hyperparameters, and finally, the set with the smallest AIC value is selected as the target hyperparameters. This approach ensures the model's fit to historical data through the maximum likelihood value while balancing fitting accuracy and model complexity using the AIC criterion, effectively avoiding overfitting or underfitting. It quickly selects the optimal combination of model orders that balances prediction accuracy and computational efficiency, significantly improving the overall adaptability and practical performance of the load prediction model.
[0016] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, a trained load prediction model is used to predict second occupancy information of at least one computing unit at a preset future time, including: Get the first occupancy information from the most recently collected data; Based on the most recently collected first occupancy information and the trained load prediction model, predict the second occupancy information of at least one computing unit at a preset future time.
[0017] In this embodiment, the most recently collected first occupancy information and the trained load prediction model are used to predict the second occupancy information of at least one computing unit at a preset future time. By linking the real-time resource occupancy status with the trained load prediction model, the resource demand of the computing unit can be predicted in advance, providing reliable data basis for the pre-configuration of resources. This avoids resource waste, ensures the resource supply policy, and improves the rationality and timeliness of the overall resource scheduling of the server cluster.
[0018] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, the first occupancy information includes multiple components, and the method further includes: Based on multiple first occupancy information, determine the distribution characteristics of resources of at least one computing unit when they are occupied; If the distribution characteristics indicate that the resource occupancy meets the stationarity condition, then at least one computing unit is determined to be in a stable state. If the distribution characteristics indicate that resource usage does not meet the stationarity condition, at least one computing unit is determined to be in a debugging state.
[0019] In this embodiment, based on multiple resource occupancy data corresponding to the first occupancy information, the distribution characteristics of at least one computing unit's resources when they are occupied are determined, enabling an overall distribution characteristic analysis of at least one computing unit. Based on these distribution characteristics, it is then determined whether the resource occupancy status is stable. Therefore, based on whether the resource occupancy status is stable, corresponding adjustments are performed, accurately distinguishing between normal stable operation and load fluctuation conditions. This achieves intelligent and accurate identification of the operating status, facilitating targeted operation and maintenance management and anomaly handling.
[0020] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, it further includes: If a user triggers a stable state, the preset load prediction model is trained to obtain the trained load prediction model. Alternatively, if the user triggers the debugging state, the load prediction model obtained from the training is used to predict the second occupancy information of at least one computing unit at a preset future time, and the hardware resources corresponding to at least one computing unit are adjusted according to the second occupancy information. Alternatively, if the first occupancy information collected in the most recent M times meets the emergency alarm conditions, at least one computing unit is triggered to enter the debugging state, where M is an integer greater than or equal to 1.
[0021] In this embodiment, users can directly trigger entry into a stable or debug state. In the stable state, the load prediction model training and iteration optimization are automatically completed. In the debug state, the trained model is directly invoked to accurately predict the future resource usage of computing units, and hardware resource configuration is dynamically adjusted based on the predicted usage information. A manual intervention scheme is provided, which, in addition to providing autonomous learning and optimization, also supports users explicitly specifying the operating state, granting administrators complete control during special periods (such as major promotional events, version releases, etc.), achieving a perfect combination of automated operation and maintenance and manual intervention. A real-time monitoring scheme is also provided. When the first usage information collected in the most recent M times meets the emergency alarm conditions, at least one computing unit is triggered to enter a debug state, achieving real-time load monitoring and timely switching to debug state to adjust resource configuration, avoiding operational anomalies caused by unreasonable resource supply, and improving system stability.
[0022] According to a first aspect of the embodiments of this application, in some embodiments of the first aspect, adjusting the hardware resources corresponding to at least one computing unit based on second occupancy information includes: Based on the preset security buffer coefficient and the reserved value of the management domain, combined with the second occupancy information, the target configuration is determined; Adjust the hardware resources of at least one computing unit according to the target configuration.
[0023] In this embodiment, a preset security buffer coefficient and a management domain reserved value are used, combined with the second occupancy information, to comprehensively determine the target configuration. Hardware resources are then adjusted based on the target configuration. While matching resources to the actual load, factors such as reserved resources and safety margins are used to mitigate risks such as sudden business disruptions and resource overload. By reserving more suitable resources, the stability of business operations is ensured, optimizing overall resource utilization while meeting business operation requirements, and avoiding resource idleness and overload issues.
[0024] According to a second aspect of the embodiments of this application, a resource allocation apparatus is provided, comprising: An information acquisition unit is used to acquire multiple first occupancy information of at least one computing unit, each first occupancy information being used to represent the overall hardware resource usage of at least one computing unit at the corresponding acquisition time. The model training unit is used to train a preset load prediction model based on multiple first occupancy information to obtain the trained load prediction model. The resource prediction unit is used to predict the second occupancy information of at least one computing unit at a preset future time by using a trained load prediction model when at least one computing unit is determined to be in a debugging state based on multiple first occupancy information, and to adjust the hardware resources corresponding to at least one computing unit according to the second occupancy information. The second occupancy information refers to the expected usage of the overall hardware resources of at least one computing unit at the preset future time.
[0025] According to a third aspect of the embodiments of this application, a controller is provided, which is electrically connected to a memory for storing a computer program. The controller is used to execute the computer program to implement the resource allocation method of any of the above embodiments.
[0026] According to a fourth aspect of the embodiments of this application, a server cluster is provided, including: a controller, at least one computing unit, and a memory, wherein the memory is used to store a computer program, and the computer program is invoked by the controller to execute any of the above-described resource configuration methods.
[0027] According to a fifth aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a controller, it implements any of the resource configuration methods.
[0028] According to a sixth aspect of the embodiments of this application, a computer product is provided, including the step of implementing any resource configuration method when the computer product is executed by a controller.
[0029] It should be understood that both the foregoing general description and the following detailed description are exemplary and intended to provide further illustration of the claimed technology. Attached Figure Description
[0030] The above and other objects, features, and advantages of the embodiments of this application will become more apparent from the more detailed description of the embodiments in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the embodiments of this application and do not constitute a limitation thereof. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0031] Figure 1 The figure shows a schematic diagram of a server cluster structure according to an embodiment of this application; Figure 2 The figure shows a flowchart of a resource allocation method according to an embodiment of this application; Figure 3 The figure shows another flowchart of a resource allocation method according to an embodiment of this application; Figure 4The figure shows another flowchart of a resource allocation method according to an embodiment of this application; Figure 5 The figure shows another flowchart of a resource allocation method according to an embodiment of this application; Figure 6 The figure shows a schematic diagram of a resource allocation device according to an embodiment of this application; Figure 7 The figure shows another structural schematic diagram of a node according to an embodiment of this application. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of the embodiments of this application more apparent, exemplary embodiments according to the embodiments of this application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the embodiments of this application, and not all embodiments of the embodiments of this application. It should be understood that the embodiments of this application are not limited to the exemplary embodiments described herein.
[0033] The technical solution of this application embodiment can be applied to server clusters. By performing different processes in stable and debugging states, this application embodiment can both maintain the ability to learn and optimize the model autonomously when the load is stable and dynamically adjust resources when the load fluctuates, thereby achieving automated and refined resource management.
[0034] The technical solutions of the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0035] like Figure 1 The diagram shown is an example of a server cluster provided in an embodiment of this application. The server cluster may include a controller 10 and one or more servers 20. Each server 20 may include at least one computing unit, such as... Figure 1 The diagram shows 20a, VM (Virtual Machine) and 20b, pod (container group).
[0036] In this embodiment, the server cluster may include multiple nodes, such as a controller and at least one server node / server. The controller, server, or server node can refer to a physical node, specifically an independent physical node. Of course, the controller can be an abstract node, that is, an independent computing unit within a server or server node. This embodiment does not impose excessive limitations on the way nodes are divided in the server cluster.
[0037] The computing unit can provide an isolated computing environment to run applications. At least one computing unit may include, but is not limited to, servers, VMs, and / or pods. A brief introduction to VMs and pods follows.
[0038] 1. A VM can simulate a complete physical computer through software, which may include an independent operating system (Guest OS) and virtual hardware (CPU, memory, disk, network card, etc.). The VM is completely isolated from the host machine and other VMs.
[0039] 2. A pod is the smallest unit of deployment in Kubernetes (a container orchestration system), providing a container runtime environment with a shared context. A pod can contain one or more containers.
[0040] The controller 10 can be any node or server in the server cluster, specifically a node / server designated or configured as having central processing capabilities. The controller 10 can be configured with the resource configuration method provided in this embodiment to perform the following steps: S101, Information Acquisition: In this step, the controller 10 can acquire multiple first occupancy information of at least one computing unit. Each first occupancy information is used to represent the usage of the overall hardware resources of at least one computing unit at the corresponding acquisition time.
[0041] S102. Stable training: In this step, the controller 10 can train the preset load prediction model based on multiple first occupancy information to obtain the trained load prediction model.
[0042] S103, Dynamic Configuration: In this step, the controller 10 can, based on multiple first occupancy information, determine that at least one computing unit is in a debugging state, and use the load prediction model obtained through training to predict the second occupancy information of at least one computing unit at a preset future time, and adjust the hardware resources corresponding to at least one computing unit according to the second occupancy information. The second occupancy information refers to the expected usage of the overall hardware resources of at least one computing unit at a preset future time.
[0043] like Figure 2 The diagram shown is a flowchart of a resource configuration method provided in an embodiment of this application. This resource configuration method can be applied to the controller of a server cluster, which further includes at least one computing unit. The method may include: S201. Collect multiple first occupancy information of at least one computing unit, each first occupancy information being used to represent the overall hardware resource usage of at least one computing unit at the corresponding collection time.
[0044] In this application's embodiments, "resources" refers to hardware resources, specifically the quotas allocated to computing units such as CPU, memory, and GPU (Graphics Processing Unit). For example, a virtual machine might be allocated 2GB (Gigabyte) of memory and 2 virtual CPUs (virtual central processing units). Of course, the hardware quotas for different computing units can be the same or different, depending on usage requirements or computing scenarios. For instance, each pod could be allocated 2000MB of memory, or an additional 1000MB of memory could be allocated to each individual pod based on its computing load.
[0045] At least one computing unit may include, but is not limited to, servers, VMs, and / or pods. Taking at least one computing unit including at least one VM and at least one pod as an example, by simultaneously adjusting the resource configuration of the VM and the pod, joint adjustment of the VM and the pod is achieved. Through a single adjustment, the overall hardware optimization of multiple computing units is realized, thereby improving the optimization efficiency of hardware resources.
[0046] Optionally, the first occupancy information may include multiple instances, and multiple instances of first occupancy information of at least one computing unit may be collected. Each instance of first occupancy information represents the overall hardware usage of at least one computing unit at the corresponding collection time.
[0047] When collecting information on the overall hardware resource usage of at least one computing unit, the first occupancy information can be collected within a preset time window and at a preset collection frequency.
[0048] The duration of the time window can be a pre-set duration for resource monitoring and adjustment. For example, a day or 5 hours can be set as a time window. Multiple first occupancy information points are collected within the time window, that is, multiple first occupancy information points are collected every day or every 5 hours. The collected multiple first occupancy information points can be used as a whole for stability analysis and resource prediction.
[0049] Specifically, multiple acquisition times can be determined based on a preset time window and acquisition frequency, and the overall hardware resource usage of at least one computing unit can be acquired at each acquisition time to obtain the first occupancy information at each acquisition time.
[0050] That is, collecting multiple first occupancy information of at least one computing unit can include: collecting first occupancy information corresponding to at least one computing unit at multiple collection times. Multiple first occupancy information can be combined to form a sequence along a time dimension.
[0051] The initial occupancy information of at least one computing unit at the time of data acquisition can be determined by the resource usage data of each computing unit collected at that time. Specifically, the resource usage data may include, but is not limited to: the total resource amount of the computing unit, real-time resource utilization rate, and / or resource utilization amount.
[0052] Optionally, S201 may include: collecting resource usage data of each computing unit multiple times within a preset time window to obtain multiple resource usage data of each computing unit, and determining the first occupancy information of at least one computing unit based on the multiple resource usage data of each computing unit.
[0053] Within a time window, resource utilization can be collected multiple times. For example, at time T1, resource usage data for each computing unit can be collected, and at time T2, after one cycle from T1, resource usage data for each computing unit can be collected again.
[0054] In other words, the resource usage data of each computing unit forms a time series. At the same time, resource usage data of multiple computing units can be collected. For the same computing unit, resource usage data of the computing unit at different times can be collected to form a time series.
[0055] When determining the first occupancy information of at least one computing unit based on multiple resource usage data of each computing unit, we can first associate a resource usage data of at least one computing unit with the same collection time. We can then summarize the resource usage data of at least one computing unit collected at the same collection time to obtain the first occupancy information of at least one computing unit at the same collection time, so as to determine the first occupancy information of at least one computing unit at multiple collection times.
[0056] The resource usage data corresponding to at least one computing unit collected at a given time are aggregated to obtain the first occupancy information of at least one computing unit at that time. This can include: determining the resource usage of each computing unit at the time of collection based on the resource usage data of at least one computing unit collected at that time; summing the resource usage of each computing unit to obtain the total resource usage of at least one computing unit; summing the resource allocation of each computing unit to obtain the total resource allocation of at least one computing unit; calculating the quotient of the total resource usage and the total resource allocation to obtain the resource occupancy rate; and using the resource occupancy rate as one piece of first occupancy information. Alternatively, the total resource usage and the total resource allocation can also be used as first occupancy information.
[0057] As mentioned above, resource usage data for computing units can be obtained through data collection, typically via monitoring programs. Specifically, collecting resource usage data for each computing unit can include: collecting resource usage data for each computing unit through monitoring programs.
[0058] Monitoring programs can be deployed on servers or individual computing units. If deployed on a server, the monitoring program can interact with each computing unit to collect its resource usage data. If deployed within a computing unit, the monitoring program can directly collect its resource usage data.
[0059] The controller interacts with the monitoring program to obtain resource usage data of each computing unit collected by the monitoring program.
[0060] It is understandable that the resource usage data of each computing unit collected at the same time can be used as a whole to participate in the acquisition of the first occupancy information at that time, which can ensure the validity of the first occupancy information in the time dimension.
[0061] S202. Based on multiple first occupancy information, and after determining that at least one computing unit is in a stable state, the preset load prediction model is trained to obtain the trained load prediction model.
[0062] At least one computing unit is in a stable state, meaning that the load fluctuation of at least one computing unit is small and there is no instantaneous flow. When at least one computing unit is in an unstable state, the load fluctuation of at least one computing unit is large and there is instantaneous flow. At this time, at least one computing unit enters the debugging state.
[0063] When multiple first occupancy information are used as the analysis object, the distribution characteristics of multiple first occupancy information can be obtained, and the distribution characteristics can be used to determine whether at least one computing unit is in a stable state.
[0064] Load forecasting models can be used to predict the resource consumption or usage of at least one computing unit at some point in the future.
[0065] S203. If, based on multiple first occupancy information points, it is determined that at least one computing unit is in a debugging state, a trained load prediction model is used to predict the second occupancy information of the at least one computing unit at a preset future time, and the hardware resources corresponding to the at least one computing unit are adjusted according to the second occupancy information. The second occupancy information refers to the expected usage of the overall hardware resources of the at least one computing unit at the preset future time.
[0066] In the above text, the first occupancy information can be obtained at the corresponding collection time. Regarding hardware resource usage, given a known collection frequency, future collection times can be estimated. For example, if the collection unit is daily, the overall hardware resource usage can be collected once a day. After multiple collections within the time window, multiple first occupancy information entries are obtained.
[0067] The future moment can refer to the next acquisition moment or the next few acquisition moments after the last acquisition moment within the time window.
[0068] Using a one-day time window and a collection frequency of once per minute, at least one computing unit's first occupancy information is collected each day within the one-day time window at the specified collection frequency (used to determine the collection time). Future times can be the first collection time after the last day's collection time or the Nth collection time.
[0069] Taking the ARIMA (Autoregressive Integrated Moving Average) model as an example, the second occupancy information for the night of the 27th can be predicted on the morning of the 27th. The ARIMA model takes multiple first occupancy information entries as input, automatically performs d-order differencing calculations and model predictions internally, and outputs future values in the differencing domain. Then, d-order inverse differencing is used to reconstruct the second occupancy information corresponding to the future values, i.e., the resource occupancy. For example, when d=2, two inverse differencing operations are needed based on the second-order differencing sequence to obtain the second occupancy information. Of course, both the differencing and inverse differencing stages are performed internally by the model.
[0070] Assuming the time window is from April 1st to April 30th, the last acquisition time within this time window is at April 30th. After acquiring the first occupancy information at April 30th, the next acquisition time or several subsequent acquisition times, such as the acquisition time at May 1st or the five acquisition times from May 1st to May 5th, can be used as future times.
[0071] In the debugging state, the hardware resources of at least one computing unit can be adjusted to better match the hardware resources with the load requirements of at least one computing unit, avoiding processing failures caused by insufficient hardware resource supply, or resource waste and excessive costs caused by excessive hardware resource supply, thus achieving a dynamic balance between supply and demand.
[0072] In this embodiment, predicted second occupancy information is used to adjust the hardware resources of at least one computing unit. During the specific resource adjustment, the second occupancy information needs to be adjusted from two dimensions: security cache and reserved resources, to ensure that the newly configured hardware resources can meet the usage requirements. As another embodiment, adjusting the hardware resources corresponding to at least one computing unit based on the second occupancy information includes: Based on the preset security buffer coefficient and the reserved value of the management domain, combined with the second occupancy information, the target configuration is determined; according to the target configuration, the hardware resources of at least one computing unit are adjusted.
[0073] This also includes: determining the hardware resource adjustment time based on future timeframes. Adjusting the hardware resources of at least one computing unit according to the target configuration may include: adjusting the hardware resources of the computing unit to the target configuration when the hardware resource adjustment time is reached.
[0074] Optionally, the target configuration can be determined based on the preset security buffer coefficient and the management domain reserved value, combined with the second occupancy information. This can include inputting the security buffer coefficient, the management domain reserved value, and the second occupancy information into a preset resource adjustment formula to obtain the target configuration.
[0075] Assume the safety buffer coefficient uses signs If the management domain reserved storage is represented by M, then the target configuration is represented using the following resource adjustment formula:
[0076] Optionally, the second occupancy information is used For example, the formula for calculating the target configuration, using the CPU as an example, is as follows:
[0077] Indicate each )) represents the minimum CPU resource configuration for all pods in the Kubernetes environment.
[0078] Taking mem as an example, the formula for calculating the target configuration is as follows:
[0079] This represents the minimum MEM resource configuration for all pods in the Kubernetes environment.
[0080] Understandably, a target configuration is determined by combining a preset safety buffer coefficient and management domain reserved storage values with secondary occupancy information. Hardware resources are then adjusted based on this target configuration. While matching resources to actual load, factors such as reserved resources and safety margins are used to mitigate risks such as sudden business disruptions and resource congestion. By reserving more suitable resources, the stability of business operations is ensured, optimizing overall resource utilization while meeting business needs and avoiding resource idleness and overload issues.
[0081] In this embodiment, when collecting multiple first occupancy information from at least one computing unit, each first occupancy information represents the overall hardware resource usage of at least one computing unit, achieving unified collection of relevant information on resource usage. The first occupancy information is then used to determine whether the operating state of at least one computing unit is stable. In a stable state, a preset load prediction model is trained to obtain the trained load prediction model, achieving model training and parameter updates. In a stable state, the focus is on parameter learning and model updates, enabling the load prediction model to adapt to environmental changes in a timely manner, maintain high prediction accuracy, and avoid model drift. In a debugging state, the load prediction model is used to predict the second occupancy information of at least one computing unit at a preset future time, achieving proactive hardware resource pre-configuration, completing resource adjustments in advance and smoothly, effectively avoiding negative phenomena such as resource waste or exhaustion caused by inconsistencies between supply and demand, improving business processing performance, and effectively ensuring higher service quality. Therefore, by performing different processes in stable and debugging states, this embodiment maintains both autonomous learning and model optimization when the load is stable and dynamic resource adjustment when the load fluctuates, achieving automated and refined resource management.
[0082] like Figure 3 The diagram shown is another flowchart of a resource configuration method provided in this application embodiment. This resource configuration method can be applied to the controller of a server cluster, which may further include at least one computing unit. The method may include: S301. Collect multiple first occupancy information of at least one computing unit, wherein the first occupancy information is used to represent the overall hardware resource usage of at least one computing unit.
[0083] S302. Based on multiple first occupancy information, determine whether at least one computing unit is in a stable state. If yes, execute S303; otherwise, execute S304.
[0084] If at least one computing unit is not in a stable state, it is determined that at least one computing unit is in a debugging state.
[0085] S303. Train the preset load prediction model to obtain the trained load prediction model.
[0086] S304. Using the load prediction model obtained from training, predict the second occupancy information of at least one computing unit at a preset future time.
[0087] S305. Adjust the hardware resources corresponding to at least one computing unit according to the second occupancy information.
[0088] In this embodiment, when collecting multiple first occupancy information from at least one computing unit, each first occupancy information represents the overall hardware resource usage of at least one computing unit, achieving unified collection of relevant information on resource usage. The first occupancy information is then used to determine whether the operating state of at least one computing unit is stable. In a stable state, a preset load prediction model is trained to obtain the trained load prediction model, achieving model training and parameter updates. In a stable state, the focus is on parameter learning and model updates, enabling the load prediction model to adapt to environmental changes in a timely manner, maintain high prediction accuracy, and avoid model drift. In an unstable state, i.e., a debugging state, the load prediction model is used to predict the second occupancy information of at least one computing unit at a preset future time, achieving proactive hardware resource pre-configuration, completing resource adjustments in advance and smoothly, effectively avoiding negative phenomena such as resource waste or exhaustion caused by inconsistencies between supply and demand, improving business processing performance, and effectively ensuring higher service quality. Therefore, by performing different processes in stable and debugging states, this embodiment maintains both autonomous learning and model optimization when the load is stable and dynamic resource adjustment when the load fluctuates, achieving automated and refined resource management.
[0089] The parameters in a load forecasting model can include hyperparameters and learnable parameters. Hyperparameters are parameters that need to be determined before model training. Learnable parameters are parameters in the load forecasting model that, in addition to hyperparameters, can be obtained through training.
[0090] The ARIMA model will be used as an example to illustrate the load forecasting model in detail. The formula for the ARIMA model is as follows:
[0091] in, ; It is a constant term; p ; It is the order of the autoregressive (AR) term. , represents the relationship between the current value and the values at the past p time points; d is the difference order, used to convert a non-stationary series into a stationary series; q is the order of the moving average (MA) term; It is the moving average coefficient, representing the relationship between the current value and random disturbances over the past q time points. ; It is a white noise sequence with a mean of 0 and a variance of . .
[0092] Among them, parameters such as (p, d, q) can be hyperparameters. , c Parameters such as ) can be learnable parameters.
[0093] Because both the hyperparameters and learnable parameters of the load forecasting model need to be determined in order to obtain a more accurate load forecasting model, therefore, as... Figure 4 The diagram shown is another flowchart of a resource allocation method provided in this application embodiment. The difference from other embodiments lies in that training a preset load prediction model to obtain the trained load prediction model may include: S401. Collect historical data of at least one computing unit. The historical data includes multiple training samples obtained by sampling at least one computing unit multiple times within a sliding window. The training samples include feature data and label data. The feature data includes at least one historical first occupancy information. The label data includes the actual occupancy information corresponding to at least one historical first occupancy information.
[0094] Understandably, each training sample can participate in model training. Specifically, the feature data of each training sample can be used as input data to the load prediction model. The prediction results output by the load prediction model are compared with the label data to calculate the error, and the prediction error is obtained. When the prediction errors of multiple training samples as a whole meet the preset convergence conditions, the load prediction model is determined to end the training.
[0095] Optionally, a sliding window can refer to a pre-set variable window in the time dimension used for information sampling. For example, the sliding window can be 30 days or one month. Specifically, the sliding window can include multiple time windows, which are sub-windows of the sliding window. Data can be collected once within each time window to obtain a training sample.
[0096] Taking a 30-day sliding window and a 1-day time window as an example, training samples can be collected once a day within the 30 days, and the resulting 30 training samples can be identified as historical data.
[0097] Feature data can include at least one historical first occupancy information collected within a time window; that is, feature data can be a set of at least one historical first occupancy information generated and stored within a time window. After each first occupancy information is collected within the time window, it can be added to the feature data as historical first occupancy information. After obtaining at least one historical first occupancy information within the time window, the collection time of label data can be determined based on the end time of the time window and the duration of a preset future time. At this collection time, actual occupancy information is collected to obtain label data. This results in a training sample consisting of {feature data: at least one historical first occupancy information, label data: actual occupancy information}.
[0098] Furthermore, at least one historical first occupancy information within the time window can be used as input data to train the load prediction model, predicting the second occupancy information of at least one computing unit at a preset future time. In this case, the second occupancy information can also be used as label data. Of course, if actual occupancy information is collected at the preset future time, this actual occupancy information can be used as label data to ensure the accuracy and effectiveness of the training samples.
[0099] Feature data may include at least one historical first occupancy information, which can be expressed using a formula. This indicates that N represents the number of data collections within the time window, and t is an integer. The length of the time window within a sliding window can be fixed or variable. For example, a time window can be set to one day or two days. For instance, within a month, the time window could be one day for days 1-5, two days for days 5-28, and five hours for days 29-30.
[0100] Of course, the information collection frequency within the same time window can be fixed. For example, the first occupancy information can be collected within the time window according to the preset collection frequency to obtain at least one first occupancy information within the time window.
[0101] S402. Based on historical data, determine at least one set of hyperparameters for the preset load prediction model.
[0102] S403. For each set of hyperparameters, use historical data to determine the learnable model parameters in the preset load prediction model.
[0103] Optionally, for each set of hyperparameters, initialize the load forecasting model, use historical data to perform a maximum likelihood estimation algorithm to fit the model, and obtain the model parameters when fitting the maximum likelihood estimation model.
[0104] S404. Based on the model parameters corresponding to each set of hyperparameters, determine the effect of each set of hyperparameters in the load prediction model, and determine the set of hyperparameters with the highest effect as the target hyperparameters of the load prediction model.
[0105] In this embodiment, when training the load prediction model, training data is first acquired, namely historical data of at least one computing unit. This historical data includes multiple historical first occupancy information obtained by sampling at least one computing unit multiple times within a sliding window. Based on the acquired historical data, at least one set of hyperparameters is determined. Then, the learnable model parameters under each set of hyperparameters are trained sequentially to obtain the load prediction model corresponding to each hyperparameter. The performance of the load prediction models corresponding to each set of hyperparameters is then evaluated, and the target hyperparameter with the highest performance is selected. This achieves a two-layer optimization based on hyperparameters and learnable parameters, effectively selecting the load prediction model with the highest performance, improving the accuracy and generalization ability of the load prediction model, thereby reducing prediction bias and providing more accurate model support for subsequent precise prediction of resource occupancy and resource scheduling.
[0106] For historical data, at least one set of hyperparameters for the load forecasting model can be determined through stationarity verification. As an example, S402, determining at least one set of hyperparameters for a preset load forecasting model based on historical data may include: A1. Verify the stationarity of historical data to obtain the difference order d.
[0107] Stationarity can be verified, for example, by using the ADF (Augmented Dickey-Fuller Test).
[0108] Specifically, A1 can include: determining historical data: Historical data Conduct ADF unit root stationarity verification and determine whether the sequence is stationary based on the test results: If the original sequence satisfies the stationarity condition, the difference order d=0 is determined; if it is determined to be a non-stationary sequence, the dataset is first-order differencing is performed, and the ADF stationarity test is performed again. If the sequence is stationary after first-order differencing, the difference order d=1 is determined; if it still does not meet the stationarity requirement, second-order differencing is performed and the stationarity test is repeated until a stationary time series is obtained, and the corresponding difference order d=2 is determined.
[0109] The original sequence satisfying the stationarity condition can include: calculating historical data. The original P-value is used to determine if the original sequence satisfies the stationarity condition. If the original P-value is less than the significance level threshold, the original sequence is determined to satisfy the stationarity condition.
[0110] If the original p-value is greater than or equal to the significance level threshold, then the original sequence does not meet the stationarity condition, and historical data can be analyzed. After performing a difference test, perform the ADF test again to obtain the first-order P-value. If the first-order P-value is less than the significance level threshold, then the first-order sequence is determined to satisfy the stationarity condition, and d=0 in this case.
[0111] If the first-order P-value is greater than or equal to the significance level threshold, then the first-order sequence does not meet the stationarity condition. The first-order data can be differxed again and the ADF test can be performed again to obtain the second-order P-value. If the second-order P-value is less than the significance level threshold, then the second-order sequence meets the stationarity condition, and d=1 in this case.
[0112] If the second-order P-value is greater than or equal to the significance level threshold, it is determined that the second-order sequence does not meet the stationarity condition. The second-order data can be differxed again and the ADF test can be performed again to obtain the third-order P-value. If the third-order P-value is less than the significance level threshold, it is determined that the third-order sequence meets the stationarity condition, and d=2 in this case.
[0113] Of course, the maximum value of d is generally 2, as higher order differences are not very meaningful and will lose trend information. Therefore, the optimal difference order d can be obtained, such as d=2.
[0114] A2. Based on the value ranges of the order of the preset moving average term q and the order of the autoregressive term p, sample to obtain at least one pair of correlation orders (p, d, q).
[0115] Optionally, the range of values for p and q is preset, such as... The difference order d=2 obtained through step A1 can be used to obtain at least one set of correlation orders by considering the range of values for p, d, and q. For example, the selected correlation order is (0, 1, 4).
[0116] A3. Determine the difference order and each pair of correlation orders as a set of hyperparameters to obtain at least one set of hyperparameters.
[0117] In this embodiment, stationarity verification is performed on historical data to accurately determine the difference order that satisfies the stationarity condition. The difference order is then combined with the correlation order to form a hyperparameter set. This allows for sampling and obtaining each set of hyperparameters based on the data's own fluctuation characteristics. The obtained hyperparameter sets are more adapted to the time-series changes in business operations, improving the overall adaptability and modeling efficiency of the load prediction model's hyperparameters.
[0118] When the hyperparameters are known, the load prediction model corresponding to the hyperparameters can be trained using historical data to obtain the specific values of the learnable model parameters in the load prediction model. Therefore, as an example, S403, for each set of hyperparameters, historical data is used to determine the learnable model parameters in the preset load prediction model, including: B1. Iterate through each group of hyperparameters. For the current group of hyperparameters, combine historical data and use the maximum likelihood estimation algorithm to fit the load prediction model to obtain the learnable model parameters in the load prediction model.
[0119] Even when the hyperparameters are known, some parameters in the load forecasting model remain unknown. Therefore, further model training is needed to obtain the final model parameters. Specifically, the maximum likelihood estimation algorithm can be used to fit the load forecasting model and obtain the learnable model parameters.
[0120] In the ARIMA model, given the hyperparameters (p, d, q), historical data can be used to fit the load forecasting model using the maximum likelihood estimation algorithm, thus obtaining the learnable model parameters in the load forecasting model. , c The stationary value for each period. Treating it as being generated jointly by historical data and historical noise, we construct a probability expression for the joint occurrence of all sample observations, thus obtaining the likelihood function L( , c To maximize the likelihood function max L( , c The maximum likelihood estimation algorithm is used to solve for the fitting objective. Specifically, the core logic of maximum likelihood estimation is: Given historical data over a known time series and a defined (p,d,q) structure, find a set of optimal parameters ( , c This maximizes the probability of observed time-series data occurrences and calculates the maximum likelihood value that can be fitted to the current load forecasting model. .
[0121] In this embodiment, by traversing each set of hyperparameters, the maximum likelihood estimation algorithm is used to complete the load prediction model fitting solution for the currently selected hyperparameter combination and the collected historical data. This accurately calculates the learnable parameters inside the model, allowing the model parameters to fully fit the time-series change patterns of historical data, reducing fitting bias, and obtaining a more accurate load prediction model.
[0122] For a load forecasting model with known parameters, the Akaike Information Criterion can be used to measure the effectiveness of the load forecasting model corresponding to each hyperparameter. Therefore, as another embodiment, in S404, determining the effectiveness of each set of hyperparameters in the load forecasting model based on the model parameters corresponding to each set of hyperparameters may include: C1. Determine the maximum likelihood value for each set of hyperparameters based on the model parameters corresponding to each set of hyperparameters.
[0123] C2. Based on the preset Akaike Information Criterion, and combining the current group order and the maximum likelihood value corresponding to the current group order, calculate the AIC value of the current group order.
[0124] The AIC (Akaike Information Criterion) can be represented by the following formula: AIC = 2k - 2ln( ) Where k = p + q is the number of model parameters. It is the maximum likelihood value of the model. The smaller the AIC value, the better the model achieves a balance between goodness of fit and complexity.
[0125] C3. Determine the AIC value of each hyperparameter group as the effect of each hyperparameter group on the load prediction model.
[0126] In S404, the set of hyperparameters that yields the best results is determined as the target hyperparameters for the load prediction model, including: C4. Based on the AIC value corresponding to each set of hyperparameters, select the order with the smallest AIC value as the target hyperparameter.
[0127] In this embodiment, the model parameters corresponding to each set of hyperparameters are used to determine the maximum likelihood value of each set of hyperparameters. Based on the maximum likelihood value, the AIC value of the current set of orders is calculated using the preset Akaike Information Criterion. The AIC value is used as the evaluation criterion for the effectiveness of the hyperparameters, and finally, the set with the smallest AIC value is selected as the target hyperparameters. This approach ensures the model's fit to historical data through the maximum likelihood value while balancing fitting accuracy and model complexity using the AIC criterion, effectively avoiding overfitting or underfitting. It quickly selects the optimal combination of model orders that balances prediction accuracy and computational efficiency, significantly improving the overall adaptability and practical performance of the load prediction model.
[0128] As mentioned above, a trained load prediction model can be used to predict the second occupancy information of at least one computing unit at a predetermined future time. Specifically, this can include: Get the first occupancy information from the most recent collection.
[0129] Based on the most recently collected first occupancy information and the trained load prediction model, predict the second occupancy information of at least one computing unit at a preset future time.
[0130] The most recently collected first occupancy information can refer to the first occupancy information collected when it is determined that at least one computing unit is in a debugging state. Alternatively, it can be obtained by acquiring the most recently collected first occupancy information when it is determined that at least one computing unit is in a debugging state.
[0131] The first occupancy information is defined as the overall hardware resource usage of at least one computing unit.
[0132] It is understandable that the most recently collected first occupancy information can refer to the most recently collected first occupancy information before the current moment.
[0133] In this embodiment, the most recently collected first occupancy information and the trained load prediction model are used to predict the second occupancy information of at least one computing unit at a preset future time. By linking the real-time resource occupancy status with the trained load prediction model, the resource demand of the computing unit can be predicted in advance, providing reliable data basis for the pre-configuration of resources. This avoids resource waste, ensures the resource supply policy, and improves the rationality and timeliness of the overall resource scheduling of the server cluster.
[0134] In one possible design, the initial occupancy information includes multiple resource occupancy data, and the method also includes: Based on multiple resource occupancy data of the first occupancy information, determine the distribution characteristics of resources of at least one computing unit when they are occupied; If the distribution characteristics indicate that the resource occupancy meets the stationarity condition, then at least one computing unit is determined to be in a stable state. If the distribution characteristics indicate that resource usage does not meet the stationarity condition, at least one computing unit is determined to be in a debugging state.
[0135] Optionally, the distribution characteristics include variance, and the method also includes: If the variance is less than a preset first threshold, then the distribution characteristics indicate that the resource occupancy meets the stationarity condition. If the variance is greater than or equal to a preset first threshold, then the distribution characteristics indicate that the resource occupancy does not meet the stationarity condition.
[0136] In this embodiment, based on multiple resource occupancy data corresponding to the first occupancy information, the distribution characteristics of at least one computing unit's resources when they are occupied are determined, enabling an overall distribution characteristic analysis of at least one computing unit. Based on these distribution characteristics, it is then determined whether the resource occupancy status is stable. Therefore, based on whether the resource occupancy status is stable, corresponding adjustments are performed, accurately distinguishing between normal stable operation and load fluctuation conditions. This achieves intelligent and accurate identification of the operating status, facilitating targeted operation and maintenance management and anomaly handling.
[0137] In addition to entering debug mode when at least one computing unit is in an unstable state, the decision to enter debug mode can also be determined by monitoring whether the first occupancy information meets the emergency alarm conditions. Specifically, after collecting multiple first occupancy information entries for at least one computing unit, the process also includes: If the first occupancy information collected in the most recent M times meets the emergency alarm conditions, at least one computing unit is triggered to enter debug mode. M is an integer greater than or equal to 1.
[0138] Optionally, the first occupancy information includes: the resource utilization rate of specified hardware, and the method further includes: If the resource utilization rate of the specified hardware in the first occupancy information collected in the most recent M times is greater than the preset second threshold, then the first occupancy information is determined to meet the emergency alarm conditions.
[0139] Alternatively, if the variance of a specified hardware in the most recent M collected occupancy data is greater than a preset third threshold, then the first occupancy data is determined to meet the emergency alarm conditions. The variance of the specified hardware can be calculated based on the resource utilization rate of the specified hardware.
[0140] In this embodiment, the corresponding computing unit is only triggered to switch to debug mode when the resource occupancy information acquired in the most recent M collections meets the alarm judgment conditions. This can effectively monitor the resource adjustment needs caused by abnormal data fluctuations, thereby initiating resource adjustments, improving the accuracy of state switching judgment, timely identifying the continuous abnormal operation of the computing unit and automatically switching to debug mode, facilitating timely resolution of changes in computing power demand caused by load fluctuations, and ensuring overall operational stability and reliability.
[0141] The above solutions provide an automatic model tuning scheme. To provide a more comprehensive model tuning solution, it may also include: If a user triggers a stable state, the preset load prediction model is trained to obtain the trained load prediction model. Alternatively, if a user triggers a debug state, the system can use the trained load prediction model to predict the second occupancy information of at least one computing unit at a preset future time, and adjust the hardware resources corresponding to at least one computing unit based on the second occupancy information.
[0142] A state selection interface can be provided to offer users controls for either a stable state or a debug state for selection. Specifically, the interface detects when the user performs a trigger operation on a control in the stable state to determine if the stable state is activated, and detects when the user performs a trigger operation on a control in the debug state to determine if the debug state is activated.
[0143] In this embodiment, users can directly trigger entry into a stable or debug state. In the stable state, the load prediction model training and iteration optimization are automatically completed. In the debug state, the trained model is directly invoked to accurately predict future resource usage of the computing unit, and hardware resource configuration is dynamically adjusted based on the predicted usage information. A manual intervention solution is provided, which, in addition to providing autonomous learning and optimization, also supports users explicitly specifying the operating state, granting administrators complete control during special periods (such as major promotional events or version releases), achieving a perfect combination of automated operation and maintenance and manual intervention.
[0144] Taking the ARIMA model as an example of load prediction model, the technical solutions of the embodiments of this application are described in detail.
[0145] like Figure 5 The diagram shown is another flowchart of a resource configuration method provided in this application embodiment. This resource configuration method can be applied to the controller of a server cluster, which may further include at least one computing unit. The method may include: S501. Initialize the window duration of the time window.
[0146] S502. Initialize the model parameters of the ARIMA model.
[0147] S503. Based on the time window, collect multiple first occupancy information of at least one computing unit.
[0148] S504. Collect historical data from at least one computing unit.
[0149] S505 If a user triggers a stable state, then execute S509.
[0150] S506 If user-triggered debug mode is detected, then execute S510.
[0151] S507. Based on multiple first occupancy information, determine the distribution characteristics of at least one computing unit when its resources are occupied.
[0152] S508. Based on the distribution characteristics, determine whether the stationarity condition is met. If yes, execute S509; otherwise, execute S510.
[0153] S509. Train the preset load prediction model to obtain the trained load prediction model.
[0154] S510. Using the load prediction model obtained from training, predict the second occupancy information of at least one computing unit at a preset future time.
[0155] S511. Adjust the hardware resources corresponding to at least one computing unit according to the second occupancy information, whereby the second occupancy information refers to the expected usage of the overall hardware resources of at least one computing unit at a preset future time.
[0156] The application scenarios of the embodiments of this application will be illustrated below with examples.
[0157] A billing and settlement service runs on a cloud platform of a certain organization. This service can be used to settle fees for all customer accounts at the end of the month, generate bills, calculate interest, and send reports. Assume that this service is deployed in a Kubernetes cluster using container deployment, containing 5 container groups (Pods). A container group is the smallest scheduling and running unit in the cluster, and is one of the computing units involved in the embodiments of this application.
[0158] 1. In the early stages of modeling, model training can be started directly when the user triggers a stable state.
[0159] Within a complete billing cycle (e.g., 30 days), you can first focus on collecting historical data from the above 5 Pods to use as training data. For example, you can collect and store the CPU utilization of all Pods at the minute-by-minute granularity.
[0160] By using historical data collected during the settlement cycle, a load prediction model, such as the ARIMA model, is trained to obtain the trained load prediction model.
[0161] In this way, after training the load prediction model over several complete settlement cycles, a relatively stable load prediction model can be obtained.
[0162] 2. Once a stable load forecasting model is obtained, you can switch to automatic resource adjustment.
[0163] Within a preset time window, collect multiple initial occupancy information for at least one computing unit, such as CPU utilization and MEM requirements.
[0164] For example, on the morning of the 27th, if multiple first occupancy information points indicate that at least one computing unit is in a debugging state, a trained load prediction model is used to predict the second occupancy information of at least one computing unit at a preset future time. The hardware resources corresponding to at least one computing unit are then adjusted based on the second occupancy information.
[0165] The second predicted occupancy information is as follows: MEM demand surged on the evening of the 27th and peaked on the 29th. The predicted hardware resource adjustment is as follows: at 4:00 PM on the 27th, the MEM limit for 5 Pods was increased from the normal 2000m to the peak requirement of 8000m.
[0166] In this situation, to avoid insufficient resource preparation due to a sudden increase in load, the MEM limit (memory limit) of the 5 Pods can be increased to 8000m at 4:00 pm on the 27th.
[0167] For example, if the settlement period ends on the 30th of each month, then on the night of the 1st of the following month, the second occupancy information predicted by the load forecasting model is: the load will drop to the normal level after the 2nd. Therefore, the hardware resource adjustment can be predicted as follows: in the early morning of the 4th, the MEM limit of 5 Pods will be reduced from the peak of 8000m to the normal period of 2000m, and the CPU configuration of the virtual machine will be reduced from 64GB to 16GB, achieving seamless scaling down and saving hardware resources.
[0168] 3. In the event of a sudden surge in abnormal traffic, hardware resource adjustments can be performed directly. If the first occupancy information collected in the most recent M times meets the emergency alarm conditions, at least one computing unit is triggered to enter debug mode. That is, resource adjustment is performed directly using the trained load prediction model.
[0169] For example, due to the quarterly financial release, there was an unexpected settlement peak in the middle of the month (around the 15th), which is the first occupancy information collected this time that triggered the emergency alarm condition. For example, due to insufficient current limit, the Pod Mem utilization rate instantly reached 95%, triggering an emergency alarm on the controller, which can trigger at least one computing unit to enter debug mode.
[0170] like Figure 6 The diagram shown is a structural schematic of a resource configuration device provided in an embodiment of this application. This resource configuration device can be configured on the controller of a server cluster. The server cluster includes at least one computing unit. The resource configuration device 600 includes: The information acquisition unit 601 is used to acquire multiple first occupancy information of at least one computing unit, and each first occupancy information is used to represent the overall hardware resource usage of at least one computing unit at the corresponding acquisition time.
[0171] The model training unit 602 is used to train a preset load prediction model based on multiple first occupancy information to obtain the trained load prediction model.
[0172] The resource prediction unit 603 is used to predict the second occupancy information of at least one computing unit at a preset future time by using a load prediction model obtained through training, when it is determined that at least one computing unit is in a debugging state based on multiple first occupancy information, and to adjust the hardware resources corresponding to at least one computing unit according to the second occupancy information. The second occupancy information refers to the expected usage of the overall hardware resources of at least one computing unit at the preset future time.
[0173] As one embodiment, the model training unit includes: The data acquisition module is used to acquire historical data of at least one computing unit. The historical data includes multiple training samples obtained by sampling at least one computing unit multiple times within a sliding window. The training samples include feature data and label data. The feature data includes at least one historical first occupancy information, and the label data includes the actual occupancy information corresponding to at least one historical first occupancy information. The parameter determination module is used to determine at least one set of hyperparameters for a preset load prediction model based on historical data. The parameter learning module is used to determine the learnable model parameters in the preset load prediction model for each set of hyperparameters using historical data. The parameter selection module is used to determine the effect of each set of hyperparameters on the load prediction model based on the model parameters corresponding to each set of hyperparameters, and to determine the set of hyperparameters with the highest effect as the target hyperparameters of the load prediction model.
[0174] As another embodiment, the parameter determination module includes: The order determination submodule is used to verify the stationarity of historical data and obtain the difference order d; The order is implemented using a submodule, which samples the values of the order of the preset moving average term q and the order of the autoregressive term p to obtain at least one pair of associated orders (p, d, q). The parameter determination submodule is used to determine the difference order and each pair of associated orders as a set of hyperparameters to obtain at least one set of hyperparameters.
[0175] As another embodiment, the parameter learning module is specifically used to: traverse each group of hyperparameters, and for the current group of hyperparameters, combine historical data and use the maximum likelihood estimation algorithm to fit the load prediction model to obtain the learnable model parameters in the load prediction model.
[0176] As another embodiment, the parameter selection module is specifically used for: Based on the model parameters corresponding to each set of hyperparameters, determine the maximum likelihood value corresponding to each set of hyperparameters; based on the preset Akaike Information Criterion, combine the current order and the maximum likelihood value corresponding to the current order to calculate the AIC value of the current order; determine the AIC value of each set of hyperparameters as the effect of each set of hyperparameters in the load prediction model; based on the AIC value corresponding to each set of hyperparameters, select the order with the smallest AIC value as the target hyperparameters.
[0177] As another embodiment, the resource prediction unit is specifically used for: Obtain the first occupancy information from the most recently collected data; based on the first occupancy information from the most recently collected data and the trained load prediction model, predict the second occupancy information of at least one computing unit at a preset future time.
[0178] As yet another embodiment, it also includes: The distribution analysis unit is used to determine the distribution characteristics of the resources of at least one computing unit when they are occupied, based on multiple first occupancy information.
[0179] The state determination unit is used to determine that at least one computing unit is in a stable state when the distribution characteristics indicate that the resource occupancy meets the stationarity condition; and to determine that at least one computing unit is in a debugging state when the distribution characteristics indicate that the resource occupancy does not meet the stationarity condition.
[0180] As yet another embodiment, it also includes: The first triggering unit is used to train a preset load prediction model when a user triggers a stable state, and obtain the trained load prediction model. Alternatively, the second triggering unit is used to, when the user triggers the debugging state, use the trained load prediction model to predict the second occupancy information of at least one computing unit at a preset future time, and adjust the hardware resources corresponding to at least one computing unit according to the second occupancy information. Alternatively, the third triggering unit is used to trigger at least one computing unit to enter the debugging state when the first occupancy information collected in the most recent M times meets the emergency alarm conditions, where M is an integer greater than or equal to 1.
[0181] As another embodiment, the resource prediction unit is specifically used for: Based on the preset security buffer coefficient and the reserved value of the management domain, combined with the second occupancy information, the target configuration is determined; according to the target configuration, the hardware resources of at least one computing unit are adjusted.
[0182] In the embodiments of this application, Figure 6The device shown can be a controller chip or a chip system, such as a system on chip (SoC) or a baseboard management controller (BMC). Figure 6 The device shown can also be located on any node in the server cluster, such as the central node.
[0183] Furthermore, this application embodiment also provides a schematic diagram of a node structure, which includes at least a memory 701 and a controller 702. The memory 701 is used to store computer programs. The controller 702 is used to execute the computer programs to implement the resource allocation method of any of the above embodiments.
[0184] In addition, both memory 701 and controller 702 are electrically connected to bus 703.
[0185] Furthermore, embodiments of this application also provide a computer-readable storage medium for storing a computer program. When executed by a controller, this computer program implements the storage space management method based on an etcd cluster as described in any of the preceding embodiments of this application.
[0186] Computer-readable storage media include, but are not limited to, volatile storage media and / or non-volatile storage media. Volatile storage media may include, for example, random access storage media (RAM) and / or cache storage media. Non-volatile storage media may include, for example, read-only storage media (ROM), hard disks, flash memory, optical disks, magnetic disks, etc.
[0187] This application also provides a computer program product that, when executed by a programmable logic device, implements the storage space management method based on the etcd cluster described in any of the preceding embodiments of this application.
[0188] The basic principles of the embodiments of this application have been described above with reference to specific examples. However, it should be noted that the advantages, benefits, and effects mentioned in the embodiments of this application are merely examples and not limitations, and should not be considered as essential features of each embodiment of this application. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the embodiments of this application from necessarily employing the aforementioned specific details.
[0189] The block diagrams of devices, apparatuses, devices, and systems involved in the embodiments of this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context explicitly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0190] Additionally, as used herein, the "or" used in a list of items beginning with "at least one" indicates a separate list, such that a list of, for example, "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not imply that the described example is preferred or better than other examples.
[0191] It should also be noted that in the systems and methods of this application embodiment, each component or step can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions of the embodiments of this application.
[0192] Various changes, substitutions, and modifications can be made to the technology herein without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of the embodiments of this application is not limited to the specific aspects of the processes, machines, manufactures, events, means, methods, and actions described above. Currently existing or later-developed processes, machines, manufactures, events, means, methods, or actions that perform substantially the same function or achieve substantially the same result as the corresponding aspects herein can be utilized. Therefore, the appended claims include such processes, machines, manufactures, events, means, methods, or actions within their scope.
[0193] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use embodiments of this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of embodiments of this application. Therefore, embodiments of this application are not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0194] The above description has been given for illustrative and descriptive purposes. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.
Claims
1. A resource allocation method, characterized in that, A controller applied to a server cluster, the server cluster including at least one computing unit, the method comprising: Multiple first occupancy information of the at least one computing unit are collected, and each first occupancy information is used to represent the overall hardware resource usage of the at least one computing unit at the corresponding collection time. If, based on the plurality of first occupancy information, it is determined that at least one computing unit is in a stable state, a preset load prediction model is trained to obtain the trained load prediction model. When it is determined that the at least one computing unit is in a debugging state based on the plurality of first occupancy information, the load prediction model obtained by training is used to predict the second occupancy information of the at least one computing unit at a preset future time, and the hardware resources corresponding to the at least one computing unit are adjusted according to the second occupancy information. The second occupancy information refers to the expected usage of the overall hardware resources of the at least one computing unit at the preset future time.
2. The method according to claim 1, characterized in that, The step of training a preset load prediction model to obtain the trained load prediction model includes: Collect historical data of the at least one computing unit. The historical data includes multiple training samples obtained by sampling the at least one computing unit multiple times within a sliding window. The training samples include feature data and label data. The feature data includes at least one historical first occupancy information. The label data includes the actual occupancy information corresponding to the at least one historical first occupancy information. Based on the historical data, at least one set of hyperparameters for the preset load prediction model is determined; For each set of hyperparameters, the historical data is used to determine the learnable model parameters in the preset load prediction model; Based on the model parameters corresponding to each set of hyperparameters, the effect of each set of hyperparameters on the load prediction model is determined, and the set of hyperparameters with the highest effect is determined as the target hyperparameters of the load prediction model.
3. The method according to claim 2, characterized in that, The determination of at least one set of hyperparameters for the preset load prediction model based on the historical data includes: The stationarity of the historical data is verified to obtain the difference order d; Based on the value ranges of the order of the preset moving average term q and the order of the autoregressive term p, sampling is performed to obtain at least one pair of correlation orders (p, d, q). The difference order and each pair of correlation orders are determined as a set of hyperparameters to obtain the at least one set of hyperparameters.
4. The method according to claim 2, characterized in that, For each set of hyperparameters, using the historical data, the learnable model parameters in the preset load prediction model are determined, including: Iterate through each group of hyperparameters. For the current group of hyperparameters, combine the historical data and use the maximum likelihood estimation algorithm to fit the load prediction model to obtain the learnable model parameters in the load prediction model.
5. The method according to claim 4, characterized in that, The determination of the effectiveness of each set of hyperparameters in the load prediction model based on the model parameters corresponding to each set of hyperparameters includes: Based on the model parameters corresponding to each set of hyperparameters, determine the maximum likelihood value corresponding to each set of hyperparameters; Based on the preset Akaike information criterion, and combining the current group order and the maximum likelihood value corresponding to the current group order, the AIC value of the current group order is calculated; The AIC value of each hyperparameter group is determined as the effect of each hyperparameter group on the load prediction model. The step of determining the set of hyperparameters with the highest performance as the target hyperparameters of the load prediction model includes: Based on the AIC value corresponding to each set of hyperparameters, select the order with the smallest AIC value as the target hyperparameter.
6. The method according to any one of claims 1-5, characterized in that, The method of using the load prediction model obtained through training to predict the second occupancy information of the at least one computing unit at a preset future time includes: Get the first occupancy information from the most recently collected data; Based on the most recently collected first occupancy information and the trained load prediction model, predict the second occupancy information of the at least one computing unit at a preset future time.
7. The method according to claim 1, characterized in that, The first occupancy information includes multiple components, and the method further includes: Based on the plurality of first occupancy information, determine the distribution characteristics of the resources of the at least one computing unit when they are occupied; If the distribution characteristics indicate that the resource occupancy meets the stationarity condition, it is determined that the at least one computing unit is in a stable state; If the distribution characteristics indicate that the resource occupancy does not meet the stability condition, then the at least one computing unit is determined to be in a debugging state.
8. The method according to claim 1, characterized in that, Also includes: If a user triggers a stable state, the preset load prediction model is trained to obtain the trained load prediction model. Alternatively, if a user triggers a debugging state, the load prediction model obtained from the training is used to predict the second occupancy information of the at least one computing unit at a preset future time, and the hardware resources corresponding to the at least one computing unit are adjusted according to the second occupancy information. Alternatively, if the first occupancy information collected in the most recent M times meets the emergency alarm conditions, the at least one computing unit is triggered to enter the debugging state, where M is an integer greater than or equal to 1.
9. The method according to claim 1, characterized in that, The step of adjusting the hardware resources corresponding to the at least one computing unit according to the second occupancy information includes: Based on the preset security buffer coefficient and the reserved value of the management domain, combined with the second occupancy information, the target configuration is determined; Adjust the hardware resources of the at least one computing unit according to the target configuration.
10. A server cluster, characterized in that, include: At least one computing unit and a controller, the controller being used to execute any of the above-described resource configuration methods.