Resource processing method and system, storage medium and electronic equipment
By collecting and evaluating the status information of resources in the cloud environment and automatically performing cleaning actions based on pre-configured policies, the problem of inefficient resource cleaning in the cloud environment is solved, achieving more efficient and accurate resource management and cleaning.
Patent Information
- Application Number
- CN202412000524.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-27
AI Technical Summary
In the prior art, the efficiency of cleaning up resources in cloud environments is low, resulting in waste of resources, increased cost expenditure, and may cause security risks.
By collecting state information for multiple resources in the cloud environment and evaluating based on pre-configured resource cleaning policies, cleanup actions are automatically triggered and performed, ensuring that only those resources that need to be cleaned are cleaned.
It improves the efficiency and accuracy of resource cleaning in cloud environments, reduces manual intervention, avoids the situation of misclearing or missed cleaning, and ensures the safe and rational use of resources.
Smart Images

Figure CN120045314A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of resource data processing. Specifically, the embodiments relate to a resource processing method, system, storage medium, and electronic device. Background Art
[0002] With the rapid development of cloud computing technology, more and more enterprises and organizations choose to deploy their businesses to the cloud to enjoy advantages such as elastic scalability, pay-as-you-go, and rapid deployment. However, the flexibility and convenience of cloud resources also bring management challenges.
[0003] There are a wide variety of resources in the cloud environment. These resources may become idle or inefficient resources during use due to reasons such as changes in business requirements, project completion, or configuration errors. If not cleaned up in time, it will not only waste valuable cloud resources, increase unnecessary cost expenditures, but also may trigger security risks, such as unauthorized access, data leakage, etc. Traditional cloud resource cleaning methods often rely on manual intervention, by regularly checking the cloud environment and manually deleting resources that are no longer needed. This method is inefficient, error-prone, and difficult to adapt to rapidly changing business requirements, resulting in low efficiency in cleaning up resources in the cloud environment in related technologies.
[0004] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention
[0005] The embodiments of the present application provide a resource processing method, system, storage medium, and electronic device to at least solve the technical problem of low efficiency in cleaning up resources in the cloud environment in related technologies.
[0006] According to one aspect of the embodiments of the present invention, a resource processing method is provided, including: collecting status information of multiple resources in a cloud environment, where the multiple resources include at least one of the following: virtual machines, containers, storage volumes, database instances, and network devices; evaluating the status information of the multiple resources respectively based on a pre-configured resource cleaning policy for the cloud environment to obtain evaluation results of the multiple resources, where the evaluation results are used to indicate whether the corresponding resources trigger a cleaning action; and in response to the evaluation results of at least one resource indicating that at least one resource triggers a cleaning action, performing a cleaning action on at least one resource based on the resource cleaning policy.
[0007] According to another aspect of the embodiments of the present invention, a resource processing system is further provided, including: a monitoring device configured to respectively evaluate the status information of multiple resources to obtain evaluation results of the multiple resources; a policy configuration device configured to pre-configure a resource cleaning policy for a cloud environment; a policy execution device connected to the monitoring device and the policy configuration device, configured to respectively evaluate the status information of the multiple resources based on the resource cleaning policy to obtain evaluation results of the multiple resources, and in response to the evaluation results of at least one resource indicating that at least one resource triggers a cleaning action, execute a cleaning action on at least one resource based on the resource cleaning policy, where the evaluation results are used to indicate whether the corresponding resources trigger a cleaning action.
[0008] According to another aspect of the embodiments of the present invention, a resource processing device is further provided, including: a collection module configured to collect the status information of multiple resources in a cloud environment, where the multiple resources include at least one of the following: virtual machines, containers, storage volumes, database instances, and network devices; an evaluation module configured to respectively evaluate the status information of the multiple resources based on a resource cleaning policy pre-configured for the cloud environment to obtain evaluation results of the multiple resources, where the evaluation results are used to indicate whether the corresponding resources trigger a cleaning action; a cleaning module configured to, in response to the evaluation results of at least one resource indicating that at least one resource triggers a cleaning action, execute a cleaning action on at least one resource based on the resource cleaning policy.
[0009] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is further provided. The computer-readable storage medium includes an executable program stored therein, where when the executable program runs, it controls the device where the computer-readable storage medium is located to execute the methods in the various embodiments of the present invention.
[0010] According to another aspect of the embodiments of the present invention, an electronic device is further provided, including: a memory storing an executable program; a processor configured to run the program, where when the program runs, it executes the methods in the various embodiments of the present invention.
[0011] According to another aspect of the embodiments of the present invention, a computer program product is further provided, including a computer program, where the computer program implements the methods in the various embodiments of the present invention when executed by a processor.
[0012] According to another aspect of the embodiments of the present invention, a computer program product is further provided, including a non-volatile computer-readable storage medium storing a computer program, where the computer program implements the methods in the various embodiments of the present invention when executed by a processor.
[0013] According to another aspect of the embodiments of the present invention, a computer program is further provided, where the computer program implements the methods in the various embodiments of the present invention when executed by a processor.
[0014] In the embodiment of the present application, first, the status information of various resources in the cloud environment is collected, including virtual machines, containers, storage volumes, database instances, and network devices. Then, according to the pre-configured resource cleaning policy, the status information of these resources is evaluated to obtain an evaluation result for determining which resources need to perform cleaning actions. Finally, according to the evaluation result, the resources that need to be cleaned are triggered to perform cleaning actions, and the resources are cleaned according to the resource cleaning policy. It is easy to notice that by collecting the status information of various resources and evaluating based on the pre-configured resource cleaning policy, through collecting and evaluating the status information of various resources, the situation of each resource can be understood more accurately, avoiding the situation of incorrect cleaning or missed cleaning due to unclear resource status. The pre-configured resource cleaning policy can formulate cleaning criteria and rules according to the actual situation, so as to clean the resources in a targeted manner, improve the cleaning efficiency and accuracy. By automatically triggering the cleaning action in response to the evaluation result, manual intervention can be reduced, the degree of automation of cleaning can be improved, and the cleaning efficiency can be further improved, realizing a more comprehensive analysis and evaluation of the status of various resources, so as to determine which resources need to be cleaned. Triggering the cleaning action according to the evaluation result can ensure that only the resources that need to be cleaned are cleaned, avoiding affecting the resources that are running normally, improving the efficiency and accuracy of resource cleaning in the cloud environment, and thus solving the technical problem of low efficiency in cleaning resources in the cloud environment in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0016] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0017] Figure 1 is a schematic diagram of the hardware environment of a resource processing method according to an embodiment of the present application;
[0018] Figure 2 is a flowchart of a resource processing method according to an embodiment of the present invention;
[0019] Figure 3 is a schematic diagram of an optional resource processing process according to an embodiment of the present invention;
[0020] Figure 4 is a schematic diagram of a data processing system according to an embodiment of the present invention;
[0021] Figure 5 It is a schematic diagram of a data processing device according to an embodiment of the present invention. Detailed implementation manners
[0022] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data used can be interchanged under appropriate circumstances, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0024] The method embodiments provided by the embodiments of the present application can be executed on a computer terminal, a device terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 It is a schematic diagram of the hardware environment of a resource processing method according to an embodiment of the present application. As Figure 1 shown, the computer terminal may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microcontroller unit (MCU) or a field-programmable gate array (FPGA)) and a memory 104 for storing data. In an exemplary embodiment, the above computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only for illustration and does not limit the structure of the above computer terminal. For example, the computer terminal may further include more or fewer components than those Figure 1 shown in the figure, or have the same functions as those Figure 1 shown in the figure or more functions than thoseFigure 1 Different configurations with more functions as shown.
[0025] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the resource processing method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories may be connected to the computer terminal through a network. Examples of the above network include but are not limited to the Internet, intranet, local area network, mobile communication network, and combinations thereof.
[0026] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of the computer terminal. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0027] According to an aspect of the embodiment of the present invention, a resource processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0028] Figure 2 is a flowchart of a resource processing method according to an embodiment of the present invention, as Figure 2 shown, the method includes the following steps:
[0029] Step S202, collect status information of various resources in the cloud environment.
[0030] Among them, the various resources include at least one of the following: virtual machines, containers, storage volumes, database instances, and network devices.
[0031] The above-mentioned cloud environment can refer to a virtualized environment built based on cloud computing technology, which can provide various computing resources and services. The cloud environment can be a public cloud, a private cloud, or a hybrid cloud. Users can choose a suitable cloud environment to deploy applications and store data according to their own needs. In the cloud environment, users can access and manage cloud services through the Internet without having to worry about the underlying hardware devices and infrastructure. The cloud environment provides the characteristics of elasticity, flexibility, and scalability. Users can adjust and expand resources at any time according to business needs. The cloud environment also has high reliability and security, which can guarantee the security and privacy of user data. The cloud environment can include computing resources, storage resources, network resources, and service resources, etc. Users can manage and configure these resources through the management interface or application programming interface provided by the cloud service provider.
[0032] The above-mentioned status information can refer to the real-time status and attribute information of various resources in the cloud environment. The status information can be the specific status information of each resource or the comprehensive evaluation information. For example, it can be the comprehensive index information obtained by comprehensively evaluating or quantifying the specific status information of each resource. Based on the status information, it can help administrators and operation and maintenance personnel understand the usage of resources, monitor the health status of resources, conduct resource planning and optimization, and timely discover and solve problems.
[0033] In an alternative embodiment, collecting the status information of various resources in a cloud environment can help to more comprehensively understand the resource usage in the cloud environment, timely detect situations of resource waste or low resource utilization rate, and thus perform resource cleaning and optimization. Specifically, first, the types of resources to be collected can be determined, which may include virtual machines, containers, storage volumes, database instances, network devices, etc. Different types of resources can be collected for status information in different ways, and appropriate monitoring tools can be selected for deployment according to the determined resource types. For resources such as virtual machines and containers, monitoring tools can be used for monitoring and data collection; for database instances, database performance monitoring tools can be used for monitoring; for network devices, network monitoring tools can be used for monitoring. Corresponding monitoring items can be configured in the monitoring tools to collect the status information of the resources. The monitoring items can include indicators such as processor utilization rate, memory usage rate, disk space utilization rate, network traffic, etc. For different types of resources, different monitoring items can be configured to ensure that the status information of the resources can be more comprehensively collected. Automated operation and maintenance tools can also be used to implement the collection and analysis of resource status information to reduce the workload of administrators. The automated operation and maintenance tools can collect the resource status information by writing scripts or using off-the-shelf plugins, and can perform resource cleaning and optimization operations according to pre-set rules. Or log analysis technology can be adopted to further improve the collection of resource status information. By analyzing the log data generated by the resources, the actual usage of the resources can be understood, including the access situation of the resources, the abnormal situation of the resources, etc.
[0034] The status information obtained in this application may include, but is not limited to, virtual machine status information, which may include the name, identification information, network address, processor usage rate, memory usage rate, disk space usage, running status, power-on / off status, operating system type and version, etc. of the virtual machine; container status information, which may include the name, identification information, image version, start time, running status, node where it is located, network configuration, processor and memory usage, etc. of the container; storage volume status information, which may include the name, identification information, type, block storage, file storage, size, mounting path, usage rate, etc. of the storage volume; database instance status information, which may include the name, version, number of connections, performance metrics, storage usage, backup status, etc. of the database; status information of network devices, which may include the name, network address, physical address, bandwidth usage, connection status, traffic condition, routing table, etc. of the network device. The method for collecting the above status information can be implemented through monitoring tools, application programming interface calls, log analysis, etc. The collected status information can be used to generate reports, charts, and alarm information to help administrators and operation and maintenance personnel comprehensively understand the situation of resources in the cloud environment, timely discover problems and take corresponding measures to ensure the stability, high availability, and security of the cloud environment. Through the analysis and monitoring of the status information, it can help enterprises optimize resource utilization, reduce costs, and improve efficiency, so as to better manage and clean up the resources in the cloud environment.
[0035] Step S204: Based on the resource cleaning policies pre-configured for the cloud environment, evaluate the status information of various resources respectively to obtain the evaluation results of various resources.
[0036] Among them, the evaluation result is used to represent whether the corresponding resource triggers a cleaning action.
[0037] The above-mentioned resource cleaning strategy can refer to a set of rules and conditions set for different types of resources in the cloud environment, which is a strategy for judging whether resources need to be cleaned. By reasonably setting the resource cleaning strategy, the utilization of cloud resources can be effectively managed and optimized. The resource cleaning strategy can include, but is not limited to, resource type, cleaning conditions, cleaning frequency, cleaning actions, etc. Among them, for the resource type, the resource cleaning strategy can clarify which types of resources need to be cleaned, such as storage space, databases, etc. Different types of resources may have different cleaning rules; for the cleaning conditions, the resource cleaning strategy can set some cleaning conditions to judge whether resources need to be cleaned. The cleaning conditions can include indicators such as the utilization rate of resources, idle time, and last access time; for the cleaning frequency, the resource cleaning strategy can also set the frequency of resource cleaning, that is, how often the resource cleaning operation should be carried out, which can avoid the resource cleaning being too frequent or too sparse; for the cleaning actions, the resource cleaning strategy can also include the specific operations during resource cleaning, such as deleting resources, migrating resources, compressing resources, etc. The cleaning actions can be flexibly set according to the resource type and cleaning conditions. By pre-setting the resource cleaning strategy, the automatic management and cleaning of resources in the cloud environment can be realized, improving resource utilization and performance.
[0038] In an alternative embodiment, a resource cleanup policy can be pre-configured. The resource cleanup policy can include information such as which resources need to be cleaned up, what the cleanup conditions are, and how the cleanup priorities are determined. Based on these pre-configured resource cleanup policies, the status information of various resources in the cloud environment can be evaluated to obtain evaluation results for various resources, thereby determining whether to trigger a cleanup action. The setting of the resource cleanup policy can include, but is not limited to, resource type, cleanup conditions, cleanup priority, and cleanup policy update. Among them, the resource type can refer to the type of resources determined to need cleanup, such as virtual machines, storage, networks, etc. The cleanup conditions can refer to the conditions for setting resource cleanup, such as the resource idle time exceeding a certain threshold, the resource utilization rate being lower than a certain percentage, etc.; the cleanup priority can refer to setting the cleanup priority for different types of resources to ensure the execution order of the cleanup action. The cleanup policy update can refer to regularly checking and updating the resource cleanup policy to adapt to changes in the cloud environment. When evaluating the resource status information, the status of various resources can be analyzed and evaluated according to the conditions set by the resource cleanup policy. For example, for virtual machine resources, it can be determined whether to clean up by monitoring the running status and resource utilization rate of the virtual machine; for storage resources, the utilization rate of the storage space and the access frequency of storage objects can be checked to evaluate the necessity of cleanup. The evaluation results can be used to indicate whether a cleanup action is triggered for the corresponding resources. If the evaluation results meet the conditions set by the resource cleanup policy, a cleanup action can be triggered to clean up the resources. The cleanup action can include operations such as releasing resources, migrating resources, and adjusting resource configurations to improve resource utilization and reduce costs. In the above process, by evaluating the status information of various resources based on the pre-configured resource cleanup policy, resources that are no longer needed can be cleaned up in a timely manner, space and resources can be released, resource utilization can be improved, automated management of resource cleanup can be achieved, manual intervention can be reduced, efficiency can be improved, and resources in the cloud environment can be better managed and optimized by reasonably setting the resource cleanup policy and accurately evaluating the resource status.
[0039] Step S206, in response to the evaluation results of at least one resource indicating that at least one resource triggers a cleanup action, execute a cleanup action on at least one resource based on the resource cleanup policy.
[0040] In an alternative embodiment, in response to the evaluation result indicating that a resource triggers a cleanup action, a cleanup strategy can be determined first, that is, cleanup rules and processes are formulated according to the actual situation. The cleanup strategy can include how to identify resources that need to be cleaned up, the cleanup priority, the cleanup method, etc. Then, based on the evaluation result, the resources that need to be cleaned up can be determined, which can be unused resources, expired resources, duplicate resources, etc. Through system analysis and comparison, the resources that need to be cleaned up are identified. According to the cleanup strategy, cleanup actions can be performed on the identified resources. The ways to clean up resources can include deletion, merging, moving, etc. Which specific way to adopt can be determined according to the nature of the resources and the cleanup strategy, and the cleanup effect can be monitored and evaluated to ensure that the cleanup action achieves the expected effect. The cleanup effect can be monitored through system logs, reports, etc., and the cleanup strategy can be adjusted in a timely manner. In the actual cloud resource management / cleanup process, automated tools can be used to achieve automatic identification and cleanup of resources, reducing the cost and error rate of manual operations. At the same time, machine learning and artificial intelligence technologies can be combined to perform intelligent analysis and identification of resources, improving the accuracy and efficiency of cleanup. Containerization and microservices architecture can also be adopted to manage resources, enabling rapid deployment and cleanup of resources, improving resource utilization and system flexibility. In the above process, by cleaning up unused and duplicate resources, more resource space can be released, improving resource utilization and system performance. Through automated cleanup and intelligent identification, manual operation costs and time costs can be reduced, and the overall cost of resource management can be lowered. By cleaning up resources, resource management strategies can be optimized, resource waste and chaos can be reduced, and the management efficiency and maintainability of resources can be improved.
[0041] In the embodiments of the present application, first, the status information of various resources in the cloud environment is collected, including virtual machines, containers, storage volumes, database instances, and network devices. Then, according to the pre-configured resource cleaning policy, the status information of these resources is evaluated to obtain an evaluation result for determining which resources need to perform cleaning actions. Finally, according to the evaluation result, the resources that need to be cleaned are triggered to perform cleaning actions, and the resources are cleaned according to the resource cleaning policy. It is easy to notice that, by collecting the status information of various resources and evaluating based on the pre-configured resource cleaning policy, through collecting and evaluating the status information of various resources, the situation of each resource can be understood more accurately, avoiding mis-cleaning or missed cleaning due to unclear resource status. The pre-configured resource cleaning policy can formulate cleaning criteria and rules according to the actual situation, so as to clean the resources in a targeted manner, improve the cleaning efficiency and accuracy. By automatically triggering the cleaning action in response to the evaluation result, manual intervention can be reduced, the degree of automation of cleaning can be improved, and the cleaning efficiency can be further improved, realizing a relatively comprehensive analysis and evaluation of the status of various resources, so as to determine which resources need to be cleaned. Triggering the cleaning action according to the evaluation result can ensure that only the resources that need to be cleaned are cleaned, avoiding affecting the resources that are running normally, improving the efficiency and accuracy of resource cleaning in the cloud environment, and thus solving the technical problem of low efficiency in cleaning the resources in the cloud environment in the related art.
[0042] In the embodiments of the present invention, the resource cleaning policy includes: at least one evaluation criterion and a cleaning condition, wherein different evaluation criteria are used to represent different dimensions for evaluating the status information, and the cleaning condition is used to represent the condition for any resource to trigger a cleaning action; based on the resource cleaning policy pre-configured for the cloud environment, the status information of various resources is respectively evaluated to obtain evaluation results of various resources, including: reading target data matching at least one evaluation criterion from the status information of any resource; using an evaluation model and at least one evaluation criterion to perform quantization processing on the target data to obtain quantization results corresponding to at least one evaluation criterion; summarizing the quantization results corresponding to at least one evaluation criterion to obtain a comprehensive quantization index of any resource; and analyzing the comprehensive quantization indexes of various resources based on the cleaning condition to obtain evaluation results of various resources.
[0043] In an alternative embodiment, formulating a cleaning strategy can effectively optimize resource utilization, improve system performance, and reduce resource waste. During the resource cleaning process, setting evaluation criteria and cleaning conditions can help determine which resources need to be cleaned and the priority of cleaning. First, at least one evaluation criterion can be defined to characterize different dimensions for evaluating status information. The evaluation criteria can include indicators such as resource utilization rate, idle time, cost-benefit ratio, resource usage rate, idle rate, access frequency, response time, etc. These indicators can help judge the health status of resources and thus determine whether cleaning is required. And cleaning conditions can be defined, which are the conditions for triggering resource cleaning actions. The cleaning conditions can be that the usage rate of a resource exceeds a certain threshold, the idle rate of a resource is lower than a certain threshold, the access frequency of a resource is lower than a certain threshold, etc. In the actual implementation process, first, target data matching at least one evaluation criterion can be read from the status information of any resource. For example, information such as the usage rate and idle rate of a certain storage resource can be read. Then, the evaluation model and at least one evaluation criterion can be used to perform quantization processing on the target data to obtain quantization results corresponding to at least one evaluation criterion. The quantization processing can adopt methods such as statistical analysis and machine learning to convert the status information into comparable numerical values. Then, the quantization results corresponding to at least one evaluation criterion can be summarized to obtain a comprehensive quantization index of the resource. The comprehensive quantization index can reflect the overall status of the resource. Finally, based on the cleaning conditions, the comprehensive quantization indexes of multiple resources can be analyzed to obtain the evaluation results of multiple resources. According to the evaluation results, it can be determined which resources need to be cleaned and the priority of cleaning. In the actual process of implementing the resource cleaning strategy, data analysis and mining techniques can be used to analyze the resource status information to discover the rules and trends in the data. At the same time, machine learning and artificial intelligence algorithms can be used to establish an evaluation model to predict and optimize the resource status. Automation techniques and big data processing techniques can also be applied to achieve the automation and high efficiency of the resource cleaning strategy. Through automation tools and scripts, resources can be evaluated and cleaned regularly, reducing manual intervention and improving the efficiency of resource management.
[0044] Through the above steps, the automated management and cleaning of cloud resources can be achieved, improving resource utilization and reducing resource waste. By setting evaluation criteria and cleaning conditions, the health status of resources can be judged more accurately, avoiding over-cleaning or neglecting resources that need to be cleaned. Through quantization processing and the calculation of comprehensive quantization indexes, resources can be objectively evaluated, reducing the influence of subjective factors. Through the automated cleaning process, resource utilization can be improved, manual intervention can be reduced, and the stability and reliability of the system can be enhanced.
[0045] In an embodiment of the present invention, in response to at least one evaluation criterion including resource utilization rate; reading target data that matches at least one evaluation criterion from the status information of any type of resource includes: reading the processor usage time, memory occupancy, storage space occupancy, and data transfer volume from the status information of any type of resource to obtain the target data; using an evaluation model and at least one evaluation criterion to perform quantization processing on the target data to obtain quantization results corresponding to at least one evaluation criterion, including: determining the processor utilization rate based on the processor usage time and a preset time period; determining the memory utilization rate based on the memory occupancy and the total memory amount pre-configured for multiple resources; determining the storage utilization rate based on the storage space occupancy and the total storage space capacity; determining the bandwidth utilization rate based on the data transfer volume and a preset data transfer volume; determining the quantization result corresponding to any one evaluation criterion based on the processor utilization rate, memory utilization rate, storage utilization rate, and bandwidth utilization rate.
[0046] In an alternative embodiment, evaluating the utilization rate of resources can help better understand the resource utilization situation, thereby effectively managing and cleaning resources. Specifically, first, resource status information such as the processor usage time, memory occupancy, storage space occupancy, and data transfer volume can be read from a cloud platform or a monitoring system. This information can be obtained in real time through an application programming interface or monitoring software for subsequent quantization processing. Then, the read resource status information is sorted out and calculated to obtain the target data. For example, the processor utilization rate can be calculated by the ratio of the processor usage time to the preset time period, the memory utilization rate can be calculated by the ratio of the memory occupancy to the total memory amount, the storage utilization rate can be calculated by the ratio of the storage space occupancy to the total storage space capacity, and the bandwidth utilization rate can be calculated by the ratio of the data transfer volume to the preset data transfer volume. Finally, an evaluation model and at least one evaluation criterion can be used to perform quantization processing on the target data to obtain quantization results corresponding to at least one evaluation criterion. For example, different thresholds can be set to evaluate the resource utilization rate, and the resource utilization rate is compared with these thresholds to obtain the evaluation result of the resource utilization rate.
[0047] In practical applications, machine learning algorithms can be used to analyze historical data to predict the trend of resource utilization rate, further optimize the resource management strategy. Automated tools can be introduced to automatically adjust and clean resources according to the evaluation results, improve the resource utilization efficiency, and container technology can be combined to achieve dynamic allocation and management of resources, improve the resource utilization rate and flexibility. Also, the resource management tools provided by the cloud platform can be used to achieve real-time monitoring and analysis of the resource utilization rate, help users adjust the resource configuration in a timely manner, and can comprehensively evaluate and manage the cloud resource utilization rate, improve the resource utilization efficiency, reduce resource waste, optimize the system performance, and enhance the user experience.
[0048] In an embodiment of the present invention, based on the processor utilization rate, memory utilization rate, storage utilization rate, and bandwidth utilization rate, determining a quantization result corresponding to any one of the evaluation criteria includes: determining a weight corresponding to the processor utilization rate based on the service requirements of multiple resources and the importance of the processor utilization rate to multiple resources; determining a weight corresponding to the memory utilization rate based on the service requirements of multiple resources and the importance of the memory utilization rate to multiple resources; determining a weight corresponding to the storage utilization rate based on the service requirements of multiple resources and the importance of the storage utilization rate to multiple resources; determining a weight corresponding to the bandwidth utilization rate based on the service requirements of multiple resources and the importance of the bandwidth utilization rate to multiple resources; determining a weighted average value of the processor utilization rate, memory utilization rate, storage utilization rate, and bandwidth utilization rate based on the weights corresponding to the processor utilization rate, memory utilization rate, storage utilization rate, and bandwidth utilization rate, to obtain the quantization result.
[0049] In an alternative embodiment, considering that different service requirements and resource importance will affect the priority and strategy of resource cleaning, the weights of the processor utilization rate, memory utilization rate, storage utilization rate, and bandwidth utilization rate can be determined to perform weighted calculation to obtain the quantization result. Specifically, first, the service requirements can be understood, which can include the demand levels for the processor, memory, storage, and bandwidth, and the importance and influence levels of different resources in the service can be understood. Then, according to the actual situation, the weights of various resources can be determined, and the weights can be determined through expert evaluation, data analysis, and statistical methods. After determining the weights of each resource, the weighted average value of each resource utilization rate can be calculated, and it can be calculated through the weighted average formula, that is, multiplying each resource utilization rate by the corresponding weight and then adding them up to obtain the total. In practical applications, the collected resource utilization rate data can be processed and analyzed. Data analysis tools or programming languages can be used for data cleaning, transformation, and calculation. Methods such as statistical analysis, machine learning, or deep learning can be used to discover the patterns and trends of resource utilization rates. The data can also be visualized into charts, reports, or dashboards to intuitively display the resource utilization situation. Data visualization tools or programming libraries can be used to generate various visualization effects to help better understand the resource utilization situation. The weight calculation and the decision-making process of resource cleaning can also be automated by writing scripts, programs, or using automated tools. The operation of resource cleaning can be automatically triggered according to the result of the weighted average value to achieve effective management and optimization of resources.
[0050] In the above process, the weights of the processor utilization rate, memory utilization rate, storage utilization rate, and bandwidth utilization rate are determined, and the weighted average is calculated. Through the methods of weight calculation and weighted average, the utilization of each resource can be evaluated more accurately, the resource allocation and utilization can be effectively optimized, the resource utilization rate and performance can be improved, which can help to realize the intelligentization and optimization of resource management, improve the performance and efficiency of the system, and meet the requirements of different business needs.
[0051] In an embodiment of the present invention, in response to at least one evaluation criterion including resource utilization rate, idle time, and cost-benefit ratio; the quantization results corresponding to the at least one evaluation criterion are summarized to obtain a comprehensive quantization index of any resource, including: obtaining the ratio of the average utilization rate and the cost-benefit ratio index to obtain an index ratio; obtaining the difference between a preset value and the idle time index to obtain an index difference; obtaining the product of the index ratio and the index difference to obtain a comprehensive quantization index of any resource.
[0052] In an alternative embodiment, the utilization rate, idle time, and cost-benefit ratio of resources can be evaluated. These evaluation criteria can be quantified and combined through calculation to obtain a comprehensive quantification index, so as to better evaluate the utilization and benefits of resources, achieve a more comprehensive understanding of the comprehensive situation of resources, and thus better guide resource management and cleaning work. Specifically, the specific calculation methods for each evaluation criterion can be defined first. The resource utilization rate can be calculated by the ratio of the actual usage time to the total time of the resource. The idle time can be obtained by subtracting the actual usage time from the total time of the resource. The cost-benefit ratio can be calculated by the ratio of the revenue to the cost of the resource. These calculation methods can be adjusted and optimized according to specific business scenarios and resource types. Then, the quantified results corresponding to each evaluation criterion can be summarized to obtain a comprehensive quantification index. The average utilization rate and cost-benefit ratio index of the resource can be calculated, and then the ratio of the two can be used as the index ratio, which can help us more comprehensively evaluate the utilization and benefits of resources. The difference between the preset value of the resource and the idle time index can be calculated to obtain the index difference, which can help us more clearly understand the idle situation of the resource and the potential improvement space. The product of the index ratio and the index difference can also be used as the comprehensive quantification index of the resource, which can more comprehensively reflect the comprehensive situation and optimization space of the resource. Through the above quantification and summarization process, we can more clearly understand the utilization and benefits of resources and formulate corresponding management and cleaning strategies accordingly. Through the comparison and analysis of the quantification indexes, we can more specifically manage and optimize resources, thereby improving the utilization rate and benefits of resources, reducing costs, and enhancing business efficiency. Through the comprehensive quantification index, we can more comprehensively understand the utilization and benefits of resources, and thus more specifically conduct resource management and cleaning. Through the comparison and analysis of the quantification indexes, we can more accurately determine the optimization direction and key points of resources, thereby improving the utilization rate and benefits of resources.
[0053] In the embodiment of the present invention, based on the cleaning conditions, the comprehensive quantification indexes of multiple resources are analyzed to obtain the evaluation results of multiple resources, including: sorting multiple resources based on the comprehensive quantification indexes of multiple resources to obtain a sorted resource sequence; determining at least one resource from the sorted resource sequence based on the cleaning conditions; determining that the evaluation results of at least one resource indicate that multiple resources trigger a cleaning action, and the evaluation results of other resources indicate that other resources do not trigger a cleaning action, where the other resources are used to represent any one of multiple resources except at least one resource.
[0054] In an alternative embodiment, some quantitative metrics of resources can be defined first. These metrics can include evaluations in aspects such as resource utilization rate, performance, and security. Then, different resources can be sorted according to these metrics to obtain a resource sequence. Next, at least one resource to be cleaned can be determined from the sorted resource sequence according to the cleaning conditions. The cleaning conditions can be some predefined rules, such as the resource utilization rate exceeding a certain threshold, the performance being lower than a certain standard, etc. According to these cleaning conditions, it can be determined which resources need to be cleaned. After determining at least one resource to be cleaned, an evaluation of the resource can be performed to determine whether the cleaning action needs to be triggered. The evaluation process can include considerations such as the actual usage of the resource and its impact on the overall system performance. If the evaluation result indicates that a certain resource requires a cleaning action, then the cleaning operation can be executed. The above process can consider using machine learning or artificial intelligence algorithms to optimize the resource sorting and evaluation processes. By training the model, the usage and performance of resources can be predicted more accurately, thereby better determining the cleaning priorities and strategies.
[0055] In the above process, based on the comprehensive quantitative metrics of multiple resources, multiple resources are sorted to achieve the comprehensive evaluation and sorting of multiple resources, which can help determine which resources need to be cleaned and the cleaning priorities. Through the quantitative metrics and the sorting process, the situation of resources can be evaluated more objectively, avoiding the influence of subjective factors, and the resources to be cleaned can be determined according to the actual situation, avoiding unnecessary cleaning operations, achieving better management of cloud resources, and improving resource utilization and system performance.
[0056] In the embodiment of the present invention, the method further includes: in response to detecting a change in the cloud environment or a change in the business requirements of the cloud environment, adjusting the parameters of the evaluation model and / or the resource cleaning strategy based on the collected change information; in response to performing a cleaning action on at least one resource, adjusting the parameters of the evaluation model and / or the resource cleaning strategy based on the collected feedback information.
[0057] In an alternative embodiment, the cloud resource cleaning process can respond to changes in the cloud environment or changes in the business requirements of the cloud environment. Based on the collected change information, the parameters of the evaluation model and the resource cleaning strategy can be adjusted to better adapt to the actual situation. After performing the cleaning action on at least one resource, the parameters of the evaluation model and the resource cleaning strategy can be adjusted according to the collected feedback information to continuously optimize the resource management and cleaning effect. Specifically, first, information such as the usage status, performance data, and network traffic of resources in the cloud environment can be collected in real time through monitoring tools or systems to detect situations such as high resource utilization, performance degradation, or network congestion. When it is detected that the business requirements of the cloud environment have changed, the reasons for the change and its impact on resource management and cleaning can be analyzed in a timely manner. For example, if the business requirements increase, resources can be added to meet the demand; if the business requirements decrease, some resources can be released to save costs. Based on the collected change information and the analysis results of the changes in business requirements, the parameters of the evaluation model and the resource cleaning strategy can be adjusted. The parameter configuration can be modified through automated tools or scripts to achieve dynamic resource adjustment and optimization. For the detected resource cleaning requirements, corresponding resource cleaning actions can be executed, which can include operations such as releasing idle resources, merging redundant resources, and migrating data to ensure the effective utilization and management of resources. After the resource cleaning action is completed, feedback information can also be collected, including data on cleaning effects, performance improvement, and cost savings. The feedback information can be used to evaluate the effectiveness of the resource cleaning strategy and provide a basis for subsequent adjustments. Based on the collected feedback information, the parameters of the evaluation model and the resource cleaning strategy can be adjusted again. By continuously optimizing the parameters and strategies, a more intelligent and efficient resource management and cleaning process can be achieved. In practical applications, machine learning and artificial intelligence technologies can be used to optimize the resource management and cleaning process. For example, machine learning algorithms can be used to analyze historical data to predict future resource requirements, so as to adjust resource allocation in advance and avoid resource waste or insufficiency. At the same time, deep learning technologies can be used to optimize the resource cleaning strategy. Through training and learning with large-scale data, more accurate and efficient resource cleaning can be achieved. Automated operation and maintenance tools and containerization technologies can also be adopted to realize the automation and programmability of resource management and cleaning. Through automated tools, dynamic adjustment and monitoring of resources can be achieved, reducing manual intervention and improving efficiency. At the same time, through containerization technology, rapid deployment and migration of resources can be realized, improving resource utilization and flexibility.
[0058] In the above process, adjustments are made by setting to respond to changes in business requirements and feedback information. By promptly responding to changes in business requirements and feedback information, the intelligent and automated management and cleaning of resources can be achieved, improving resource utilization and management efficiency. By dynamically adjusting resource allocation and cleaning strategies, the performance stability and improvement of the cloud environment can be ensured, enhancing user experience and business efficiency. By adjusting resource management and cleaning strategies according to business requirements and feedback information, the flexible deployment and migration of resources can be realized to adapt to different business scenarios and demand changes.
[0059] In an embodiment of the present invention, the method further includes: during the process of performing a cleaning action on at least one type of resource, obtaining the execution data of the cleaning action, where the execution data at least includes: execution time, execution object, and execution result; generating a resource cleaning log for multiple resources based on the execution data; storing the resource cleaning log in a log database, and sending the resource cleaning log to a target terminal.
[0060] In an alternative embodiment, during the process of performing a cleaning action, execution data such as execution time, execution object, and execution result can be obtained. A resource cleaning log for multiple resources can be generated based on the execution data. The resource cleaning log can include information such as the type of cleaning action, execution time, execution object, execution result, and resource status before and after cleaning. The resource cleaning log can be stored in a log database. The log database can be a relational database or a non-relational database, which can be selected according to the actual situation. Storing the resource cleaning log helps to conveniently view the execution status of resource cleaning and perform analysis and optimization. Finally, the resource cleaning log can be sent to a target terminal. The target terminal can be the email of the system administrator, a message queue, a monitoring system, etc. By sending the resource cleaning log to the target terminal, the system administrator can timely understand the situation of resource cleaning and handle abnormal situations in a timely manner. In practical applications, a message queue or a log collection tool can be used to transmit the resource cleaning log to the target terminal. The message queue can ensure the reliability and real-time nature of log transmission, and the log collection tool can help the system administrator to centrally manage and monitor the logs. Log analysis tools can be used to analyze the resource cleaning log to generate reports and charts to help the system administrator understand the effect and trend of resource cleaning. By analyzing the resource cleaning log, problems can be timely discovered and optimized, improving the efficiency and accuracy of resource cleaning.
[0061] In the above process, it is possible to achieve comprehensive monitoring and management of the cloud resource cleaning process, ensuring the effective utilization of resources and the stable operation of the system. At the same time, a resource cleaning log is generated based on the execution data, stored in the log database and sent to the target terminal. System administrators can conveniently view the execution status and results of resource cleaning, discover problems in a timely manner and handle them. Through the resource cleaning log, the execution process of resource cleaning can be traced, helping system administrators to troubleshoot faults and locate problems.
[0062] In an embodiment of the present invention, the method further includes: in response to receiving a log query request sent by a client, reading a target cleaning log corresponding to the log query request from the log database; sending the target cleaning log to the client.
[0063] In an optional embodiment, in response to receiving a log query request sent by a client, a target cleaning log corresponding to the log query request can be read from the log database and sent to the client. Specifically, when the client sends a log query request, after receiving the request, the server can query according to the parameters in the request, such as time range, keywords, etc., from the log database, which can be implemented by using a database query language. The log data that meets the requirements is filtered according to the query conditions. Then, the server can sort out and process the queried target cleaning log data, which can be formatted according to the client's needs, such as converted into a specific file format, or sorted and filtered according to specific fields. This can ensure that the client can more conveniently process and analyze these log data. Finally, the server can send the sorted target cleaning log data to the client, which can be implemented through a network transmission protocol, packaging the data into data packets and transmitting them to the client through the network. After receiving the data, the client can perform further processing and analysis, such as displaying on the interface, storing in a local file, etc. In practical applications, a suitable database system can be selected for the log database, and optimization operations such as indexing and partitioning can be performed according to requirements to improve query performance. In terms of data transmission, a compression algorithm can be used to reduce the size of the data packets and improve the transmission efficiency. In terms of data processing, a data processing framework can be used for parallel processing to speed up the data processing speed. In the above process, the client can flexibly query and obtain log data according to its own needs, improving the availability and real-time nature of the data. Responding to the client's log query request and sending the target cleaning log to the client can improve the performance and stability of the system and provide a better service experience for users.
[0064] In an embodiment of the present invention, based on a resource cleaning policy pre-configured for a cloud environment, the status information of multiple resources is respectively evaluated to obtain evaluation results of the multiple resources, including: obtaining a target policy class corresponding to the resource cleaning policy, where the target policy class is generated by encapsulating the resource cleaning policy; executing the target policy class, and based on the resource cleaning policy, respectively evaluating the status information of the multiple resources to obtain evaluation results of the multiple resources.
[0065] In an alternative embodiment, a target policy class corresponding to the resource cleaning policy can be obtained. The target policy class can be generated by encapsulating the resource cleaning policy, which can help to better execute the resource cleaning policy. The target policy class can include specific methods and logics for cleaning resources, as well as methods for evaluating resource status information. Then, the target policy class can be executed, and based on the resource cleaning policy, the status information of multiple resources is respectively evaluated to obtain evaluation results of the multiple resources. Specifically, the types and conditions of resources to be cleaned can be determined according to the resource cleaning policy. For example, unused storage space, expired virtual machine instances, etc. can be cleaned. Various resources can be traversed to obtain the status information of the resources, and the application programming interface of the cloud service provider can be called to obtain information such as the usage and status of the resources. Then, according to the evaluation method defined in the target policy class, the status information of the resources can be evaluated, and information such as the resource usage and status can be compared and analyzed to determine which resources need to be cleaned. Finally, according to the evaluation results, resource cleaning operations can be performed, such as releasing unused resources and deleting expired resources.
[0066] In the above process, multiple resources can be effectively cleaned according to the pre-configured resource cleaning policy. By evaluating the status information of multiple resources based on the resource cleaning policy pre-configured for the cloud environment and executing the target policy class, more efficient resource management and cleaning effects can be brought, while improving the neatness and security of the cloud environment, realizing automated and intelligent resource management, which can help the cloud environment better meet business requirements and improve the overall operation efficiency and performance.
[0067] The following describes the technical application proposed in this application in combination with an alternative embodiment. This application proposes a cloud resource cleaning method and device based on the policy pattern. The device automatically monitors, analyzes, and cleans resources in the cloud environment through pre-defined or dynamically configured cleaning policies, realizing efficient management and optimized utilization of cloud resources. This application is applicable to the resource efficient use requirements in various cloud computing environments, and has high practical value and broad application prospects.
[0068] The cloud resource cleaning device of the present application may mainly include the following parts: a policy configuration module, a resource monitoring module, a policy execution engine, a log and report module, and a user interaction interface. Among them, the policy configuration module can allow users to define cleaning policies according to actual needs, including resource types, evaluation criteria, such as resource utilization, idle time, cost-effectiveness ratio, etc.; cleaning conditions, such as reaching a specific threshold, meeting a specific time condition, etc.; and cleaning actions, such as deletion, suspension, migration, etc. The policy supports flexible configuration and can be customized according to different business scenarios. The resource monitoring module can be responsible for collecting the status information of various resources in the cloud environment in real time or periodically, which may include but is not limited to the processor (Central Processing Unit, referred to as CPU) usage, memory usage, storage usage, network traffic, etc. The monitoring data can be used as the basis for policy execution; the policy execution engine can analyze the data collected by the resource monitoring module according to the policy defined in the policy configuration module, determine which resources meet the cleanup conditions, and automatically trigger the corresponding cleanup actions without human intervention; the log and report module can record the detailed information of each cleanup operation, which may include the operation time, operation object, operation result, etc., and generate a cleanup report for users to review, which helps users understand the cleanup effect and optimize the policy configuration; the user interaction interface can provide a friendly graphical interface to facilitate users to configure policies, view monitoring data, review cleanup reports and perform other related operations.
[0069] Figure 3 is a schematic diagram of an optional resource processing process according to an embodiment of the present invention, such as Figure 3 As shown, the resource monitoring module can collect monitoring data for multiple monitoring objects. The figure shows three monitoring objects by way of example, but is not limited to this; the policy execution engine can obtain monitoring data from the resource monitoring module and read policies from the policy configuration module; the policy execution engine can perform policy optimization and record logs.
[0070] For the purpose of achieving efficient use of cloud resources and avoiding resource waste, the cloud resource cleaning method based on the strategy pattern proposed in this application can be implemented as follows: The cleaning strategy can be designed using the strategy pattern, encapsulating different cleaning logics into independent strategy classes, and interacting with the strategy execution engine through the strategy interface. This can improve the flexibility and scalability of the system. Users can add, modify, or delete strategies as needed without modifying the code of the strategy execution engine. The strategy interface can be defined by defining a strategy interface that specifies the methods that each strategy class needs to implement, such as evaluating whether a resource meets the cleaning conditions and performing the cleaning action. The strategy classes can be implemented by creating multiple specific strategy classes according to actual needs, and each class implements the methods defined in the strategy interface. For example, a cleaning strategy class based on resource utilization can be created to evaluate resources with CPU or memory usage below a set threshold, or a cleaning strategy class based on idle time can be created to delete resources that have been continuously idle for more than a specified number of days. The strategy can be registered and selected. The strategy configuration module can provide a strategy registration function that allows users to register custom strategy classes into the system. When executing the cleaning task, the strategy execution engine selects the corresponding strategy class according to the strategy configuration for execution.
[0071] During the resource monitoring and strategy execution of this application, a resource status evaluation algorithm is designed, and a relatively efficient resource status evaluation algorithm is designed to accurately determine whether a resource meets the cleaning conditions. The algorithm can consider various factors, such as resource utilization, idle time, cost-benefit ratio, etc., and conduct a comprehensive evaluation according to the strategies defined by users. The resource status evaluation algorithm can first collect real-time or historical data of various resources in the cloud environment, and then analyze and process these data according to the preset evaluation model and the strategies defined by users, and finally output the cleaning priority of the resources or the judgment result of whether they meet the cleaning conditions. The resource monitoring data can be collected. In this application, the monitoring data collection can use the technology stack (Prometheus), and collect the monitoring data of various resources through a custom exporter. For example: The resource types can include, but are not limited to, virtual machines, containers, storage volumes, database instances, network devices, etc. The key metrics can be as follows:
[0072] Resource utilization: CPU usage, memory occupancy, storage usage, network bandwidth occupancy, etc. The definitions of each metric can be as follows:
[0073] CPU utilization = (CPU usage time / CPU total time) × 100%;
[0074] Among them, the CPU usage time can refer to the total time that the CPU is actually used within a specific time period, and the CPU total time is the total length of this time period, such as one hour, one day, etc., which can be determined according to actual needs and is not limited here.
[0075] Memory utilization rate = (Used memory amount / Total memory amount) × 100%;
[0076] Among them, the used memory amount can be the memory amount currently occupied by application programs and the system, and the total memory amount can be the total memory configured by the system.
[0077] Storage utilization rate = (Used storage capacity / Total storage capacity) × 100%;
[0078] Among them, the used storage capacity can be the amount of space already used on the current storage device, and the total storage capacity can be the total capacity of the storage device.
[0079] Bandwidth utilization rate = (Actual transmitted data volume / Theoretical maximum transmitted volume within a time period) × 100%;
[0080] Among them, the theoretical maximum transmitted volume within a time period can be calculated based on the bandwidth rate and the time period.
[0081] The idle time can refer to the time since the resource was last active, such as when the CPU usage rate exceeds a specific threshold, network traffic is generated, etc. Calculate the idle time of the resource and compare it with a preset idle time threshold. The longer the idle time, the greater the possibility that the resource is idle and the higher the cleaning priority.
[0082] The cost information can refer to the current cost of the resource, the cost per unit time, the expected future cost, etc. According to the cost information of the resource and the expected benefits, it can be estimated based on business logic or historical data to calculate the cost-benefit ratio. Resources with a low cost-benefit ratio may no longer have economic value and can be potential cleaning targets.
[0083] Other metadata can include the resource owner, the project it belongs to, the creation time, resource tags, etc.
[0084] During the execution of the cleaning policy, a weighted average can be adopted. A weight can be assigned to various resource utilization rates, and then the weighted average is calculated. The assignment of weights can depend on business requirements and the importance of the resources. Assume that the user sets the weights for the utilization rates of the CPU, memory, storage, and bandwidth to 0.3, 0.2, 0.3, and 0.2 respectively. These weights are examples and can be adjusted as needed, which is not limited here. Thus, the resource utilization rate = 0.3 × CPU utilization rate + 0.2 × memory utilization rate + 0.3 × storage utilization rate + 0.2 × bandwidth utilization rate. This application designs an algorithm that comprehensively considers resource utilization rate, cost information, and idle time utilization rate. It can first clarify how each factor is quantified and determine the relative importance of each factor in the overall evaluation. The algorithm design can be as follows:
[0085] Resource utilization rate (Ur). For various resources such as CPU, memory, storage, and bandwidth, based on the utilization calculation formula, the weighted average of the utilization rates of each resource can be taken as an indicator of the overall resource utilization rate. Cost information (C). The cost information can include the purchase cost, operating cost, maintenance cost, etc. of the resources. For simplicity, the Cost Efficiency Ratio (CER) can be used, which can represent the resource utilization rate obtained per unit cost. The lower the CER, the higher the cost - effectiveness. Idle time (Tidle). The idle time can refer to the time when the resource is not used within a certain period. To incorporate it into the utilization formula, the idle time ratio can be calculated, that is, the ratio of idle time to the total time, and this ratio is attempted to be minimized. Composite Utilization Index (CUI) = (weighted average resource utilization rate / Cost Efficiency Ratio (CER)) × (1 - idle time ratio).
[0086] Suppose there are three resources, CPU, memory, and storage. The utilization rates of CPU, memory, and storage are 80%, 60%, and 70% respectively, and the weights are 0.4, 0.3, and 0.3. The total cost is 1000 yuan, and the total resource utilization rate is (0.4 * 80% + 0.3 * 60% + 0.3 * 70%) = 69%; assume the estimated CER is 1.5, that is, 0.67 of resource utilization rate is obtained per unit cost; the idle time ratio is 10%, then the Composite Utilization Index can be CUI = (0.69 / 1.5) × (1 - 0.1) ≈ 0.414.
[0087] During the cleaning process, the resources can be sorted according to the obtained composite resource utilization rate. The lower the utilization rate, the more serious the resource waste, and the higher the probability that the resource will be cleaned. When the configuration threshold and conditions are exceeded, the cleaning is triggered; according to the resource cleaning strategy configured by the user, the configuration implementation of resource cleaning can be obtained, such as deletion, suspension, and migration. Logs and reports can be generated to record the detailed information of each cleaning operation, including the operation time, operation object, operation result, etc., and a cleaning report can be generated for the user to view, which helps the user understand the cleaning effect and optimize the strategy configuration. User notifications can be made. When a cleaning situation occurs, the system can send notifications to the user in a timely manner so that the user can understand the task status and take corresponding measures. The system can support notifications through the user operation log. During the optimization and adjustment process, a feedback mechanism can be implemented to collect the feedback on the effect of the cleaning operation, such as the change in resource utilization rate after cleaning, cost savings, etc., for optimizing the evaluation model and strategy configuration. Dynamic adjustment can be carried out. According to the real - time changes in the cloud environment and the changes in business requirements, the parameters of the evaluation model and the strategy configuration can be dynamically adjusted to ensure the accuracy and efficiency of resource cleaning.
[0088] This application proposes a cloud resource cleaning device based on the strategy pattern, achieving better utilization of cloud resources. After testing, it has greatly improved the resource utilization rate, saved costs, increased the overall resource utilization rate of the data center, and reduced the occupation of invalid resources; through the design of a multi-factor resource utilization method, it measures the comprehensive utilization rate of resources in multiple dimensions, which is more accurate than the traditional method based on the utilization rate of the resources themselves; it introduces notification and recording functions, which can notify users in a timely manner when resources are accidentally deleted, improving the stability and maintainability of the system; it is applicable to various cloud computing environments and scenarios, with high generality and applicability.
[0089] This application proposes a cloud resource cleaning device based on the strategy pattern, achieving efficient use of cloud resources, avoiding resource waste, and improving the resource utilization rate and other capabilities. In the policy configuration part, users can define cleaning policies according to actual needs, including resource types, evaluation criteria such as resource utilization rate, idle time, cost-benefit ratio, etc.; cleaning conditions such as reaching specific thresholds and meeting specific time conditions; and cleaning actions such as deletion, suspension, and migration. The policy supports flexible configuration and can be customized according to different business scenarios. The resource monitoring configuration part is responsible for collecting the status information of various resources in the cloud environment in real time or regularly, which may include but is not limited to CPU utilization rate, memory occupancy, storage usage, network traffic, etc. The monitoring data can be used as the basis for policy execution. The policy automatic execution part can analyze the data collected by the resource monitoring module according to the policies defined in the policy configuration module, determine which resources meet the cleaning conditions, and automatically trigger the corresponding cleaning actions without manual intervention. The log and report notification part can record the detailed information of each cleaning operation, including operation time, operation object, operation result, etc., and generate a cleaning report for users to view, which helps users understand the cleaning effect and optimize the policy configuration.
[0090] According to another aspect of the embodiments of the present invention, a resource processing system is further provided. This system can execute the resource processing method of the above embodiments, and the specific implementation method and preferred application scenarios are the same as those of the above embodiments, which will not be elaborated here.
[0091] Figure 4 It is a schematic diagram of a resource processing system according to an embodiment of this application. As Figure 4 shown, the system includes the following: a monitoring device 402, a policy configuration device 404, and a policy execution device 406.
[0092] Among them, a monitoring device is used to respectively evaluate the status information of multiple resources to obtain evaluation results of the multiple resources; a policy configuration device is used to pre-configure a resource cleaning policy for the cloud environment; a policy execution device is connected to the monitoring device and the policy configuration device, and is used to respectively evaluate the status information of the multiple resources based on the resource cleaning policy to obtain evaluation results of the multiple resources, and in response to the evaluation results of at least one resource indicating that at least one resource triggers a cleaning action, execute a cleaning action on at least one resource based on the resource cleaning policy, where the evaluation results are used to indicate whether the corresponding resources trigger a cleaning action.
[0093] In an embodiment of the present invention, the system further includes: a log device, connected to the policy execution device and the target terminal, and is used to obtain execution data of the cleaning action during the execution of the cleaning action on at least one resource, generate a resource cleaning log of the multiple resources based on the execution data, store the resource cleaning log in a log database, and send the resource cleaning log to the target terminal, where the execution data at least includes: execution time, execution object, and execution result.
[0094] According to another aspect of the embodiments of the present invention, there is also provided a resource processing device, which can execute the resource processing method of the above embodiments. The specific implementation method and preferred application scenarios are the same as those of the above embodiments and will not be elaborated here.
[0095] Figure 5 is a schematic diagram of a resource processing device according to an embodiment of the present application. As Figure 5 shown, the device includes the following: a collection module 502, an evaluation module 504, and a cleaning module 506.
[0096] Among them, the collection module is used to collect the status information of multiple resources in the cloud environment, where the multiple resources include at least one of the following: virtual machines, containers, storage volumes, database instances, and network devices; the evaluation module is used to respectively evaluate the status information of the multiple resources based on the resource cleaning policy pre-configured for the cloud environment to obtain evaluation results of the multiple resources, where the evaluation results are used to indicate whether the corresponding resources trigger a cleaning action; the cleaning module is used to, in response to the evaluation results of at least one resource indicating that at least one resource triggers a cleaning action, execute a cleaning action on at least one resource based on the resource cleaning policy.
[0097] Among them, the resource cleaning strategy includes: at least one evaluation criterion and a cleaning condition. Different evaluation criteria are used to represent different dimensions for evaluating the status information, and the cleaning condition is used to represent the condition for any resource to trigger a cleaning action; the evaluation module is further configured to read out target data that matches at least one evaluation criterion from the status information of any resource; perform quantization processing on the target data using an evaluation model and at least one evaluation criterion to obtain quantization results corresponding to at least one evaluation criterion; summarize the quantization results corresponding to at least one evaluation criterion to obtain a comprehensive quantization index for any resource; analyze the comprehensive quantization indexes of multiple resources based on the cleaning condition to obtain the evaluation results of multiple resources.
[0098] Among them, in response to at least one evaluation criterion including resource utilization rate; the evaluation module is further configured to read out the processor usage time, memory occupancy, storage space occupancy, and data transfer volume from the status information of any resource to obtain target data; perform quantization processing on the target data using an evaluation model and at least one evaluation criterion to obtain quantization results corresponding to at least one evaluation criterion, including: determining the processor utilization rate based on the processor usage time and a preset time period; determining the memory utilization rate based on the memory occupancy and the total memory amount pre-configured for multiple resources; determining the storage utilization rate based on the storage space occupancy and the total storage space capacity; determining the bandwidth utilization rate based on the data transfer volume and a preset data transfer volume; determining the quantization result corresponding to any one evaluation criterion based on the processor utilization rate, memory utilization rate, storage utilization rate, and bandwidth utilization rate.
[0099] Among them, the evaluation module is further configured to determine the weight corresponding to the processor utilization rate based on the service requirements of multiple resources and the importance of the processor utilization rate to multiple resources; determine the weight corresponding to the memory utilization rate based on the service requirements of multiple resources and the importance of the memory utilization rate to multiple resources; determine the weight corresponding to the storage utilization rate based on the service requirements of multiple resources and the importance of the storage utilization rate to multiple resources; determine the weight corresponding to the bandwidth utilization rate based on the service requirements of multiple resources and the importance of the bandwidth utilization rate to multiple resources; determine the weighted average value of the processor utilization rate, memory utilization rate, storage utilization rate, and bandwidth utilization rate based on the weights corresponding to the processor utilization rate, memory utilization rate, storage utilization rate, and bandwidth utilization rate to obtain the quantization result.
[0100] Among them, in response to at least one evaluation criterion including resource utilization rate, idle time, and cost-benefit ratio; the evaluation module is further configured to obtain the ratio of the average utilization rate and the cost-benefit ratio index to obtain an index ratio; obtain the difference between the preset value and the idle time index to obtain an index difference; obtain the product of the index ratio and the index difference to obtain the comprehensive quantization index of any resource.
[0101] The evaluation module is further configured to sort the multiple resources based on the comprehensive quantitative indicators of the multiple resources to obtain a sorted resource sequence; determine at least one resource from the sorted resource sequence based on the cleaning condition; determine that the evaluation results of the at least one resource indicate that the multiple resources trigger a cleaning action, and the evaluation results of the other resources indicate that the other resources do not trigger a cleaning action, where the other resources are used to represent any one of the multiple resources other than the at least one resource.
[0102] The evaluation module is further configured to, in response to detecting a change in the cloud environment or a change in the business requirements of the cloud environment, adjust the parameters of the evaluation model and / or the resource cleaning policy based on the collected change information; and in response to performing a cleaning action on at least one resource, adjust the parameters of the evaluation model and / or the resource cleaning policy based on the collected feedback information.
[0103] The cleaning module is further configured to, during the process of performing a cleaning action on at least one resource, obtain the execution data of the cleaning action, where the execution data at least includes: execution time, execution object, and execution result; generate a resource cleaning log of the multiple resources based on the execution data; store the resource cleaning log in a log database, and send the resource cleaning log to a target terminal.
[0104] The cleaning module is further configured to, in response to receiving a log query request sent by a client, read out a target cleaning log corresponding to the log query request from the log database; and send the target cleaning log to the client.
[0105] The cleaning module is further configured to obtain a target policy class corresponding to the resource cleaning policy, where the target policy class is generated by encapsulating the resource cleaning policy; execute the target policy class, and evaluate the status information of the multiple resources respectively based on the resource cleaning policy to obtain the evaluation results of the multiple resources.
[0106] An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium includes a stored executable program, and when the executable program runs, it controls the device where the computer-readable storage medium is located to execute the methods in the various embodiments of the present invention.
[0107] The above-mentioned computer storage medium may refer to a medium in a computer memory for storing a certain discontinuous physical quantity. The computer storage medium mainly includes semiconductors, magnetic cores, magnetic drums, magnetic tapes, laser discs, etc.; the stored program included in the computer-readable storage medium may be a set of instructions that can be recognized and executed by a computer, running on an electronic computer, and is an information tool that meets certain needs of people.
[0108] Embodiments of the present application also provide an electronic device, including: a memory storing an executable program; a processor for running the program, wherein when the program runs, it executes the methods in various embodiments of the present invention.
[0109] The above-mentioned memory may refer to a device inside a computer for storing data and programs, which may include memory, hard disk, etc. Among them, the memory can be used for temporarily storing running programs and data, and the hard disk can be used for long-term storing programs and data. The memory can be used to enable a computer to read and write data and execute programs; the above-mentioned processor can be responsible for executing instructions in a computer program and performing data processing, and can be responsible for controlling and executing various operations, including arithmetic operations, logical operations, data transmission, etc.
[0110] Embodiments of the present application also provide a computer program product, including a computer program, which when executed by a processor, implements the methods in various embodiments of the present invention.
[0111] The above-mentioned computer program product may refer to a software program that has been written, tested, and released, and can run on a computer or other devices. The computer program product may include application programs, operating systems, tool software, etc., and is used to implement specific functions or solve specific problems.
[0112] Embodiments of the present application also provide a computer program product, including a non-volatile computer-readable storage medium for storing a computer program, which when executed by a processor, implements the methods in various embodiments of the present invention.
[0113] The above-mentioned non-volatile computer-readable storage medium may refer to a medium for storing data. The non-volatile computer-readable storage medium can keep data from being lost when powered off, and can be used for storing data to be preserved for a long time, such as operating systems, application programs, and user files. The non-volatile storage medium may include hard disk drives, solid-state drives, optical discs, and flash memory storage devices, etc.
[0114] Embodiments of the present application also provide a computer program, which when executed by a processor, implements the methods in the above-mentioned various embodiments of the present invention.
[0115] The above-mentioned computer program may refer to a set of instructions for telling a computer to perform specific tasks or operations. The computer program can be written by a programmer using a specific programming language, and can include contents such as algorithms, data structures, logic, and control flows. The computer program can be used for various purposes, including application software, operating systems, etc.
[0116] In the above embodiments of the present invention, the descriptions of the respective embodiments have their own emphases. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0117] In several embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.
[0118] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0119] In addition, the functional units in the various embodiments of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0120] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical disks, etc., which can store program codes.
[0121] The above is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A resource processing method, characterized in that: include: Collecting status information of various resources in a cloud environment, wherein the various resources include at least two of the following: a virtual machine, a container, a storage volume, a database instance, and a network device; Based on a resource cleanup policy pre-configured for the cloud environment, status information of the multiple resources is evaluated respectively to obtain evaluation results of the multiple resources, wherein the evaluation results are used to characterize whether corresponding resources trigger cleanup actions; in response to the evaluation result of at least one resource characterizing that the at least one resource triggers a cleanup action, a cleanup action is performed on the at least one resource based on the resource cleanup policy.
2. The method according to claim 1, characterized in that The resource cleanup strategy includes: at least one evaluation standard and a cleanup condition, wherein different evaluation standards are used to represent different dimensions of evaluating the state information, and the cleanup condition is used to represent the condition under which any resource triggers the cleanup action; The step of evaluating the status information of the multiple resources based on the resource cleanup strategy pre-configured for the cloud environment to obtain evaluation results of the multiple resources includes: Reading target data matching the at least one evaluation criterion from the status information of any resource; Quantitatively processing the target data using the evaluation model and the at least one evaluation criterion to obtain a quantitative result corresponding to the at least one evaluation criterion; Summarizing the quantitative results corresponding to the at least one evaluation criterion to obtain a comprehensive quantitative index of any one of the resources; Based on the cleaning conditions, comprehensive quantitative indicators of the various resources are analyzed to obtain evaluation results of the various resources.
3. The method according to claim 2, characterized in that In response to the at least one evaluation criterion comprising resource utilization; The step of reading target data matching the at least one evaluation criterion from the status information of any resource comprises: Reading processor usage time, memory occupancy, storage space occupancy and transmission data volume from the status information of any one of the resources to obtain the target data; The step of performing quantization processing on the target data by using the evaluation model and the at least one evaluation standard to obtain a quantization result corresponding to the at least one evaluation standard includes: Determining processor utilization based on the processor usage time and a preset time period; Determining memory utilization based on the memory occupancy and a total memory amount pre-configured for the multiple resources; Determine storage utilization based on the storage space occupancy and the total storage space capacity; Determining bandwidth utilization based on the transmission data volume and a preset transmission data volume; Based on the processor utilization, the memory utilization, the storage utilization, and the bandwidth utilization, a quantization result corresponding to any one of the evaluation criteria is determined.
4. The method according to claim 3, characterized in that The determining, based on the processor utilization, the memory utilization, the storage utilization, and the bandwidth utilization, a quantization result corresponding to any one of the evaluation criteria includes: Determining a weight corresponding to the processor utilization based on the business requirements of the multiple resources and the importance of the processor utilization to the multiple resources; Determining a weight corresponding to the memory utilization based on the business requirements of the multiple resources and the importance of the memory utilization to the multiple resources; Determining a weight corresponding to the storage utilization rate based on the business requirements of the multiple resources and the importance of the storage utilization rate to the multiple resources; Determining weights corresponding to the bandwidth utilization rates based on the business requirements of the multiple resources and the importance of the bandwidth utilization rates to the multiple resources; Based on the weight corresponding to the processor utilization, the weight corresponding to the memory utilization, the weight corresponding to the storage utilization, and the weight corresponding to the bandwidth utilization, a weighted average of the processor utilization, the memory utilization, the storage utilization, and the bandwidth utilization is determined to obtain the quantization result.
5. The method according to claim 2, characterized in that: In response to the at least one evaluation criterion comprising resource utilization, idle time, and cost-effectiveness ratio; The step of summarizing the quantitative results corresponding to the at least one evaluation criterion to obtain a comprehensive quantitative index of any one resource includes: Obtaining a ratio of the average utilization rate to the cost-effectiveness ratio index to obtain an index ratio; Obtaining a difference between a preset value and the idle time indicator to obtain an indicator difference; The product of the indicator ratio and the indicator difference is obtained to obtain a comprehensive quantitative indicator of any one of the resources.
6. The method according to claim 2, characterized in that The comprehensive quantitative indicators of the multiple resources are analyzed based on the cleaning conditions to obtain evaluation results of the multiple resources, including: Based on the comprehensive quantitative indicators of the multiple resources, the multiple resources are sorted to obtain a sorted resource sequence; Based on the cleaning condition, determining the at least one resource from the sorted resource sequence; Determine that the evaluation result of the at least one resource represents that the multiple resources trigger a cleanup action, and the evaluation results of other resources represent that the other resources do not trigger a cleanup action, wherein the other resources are used to represent any one of the multiple resources except the at least one resource.
7. The method according to any one of claims 2 to 6, characterized in that The method further comprises: In response to monitoring changes in the cloud environment or changes in business requirements of the cloud environment, adjusting parameters of the assessment model and / or the resource cleanup strategy based on the collected change information; In response to performing a cleanup action on the at least one resource, parameters of the evaluation model and / or the resource cleanup strategy are adjusted based on the collected feedback information.
8. The method according to claim 1, characterized in that The method further comprises: In the process of executing the cleanup action on the at least one resource, acquiring execution data of the cleanup action, wherein the execution data at least includes: execution time, execution object and execution result; Based on the execution data, generating resource cleanup logs for the multiple resources; The resource cleanup log is stored in a log database, and the resource cleanup log is sent to a target terminal.
9. The method according to claim 8, characterized in that The method further comprises: In response to receiving a log query request sent by a client, reading a target cleanup log corresponding to the log query request from the log database; Send the target cleanup log to the client.
10. The method according to claim 1, characterized in that The step of evaluating the status information of the multiple resources based on the resource cleanup strategy pre-configured for the cloud environment to obtain evaluation results of the multiple resources includes: Obtaining a target policy class corresponding to the resource cleanup policy, wherein the target policy class is generated by encapsulating the resource cleanup policy; The target policy class is executed, and based on the resource cleanup policy, the status information of the multiple resources is evaluated respectively to obtain evaluation results of the multiple resources.
11. A resource processing system, characterized in that: include: A monitoring device, used to evaluate the status information of the multiple resources respectively to obtain the evaluation results of the multiple resources; a policy configuration device, used to pre-configure a resource cleanup policy for the cloud environment; A policy execution device is connected to the monitoring device and the policy configuration device, and is used to evaluate the status information of the multiple resources respectively based on the resource cleanup policy to obtain evaluation results of the multiple resources, characterize the at least one resource triggering a cleanup action in response to the evaluation result of at least one resource, and perform a cleanup action on the at least one resource based on the resource cleanup policy, wherein the evaluation result is used to characterize whether the corresponding resource triggers a cleanup action.
12. The system according to claim 11, characterized in that The system further comprises: A logging device is connected to the policy execution device and the target terminal, and is used to obtain the execution data of the cleaning action during the execution of the cleaning action on the at least one resource, generate a resource cleaning log for the multiple resources based on the execution data, store the resource cleaning log in a log database, and send the resource cleaning log to the target terminal, wherein the execution data includes at least: execution time, execution object and execution result.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 10 when executed by a processor.
14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 10 are implemented.
15. 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 described in any one of claims 1 to 10 are implemented.
Citation Information
Cited By
Block chain encrypted data analysis system and method based on scene evaluation
CN120675824A