Resource allocation method and device, storage medium, and computer equipment
By monitoring and analyzing the configuration and usage of cloud host resources and adjusting resource configuration using preset strategies, the problem of unbalanced cloud host resources is solved, and the rational and safe use of resources is achieved.
Patent Information
- Application Number
- CN202210574308.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-25
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-05-25
AI Technical Summary
Unbalanced use of cloud host resources leads to waste and shortage, affecting system availability, which is difficult to effectively solve with existing technologies.
By pre-setting monitoring strategies and analysis rules, we can monitor the configuration and usage of cloud host resources, match resource adjustment strategies, and achieve flexible and secure update configuration of resources.
Effectively reduce the waste of cloud host resources, improve system availability, and ensure the rational and safe use of resources.
Smart Images

Figure CN114860451B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent monitoring, and in particular to a resource allocation method and device, a storage medium, and a computer device. Background Art
[0002] Cloud hosting is an IT infrastructure that integrates computing, storage, and network resources, providing on-demand, pay-as-you-go server rental services based on a cloud computing model. By integrating high-performance servers with premium network bandwidth, it effectively addresses the high costs and inconsistent service quality of traditional hosting services, fully meeting the needs of small and medium-sized enterprises and individual webmasters for low-cost, highly reliable, and easy-to-manage hosting services.
[0003] Cloud computing refers to the delivery and usage model of IT infrastructure, which means obtaining the required resources (hardware, platform, software) through the network in an on-demand and easily scalable manner. Cloud hosting is an important component of cloud computing services and is a service platform that provides comprehensive business capabilities to various Internet users. The platform integrates the three core elements of traditional Internet applications: computing, storage, and networking, and provides public Internet infrastructure services to users. Cloud hosting is a large server cluster that includes computing servers, storage servers, bandwidth resources, and so on. The resources of cloud hosting are infinitely scalable for users and can be obtained at any time, used on demand, expanded at any time, and paid for on a per-use basis. Customers can deploy the required server environment through the self-service platform of the web interface.
[0004] For large and medium-sized internet users, cloud hosts are a crucial component of their resource distribution. Applications run on cloud hosts. Over time and as business grows, more and more cloud host resources are rapidly being used. Because each cloud host runs different system applications, this leads to uneven resource utilization, wasted resources, or even insufficient resources. A large internet company adds 2,000 cloud hosts annually. Assuming that even one out of every five hosts is underutilized, this could result in 400 hosts being wasted annually, potentially costing millions of yuan. For cloud hosts reaching resource bottlenecks, timely capacity expansion can nip the risk of service anomalies caused by insufficient resources in the bud. Summary of the Invention
[0005] In view of the above problems, the present invention proposes a resource allocation method and device, storage medium, and computer equipment. By combining different cloud host operation scenarios for comprehensive consideration and analysis, the collected resource configuration parameters and resource usage data are differentiated and analyzed according to the preset analysis rules corresponding to a variety of different cloud host operation scenarios, forming a flexible, universal, safe and operational resource allocation strategy, thereby improving the rationality and security of cloud host resources.
[0006] According to a first aspect of the present invention, there is provided a resource allocation method, comprising monitoring the resource configuration and resource usage of at least one cloud host according to a preset monitoring strategy, and obtaining resource configuration parameters and resource usage data of the cloud host;
[0007] Analyzing the resource configuration parameters and the resource usage data using preset analysis rules to match resource adjustment strategies corresponding to the resource usage;
[0008] The resource adjustment policy is used to update the resource configuration parameters of the cloud host.
[0009] Optionally, monitoring the resource configuration and resource usage of at least one cloud host according to a preset monitoring strategy to obtain resource configuration parameters and resource usage data of the cloud host includes:
[0010] Periodically monitor the resource configuration and resource usage of the cloud host according to the preset monitoring strategy, and collect corresponding resource configuration parameters and resource usage data when the cloud host is running;
[0011] Among them, the cloud host operation status includes at least one of the cloud host operation environment and the cloud host operation system; the resource configuration parameters include at least one of the memory configuration parameters, the CPU configuration parameters and the number of cloud hosts running; the resource usage data includes at least one of the memory usage value and the CPU usage value.
[0012] Optionally, the preset analysis rules include environment analysis rules, system analysis rules, minimum configuration analysis rules and quantity analysis rules;
[0013] The environment analysis rule is an analysis rule for determining whether resource configuration parameters and resource usage data corresponding to the cloud host operating environment meet first preset standard requirements, including at least one of a production environment analysis rule, a development environment analysis rule, and a test environment analysis rule;
[0014] The system analysis rule is an analysis rule for determining whether resource configuration parameters and resource usage data corresponding to the cloud host operating system meet second preset standard requirements, including at least one of an active-active system analysis rule and a non-active-active system analysis rule;
[0015] The minimum configuration analysis rule is an analysis rule for determining whether the resource configuration parameters corresponding to the cloud host meet the requirements of a third preset standard, including at least one of an environment requirement minimum configuration rule and a memory requirement minimum configuration rule;
[0016] The quantity analysis rule is an analysis rule for determining whether the number of cloud hosts running the same application service meets the fourth preset standard requirement.
[0017] Optionally, the analyzing the resource configuration parameters and the resource usage data by using preset analysis rules includes:
[0018] The environment analysis rules, system analysis rules, minimum configuration analysis rules and quantity analysis rules are used to comprehensively analyze the resource configuration parameters and resource usage data corresponding to the operation of the cloud host to determine whether the resource usage is standard.
[0019] Optionally, matching a resource adjustment policy corresponding to the resource usage includes:
[0020] If the resource usage is standard, there is no need to update the resource configuration parameters;
[0021] If the resource usage is not standard, a resource adjustment strategy corresponding to the resource usage is matched according to the preset analysis rules, and the resource adjustment strategy includes at least one of increasing or decreasing memory configuration parameters, increasing or decreasing CPU configuration parameters, and increasing or decreasing the number of cloud hosts running.
[0022] Optionally, the first preset standard requirement is that if the P95 value of the resource usage data is greater than a first P95 preset maximum value, the resource usage is non-standard and the corresponding resource configuration parameter needs to be increased; if the P95 value of the resource usage data is less than the first P95 preset minimum value, the maximum value of the resource usage data is less than the first preset maximum value, and the corresponding resource configuration parameter is greater than the first preset standard value, the resource usage is non-standard and the corresponding resource configuration parameter needs to be reduced;
[0023] The second preset standard requirement is that if P95 is less than a second preset minimum value of P95, the maximum value of the resource usage data is less than a second preset maximum value, and the corresponding resource configuration parameter is greater than a second preset standard value, then the resource usage is not standard and the corresponding resource configuration parameter needs to be reduced;
[0024] The third preset standard requirement is that if the resource configuration parameter is lower than the minimum preset configuration parameter corresponding to the cloud host operating environment, the resource configuration parameter cannot be reduced; or if the memory configuration parameter is equal to the CPU configuration parameter, the memory configuration parameter cannot be reduced;
[0025] The fourth preset standard requirement is that if the number of cloud hosts running for the same application service is greater than the preset minimum number of hosts, and both need to reduce resource configuration parameters, but the resource configuration parameters corresponding to the cloud hosts are the minimum preset configuration parameters corresponding to the cloud host operating environment, then the number of cloud hosts running needs to be reduced; or if the number of cloud hosts running for the same application service is greater than or equal to the preset minimum number of hosts, and both need to increase resource configuration parameters, but the resource configuration parameters corresponding to the cloud hosts are the highest preset configuration parameters corresponding to the cloud host operating environment, then the number of cloud hosts running needs to be increased.
[0026] Optionally, the preset monitoring strategy is to periodically monitor the cloud hosts used within a preset time range.
[0027] According to a second aspect of the present invention, a resource allocation device is provided, comprising:
[0028] A data acquisition module is used to monitor the resource configuration and resource usage of at least one cloud host according to a preset monitoring strategy, and obtain the resource configuration parameters and resource usage data of the cloud host;
[0029] A policy analysis module, configured to analyze the resource configuration parameters and the resource usage data using preset analysis rules, and match a resource adjustment policy corresponding to the resource usage;
[0030] The configuration update module is used to update the resource configuration parameters of the cloud host using the resource adjustment strategy.
[0031] According to a third aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the resource allocation method as described in any one of the first aspects of the present invention are implemented.
[0032] According to a fourth aspect of the present invention, a computer device is proposed, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the resource allocation method as described in any one of the first aspects of the present invention are implemented.
[0033] The present invention provides a resource allocation method and device, storage medium, and computer equipment, which monitor resource configuration and resource usage according to a preset monitoring strategy to obtain resource configuration parameters and resource usage data; use preset analysis rules to analyze the resource configuration parameters and resource usage data, and match the resource adjustment strategy corresponding to the resource usage; use the resource adjustment strategy to update the resource configuration parameters, solve the problem of cloud host resource waste, release idle cloud host resources in a timely manner, expand tense cloud host resources in a timely manner, improve the cloud host system availability, and realize healthier, safer, and more reasonable use of cloud host resources.
[0034] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below.
[0035] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:
[0037] Figure 1 A schematic diagram showing a flow chart of a resource allocation method provided by an embodiment of the present invention is shown;
[0038] Figure 2 A schematic diagram showing the structure of a resource allocation device provided by an embodiment of the present invention is shown;
[0039] Figure 3 A schematic structural diagram of a resource allocation device provided by another embodiment of the present invention is shown;
[0040] Figure 4 A schematic diagram of the physical structure of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0041] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0042] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, the elements defined by the phrase "comprising..." do not exclude the presence of other identical elements in the process, method, article, or device comprising the elements.
[0043] The embodiment of the present invention provides a resource allocation method, such as Figure 1 As shown, the method may at least include the following steps S101 to S103:
[0044] In step S101, the resource configuration and resource usage of at least one cloud host are monitored according to a preset monitoring strategy to obtain resource configuration parameters and resource usage data of the cloud host.
[0045] The embodiment of the present invention takes the cloud host operation mode of a large Internet enterprise as an example and proposes the following cloud host resource allocation solution.
[0046] The preset monitoring policy may be to periodically monitor cloud hosts used within a preset time range. The preset time range can be set based on actual application scenarios. For example, if a cloud host resource is leased for an application service and has been in use for less than a month, to ensure the initial stable operation of the application service, there is no need to monitor the cloud host and subsequently update and configure resources. It is understood that in actual applications, the usage requirements of cloud hosts correspond to a variety of situations, and the preset time range corresponding to the preset monitoring policy can be set based on actual circumstances, and the present invention does not impose any limitations on this.
[0047] Specifically, the resource configuration and usage of the cloud host can be periodically monitored according to a preset monitoring strategy, and the corresponding resource configuration parameters and resource usage data can be collected during the operation of the cloud host. Among them, periodic monitoring refers to the ability to monitor the resource configuration and resource usage of the cloud host in real time, and analyze the collected resource configuration parameters and resource usage data at preset time periods and subsequently update resource configurations.
[0048] Among them, resource configuration refers to the memory configuration, CPU configuration and number of cloud hosts running corresponding to each cloud host; resource usage refers to memory usage, CPU usage, etc.
[0049] By monitoring the resource configuration and resource usage of the cloud host, you can obtain the corresponding resource configuration parameters and resource usage data under different cloud host operating conditions.
[0050] Among them, resource configuration parameters may include memory configuration parameters, CPU configuration parameters and the number of cloud hosts running; memory configuration parameters refer to the memory size configured for the cloud host, such as 1G, 2G, 4G, etc.; CPU configuration parameters refer to the CPU model configured for the cloud host, such as 1C, 2C, 4C, etc.; the number of cloud hosts running is the number of cloud hosts running corresponding to the same application service, such as 1, 2, 3, etc.
[0051] Resource usage data may include memory usage values and CPU usage values; for example, the memory monitoring value or CPU monitoring value of the cloud host at a certain moment may be obtained as the memory usage value or CPU usage value of the cloud host at that moment.
[0052] The cloud host operating status may include the cloud host operating environment and the cloud host operating system.
[0053] The cloud host operating environment can be divided into production environment, development environment, test environment, etc.; the development environment and test environment refer to the cloud host operating environment corresponding to when the cloud host provider uses the cloud host resources it provides for project development or project testing; the production environment refers to the cloud host operating environment when the cloud host lessee uses the rented cloud host resources.
[0054] Cloud host operating systems can be categorized as either active-active or non-active-active. Active-active systems, also known as disaster recovery systems, are dual-operation systems deployed at different locations to simultaneously provide production services. The two systems are peer-to-peer, with no master-slave distinction, and can deploy services simultaneously. Non-active-active systems have only one independent operating system and lack disaster recovery capabilities. In embodiments of the present invention, cloud hosts can be either active-active or non-active-active in a production environment providing services.
[0055] Step S102: Analyze resource configuration parameters and resource usage data using preset analysis rules to match resource adjustment strategies corresponding to resource usage.
[0056] Among them, the preset analysis rules may include A environment analysis rules, B system analysis rules, C minimum configuration analysis rules and D quantity analysis rules.
[0057] A: Environment analysis rules determine whether the resource configuration parameters and resource usage data corresponding to the cloud host operating environment meet the first preset standard requirements. These include production environment analysis rules, development environment analysis rules, and test environment analysis rules. The first preset standard requirement is that if the P95 value of the resource usage data is greater than the first P95 preset maximum value, the resource usage is non-standard and the corresponding resource configuration parameters need to be increased. If the P95 value of the resource usage data is less than the first P95 preset minimum value, the maximum value of the resource usage data is less than the first preset maximum value, and the corresponding resource configuration parameters are greater than the first preset standard value, the resource usage is non-standard and the corresponding resource configuration parameters need to be reduced.
[0058] Among them, the corresponding analysis standards of the production environment analysis rules, development environment analysis rules, and test environment analysis rules can be the same or different, that is, the first P95 preset maximum value, the first P95 preset minimum value, the first preset maximum value, and the first preset standard value can all be set according to actual needs. For example, the production environment analysis rule can be: when the cloud host operating environment is the production environment, when the P95 value of the memory usage value is greater than 70, it is considered that the cloud host's memory resources are in short supply and the cloud host's memory configuration parameters need to be increased; when the P95 value of the CPU usage value is greater than 70, it is considered that the cloud host's CPU resources are in short supply and the cloud host's CPU configuration parameters need to be increased. Taking a large Internet company as an example, the development environment analysis rules and test environment analysis rules are used internally by the cloud host provider and are set with the same analysis standards. For example, the development environment analysis rules and the test environment analysis rules can be: if the cloud host operating environment is a development or test environment, when the P95 value of the cloud host's memory usage value or the P95 value of the CPU usage value is greater than 95, it is considered that the cloud host's memory resources and CPU resources are in short supply, and the cloud host's memory configuration parameters and CPU configuration parameters need to be increased; when the P95 value of the cloud host's memory usage value is less than 40, the maximum memory usage value is less than 50, and the memory configuration parameter is greater than 2G, it is considered that the cloud host's memory resources are wasted, and the cloud host's memory configuration parameters need to be reduced; when the P95 value of the cloud host's CPU usage value is less than 40, the maximum CPU usage value is less than 50, and the CPU configuration parameter is greater than 2C, it is considered that the cloud host's CPU resources are wasted, and the cloud host's CPU configuration parameters need to be reduced.
[0059] The P95 value of memory usage is the average of the 95th percentile memory usage values for a cloud host, sorted in ascending order, over a specific timeframe. For example, if a cloud host's memory usage is monitored every 3 seconds, and its 200 memory usage values for the past 600 seconds are 1, 1, 2, 2, 3, 3... 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, the P95 value is (95 + 95) / 2 = 95. The maximum memory usage value is the average of the highest memory usage values for a cloud host, sorted in ascending order over a specific timeframe. The P95 and maximum CPU usage values are calculated similarly.
[0060] B: System analysis rules determine whether the resource configuration parameters and resource usage data corresponding to the cloud host operating system meet the second preset standard requirements. This includes analysis rules for active-active systems and non-active-active systems. The second preset standard requirement is that if the P95 value is less than the second preset minimum P95 value, the maximum resource usage data value is less than the second preset maximum value, and the corresponding resource configuration parameter is greater than the second preset standard value, the resource usage is non-standard and the corresponding resource configuration parameter needs to be reduced.
[0061] When the cloud host operating environment is a production environment, the cloud host operating system can be divided into active-active and non-active-active systems. Different analysis rules can be set for these two different cloud host operating systems. The second P95 preset minimum value, second preset maximum value, and second preset standard value can be set based on different needs in actual applications, and this invention does not limit this. Taking a large internet company as an example, when the cloud host runs an active-active system, if the P95 value of the CPU usage is less than 10, the maximum CPU usage is less than 25, and the CPU configuration parameter is greater than 2C, the cloud host's CPU resources are considered to be wasted and the CPU configuration parameters need to be reduced. If the P95 value of the memory usage is less than 10, the maximum memory usage is less than 25, and the memory configuration parameter is greater than 4G, the cloud host's memory resources are considered to be wasted and the memory configuration parameters need to be reduced. If the cloud host runs a non-active-active system, if the P95 value of the CPU usage is less than 20, the maximum CPU usage is less than 50, and the CPU configuration parameter is greater than 2C, the cloud host's CPU resources are considered to be wasted and the CPU configuration parameters need to be reduced. If the P95 value of the memory usage is less than 20, the maximum memory usage is less than 50, and the memory configuration parameter is greater than 4G, the cloud host's memory resources are considered to be wasted and the memory configuration parameters need to be reduced.
[0062] C: Minimum configuration analysis rules determine whether the resource configuration parameters corresponding to the cloud host resource configuration meet the third preset standard requirements. These include the minimum configuration rules for the environment and the minimum configuration rules for memory. The third preset standard requires that if the resource configuration parameters are lower than the minimum preset configuration parameters corresponding to the cloud host operating environment, the resource configuration parameters cannot be reduced; or if the memory configuration parameters are equal to the CPU configuration parameters, the memory configuration parameters cannot be reduced.
[0063] Specifically, the minimum configuration rule required by the environment refers to the minimum resource configuration requirements of the cloud host under different cloud host operating environments. The resource configuration requirements of the cloud host are the memory and CPU configuration parameters corresponding to the cloud host, such as 1C2G, 2C4G, 4C4G, etc. Taking a large Internet company as an example, when the cloud host operating environment is a production environment, the minimum resource configuration requirement is 2C4G, and when the cloud host operating environment is a development environment or a test environment, the minimum resource configuration requirement is 1C2G. At this time, even if the cloud host meets the conditions for reducing the resource configuration parameters in A and B above, scaling cannot be implemented. It should be noted that the above-mentioned minimum preset configuration parameters can be set according to actual needs, and the present invention does not limit this.
[0064] The minimum memory configuration rule means that if the cloud host's memory configuration parameters are equal to the CPU configuration parameters, memory configuration reduction cannot be implemented even if the cloud host meets the conditions for reducing memory configuration parameters in A and B above.
[0065] D: The quantity analysis rule is used to determine whether the number of cloud hosts operating for the same application service meets the requirements of the fourth preset standard. The fourth preset standard stipulates that if the number of cloud hosts operating for the same application service exceeds the preset minimum number of hosts and both require a reduction in resource configuration parameters, but the resource configuration parameters corresponding to the cloud hosts are the minimum preset configuration parameters corresponding to the cloud host operating environment, then the number of cloud hosts operating will need to be reduced; or if the number of cloud hosts operating for the same application service is greater than or equal to the preset minimum number of hosts and both require an increase in resource configuration parameters, but the resource configuration parameters corresponding to the cloud hosts are the maximum preset configuration parameters corresponding to the cloud host operating environment, then the number of cloud hosts operating will need to be increased.
[0066] Among them, cloud hosts that undertake the same application service can be determined by judging whether the cloud hosts have the same deployment environment name or the same set of LEs (logical entities). Taking a large Internet company as an example, when there are more than two cloud hosts that undertake the same application service and all meet the conditions for reducing resource configuration parameters in A and B above, but the resource configuration parameters are already the minimum preset configuration parameters in C, the number of running cloud hosts will be reduced; when there are more than or equal to two cloud hosts that undertake the same application service and all meet the conditions for increasing resource configuration parameters in A and B above, but the resource configuration parameters are already the maximum preset configuration parameters that the cloud hosts can reach, the number of running cloud hosts will be increased; when there are more than or equal to two cloud hosts that undertake the same application service and some of them meet and some do not meet the conditions for updating resource configuration parameters in A and B above, the resource configuration parameters of these cloud hosts will not be adjusted.
[0067] That is, when a cloud host matches the rules in A, B, and C above and needs to update its resource configuration, but cannot do so for other reasons, it can be set to a cloud host exception list. After this is set, the cloud host will temporarily not update its resource configuration. For example, at a large Internet company, cloud hosts that provide the same application service need to maintain consistent resource configuration parameters. If some cloud hosts need to adjust their resource configuration parameters while others do not, it is assumed that all cloud hosts that provide the same application service will not have their resource configuration parameters adjusted to prevent future anomalies caused by inconsistent resource configuration. For another example, if a cloud host needs to increase its resource configuration parameters but the computer room no longer has excess cloud host resources to provide, meaning that the physical layer cannot provide resource configuration, it also needs to be set to a cloud host exception list and its resource configuration parameters will not be adjusted.
[0068] Specifically, using A environmental analysis rule, B system analysis rule, C minimum configuration analysis rule, and D quantity analysis rule, a comprehensive analysis is performed on the resource configuration parameters and resource usage data corresponding to the cloud host operation to determine whether resource usage is standard. Resource adjustment policies corresponding to resource usage can be matched in the following ways: If resource usage is standard, no resource update configuration of resource configuration parameters is required; if resource usage is non-standard, resource adjustment policies corresponding to resource usage are matched according to preset analysis rules. Resource adjustment policies include increasing or decreasing memory configuration parameters, increasing or decreasing CPU configuration parameters, and increasing or decreasing the number of running cloud hosts.
[0069] Use the above A environment analysis rules, B system analysis rules, C minimum configuration analysis rules and D quantity analysis rules to analyze the corresponding resource configuration parameters and resource usage data under the cloud host operating environment and cloud host operating system one by one to obtain the final analysis results and corresponding resource adjustment strategies.
[0070] Step S103: update and configure resource configuration parameters using resource adjustment policies.
[0071] Updating resource configuration parameters includes increasing or decreasing memory configuration parameters, increasing or decreasing CPU configuration parameters, and increasing or decreasing the number of running cloud hosts.
[0072] Specifically, you can find the ECS cloud host on the enterprise portal corresponding to the cloud resource, find the cloud host that needs to have its resources updated and configured, shut down the cloud host, select Resource Configuration Change, change the resource configuration parameters to x units xxCxxG, and make the payment. After the payment is completed, restart the computer to have the cloud host with the updated resource configuration.
[0073] In another optional embodiment of the present invention, a resource allocation method provided by the present invention may further include:
[0074] Match the corresponding payment mode according to the operation status of the cloud host; the payment mode includes prepaid mode and postpaid mode; the prepaid mode includes monthly payment mode and pay-as-you-go mode;
[0075] If the cloud host is in normal operation, the cloud host payment mode matches the prepaid mode;
[0076] If the cloud host is in disaster recovery operation, the cloud host payment mode will be adjusted to post-payment mode, and the cloud host operation time and corresponding fees in the disaster recovery operation environment will be counted;
[0077] If the cloud host payment mode is prepaid mode and the usage time is less than the preset usage time, a reminder to adjust the payment mode will be automatically generated.
[0078] The normal operating state refers to the cloud host's non-disaster recovery state. The disaster recovery state refers to the cloud host's continued operation after a system anomaly or emergency causes the cloud service to switch to the disaster recovery system. The normal operating state refers to the cloud host's operation without any system anomalies or emergencies. Users can choose between a monthly subscription or a pay-as-you-go payment model within the prepaid model. Automatically switching the cloud host's payment model to a postpaid model when the cloud host is in disaster recovery mode, or reminding users to switch to a postpaid model when usage is low, can save users money and optimize the user experience.
[0079] The embodiments of the present invention propose a resource allocation method and device, storage medium, and computer equipment, which monitor resource configuration and resource usage according to a preset monitoring strategy to obtain resource configuration parameters and resource usage data; use preset analysis rules to analyze the resource configuration parameters and resource usage data, and match resource adjustment strategies corresponding to resource usage; use resource adjustment strategies to update resource configuration parameters, solve the problem of cloud host resource waste, release idle cloud host resources in a timely manner, expand tense cloud host resources in a timely manner, improve cloud host system availability, and achieve healthier, safer, and more reasonable use of cloud host resources.
[0080] Further, as Figure 1 The specific implementation of the present invention provides a resource allocation device, such as Figure 2 As shown, the apparatus may include: a data acquisition module 210 , a policy analysis module 220 and a configuration update module 230 .
[0081] The data acquisition module 210 can be used to monitor the resource configuration and resource usage of at least one cloud host according to a preset monitoring strategy to obtain resource configuration parameters and resource usage data;
[0082] The policy analysis module 220 can be used to analyze the resource configuration parameters and resource usage data of the cloud host using preset analysis rules and match resource adjustment policies corresponding to resource usage;
[0083] The configuration update module 230 may be used to update resource configuration parameters of the cloud host using a resource adjustment policy.
[0084] Alternatively, as Figure 3 As shown, a resource allocation device provided by an embodiment of the present invention may further include: a payment matching module 240.
[0085] The payment matching module 240 can be used to match the corresponding payment mode according to the operation status of the cloud host; the payment mode includes prepaid mode and postpaid mode; the prepaid mode includes monthly payment mode and pay-as-you-go mode; if the cloud host is in normal operation, the cloud host payment mode is matched with the prepaid mode; if the cloud host is in disaster recovery operation state, the cloud host payment mode is adjusted to the postpaid mode, and the operation time and corresponding fees of the cloud host in the disaster recovery operation environment are counted; if the cloud host payment mode is prepaid mode and the usage time is less than the preset usage time, a reminder to adjust the payment mode is automatically generated.
[0086] The data acquisition module 210 may also be used to periodically monitor the resource configuration and resource usage of the cloud host according to a preset monitoring strategy, and collect resource configuration parameters and resource usage data corresponding to the cloud host operation; wherein the cloud host operation status includes at least one of the cloud host operation environment, the cloud host operation system, the cloud host resource configuration, and the number of cloud hosts running; the resource configuration parameters include at least one of the memory configuration parameters, the CPU configuration parameters, and the number of cloud hosts running; and the resource usage data includes at least one of the memory usage value and the CPU usage value;
[0087] The default monitoring strategy is to monitor cloud hosts that are used within a preset time range.
[0088] The policy analysis module 220 may also be used to comprehensively analyze resource configuration parameters and resource usage data corresponding to the cloud host operation using environment analysis rules, system analysis rules, minimum configuration analysis rules, and quantity analysis rules to determine whether resource usage is standard.
[0089] If the resource usage is standard, there is no need to update the resource configuration parameters; if the resource usage is not standard, a resource adjustment policy corresponding to the resource usage is matched according to the preset analysis rules. The resource adjustment policy includes at least one of increasing or decreasing the memory configuration parameters, increasing or decreasing the CPU configuration parameters, and increasing or decreasing the number of cloud hosts running.
[0090] The preset analysis rules include environment analysis rules, system analysis rules, minimum configuration analysis rules and quantity analysis rules; the environment analysis rules are analysis rules for determining whether the resource configuration parameters and resource usage data corresponding to the cloud host operating environment meet the requirements of the first preset standard, including at least one of the production environment analysis rules, the development environment analysis rules and the test environment analysis rules; the system analysis rules are analysis rules for determining whether the resource configuration parameters and resource usage data corresponding to the cloud host operating system meet the requirements of the second preset standard, including at least one of the active-active system analysis rules and the non-active-active system analysis rules; the minimum configuration analysis rules are analysis rules for determining whether the resource configuration parameters corresponding to the cloud host resource configuration meet the requirements of the third preset standard, including at least one of the minimum configuration rules for environmental requirements and the minimum configuration rules for memory requirements; the quantity analysis rules are analysis rules for determining whether the number of cloud hosts running for the same application service meets the requirements of the fourth preset standard;
[0091] The first preset standard requirement is that if the P95 value of the resource usage data is greater than the first P95 preset maximum value, the resource usage is not standard and the corresponding resource configuration parameter needs to be increased; if the P95 of the resource usage data is less than the first P95 preset minimum value, the maximum value of the resource usage data is less than the first preset maximum value, and the corresponding resource configuration parameter is greater than the first preset standard value, the resource usage is not standard and the corresponding resource configuration parameter needs to be reduced; the second preset standard requirement is that if the P95 is less than the second P95 preset minimum value, the maximum value of the resource usage data is less than the second preset maximum value, and the corresponding resource configuration parameter is greater than the second preset standard value, the resource usage is not standard and the corresponding resource configuration parameter needs to be reduced; the third preset standard requirement is that if the resource If the configuration parameters are lower than the minimum preset configuration parameters corresponding to the cloud host operating environment, the resource configuration parameters cannot be reduced; or if the memory configuration parameters are equal to the CPU configuration parameters, the memory configuration parameters cannot be reduced; the fourth preset standard requirement is that if the number of cloud hosts running for the same application service is greater than the preset minimum number of hosts, and both need to reduce the resource configuration parameters, but the resource configuration parameters corresponding to the cloud host are the minimum preset configuration parameters corresponding to the cloud host operating environment, then the number of running cloud hosts needs to be reduced; or if the number of cloud hosts running for the same application service is greater than or equal to the preset minimum number of hosts, and both need to increase the resource configuration parameters, but the resource configuration parameters corresponding to the cloud host are the highest preset configuration parameters corresponding to the cloud host operating environment, then the number of running cloud hosts needs to be increased.
[0092] It should be noted that for other corresponding descriptions of the functional modules involved in the resource allocation device provided in the embodiment of the present invention, please refer to Figure 1 The corresponding description of the method shown will not be repeated here.
[0093] Based on the above Figure 1 The method shown, accordingly, an embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, it implements the steps of the resource configuration method described in any of the above embodiments.
[0094] Based on the above Figure 1 The method shown and Figure 3 The embodiment of the device shown in the figure, the embodiment of the present invention also provides a physical structure diagram of a computer device, such as Figure 4 As shown, the computer device may include a communication bus, a processor, a memory, and a communication interface. It may also include an input / output interface and a display device. The various functional units can communicate with each other via the bus. The memory stores a computer program, and the processor is configured to execute the program stored in the memory and perform the steps of the resource configuration method described in the above embodiment.
[0095] Those skilled in the art will clearly understand that the specific working processes of the systems, devices, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and for the sake of brevity, they will not be further described here.
[0096] In addition, the functional units in various embodiments of the present invention may be physically independent of each other, or two or more functional units may be integrated together, or all functional units may be integrated into a single processing unit. The above-mentioned integrated functional units may be implemented in the form of hardware, software, or firmware.
[0097] Those skilled in the art will understand that if the integrated functional unit is implemented in the form of software and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can essentially or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, which includes a number of instructions for enabling a computing device (such as a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention when running the instructions. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0098] Alternatively, all or part of the steps of implementing the aforementioned method embodiments may be accomplished by hardware associated with program instructions (such as a computing device such as a personal computer, a server, or a network device), and the program instructions may be stored in a computer-readable storage medium. When the program instructions are executed by a processor of a computing device, the computing device executes all or part of the steps of the method described in each embodiment of the present invention.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that within the spirit and principles of the present invention, they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some or all of the technical features therein. However, these modifications or replacements do not deviate from the scope of protection of the present invention.
Claims
1. A resource allocation method, characterized in that: include: Monitor the resource configuration and resource usage of at least one cloud host according to a preset monitoring strategy to obtain resource configuration parameters and resource usage data of the cloud host; Analyzing the resource configuration parameters and the resource usage data using preset analysis rules to match resource adjustment strategies corresponding to the resource usage; Using the resource adjustment strategy to update the resource configuration parameters of the cloud host; The resource configuration parameters include at least one of a memory configuration parameter, a CPU configuration parameter, and the number of cloud hosts running; The resource adjustment strategy includes at least one of increasing or decreasing memory configuration parameters, increasing or decreasing CPU configuration parameters, and increasing or decreasing the number of cloud host operations; The resource adjustment strategy is used to update the resource configuration parameters of the cloud host, including: For any cloud host group to be adjusted, if the resource configuration parameters of each cloud host in the cloud host group to be adjusted need to be adjusted, then the resource configuration parameters of each cloud host are updated and configured using each resource adjustment strategy; wherein each cloud host in the cloud host group to be adjusted undertakes the same application service; If some of the resource configuration parameters in the cloud host group to be adjusted need to be adjusted, then the resource configuration parameters of all the cloud hosts in the cloud host group to be adjusted will not be adjusted.
2. The method according to claim 1, characterized in that The monitoring of the resource configuration and resource usage of at least one cloud host according to a preset monitoring strategy to obtain resource configuration parameters and resource usage data of the cloud host includes: Periodically monitor the resource configuration and resource usage of the cloud host according to the preset monitoring strategy, and collect resource configuration parameters and resource usage data corresponding to the operation of the cloud host; The cloud host operation status includes at least one of the cloud host operation environment and the cloud host operation system; the resource usage data includes at least one of the memory usage value and the CPU usage value.
3. The method according to claim 2, characterized in that The preset analysis rules include environment analysis rules, system analysis rules, minimum configuration analysis rules and quantity analysis rules; The environment analysis rule is an analysis rule for determining whether resource configuration parameters and resource usage data corresponding to the cloud host operating environment meet first preset standard requirements, including at least one of a production environment analysis rule, a development environment analysis rule, and a test environment analysis rule; The system analysis rule is an analysis rule for determining whether resource configuration parameters and resource usage data corresponding to the cloud host operating system meet second preset standard requirements, including at least one of an active-active system analysis rule and a non-active-active system analysis rule; The minimum configuration analysis rule is an analysis rule for determining whether the resource configuration parameters of the cloud host meet the requirements of a third preset standard, including at least one of an environment requirement minimum configuration rule and a memory requirement minimum configuration rule; The quantity analysis rule is an analysis rule for determining whether the number of cloud hosts running the same application service meets the fourth preset standard requirement.
4. The method according to claim 3, characterized in that The analyzing the resource configuration parameters and the resource usage data by using preset analysis rules includes: The environment analysis rules, system analysis rules, minimum configuration analysis rules and quantity analysis rules are used to comprehensively analyze the resource configuration parameters and resource usage data corresponding to the operation of the cloud host to determine whether the resource usage is standard.
5. The method according to claim 4, characterized in that The matching of the resource adjustment strategy corresponding to the resource usage includes: If the resource usage is standard, there is no need to update the resource configuration parameters; If the resource usage is not standard, a resource adjustment policy corresponding to the resource usage is matched according to the preset analysis rule.
6. The method according to claim 4, characterized in that The first preset standard requirement is that if the P95 value of the resource usage data is greater than the first P95 preset maximum value, the resource usage is not standard and the corresponding resource configuration parameters need to be increased; If the P95 of the resource usage data is less than the first P95 preset minimum value, the maximum value of the resource usage data is less than the first preset maximum value, and the corresponding resource configuration parameter is greater than the first preset standard value, then the resource usage is not standard and the corresponding resource configuration parameter needs to be reduced; The second preset standard requirement is that if P95 is less than a second preset minimum value of P95, the maximum value of the resource usage data is less than a second preset maximum value, and the corresponding resource configuration parameter is greater than a second preset standard value, then the resource usage is not standard and the corresponding resource configuration parameter needs to be reduced; The third preset standard requirement is that if the resource configuration parameter is lower than the minimum preset configuration parameter corresponding to the cloud host operating environment, the resource configuration parameter cannot be reduced; or if the memory configuration parameter is equal to the CPU configuration parameter, the memory configuration parameter cannot be reduced; The fourth preset standard requirement is that if the number of cloud hosts running for the same application service is greater than the preset minimum number of hosts, and both need to reduce resource configuration parameters, but the resource configuration parameters corresponding to the cloud hosts are the minimum preset configuration parameters corresponding to the cloud host operating environment, then the number of cloud hosts running needs to be reduced; or if the number of cloud hosts running for the same application service is greater than or equal to the preset minimum number of hosts, and both need to increase resource configuration parameters, but the resource configuration parameters corresponding to the cloud hosts are the highest preset configuration parameters corresponding to the cloud host operating environment, then the number of cloud hosts running needs to be increased.
7. The method according to any one of claims 1 to 6, characterized in that The preset monitoring strategy is to periodically monitor the cloud hosts that are used within a preset time range.
8. A resource allocation device, characterized in that: include: A data acquisition module is used to monitor the resource configuration and resource usage of at least one cloud host according to a preset monitoring strategy, and obtain the resource configuration parameters and resource usage data of the cloud host; A policy analysis module, configured to analyze the resource configuration parameters and the resource usage data using preset analysis rules, and match a resource adjustment policy corresponding to the resource usage; A configuration update module, configured to update resource configuration parameters of the cloud host using the resource adjustment strategy; The resource configuration parameters include at least one of a memory configuration parameter, a CPU configuration parameter, and the number of cloud hosts running; The resource adjustment strategy includes at least one of increasing or decreasing memory configuration parameters, increasing or decreasing CPU configuration parameters, and increasing or decreasing the number of cloud host operations; The configuration update module is specifically configured to: for any cloud host group to be adjusted, if the resource configuration parameters of each cloud host in the cloud host group to be adjusted need to be adjusted, then use each resource adjustment policy to update the resource configuration parameters of each cloud host; wherein each cloud host in the cloud host group to be adjusted undertakes the same application service; If some of the resource configuration parameters in the cloud host group to be adjusted need to be adjusted, then the resource configuration parameters of all the cloud hosts in the cloud host group to be adjusted will not be adjusted.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the resource allocation method according to any one of claims 1 to 7 are implemented.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the resource allocation method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Event-based cloud network service scheduling method and device
CN110677274A