Resource charging method, system, device and medium

By calculating weights based on the health status of cloud hosts and calculating resource costs in proportion, the problem of unfair costs in traditional cloud resource billing methods is solved and user satisfaction is improved.

CN118713945AInactive Publication Date: 2024-09-27JINAN INSPUR DATA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410773597.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-09-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional cloud resource billing methods ignore the health status of cloud hosts, resulting in unfair fees. Users cannot fully utilize resources and still have to pay the same fee, which reduces user satisfaction.

Method used

By obtaining the resource amount and status evaluation parameters of the cloud host, its health status is determined, and the weight is calculated based on the health status, and the resource cost is calculated in proportion to ensure that the cost is consistent with resource utilization efficiency and service quality.

Benefits of technology

Fair distribution of fees is achieved, and users can reasonably pay fees consistent with actual resource utilization, which improves user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118713945A
    Figure CN118713945A
Patent Text Reader

Abstract

The invention discloses a resource charging method, system and device and a medium, and relates to the field of resource usage, in the scheme, the resource quantity and state evaluation parameters of a cloud host are acquired, and the health state of the cloud host is determined according to the state evaluation parameters of the cloud host; and determining a calculation weight according to the health state of the cloud host, and calculating the cost of the user during the period of using the cloud host according to the calculation weight and the resource quantity. Visibly, according to the invention, the calculation weight is determined according to the health state of the cloud host, so that the resource cost in different health states can be calculated in proportion, the resource utilization efficiency and the service quality can be better reflected, a user can pay the cost conforming to the actual resource utilization condition more reasonably, and the user experience is improved. Therefore, the problem that the cloud host with a poor health state still needs to pay the same cost is avoided, fair distribution of the cost is ensured, and the user satisfaction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of resource usage, and in particular to a resource charging method, system, device and medium. Background Art

[0002] With the popularization of cloud computing technology, cloud management platforms have become key tools for managing and optimizing cloud resources. Traditional billing methods for using cloud resources mainly focus on the amount and / or usage time of cloud resources, but ignore the impact of the health status of the cloud host on resource utilization efficiency.

[0003] If the health status of the cloud host is not considered during billing, it may lead to unfair charges, because the cloud host with poor health status may cause users to be unable to fully utilize cloud resources due to performance degradation or service interruption, but still need to pay the same fee. In this case, users may feel unfair and reduce user satisfaction. Summary of the invention

[0004] The purpose of the present invention is to provide a resource billing method, system, device and medium. By determining the calculation weight according to the health status of the cloud host, the resource costs in different health states can be calculated proportionally, which can better reflect the resource utilization efficiency and service quality. Users can more reasonably pay fees that are consistent with the actual resource utilization, thereby avoiding the problem that cloud hosts in poor health still need to pay the same fees, ensuring fair distribution of fees, and thus improving user satisfaction.

[0005] In a first aspect, the present invention provides a resource charging method, comprising:

[0006] Obtaining the resource amount of the cloud host, the resource amount at least including the allocation amount of the central processing unit allocated to the cloud host, the allocation amount of the cloud memory, and the allocation amount of the cloud disk;

[0007] Acquire status evaluation parameters of the cloud host, and determine the health status of the cloud host according to the status evaluation parameters of the cloud host;

[0008] A calculation weight is determined according to the health status of the cloud host, and a fee for the user during the period of using the cloud host is calculated according to the calculation weight and the resource amount.

[0009] In one embodiment, before obtaining the resource amount of the cloud host, the method further includes:

[0010] Acquire the state and resource amount of the physical host and the state and resource amount of the physical storage pool, wherein the state of the physical host and the state of the physical storage pool include an available state and an unavailable state;

[0011] Determine the status of the cloud host created on the physical host according to the status of the physical host;

[0012] The state of the cloud disk created on the physical storage pool is determined according to the state of the physical storage pool.

[0013] In one embodiment, obtaining the status evaluation parameters of the cloud host, and determining the health status of the cloud host according to the status evaluation parameters of the cloud host includes:

[0014] Obtain the health of the central processing unit, the health of the cloud memory, and the health of the cloud disk corresponding to the cloud host;

[0015] The health status of the cloud host is determined according to the health of the central processor, the weight of the central processor, the health of the cloud memory, the weight of the cloud memory, the health of the cloud disk and the weight of the cloud disk.

[0016] In one embodiment, obtaining the health of the central processor, the health of the cloud memory, and the health of the cloud disk corresponding to the cloud host includes:

[0017] When the usage rate of the central processing unit does not reach a first threshold, determining the health of the central processing unit to be a first preset value;

[0018] When the usage rate of the central processing unit reaches the first threshold, determining the health of the central processing unit to be a larger value of a first calculated value and a second preset value;

[0019] The first calculated value is (1-the usage rate of the central processing unit)×100%, and the second preset value is less than the first preset value;

[0020] When the usage rate of the cloud memory does not reach the second threshold, determining the health of the cloud memory to be a third preset value;

[0021] When the usage rate of the cloud memory reaches the second threshold, determining the health of the cloud memory to be a larger value between a second calculated value and a fourth preset value;

[0022] The second calculated value is (1-the usage rate of the cloud memory)×100%, and the third preset value is greater than the fourth preset value;

[0023] The health of the cloud disk is determined according to a ratio of the number of normally available cloud disks to the total number of cloud disks.

[0024] In one embodiment, before calculating the fee for the user during the use of the cloud host according to the calculation weight and the resource amount, the method further includes:

[0025] Determining whether there are any resources with abnormal status among the resources allocated to the cloud host;

[0026] If so, remove the resource with abnormal status from the resource amount, and calculate the remaining resource amount after removing the resource with abnormal status;

[0027] Calculating the cost of the user during the period of using the cloud host according to the calculation weight and the resource amount, including:

[0028] The fee for the user during the period of using the cloud host is calculated according to the calculation weight and the remaining resource amount.

[0029] In one embodiment, obtaining the resource amount of the cloud host includes:

[0030] Obtaining the test resource amount of the cloud host at different times multiple times;

[0031] An average resource amount is calculated based on the multiple test resource amounts, and the average resource amount is determined as the resource amount of the cloud host.

[0032] In one embodiment, the health status of the cloud host includes a health level, a calculation weight is determined according to the health status of the cloud host, and a fee for the user during use of the cloud host is calculated according to the calculation weight and the resource amount, including:

[0033] Determine the calculation weight according to the health level, wherein the calculation weight is positively correlated with the health level;

[0034] The sum of the product of the allocated amount of the CPU and the unit price of the CPU, the product of the allocated amount of the cloud memory and the unit price of the cloud memory, and the product of the allocated amount of the cloud disk and the unit price of the cloud disk is taken as the unit time fee;

[0035] Obtaining the total time the user has used the cloud host;

[0036] Determine the total cost according to the unit time cost and the total time;

[0037] The final fee for the user to use the cloud host is determined according to the total fee and the calculation weight.

[0038] In a second aspect, the present application provides a resource billing system, including:

[0039] An acquisition unit, configured to acquire the resource amount of the cloud host, wherein the resource amount at least includes the allocation amount of the central processing unit, the allocation amount of the cloud memory, and the allocation amount of the cloud disk allocated to the cloud host;

[0040] A health assessment unit, used to obtain a status assessment parameter of the cloud host, and determine a health status of the cloud host according to the status assessment parameter of the cloud host;

[0041] The cost calculation unit is used to determine the calculation weight according to the health status of the cloud host, and calculate the cost of the user during the use of the cloud host according to the calculation weight and the resource amount.

[0042] In a third aspect, the present application provides a resource charging device, including:

[0043] Memory for storing computer programs;

[0044] The processor is used to implement the steps of the resource billing method described above when executing a computer program.

[0045] In a fourth aspect, the present application provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the resource billing method described above are implemented.

[0046] The present application provides a resource billing method, system, device and medium, which relates to the field of resource use. In this solution, the resource quantity and status evaluation parameters of the cloud host are obtained, and the health status of the cloud host is determined according to the status evaluation parameters of the cloud host; the calculation weight is determined according to the health status of the cloud host, and the user's fee during the use of the cloud host is calculated according to the calculation weight and the resource quantity. It can be seen that the present application can realize the proportional calculation of resource costs in different health states by determining the calculation weight according to the health status of the cloud host, which can better reflect the resource utilization efficiency and service quality. Users can more reasonably pay fees that are consistent with the actual resource utilization, thereby avoiding the problem that cloud hosts in poor health still need to pay the same fees, ensuring fair distribution of fees, and thus improving user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 A flow chart of a resource billing method provided by the present invention;

[0049] Figure 2 A schematic diagram of a resource billing system provided by the present invention;

[0050] Figure 3A schematic diagram of a resource billing device provided by the present invention;

[0051] Figure 4 A schematic diagram of a non-volatile storage medium provided by the present invention. DETAILED DESCRIPTION

[0052] The core of the present invention is to provide a resource billing method, system, device and medium. By determining the calculation weight according to the health status of the cloud host, the resource costs in different health states can be calculated proportionally, which can better reflect the resource utilization efficiency and service quality. Users can more reasonably pay fees that are consistent with the actual resource utilization, thereby avoiding the problem that cloud hosts in poor health status still need to pay the same fees, ensuring fair distribution of fees, and thus improving user satisfaction.

[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] First, as Figure 1 As shown, the present invention provides a resource billing method, comprising:

[0055] S11: Obtain the resource amount of the cloud host, where the resource amount at least includes the allocation amount of the central processing unit allocated to the cloud host, the allocation amount of the cloud memory, and the allocation amount of the cloud disk.

[0056] Obtaining the cloud host's resource capacity mentioned in this step means collecting information about the cloud host configuration, which usually includes the allocation of the central processing unit, the allocation of cloud memory, and the allocation of cloud disk. Among them, the allocation of the central processing unit (CPU) refers to the number of CPU cores or computing power allocated to the cloud host, which is the number of virtual CPU cores or physical CPU cores. The allocation of cloud memory refers to the memory capacity allocated to the cloud host, which refers to the RAM (Random Access Memory) capacity allocated to the virtual machine instance in order to run applications and store data. The allocation of cloud disk refers to the storage capacity allocated to the cloud host, which is the capacity of the virtual disk, used for purposes such as persistent data storage or operating system installation.

[0057] The purpose of collecting this resource information is to determine the resources consumed by the user during the use of the cloud host and use it for billing purposes. This information can be obtained through the cloud platform's monitoring system or API (Application Programming Interface) and then used to calculate the user's fees.

[0058] S12: Obtain status evaluation parameters of the cloud host, and determine the health status of the cloud host according to the status evaluation parameters of the cloud host.

[0059] The purpose of this step is to obtain the status evaluation parameters of the cloud host and determine the health status of the cloud host based on these parameters. This step is crucial because the health status of the cloud host directly affects the determination of the billing weight, thereby affecting the user's expenses during the use of the cloud host.

[0060] In this step, various parameters and indicators related to the health status of the cloud host are collected. These parameters may include but are not limited to: CPU usage, memory usage, disk usage, network latency, load conditions, etc. These parameters reflect the current performance and operating status of the cloud host. The collected status evaluation parameters will be used to determine the health status of the cloud host. Usually, these parameters will be comprehensively evaluated according to certain rules or algorithms to determine the health status of the cloud host. For example, a threshold can be set. When a parameter exceeds the set threshold, the cloud host is considered to be in an unhealthy state.

[0061] S13: Determine a calculation weight according to the health status of the cloud host, and calculate the fee for the user during the period of using the cloud host according to the calculation weight and the amount of resources.

[0062] This step determines the calculation weights based on the health status of the cloud host, and uses these weights to calculate the fees for the user during the use of the cloud host. First, the calculation weights for different health states are determined based on the health status of the cloud host. These weights reflect the proportion of fees that the user should pay under different health states. For example, a cloud host in a healthy state may be given a weight of full fee (e.g., 1), while a cloud host in an unhealthy state may be given a lower weight (e.g., 0.5), indicating that the user only needs to pay part of the fee. Once the calculation weights are determined, the fees can be calculated based on the amount of resources used by the user during the use of the cloud host and the corresponding calculation weights. The calculation of fees usually involves the amount of resources (such as CPU, memory, disk, etc.) used, as well as the standard unit price or rate of various resources. By multiplying the amount of resources with the corresponding calculation weights and rates, the fees that the user should pay during the use of the cloud host can be calculated.

[0063] By determining the calculation weight according to the health status of the cloud host, the cost of resources can be calculated proportionally, which better reflects the resource utilization efficiency and service quality. This can avoid the problem of cloud hosts with poor health still having to pay the same fee, thus achieving fair distribution of fees. This method helps to improve user satisfaction because users can more reasonably pay fees that are consistent with actual resource utilization.

[0064] Based on the above embodiments:

[0065] In one embodiment, before obtaining the resource amount of the cloud host, it also includes: obtaining the status and resource amount of the physical host, and the status and resource amount of the physical storage pool, the status of the physical host and the status of the physical storage pool including an available status and an unavailable status; determining the status of the cloud host created on the physical host according to the status of the physical host; determining the status of the cloud disk created on the physical storage pool according to the status of the physical storage pool.

[0066] This embodiment describes obtaining the status and resource amount of the physical host and physical storage pool, and then determining the status of the cloud host and cloud disk created on them based on these statuses. Specifically, the physical host status and resource amount refer to the operating status of the physical server or host and its available resource amount, such as the number of central processing units (CPUs), the size of memory (RAM), disk space, etc. The physical storage pool status and resource amount refer to the operating status of the physical storage pool or storage system and its available storage resource amount, such as total storage capacity, used capacity, available capacity, etc.

[0067] After the status of the physical host is obtained, the status of the cloud host created on the physical host is determined based on these statuses. For example, if the physical host status is available, the cloud host created on it may be in a normal state; if the physical host status is unavailable, the cloud host created on it may be marked as abnormal or unavailable. Similarly, the status of the cloud disk created on the storage pool is determined based on the obtained status of the physical storage pool. If the physical storage pool status is available, the cloud disk created on it may be marked as normal; if the storage pool status is unavailable, the cloud disk created on it may be marked as abnormal or unavailable.

[0068] In general, the purpose of this embodiment is to obtain the status and resource quantity of the underlying physical host and physical storage pool before creating the cloud host and cloud disk, and then determine the status of the cloud resources (cloud host and cloud disk) created thereon based on this information to ensure that the cloud resources are created and managed in a suitable physical environment.

[0069] In one embodiment, status evaluation parameters of a cloud host are obtained, and the health status of the cloud host is determined based on the status evaluation parameters of the cloud host, including: obtaining the health of a central processing unit, the health of a cloud memory, and the health of a cloud disk corresponding to the cloud host; and determining the health status of the cloud host based on the health of the central processing unit, the weight of the central processing unit, the health of the cloud memory, the weight of the cloud memory, the health of the cloud disk, and the weight of the cloud disk.

[0070] In this embodiment, it is first necessary to obtain the health assessment parameters of the central processing unit (CPU), cloud memory and cloud disk corresponding to the cloud host. These health assessment parameters can be evaluated based on various indicators, such as CPU usage, memory utilization, disk available space, etc. These indicators reflect the performance and resource utilization of the cloud host and quantitatively evaluate the health status of the cloud host.

[0071] Specifically, the health of the central processing unit can be evaluated based on indicators such as the CPU load, temperature, and operating frequency. For example, if the CPU usage is high, it may mean that the CPU is carrying a heavy load and the health is low; if the CPU temperature is too high, it may indicate that there may be a risk of overheating and the health is also low. The health of cloud memory can be evaluated based on memory utilization. If the memory utilization is close to or exceeds its capacity limit, it may cause performance degradation and low health. The health of cloud disks can be evaluated based on indicators such as disk available space and read and write speeds. If the disk has insufficient available space or the read and write speeds are reduced, it may indicate that the disk has performance problems and is low in health.

[0072] The comprehensive health of the cloud host is calculated based on the obtained health evaluation parameters of the central processing unit, memory and disk, and the pre-set weights. These weights can be set according to user needs and actual conditions, and are usually determined according to the degree of influence of different hardware components on the overall performance of the system. The calculation of comprehensive health can be a simple weighted summation or a more complex algorithm, such as weighted average or other statistical methods. For example, the health of the CPU, memory and disk can be multiplied by the corresponding weights respectively, and then they can be added to obtain the comprehensive health. Finally, according to the calculated comprehensive health value, the cloud host is divided into different health states, such as healthy, sub-healthy and unhealthy. Different health status thresholds can be set according to specific needs and situations. For example, if the comprehensive health exceeds a certain threshold, it is defined as healthy, if it is lower than a certain threshold but still within a certain range, it is defined as sub-healthy, and if it is lower than another threshold, it is defined as unhealthy.

[0073] In summary, this embodiment obtains the health evaluation parameters of each hardware component of the cloud host, calculates the comprehensive health according to the preset weights, and then determines the health status of the cloud host, thereby performing more detailed evaluation and management of the status of the cloud host.

[0074] In one embodiment, the health of a central processing unit (CPU), the health of a cloud memory and the health of a cloud disk corresponding to a cloud host are obtained, including: when the usage rate of the CPU does not reach a first threshold, determining the health of the CPU to be a first preset value; when the usage rate of the CPU reaches the first threshold, determining the health of the CPU to be a larger value of a first calculated value and a second preset value; the first calculated value is (1-CPU usage rate) × 100%, and the second preset value is less than the first preset value; when the usage rate of the cloud memory does not reach the second threshold, determining the health of the cloud memory to be a third preset value; when the usage rate of the cloud memory reaches the second threshold, determining the health of the cloud memory to be a larger value of a second calculated value and a fourth preset value; the second calculated value is (1-cloud memory usage rate) × 100%, and the third preset value is greater than the fourth preset value; determining the health of the cloud disk according to the ratio of the number of normally available cloud disks to the total number of cloud disks.

[0075] In this embodiment, the health evaluation method of the cloud host mainly includes health evaluation of three aspects: central processing unit (CPU), cloud memory and cloud disk. The health evaluation of each aspect has its specific logic and calculation method.

[0076] Specifically, for the central processing unit (CPU) health evaluation, the first threshold is used to determine whether the CPU usage is too high. If the CPU usage is lower than this threshold, the CPU health is considered to be high. The first preset value is the health value set when the CPU usage does not reach the first threshold, which is usually a higher value, such as 100, indicating that the CPU is in a healthy state. The second preset value is a fixed value used to compare with the first calculated value when the CPU usage reaches or exceeds the first threshold. It is usually a lower value, such as 5, indicating that the CPU health is affected. The health determination logic is: when the CPU usage does not reach the first threshold, the CPU health is directly determined to be the first preset value. This situation indicates that the CPU workload is light and in a healthy state. When the CPU usage reaches or exceeds the first threshold, two values ​​are calculated: the first calculated value is calculated according to the formula (1-CPU usage) × 100%, which means that the higher the usage, the lower the health. The second preset value is a fixed lower health value. Compare the first calculated value and the second preset value, and select the larger value as the CPU health, so as to prevent the CPU health from being too low and ensure that there is still a certain health representation under high load.

[0077] For cloud memory health assessment, it is consistent with the health assessment principle of the above-mentioned central processor. The second threshold is used to determine whether the memory usage is too high. If the memory usage is lower than this threshold, the memory health is considered to be high. The third preset value is the health value set when the memory usage does not reach the second threshold. It is usually a higher value, indicating that the memory is in a healthy state. The fourth preset value is a fixed value used to compare with the calculated value when the memory usage reaches or exceeds the second threshold. It is usually a lower value, indicating that the memory health is affected. The logic for determining the health of cloud memory is: when the memory usage does not reach the second threshold, the memory health is directly determined to be the third preset value. This situation indicates that the memory load is light and in a healthy state. When the memory usage reaches or exceeds the second threshold, two values ​​are calculated. The second calculated value is calculated according to the formula (1-memory usage) × 100%, which means that the higher the usage, the lower the health; the fourth preset value: a fixed lower health value. Compare the second calculated value and the fourth preset value, and select the larger value as the memory health, so as to prevent the memory health from being too low and ensure that there is still a certain health representation under high load.

[0078] For cloud disk health assessment, the health of cloud disks is determined by calculating the ratio of the number of cloud disks that are normally available to the total number of cloud disks. The higher the ratio, the healthier the cloud disk. This ratio reflects the availability of cloud disks, that is, how many of the total disks are working normally. If all disks are normal, the ratio is 1 and the health is the highest; if some disks are unavailable, the ratio will decrease and the health will also decrease.

[0079] Among them, the reason why the first preset value and the second preset value are not set to 0 is to take into account the volatility of resource utilization. In actual operation, the utilization of CPU and memory may reach a high level, such as 100%, due to some short-term tasks or the increase of instantaneous load. If the resource is judged to be unavailable based only on the short-term high utilization, this judgment may be too hasty and inaccurately reflect the overall health status of the cloud host. By setting a non-zero preset value, it is possible to avoid judging the cloud host as unavailable due to short-term fluctuations, thereby improving the accuracy of the assessment. The preset value provides a lower limit of health, and the health will not drop to zero even under high load. This ensures that the cloud host is still considered available under high load, but the health is low, avoiding unnecessary resource migration or adjustment. This method improves the stability and reliability of health status assessment, making the assessment results more reasonable and credible.

[0080] In summary, setting a non-zero first preset value and a non-zero second preset value can effectively avoid misjudgment caused by short-term fluctuations, ensure the stability and reliability of the evaluation results, prevent misleading users, and ensure service continuity. These make the evaluation of the health status of the cloud host more accurate and practical, and improve user satisfaction.

[0081] In summary, this method can more accurately reflect the actual operating status of the cloud host through refined health assessment, thereby reflecting resource utilization efficiency and service quality during billing, and providing a more fair and reasonable fee settlement method.

[0082] In one embodiment, before calculating the fees incurred by the user during the use of the cloud host based on the calculation weights and the amount of resources, it also includes: determining whether there are resources with abnormal status in the amount of resources allocated to the cloud host; if so, removing the resources with abnormal status from the amount of resources, and calculating the remaining amount of resources after removing the resources with abnormal status; calculating the fees incurred by the user during the use of the cloud host based on the calculation weights and the amount of resources, including: calculating the fees incurred by the user during the use of the cloud host based on the calculation weights and the remaining amount of resources.

[0083] In this embodiment, by checking the status of resources before calculating user fees and eliminating resources with abnormal status, a more fair and reasonable fee calculation can be achieved. Specifically, before starting to calculate the fees, the status of all resources allocated to the cloud host (such as CPU, memory, cloud disk, etc.) must be determined first. Resource status may include normal, abnormal, or unavailable. If an abnormal resource status is detected, such as excessive CPU usage causing the health level to be below the threshold, or cloud disk damage, these resources may not play their due role in actual use. Therefore, it is necessary to eliminate these resources with abnormal status from the resource amount and only consider the usage of normal resources.

[0084] After removing resources with abnormal status, the remaining available resources are calculated. These resources are the resources that users can actually use. Cost calculation is not only based on the number of resources, but also on the health status of resources. The health status is reflected by weights. The better the health status, the higher the weight. The calculation formula combines the amount of resources with the weight to reflect the resource consumption and service quality of users during actual use.

[0085] In this embodiment, resources with abnormal status are eliminated to ensure that users only pay for valid resources actually used, avoiding additional costs caused by resource failure or poor status. It can more fairly reflect the actual usage of users, prevent users from paying for resources that cannot be used normally, and improve user satisfaction.

[0086] In one embodiment, obtaining the resource amount of the cloud host includes: obtaining the test resource amount of the cloud host at different times for multiple times; calculating the average resource amount based on the multiple test resource amounts, and determining the average resource amount as the resource amount of the cloud host.

[0087] In this embodiment, the resource amount of the cloud host is determined by obtaining the test resource amount of the cloud host at different times for multiple times and calculating the average value thereof. This method aims to provide a more accurate and stable resource usage measurement. Specifically, during the operation of the cloud host, its resource usage (such as CPU usage, memory usage, disk usage, etc.) will fluctuate over time. A single measurement may be affected by short-term factors such as instantaneous load and network delay, and thus cannot reflect the actual resource usage of the cloud host. Therefore, by obtaining the resource usage of the cloud host for multiple times at different time points, its performance under different workloads can be captured. After collecting resource usage data at multiple time points, the influence of instantaneous fluctuations can be smoothed out by calculating the average value of these data. The average value provides a stable measurement method that better represents the resource usage of the cloud host over a period of time. The calculated average resource amount is used as the resource amount of the cloud host, reflecting its comprehensive resource usage level in different time periods. This method can reduce the accidental error in a single measurement and make the determination of the resource amount more scientific and reasonable.

[0088] In summary, this embodiment can smooth out the fluctuations caused by instantaneous load peaks or valleys through multiple measurements, thereby obtaining a resource usage situation that is closer to the actual situation. The average resource amount can reflect the usage trend of the cloud host over a long period of time, rather than just the instantaneous state at a certain point in time.

[0089] In one embodiment, before obtaining the test resource amounts of the cloud host at different times for multiple times, it also includes: setting a sampling frequency and / or time interval, and obtaining the test resource amounts of the cloud host at different times for multiple times, including: obtaining the test resource amounts of the cloud host at different times for multiple times according to the sampling frequency and / or time interval; after obtaining the test resource amounts of the cloud host at different times for multiple times, it also includes: judging whether there are abnormal values ​​in the test resource amounts, if so, eliminating the abnormal values, and calculating the average resource amounts based on the test resource amounts excluding the abnormal values.

[0090] In this embodiment, the acquisition frequency of the test resource amount is determined by setting the sampling frequency and time interval. For example, sampling is performed once a minute or once an hour. This ensures that the acquisition of the test resource amount is regular and consistent. By regular sampling, the resource usage of the cloud host at different times can be obtained, the fluctuation and trend of resource usage can be captured, and the deviation that may be caused by sampling at a single time can be avoided. According to the preset sampling frequency and time interval, the resource amount information of the cloud host is regularly obtained. The collected data includes the usage of the central processing unit, the usage of the cloud memory, and the usage of the cloud disk. In the test resource amounts obtained multiple times, it is detected whether there are outliers. For example, the resource usage of some sampling points is significantly higher or lower than that of other sampling points, which may be an outlier caused by load fluctuations or measurement errors in the short term. For example, statistical methods such as standard deviation and mean can be used, or outliers can be detected based on a set threshold. For example, if a data point deviates from the mean by more than twice the standard deviation, it can be considered an outlier. These outliers are removed from the test data. Removing outliers can avoid these outliers from having an adverse effect on the calculation of the average resource amount, thereby improving the accuracy of resource estimation. The average resource amount is calculated based on the remaining test resource amount. The average resource usage is the average of multiple sampling data, which can more accurately reflect the actual resource usage of the cloud host.

[0091] This embodiment can more accurately and reasonably evaluate the actual resource usage of the cloud host by obtaining the test resource volume of the cloud host at different times for multiple times, setting the sampling frequency and time interval, eliminating abnormal values, and calculating the average resource volume. This method not only improves the accuracy of resource volume estimation, but also better reflects the actual usage status of the cloud host, thereby providing a solid foundation for subsequent resource billing and management.

[0092] In summary, by obtaining the test resource volume of the cloud host at different times for multiple times and calculating the average resource volume, a more accurate, fair and reliable resource volume measurement can be achieved, providing a solid data foundation for resource optimization, management and billing.

[0093] In one embodiment, the health status of the cloud host includes a health level, a calculation weight is determined according to the health status of the cloud host, and the fee for the user during the use of the cloud host is calculated according to the calculation weight and the amount of resources, including: determining the calculation weight according to the health level, the calculation weight is positively correlated with the health level; taking the sum of the product of the allocated amount of the central processing unit and the unit price of use of the central processing unit, the product of the allocated amount of the cloud memory and the unit price of use of the cloud memory, and the product of the allocated amount of the cloud disk and the unit price of use of the cloud disk as the unit time fee; obtaining the total time that the user uses the cloud host; determining the total fee according to the unit time fee and the total time; and determining the final fee for the user to use the cloud host according to the total fee and the calculation weight.

[0094] In this embodiment, the health status of the cloud host is included in the calculation process of resource billing. Specifically, the calculation weight is determined by the health level, and the user's fee during the use of the cloud host is calculated in combination with the amount of resources and the usage time. Specifically, the health status of the cloud host can be divided into different health levels, such as healthy, sub-healthy and unhealthy. Each level corresponds to a different health status, reflecting the difference in performance and service quality of the cloud host during operation. The calculation weight is determined according to the health level of the cloud host, and the weight is positively correlated with the health level, which means that the higher the health level (for example, the cloud host is in good operating condition), the higher the calculation weight; conversely, the lower the health level, the lower the calculation weight.

[0095] The usage unit price is the usage unit price of each resource (CPU, cloud memory, cloud disk), which is usually pre-set by the cloud service provider. Multiply the allocation of each resource by its corresponding usage unit price, and then add these products to get the unit time fee. The total time that the user uses the cloud host is usually the sum of the time period from the start to the stop of the cloud host, or accumulated by the billing cycle (such as hours, days, months). Multiply the unit time fee by the total time to get the total fee for the user to use the cloud host. Multiply the total fee by the calculation weight to get the final fee for the user to use the cloud host.

[0096] This embodiment introduces health levels and calculation weights to more accurately reflect the resource utilization efficiency and service quality of cloud hosts in different health states. The fees paid by users are not only related to resource usage, but also to the operating status of the cloud host, which is more reasonable and fair. Since cloud hosts in poor health will lead to lower fees, users will not pay unfairly high fees due to the performance degradation of the cloud host, thereby improving user satisfaction.

[0097] Furthermore, the health status of the cloud host can be evaluated regularly or in real time to determine its health level and adjust the calculation weight accordingly. As the operating status of the cloud host changes, the calculation weight needs to be adjusted dynamically to reflect the current health status in real time.

[0098] In one embodiment, it also includes providing users with a transparent fee calculation method and a detailed billing report, which explains the composition of the fee and the impact of the health status on the fee. Providing clear usage and fee data enables users to better understand and manage their cloud resources.

[0099] In summary, in this embodiment, the resource billing of the cloud host is not only based on the resource quantity and usage time, but also takes the health status into consideration, which can more accurately reflect the actual resource utilization and improve the fairness of billing and user satisfaction.

[0100] Second, as Figure 2As shown, the present application provides a resource billing system, including: an acquisition unit 21, used to acquire the resource amount of the cloud host, the resource amount at least including the allocation amount of the central processing unit allocated to the cloud host, the allocation amount of the cloud memory and the allocation amount of the cloud disk; a health assessment unit 22, used to acquire the state assessment parameters of the cloud host, and determine the health state of the cloud host according to the state assessment parameters of the cloud host; a fee calculation unit 23, used to determine the calculation weight according to the health state of the cloud host, and calculate the fee of the user during the use of the cloud host according to the calculation weight and the resource amount.

[0101] In one embodiment, it also includes: a physical status acquisition unit, which is used to obtain the status and resource quantity of the physical host and the status and resource quantity of the physical storage pool before obtaining the resource quantity of the cloud host, and the status of the physical host and the status of the physical storage pool include an available status and an unavailable status; a status setting unit, which is used to determine the status of the cloud host created on the physical host according to the status of the physical host; and determine the status of the cloud disk created on the physical storage pool according to the status of the physical storage pool.

[0102] In one embodiment, the health assessment unit 22 includes:

[0103] A health acquisition unit, used to acquire the health of the central processor corresponding to the cloud host, the health of the cloud memory and the health of the cloud disk;

[0104] The health determination unit is used to determine the health status of the cloud host according to the health of the central processing unit, the weight of the central processing unit, the health of the cloud memory, the weight of the cloud memory, the health of the cloud disk and the weight of the cloud disk.

[0105] In one embodiment, the health acquisition unit is specifically used to: when the usage rate of the central processing unit does not reach the first threshold, determine the health of the central processing unit as a first preset value; when the usage rate of the central processing unit reaches the first threshold, determine the health of the central processing unit as the larger value of the first calculated value and the second preset value; the first calculated value is (1-the usage rate of the central processing unit) × 100%, and the second preset value is less than the first preset value; when the usage rate of the cloud memory does not reach the second threshold, determine the health of the cloud memory as a third preset value; when the usage rate of the cloud memory reaches the second threshold, determine the health of the cloud memory as the larger value of the second calculated value and the fourth preset value; the second calculated value is (1-the usage rate of the cloud memory) × 100%, and the third preset value is greater than the fourth preset value; determine the health of the cloud disk according to the ratio of the number of normally available cloud disks to the total number of cloud disks.

[0106] In one embodiment, it also includes: a resource elimination unit, which is used to determine whether there are resources with abnormal status in the resource amount allocated to the cloud host before calculating the user's fee during the use of the cloud host based on the calculation weight and the resource amount; if so, the resources with abnormal status are eliminated from the resource amount, and the remaining resource amount after eliminating the resources with abnormal status is calculated; a fee calculation unit 23, which is specifically used to determine the calculation weight according to the health status of the cloud host, and calculate the user's fee during the use of the cloud host based on the calculation weight and the remaining resource amount.

[0107] In one embodiment, the acquisition unit 21 is specifically used to obtain the test resource amounts of the cloud host at different times for multiple times; calculate the average resource amount according to the multiple test resource amounts, and determine the average resource amount as the resource amount of the cloud host.

[0108] In one embodiment, the health status of the cloud host includes a health level, and the cost calculation unit 23 is specifically used to determine the calculation weight according to the health level, and the calculation weight is positively correlated with the health level; the sum of the product of the allocated amount of the central processing unit and the unit price of the central processing unit, the product of the allocated amount of the cloud memory and the unit price of the cloud memory, and the product of the allocated amount of the cloud disk and the unit price of the cloud disk is used as the unit time cost; the total time that the user uses the cloud host is obtained; the total cost is determined according to the unit time cost and the total time; and the final cost of the user using the cloud host is determined according to the total cost and the calculation weight.

[0109] For the description of the resource billing system, please refer to the above embodiment, and this application will not go into details here.

[0110] Thirdly, Figure 3 As shown, the present application provides a resource billing device, including:

[0111] A memory 31, used for storing computer programs;

[0112] The processor 32 is used to implement the steps of the above-mentioned resource charging method when executing the computer program.

[0113] For the description of the resource billing device, please refer to the above embodiment, and this application will not go into details here.

[0114] Fourthly, Figure 4 As shown, the present application provides a non-volatile storage medium 40, on which a computer program 41 is stored, and when the computer program 41 is executed by a processor, the steps of the above-mentioned resource billing method are implemented. For the description of the non-volatile storage medium 40, please refer to the above-mentioned embodiment, and the present application will not repeat it here.

[0115] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such 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 including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0116] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A resource charging method, characterized in that: include: Obtaining the resource amount of the cloud host, the resource amount at least including the allocation amount of the central processing unit allocated to the cloud host, the allocation amount of the cloud memory, and the allocation amount of the cloud disk; Acquire status evaluation parameters of the cloud host, and determine the health status of the cloud host according to the status evaluation parameters of the cloud host; A calculation weight is determined according to the health status of the cloud host, and a fee for the user during the period of using the cloud host is calculated according to the calculation weight and the resource amount.

2. The resource charging method according to claim 1, characterized in that: Before obtaining the cloud host's resource volume, it also includes: Acquire the state and resource amount of the physical host and the state and resource amount of the physical storage pool, wherein the state of the physical host and the state of the physical storage pool include an available state and an unavailable state; Determine the state of the cloud host created on the physical host according to the state of the physical host; The state of the cloud disk created on the physical storage pool is determined according to the state of the physical storage pool.

3. The resource charging method according to claim 1, characterized in that: Acquiring a status evaluation parameter of the cloud host, and determining a health status of the cloud host according to the status evaluation parameter of the cloud host, including: Obtain the health of the central processing unit, the health of the cloud memory, and the health of the cloud disk corresponding to the cloud host; The health status of the cloud host is determined according to the health of the central processor, the weight of the central processor, the health of the cloud memory, the weight of the cloud memory, the health of the cloud disk and the weight of the cloud disk.

4. The resource charging method according to claim 3, characterized in that: Obtaining the health of the central processor, the health of the cloud memory, and the health of the cloud disk corresponding to the cloud host, including: When the usage rate of the central processing unit does not reach a first threshold, determining the health of the central processing unit to be a first preset value; When the usage rate of the central processing unit reaches the first threshold, determining the health of the central processing unit to be a larger value of a first calculated value and a second preset value; The first calculated value is (1-the usage rate of the central processing unit)×100%, and the second preset value is less than the first preset value; When the usage rate of the cloud memory does not reach the second threshold, determining the health of the cloud memory to be a third preset value; When the usage rate of the cloud memory reaches the second threshold, determining the health of the cloud memory to be a larger value between a second calculated value and a fourth preset value; The second calculated value is (1-the usage rate of the cloud memory)×100%, and the third preset value is greater than the fourth preset value; The health of the cloud disk is determined according to a ratio of the number of normally available cloud disks to the total number of cloud disks.

5. The resource charging method according to claim 1, characterized in that: Before calculating the fee for the user during the period of using the cloud host according to the calculation weight and the resource amount, the method further includes: Determining whether there are any resources with abnormal status among the resources allocated to the cloud host; If so, remove the resource with abnormal status from the resource amount, and calculate the remaining resource amount after removing the resource with abnormal status; Calculating the cost of the user during the period of using the cloud host according to the calculation weight and the resource amount, including: The fee for the user during the period of using the cloud host is calculated according to the calculation weight and the remaining resource amount.

6. The resource charging method according to claim 1, characterized in that: Get the cloud host's resource quantity, including: Obtaining the test resource amount of the cloud host at different times multiple times; An average resource amount is calculated based on the multiple test resource amounts, and the average resource amount is determined as the resource amount of the cloud host.

7. The resource charging method according to any one of claims 1 to 6, characterized in that: The health status of the cloud host includes a health level, a calculation weight is determined according to the health status of the cloud host, and a fee for the user during the use of the cloud host is calculated according to the calculation weight and the resource amount, including: Determine the calculation weight according to the health level, wherein the calculation weight is positively correlated with the health level; The sum of the product of the allocated amount of the CPU and the unit price of the CPU, the product of the allocated amount of the cloud memory and the unit price of the cloud memory, and the product of the allocated amount of the cloud disk and the unit price of the cloud disk is taken as the unit time fee; Obtaining the total time the user has used the cloud host; Determine the total cost according to the unit time cost and the total time; The final fee for the user to use the cloud host is determined according to the total fee and the calculation weight.

8. A resource billing system, characterized in that: include: An acquisition unit, configured to acquire the resource amount of the cloud host, wherein the resource amount at least includes the allocation amount of the central processing unit, the allocation amount of the cloud memory, and the allocation amount of the cloud disk allocated to the cloud host; A health assessment unit, used to obtain a status assessment parameter of the cloud host, and determine a health status of the cloud host according to the status assessment parameter of the cloud host; The cost calculation unit is used to determine the calculation weight according to the health status of the cloud host, and calculate the cost of the user during the use of the cloud host according to the calculation weight and the resource amount.

9. A resource billing device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the resource charging method according to any one of claims 1 to 7 when executing a computer program.

10. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the resource charging method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method and system for distributing cloud computing resources

    CN103164279A

  • Cloud host charging method and device according to quantity

    CN108833123A

  • Method and system for measuring and calculating profit and loss of cloud host and cloud machine room, and computer medium

    CN113409085A