Device Resource Monitoring Method, Device, Equipment and Computer Readable Storage Medium

By customizing the number of preset items and the second monitoring cycle, the moving average of the device resource index value is calculated, which solves the problem of high error judgment rate of equipment operation status in the prior art, and realizes more accurate equipment status monitoring.

CN114048105BActive Publication Date: 2025-08-01WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111409266.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-24
Publication Date
2025-08-01
Estimated Expiration
2041-11-24

AI Technical Summary

Technical Problem

In the prior art, the calculation of the moving average value based on the fixed monitoring period leads to a high misjudgment rate of equipment operation status, especially the long-term fluctuation index value cannot be effectively eliminated, resulting in frequent false alarms.

Method used

Through the customized preset number of items and the second monitoring period, the moving average of the device resource index value is calculated, and the second monitoring period is an integer multiple of the first monitoring period. The weighted average value is calculated in combination with the weight to reduce the misjudgment rate.

Benefits of technology

It realizes flexible calculation of moving averages, reduces the misjudgment rate of equipment operating status, and improves the accuracy and working efficiency of equipment status detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114048105B_ABST
    Figure CN114048105B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of fintech, and discloses a device resource monitoring method, device, equipment and computer-readable storage medium. The method includes the following steps: obtaining the resource index value of the device and the corresponding monitoring time according to the first monitoring period; calculating the moving average value of the resource index value according to the preset number of items, the second monitoring period and the monitoring time, where the second monitoring period is an integer multiple of the first monitoring period; determining the operating state of the device according to the moving average value of the resource index value. It realizes the flexible calculation of the moving average value according to the custom period, and reduces the misjudgment rate of the device operating state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology (Fintech), and particularly to a method, device, equipment and computer-readable storage medium for monitoring device resources. Background Art

[0002] With the development of computer technology, more and more technologies (big data, distributed, blockchain, artificial intelligence, etc.) are applied in the financial field. The traditional financial industry is gradually transforming into financial technology (Fintech). However, due to the security and real-time requirements of the financial industry, higher requirements are also put forward for device resource monitoring technology.

[0003] The business of enterprises is complex and changeable, the computing logic is heavy, the data volume is large, the flow is fast and unstable. The resource indicators used in device operation, such as memory usage rate, CPU load, disk usage rate, etc., have large fluctuations. For the monitoring of these indicators, the moving average is usually calculated based on the indicator values in the recent N adjacent monitoring periods (for example, 5 minutes). Whether the device operation state is normal is determined according to whether the ratio or difference between the indicator value and the moving average triggers a threshold. However, this monitoring method can only calculate the moving average of the indicator values in adjacent monitoring periods. For indicator values with long-period fluctuations, misjudgment of the device operation state will occur because the long-period fluctuations cannot be eliminated. Summary of the Invention

[0004] The main purpose of the present invention is to provide a method, device, equipment and computer-readable storage medium for monitoring device resources, aiming to solve the technical problem of high misjudgment rate of device operation state caused by calculating the moving average according to a fixed monitoring period in the prior art.

[0005] To achieve the above purpose, the present invention provides a method for monitoring device resources, and the method for monitoring device resources includes the following steps:

[0006] Obtain the resource indicator value of the device and the corresponding monitoring time according to the first monitoring period;

[0007] Calculate the moving average of the resource indicator value according to the preset number of items, the second monitoring period and the monitoring time, and the second monitoring period is an integer multiple of the first monitoring period;

[0008] Determine the operation state of the device according to the moving average of the resource indicator value.

[0009] Optionally, the step of calculating the moving average of the resource indicator value according to the preset number of items, the second monitoring period and the monitoring time includes:

[0010] Based on the second monitoring period and the monitoring time, select the target metric values of the preset number for the current metric value from the resource metric values. The current metric value is any one of the resource metric values. The monitoring time of the target metric value is less than the monitoring time of the current metric value, and the time interval between the monitoring time of the target metric value and the monitoring time of the current metric value is an adjacent integer multiple of the second monitoring period;

[0011] Calculate the moving average of each current metric value according to the target metric value.

[0012] Optionally, the step of selecting the target metric values of the preset number for the current metric value from the resource metric values based on the second monitoring period and the monitoring time includes:

[0013] Sort the resource metric values in ascending order of the corresponding monitoring time and number them in sequence to obtain a metric value sequence;

[0014] Determine the first quantity of the first monitoring period included in the second monitoring period;

[0015] Calculate the target number of the target metric value of the current metric value in the metric value sequence according to the first quantity and the number of the current metric value;

[0016] Determine the corresponding target metric value according to the target number.

[0017] Optionally, the step of calculating the moving average of each current metric value according to the target metric value includes:

[0018] Obtain the weights corresponding to each target metric value;

[0019] Calculate the sum of the products of each target metric value and the corresponding weight to obtain a first result, and calculate the sum of the weights corresponding to each target metric value to obtain a second result;

[0020] Calculate the quotient of the first result and the second result to obtain the moving average of the current metric value.

[0021] Optionally, the step of obtaining the weights corresponding to each target metric value includes:

[0022] Determine the target metric value intervals where each target metric value is located;

[0023] Determine the weight corresponding to the target metric value interval as the weight corresponding to the target metric value.

[0024] Optionally, before the step of determining the target metric value intervals where each target metric value is located, it further includes:

[0025] Obtain the historical resource metric values of the device, and divide a preset number of preset metric value intervals with the same interval length according to the maximum and minimum values of the historical resource metric values;

[0026] Count the number of metric values of the historical resource metric values falling into each of the preset metric value intervals;

[0027] Determine the weights of each of the preset metric value intervals according to the number of metric values of each of the preset metric value intervals.

[0028] Optionally, after the step of determining the operating state of the device according to the moving average value of the resource metric value, the method further includes:

[0029] If the operating state of the device is a normal state, save the current metric value to a first set;

[0030] If the number of resource metric values in the first set reaches a preset quantity threshold, update the historical resource metric value according to the resource metric values in the first set, and clear the resource metric values in the first set.

[0031] Furthermore, to achieve the above object, the present invention further provides a device resource monitoring device, where the device resource monitoring device includes:

[0032] An acquisition module, configured to acquire the resource metric value of the device and the corresponding monitoring time according to a first monitoring period;

[0033] A calculation module, configured to calculate the moving average value of the resource metric value according to a preset number of items, a second monitoring period, and the monitoring time, where the second monitoring period is an integer multiple of the first monitoring period;

[0034] A determination module, configured to determine the operating state of the device according to the moving average value of the resource metric value.

[0035] Furthermore, to achieve the above object, the present invention further provides a device resource monitoring device, where the device resource monitoring device includes a memory, a processor, and a device resource monitoring program stored on the memory and executable on the processor, and when the device resource monitoring program is executed by the processor, the steps of the device resource monitoring method as described above are implemented.

[0036] Furthermore, to achieve the above object, the present invention further provides a computer-readable storage medium, where a device resource monitoring program is stored on the computer-readable storage medium, and when the device resource monitoring program is executed by a processor, the steps of the device resource monitoring method as described above are implemented.

[0037] The present invention obtains the resource index values of a device and the corresponding monitoring times according to a first monitoring period; calculates the moving average value of the resource index values according to a preset number of items, a second monitoring period, and the monitoring times, where the second monitoring period is an integer multiple of the first monitoring period; and determines the operating state of the device according to the moving average value of the resource index values. It realizes the flexible calculation of the moving average value according to a custom period, and reduces the misjudgment rate of the device operating state. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a schematic structural diagram of the device hardware operating environment related to the embodiment solution of the device resource monitoring device of the present invention;

[0039] Figure 2 It is a schematic flowchart of the first embodiment of the device resource monitoring method of the present invention;

[0040] Figure 3 It is a schematic diagram of the functional modules of the preferred embodiment of the device resource monitoring device of the present invention.

[0041] The realization, functional features, and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0042] 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.

[0043] It should be noted that the business of enterprises is complex and changeable, the calculation logic is heavy, the data volume is large, the flow is fast and unstable, and the resource indexes used in the operation of the device, such as memory usage rate, cpu load, disk usage rate, etc., have large fluctuations. For the monitoring of these indexes, the moving average value is usually calculated based on the index values of the most recent N adjacent monitoring periods (for example, 5 minutes), and whether the device operating state is normal is determined according to whether the ratio or difference between the index value and the moving average value triggers a threshold. However, this monitoring method can only calculate the moving average value of the index values of adjacent monitoring periods, and for the index values with long-period fluctuations, the long-period fluctuations cannot be eliminated, resulting in misjudgment of the device operating state.

[0044] Based on the above defects, the present invention provides a device resource monitoring device, referring to Figure 1 , Figure 1 It is a schematic structural diagram of the device hardware operating environment related to the embodiment solution of the device resource monitoring device of the present invention.

[0045] As Figure 1As shown in the figure, the device resource monitoring apparatus may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to implement connection communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may further 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. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0046] Those skilled in the art can understand that Figure 1 the hardware structure of the device resource monitoring apparatus shown in does not constitute a limitation on the device resource monitoring apparatus, and it may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0047] The present invention also provides a device resource monitoring method.

[0048] Before further elaborating on the embodiments of the present invention, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are applicable to the following explanations.

[0049] The moving average, also known as the moving average number, refers to a series of averages obtained by arithmetically averaging several items of data in a time series using a step-by-step method. If the number of data items averaged is N, it is called an N-period (item) moving average. Predicting based on the moving average is moving average prediction.

[0050] Referring to Figure 2 , Figure 2 is a schematic flowchart of the first embodiment of the device resource monitoring method of the present invention.

[0051] The embodiments of the present invention provide an embodiment of the device resource monitoring 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 executed in a different order than here.

[0052] In each embodiment of the device resource monitoring method, each embodiment is described with the device resource monitoring apparatus as the execution subject. The device resource monitoring method includes:

[0053] Step S10, obtaining the resource index value of the device and the corresponding monitoring time according to the first monitoring period;

[0054] The business of an enterprise is complex and changeable, with heavy computing logic, large amounts of data, fast and unstable data flow. The resource metrics used in the operation of devices, such as memory usage rate, CPU load, disk usage rate, etc., have large fluctuations. For the monitoring of these metrics, the moving average is usually calculated based on the metric values in the most recent N (e.g., 3) adjacent monitoring periods (e.g., 5 minutes). Whether the device operation state is normal is determined by whether the ratio or difference between the metric value and the moving average triggers a threshold. However, this monitoring method can only calculate the moving average of the metric values in adjacent monitoring periods. For metric values with long-period fluctuations (e.g., 1 hour), the long-period fluctuations cannot be eliminated, resulting in misjudgment of the device operation state.

[0055] With the development of Internet technology, financial institutions (banks, insurance companies, securities institutions) have higher and higher requirements for device resource monitoring technology. In the existing technology, this device resource monitoring method can only calculate the moving average based on the N adjacent minimum monitoring node values in the front, and there is no way to calculate the moving average for any non-adjacent minimum monitoring node values. Therefore, long-period fluctuations cannot be eliminated, which is likely to misjudge the device operation state, resulting in false alarms, seriously affecting the work efficiency of financial institutions such as banks, and increasing the time cost.

[0056] Therefore, to solve the technical problem of high misjudgment rate of device operation state caused by calculating the moving average according to a fixed monitoring period in the existing technology, this embodiment provides a device resource monitoring solution.

[0057] In this embodiment, the resource metric value of a device refers to the value of the resource metric used during the operation of the device, such as memory usage rate, CPU load, disk usage rate, etc. The device resource monitoring device can collect the resource metric values of the device according to the first monitoring period and save the collected resource metric values in association with the corresponding collection time (i.e., monitoring time). For example, the resource metric value and the corresponding monitoring time are saved in the form of (a, b), where a is the monitoring time and b is the resource metric value. If the first monitoring period X is 5 minutes, that is, the resource metric value at the current moment is collected every 5 minutes, a data set T similar to [(12:30, 100), (12:25, 105), (12:20, 103), …] can be obtained.

[0058] Optionally, the associated data of the resource metric value and the corresponding monitoring time can be collected one by one by the device resource monitoring device according to the first monitoring period, or can be collected by other collection devices and the collected associated data can be forwarded to the device resource monitoring device in batches. This embodiment does not make specific limitations on this.

[0059] Optionally, the elements in the data set T can be arranged in sequence according to the monitoring time.

[0060] Step S20: Calculate the moving average value of the resource index value according to a preset number of items, a second monitoring period, and the monitoring time, where the second monitoring period is an integer multiple of the first monitoring period.

[0061] Optionally, before the above step S20, there is also a setting step for the preset number of items N and the second monitoring period Y. The user can set the preset number of items and the size of the second monitoring period according to needs, so that the second monitoring period can be as consistent as possible with the long-term periodic changes of the device resource index. In this way, the long-term periodic fluctuations can be weakened or even eliminated, and the misjudgment rate can be reduced. However, the second monitoring period needs to be an integer multiple of the first monitoring period, that is, if the first monitoring period is X, then the second monitoring period Y = p * X, where p is a natural number. Among them, the definition of the moving average value is that when a set of measured values are obtained in sequence, a certain number of data are taken in order and their arithmetic mean is calculated, and the obtained data is called the moving average value. This "certain number" is the preset number of items in this embodiment.

[0062] It should be noted that this embodiment retains the existing data collection period of the device. Based on the data collected according to the existing data collection period, only when calculating the moving average value, the corresponding target index values are selectively screened, and it will not affect the data collection period of other monitoring services due to the different second monitoring periods when calculating the moving average value, resulting in changes in the collected original data.

[0063] After determining the preset number of items and the second monitoring period, the moving average value of the resource index value can be calculated in combination with the monitoring time.

[0064] Specifically, the above step S20 includes:

[0065] Step S21: Based on the second monitoring period and the monitoring time, select the target index values of the preset number of items for the current index value in the resource index value. The current index value is any one of the resource index values. The monitoring time of the target index value is less than the monitoring time of the current index value, and the time interval between the monitoring time of the target index value and the monitoring time of the current index value is an adjacent integer multiple of the second monitoring period.

[0066] Step S22: Calculate the moving average value of each current index value according to the target index value.

[0067] In this embodiment, after determining the preset number of items and the second monitoring period, based on the preset selection rule, any current index value in the resource index values can be selected with a preset number of target index values, and then the moving average value of the current index value can be calculated according to the selected target index values.

[0068] Among them, the preset selection rule is as follows: First, determine the current index value, where the current index value is any one of the resource index values. Then, perform reverse screening based on the monitoring time corresponding to the current index value, and sequentially select the index values whose time intervals from the monitoring time corresponding to the current index value are adjacent integer multiples (1, 2,..., N) of the second monitoring period as the target index values, and the number of target index values is the preset number N.

[0069] For the sake of auxiliary understanding, an example is given here. If the preset number N is 3, the second monitoring period Y is 60 minutes, the first monitoring period X is 5 minutes, and the data set T is [(12:30, 100), (12:25, 105), (12:20, 103),...]. If the current index value is the index value 100 at the monitoring time 12:30, then its corresponding target index values are the index value 100 at 11:30, the index value 103 at 10:30, and the index value 106 at 09:30; if the current index value is the index value 105 at the monitoring time 12:25, then its corresponding target index values are the index value 105 at 11:25, the index value 96 at 10:25, and the index value 99 at 09:25;... and so on.

[0070] Optionally, in an implementation scenario, after determining the target index values of the current index value, the average value of the target index values of the current index value can be calculated as the moving average value corresponding to the current index value. For example, continuing with the above example, if the current index value is the index value 100 at the monitoring time 12:30, then its corresponding moving average value A1 = (100 + 103 + 106) / 3 = 103; if the current index value is the index value 105 at the monitoring time 12:25, then its corresponding moving average value A2 = (105 + 96 + 99) / 3 = 100.

[0071] Optionally, in another implementation scenario, after determining the target index values of the current index value, calculate the weighted average value according to the weights of each target index value as the moving average value corresponding to the current index value.

[0072] Furthermore, the above step S21 includes:

[0073] Step S211, sort the resource index values in ascending order according to the corresponding monitoring time and number them sequentially to obtain an index value sequence;

[0074] Step S212, determining a first number of the first monitoring periods included in the second monitoring period;

[0075] Step S213, calculating the target number of the target indicator value of the current indicator value in the indicator value sequence according to the first quantity and the number of the current indicator value;

[0076] Step S214: determining a corresponding target indicator value according to the target number.

[0077] In this embodiment, the obtained resource indicator values are sorted according to the size of their corresponding monitoring time and numbered in sequence to obtain an indicator value sequence.

[0078] Since the second monitoring period is an integer multiple of the first monitoring period, the number of first monitoring periods included in the second monitoring period can be determined, i.e., the first number p, where p = Y / X. Assuming Y = 60 minutes and X = 5 minutes, then p = 60 / 5 = 12. It can be understood that this first number represents the serial distance between any current indicator value and the adjacent target indicator value.

[0079] After determining the first number, the target number of the target indicator value can be calculated according to the number of the current indicator value and the first number, and then the corresponding target indicator value in the indicator value sequence can be determined according to the number. It should be noted that the method of calculating the target number of the target indicator value is related to the numbering method of the indicator value sequence. There are two numbering methods. One is to number the indicator values in descending order from small to large according to the decreasing direction of the monitoring time (in reverse order), that is, the indicator value sequence is (a0, b0), (a1, b1), (a2, b2), ..., (a n-1 ,b n-1 ), where a is the monitoring time, b is the resource indicator value, and the subscripts of a and b are numbers according to the size of the monitoring time. The monitoring time is a0>a1>a2>...>a n-1 For this reverse numbering method, the target number of the target indicator value of the current indicator value is calculated as follows: j =p*j+p+k, where I j is the target number of the target indicator value; p is the first quantity; j is any integer between 0 and N-1, where N is the number of preset items; and k is the number of the current indicator value. To facilitate understanding, continuing with the above example, if p = 12 and N = 10, then for a current indicator value of 0, the corresponding target indicator values are numbered 12, 24, 36, ..., 120; and for a current indicator value of 1, the corresponding target indicator values are numbered 12, 25, 37, ..., 121.

[0080] Another numbering method is to number the indicator values in descending order according to the decreasing direction of monitoring time (positive order), for example, (an-1 , b n-1 ), …, (a2, b2), (a1, b1), (a0, b0), where a is the monitoring time, b is the resource metric value, and the subscripts of a and b are the numbers assigned according to the magnitude of the monitoring time. The monitoring time a0 > a1 > a2 >... > a n-1 . For this positive-order numbering method, the calculation method for the target number of the target metric value of the current metric value is: I = k - p - p * j, where I is the target number of the target metric value; p is the first quantity; j takes all integers between 0 and N - 1, and N is the preset number of items; k is the number of the current metric value. For the sake of assisting understanding, continue to use the above example. If p = 12 and N = 10, then for the current metric value with the number 120, the numbers of its corresponding target metric values are 108, 96, 84,..., 0.

[0081] This embodiment does not specifically limit the numbering method of the metric value sequence, and the user can set it according to needs.

[0082] Step S30, determine the operating state of the device according to the moving average value of the resource metric value.

[0083] In this embodiment, after determining the moving average value of the resource metric value, the operating state of the device can be determined by this resource metric value and its moving average value. The way to determine the operating state can be to calculate the difference between this resource metric value and its moving average value, and compare this difference with a preset difference threshold. If this difference is greater than the preset difference threshold, it is determined that the operating state of the device is abnormal, otherwise the operating state of the device is normal; the way to determine the operating state can also be to calculate the difference between this resource metric value and its moving average value, calculate the ratio of this difference to its moving average value, and compare this ratio with a preset ratio threshold. If this ratio is greater than the preset ratio threshold, it is determined that the operating state of the device is abnormal, otherwise the operating state of the device is normal.

[0084] Optionally, if it is determined that the operating state of the device is abnormal, the device resource monitoring issues an alarm.

[0085] This embodiment obtains the resource metric value of the device and the corresponding monitoring time according to the first monitoring period; calculates the moving average value of the resource metric value according to the preset number of items, the second monitoring period, and the monitoring time, and the second monitoring period is an integer multiple of the first monitoring period; determines the operating state of the device according to the moving average value of the resource metric value. It realizes the flexible calculation of the moving average value according to the custom period and reduces the misjudgment rate of the device operating state.

[0086] Furthermore, a second embodiment of the device resource monitoring method of the present invention is proposed. The above step S22 includes:

[0087] Step a1, obtaining the weight corresponding to each target indicator value;

[0088] Step a2, calculating the sum of the products of the target index values and the corresponding weights to obtain a first result, and calculating the sum of the weights corresponding to the target index values to obtain a second result;

[0089] Step a3: Calculate the quotient of the first result and the second result to obtain a moving average of the current indicator value.

[0090] This embodiment is a scenario in which a weighted moving average is calculated based on the weight of the target indicator value as a moving average. The weight corresponding to the target indicator value can be manually set by the user or determined by the device resource monitoring device based on historical resource indicator values.

[0091] After determining the weights corresponding to the target indicator values, the sum of the products of the target indicator values of the current indicator value and the corresponding weights is calculated to obtain a first result. The sum of the weights corresponding to the target indicator values of the current indicator value is calculated to obtain a second result. The quotient of the first result and the second result is calculated to obtain a weighted moving average, which is used as the moving average of the current indicator value.

[0092] The formula for calculating the weighted moving average above is, Among them, A k is the weighted moving average; N is the number of preset items; j is any integer between 0 and N-1; W j is the weight of the target indicator value; I j is the target number; T is the target indicator value.

[0093] This embodiment sets weights for target indicator values and calculates weighted average values, thereby reducing the impact of individual burr data on the calculation results and improving the accuracy of device operation status detection.

[0094] Furthermore, the above step a1 includes:

[0095] Step a11, determining the target indicator value interval in which each target indicator value lies;

[0096] Step a12: determining the weight corresponding to the target indicator value interval as the weight corresponding to the target indicator value.

[0097] In this embodiment, a preset number of index value intervals are pre-set, and a corresponding weight is set for each index value interval. After the target index value is determined, the target index value interval in which it falls can be determined based on the size of the target index value, and the weight of the target index value interval in which it falls is used as the weight corresponding to the target index value.

[0098] Optionally, if the target index value does not belong to any preset index value interval, the preset index value interval closest to the target index value can be determined, and it is used as the target index interval of the target index value, and the weight of its target index value interval is used as the weight corresponding to the target index value.

[0099] Further, before the above step a11, the following is also included:

[0100] Step b1: Obtain the historical resource index values of the device, and divide preset index value intervals with the same interval length into a preset number according to the maximum and minimum values of the historical resource index values;

[0101] Step b2: Count the number of index values of the historical resource index values falling into each of the preset index value intervals;

[0102] Step b3: Determine the weights of each of the preset index value intervals according to the number of index values of each of the preset index value intervals.

[0103] This embodiment describes a solution for determining the weight of a target index value according to historical resource index values. Specifically, the historical resource index values of the device are obtained, and preset index value intervals with the same interval length are divided into a preset number according to the maximum and minimum values of the historical resource index values.

[0104] Then, count the number of index values of the historical resource index values falling into each preset index value interval, and determine the weights of each preset index value interval according to the ratio of the number of index values of each preset index value interval to the total number of historical resource index values. For example, if the maximum value of the historical resource index value is 120, the minimum value is 80, and the preset number is 4, then the preset index value intervals are [80, 90], (90, 100], (100, 110], (100, 120]. If the number of samples of the historical resource index value is 100, and the number of index values falling into these 4 intervals are 10, 30, 45, and 15 in sequence, then the weights of these 4 intervals are 0.1, 0.3, 0.45, and 0.15 in sequence.

[0105] Further, after the above step S30, the following is also included:

[0106] Step c1: If the operating state of the device is a normal state, save the current index value to the first set;

[0107] Step c2: If the number of resource index values in the first set reaches a preset number threshold, update the historical resource index values according to the resource index values in the first set, and clear the resource index values in the first set.

[0108] This embodiment provides a solution for automatically updating historical resource index values, and then automatically adjusting the preset index value range and / or the weight of the preset index value range according to the updated historical resource index values.

[0109] Specifically, if it is determined that the operating state of the current device is normal according to the moving average value of the current index value, the current index value is saved in the first set until the number of resource index values in the first set reaches the preset quantity threshold, and then the historical resource index value is updated according to the resource index values in the first set, and the resource index values in the first set are cleared.

[0110] It can be understood that there are various ways to update the historical resource index value according to the resource index values in the first set. The original historical resource index value can be directly replaced with the resource index values in the first set, or the resource index values in the first set and the original historical resource index value can be used together as the updated historical resource index value. This embodiment does not make specific limitations on this.

[0111] By automatically updating the historical resource index value in this embodiment and then automatically adjusting the preset index value range and / or the weight of the preset index value range according to the updated historical resource index value, the matching degree between the weight of the target index value and the latest historical data distribution can be improved.

[0112] The present invention also provides a device resource monitoring device.

[0113] Referring to Figure 3 , Figure 3 is a schematic diagram of the functional modules of the first embodiment of the device resource monitoring device of the present invention. The device resource monitoring device includes:

[0114] An acquisition module 10, configured to acquire the resource index value of the device and the corresponding monitoring time according to the first monitoring period;

[0115] A calculation module 20, configured to calculate the moving average value of the resource index value according to the preset number of items, the second monitoring period, and the monitoring time, and the second monitoring period is an integer multiple of the first monitoring period;

[0116] ]>A determination module 30, configured to determine the operating state of the device according to the moving average value of the resource index value.

[0117] Further, the calculation module is further configured to:

[0118] Based on the second monitoring period and the monitoring time, select the target metric values of the preset number from the resource metric values for the current metric value. The current metric value is any one of the resource metric values. The monitoring time of the target metric value is less than the monitoring time of the current metric value, and the time interval between the monitoring time of the target metric value and the monitoring time of the current metric value is an adjacent integer multiple of the second monitoring period;

[0119] Calculate the moving average value of each current metric value according to the target metric value.

[0120] Further, the calculation module is further configured to:

[0121] Sort the resource metric values in ascending order of the corresponding monitoring time and number them in sequence to obtain a metric value sequence;

[0122] Determine the first quantity of the first monitoring period included in the second monitoring period;

[0123] Calculate the target number of the target metric value of the current metric value in the metric value sequence according to the first quantity and the number of the current metric value;

[0124] Determine the corresponding target metric value according to the target number.

[0125] Further, the calculation module is further configured to:

[0126] Obtain the weights corresponding to each target metric value;

[0127] Calculate the sum of the products of each target metric value and the corresponding weight to obtain a first result, and calculate the sum of the weights corresponding to each target metric value to obtain a second result;

[0128] Calculate the quotient of the first result and the second result to obtain the moving average value of the current metric value.

[0129] Further, the calculation module is further configured to:

[0130] Determine the target metric value intervals where each target metric value is located;

[0131] Determine the weight corresponding to the target metric value interval as the weight corresponding to the target metric value.

[0132] Further, the calculation module is further configured to:

[0133] Obtain the historical resource metric values of the device, and divide the preset number of preset metric value intervals with the same interval length according to the maximum and minimum values of the historical resource metric values;

[0134] Count the number of the historical resource index values that fall into each of the preset index value intervals;

[0135] Determine the weight of each of the preset index value intervals according to the number of the index values in each of the preset index value intervals.

[0136] Further, the device resource monitoring device further includes:

[0137] A saving module, configured to save the current index value to a first set if the operating state of the device is a normal state;

[0138] An updating module, configured to update the historical resource index value according to the resource index values in the first set and clear the resource index values in the first set if the number of the resource index values in the first set reaches a preset number threshold.

[0139] The specific implementation manner of the device resource monitoring device of the present invention is basically the same as each embodiment of the above device resource monitoring method, and will not be described in detail here.

[0140] In addition, an embodiment of the present invention further provides a computer-readable storage medium.

[0141] A device resource monitoring program is stored on the computer-readable storage medium, and when the device resource monitoring program is executed by a processor, the steps of the device resource monitoring method as described above are implemented.

[0142] The specific implementation manner of the computer-readable storage medium of the present invention is basically the same as each embodiment of the above device resource monitoring method, and will not be described in detail here.

[0143] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the above specific implementation manners. The above specific implementation manners are merely illustrative and not restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the spirit and scope protected by the present invention and the claims. Any equivalent structural or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied to other related technical fields, all fall within the protection scope of the present invention.

Claims

1. A device resource monitoring method, characterized in that, The device resource monitoring method includes the following steps: Obtain the resource index value of the device and the corresponding monitoring time according to the first monitoring period; Calculate the moving average value of the resource index value according to the preset number of items, the second monitoring period, and the monitoring time, where the second monitoring period is an integer multiple of the first monitoring period; Determine the operating state of the device according to the moving average value of the resource index value; Wherein, the step of calculating the moving average value of the resource index value according to the preset number of items, the second monitoring period, and the monitoring time includes: Based on the second monitoring period and the monitoring time, select the target index values of the preset number of items from the resource index values for the current index value. The current index value is any one of the resource index values. The monitoring time of the target index value is less than the monitoring time of the current index value, and the time interval between the monitoring time of the target index value and the monitoring time of the current index value is an adjacent integer multiple (1, 2,..., N) of the second monitoring period; Calculate the moving average value of each current index value according to the target index value; 2. The device resource monitoring method according to claim 1, wherein The step of selecting the target index values of the preset number of items from the resource index values for the current index value based on the second monitoring period and the monitoring time includes: Sort the resource index values in ascending order according to the corresponding monitoring time and number them in sequence to obtain an index value sequence; Determine the first quantity of the first monitoring periods included in the second monitoring period; Calculate the target number in the index value sequence of the target index value of the current index value according to the first quantity and the number of the current index value; Determine the corresponding target index value according to the target number; 3. The device resource monitoring method according to claim 1, characterized in that The step of calculating the moving average value of each current index value according to the target index value includes: Obtain the weights corresponding to each target index value; Calculate the sum of the products of each target index value and the corresponding weight to obtain a first result, and calculate the sum of the weights corresponding to each target index value to obtain a second result; Calculate the quotient of the first result and the second result to obtain the moving average value of the current index value; 4. The device resource monitoring method according to claim 3, wherein The step of obtaining the weights corresponding to each target index value includes: Determine the target index value intervals where each target index value is located; Determine the weight corresponding to the target index value interval as the weight corresponding to the target index value; 5. The device resource monitoring method according to claim 4, wherein Before the step of determining the target index value intervals where each target index value is located, it further includes: Obtain the historical resource index values of the device, and divide the preset number of preset index value intervals with the same interval length according to the maximum value and the minimum value of the historical resource index values; Count the number of index values of the historical resource index values falling into each preset index value interval; Determine the weights of each preset index value interval according to the number of index values of each preset index value interval; 6. The device resource monitoring method according to claim 5, wherein, After the step of determining the operating state of the device according to the moving average value of the resource index value, it further includes: If the operating state of the device is a normal state, save the current index value to the first set; If the number of resource index values in the first set reaches a preset quantity threshold, update the historical resource index value according to the resource index values in the first set, and clear the resource index values in the first set.

7. A device resource monitoring apparatus, characterized in that, The device resource monitoring device includes: An acquisition module, configured to acquire the resource index value of the device and the corresponding monitoring time according to a first monitoring period; A calculation module, configured to calculate the moving average value of the resource index value according to a preset number of items, a second monitoring period, and the monitoring time, where the second monitoring period is an integer multiple of the first monitoring period; A determination module, configured to determine the operating state of the device according to the moving average value of the resource index value; The calculation module is further configured to, based on the second monitoring period and the monitoring time, select, from the resource index values, the target index values of the preset number of items for the current index value, where the current index value is any one of the resource index values, the monitoring time of the target index value is less than the monitoring time of the current index value, and the time interval between the monitoring time of the target index value and the monitoring time of the current index value is an adjacent integer multiple (1, 2,..., N) of the second monitoring period; calculate the moving average value of each current index value according to the target index values.

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

9. A computer-readable storage medium, characterized in that A device resource monitoring program is stored on the computer-readable storage medium. When the device resource monitoring program is executed by the processor, the steps of the device resource monitoring method according to any one of claims 1-6 are implemented.

Citation Information

Patent Citations

  • Data monitoring method, device and equipment, storage medium and program product

    CN112527598A

  • Business resources monitoring method and device, computing equipment and storage medium

    CN113568822A