Resource management method and device, computer equipment, storage medium and program product
Through the prediction model, predicting the demand for cloud service resource and dynamically adjusting resources, the rationality and efficiency of cloud service resource management are solved, and efficient utilization of resources and avoiding waste are achieved.
Patent Information
- Application Number
- CN202510183816.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-06-06
AI Technical Summary
How to manage cloud service resources reasonably while meeting the needs of user-side cloud service resources to avoid resource waste.
By obtaining the target feature data in the historical period of the cloud service system, input it into the target resource prediction model, predicting the target resource demand data in the future preset period, and determining the change in the cloud service resource based on the data, and dynamically increasing or decreasing cloud service resources.
It realizes dynamic management of cloud service resources to meet user needs while avoiding resource waste, and achieves more reasonable resource management.
Smart Images

Figure CN120104324A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a resource management method, apparatus, computer equipment, storage medium and program product. Background Art
[0002] Cloud computing is an Internet-based computing model that provides computing and storage resources to users in a virtualized manner. With the popularization and development of cloud computing technology, more and more applications have been migrated to the cloud, and the demand for cloud service resources from users is also growing.
[0003] Therefore, how to reasonably manage cloud service resources while meeting the cloud service resource needs of the user side is a technical problem that urgently needs to be solved in this field. Summary of the invention
[0004] Based on this, it is necessary to provide a resource management method, apparatus, computer equipment, storage medium and program product to address the above technical problems, which can more reasonably manage cloud service resources while meeting the cloud service resource needs of the user side.
[0005] In a first aspect, the present application provides a resource management method, comprising:
[0006] Obtain target feature data related to cloud service resources of the cloud service system in a historical period; wherein the target feature data includes performance data and log data of the cloud service, and behavior data of the user end;
[0007] Input the target feature data into the target resource prediction model to obtain the target resource demand data for the cloud service system within a preset time period in the future;
[0008] Determine the change in cloud service resources relative to currently available resources at each future time within a preset future period based on target resource demand data;
[0009] At each future moment, the cloud service resources of the cloud service system are increased or decreased according to the corresponding change amount.
[0010] In one of the embodiments, the target resource demand data includes a resource demand type and a resource demand amount corresponding to the resource demand type;
[0011] Based on the target resource demand data, determine the change in cloud service resources at each future moment in the future preset period relative to the current available resources, including:
[0012] For each resource demand type, determine the change in cloud service resources of the resource demand type at each future moment relative to the currently available resources of the resource demand type based on the target resource demand data;
[0013] At each future moment, according to the corresponding change amount, the cloud service resources of the cloud service system are increased or decreased, including:
[0014] For each resource demand type, at each future moment, the cloud service resources of the cloud service system under the resource demand type are increased or decreased according to the change amount corresponding to the resource demand type.
[0015] In one embodiment, if the change amount is a positive value, at each future moment, increasing or decreasing the cloud service resources of the cloud service system under the resource demand type according to the change amount corresponding to the resource demand type includes:
[0016] For each future moment, determining a first ratio of a change amount corresponding to the resource demand type to currently available resources corresponding to the resource demand type;
[0017] Determining, according to the first ratio and currently available resources corresponding to the resource demand type, an expansion capacity of cloud service resources of the cloud service system under the resource demand type;
[0018] Add cloud service resources with resource requirements that require capacity expansion.
[0019] In one embodiment, if the change amount is a negative value, at each future moment, increasing or decreasing the cloud service resources of the cloud service system under the resource demand type according to the change amount corresponding to the resource demand type includes:
[0020] For each future moment, determining a second ratio of the change amount corresponding to the resource demand type to the currently available resources corresponding to the resource demand type;
[0021] Determining, based on the second ratio and currently available resources corresponding to the resource demand type, a reduced capacity of cloud service resources of the cloud service system under the resource demand type;
[0022] Reduce the resource demand type of cloud service resources that need to be scaled down.
[0023] In one of the embodiments, the historical period is at least two different historical periods;
[0024] Input the target characteristic data into the target resource prediction model to obtain the target resource demand data within the future preset period, including:
[0025] Input the target characteristic data in each historical period into the target resource prediction model to obtain the demand data of each candidate resource in the future preset period;
[0026] The average value of each candidate resource requirement data is used as the target resource requirement data.
[0027] In one embodiment, the target resource prediction model is trained in the following manner:
[0028] Obtain sample feature data;
[0029] Determine candidate parameter combinations for the initial resource prediction model;
[0030] Based on the sample feature data, the target parameter combination is screened from the candidate parameter combinations by cross-validation.
[0031] Based on the sample feature data, the initial resource prediction model whose model parameters are the target parameter combination is trained by cross-validation to obtain the target resource prediction model.
[0032] In a second aspect, the present application further provides a resource management device, including:
[0033] An acquisition module is used to acquire target feature data related to cloud service resources of the cloud service system in a historical period; wherein the target feature data includes performance data and log data of the cloud service, and behavior data of the user end;
[0034] The prediction module is used to input the target feature data into the target resource prediction model to obtain the target resource demand data for the cloud service system within a preset time period in the future;
[0035] A determination module, used to determine the change in cloud service resources relative to currently available resources at each future moment in a future preset period of time based on target resource demand data;
[0036] The management module is used to increase or decrease the cloud service resources of the cloud service system according to the corresponding change amount at each future moment.
[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 following steps are implemented:
[0038] Obtain target feature data related to cloud service resources of the cloud service system in a historical period; wherein the target feature data includes performance data and log data of the cloud service, and behavior data of the user end;
[0039] Input the target feature data into the target resource prediction model to obtain the target resource demand data for the cloud service system within a preset time period in the future;
[0040] Determine the change in cloud service resources relative to currently available resources at each future time within a preset future period based on target resource demand data;
[0041] At each future moment, the cloud service resources of the cloud service system are increased or decreased according to the corresponding change amount.
[0042] 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 following steps are implemented:
[0043] Obtain target feature data related to cloud service resources of the cloud service system in a historical period; wherein the target feature data includes performance data and log data of the cloud service, and behavior data of the user end;
[0044] Input the target feature data into the target resource prediction model to obtain the target resource demand data for the cloud service system within a preset time period in the future;
[0045] Determine the change in cloud service resources relative to currently available resources at each future time within a preset future period based on target resource demand data;
[0046] At each future moment, the cloud service resources of the cloud service system are increased or decreased according to the corresponding change amount.
[0047] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0048] Obtain target feature data related to cloud service resources of the cloud service system in a historical period; wherein the target feature data includes performance data and log data of the cloud service, and behavior data of the user end;
[0049] Input the target feature data into the target resource prediction model to obtain the target resource demand data for the cloud service system within a preset time period in the future;
[0050] Determine the change in cloud service resources relative to currently available resources at each future time within a preset future period based on target resource demand data;
[0051] At each future moment, the cloud service resources of the cloud service system are increased or decreased according to the corresponding change amount.
[0052] The resource management method, device, computer equipment, storage medium and program product described above obtain target feature data related to cloud service resources of the cloud service system in the historical period; and input the target feature data into the target resource prediction model to obtain the target resource demand data for the cloud service system in the future preset period; and then determine the change in cloud service resources relative to current available resources at each future moment in the future preset period based on the target resource demand data in the future preset period; and at each future moment, increase or decrease cloud service resources based on the change. The above scheme realizes the dynamic management of cloud service resources by predicting the target resource demand data in the future preset period based on the target feature data in the historical period, and then increasing or decreasing cloud service resources based on the target resource demand data in the future preset period, which can not only meet the user's cloud service resource demand, but also avoid the waste of cloud service resources, thereby achieving the purpose of more reasonable management of cloud service resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] 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.
[0054] Figure 1 A schematic diagram of a resource management method in one embodiment;
[0055] Figure 2 A schematic diagram of a process for adding cloud service resources in one embodiment;
[0056] Figure 3 A schematic diagram of a process of reducing cloud service resources in one embodiment;
[0057] Figure 4 A schematic diagram of a process for predicting target resource demand data in one embodiment;
[0058] Figure 5 A schematic diagram of a process for obtaining a target resource prediction model in an embodiment;
[0059] Figure 6 is a flowchart of a resource management method in another embodiment;
[0060] Figure 7 is a structural block diagram of a resource management device in one embodiment;
[0061] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0062] 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.
[0063] The resource management method provided in the embodiment of the present application can be applied to the application scenario of cloud service resource management. The method can be executed by a server or by a terminal. Among them, the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc.
[0064] In an exemplary embodiment, Figure 1 As shown, a resource management method is provided, which is described by taking the method applied to a server as an example, and includes the following steps:
[0065] S101, obtaining target feature data related to cloud service resources of a cloud service system within a historical period.
[0066] Exemplarily, a cloud service system is a system that can provide cloud services, such as a system composed of a cluster of cloud servers. The target feature data includes performance data and log data of cloud services, as well as behavioral data of the user end. Among them, the performance data of cloud services includes but is not limited to the utilization rate of the central processing unit (CPU), memory usage, network bandwidth, and storage read and write speeds; the log data includes but is not limited to the operation records and event information of the cloud service system during operation, such as software startup, stop, abnormal errors, and service call records; the behavioral data of the user end includes but is not limited to the user login time, the type of service operated, the frequency of operation, and the amount of resources requested.
[0067] Exemplarily, target feature data related to cloud service resources in a historical period can be obtained from multiple data sources. For example, target feature data related to cloud service resources in a historical period can be obtained from data sources such as internal databases, application programming interfaces (APIs) of cloud service providers, third-party data providers, and web pages. The historical period can be set according to demand, for example, it can be set to one day, one week, one hour, etc., and no specific limitation is made here.
[0068] S102, inputting the target feature data into a target resource prediction model to obtain target resource demand data for the cloud service system within a future preset period of time.
[0069] Exemplarily, the target resource prediction model is obtained by training the initial resource prediction model using sample feature data. When predicting resource demand data in a future period, the target feature data can be input into the target resource prediction model, and the target resource prediction model extracts and predicts the target feature data to obtain the target resource demand data for the cloud service system in the future preset period. The target resource demand data in the future preset period can be the total resource demand amount in the future preset period, or the total resource demand amount at each future moment in the future preset period.
[0070] S103, determining the amount of change of cloud service resources at each future moment in the future preset time period relative to the current available resources based on the target resource demand data in the future preset time period.
[0071] Furthermore, when the target resource demand data in the future preset period is the total resource demand at each future moment in the future preset period, the target resource demand data in the future preset period can be subtracted from the current available resources to determine the change in the cloud service resources at each future moment in the future preset period relative to the current available resources. The change can be a positive number, i.e., the resource demand has increased, a negative number, i.e., the resource demand has decreased, or zero, i.e., the resource demand remains unchanged.
[0072] S104: At each future moment, increase or decrease the cloud service resources of the cloud service system according to the corresponding change amount.
[0073] Furthermore, at each future moment, the cloud service resources of the cloud service system can be increased or decreased according to the change amount corresponding to each future moment. For example, if the change amount is a positive number, the cloud service resources of the cloud service system can be increased; if the change amount is a negative number, the cloud service resources of the cloud service system can be decreased; if the change amount is zero, the cloud service resources of the cloud service system remain unchanged.
[0074] The above resource management method obtains the target feature data related to cloud service resources of the cloud service system in the historical period; and inputs the target feature data into the target resource prediction model to obtain the target resource demand data for the cloud service system in the future preset period; then, based on the target resource demand data in the future preset period, determines the change in cloud service resources at each future moment in the future preset period relative to the current available resources; at each future moment, increases or decreases cloud service resources based on the corresponding change. The above scheme realizes the dynamic management of cloud service resources by predicting the target resource demand data in the future preset period based on the target feature data in the historical period, and then increases or decreases cloud service resources based on the target resource demand data in the future preset period, which can not only meet the user's cloud service resource demand, but also avoid the waste of cloud service resources, thereby achieving the purpose of more reasonable management of cloud service resources.
[0075] In some optional implementations, the target resource demand data may include resource demand types and resource demand quantities corresponding to the resource demand types. The resource demand types include but are not limited to virtual machines, CPUs, memory resources, and storage resources, etc., that is, the target resource demand data may include the total resource demand corresponding to each resource demand type at each future moment in a preset time period in the future.
[0076] Based on this, in the process of determining the change in cloud service resources at each future moment in the future preset time period relative to the currently available resources according to the target resource demand data within the future preset time period, the change in cloud service resources under different resource demand types at each future moment in the future preset time period relative to the currently available resources of different resource demand types can be determined based on the resource demand type and resource demand amount within the future preset time period.
[0077] For example, the target resource demand data includes each resource demand type and the resource demand amount under each resource demand type corresponding to each future moment within a preset time period in the future; based on this, for each resource demand type, the resource demand amount of the resource demand type at each future moment can be subtracted from the currently available resources of the resource demand type to obtain the change in cloud service resources of the resource demand type at each future moment relative to the currently available resources; the change in cloud service resources under each resource demand type at each future moment relative to the currently available resources is obtained, that is, the change in cloud service resources under different resource demand types at each future moment relative to the currently available resources is obtained.
[0078] Furthermore, in the process of increasing or decreasing cloud service resources according to the change amount corresponding to each future moment, for each resource demand type, at each future moment, the cloud service resources under the resource demand type can be increased or decreased according to the change amount corresponding to each future moment. For example, for each resource demand type, if the change amount of the cloud service resources is a positive number, the cloud service resources of the resource demand type can be increased; if the change amount of the cloud service resources is a negative number, the cloud service resources of the resource demand type can be decreased; if the change amount of the cloud service resources is zero, the cloud service resources of the resource demand type remain unchanged.
[0079] In the embodiment of the present application, cloud service resources can be increased or decreased for each resource demand type, which can make resource adjustment more targeted, thereby improving the rationality of resource adjustment.
[0080] Furthermore, when the change amount is a positive value, cloud server resources need to be increased; in the process of increasing cloud service resources under each resource demand type, the number of cloud service resources to be increased under each resource demand type may be determined first.
[0081] For example, see Figure 2 , Figure 2 A flowchart for adding cloud service resources is provided, which takes each resource requirement type as an example and specifically includes the following steps:
[0082] S201, for each future moment, determining a first ratio of a change amount corresponding to a resource demand type to currently available resources corresponding to the resource demand type.
[0083] Exemplarily, at each future moment, the change amount corresponding to the resource demand type can be determined, and a first ratio of the change amount corresponding to the resource demand type to the currently available resources corresponding to the resource demand type can be calculated, that is, the quotient of the change amount and the currently available resources is taken as the first ratio.
[0084] S202: Determine, according to the first ratio and currently available resources corresponding to the resource demand type, an expansion capacity of cloud service resources of the cloud service system under the resource demand type.
[0085] Furthermore, the product of the first ratio and the currently available resources corresponding to the resource demand type may be rounded up, and the obtained integer may be used as the expansion capacity of the cloud service resources of the cloud service system under the resource demand type.
[0086] S203: Add cloud service resources of the resource demand type that requires capacity expansion.
[0087] Furthermore, the cloud service resources of the resource requirement type for capacity expansion can be increased. For example, if the resource requirement type is CPU, the number of CPUs for capacity expansion can be increased.
[0088] In an embodiment of the present application, in the process of increasing cloud service resources under each resource demand type, the number of cloud service resources to be increased under each resource demand type is first determined, so that the number of increased cloud service resources can meet the resource demand without causing resource waste.
[0089] Furthermore, when the change amount is a negative value, the cloud server resources need to be reduced; in the process of reducing the cloud service resources under each resource demand type, it can be determined firstly that the number of cloud service resources under each resource demand type is reduced.
[0090] For example, see Figure 3 , Figure 3 A flowchart of reducing cloud service resources is provided, which is also explained by taking each resource requirement type as an example, and specifically includes the following steps:
[0091] S301, for each future moment, determining a second ratio of a change amount corresponding to a resource demand type to currently available resources corresponding to the resource demand type.
[0092] Exemplarily, for each future moment, a second ratio of the change amount corresponding to the resource demand type to the currently available resources corresponding to the resource demand type may be calculated, that is, the quotient of the change amount and the currently available resources is taken as the second ratio.
[0093] S302: Determine the reduced capacity of cloud service resources of the cloud service system under the resource demand type according to the second ratio and currently available resources.
[0094] Furthermore, the product of the second ratio and the currently available resources may be rounded down, and the obtained integer may be used as the reduced capacity of the cloud service resources of the cloud service system under the resource demand type.
[0095] S303: Reduce the cloud service resources of the resource demand type that require reduced capacity.
[0096] Furthermore, the cloud service resources of the resource demand type for capacity expansion can be reduced. For example, if the resource demand type is CPU, the number of CPUs for capacity reduction can be reduced.
[0097] In an embodiment of the present application, in the process of reducing cloud service resources under each resource demand type, it is first determined to reduce the number of cloud service resources under each resource demand type, so that the resource demand can still be met after the number of cloud service resources is reduced, and resource waste is avoided.
[0098] In some optional implementations, in order to improve the accuracy of predicting target resource demand data, target feature data of multiple historical periods may be used to predict multiple target resource demand data, and the average value of the multiple target resource demand data may be used as the final target resource demand data. The historical period is at least two different historical periods, and different historical periods are continuous periods containing different historical moments.
[0099] Based on this, see Figure 4 , Figure 4 A schematic diagram of a process for predicting target resource demand data is provided, which specifically includes the following steps:
[0100] S401, inputting the target characteristic data in each historical period into the target resource prediction model respectively, and obtaining the demand data of each candidate resource in a future preset period.
[0101] Exemplarily, the target feature data in each historical period can be input into the target resource prediction model to obtain the candidate resource demand data in the future preset period. Since the historical period is at least two consecutive periods containing different historical moments, the obtained candidate resource demand data is predicted based on the target feature data in different historical periods, which can avoid the contingency caused by using the target feature data in the same historical period to predict the target feature data.
[0102] S402: Taking the average value of each candidate resource requirement data as the target resource requirement data.
[0103] Then, the average value of each candidate resource demand data can be used as the target resource demand data. In this way, the candidate resource demand data predicted by the target characteristic data in multiple historical periods can be integrated to avoid the contingency and one-sidedness of the target resource demand data, thereby improving the accuracy of the predicted target resource demand data.
[0104] In some optional implementations, see Figure 5 , Figure 5 A flowchart for obtaining a target resource prediction model is provided, which specifically includes the following steps:
[0105] S501, obtaining sample feature data.
[0106] Exemplarily, candidate feature data related to cloud service resources in a historical period can be obtained from multiple data sources. For example, candidate feature data related to cloud service resources in a historical period can be obtained from data sources such as internal databases, API interfaces of cloud service providers, third-party data providers, and web pages. The candidate feature data can be multi-dimensional data related to cloud service resources.
[0107] Optionally, in order to improve the quality of the candidate feature data, the candidate feature data may be preprocessed, for example, data cleaning and format conversion may be performed on the candidate feature data. Then, sample feature data may be screened out from the preprocessed candidate feature data by methods such as correlation analysis and chi-square test.
[0108] S502: Determine candidate parameter combinations for an initial resource prediction model.
[0109] Furthermore, the grid search technology can be used to determine the candidate parameter combination of the initial resource prediction model. Among them, grid search is a method of hyperparameter tuning, which is used to find the best hyperparameter combination of the model. First, it is necessary to define the search space of the hyperparameters, that is, to list the hyperparameters that need to be adjusted for the initial resource prediction model and their possible value ranges. Taking the initial resource prediction model as the support vector machine (SVM) as an example, the value of the regularization parameter C for SVM may be set to [0.1, 1, 10], and the value of the kernel function parameter gamma may be set to [0.01, 0.1, 1]. The candidate parameter combination of the initial resource prediction model is the combination of C and gamma.
[0110] It should be noted that in the embodiments of the present application, the machine learning algorithms used to train the initial resource prediction model include but are not limited to time series prediction algorithms and regression algorithms.
[0111] S503, based on the sample feature data, a cross-validation method is used to select a target parameter combination from the candidate parameter combinations.
[0112] Furthermore, based on the sample feature data, a cross-validation method can be used to screen the target parameter combination from the candidate parameter combinations. For example, for each candidate parameter combination, the performance of the initial resource prediction model is evaluated using cross-validation, and the performance indicators under different candidate parameter combinations are compared, and the candidate parameter combination with the best performance is used as the target parameter combination.
[0113] Among them, cross-validation is a method for evaluating model performance. Sample data features can usually be divided into multiple subsets, such as k subsets, and k training and validation are performed. In each training, k-1 subsets are used as training sets, and the remaining subset is used as a validation set. The training set is used to train the initial resource prediction model, that is, to let the model learn the relationship between features and target variables (such as future resource demand). The validation set is used to evaluate the performance of the trained model, and some performance indicators are usually calculated, such as mean square error (MSE), mean absolute error (MAE), coefficient of determination (R²), etc. Repeat this process k times, each time using a different subset as a validation set, and finally get k performance indicator results. These results can be combined to evaluate the performance of the model, such as finding the average, so as to more accurately understand the performance of the model on unseen data and avoid overfitting.
[0114] S504, based on the sample feature data, the initial resource prediction model whose model parameters are the target parameter combination is trained by cross-validation to obtain the target resource prediction model.
[0115] Exemplarily, based on the sample feature data, a cross-validation method can be used to train the initial resource prediction model whose model parameters are the target parameter combination to obtain the target resource prediction model. For example, the sample feature data can be used to retrain the initial resource prediction model whose model parameters are the target parameter combination, and the model can be cross-validated to obtain the final target resource prediction model.
[0116] In the embodiment of the present application, the initial resource prediction model is trained by grid search and cross-validation, so that the obtained target resource prediction model has better model parameters and makes the prediction results more accurate, thereby improving the accuracy of the target resource prediction model.
[0117] In some optional implementations, see Figure 6 , Figure 6 A flowchart of another resource management method is provided, which specifically includes the following steps:
[0118] S601, obtaining target feature data related to cloud service resources of a cloud service system in at least two historical time periods.
[0119] S602, inputting the target characteristic data in each historical period into the target resource prediction model respectively, and obtaining the demand data of each candidate resource in a future preset period.
[0120] S603: Taking the average value of each candidate resource requirement data as the target resource requirement data.
[0121] S604, determining the amount of change of cloud service resources under different resource demand types at each future moment in the future preset period relative to currently available resources under different resource demand types based on the resource demand types and resource demand amounts in the target resource demand data within the future preset period.
[0122] S605, at each future moment, for each resource demand type, according to the change amount corresponding to each resource demand type, increase the cloud service resources under the resource demand type or reduce the cloud service resources under the resource demand type.
[0123] The specific process of S601 to S605 can refer to the description of the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0124] Furthermore, the execution order of the above steps is only an exemplary description and is not used to limit the execution steps. Other execution orders of the steps are within the protection scope of the embodiments of the present application.
[0125] The resource management method provided in the embodiment of the present application can be applied in the following scenarios:
[0126] Cloud computing platform: Provide intelligent resource allocation and optimization services for cloud computing platform.
[0127] Big data processing: Provide dynamic resource allocation and optimization services for big data processing tasks.
[0128] Online services: Provide real-time resource monitoring and optimization services for online services.
[0129] In order to avoid the situation where cloud service resources cannot meet resource needs, the cloud service system can also be monitored. For example, the cloud service resource usage and service performance can be monitored in real time. When the resource usage rate exceeds the preset threshold or the service quality decreases, the cloud service system can automatically trigger the alarm mechanism, promptly notify the administrator to perform manual intervention, and automatically adjust resource allocation according to the preset strategy.
[0130] 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.
[0131] Based on the same inventive concept, the embodiment of the present application also provides a resource management device for implementing the resource management method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more resource management device embodiments provided below can refer to the limitations on the resource management method above, and will not be repeated here.
[0132] In an exemplary embodiment, Figure 7 As shown, a resource management device is provided, comprising:
[0133] The acquisition module 10 is used to acquire target feature data related to cloud service resources of the cloud service system in a historical period; wherein the target feature data includes performance data and log data of the cloud service, and behavior data of the user end;
[0134] The prediction module 20 is used to input the target feature data into the target resource prediction model to obtain the target resource demand data for the cloud service system within a preset time period in the future;
[0135] A determination module 30, for determining the amount of change of cloud service resources relative to currently available resources at each future moment in a future preset period of time according to the target resource demand data;
[0136] The management module 40 is used to increase or decrease the cloud service resources of the cloud service system according to the corresponding change amount at each future moment.
[0137] The resource management device described above obtains target feature data related to cloud service resources of the cloud service system in the historical period; and inputs the target feature data into the target resource prediction model to obtain the target resource demand data of the cloud service system in the future preset period; and then determines the change of cloud service resources at each future moment in the future preset period relative to the current available resources based on the target resource demand data in the future preset period; and at each future moment, increases or decreases cloud service resources based on the change. The above scheme realizes the dynamic management of cloud service resources by predicting the target resource demand data in the future preset period based on the target feature data in the historical period, and then increases or decreases cloud service resources based on the target resource demand data in the future preset period, which can not only meet the cloud service resource needs of users, but also avoid the waste of cloud service resources, thereby achieving the purpose of more reasonable management of cloud service resources.
[0138] In one embodiment, the target resource demand data includes a resource demand type and a resource demand amount corresponding to the resource demand type; the determination module 30 is specifically used to:
[0139] For each resource demand type, determine the change in cloud service resources of the resource demand type at each future moment relative to the currently available resources of the resource demand type based on the target resource demand data;
[0140] The management module 40 is specifically used for:
[0141] For each resource demand type, at each future moment, the cloud service resources of the cloud service system under the resource demand type are increased or decreased according to the change amount corresponding to the resource demand type.
[0142] In one embodiment, if the change amount is a positive value, the management module 40 is specifically configured to:
[0143] For each future moment, determine a first ratio of the change corresponding to the resource demand type to the currently available resources corresponding to the resource demand type; determine the expansion capacity of the cloud service resources of the cloud service system under the resource demand type based on the first ratio and the currently available resources corresponding to the resource demand type; and increase the cloud service resources of the resource demand type with expanded capacity.
[0144] In one embodiment, if the change amount is a negative value, the management module 40 is specifically configured to:
[0145] For each future moment, determine a second ratio of the change corresponding to the resource demand type to the currently available resources corresponding to the resource demand type; determine the reduced capacity of the cloud service resources of the cloud service system under the resource demand type based on the second ratio and the currently available resources corresponding to the resource demand type; and reduce the cloud service resources of the resource demand type with reduced capacity.
[0146] In one embodiment, the historical period is at least two different historical periods; the prediction module 20 is specifically used for:
[0147] The target feature data in each historical period are respectively input into the target resource prediction model to obtain the demand data of each candidate resource in the future preset period; the average value of each candidate resource demand data is used as the target resource demand data.
[0148] In one embodiment, the target resource prediction model is trained in the following manner:
[0149] Acquire sample feature data; determine candidate parameter combinations of the initial resource prediction model; based on the sample feature data, use a cross-validation method to screen a target parameter combination from the candidate parameter combinations; based on the sample feature data, use a cross-validation method to train the initial resource prediction model whose model parameters are the target parameter combination to obtain a target resource prediction model.
[0150] Each module in the resource management device 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.
[0151] 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 (I / O) interface and a communication interface. 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. 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 cloud service data. The input / output interface of the computer device is used to exchange information between the processor and an 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 resource management method is implemented.
[0152] Those skilled in the art will understand that Figure 8 The 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.
[0153] 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 following steps are implemented:
[0154] Obtain target feature data related to cloud service resources of the cloud service system in a historical period; wherein the target feature data includes performance data and log data of the cloud service, and behavior data of the user end;
[0155] Input the target feature data into the target resource prediction model to obtain the target resource demand data for the cloud service system within a preset time period in the future;
[0156] Determine the change in cloud service resources relative to currently available resources at each future time within a preset future period based on target resource demand data;
[0157] At each future moment, the cloud service resources of the cloud service system are increased or decreased according to the corresponding change amount.
[0158] In one embodiment, the target resource requirement data includes a resource requirement type and a resource requirement amount corresponding to the resource requirement type; when the processor executes the computer program, the following steps are also implemented:
[0159] For each resource demand type, determine the cloud service resources of the resource demand type at each future moment, and the change in the currently available resources of the resource demand type based on the target resource demand data; for each resource demand type, at each future moment, increase or decrease the cloud service resources of the cloud service system under the resource demand type based on the change corresponding to the resource demand type.
[0160] In one embodiment, if the change is a positive value, the processor further implements the following steps when executing the computer program:
[0161] For each future moment, determine a first ratio of the change corresponding to the resource demand type to the currently available resources corresponding to the resource demand type; determine the expansion capacity of the cloud service resources of the cloud service system under the resource demand type based on the first ratio and the currently available resources corresponding to the resource demand type; and increase the cloud service resources of the resource demand type with expanded capacity.
[0162] In one embodiment, if the change is a negative value, the processor further implements the following steps when executing the computer program:
[0163] For each future moment, determine a second ratio of the change corresponding to the resource demand type to the currently available resources corresponding to the resource demand type; determine the reduced capacity of the cloud service resources of the cloud service system under the resource demand type based on the second ratio and the currently available resources corresponding to the resource demand type; and reduce the cloud service resources of the resource demand type with reduced capacity.
[0164] In one embodiment, the historical period is at least two consecutive periods including different historical moments; when the processor executes the computer program, the following steps are also implemented:
[0165] The target feature data in each historical period are respectively input into the target resource prediction model to obtain the demand data of each candidate resource in the future preset period; the average value of each candidate resource demand data is used as the target resource demand data.
[0166] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0167] Acquire sample feature data; determine candidate parameter combinations of the initial resource prediction model; based on the sample feature data, use a cross-validation method to screen a target parameter combination from the candidate parameter combinations; based on the sample feature data, use a cross-validation method to train the initial resource prediction model whose model parameters are the target parameter combination to obtain a target resource prediction model.
[0168] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0169] Obtain target feature data related to cloud service resources of the cloud service system in a historical period; wherein the target feature data includes performance data and log data of the cloud service, and behavior data of the user end;
[0170] Input the target feature data into the target resource prediction model to obtain the target resource demand data for the cloud service system within a preset time period in the future;
[0171] Determine the change in cloud service resources relative to currently available resources at each future time within a preset future period based on target resource demand data;
[0172] At each future moment, the cloud service resources of the cloud service system are increased or decreased according to the corresponding change amount.
[0173] In one embodiment, the target resource requirement data includes a resource requirement type and a resource requirement amount corresponding to the resource requirement type; when the computer program is executed by the processor, the following steps are also implemented:
[0174] For each resource demand type, determine the cloud service resources of the resource demand type at each future moment, and the change in the currently available resources of the resource demand type based on the target resource demand data; for each resource demand type, at each future moment, increase or decrease the cloud service resources of the cloud service system under the resource demand type based on the change corresponding to the resource demand type.
[0175] In one embodiment, if the change is a positive value, the computer program further implements the following steps when executed by the processor:
[0176] For each future moment, determine a first ratio of the change corresponding to the resource demand type to the currently available resources corresponding to the resource demand type; determine the expansion capacity of the cloud service resources of the cloud service system under the resource demand type based on the first ratio and the currently available resources corresponding to the resource demand type; and increase the cloud service resources of the resource demand type with expanded capacity.
[0177] In one embodiment, if the change is a negative value, the computer program further implements the following steps when executed by the processor:
[0178] For each future moment, determine a second ratio of the change corresponding to the resource demand type to the currently available resources corresponding to the resource demand type; determine the reduced capacity of the cloud service resources of the cloud service system under the resource demand type based on the second ratio and the currently available resources corresponding to the resource demand type; and reduce the cloud service resources of the resource demand type with reduced capacity.
[0179] In one embodiment, the historical period is at least two consecutive periods containing different historical moments; when the computer program is executed by the processor, the following steps are also implemented:
[0180] The target feature data in each historical period are respectively input into the target resource prediction model to obtain the demand data of each candidate resource in the future preset period; the average value of each candidate resource demand data is used as the target resource demand data.
[0181] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0182] Acquire sample feature data; determine candidate parameter combinations of the initial resource prediction model; based on the sample feature data, use a cross-validation method to screen a target parameter combination from the candidate parameter combinations; based on the sample feature data, use a cross-validation method to train the initial resource prediction model whose model parameters are the target parameter combination to obtain a target resource prediction model.
[0183] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0184] Obtain target feature data related to cloud service resources of the cloud service system in a historical period; wherein the target feature data includes performance data and log data of the cloud service, and behavior data of the user end;
[0185] Input the target feature data into the target resource prediction model to obtain the target resource demand data for the cloud service system within a preset time period in the future;
[0186] Determine the change in cloud service resources relative to currently available resources at each future time within a preset future period based on target resource demand data;
[0187] At each future moment, the cloud service resources of the cloud service system are increased or decreased according to the corresponding change amount.
[0188] In one embodiment, the target resource requirement data includes a resource requirement type and a resource requirement amount corresponding to the resource requirement type; when the computer program is executed by the processor, the following steps are also implemented:
[0189] For each resource demand type, determine the cloud service resources of the resource demand type at each future moment, and the change in the currently available resources of the resource demand type based on the target resource demand data; for each resource demand type, at each future moment, increase or decrease the cloud service resources of the cloud service system under the resource demand type based on the change corresponding to the resource demand type.
[0190] In one embodiment, if the change is a positive value, the computer program further implements the following steps when executed by the processor:
[0191] For each future moment, determine a first ratio of the change corresponding to the resource demand type to the currently available resources corresponding to the resource demand type; determine the expansion capacity of the cloud service resources of the cloud service system under the resource demand type based on the first ratio and the currently available resources corresponding to the resource demand type; and increase the cloud service resources of the resource demand type with expanded capacity.
[0192] In one embodiment, if the change is a negative value, the computer program further implements the following steps when executed by the processor:
[0193] For each future moment, determine a second ratio of the change corresponding to the resource demand type to the currently available resources corresponding to the resource demand type; determine the reduced capacity of the cloud service resources of the cloud service system under the resource demand type based on the second ratio and the currently available resources corresponding to the resource demand type; and reduce the cloud service resources of the resource demand type with reduced capacity.
[0194] In one embodiment, the historical period is at least two consecutive periods containing different historical moments; when the computer program is executed by the processor, the following steps are also implemented:
[0195] The target feature data in each historical period are respectively input into the target resource prediction model to obtain the demand data of each candidate resource in the future preset period; the average value of each candidate resource demand data is used as the target resource demand data.
[0196] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0197] Acquire sample feature data; determine candidate parameter combinations of the initial resource prediction model; based on the sample feature data, use a cross-validation method to screen a target parameter combination from the candidate parameter combinations; based on the sample feature data, use a cross-validation method to train the initial resource prediction model whose model parameters are the target parameter combination to obtain a target resource prediction model.
[0198] 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.
[0199] 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.
[0200] 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.
[0201] 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 construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications 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 resource management method, characterized in that: The method comprises: Obtaining target feature data related to cloud service resources of the cloud service system in a historical period; wherein the target feature data includes performance data and log data of the cloud service, and behavior data of the user end; Inputting the target characteristic data into a target resource prediction model to obtain target resource demand data for the cloud service system within a future preset period of time; Determine, based on the target resource demand data, a change in cloud service resources relative to currently available resources at each future moment in the future preset time period; At each of the future moments, the cloud service resources of the cloud service system are increased or decreased according to the corresponding change amount.
2. The method according to claim 1, characterized in that The target resource demand data includes a resource demand type and a resource demand amount corresponding to the resource demand type; Determining, according to the target resource demand data, a change in cloud service resources at each future moment in the future preset time period relative to currently available resources, including: For each resource demand type, determining, according to the target resource demand data, a change amount of the cloud service resources of the resource demand type at each future moment relative to currently available resources of the resource demand type; The increasing or decreasing the cloud service resources of the cloud service system according to the corresponding change amount at each future moment includes: For each resource demand type, at each future moment, the cloud service resources of the cloud service system under the resource demand type are increased or decreased according to the change amount corresponding to the resource demand type.
3. The method according to claim 2, characterized in that If the change amount is a positive value, at each future moment, increasing or decreasing the cloud service resources of the cloud service system under the resource demand type according to the change amount corresponding to the resource demand type includes: For each future moment, determining a first ratio of a change amount corresponding to the resource demand type to currently available resources corresponding to the resource demand type; Determining, according to the first ratio and currently available resources corresponding to the resource demand type, an expansion capacity of cloud service resources of the cloud service system under the resource demand type; Increase cloud service resources of the resource demand type for the capacity expansion.
4. The method according to claim 2, characterized in that: If the change amount is a negative value, at each future moment, increasing or decreasing the cloud service resources of the cloud service system under the resource demand type according to the change amount corresponding to the resource demand type includes: For each future moment, determining a second ratio of the change amount corresponding to the resource demand type to the currently available resources corresponding to the resource demand type; Determining, according to the second ratio and currently available resources corresponding to the resource demand type, a reduced capacity of cloud service resources of the cloud service system under the resource demand type; Reduce the cloud service resources of the resource demand type for the reduced capacity.
5. The method according to claim 1, characterized in that The historical periods are at least two different historical periods; The target characteristic data is input into the target resource prediction model to obtain the target resource demand data within a future preset period of time, including: Input the target characteristic data in each historical period into the target resource prediction model to obtain the demand data of each candidate resource in the future preset period; The average value of the candidate resource requirement data is used as the target resource requirement data.
6. The method according to claim 1, characterized in that The target resource prediction model is trained in the following way: Obtain sample feature data; Determine candidate parameter combinations for the initial resource prediction model; Based on the sample feature data, a target parameter combination is screened from the candidate parameter combinations by cross-validation; Based on the sample feature data, an initial resource prediction model whose model parameters are the target parameter combination is trained by cross-validation to obtain the target resource prediction model.
7. A resource management device, characterized in that: The device comprises: An acquisition module, used to acquire target feature data related to cloud service resources of the cloud service system in a historical period; wherein the target feature data includes performance data and log data of the cloud service, and behavior data of the user end; A prediction module, used to input the target feature data into a target resource prediction model to obtain target resource demand data for the cloud service system within a future preset period of time; A determination module, configured to determine, based on the target resource demand data, a change in the cloud service resources at each future moment in the future preset time period relative to the currently available resources; The management module is used to increase or decrease the cloud service resources of the cloud service system according to the corresponding change amount at each future moment.
8. 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 6 are implemented.
9. 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 6 are implemented.
10. A computer program product, comprising a computer program, 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 6 are implemented.
Citation Information
Cited By
Cloud resource allocation prediction method during end-cloud fusion, computer equipment and medium
CN120750940A