Cloud host resource recovery method and device, equipment and storage medium
By comprehensively evaluating the idle rate of cloud hosts and using trained models for cloud resource recycling, the problem of low recycling accuracy in the existing technology is solved, and more efficient and accurate resource management is achieved.
Patent Information
- Application Number
- CN202411708609.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-11
AI Technical Summary
The existing cloud resource recycling methods have low accuracy in recycling, which can easily lead to misjudgment, business interruption or performance degradation.
By obtaining the host status value, monitoring data and historical boot data of the cloud host, the trained cloud host status classification model and idle rate prediction model are called, the idle rate of the cloud host is comprehensively evaluated, and resource recycling is carried out according to the preset threshold.
It improves the accuracy of cloud resource recycling, reduces the risk of misjudgment, improves resource utilization, promotes load balancing, and enhances the stability and reliability of the system.
Smart Images

Figure CN119597476A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing, and in particular to a cloud host resource recovery method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] The amount of applications and data hosted on cloud computing platforms is huge, and users have different requirements for resources. Sometimes, some applications may crash or become unstable due to insufficient resources. Therefore, timely recycling of unused resources and effective management of occupied resources have become an important task for cloud computing platforms.
[0003] At present, resource recycling and cleaning methods usually include: real-time monitoring of resource usage through monitoring systems, automatic recycling of resources when resources have not been used for a long time; regular scanning of storage space, cleaning of expired data, and release of space resources, etc. However, during the detection process, there may be a risk of misjudgment of resources, resulting in incorrect recycling, causing business interruption or performance degradation.
[0004] It can be seen that the recovery accuracy of existing cloud resource recovery methods is not high. Summary of the invention
[0005] Based on this, it is necessary to provide a cloud host resource recovery method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the accuracy of cloud resource recovery in response to the above technical problems.
[0006] In a first aspect, the present application provides a cloud host resource recovery method, comprising:
[0007] Obtain the host status value, monitoring data, and historical startup data of each cloud host;
[0008] Taking the monitoring data of each cloud host as input, calling the trained cloud host status classification model, and obtaining the resource usage status category corresponding to each cloud host. The trained cloud host status classification model is trained based on the historical monitoring data of multiple cloud hosts with resource usage status category labels. The resource usage status categories include usage status and abandoned status.
[0009] For each cloud host, based on the historical startup data of the cloud host, determine the startup time distribution value of the cloud host in different historical time periods;
[0010] Determine the idle rate prediction value of the cloud host based on the host status value of the cloud host, the resource usage status category of the cloud host, and the power-on time distribution value of the cloud host;
[0011] Cloud host resources are reclaimed based on the idle rate prediction value of each cloud host.
[0012] In one embodiment, cloud host resource recovery is performed based on the idle rate prediction value of each cloud host, including:
[0013] For each cloud host, if the idle rate prediction value of the cloud host is greater than or equal to the preset idle rate threshold, the cloud host is determined to be in an idle state, and the host dependency relationship of the cloud host is obtained;
[0014] When it is determined that the cloud host has no dependency relationship with other cloud hosts according to the host dependency relationship, the resources of the cloud host are reclaimed.
[0015] In one embodiment, determining the idle rate prediction value of the cloud host based on the host status value of the cloud host, the resource usage status category of the cloud host, and the boot time distribution value of the cloud host includes:
[0016] Taking the host status value of the cloud host, the resource usage status category of the cloud host, and the power-on time distribution value of the cloud host as input, the trained idle rate prediction model is called to determine the idle rate prediction value of the cloud host;
[0017] Among them, the idle rate prediction model is a polynomial regression model.
[0018] In one embodiment, the monitoring data includes monitoring time series data; the monitoring data of each cloud host is used as input, and a trained cloud host status classification model is called to obtain a resource usage status category corresponding to each cloud host, including:
[0019] Taking the monitoring time series data of each cloud host as input, the trained cloud host status classification model is called to obtain the resource usage status category corresponding to each cloud host. The cloud host status classification model is obtained by training the long short-term memory network based on the historical monitoring data of multiple cloud hosts carrying resource usage status category labels.
[0020] In one embodiment, obtaining the host status value of each cloud host includes:
[0021] Get the health status data of each cloud host;
[0022] For each cloud host, a host status value of the cloud host is determined based on health status data of the cloud host, where the health status data includes a normal status and an abnormal status.
[0023] In one embodiment, before taking the monitoring data of each cloud host as input and calling the trained cloud host status classification model to obtain the resource usage status category corresponding to each cloud host, the cloud host resource recovery method further includes:
[0024] Pre-process the monitoring data of each cloud host;
[0025] Normalize and standardize the pre-processed monitoring data of each cloud host to obtain the target monitoring data of each cloud host;
[0026] Taking the monitoring data of each cloud host as input, the trained cloud host status classification model is called to obtain the resource usage status category corresponding to each cloud host, including:
[0027] Taking the target monitoring data of each cloud host as input, the trained cloud host status classification model is called to obtain the resource usage status category corresponding to each cloud host.
[0028] In one embodiment, based on historical startup data of the cloud host, determining the startup time distribution value of the cloud host in different historical time periods includes:
[0029] Based on the historical startup data of the cloud host, determine the percentage of the cloud host startup time in different historical time periods;
[0030] Based on the proportion of boot time in each historical time period and the corresponding weight, the boot time distribution value of the cloud host is obtained.
[0031] In a second aspect, the present application also provides a cloud host resource recovery device, comprising:
[0032] The data acquisition module is used to obtain the host status value, monitoring data and historical startup data of each cloud host;
[0033] The resource usage status category determination module is used to use the monitoring data of each cloud host as input, call the trained cloud host status classification model, and obtain the resource usage status category corresponding to each cloud host. The trained cloud host status classification model is trained based on the historical monitoring data of multiple cloud hosts carrying resource usage status category labels. The resource usage status categories include usage status and abandoned status.
[0034] A boot time distribution value determination module is used to determine the boot time distribution value of each cloud host in different historical time periods based on the historical boot data of the cloud host;
[0035] An idle rate prediction module, used to determine an idle rate prediction value of a cloud host based on a host status value of the cloud host, a resource usage status category of the cloud host, and a power-on time distribution value of the cloud host;
[0036] The resource recovery module is used to recover cloud host resources based on the predicted idle rate value of each cloud host.
[0037] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in any one of the above-mentioned cloud host resource recovery method embodiments are implemented.
[0038] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any one of the above-mentioned cloud host resource recovery method embodiments are implemented.
[0039] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps in any one of the above-mentioned cloud host resource recovery method embodiments.
[0040] The above-mentioned cloud host resource recovery method, device, computer equipment, computer-readable storage medium and computer program product firstly obtain the cloud host status value, monitoring data and historical startup data to evaluate the idle rate of the cloud host. Secondly, the historical monitoring data of the cloud host is input into the trained classifier to evaluate the category of the resource usage status of the cloud host. Then, according to the historical startup data of the cloud host, the distribution value of the startup time in different time periods with the host is determined. Thus, the idle rate of the cloud host is comprehensively evaluated from multiple state dimensions of the host status value, resource usage status category and startup time distribution value of the cloud host to obtain the idle rate prediction value of the cloud host. Finally, the cloud host resource recovery is carried out based on the idle rate prediction value, which reduces the risk of misjudgment of the recovered resources and improves the accuracy of the resource recovery of the cloud host. At the same time, the resource utilization rate of the cloud host is improved, which is conducive to load balancing between multiple cloud hosts, thereby helping to improve the stability and reliability of the entire system. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A diagram of an application environment of a cloud host resource recovery method in one embodiment;
[0043] Figure 2 A schematic diagram of a process of a cloud host resource recovery method in one embodiment;
[0044] Figure 3 A schematic diagram of a process of a cloud host resource recovery method in another embodiment;
[0045] Figure 4 A schematic diagram of a process of a cloud host resource recovery method in another embodiment;
[0046] Figure 5 A schematic diagram of the dependency relationship of a cloud host in one embodiment;
[0047] Figure 6 A schematic diagram of a process of a cloud host resource recovery method in yet another embodiment;
[0048] Figure 7 is a structural block diagram of a cloud host resource recovery device in one embodiment;
[0049] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] The cloud host resource recovery method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers.
[0052] Specifically, the operator may upload the collected host status value, monitoring data and historical startup data of each cloud host to the server 104 through the terminal 102, and then send a cloud host resource recovery message to the server 104 through the terminal 102. The server 104 obtains the host status value, monitoring data and historical startup data of each cloud host. Secondly, the monitoring data of each cloud host is used as input, and the trained cloud host status classification model is called to obtain the resource usage status category corresponding to each cloud host. The trained cloud host status classification model is trained based on the historical monitoring data of multiple cloud hosts carrying resource usage status category labels. The resource usage status category includes a usage status and an abandoned status. Then, for each cloud host, based on the historical startup data of the cloud host, the startup time distribution value of the cloud host in different historical time periods is determined. Based on the host status value of the cloud host, the resource usage status category of the cloud host, and the startup time distribution value of the cloud host, the idle rate prediction value of the cloud host is determined. Finally, the cloud host resources are recovered based on the idle rate prediction value of each cloud host.
[0053] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The portable wearable devices may be smart watches and smart bracelets, etc. The server 104 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0054] In an exemplary embodiment, Figure 2 As shown, a cloud host resource recovery method is provided, which is applied to Figure 1 The server 104 in the example is used for explanation, and includes the following S100 to S500. Among them:
[0055] S100, obtaining the host status value, monitoring data and historical startup data of each cloud host.
[0056] Among them, a cloud host is a virtualized host based on cloud computing technology. Through virtualization technology, large-scale physical server cluster resources are dynamically allocated to multiple independent virtual hosts. Each cloud host has independent operating system, memory, storage and bandwidth resources. A cloud host can have one or more host machines. The host status value of the cloud host is used to characterize the actual operating status of the cloud host. For example, the actual operating status may include normal operating status, maintenance status and fault status. Monitoring data may include CPU utilization, memory utilization, disk occupancy and network traffic. Historical startup data may include the startup time and shutdown time of the cloud host in the historical time period.
[0057] In actual applications, the host status value of a cloud host can be obtained by first obtaining the running status of the cloud host through the cloud management system, assigning different values to different states for distinction, and obtaining the host status value of each cloud host. The cloud monitoring console can be used to obtain the periodic (e.g., 10-minute) monitoring data of each cloud host and the historical startup data within a period of time (e.g., 90 days).
[0058] S200, taking the monitoring data of each cloud host as input, calls the trained cloud host status classification model to obtain the resource usage status category corresponding to each cloud host. The trained cloud host status classification model is trained based on the historical monitoring data of multiple cloud hosts carrying resource usage status category labels. The resource usage status categories include usage status and abandoned status.
[0059] The resource usage status category is used to characterize the resource usage on the cloud host.
[0060] In practical applications, the historical monitoring data of each cloud host can be obtained first, processed into multiple historical monitoring sequence data according to the historical monitoring time, and each historical monitoring sequence data can be labeled with a resource usage status category label. A classification model is selected to build an initial cloud host status classification model, such as a regression model or a recurrent neural network, etc. The parameters of the initial cloud host status classification model are iteratively updated through training with the labeled historical monitoring sequence data to obtain a trained cloud host status classification model. After obtaining the trained cloud host status classification model, the monitoring data of each cloud host is used as input to call the trained cloud host status classification model. The model outputs the prediction parameters of the resource usage status category corresponding to each cloud host, ranging from [0-1], where 1 represents the abandoned state and 0 represents the used state, and the resource usage status category of each cloud host is obtained.
[0061] S300, for each cloud host, based on historical startup data of the cloud host, determining a startup duration distribution value of the cloud host in different historical time periods.
[0062] The cloud host startup time distribution value is used to characterize the host usage of the cloud host in a historical period of time.
[0063] In actual applications, after obtaining the historical startup data of each cloud host, it can be divided into historical startup data of different historical time periods, and the startup duration corresponding to different historical time periods can be determined. The startup duration distribution value of the cloud host can be obtained based on the startup duration corresponding to multiple historical time periods.
[0064] S400, determining a predicted idle rate value of the cloud host based on a host status value of the cloud host, a resource usage status category of the cloud host, and a power-on duration distribution value of the cloud host.
[0065] In actual applications, the host status value, resource usage status category, boot time distribution value, and corresponding idle rate prediction value of other cloud hosts can be obtained in advance. The idle rate prediction value can be set according to experience to build a training set. Use the constructed initial idle rate prediction model to train the initial idle rate prediction model through the training set to obtain the trained idle rate prediction model. Take the host status value of the cloud host, the resource usage status category of the cloud host, and the boot time distribution value of the cloud host as input, call the trained idle rate prediction model, and obtain the idle rate prediction value of each cloud host.
[0066] S500: reclaim cloud host resources based on the predicted idle rate value of each cloud host.
[0067] In actual applications, after obtaining the idle rate prediction value of each cloud host, an idle rate threshold can be set. If the idle rate prediction value of the cloud host is not less than the idle rate threshold, it indicates that resources of the cloud host can be reclaimed, thereby performing cloud host resource reclaim based on the idle rate prediction value of each cloud host and the idle rate threshold.
[0068] In the above cloud host resource recovery method, firstly, the cloud host status value, monitoring data and historical startup data are obtained to evaluate the idle rate of the cloud host. Secondly, the cloud host's historical monitoring data is input into the trained classifier to evaluate the category of the cloud host's resource usage status. Then, according to the cloud host's historical startup data, the startup time distribution value of the host in different time periods is determined. Thus, the idle rate of the cloud host is comprehensively evaluated from multiple state dimensions of the cloud host's host status value, resource usage status category, and startup time distribution value to obtain the idle rate prediction value of the cloud host. Finally, the cloud host resources are recovered based on the idle rate prediction value, which reduces the risk of misjudgment of the recovered resources and improves the accuracy of the cloud host's resource recovery. At the same time, the cloud host resource utilization rate is improved, which is conducive to load balancing between multiple cloud hosts, thereby helping to improve the stability and reliability of the entire system.
[0069] In order to improve the accuracy of cloud host resource recovery, in an exemplary embodiment, Figure 3 As shown, S500 includes S520 to S540. Among them:
[0070] S520: For each cloud host, if the idle rate prediction value of the cloud host is greater than or equal to a preset idle rate threshold, it is determined that the cloud host is in an idle state, and the host dependency relationship of the cloud host is obtained.
[0071] The host dependency is used to characterize the service dependency between a cloud host and other cloud hosts.
[0072] In actual applications, after obtaining the idle rate prediction value of each cloud host, for each cloud host, the relationship between the idle rate prediction value and the preset idle rate threshold (such as 80%) is monitored. If the idle rate prediction value is greater than or equal to the idle rate threshold, it is preliminarily determined that the cloud host is in an idle state. In order to prevent resource recovery from affecting the services of other cloud hosts, it is necessary to further check whether the cloud host has resource references or service dependencies with other cloud hosts, and determine the host dependency relationship of the cloud host. Exemplarily, it can be through obtaining the network configuration of the cloud host, such as routing tables and security group rules, to determine whether the cloud host is a transit station or gateway for network traffic, obtaining the configuration file of the cloud host's application to find out whether there are resource references or dependencies with other cloud hosts, thereby determining other cloud hosts that have resource or dependency relationships with the cloud host, and obtaining the host dependency relationship of the cloud host.
[0073] S540: When it is determined according to the host dependency relationship that the cloud host has no dependency relationship with other cloud hosts, reclaim the resources of the cloud host.
[0074] In actual applications, after the dependency of a cloud host is obtained, if the cloud host has no dependency with other cloud hosts, the resources of the cloud host are recycled.
[0075] If there is a dependency, it is also necessary to determine the idle state of the cloud host that is dependent on the cloud host. If the cloud host that is dependent on the cloud host is also idle, resource recycling can be performed. Figure 4 As shown, A, B, and C are dependent cloud hosts. After being determined to be idle cloud hosts, their subordinate hosts need to be analyzed again. If all their child nodes are idle cloud hosts, the parent node cloud host can be reclaimed for resources, otherwise it needs to be retained.
[0076] In this embodiment, an idle cloud host is preliminarily determined based on the idle rate prediction value of the cloud host. After the cloud host is preliminarily determined to be in an idle state, the host dependency of the cloud host is further checked, and resource recovery is performed in combination with the idle rate prediction value and the host dependency, thereby improving the accuracy of resource recovery, reducing the possibility of the recovery behavior affecting other cloud host services, and improving the stability of cloud services.
[0077] In order to improve the prediction accuracy of the idle rate of the cloud host, the prediction is performed from multiple status dimensions of the cloud host. In an exemplary embodiment, Figure 5 As shown, S400 also includes S420. Among them:
[0078] S420, taking the host status value of the cloud host, the resource usage status category of the cloud host, and the power-on time distribution value of the cloud host as input, calling the trained idle rate prediction model to determine the idle rate prediction value of the cloud host, wherein the idle rate prediction model is a polynomial regression model.
[0079] In practical applications, the host status values of other cloud hosts, the resource usage status categories of cloud hosts, the power-on time distribution values of cloud hosts, and the idle rates of cloud hosts can be obtained in advance. The relationship between the above parameters (host status values, resource usage status categories, and power-on time distribution values) and the idle rates are analyzed by polynomial regression to obtain a polynomial regression model as an idle rate prediction model. The model parameters are updated through training iterations to obtain a trained idle rate prediction model. The host status values of cloud hosts, the resource usage status categories of cloud hosts, and the power-on time distribution values of cloud hosts are used as inputs to call the trained idle rate prediction model, and the idle rate prediction value of the cloud hosts is obtained as output.
[0080] In this embodiment, based on multiple parameters of the cloud host and the trained idle rate prediction model, the idle rate of the cloud host is comprehensively evaluated from multiple status dimensions of the cloud host to obtain a predicted value of the idle rate of the cloud host, which is beneficial to reducing the risk of misjudgment of resource recovery, thereby facilitating improving the accuracy of resource recovery of the cloud host.
[0081] In order to improve the accuracy of cloud host resource usage status classification, in an exemplary embodiment, the monitoring data includes monitoring time series data, and S200 includes S220. Among them:
[0082] S200, taking the monitoring time series data of each cloud host as input, calling the trained cloud host status classification model, and obtaining the resource usage status category corresponding to each cloud host. The cloud host status classification model is obtained by training the long short-term memory network based on the historical monitoring data of multiple cloud hosts carrying resource usage status category labels.
[0083] In practical applications, an initial cloud host status classification model can be constructed in advance based on a long short-term memory network (LSTM), and the historical monitoring time series data of each cloud host can be obtained. Each historical monitoring time series data is labeled with a resource usage status category label, and the labeled historical monitoring sequence data is divided into a training set and a test set. The initial cloud host status classification model is trained with the training set, and the classification error is determined according to the loss function. The parameters of the initial cloud host status classification model are iteratively updated according to the classification error until the classification error is less than the preset error threshold. The performance of the model is evaluated through the test set until the preset performance condition is met, and the trained cloud host status classification model is obtained. After the trained cloud host status classification model is obtained, the monitoring time series data of each cloud host is used as input, and the trained cloud host status classification model is called. The model outputs the prediction parameters of the resource usage status category corresponding to each cloud host, ranging from [0-1], where 1 represents the abandoned state and 0 represents the used state, and the resource usage status category of each cloud host is obtained.
[0084] In this embodiment, the cloud host status classification model obtained by training the long short-term memory network is used with historical monitoring data that carries resource usage status category labels. The resource usage status category of each cloud host is classified according to the monitoring time series data of the cloud host. On the one hand, the accuracy of status classification is improved. On the other hand, it is beneficial to improve the accuracy of evaluating the idle rate of the cloud host according to the resource usage status category of the cloud host, thereby helping to improve the accuracy of resource recovery.
[0085] In order to improve the accuracy of cloud host idle rate prediction, the host status of the cloud host can be analyzed according to the health status data of the cloud host. In an exemplary embodiment, obtaining the host status value of each cloud host includes S120 to S140. Among them:
[0086] S120: Obtain health status data of each cloud host.
[0087] S140, for each cloud host, determining a host status value of the cloud host based on health status data of the cloud host, where the health status data includes a normal status and an abnormal status.
[0088] Among them, the health status data is used to represent the actual status (normal status and abnormal status) of the cloud host, which can be determined based on the cloud management status data and underlying status data of the cloud host. The cloud management status data represents the status of the cloud host in the cloud management system, and the underlying status data represents the actual status of the cloud host.
[0089] In actual applications, it is possible that the cloud management status of the cloud host is inconsistent with the underlying status. In order to determine the actual status of the cloud host, the cloud management status data of the cloud host can be obtained through the cloud management system, and the underlying status data of the cloud host can be obtained through the monitoring platform of the physical server. The cloud management status and the underlying status are compared and synchronized to obtain the health status data of each cloud host. For example, if the cloud management status data indicates that the cloud host status is normal and the underlying status data indicates that the cloud host status is normal, the health status data of the cloud host is normal, and it is marked as If the cloud management status data indicates that the cloud host is in a normal state, and the underlying status data indicates that the cloud host is in an abnormal state (such as disconnection, failure, etc.), the health status data of the cloud host is in an abnormal state and is marked as If the cloud management status data indicates that the cloud host is in a normal state and the underlying status data indicates that the cloud host does not exist (such as it has been deleted), the health status data of the cloud host is abnormal and marked as .
[0090] Different weights are assigned to normal status and abnormal status, and the host status value of each cloud host is obtained:
[0091]
[0092] In the formula, The host status value of the cloud host.
[0093] In other embodiments, for For the corresponding cloud host, the relevant data is deleted from the cloud management system, and its monitoring data and historical startup data are not obtained for resource recovery analysis. and For the corresponding cloud host, obtain its monitoring data and historical startup data for analysis and resource recovery.
[0094] In this embodiment, the health status data of each cloud host is obtained to determine the host status value of the cloud host, thereby improving the accuracy of host status determination, thereby facilitating improving the accuracy of evaluating the idle rate of the cloud host based on the host status value.
[0095] In an exemplary embodiment, the monitoring data of each cloud host is used as input, and before the trained cloud host status classification model is called to obtain the resource usage status category corresponding to each cloud host, S160 to S180 are also included. Among them:
[0096] S160, pre-processing the monitoring data of each cloud host.
[0097] S180, normalizing and standardizing the pre-processed monitoring data of each cloud host to obtain target monitoring data of each cloud host.
[0098] In actual applications, the monitoring data of each cloud host is cleaned and preprocessed to remove abnormal values. After preprocessing the monitoring data of each cloud host, the CPU usage, memory usage, disk occupancy and network traffic in the monitoring data are converted into unified units and normalized. The normalization of CPU usage is used as an example to illustrate:
[0099]
[0100] Where x is the original CPU usage in the monitoring data, is the minimum CPU usage (e.g. 0%), The maximum CPU usage (e.g. 100%). will be in the interval [0, 1].
[0101] The network inflow and outflow in the monitoring data are processed using Z-score standardization. Take the standardization of network inflow as an example:
[0102]
[0103] In the formula, Z is the standardized network inflow, i.e., Z-score; X is the original network inflow in the monitoring data; is the mean of the original network inflow data set; is the standard deviation of the original network inflow data set.
[0104] After obtaining the normalized CPU usage, memory usage, disk occupancy and network traffic of each cloud host, as well as the standardized network inflow and network outflow, these data are respectively determined as the target monitoring data of each cloud host.
[0105] In a possible implementation, the monitoring data of each cloud host is used as input, and a trained cloud host status classification model is called to obtain the resource usage status category corresponding to each cloud host, including:
[0106] Taking the target monitoring data of each cloud host as input, the trained cloud host status classification model is called to obtain the resource usage status category corresponding to each cloud host.
[0107] In practical applications, after obtaining the target monitoring data of each cloud host, the target monitoring data can be processed into target monitoring time series data. Taking each target monitoring time series data as input, the trained cloud host status classification model is called. The model outputs the prediction parameters of the resource usage status category corresponding to each cloud host, thereby obtaining the resource usage status category corresponding to each cloud host.
[0108] In this embodiment, the monitoring data of each cloud host is normalized and standardized, and the pre-processed monitoring data is input into a trained host status classification model to determine the resource usage status category. This can eliminate the dimensional differences between different monitoring data and is beneficial to improving the classification accuracy of the model.
[0109] In order to improve the accuracy of the prediction of the idle rate of the cloud host, the usage of the cloud host in different historical time periods can be analyzed. In an exemplary embodiment, Figure 6 As shown, S300 includes S320 to S340. Among them:
[0110] S320: Determine, based on historical startup data of the cloud host, a startup duration ratio of the cloud host in different historical time periods.
[0111] S340: Based on the power-on duration ratios and corresponding weights in each historical time period, a power-on duration distribution value of the cloud host is obtained.
[0112] In actual applications, the cloud host's historical startup data within a historical time range (such as 90 days) can be obtained through a cloud management system or a cloud monitoring platform, and the historical time range can be divided into multiple different historical time periods. According to the cloud host's historical startup data, the actual running time of the cloud host's equipment in different historical time periods can be determined, thereby obtaining the percentage of the cloud host's startup time in different historical time periods. For example, taking the historical time range of 90 days as an example, it can be divided into 5 different historical time periods: within 90 historical days, within 60-90 historical days, within 30-60 historical days, within 15-30 historical days, and within 15 historical days. Calculate the percentage of startup time in different historical time periods: startup time percentage = actual running time of the device / total time of the historical time period.
[0113] After determining the proportion of cloud host power-on time in different historical time periods, weights can be assigned to the different historical time periods to characterize the relevance of the power-on time proportion data in different time periods to the prediction of cloud host idle rate. Taking the five historical time periods divided above as an example, the weights can be assigned in sequence as 0.2, 0.4, 0.6, 0.8, and 1. Therefore, according to the power-on time proportion in the historical time period and the corresponding weight, the power-on time distribution value of the cloud host is obtained as follows:
[0114]
[0115] In the formula, is the weight corresponding to the historical time period, and T is the proportion of power-on time.
[0116] In this embodiment, the power-on time distribution value of the cloud host is determined by the power-on time of the cloud host in different historical time periods and the weights corresponding to different time periods. This is conducive to analyzing the usage of the cloud host in different historical time periods based on the power-on time distribution value, thereby facilitating improving the accuracy of predicting the idle rate of the cloud host based on the power-on time distribution value.
[0117] In order to make a clearer description of the cloud host resource recovery method provided by the present application, a specific embodiment is described below, and the specific embodiment includes the following steps:
[0118] S1, obtaining health status data of each cloud host, and determining the host status value of each cloud host based on the health status data of the cloud host, wherein the health status data includes a normal state and an abnormal state.
[0119] S2, obtaining the power-on time of the cloud host in different historical time periods, and for each cloud host, determining the power-on time ratio of the cloud host in each historical time period, and obtaining the power-on time distribution value of the cloud host based on the power-on time ratio in each historical time period and the corresponding weight.
[0120] S3, acquiring monitoring data of each cloud host, preprocessing the monitoring data of each cloud host, normalizing and standardizing the preprocessed monitoring data of each cloud host, and obtaining target monitoring data of each cloud host.
[0121] S4, target monitoring data includes target monitoring time series data. The target monitoring time series data of each cloud host is used as input, and the trained cloud host status classification model is called to obtain the resource usage status category corresponding to each cloud host. The cloud host status classification model is obtained by training the long short-term memory network based on the historical monitoring data of multiple cloud hosts carrying resource usage status category labels. The resource usage status categories include usage status and abandoned status.
[0122] S5, taking the host status value of the cloud host, the resource usage status category of the cloud host, and the power-on time distribution value of the cloud host as input, calling the trained idle rate prediction model to determine the idle rate prediction value of the cloud host, wherein the idle rate prediction model is a polynomial regression model.
[0123] S6, for each cloud host, if the idle rate prediction value of the cloud host is greater than or equal to the preset idle rate threshold, the cloud host is determined to be in an idle state, the host dependency of the cloud host is obtained, and when it is determined that the cloud host has no dependency relationship with other cloud hosts based on the host dependency, the resources of the cloud host are reclaimed.
[0124] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0125] In an exemplary embodiment, Figure 7 As shown, a cloud host resource recovery device 600 is provided, comprising: a data acquisition module 610, a resource usage status category determination module 620, a boot time distribution value determination module 630, an idle rate prediction module 640 and a resource recovery module 650, wherein:
[0126] The data acquisition module 610 is used to obtain the host status value, monitoring data and historical startup data of each cloud host;
[0127] The resource usage status category determination module 620 is used to use the monitoring data of each cloud host as input, call the trained cloud host status classification model, and obtain the resource usage status category corresponding to each cloud host. The trained cloud host status classification model is trained based on the historical monitoring data of multiple cloud hosts carrying resource usage status category labels. The resource usage status categories include usage status and abandoned status.
[0128] A boot time distribution value determination module 630 is used to determine, for each cloud host, a boot time distribution value of the cloud host in different historical time periods based on the historical boot data of the cloud host;
[0129] An idle rate prediction module 640, configured to determine an idle rate prediction value of the cloud host based on a host status value of the cloud host, a resource usage status category of the cloud host, and a power-on time distribution value of the cloud host;
[0130] The resource recovery module 650 is used to recover cloud host resources based on the idle rate prediction value of each cloud host.
[0131] In an exemplary embodiment, the resource recovery module 650 is also used to determine that each cloud host is in an idle state if the idle rate prediction value of the cloud host is greater than or equal to a preset idle rate threshold, and obtain the host dependency of the cloud host; if it is determined that the cloud host has no dependency relationship with other cloud hosts based on the host dependency, the resources of the cloud host are recovered.
[0132] In an exemplary embodiment, the idle rate prediction module 640 is also used to call a trained idle rate prediction model to determine the idle rate prediction value of the cloud host by taking the host status value of the cloud host, the status category of the cloud host, and the power-on time distribution value of the cloud host as input; wherein the idle rate prediction model is a polynomial regression model.
[0133] In an exemplary embodiment, the resource usage status category determination module 620 is also used to call a trained cloud host status classification model using the monitoring time series data of each cloud host as input to obtain the resource usage status category corresponding to each cloud host. The cloud host status classification model is obtained by training a long short-term memory network based on historical monitoring data of multiple cloud hosts carrying resource usage status category labels.
[0134] In an exemplary embodiment, the cloud host resource recovery device also includes a host status value determination module 660, which is used to obtain the health status data of each cloud host; for each cloud host, the host status value of the cloud host is determined based on the health status data of the cloud host, and the health status data includes normal status and abnormal status.
[0135] In an exemplary embodiment, the cloud host resource recovery device also includes a data preprocessing module 670 for preprocessing the monitoring data of each cloud host; normalizing and standardizing the preprocessed monitoring data of each cloud host to obtain target monitoring data of each cloud host.
[0136] The resource usage status category determination module 620 is further used to take the target monitoring data of each cloud host as input, call the trained cloud host status classification model, and obtain the resource usage status category corresponding to each cloud host.
[0137] In an exemplary embodiment, the boot-up time distribution value determination module 630 is also used to determine the boot-up time proportion of the cloud host in different historical time periods based on the historical boot-up data of the cloud host, and obtain the boot-up time distribution value of the cloud host based on the boot-up time proportion in each historical time period and the corresponding weight.
[0138] Each module in the cloud host resource recovery device 600 can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0139] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the host status value, monitoring data, historical startup data, startup time distribution value and idle rate prediction value of each cloud host. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a cloud host resource recovery method is implemented.
[0140] Those skilled in the art will understand that Figure 8The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0141] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in any one of the above-mentioned cloud host resource recovery method embodiments are implemented.
[0142] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in any one of the above-mentioned cloud host resource recovery method embodiments are implemented.
[0143] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps in any one of the above-mentioned cloud host resource recovery method embodiments.
[0144] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0145] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0146] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0147] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A cloud host resource recovery method, characterized in that: The method comprises: Obtain the host status value, monitoring data, and historical startup data of each cloud host; Taking the monitoring data of each cloud host as input, calling a trained cloud host status classification model to obtain a resource usage status category corresponding to each cloud host, wherein the trained cloud host status classification model is trained based on historical monitoring data of multiple cloud hosts carrying resource usage status category labels, and the resource usage status category includes a usage status and an abandoned status; For each of the cloud hosts, based on the historical startup data of the cloud hosts, determining the startup duration distribution values of the cloud hosts in different historical time periods; Determine a predicted idle rate value of the cloud host based on a host status value of the cloud host, a resource usage status category of the cloud host, and a power-on time distribution value of the cloud host; Cloud host resources are recycled based on the idle rate prediction value of each of the cloud hosts.
2. The method according to claim 1, characterized in that: Reclaiming cloud host resources based on the idle rate prediction value of each cloud host includes: For each cloud host, if the idle rate prediction value of the cloud host is greater than or equal to a preset idle rate threshold, the cloud host is determined to be in an idle state, and the host dependency relationship of the cloud host is obtained; When it is determined according to the host dependency that the cloud host has no dependency relationship with other cloud hosts, the resources of the cloud host are recovered.
3. The method according to claim 1, characterized in that The determining the idle rate prediction value of the cloud host based on the host status value of the cloud host, the status category of the cloud host, and the power-on time distribution value of the cloud host includes: Taking the host status value of the cloud host, the status category of the cloud host, and the power-on time distribution value of the cloud host as input, calling the trained idle rate prediction model to determine the idle rate prediction value of the cloud host; Wherein, the idle rate prediction model is a polynomial regression model.
4. The method according to claim 1, characterized in that The monitoring data includes monitoring time series data; Taking the monitoring data of each cloud host as input, calling the trained cloud host status classification model, the resource usage status categories corresponding to each cloud host are obtained, including: Taking the monitoring time series data of each cloud host as input, calling the trained cloud host status classification model, and obtaining the resource usage status category corresponding to each cloud host, the cloud host status classification model is obtained by training the long short-term memory network based on the historical monitoring data of multiple cloud hosts carrying resource usage status category labels.
5. The method according to claim 4, characterized in that The obtaining of the host status value of each cloud host includes: Get the health status data of each cloud host; For each cloud host, a host status value of the cloud host is determined based on health status data of the cloud host, where the health status data includes a normal status and an abnormal status.
6. The method according to any one of claims 1 to 5, characterized in that: Before taking the monitoring data of each cloud host as input and calling the trained cloud host status classification model to obtain the resource usage status category corresponding to each cloud host, the method further includes: Preprocessing the monitoring data of each cloud host; Normalizing and standardizing the preprocessed monitoring data of each cloud host to obtain target monitoring data of each cloud host; The monitoring data of each cloud host is used as input, and the trained cloud host status classification model is called to obtain the resource usage status category corresponding to each cloud host, including: The target monitoring data of each cloud host is used as input, and a trained cloud host status classification model is called to obtain a resource usage status category corresponding to each cloud host.
7. The method according to any one of claims 1 to 5, characterized in that: The determining, based on the historical startup data of the cloud host, the startup duration distribution value of the cloud host in different historical time periods includes: Based on the historical startup data of the cloud host, determining the startup time ratio of the cloud host in different historical time periods; Based on the power-on duration proportions and corresponding weights in each of the historical time periods, a power-on duration distribution value of the cloud host is obtained.
8. A cloud host resource recovery device, characterized in that: The device comprises: The data acquisition module is used to obtain the host status value, monitoring data and historical startup data of each cloud host; A resource usage status category determination module is used to use the monitoring data of each cloud host as input, call a trained cloud host status classification model, and obtain the resource usage status category corresponding to each cloud host, wherein the trained cloud host status classification model is trained based on historical monitoring data of multiple cloud hosts carrying resource usage status category labels, and the resource usage status category includes a usage state and an abandoned state; A boot time distribution value determination module, configured to determine, for each of the cloud hosts, a boot time distribution value of the cloud host in different historical time periods based on the historical boot data of the cloud host; An idle rate prediction module, used to determine an idle rate prediction value of the cloud host based on a host status value of the cloud host, a resource usage status category of the cloud host, and a power-on time distribution value of the cloud host; The resource recovery module is used to recover cloud host resources based on the idle rate prediction value of each cloud host.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.