A threshold dynamic calculation method, device and computer readable storage medium
By calculating the dynamic threshold of the observation point, the problem of low accuracy and high workload when manually setting the alarm threshold is solved, which achieves higher accuracy and stability, and reduces the workload of threshold setting.
Patent Information
- Application Number
- CN202111391967.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-19
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2041-11-19
AI Technical Summary
In the prior art, the alarm threshold is set manually in the art, and there are problems of low accuracy and high workload.
By obtaining the original measurement data sequence of the observation points in the target historical period, the moving average data sequence, the absolute error mean and the standard deviation are calculated, and dynamic thresholds are calculated based on these data for comparative analysis of real-time measurement data.
It realizes automatic calculation of dynamic thresholds based on measurement data of historical periods, improves the accuracy and stability of alarm threshold calculation, and reduces the workload of threshold setting.
Smart Images

Figure CN114328078B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a threshold dynamic calculation method, device and computer-readable storage medium. Background Art
[0002] With the continuous development of network technology, equipment operators have put forward higher requirements for equipment operation and maintenance. In the traditional equipment maintenance mode, operation and maintenance personnel mainly focus on the operating status of the equipment, and judging whether the equipment is operating normally mainly depends on equipment alarms.
[0003] In actual business performance indicator monitoring, the setting of alarm thresholds is the key to performance indicator monitoring. How to set reasonable alarm thresholds directly determines the equipment monitoring effect. In related technologies, it is usually necessary to manually configure the thresholds for over-limit alarms. However, with changes in business, region, season, etc., the previously configured alarm thresholds are no longer reasonable. It is necessary to manually adjust the alarm threshold settings from time to time based on business experience, which has learning costs, labor costs and certain maintenance costs. In addition, the alarm thresholds configured by different operation and maintenance personnel according to business conditions are somewhat subjective, and the thresholds configured by different operation and maintenance personnel are usually different. It can be seen that the alarm threshold setting method currently provided by related technologies will have the problems of low accuracy and high workload. Summary of the invention
[0004] The embodiments of the present application provide a threshold dynamic calculation method, device and computer-readable storage medium, which can at least solve the problems of low accuracy and large workload in the related art of manually setting the alarm threshold.
[0005] A first aspect of an embodiment of the present application provides a threshold dynamic calculation method, including:
[0006] Obtain the original measurement data sequence of the observation point in the target historical period;
[0007] Calculate a moving average data sequence based on the original measurement data sequence;
[0008] Calculate the absolute error mean and standard deviation based on the original measurement data sequence and the moving average data sequence;
[0009] A dynamic threshold is calculated in combination with the absolute error average and the standard deviation; wherein the dynamic threshold is used to perform comparative analysis on the real-time measurement data of the observation point.
[0010] A second aspect of an embodiment of the present application provides a threshold dynamic calculation device, including:
[0011] An acquisition module is used to obtain the original measurement data sequence of the observation point in the target historical period;
[0012] A first calculation module, used for calculating a moving average data sequence according to the original measurement data sequence;
[0013] A second calculation module, used for calculating an absolute error mean value and a standard deviation based on the original measurement data sequence and the moving average data sequence;
[0014] The third calculation module is used to calculate a dynamic threshold value in combination with the absolute error average value and the standard deviation; wherein the dynamic threshold value is used to perform comparative analysis on the real-time measurement data of the observation point.
[0015] The third aspect of an embodiment of the present application provides an electronic device, including: a memory, a processor and a bus; the bus is used to realize connection and communication between the memory and the processor; the processor is used to execute a computer program stored in the memory; when the processor executes the computer program, it implements each step of the threshold dynamic calculation method provided in the first aspect of the embodiment of the present application.
[0016] The fourth aspect of the embodiments of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, each step of the threshold dynamic calculation method provided in the first aspect of the embodiments of the present application is implemented.
[0017] As can be seen from the above, according to the threshold dynamic calculation method, device and computer-readable storage medium provided by the present application, the original measurement data sequence of the observation point in the target historical period is obtained; the moving average data sequence is calculated based on the original measurement data sequence; the absolute error mean and standard deviation are calculated based on the original measurement data sequence and the moving average data sequence; the dynamic threshold is calculated in combination with the absolute error mean and standard deviation. Through the implementation of the present application, the system automatically calculates the dynamic threshold based on the measurement data of the historical period, with higher accuracy and stability, and effectively reduces the workload of threshold setting. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A basic flow chart of a threshold dynamic calculation method provided in the first embodiment of the present application;
[0019] Figure 2 A schematic diagram of sampling time of raw measurement data provided in the first embodiment of the present application;
[0020] Figure 3 A schematic diagram of a detailed flow chart of a threshold dynamic calculation method provided in the second embodiment of the present application;
[0021] Figure 4 A schematic diagram of a program module of a threshold dynamic calculation device provided in a third embodiment of the present application;
[0022] Figure 5 A schematic diagram of the structure of an electronic device provided in the fourth embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0024] In order to solve the problems of low accuracy and heavy workload in setting the alarm threshold manually in the related art, the first embodiment of the present application provides a threshold dynamic calculation method, such as Figure 1 The basic flow chart of the threshold dynamic calculation method provided in this embodiment includes the following steps:
[0025] Step 101: Obtain the original measurement data sequence of the observation point in the target historical period.
[0026] Specifically, in this embodiment, the dynamic threshold calculation service provides an interface for the java service call of the alarm configuration, and whenever the java service of the alarm configuration needs to configure the dynamic threshold, the interface is called to request the dynamic threshold calculation service to calculate the dynamic threshold, which triggers the execution of the above step 101. It should be noted that in this embodiment, the observation point is the device node, and the original measurement data is the performance indicator monitoring data of the device. Multiple original measurement data will be obtained correspondingly at multiple time nodes in the historical period, thereby forming an original measurement data sequence.
[0027] It should be noted that many business performance indicators show the characteristics of dynamic changes over time. If a static threshold calculation method is used, the dynamic changes cannot be reflected, resulting in low accuracy of the calculated alarm threshold. Based on this, this embodiment comprehensively considers all measurement data in a specific historical period to dynamically set the threshold, which can effectively improve the accuracy of the alarm threshold calculation.
[0028] In one implementation of this embodiment, before the above-mentioned step of obtaining the original measurement data sequence of the observation point in the target historical period, it also includes: obtaining the data collection period and dynamic threshold calculation frequency of the observation point; based on the data collection period and the dynamic threshold calculation frequency, correspondingly determining the target historical period.
[0029] Specifically, in actual applications, the data collection behavior of the observation point and the dynamic threshold update requirements are different. If a fixed historical period is used to obtain basic data, it cannot be applied to all application scenarios, resulting in poor effectiveness of the calculated dynamic threshold in some cases. Therefore, this embodiment refers to the data collection cycle and the dynamic threshold calculation frequency to flexibly determine the target historical period to adapt to the threshold dynamic calculation requirements in different scenarios. It should be understood that the target historical period of this embodiment is any period between 0 and 24 hours.
[0030] Further, in one implementation of the present embodiment, the above-mentioned step of determining the target historical period based on the data collection cycle and the dynamic threshold calculation frequency includes: comparing the dynamic threshold calculation frequency with a preset frequency threshold; when the dynamic threshold calculation frequency is less than or equal to the frequency threshold, inputting the data collection cycle and the dynamic threshold calculation frequency into the first calculation model, and determining the target historical period accordingly; the first calculation model is expressed as: W=60*F / T; when the dynamic threshold calculation frequency is greater than the frequency threshold, inputting the data collection cycle and the frequency threshold into the second calculation model, and determining the target historical period accordingly; the second calculation model is expressed as: W=60*E / T; wherein W represents the target historical period, F represents the dynamic threshold calculation frequency, E represents the frequency threshold, and T represents the data collection cycle.
[0031] Specifically, Figure 2 The figure shows a sampling time diagram of the original measurement data provided by the present embodiment. Taking the current moment as the reference, assuming that the data collection cycle is 5 minutes, and the set dynamic threshold calculation frequency F (unit: hour) is less than 12 hours, then W = 60*F / 5 = 12F, otherwise, W = 60*12 / 5 = 144. It should be noted that in the present embodiment, for the case where the dynamic threshold calculation frequency is less than the frequency threshold, the corresponding target historical period is the time interval of W hours before the current moment, and for the case where the dynamic threshold calculation frequency is greater than the frequency threshold, the corresponding target historical period can be composed of the first historical period before the current moment and the second historical period after the current moment, that is, a time interval of 2W hours with the current moment as the middle moment.
[0032] Step 102: Calculate a moving average data sequence based on the original measurement data sequence.
[0033] Specifically, the moving average data of this embodiment is used to characterize the average trend of the measurement data. In practical applications, by performing moving average processing on the original measurement data sequence, the data can be made smoother and more stable, so as to improve the accuracy of subsequent data calculation.
[0034] In one implementation of this embodiment, the step of calculating the moving average data sequence based on the original measurement data sequence includes: inputting the original measurement data sequence into the third calculation model to calculate the estimated data corresponding to the measurement data at each moment; the third calculation model is expressed as: Y t =αX t +(1-α)Y t-1 , where Y t is the estimated data at time t, α is the weight coefficient, X t Represents the measured data at time t; through all the estimated data calculated, the moving average data series is obtained.
[0035] Specifically, this embodiment uses an exponentially weighted moving average method to process sequence data. The exponentially weighted moving average is to give different weight coefficients to the measurement data, obtain the moving average data according to the different weight coefficients, and determine the estimated data based on the final moving average data. It should be noted that the smaller the weight system of this embodiment, the more stable the estimated data obtained. The exponentially weighted moving average method is adopted because the measurement data collected recently during the data collection period has a greater impact on the estimated data, and it can better reflect the trend of recent changes. It should be understood that the exponentially weighted moving average method means that the weight coefficient of each data decreases exponentially over time, and the closer the data is to the current moment, the larger the weight coefficient. In addition, compared with the traditional averaging method, the exponentially weighted moving average does not need to save all past values; second, the amount of calculation can be significantly reduced.
[0036] Step 103: Calculate the absolute error mean and standard deviation based on the original measurement data sequence and the moving average data sequence.
[0037] In one implementation of the present embodiment, the above-mentioned step of calculating the absolute error mean and the standard deviation based on the original measurement data sequence and the moving average data sequence includes: calculating the absolute error based on the original measurement data sequence and the moving average data sequence; inputting the absolute error into the fourth calculation model to calculate the absolute error mean; inputting the absolute error and the absolute error mean into the fifth calculation model to calculate the standard deviation.
[0038] It should be noted that the fourth calculation model of this embodiment is expressed as: The fifth calculation model is expressed as: in, represents the mean absolute error, D t represents the absolute error at time t, n represents the total number of data, and S represents the standard deviation.
[0039] In addition, the original measurement data sequence of this embodiment is represented by X, and the moving average data sequence is represented by Y, then the absolute error between the two is represented by: D=|XY|.
[0040] Step 104: Calculate a dynamic threshold by combining the absolute error mean and the standard deviation.
[0041] Specifically, the dynamic threshold calculation service of this embodiment can be called back through the interface provided by the Java service to pass the calculated threshold to the alarm configuration. The dynamic threshold is used for comparative analysis of the real-time measurement data of the observation point.
[0042] In one implementation of this embodiment, the step of calculating the dynamic threshold by combining the absolute error mean and the standard deviation includes: calculating the first-level upper threshold, the second-level upper threshold, the first-level lower threshold and the second-level lower threshold by combining the absolute error mean and the standard deviation; the first-level upper threshold is expressed as: The secondary upper threshold is expressed as: The first-level lower threshold is expressed as: The secondary lower threshold is expressed as: Among them, max 1 Indicates the first-level upper threshold, max 2 Indicates the secondary upper threshold, min 1 Indicates the first-level lower threshold, min 2 Represents the secondary lower threshold, represents the mean absolute error, and S represents the standard deviation.
[0043] Specifically, in practical applications, the method usually adopted is the single-level configuration threshold method, that is, only one upper threshold and one lower threshold are set. If the alarm threshold is set low, it is impossible to monitor the change of service quality, and the alarm sensitivity is low; if the alarm threshold is set high, although it can relatively improve the alarm sensitivity of service quality monitoring, but when the business is idle, especially at night, the excessively high alarm threshold will trigger a large number of false alarms. Based on this, this embodiment adopts a hierarchical threshold configuration method, and multiple upper and lower thresholds are configured. On the one hand, it can support abnormal alarms based on different levels of alarm thresholds, and the alarm mechanism is more refined. On the other hand, it can support the selection of different levels of alarm thresholds for observation point monitoring in different scenarios to ensure the effectiveness of alarms in different scenarios.
[0044] Furthermore, in one implementation of the present embodiment, after the above-mentioned step of calculating the dynamic threshold by combining the absolute error mean and the standard deviation, it also includes: comparing the dynamic threshold with the original threshold to determine the threshold adjustment amplitude; comparing the threshold adjustment amplitude with the preset amplitude threshold; upon receiving a threshold call request sent by the alarm configuration service, if the threshold adjustment amplitude is greater than or equal to the amplitude threshold, outputting the original threshold to the alarm configuration service; if the threshold adjustment amplitude is less than the amplitude threshold, outputting the dynamic threshold to the alarm configuration service.
[0045] Specifically, in this embodiment, the original threshold value θ of the observation point is obtained, and the adjustment range of the dynamic threshold value δ relative to the original threshold value θ is calculated by comparison. In practical applications, a certain threshold adjustment range threshold value (for example, 10%) can be set according to needs to decide whether to replace the original threshold value with the calculated dynamic threshold value. The final dynamic threshold value is expressed as:
[0046]
[0047] In this embodiment, in order to prevent invalid alarms caused by excessive threshold adjustment, a dynamic threshold filtering mechanism is added, that is, the calculated dynamic threshold is compared with the original threshold. When the adjustment range exceeds 10%, the dynamic threshold is discarded and the original threshold is output as the result. For example, if the original threshold of a certain observation point is 40 and the calculated dynamic threshold is 45, then the threshold adjustment range is |45-40|÷40=12.5%, 12.5%>10%, and the original threshold 40 is still used as the dynamic threshold instead of 45.
[0048] Based on the technical solution of the embodiment of the present application, the original measurement data sequence of the observation point in the target historical period is obtained; the moving average data sequence is calculated based on the original measurement data sequence; the absolute error mean and standard deviation are calculated based on the original measurement data sequence and the moving average data sequence; the dynamic threshold is calculated in combination with the absolute error mean and standard deviation. Through the implementation of the solution of the present application, the system automatically calculates the dynamic threshold based on the measurement data of the historical period, with higher accuracy and stability, and effectively reduces the workload of threshold setting.
[0049] Figure 3 The method in is a refined threshold dynamic calculation method provided in the second embodiment of the present application, and the threshold dynamic calculation method includes:
[0050] Step 301: Obtain the data collection cycle and dynamic threshold calculation frequency of the observation point, and determine the target historical period accordingly based on the data collection cycle and the dynamic threshold calculation frequency.
[0051] Step 302: Obtain the original measurement data sequence of the observation point in the target historical period.
[0052] Step 303: Based on the original measurement data sequence, the estimated data corresponding to the measurement data at each moment is calculated, and a moving average data sequence is obtained through all the calculated estimated data.
[0053] Step 304: Calculate the absolute error based on the original measurement data sequence and the moving average data sequence, and calculate the absolute error average based on the absolute error.
[0054] Step 305: Calculate the standard deviation based on the absolute error and the average absolute error.
[0055] Step 306: Calculate the dynamic threshold by combining the absolute error mean and standard deviation.
[0056] Step 307: Compare the threshold adjustment amplitude of the dynamic threshold relative to the original threshold with the preset amplitude threshold.
[0057] Step 308: If the threshold adjustment amplitude is greater than or equal to the amplitude threshold, the original threshold is output to the alarm configuration service according to the threshold call request.
[0058] Step 309: If the threshold adjustment amplitude is less than the amplitude threshold, the dynamic threshold is output to the alarm configuration service according to the threshold call request.
[0059] It should be understood that the size of the serial number of each step in this embodiment does not mean the order of execution of the steps. The execution order of each step should be determined by its function and internal logic, and should not constitute a sole limitation on the implementation process of the embodiment of this application.
[0060] Based on the technical solution of the embodiment of the present application, the original measurement data sequence of the observation point in the target historical period is obtained; the moving average data sequence is calculated based on the original measurement data sequence; the absolute error mean and standard deviation are calculated based on the original measurement data sequence and the moving average data sequence; the dynamic threshold is calculated in combination with the absolute error mean and standard deviation. Through the implementation of the solution of the present application, the system automatically calculates the dynamic threshold based on the measurement data of the historical period, with higher accuracy and stability, and effectively reduces the workload of threshold setting. In addition, dynamic threshold filtering is added to prevent invalid alarms caused by excessive threshold adjustment.
[0061] Figure 4 A threshold dynamic calculation device is provided in the third embodiment of the present application. The threshold dynamic calculation device can be used to implement the threshold dynamic calculation method in the above embodiment. Figure 4 As shown, the threshold dynamic calculation device mainly includes:
[0062] An acquisition module 401 is used to acquire a sequence of original measurement data of an observation point in a target historical period;
[0063] A first calculation module 402, used to calculate a moving average data sequence according to an original measurement data sequence;
[0064] A second calculation module 403 is used to calculate the absolute error mean and standard deviation based on the original measurement data sequence and the moving average data sequence;
[0065] The third calculation module 404 is used to calculate a dynamic threshold value by combining the absolute error mean value and the standard deviation; wherein the dynamic threshold value is used to compare and analyze the real-time measurement data of the observation point.
[0066] In some implementations of this embodiment, the threshold dynamic calculation device further includes: a determination module. The acquisition module is also used to: obtain the data collection cycle of the observation point and the dynamic threshold calculation frequency; the determination module is specifically used to: determine the target historical period accordingly based on the data collection cycle and the dynamic threshold calculation frequency.
[0067] Further, in some implementations of the present embodiment, the above-mentioned determination module is specifically used to: compare the dynamic threshold calculation frequency with the preset frequency threshold; when the dynamic threshold calculation frequency is less than or equal to the frequency threshold, input the data collection period and the dynamic threshold calculation frequency into the first calculation model, and determine the target historical period accordingly; the first calculation model is expressed as: W=60*F / T; when the dynamic threshold calculation frequency is greater than the frequency threshold, input the data collection period and the frequency threshold into the second calculation model, and determine the target historical period accordingly; the second calculation model is expressed as: W=60*E / T; wherein W represents the target historical period, F represents the dynamic threshold calculation frequency, E represents the frequency threshold, and T represents the data collection period.
[0068] In some implementations of this embodiment, the first calculation module is specifically used to: input the original measurement data sequence into the third calculation model to calculate the estimated data corresponding to the measurement data at each moment; the third calculation model is expressed as: t =αX t +(1-α)Y t-1 , where Y t is the estimated data at time t, α is the weight coefficient, X t Represents the measured data at time t; through all the estimated data calculated, the moving average data series is obtained.
[0069] In some implementations of this embodiment, the second calculation module is specifically used to: calculate the absolute error based on the original measurement data sequence and the moving average data sequence; input the absolute error into the fourth calculation model to calculate the average value of the absolute error; the fourth calculation model is expressed as: The absolute error and the average absolute error are input into the fifth calculation model to calculate the standard deviation; the fifth calculation model is expressed as: in, represents the mean absolute error, D t represents the absolute error at time t, n represents the total number of data, and S represents the standard deviation.
[0070] In some implementations of this embodiment, the third calculation module is specifically used to calculate the first-level upper threshold, the second-level upper threshold, the first-level lower threshold and the second-level lower threshold in combination with the absolute error mean and the standard deviation; the first-level upper threshold is expressed as: The secondary upper threshold is expressed as: The first-level lower threshold is expressed as: The secondary lower threshold is expressed as: Among them, max 1 Indicates the first-level upper threshold, max 2 Indicates the secondary upper threshold, min 1 Indicates the first-level lower threshold, min 2 Represents the secondary lower threshold, represents the mean absolute error, and S represents the standard deviation.
[0071] In some implementations of this embodiment, the threshold dynamic calculation device also includes: a comparison module and an output module. The above-mentioned determination module is also used to: compare the dynamic threshold with the original threshold to determine the threshold adjustment range. The comparison module is used to: compare the threshold adjustment range with the preset amplitude threshold. The output module is used to: when receiving a threshold call request sent by the alarm configuration service, if the threshold adjustment range is greater than or equal to the amplitude threshold, then output the original threshold to the alarm configuration service; if the threshold adjustment range is less than the amplitude threshold, then output the dynamic threshold to the alarm configuration service.
[0072] It should be noted that the threshold dynamic calculation methods in the first and second embodiments can be implemented based on the threshold dynamic calculation device provided in this embodiment. Ordinary technical personnel in the relevant field can clearly understand that for the convenience and conciseness of description, the specific working process of the threshold dynamic calculation device described in this embodiment can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0073] According to the threshold dynamic calculation device provided by this embodiment, the original measurement data sequence of the observation point in the target historical period is obtained; the moving average data sequence is calculated based on the original measurement data sequence; the absolute error mean and standard deviation are calculated based on the original measurement data sequence and the moving average data sequence; the dynamic threshold is calculated in combination with the absolute error mean and standard deviation. Through the implementation of the scheme of this application, the system automatically calculates the dynamic threshold based on the measurement data of the historical period, with higher accuracy and stability, and effectively reduces the workload of threshold setting.
[0074] See also Figure 5 , Figure 5 The fourth embodiment of the present application provides an electronic device. The electronic device can be used to implement the threshold dynamic calculation method in the above embodiment. Figure 5 As shown, the electronic device mainly includes:
[0075] Memory 501, processor 502, bus 503, and a computer program stored in memory 501 and executable on processor 502, memory 501 and processor 502 are connected via bus 503. When processor 502 executes the computer program, the threshold dynamic calculation method in the aforementioned embodiment is implemented. The number of processors may be one or more.
[0076] The memory 501 may be a high-speed random access memory (RAM) memory, or a non-volatile memory, such as a disk memory. The memory 501 is used to store executable program codes, and the processor 502 is coupled to the memory 501 .
[0077] Furthermore, the present application also provides a computer-readable storage medium, which may be disposed in the electronic device in the above embodiments. Figure 5 Memory in the illustrated embodiment.
[0078] The computer readable storage medium stores a computer program, and when the program is executed by the processor, the threshold dynamic calculation method in the aforementioned embodiment is implemented. Furthermore, the computer storable medium can also be a U disk, a mobile hard disk, a read-only memory (ROM), a RAM, a magnetic disk or an optical disk, and other media that can store program codes.
[0079] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0080] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0081] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0082] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a readable storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned readable storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0083] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0084] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0085] The above is a description of the threshold dynamic calculation method, device and computer-readable storage medium provided in the present application. For technicians in this field, according to the ideas of the embodiments of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A threshold dynamic calculation method, It is characterized in that The threshold dynamic calculation method comprises: Obtain the data collection period of the observation point and the dynamic threshold calculation frequency; comparing the dynamic threshold calculation frequency with a preset frequency threshold; When the dynamic threshold calculation frequency is less than or equal to the frequency threshold, the data collection period and the dynamic threshold calculation frequency are input into the first calculation model, and the target historical period is determined accordingly; the first calculation model is expressed as: W=60*F / T; When the dynamic threshold calculation frequency is greater than the frequency threshold, the data collection period and the frequency threshold are input into the second calculation model, and the target historical period is determined accordingly; the second calculation model is expressed as: W=60*E / T; Wherein, W represents the target historical period, F represents the dynamic threshold calculation frequency, E represents the frequency threshold, and T represents the data collection period; Obtain the original measurement data sequence of the observation point in the target historical period; Calculate a moving average data sequence based on the original measurement data sequence; Calculate the absolute error mean and standard deviation based on the original measurement data sequence and the moving average data sequence; A dynamic threshold is calculated in combination with the absolute error average and the standard deviation; wherein the dynamic threshold is used to perform comparative analysis on the real-time measurement data of the observation point.
2. The threshold dynamic calculation method according to claim 1, It is characterized in that The step of calculating the moving average data sequence according to the original measurement data sequence comprises: The original measurement data sequence is input into the third calculation model to calculate the estimated data corresponding to the measurement data at each moment; the third calculation model is expressed as: t =αX t +(1-α)Y t-1 , where Y t is the estimated data at time t, α is the weight coefficient, X t represents the measurement data at time t; By calculating all the estimated data, a moving average data series is obtained.
3. The threshold dynamic calculation method according to claim 1, It is characterized in that The step of calculating the absolute error mean and standard deviation based on the original measurement data sequence and the moving average data sequence comprises: Calculating an absolute error based on the original measurement data sequence and the moving average data sequence; The absolute error is input into the fourth calculation model to calculate the average absolute error; the fourth calculation model is expressed as: The absolute error and the average absolute error are input into the fifth calculation model to calculate the standard deviation; the fifth calculation model is expressed as: in, Denotes the absolute error mean, D t represents the absolute error at time t, n represents the total number of data, and S represents the standard deviation.
4. The threshold dynamic calculation method according to any one of claims 1 to 3, It is characterized in that The step of calculating the dynamic threshold by combining the absolute error mean and the standard deviation comprises: In combination with the absolute error mean and the standard deviation, a first-level upper threshold, a second-level upper threshold, a first-level lower threshold, and a second-level lower threshold are calculated; the first-level upper threshold is expressed as: The secondary upper limit threshold is expressed as: The first-level lower threshold is expressed as: The secondary lower threshold is expressed as: Among them, max 1 Indicates the upper limit threshold of the first level, max 2 Indicates the secondary upper limit threshold, min 1 Indicates the first-level lower threshold, min 2 represents the secondary lower threshold, represents the absolute error mean, and S represents the standard deviation.
5. The threshold dynamic calculation method according to any one of claims 1 to 3, It is characterized in that After the step of calculating the dynamic threshold by combining the absolute error mean value and the standard deviation, the method further includes: Compare the dynamic threshold with the original threshold to determine the threshold adjustment amplitude; comparing the threshold adjustment amplitude with a preset amplitude threshold; When receiving a threshold call request sent by the alarm configuration service, if the threshold adjustment amplitude is greater than or equal to the amplitude threshold, the original threshold is output to the alarm configuration service; if the threshold adjustment amplitude is less than the amplitude threshold, the dynamic threshold is output to the alarm configuration service.
6. A threshold dynamic calculation device, It is characterized in that The threshold dynamic calculation device comprises: An acquisition module is used to obtain the original measurement data sequence of the observation point in the target historical period; A first calculation module, used for calculating a moving average data sequence according to the original measurement data sequence; A second calculation module, used for calculating an absolute error mean value and a standard deviation based on the original measurement data sequence and the moving average data sequence; A third calculation module, used to calculate a dynamic threshold value in combination with the absolute error average value and the standard deviation; wherein the dynamic threshold value is used to compare and analyze the real-time measurement data of the observation point; The acquisition module is also used to: acquire the data collection period of the observation point and the dynamic threshold calculation frequency; A determination module is used to compare the dynamic threshold calculation frequency with a preset frequency threshold; when the dynamic threshold calculation frequency is less than or equal to the frequency threshold, the data collection period and the dynamic threshold calculation frequency are input into a first calculation model, and a target historical period is determined accordingly; the first calculation model is expressed as: W=60*F / T; when the dynamic threshold calculation frequency is greater than the frequency threshold, the data collection period and the frequency threshold are input into a second calculation model, and a target historical period is determined accordingly; the second calculation model is expressed as: W=60*E / T; wherein W represents the target historical period, F represents the dynamic threshold calculation frequency, E represents the frequency threshold, and T represents the data collection period.
7. An electronic device, It is characterized in that include: Memory, processor and bus; The bus is used to realize the connection and communication between the memory and the processor; The processor is used to execute the computer program stored in the memory; When the processor executes the computer program, the steps in the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Self-adaptive anomaly judgment method and device in real-time anomaly detection system
CN112508316A
Time series data anomaly detection method and device, equipment and storage medium
CN113570396A