Resource usage estimation method, device and equipment

By calculating the deviation degree of the resource usage indicator, the sample group is divided and unbiased estimation is performed, which solves the problem of inaccurate usage estimation of the sliding average algorithm under emergencies and improves the accuracy and adaptability of resource usage estimation.

CN113342522BActive Publication Date: 2024-10-01WEBANK (CHINA)
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202110621676.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-03
Publication Date
2024-10-01
Estimated Expiration
2041-06-03

AI Technical Summary

Technical Problem

When faced with abnormally high business loads and a large number of concurrent service requests, the existing sliding average algorithm has low accuracy in resource usage estimation and cannot effectively respond to emergencies.

Method used

By obtaining the current measurement value of the resource usage indicator, calculating the deviation between the sample group obtained by dividing the historical measurement value, determining the target sample group to which the current measurement value belongs, and adding it as a new sample value to the target sample group for seamless testing. For partial estimation, statistical values ​​are updated to combine to obtain resource usage estimates.

Benefits of technology

It improves the accuracy of resource usage estimation, can effectively deal with complex change scenarios of single-machine or multi-machine servers, filters random data jitter while retaining mutation characteristics, and adapts to resource usage changes with different probability distributions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113342522B_ABST
    Figure CN113342522B_ABST
Patent Text Reader

Abstract

The present invention discloses a resource usage estimation method, device and equipment, the method comprising: obtaining the current measurement value of the resource usage index, and respectively calculating the deviation between the current measurement value and each sample group, wherein the sample group is obtained by dividing the historical measurement value of the resource usage index, and the probability distribution of each sample group is different; determining the target sample group to which the current measurement value belongs according to the deviation; adding the current measurement value as a new sample value to the target sample group, and using the new sample value to make an unbiased estimate of the target sample group to update the statistical value of the target sample group; based on the target sample group after the statistical value is updated, merging the mean estimation value in the statistical value of each sample group to obtain the resource usage estimation corresponding to the current measurement value. The present invention realizes the ability to effectively cope with various complex change scenarios of resource usage of single-machine or multi-machine servers, and improves the accuracy of resource usage estimation in various scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of resource management, and in particular to a resource usage estimation method, device and equipment. Background Art

[0002] Currently, it is becoming more and more common to purchase cloud servers, dynamically apply for resources, and provide services to customers. How to quickly, accurately, and cost-effectively estimate resource usage and make corresponding response strategies based on usage changes is of great significance to meeting service level agreements and improving service quality. The current usage estimation uses a sliding average algorithm to calculate usage changes. However, the sliding average algorithm itself is based on the assumption that usage conforms to an independent Gaussian distribution, which is suitable for slow fluctuations under single machine and stable operation conditions. When there are emergencies such as abnormalities, temporary high business loads, and a large number of concurrent service requests, the resource usage estimation accuracy is not high. Summary of the invention

[0003] The main purpose of the present invention is to provide a resource usage estimation method, device and equipment, aiming to solve the technical problem that the current usage estimation method based on the sliding average algorithm has low accuracy in resource usage estimation when emergencies such as abnormalities, temporary high business loads, and a large number of concurrent service requests occur.

[0004] To achieve the above object, the present invention provides a method for estimating resource usage, the method comprising the following steps:

[0005] Obtaining a current measurement value of a resource usage indicator, and respectively calculating a deviation between the current measurement value and each sample group, wherein the sample groups are obtained by dividing historical measurement values ​​of the resource usage indicator, and the probability distribution of each sample group is different;

[0006] Determine the target sample group to which the current measurement value belongs according to the deviation;

[0007] Adding the current measurement value as a new sample value to the target sample group, and using the new sample value to perform an unbiased estimation on the target sample group to update the statistical value of the target sample group;

[0008] Based on the target sample group after the updated statistical value, the mean estimated values ​​in the statistical values ​​of each sample group are combined to obtain the resource usage estimation corresponding to the current measurement value.

[0009] Optionally, the step of respectively calculating the deviation between the current measurement value and each sample group includes:

[0010] Obtaining current statistical values ​​of each sample group, wherein the statistical values ​​include a mean estimate and a variance estimate;

[0011] For each of the sample groups, the degree of deviation between the current measurement value and the sample group is obtained by dividing the absolute value of the difference between the current measurement value and the estimated mean value of the sample group by the estimated variance value of the sample group.

[0012] Optionally, the step of determining the target sample group to which the current measurement value belongs according to the deviation comprises:

[0013] When it is detected that the first condition or the second condition is met, a new sample group is added as the target sample group to which the current measurement value belongs, wherein the first condition is that each of the deviations is greater than a preset threshold and the current number of sample groups is less than a preset number of groups, and the second condition is that the current number of sample groups is zero;

[0014] When it is detected that the third condition or the fourth condition is met, the sample group corresponding to the smallest deviation among the deviations is taken as the target sample group to which the current measurement value belongs, wherein the third condition is that not all of the deviations are greater than the preset threshold, and the fourth condition is that all of the deviations are greater than the preset threshold and the current number of sample groups is not less than the preset number of groups.

[0015] Optionally, the step of using the new sample value to perform unbiased estimation on the target sample group to update the statistical value of the target sample group includes:

[0016] When the probability distribution type of the target sample group is Gaussian distribution, calculating the absolute value of the difference between the new sample value and the mean estimate in the current statistical value of the target sample group;

[0017] Performing weighted averaging of the variance estimate in the current statistical value and the absolute value of the difference according to a first preset weight, to obtain an updated variance estimate of the target sample group;

[0018] The new sample value and the mean estimate in the current statistical value are weighted averaged according to a second preset weight to obtain an updated mean estimate of the target sample group.

[0019] Optionally, the step of using the new sample value to perform unbiased estimation on the target sample group to update the statistical value of the target sample group includes:

[0020] When the probability distribution type of the target sample group is Poisson distribution, multiplying the mean estimate value in the current statistical value of the target sample group by the first sample number and adding the new sample value to obtain the total sample value, wherein the first sample number is the number of samples in the target sample group before the new sample value is added to the target sample group;

[0021] Dividing the total sample value by a second sample number to obtain an updated mean estimate of the target sample group, wherein the second sample number is obtained by adding one to the first sample number;

[0022] The updated mean estimate of the target sample group is used as the updated variance estimate of the target sample group.

[0023] Optionally, the step of using the new sample value to perform unbiased estimation on the target sample group to update the statistical value of the target sample group includes:

[0024] When the target sample group is a newly added sample group, the new sample value is used as the mean estimate of the target sample group, and the new sample value is divided by two to obtain the variance estimate of the target sample group.

[0025] Optionally, after the step of adding the current measurement value as a new sample value to the target sample group and using the new sample value to perform an unbiased estimation on the target sample group to update the statistical value of the target sample group, the method further includes:

[0026] Detecting whether the variance estimate of the target sample group after the updated statistical value is greater than or equal to the mean estimate;

[0027] If yes, the probability distribution type of the target sample group is converted from the default Gaussian distribution to the Poisson distribution.

[0028] Optionally, after the step of combining the estimated mean values ​​in the statistical values ​​of each sample group based on the target sample group after the updated statistical value to obtain the resource usage estimate corresponding to the current measurement value, the step further includes:

[0029] Detecting whether the resource usage estimate is greater than a preset usage;

[0030] If the resource usage estimate is greater than the preset usage, expansion prompt information is output.

[0031] To achieve the above object, the present invention further provides a resource usage estimation device, the device comprising:

[0032] An acquisition module, used to acquire a current measurement value of a resource usage indicator, and respectively calculate a deviation between the current measurement value and each sample group, wherein the sample groups are obtained by dividing the historical measurement values ​​of the resource usage indicator, and the probability distribution of each sample group is different;

[0033] A determination module, used for determining the target sample group to which the current measurement value belongs according to the deviation;

[0034] An updating module, configured to add the current measurement value as a new sample value to the target sample group, and use the new sample value to perform an unbiased estimation on the target sample group to update the statistical value of the target sample group;

[0035] The calculation module is used to combine the estimated mean values ​​in the statistical values ​​of each sample group based on the target sample group after the statistical value is updated to obtain the resource usage estimation value corresponding to the current measurement value.

[0036] To achieve the above-mentioned purpose, the present invention also provides a resource usage estimation device, which includes: a memory, a processor, and a resource usage estimation program stored in the memory and executable on the processor, and the resource usage estimation program implements the steps of the resource usage estimation method described above when executed by the processor.

[0037] In addition, to achieve the above objectives, the present invention also proposes a computer-readable storage medium, on which a resource usage estimation program is stored, and when the resource usage estimation program is executed by a processor, the steps of the resource usage estimation method as described above are implemented.

[0038] In the present invention, the current measurement value of the resource usage indicator is obtained, and the deviation between the current measurement value and the sample groups belonging to different probabilities obtained by dividing the historical measurement values ​​is calculated respectively. The target sample group to which the current measurement value belongs is determined according to the deviation, and the current measurement value is added to the target sample group as a new sample value. The new sample value is used to perform an unbiased estimate of the target sample group to update the statistical value of the target sample group, and then the resource usage valuation is obtained by merging the mean estimated values ​​in the statistical values ​​of each sample group. Compared with the usage estimation method that adopts the sliding average algorithm for Gaussian distribution, which can only be applicable to the usage change scenario with smooth and slowly fluctuating fluctuations, the present invention assumes that the resource usage indicator is a mixture of multiple probability distributions. According to this assumption, by dividing the measured values ​​into the sample groups to which they belong according to the deviation between the measured values ​​and the sample groups, the various sample groups with different probability distributions are adaptively established to track various mutation characteristics of resource usage. At the same time, the statistical values ​​of the sample groups are updated through unbiased estimation, and the resource usage valuation is calculated according to the mean estimated value of each sample group. It is achieved that random jitter of the data is filtered out while retaining the mutation characteristics of the data, so that it can effectively cope with various complex change scenarios of resource usage of single or multi-machine servers, and improve the accuracy of resource usage estimation in various scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A schematic diagram of the structure of the hardware operating environment involved in the embodiment of the present invention;

[0040] Figure 2It is a flowchart of a first embodiment of a method for estimating resource usage according to the present invention;

[0041] Figure 3 A comparison diagram of the effect of dosage estimation involved in an embodiment of the present invention;

[0042] Figure 4 Schematic diagram of functional modules of a preferred embodiment of the resource usage estimation device of the present invention.

[0043] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0045] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.

[0046] It should be noted that the resource usage estimation device in the embodiment of the present invention can be a smart phone, a personal computer, a server and other devices, and no specific limitation is made here.

[0047] like Figure 1 As shown, the resource usage estimation device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0048] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation on the resource usage estimation device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0049] like Figure 1As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a resource usage estimation program. The operating system is a program that manages and controls the hardware and software resources of the device, and supports the operation of the resource usage estimation program and other software or programs. Figure 1 In the device shown, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used for establishing a communication connection with the server; and the processor 1001 can be used to call the resource usage estimation program stored in the memory 1005 and perform the following operations:

[0050] Obtaining a current measurement value of a resource usage indicator, and respectively calculating a deviation between the current measurement value and each sample group, wherein the sample groups are obtained by dividing historical measurement values ​​of the resource usage indicator, and the probability distribution of each sample group is different;

[0051] Determine the target sample group to which the current measurement value belongs according to the deviation;

[0052] Adding the current measurement value as a new sample value to the target sample group, and using the new sample value to perform an unbiased estimation on the target sample group to update the statistical value of the target sample group;

[0053] Based on the target sample group after the updated statistical value, the mean estimated values ​​in the statistical values ​​of each sample group are combined to obtain the resource usage estimation corresponding to the current measurement value.

[0054] Furthermore, the step of respectively calculating the deviation between the current measurement value and each sample group includes:

[0055] Obtaining current statistical values ​​of each sample group, wherein the statistical values ​​include a mean estimate and a variance estimate;

[0056] For each of the sample groups, the degree of deviation between the current measurement value and the sample group is obtained by dividing the absolute value of the difference between the current measurement value and the estimated mean value of the sample group by the estimated variance value of the sample group.

[0057] Furthermore, the step of determining the target sample group to which the current measurement value belongs according to the deviation comprises:

[0058] When it is detected that the first condition or the second condition is met, a new sample group is added as the target sample group to which the current measurement value belongs, wherein the first condition is that each of the deviations is greater than a preset threshold and the current number of sample groups is less than a preset number of groups, and the second condition is that the current number of sample groups is zero;

[0059] When it is detected that the third condition or the fourth condition is met, the sample group corresponding to the smallest deviation among the deviations is taken as the target sample group to which the current measurement value belongs, wherein the third condition is that not all of the deviations are greater than the preset threshold, and the fourth condition is that all of the deviations are greater than the preset threshold and the current number of sample groups is not less than the preset number of groups.

[0060] Furthermore, the step of using the new sample value to perform unbiased estimation on the target sample group to update the statistical value of the target sample group includes:

[0061] When the probability distribution type of the target sample group is Gaussian distribution, calculating the absolute value of the difference between the new sample value and the mean estimate in the current statistical value of the target sample group;

[0062] Performing weighted averaging of the variance estimate in the current statistical value and the absolute value of the difference according to a first preset weight, to obtain an updated variance estimate of the target sample group;

[0063] The new sample value and the mean estimate in the current statistical value are weighted averaged according to a second preset weight to obtain an updated mean estimate of the target sample group.

[0064] Furthermore, the step of using the new sample value to perform unbiased estimation on the target sample group to update the statistical value of the target sample group includes:

[0065] When the probability distribution type of the target sample group is Poisson distribution, multiplying the mean estimate value in the current statistical value of the target sample group by the first sample number and adding the new sample value to obtain the total sample value, wherein the first sample number is the number of samples in the target sample group before the new sample value is added to the target sample group;

[0066] Dividing the total sample value by a second sample number to obtain an updated mean estimate of the target sample group, wherein the second sample number is obtained by adding one to the first sample number;

[0067] The updated mean estimate of the target sample group is used as the updated variance estimate of the target sample group.

[0068] Furthermore, the step of using the new sample value to perform unbiased estimation on the target sample group to update the statistical value of the target sample group includes:

[0069] When the target sample group is a newly added sample group, the new sample value is used as the mean estimate of the target sample group, and the new sample value is divided by two to obtain the variance estimate of the target sample group.

[0070] Further, after the step of adding the current measurement value as a new sample value to the target sample group and using the new sample value to perform an unbiased estimation on the target sample group to update the statistical value of the target sample group, the processor 1001 may also be used to call a resource usage estimation program stored in the memory 1005 to perform the following operations:

[0071] Detecting whether the variance estimate of the target sample group after the updated statistical value is greater than or equal to the mean estimate;

[0072] If yes, the probability distribution type of the target sample group is converted from the default Gaussian distribution to the Poisson distribution.

[0073] Further, after the step of merging the mean estimated values ​​in the statistical values ​​of each sample group based on the target sample group after the updated statistical value to obtain the resource usage estimation corresponding to the current measurement value, the processor 1001 may also be used to call the resource usage estimation program stored in the memory 1005 to perform the following operations:

[0074] Detecting whether the resource usage estimate is greater than a preset usage;

[0075] If the resource usage estimate is greater than the preset usage, expansion prompt information is output.

[0076] Based on the above structure, various embodiments of a resource usage estimation method are proposed.

[0077] Reference Figure 2 , Figure 2 FIG. 1 is a flow chart of a first embodiment of a method for estimating resource usage according to the present invention.

[0078] The embodiments of the present invention provide embodiments of the resource usage estimation method. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than here. The execution subjects of each embodiment of the resource usage estimation method of the present invention may be devices such as smart phones, personal computers, and servers. For ease of description, the execution subjects are omitted in the following embodiments. In this embodiment, the resource usage estimation method includes:

[0079] Step S10, obtaining the current measurement value of the resource usage indicator, and respectively calculating the deviation between the current measurement value and each sample group, wherein the sample groups are obtained by dividing the historical measurement values ​​of the resource usage indicator, and the probability distribution of each sample group is different;

[0080] The measured values ​​of resource usage often contain random jitter and cannot be directly used in actual business scenarios, such as resource expansion and contraction scenarios. Therefore, it is necessary to filter out the random jitter and retain the accurate change characteristics, that is, to calculate the resource usage valuation and use the resource usage valuation instead of the original measurement value for actual business scenarios.

[0081] In this embodiment, through the observation of resource consumption in a cloud server cluster scenario composed of multiple machines, it is found that in most cases, resource consumption will have characteristics that appear as mutations in the time domain, but can be stable and continuous over a period of time (possibly due to sudden business traffic, machine failures, and machine migration), and rarely slow changes. For example, due to business expansion requirements, it is temporarily necessary to bear several hours of concentrated and continuous user access requests, and then these requests disappear; for example, daily user access requests are uniformly in line with the normal distribution, while short-term burst traffic is more in line with the Poisson distribution. Therefore, only using the sliding average algorithm for the Gaussian distribution, a probability distribution, to estimate resource usage, the characteristics of sudden changes in resource usage in multi-machine scenarios are often unable to be accurately tracked, and thus accurate resource usage valuation cannot be obtained.

[0082] In response to this finding, in this embodiment, a fast, accurate, lightweight and low-overhead method for estimating server resource usage is proposed. By adaptively segmenting the server resource usage, data change tracking and feature matching of resource usage can be achieved at high speed and efficiency, without the need to introduce specific software and hardware, and with strong versatility and adaptability. The specific principle is to assume that the resource usage indicator is a mixture of multiple probability distributions, and the types of multiple probability distributions can be the same or different, for example, possible probability distribution types such as Gaussian distribution, binomial distribution and Poisson distribution; by adaptively dividing the continuously incoming measurement values ​​of the resource usage indicator into the probability distribution to which it belongs, the various mutation characteristics of the usage can be accurately detected and retained, and the random jitter part can be filtered by updating the mean estimate of the sample group through unbiased estimation, and the mean estimate of each group of probability distributions is merged to obtain an accurate resource usage estimate.

[0083] Specifically, the measured value of the resource usage indicator can be collected according to a certain collection frequency. Among them, the collection frequency can be set as needed, for example, set to once per second, which is not limited in this embodiment. The resource usage indicator can be the usage of the hardware components of the computing device, such as the storage capacity consumed by the application, network throughput, battery, CPU, etc., or the software components of the computing device such as the length of time the application is called, the frequency of abnormalities, etc. The measured value of the resource usage indicator can come from a single machine or multiple machines, and the collection method can refer to the existing collection method, which is not limited in this embodiment. In the following embodiments, the resource usage indicator of the current network throughput of the machine (in KB / s) is used as a specific example to illustrate.

[0084] Get the current measurement value of the resource usage indicator, that is, the measurement value collected at the current moment. Calculate the deviation between the current measurement value and each sample group respectively. Among them, each sample group is obtained by dividing the historical measurement values, that is, a sample group includes one or more historical measurement values. It can be understood that the way of dividing the historical measurement values ​​into sample groups is the same as the way of dividing the current measurement values ​​into sample groups in the following steps. Since the deviation between the measurement value and the sample group is taken into account when dividing the measurement value into the sample group, the measurement value is divided into the probability distribution to which it belongs according to the deviation, so the probability distribution of each sample group obtained by the division is different. Here, the two different probability distributions may refer to the two probability distributions belonging to the same type of probability distribution but are two independent probability distributions, such as two independent Gaussian distributions, or it may refer to the two probability distributions belonging to different types of probability distributions.

[0085] It should be noted that when the current measurement value is the first measurement value collected and there is no historical measurement value before, it can be assumed that there is no sample group at present, and then no deviation calculation is performed. Alternatively, an empty sample group with no sample values ​​can be pre-set to calculate the deviation between the current measurement value and this empty sample group.

[0086] There are many methods for calculating the deviation. For example, in one embodiment, the step of respectively calculating the deviation between the current measurement value and each sample group in step S10 includes:

[0087] Step S101, obtaining the current statistical value of each sample group, wherein the statistical value includes a mean estimate and a variance estimate;

[0088] The current statistical values ​​of each sample value may be obtained first, and the statistical values ​​may include a mean estimate and a variance estimate. The mean estimate and the variance estimate may be directly calculated for each sample value in the sample group, or may be updated by performing an unbiased estimate on the sample group when a sample value was added to the sample group last time.

[0089] Step S102: For each of the sample groups, the absolute value of the difference between the current measurement value and the estimated mean value of the sample group is divided by the estimated variance value of the sample group to obtain the deviation between the current measurement value and the sample group.

[0090] For a sample group, the deviation between the current measurement value and the estimated mean value of the sample group is divided by the estimated variance of the sample group to obtain the deviation between the current measurement value and the sample group. The deviation between the current measurement value and the sample group is calculated in this way for each sample group. The specific formula for calculating the deviation between the measurement value and the sample group is as follows:

[0091]

[0092] Among them, M t is the current measured value, M m (i) is the estimated mean of the i-th sample group, M v (i) is the variance estimate of the i-th sample group.

[0093] It should be noted that, if an empty sample group is preset as the first sample group, the variance of the empty sample group can be set to 0. In this case, the deviation between the calculated current measurement value and the empty sample group is 0.

[0094] Step S20, determining the target sample group to which the current measurement value belongs according to the deviation;

[0095] After calculating the deviation between the current measurement value and each sample group, the sample group to which the current measurement value belongs can be determined based on the deviation, and this sample group is called the target sample group. The principle of determining the sample group to which the current measurement value belongs based on the deviation is that the smaller the deviation between the measurement value and a sample group, the greater the possibility that the measurement value belongs to the probability distribution corresponding to the sample group. Based on this principle, there are many specific implementation methods for determining the target sample group to which the current measurement value belongs based on the deviation, which are not limited in this embodiment.

[0096] For example, in one embodiment, when the deviation between the current measurement value and each sample group is greater than a preset threshold, it means that the possibility that the current measurement value belongs to any current sample group is very small. In essence, the change trend of the current measurement value relative to the historical measurement value has undergone a new mutation. The new mutation feature is tracked by calculating and comparing the deviation. At this time, the mutation feature can be retained by adding a new sample group as the target sample group to which the current measurement value belongs, so that accurate dosage estimation can be performed based on the mutation feature in the future. When the deviation between the current measurement value and each sample group is not greater than the preset threshold, it means that the current measurement value is likely to belong to the sample group with the smallest deviation. At this time, the sample group corresponding to the smallest deviation can be selected as the target sample group. Among them, the preset threshold can be set according to specific needs. When the deviation is greater than the preset threshold, it means that the current measurement value cannot belong to the sample group corresponding to the deviation. It can be understood that different sample groups correspond to different probability distributions. The change from one probability distribution to another probability distribution reflects the mutation of data. By dividing the measurement value into the sample group to which it belongs according to the deviation between the measurement value and the sample group, it is actually tracking the mutation feature.

[0097] Step S30, adding the current measurement value as a new sample value to the target sample group, and using the new sample value to perform an unbiased estimation on the target sample group to update the statistical value of the target sample group;

[0098] After determining the target sample group to which the current measurement value belongs, the current measurement value is added to the target sample group as a new sample value, and the new sample value is used to perform an unbiased estimate on the target sample group to update the statistical value of the target sample group. There are many methods for performing an unbiased estimate on the target sample group using the new sample value, which are not limited in this embodiment. For example, for Gaussian distribution, a sliding average algorithm can be used for updating. The statistical value may include a mean estimate, or include a mean estimate and a variance estimate, or in other embodiments, may include other statistical values ​​that can reflect the characteristics of the probability distribution.

[0099] Step S40: Based on the target sample group after the updated statistical value, the mean estimated values ​​in the statistical values ​​of each sample group are combined to obtain a resource usage estimate corresponding to the current measurement value.

[0100] After the target sample group is estimated unbiasedly and the statistics are updated, based on the target sample group after the statistics are updated, the mean estimates in the statistics of each existing sample group are merged to obtain the resource usage estimate corresponding to the current measurement value. Specifically, in one embodiment, the resource usage estimate can be obtained by merging the mean estimates of each sample group in a manner of weighted averaging the mean estimates of each sample group using the number of samples in each group as a weight. In other embodiments, other methods can also be used for merging, such as eliminating sample groups with too few samples, and obtaining the resource usage estimate by weighted averaging the mean estimates of the remaining sample groups using the number of samples in each group as a weight.

[0101] It should be noted that by adding the current measurement value to the target sample group to which it belongs, the new change characteristics of resource usage can be accurately retained, and the mean estimate of the sample group is updated by an unbiased estimation method, which can filter out the random jitter part of the data, and obtain the resource usage estimation by merging the mean estimates of each sample group. This achieves the goal of filtering out the random jitter part in the measurement value while accurately retaining various mutation characteristics, thereby obtaining an accurate resource usage estimation.

[0102] In this embodiment, the current measurement value of the resource usage indicator is obtained, and the deviation between the current measurement value and the sample groups belonging to different probabilities obtained by dividing the historical measurement values ​​is calculated respectively. The target sample group to which the current measurement value belongs is determined according to the deviation, and the current measurement value is added to the target sample group as a new sample value. The new sample value is used to perform an unbiased estimate of the target sample group to update the statistical value of the target sample group, and then the resource usage valuation is obtained by merging the mean estimated values ​​in the statistical values ​​of each sample group. Compared with the usage estimation method using the sliding average algorithm for Gaussian distribution, which can only be applicable to scenarios with smooth and slowly fluctuating usage changes, this embodiment assumes that the resource usage indicator is a mixture of multiple probability distributions. According to this assumption, the measured values ​​are divided into the sample groups to which they belong according to the deviation between the measured values ​​and the sample groups. In this way, sample groups with different probability distributions are adaptively established to track various mutation characteristics of resource usage. At the same time, the statistical values ​​of the sample groups are updated through unbiased estimation, and the resource usage valuation is calculated according to the mean estimated value of each sample group. This achieves filtering of random data jitter while retaining the mutation characteristics of the data, thereby being able to effectively cope with various complex changes in resource usage of single or multi-machine servers and improving the accuracy of resource usage estimation in various scenarios.

[0103] Furthermore, after the resource usage estimation is calculated, the resource usage estimation can be used in actual business scenarios, such as resource expansion and contraction scenarios. In one embodiment, after step S40, the following is further included:

[0104] Step S50, detecting whether the resource usage estimate is greater than a preset usage;

[0105] Step S60: if the resource usage estimate is greater than the preset usage, outputting capacity expansion prompt information.

[0106] After calculating the resource usage estimate corresponding to the current measurement value, check whether the resource usage estimate is greater than the preset amount. The preset amount is the maximum available amount of a current resource set in advance according to needs. When the resource usage estimate is greater than the preset amount, it means that the current resources can no longer meet business needs and additional server resources are needed to cope with more business volume. When it is detected that the resource usage estimate is greater than the preset amount, an expansion prompt message can be output to prompt the server operation and maintenance personnel to expand the server resources.

[0107] Further, based on the above first embodiment, a second embodiment of the resource usage estimation method of the present invention is proposed. In this embodiment, step S20 includes:

[0108] Step S201, when it is detected that the first condition or the second condition is met, a new sample group is added as the target sample group to which the current measurement value belongs, wherein the first condition is that each of the deviations is greater than a preset threshold and the current number of sample groups is less than a preset number of groups, and the second condition is that the current number of sample groups is zero;

[0109] After calculating the deviation between the current measurement value and each sample group, the sample group to which the current measurement value belongs can be determined based on the deviation.

[0110] Specifically, in this embodiment, when it is detected that the first condition or the second condition is met, a new sample group can be added as the target sample group to which the current measurement value belongs. Among them, the first condition is that the deviation between the current measurement value and each sample group is greater than the preset threshold, and the number of the current sample group is less than the preset number of groups. The preset threshold is set as needed. When the deviation between the current measurement value and the sample group is greater than the preset threshold, it means that the probability distribution of the current measurement value belonging to the sample group is very small or it is impossible to belong to the probability distribution of the sample group. The preset number of groups can be set according to specific needs, which indicates the maximum number of sample groups allowed to be established; when the preset number of groups is larger, the more sample groups are allowed to be established, and the more probability distributions are divided, so that the mutation characteristics of resource usage can be detected more accurately; at the same time, when the preset number of groups is larger, the more sample groups need to calculate the deviation, and the greater the amount of calculation; therefore, in practical applications, the preset number of groups can be set according to the accuracy and calculation efficiency requirements of resource usage estimation. The second condition is that the current sample group number is zero, that is, the current measurement value is the first measurement value, and no sample group has been established. Therefore, in this case, a new sample group is added as the target sample group to which the current measurement value belongs.

[0111] Step S202, when it is detected that the third condition or the fourth condition is met, the sample group corresponding to the smallest deviation among the deviations is used as the target sample group to which the current measurement value belongs, wherein the third condition is that not all of the deviations are greater than the preset threshold, and the fourth condition is that all of the deviations are greater than the preset threshold and the current number of sample groups is not less than the preset number of groups.

[0112] When it is detected that the third condition or the fourth condition is met, the sample group corresponding to the smallest deviation between the current measurement value and each sample group is taken as the target sample group. Among them, the third condition is that the deviation between the current measurement value and each sample group is not all greater than the preset threshold, that is, at least one deviation is less than the preset threshold, which means that the current measurement value is likely to belong to the sample group corresponding to the smallest deviation, so the sample group corresponding to the smallest deviation is taken as the target sample group. The fourth condition is that the deviation between the current measurement value and each sample group is greater than the preset threshold and the current number of sample groups is not less than the preset number of groups, that is, although the possibility that the current measurement value belongs to each sample group is very small, in order to reduce the amount of calculation, a part of the accuracy can be sacrificed and the current measurement value can be added to a probability distribution that it is most likely to meet.

[0113] Further, based on the above-mentioned first and / or second embodiments, a third embodiment of the resource usage estimation method of the present invention is proposed. In this embodiment, the step of using the new sample value to perform unbiased estimation on the target sample group to update the statistical value of the target sample group in step S30 includes:

[0114] Step S301, when the probability distribution type of the target sample group is Gaussian distribution, calculating the absolute value of the difference between the new sample value and the mean estimated value in the current statistical value of the target sample group;

[0115] After adding the new sample values ​​to the target sample group, the new sample group can be used to perform unbiased estimation on the target sample group to update the statistical value of the target sample group. There are many specific unbiased estimation methods that can be used, as long as they have good unbiased estimation characteristics for the probability distribution of the sample group.

[0116] In this embodiment, an unbiased estimation method for Gaussian distribution is proposed, and it can be pre-set that the probability distribution type of each sample group is Gaussian distribution. Specifically, the statistical value of the sample group may include a mean estimate and a variance estimate. When the probability distribution type of the target sample group is Gaussian distribution, the absolute value of the difference between the new sample value and the mean estimate in the current statistical value of the target sample group can be calculated first, that is, the absolute value is taken after the difference between the new sample value and the mean estimate is taken.

[0117] Step S302, performing weighted averaging on the variance estimate value and the absolute value of the difference in the current statistical value according to a first preset weight, to obtain an updated variance estimate value of the target sample group;

[0118] Then, the variance estimate in the current statistical value of the target sample group and the calculated absolute value of the difference are weighted averaged according to the first preset weight, and the result is used as the updated variance estimate of the target sample group. Among them, the first preset weight includes the weights corresponding to the variance estimate and the absolute value of the difference, which can be set as needed. For example, the weight corresponding to the variance estimate is set to 1-2α, and the weight corresponding to the absolute value of the difference is set to 2α, where α can take a value of 0.1 to 0.3, for example, 0.15. The corresponding update formula is:

[0119] M v (i) = (1-2α)M v (i)+2α|M t -M m (i)|

[0120] Step S303: Perform weighted averaging on the new sample value and the mean estimate in the current statistical value according to a second preset weight to obtain an updated mean estimate of the target sample group.

[0121] The new sample value and the mean estimate in the current statistical value are weighted averaged according to the second preset weight, and the result is used as the updated mean estimate of the target sample group. The second preset weight is set corresponding to the first preset weight, for example, the weight corresponding to the mean estimate is set to 1-α, and the weight corresponding to the new sample value is set to α. The corresponding update formula is:

[0122] M m (i) = (1-α) M m (i)+αM t

[0123] Further, in one embodiment, the step of using the new sample value to perform unbiased estimation on the target sample group to update the statistical value of the target sample group in step S30 includes:

[0124] Step S304, when the probability distribution type of the target sample group is Poisson distribution, multiplying the mean estimate value in the current statistical value of the target sample group by the first sample number and adding the new sample value to obtain the total sample value, wherein the first sample number is the number of samples in the target sample group before the new sample value is added to the target sample group;

[0125] In this embodiment, an unbiased estimation method for Poisson distribution is proposed. It can be pre-set that the probability distribution type of each sample group is Gaussian distribution. When the number of sample groups increases and it is detected that the sample group meets the characteristics of Poisson distribution, the probability distribution type of the sample group is converted to Poisson distribution. For example, when the variance estimate of the sample group is greater than or equal to the mean estimate, the probability distribution of the sample group is converted from the default Gaussian distribution to Poisson distribution. When the probability distribution type of the target sample group is Poisson distribution, the mean estimate in the current statistical value of the target sample group can be multiplied by the first sample number and then added to the new sample value, and the calculated result is called the total sample value. Among them, the first sample number is the number of samples in the target sample group before the new sample value is added to the target sample group.

[0126] Step S305, dividing the total sample value by a second sample number to obtain an updated mean estimate of the target sample group, wherein the second sample number is obtained by adding one to the first sample number;

[0127] The total sample value is then divided by the second sample number to obtain the updated mean estimate of the target sample group. The second sample number is obtained by adding one to the first sample number, that is, the second sample number is the number of samples in the target sample group after the new sample value is added to the target sample group. The corresponding update formula is:

[0128]

[0129] Wherein, C(i) is the number of samples in the target sample group before the new sample value is added to the target sample group.

[0130] Step S306: Using the updated mean estimate of the target sample group as the updated variance estimate of the target sample group.

[0131] The updated mean estimate of the target sample is used as the updated variance estimate of the target sample group, that is, M v (i) = M m (i).

[0132] Further, in one embodiment, the step of using the new sample value to perform unbiased estimation on the target sample group to update the statistical value of the target sample group in step S30 includes:

[0133] Step S307: when the target sample group is a newly added sample group, the new sample value is used as the mean estimate of the target sample group, and the new sample value is divided by two to obtain the variance estimate of the target sample group.

[0134] In this embodiment, an unbiased estimation method is proposed for the newly added sample group. Specifically, the new sample value can be used as the mean estimate of the target sample group, and the result of dividing the new sample value by two can be used as the variance estimate of the target sample group. The corresponding update formula is:

[0135] M m (i) = M t

[0136]

[0137] Furthermore, in one embodiment, after step S30, the following steps are further included:

[0138] Step S70, detecting whether the variance estimate of the target sample group after the statistical value is updated is greater than or equal to the mean estimate;

[0139] Step S80: If yes, convert the probability distribution type of the target sample group from the default Gaussian distribution to the Poisson distribution.

[0140] In this embodiment, when a new sample group is created, the probability distribution type of the sample group can be assumed to be Gaussian distribution by default. After the statistical value of the target sample group is updated, it can be detected whether the variance estimate in the updated statistical value is greater than or equal to the mean estimate. If the variance estimate is greater than or equal to the mean estimate, it means that the target sample group has met the characteristics of Poisson distribution. At this time, the probability distribution type of the target sample group is converted from the default Gaussian distribution to Poisson distribution. When the statistical value of the sample group is subsequently updated, it is updated using an unbiased estimation method suitable for Poisson distribution. If the variance estimate is less than the mean estimate, the probability distribution type of the sample group may not be converted, that is, it is still Gaussian distribution type.

[0141] Furthermore, in one embodiment, a usage feature table can be used to maintain the sample groups obtained by dividing the measured values ​​of the resource usage indicators. Specifically, each row in the usage feature table represents a sample group, and a row includes five values: sample group number i, mean estimated value M m (i) Variance estimate M v (i), the total number of samples C(i) and the probability distribution type. The following is a specific example to illustrate the process of resource usage estimation. Assume that the usage characteristic table after running for a period of time is as shown in the following table:

[0142] Group <![CDATA[M m ]]> <![CDATA[M v ]]> C distributed 1 135 11 33 Gaussian distribution 2 180 5 20 Gaussian distribution 3 55 55 9 Poisson distribution

[0143] 1. Take T as the collection cycle and continuously collect data M of resource usage indicators t (i.e., measured value). Assume that the resource usage indicator is network throughput, and the currently collected M t =141.

[0144] 2. Traverse each group of the usage characteristic table and calculate the new measurement value M t Specifically, for each group i, the following formula is used to perform low-frequency extraction and calculate the deviation Di:

[0145]

[0146] Deviation D i The meaning of the measured value M t The degree of deviation from the mean of group i to its variance. If the deviation is small, the measurement value M t If the deviation is large, it is more likely to belong to this group. If the deviation is large, it is not. A maximum allowable deviation D is given in advance. max , given by experience, here D max =3 as an example. t =141, we calculate its deviation from the three groups, which are D1=|141-135| / 11=0.545, D2=|180-141| / 5=7.8, D3=|141-55| / 55=1.564.

[0147] 3. Find the group with the smallest deviation from the measured value among all groups. Specifically, find all groups with values ​​less than D max D i , and find the group i corresponding to the minimum value. At this time, pay attention to three special cases:

[0148] 3.1 If no group meets the deviation requirement, a new group is created and a new row is created in the usage characteristics table.

[0149] 3.2 If the total number of groups has reached the maximum number of groups N, select D directly. i The smallest groups are merged.

[0150] 3.3 If no group currently has data (at the moment the table is just created), create a new row in the usage feature table.

[0151] M t =141 as an example. According to the description of this step, only D1 and D3 meet the requirements and are less than 3. Therefore, we select the first group D1=0.545 as the target sample group.

[0152] 4. Set the measured value M t Add the target sample group and update the usage feature table. Mathematically speaking, this is to use the new sample values ​​to make a new unbiased estimate of the existing probability distribution.

[0153] Specifically, after determining that the measured value M t After group i is merged, the mean estimate M for this group ism (i) and the variance estimate M v (i) Update.

[0154] 4.1 When the group to be updated is Gaussian distributed, use the following formula to update, and C(i) increases by 1:

[0155] M m (i) = (1-α) M m (i)+αM t

[0156] M v (i) = (1-2α)M v (i)+2α|M t -M m (i)|

[0157] The α in the formula is the measured value M t The ratio of updating the old estimated value is empirically taken as 0.1-0.3, and in this embodiment, α=0.15.

[0158] In this case, the first group of M m (1)=0.85*135+0.15*141=136,M v (1) = 9.5, and C(1) = 34.

[0159] 4.2 When the group to be updated is Poisson distributed, use the following formula to update, and C(i) increases by 1:

[0160]

[0161] M v (i) = M m (i)

[0162] 4.3 In the case where a new row of groups needs to be created, the following formula is used to create a new group, and C(i) is set to 1:

[0163] M m (i) = M t

[0164]

[0165] 5. Under certain circumstances, the variance of the Gaussian distribution of some groups may continue to increase. v (i)≥M m (i) When the probability distribution of the group is changed from Gaussian distribution to Poisson distribution, the Poisson distribution is a more unbiased estimate of the group than the Gaussian distribution.

[0166] 6. Combine the mean estimates of all groups to generate resource usage estimates that can be used directly by the business. The following formula can be used for the combination:

[0167]

[0168] The mean dosage obtained by combining the mean estimates of the three groups is:

[0169] (136*34+180*20+55*9) / 63=138, this value is the true estimate of the mean resource usage M m , that is, resource usage valuation.

[0170] like Figure 3 As shown, it is a schematic diagram of an example of the comparison between the effect of the present embodiment and the common sliding average algorithm when N=3 is set. It can be seen that the performance of the present embodiment is much better than the tracking ability of the common sliding average algorithm in most cases.

[0171] In addition, the embodiment of the present invention also provides a resource usage estimation device, referring to Figure 4 , the device comprises:

[0172] An acquisition module 10 is used to acquire a current measurement value of a resource usage indicator and calculate the deviation between the current measurement value and each sample group, wherein the sample groups are obtained by dividing the historical measurement values ​​of the resource usage indicator, and the probability distribution of each sample group is different;

[0173] A determination module 20, configured to determine the target sample group to which the current measurement value belongs according to the deviation;

[0174] An updating module 30, configured to add the current measurement value as a new sample value to the target sample group, and use the new sample value to perform an unbiased estimation on the target sample group to update the statistical value of the target sample group;

[0175] The calculation module 40 is used to combine the estimated mean values ​​in the statistical values ​​of each sample group based on the target sample group after the statistical value is updated to obtain the resource usage estimation value corresponding to the current measurement value.

[0176] Furthermore, the acquisition module 10 includes:

[0177] An acquisition unit, used to acquire current statistical values ​​of each sample group, wherein the statistical values ​​include a mean estimate and a variance estimate;

[0178] The first calculation unit is used to obtain the deviation between the current measurement value and the sample group by dividing the absolute value of the difference between the current measurement value and the estimated mean value of the sample group by the estimated variance value of the sample group for each sample group.

[0179] Furthermore, the determining module 20 includes:

[0180] A first determining unit, configured to add a new sample group as a target sample group to which the current measurement value belongs when it is detected that a first condition or a second condition is met, wherein the first condition is that each of the deviations is greater than a preset threshold and the current number of sample groups is less than a preset number of groups, and the second condition is that the current number of sample groups is zero;

[0181] The second determination unit is used to take the sample group corresponding to the smallest deviation among the deviations as the target sample group to which the current measurement value belongs when it is detected that the third condition or the fourth condition is met, wherein the third condition is that not all of the deviations are greater than the preset threshold, and the fourth condition is that all of the deviations are greater than the preset threshold and the current number of sample groups is not less than the preset number of groups.

[0182] Furthermore, the updating module 30 includes:

[0183] A second calculation unit, configured to calculate an absolute value of a difference between the new sample value and a mean estimate in current statistical values ​​of the target sample group when the probability distribution type of the target sample group is a Gaussian distribution;

[0184] A third calculation unit, configured to perform weighted averaging on the variance estimate in the current statistical value and the absolute value of the difference according to a first preset weight, to obtain an updated variance estimate of the target sample group;

[0185] The fourth calculation unit is used to perform weighted averaging on the new sample value and the mean estimate in the current statistical value according to a second preset weight to obtain an updated mean estimate of the target sample group.

[0186] Furthermore, the updating module 30 includes:

[0187] a fifth calculation unit, configured to, when the probability distribution type of the target sample group is Poisson distribution, obtain a total sample value by multiplying a mean estimate value in a current statistical value of the target sample group by a first sample number and then adding the new sample value, wherein the first sample number is the number of samples in the target sample group before the new sample value is added to the target sample group;

[0188] a sixth calculation unit, configured to obtain an updated mean estimate of the target sample group by dividing the total sample value by a second sample number, wherein the second sample number is obtained by adding one to the first sample number;

[0189] The seventh calculation unit is used to use the updated mean estimate of the target sample group as the updated variance estimate of the target sample group.

[0190] Furthermore, the updating module 30 includes:

[0191] An eighth calculation unit is used for, when the target sample group is a newly added sample group, using the new sample value as the mean estimate of the target sample group, and dividing the new sample value by two to obtain the variance estimate of the target sample group.

[0192] Furthermore, the device also includes:

[0193] A first detection module, used to detect whether the variance estimate of the target sample group after the statistical value is updated is greater than or equal to the mean estimate;

[0194] The conversion module is used for converting the probability distribution type of the target sample group from a default Gaussian distribution to a Poisson distribution if yes.

[0195] Furthermore, the device also includes:

[0196] A second detection module is used to detect whether the resource usage estimate is greater than a preset usage;

[0197] The output module is used to output expansion prompt information if the resource usage estimate is greater than the preset usage.

[0198] The extended contents of the specific implementation of the resource usage estimation device of the present invention are basically the same as the various embodiments of the above-mentioned resource usage estimation method, and will not be elaborated here.

[0199] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which a resource usage estimation program is stored. When the resource usage estimation program is executed by a processor, the steps of the resource usage estimation method described below are implemented.

[0200] The various embodiments of the resource usage estimation device and the computer-readable storage medium of the present invention may refer to the various embodiments of the resource usage estimation method of the present invention, and will not be described in detail here.

[0201] It should be noted that, in this article, the terms "include", "comprises" or any other variations 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 sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0202] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0203] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0204] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A resource usage estimation method, characterized in that: The method comprises the following steps: Obtaining a current measurement value of a resource usage indicator, and respectively calculating a deviation between the current measurement value and each sample group, wherein the sample groups are obtained by dividing historical measurement values ​​of the resource usage indicator, and the probability distribution of each sample group is different; Determine the target sample group to which the current measurement value belongs according to the deviation; Adding the current measurement value as a new sample value to the target sample group, and using the new sample value to perform an unbiased estimation on the target sample group to update the statistical value of the target sample group; Based on the target sample group after updating the statistical value, the mean estimated values ​​in the statistical values ​​of each sample group are combined to obtain the resource usage estimation corresponding to the current measurement value; the step of respectively calculating the deviation between the current measurement value and each sample group includes: Obtaining current statistical values ​​of each sample group, wherein the statistical values ​​include a mean estimate and a variance estimate; For each of the sample groups, the absolute value of the difference between the current measurement value and the estimated mean value of the sample group is divided by the estimated variance value of the sample group to obtain the degree of deviation between the current measurement value and the sample group; The step of determining the target sample group to which the current measurement value belongs according to the deviation comprises: When it is detected that the first condition or the second condition is met, a new sample group is added as the target sample group to which the current measurement value belongs, wherein the first condition is that each of the deviations is greater than a preset threshold and the current number of sample groups is less than a preset number of groups, and the second condition is that the current number of sample groups is zero; When it is detected that the third condition or the fourth condition is met, the sample group corresponding to the smallest deviation among the deviations is taken as the target sample group to which the current measurement value belongs, wherein the third condition is that not all of the deviations are greater than the preset threshold, and the fourth condition is that all of the deviations are greater than the preset threshold and the current number of sample groups is not less than the preset number of groups.

2. The resource usage estimation method according to claim 1, characterized in that: The step of using the new sample value to perform unbiased estimation on the target sample group to update the statistical value of the target sample group includes: When the probability distribution type of the target sample group is Gaussian distribution, calculating the absolute value of the difference between the new sample value and the mean estimate in the current statistical value of the target sample group; Performing weighted averaging of the variance estimate in the current statistical value and the absolute value of the difference according to a first preset weight, to obtain an updated variance estimate of the target sample group; The new sample value and the mean estimate in the current statistical value are weighted averaged according to a second preset weight to obtain an updated mean estimate of the target sample group.

3. The resource usage estimation method according to claim 1, characterized in that: The step of using the new sample value to perform unbiased estimation on the target sample group to update the statistical value of the target sample group includes: When the probability distribution type of the target sample group is Poisson distribution, multiplying the mean estimate value in the current statistical value of the target sample group by the first sample number and adding the new sample value to obtain the total sample value, wherein the first sample number is the number of samples in the target sample group before the new sample value is added to the target sample group; Dividing the total sample value by a second sample number to obtain an updated mean estimate of the target sample group, wherein the second sample number is obtained by adding one to the first sample number; The updated mean estimate of the target sample group is used as the updated variance estimate of the target sample group.

4. The resource usage estimation method according to claim 1, characterized in that: The step of using the new sample value to perform unbiased estimation on the target sample group to update the statistical value of the target sample group includes: When the target sample group is a newly added sample group, the new sample value is used as the mean estimate of the target sample group, and the new sample value is divided by two to obtain the variance estimate of the target sample group.

5. The resource usage estimation method according to claim 1, characterized in that: After the step of adding the current measurement value as a new sample value to the target sample group and using the new sample value to perform unbiased estimation on the target sample group to update the statistical value of the target sample group, the method further includes: Detecting whether the variance estimate of the target sample group after the updated statistical value is greater than or equal to the mean estimate; If yes, the probability distribution type of the target sample group is converted from the default Gaussian distribution to the Poisson distribution.

6. The resource usage estimation method according to any one of claims 1 to 5, characterized in that: After the step of combining the estimated mean values ​​in the statistical values ​​of each sample group based on the target sample group after the updated statistical value to obtain the resource usage estimation corresponding to the current measurement value, the method further includes: Detecting whether the resource usage estimate is greater than a preset usage; If the resource usage estimate is greater than the preset usage, expansion prompt information is output.

7. A resource usage estimation device, characterized in that: The device comprises: An acquisition module, used to acquire a current measurement value of a resource usage indicator, and respectively calculate a deviation between the current measurement value and each sample group, wherein the sample groups are obtained by dividing the historical measurement values ​​of the resource usage indicator, and the probability distribution of each sample group is different; A determination module, used for determining the target sample group to which the current measurement value belongs according to the deviation; An updating module, configured to add the current measurement value as a new sample value to the target sample group, and use the new sample value to perform an unbiased estimation on the target sample group to update the statistical value of the target sample group; A calculation module, configured to combine the estimated mean values ​​in the statistical values ​​of each sample group based on the target sample group after the statistical value is updated to obtain a resource usage estimate corresponding to the current measurement value; The acquisition module comprises: An acquisition unit, used to acquire current statistical values ​​of each sample group, wherein the statistical values ​​include a mean estimate and a variance estimate; A first calculation unit is used for obtaining the deviation between the current measurement value and the sample group by dividing the absolute value of the difference between the current measurement value and the estimated mean value of the sample group by the estimated variance value of the sample group for each sample group; The determination module comprises: A first determining unit, configured to add a new sample group as a target sample group to which the current measurement value belongs when it is detected that a first condition or a second condition is met, wherein the first condition is that each of the deviations is greater than a preset threshold and the current number of sample groups is less than a preset number of groups, and the second condition is that the current number of sample groups is zero; The second determination unit is used to take the sample group corresponding to the smallest deviation among the deviations as the target sample group to which the current measurement value belongs when it is detected that the third condition or the fourth condition is met, wherein the third condition is that not all of the deviations are greater than the preset threshold, and the fourth condition is that all of the deviations are greater than the preset threshold and the current number of sample groups is not less than the preset number of groups.

8. A resource usage estimation device, characterized in that: The resource usage estimation device includes: a memory, a processor, and a resource usage estimation program stored in the memory and executable on the processor. When the resource usage estimation program is executed by the processor, the steps of the resource usage estimation method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Operation optimizing method capable of coordinating operation risk and wind energy consumption of power system

    CN104600747A

  • Voltage stability evaluation method with consideration of load growth and new energy output randomness

    CN108306303A

  • System resource dynamic capacity expanding and shrinking method and device, computer device and storage medium

    CN109766182A

  • Data detection early warning method based on dynamic distribution function

    CN112231475A

  • Service resource estimation method and device, electronic equipment and storage medium

    CN112580889A