Hydrological sequence abnormal value detection method, device, equipment, medium and program product
By calculating the target mean and variance in the hydrological sequence data and calculating the abnormal judgment threshold based on these values, the problem of difficult to accurately identify the outliers of hydrological sequence data in the prior art is solved, and accurate abnormal detection of runoff observation time series data is achieved.
Patent Information
- Application Number
- CN202510388756.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, when detecting outliers in hydrological sequence data, it is difficult to accurately identify outliers of data, especially when the data does not comply with the hypothetical distribution and the time series changes greatly.
By calculating the target mean and target variance corresponding to the first runoff observation data in the runoff observation time series data, the abnormality judgment threshold is calculated based on the target variance and the preset target probability value, and whether the first runoff observation data is abnormal observation data.
Accurate detection of abnormal data in runoff observation time series data is realized, effectively solving the problem that the runoff abnormal data cannot be accurately identified in the prior art.
Smart Images

Figure CN119903461A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic technology, and in particular to a method, device, equipment, medium and program product for detecting hydrological sequence outliers. Background Art
[0002] The outliers of hydrological data refer to the jumps in time series data caused by various reasons such as detection equipment failure, extreme weather or statistical errors. Such data have an important impact on hydrological forecasting, etc. Therefore, correctly detecting outliers in time series is of great practical significance.
[0003] In the related technologies, abnormal data detection technology is mainly divided into detection methods based on prediction models, distance-based methods and clustering-based methods, among which the distance-based method is more efficient. The distance-based outlier detection method generally assumes that the hydrological data obeys a special distribution such as Gaussian distribution, Cauchy distribution, etc., and the threshold is set based on global data. This method makes it difficult to accurately identify the outliers of the data when the data does not obey the assumed distribution and changes greatly over time series. Summary of the invention
[0004] In view of this, the present invention provides a hydrological sequence outlier detection method, device, equipment, medium and program product to solve the problem of accurately identifying abnormal data in sequence data in the related art.
[0005] In a first aspect, the present invention provides a method for detecting anomalies in a hydrological sequence, the method comprising: obtaining runoff observation time series data of a target area and a preset target probability value; when performing anomaly detection on the first runoff observation data in the runoff observation time series data, calculating the target mean and target variance corresponding to the first runoff observation data, the target mean of the first runoff observation data being calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, the target variance of the first runoff observation data being calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, the first runoff observation data being any runoff observation data in the runoff observation time series; calculating the anomaly judgment threshold of the first runoff observation data based on the target variance and the target probability value of the first runoff observation data; judging whether the first runoff observation data is an abnormal observation data based on the first runoff observation data, the target mean of the first runoff observation data and the anomaly judgment threshold, and obtaining an anomaly detection result of the first runoff observation data.
[0006] The hydrological sequence outlier detection method provided by the present invention calculates the target mean and target variance corresponding to the first runoff observation data when performing anomaly detection on the first runoff observation data in the runoff observation time series data, the target mean of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, the target variance of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, and the anomaly judgment threshold of the first runoff observation data is calculated based on the target variance and target probability value of the first runoff observation data; based on the first runoff observation data, whether the first runoff observation data is an abnormal observation data is judged, and an anomaly detection result of the first runoff observation data is obtained. The method provided by the present invention calculates the target mean and target variance of the first runoff observation data through a preset number of runoff observation data before the time node corresponding to the first runoff observation data in the runoff observation time series data, calculates the abnormality judgment threshold based on the target variance and target probability value of the first runoff observation data, judges whether the first runoff observation data is abnormal data based on the first runoff observation data, the target mean and the abnormality judgment threshold, and obtains the abnormality judgment result. The abnormal data in the runoff observation time series data can be accurately detected, and the problem that the runoff abnormal data cannot be accurately identified in the related technology is effectively solved.
[0007] In an optional embodiment, the method further includes: if the first runoff observation data is abnormal data and the second runoff observation data is non-abnormal data, using the second runoff observation data to replace the first runoff observation data in the runoff observation time series data to obtain target runoff observation sequence data, the second runoff observation data being the runoff observation data at a time node before the first runoff observation data; using a preset number of runoff observation data before the time node corresponding to the third runoff observation data in the target runoff observation sequence data to calculate the target mean and target variance of the third runoff observation data, the third runoff observation data being the runoff observation data at a time node after the first runoff observation data; using the target variance and target probability value of the third runoff observation data to calculate the abnormal judgment threshold of the third runoff observation data; using the third runoff observation data, the target variance of the third runoff observation data and the abnormal judgment threshold to judge whether the third runoff observation data is abnormal observation data, and obtain the abnormal detection result of the third runoff observation data.
[0008] The method provided in this optional implementation manner, when abnormal data is identified, uses the non-abnormal data of the previous time node to replace the abnormal data identified in the runoff observation time series data, thereby avoiding the influence of the current abnormal data on the next abnormal data detection.
[0009] In an optional embodiment, the method also includes: determining multiple non-abnormal data in the runoff observation time series data, the time nodes of each non-abnormal data, and the time nodes corresponding to different abnormal data; constructing a target model based on the multiple non-abnormal data and the time nodes of each non-abnormal data, the target model is used to characterize the association between the time nodes of the non-abnormal data and the non-abnormal data; inputting the time nodes of each abnormal data into the target model, and calculating the correction data of the corresponding abnormal data; using each correction data to replace the corresponding abnormal data in the runoff observation time series data, to obtain the corrected runoff observation time series data.
[0010] The method provided in this optional implementation manner constructs a target model, uses the target model to calculate correction data corresponding to each abnormal data, and uses each correction data to replace the corresponding abnormal data in the runoff observation time series data, thereby achieving effective quality control of the runoff data.
[0011] In an optional embodiment, the step of determining whether the first runoff observation data is abnormal observation data based on the first runoff observation data, the target mean of the first runoff observation data, and the abnormality judgment threshold, and obtaining the abnormality detection result of the first runoff observation data includes: calculating the absolute value of the difference between the first runoff observation data and the corresponding target mean; comparing the absolute value of the difference between the first runoff observation data and the corresponding target mean with the abnormality judgment threshold, and obtaining the abnormality detection result of the first runoff observation data.
[0012] In an optional embodiment, the absolute value of the difference between the first runoff observation data and the corresponding target mean is compared with the abnormality judgment threshold to obtain an abnormality detection result of the first runoff observation data, including: if the absolute value of the difference between the first runoff observation data and the corresponding target mean is greater than or equal to the abnormality judgment threshold, the first runoff observation data is determined to be abnormal data; if the absolute value of the difference between the first runoff observation data and the corresponding target mean is less than the abnormality judgment threshold, the first runoff observation data is determined to be non-abnormal data.
[0013] In a second aspect, the present invention provides a hydrological sequence anomaly detection device, which includes: an acquisition module, used to acquire runoff observation time series data of a target area and a preset target probability value; a first calculation module, used to calculate the target mean and target variance corresponding to the first runoff observation data when performing anomaly detection on the first runoff observation data in the runoff observation time series data, the target mean of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, the target variance of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, and the first runoff observation data is any runoff observation data in the runoff observation time series; the second calculation module is used to calculate the anomaly judgment threshold of the first runoff observation data based on the target variance and target probability value of the first runoff observation data; the first judgment module is used to judge whether the first runoff observation data is an abnormal observation data based on the first runoff observation data, the target mean of the first runoff observation data and the anomaly judgment threshold, and obtain the anomaly detection result of the first runoff observation data.
[0014] In an optional embodiment, the device also includes: a replacement module, which is used to replace the first runoff observation data in the runoff observation time series data with the second runoff observation data if the first runoff observation data is abnormal data and the second runoff observation data is non-abnormal data, so as to obtain target runoff observation sequence data, and the second runoff observation data is the runoff observation data at a time node before the first runoff observation data; a third calculation module, which is used to calculate the target mean and target variance of the third runoff observation data using a preset number of runoff observation data before the time node corresponding to the third runoff observation data in the target runoff observation sequence data, and the third runoff observation data is the runoff observation data at a time node after the first runoff observation data; a fourth calculation module, which is used to calculate the abnormal judgment threshold of the third runoff observation data using the target variance and target probability value of the third runoff observation data; and a second judgment module, which is used to judge whether the third runoff observation data is abnormal observation data using the third runoff observation data, the target variance of the third runoff observation data and the abnormal judgment threshold, and obtain the abnormal detection result of the third runoff observation data.
[0015] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the hydrological sequence anomaly detection method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0016] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the hydrological sequence outlier detection method of the first aspect or any corresponding embodiment thereof.
[0017] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the hydrological sequence outlier detection method according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 is a flow chart of a method for detecting hydrological sequence outliers according to an embodiment of the present invention; Figure 2 is a flow chart of another hydrological sequence outlier detection method according to an embodiment of the present invention; Figure 3 is a flow chart of another hydrological sequence outlier detection method according to an embodiment of the present invention; Figure 4 is a structural block diagram of a hydrological sequence outlier detection device according to an embodiment of the present invention; Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0021] In the related technologies, abnormal data detection technology is mainly divided into detection methods based on prediction models, distance-based methods and clustering-based methods, among which the distance-based method is more efficient. The distance-based outlier detection method generally assumes that the hydrological data obeys a special distribution such as Gaussian distribution, Cauchy distribution, etc., and the threshold is set based on global data. This method makes it difficult to accurately identify the outliers of the data when the data does not obey the assumed distribution and changes greatly over time series.
[0022] In view of this, a hydrological sequence outlier detection method provided in an embodiment of the present application can be applied to a server to realize outlier monitoring of hydrological sequence data. The method provided in an embodiment of the present application calculates the target mean and target variance of the first runoff observation data through a preset number of runoff observation data before the time node corresponding to the first runoff observation data in the runoff observation time series data, calculates the abnormal judgment threshold based on the target variance and target probability value of the first runoff observation data, judges whether the first runoff observation data is abnormal data based on the first runoff observation data, the target mean and the abnormal judgment threshold, and obtains the abnormal judgment result, which can accurately detect the abnormal data in the runoff observation time series data, and effectively solves the problem that the runoff abnormal data cannot be accurately identified in the related technology.
[0023] According to an embodiment of the present invention, an embodiment of a method for detecting outliers in a hydrological sequence is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0024] In this embodiment, a hydrological sequence outlier detection method is provided, which can be used in the above-mentioned server. Figure 1 is a flow chart of a method for detecting hydrological sequence outliers according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps: Step S101, obtaining the runoff observation time series data of the target area and the preset target probability value.
[0025] For example, the target area may be a research area where hydrological observation anomaly detection is required. The runoff observation time series data is the continuous time series of runoff observation data observed by a preset runoff observation device. The target probability value is a smaller probability value preset according to the actual situation. The specific content of the target probability value is not limited in the embodiment of the present application, and those skilled in the art may determine it according to their needs. In the embodiment of the present application, the runoff observation time series data can be expressed as , where n represents the number of time nodes in the runoff observation time series data, and the value of the target probability may include but is not limited to 0.01.
[0026] Step S102, when performing anomaly detection on the first runoff observation data in the runoff observation time series data, calculate the target mean and target variance corresponding to the first runoff observation data, the target mean of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, and the target variance of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data.
[0027] Exemplarily, the first runoff observation data is any runoff observation data in the runoff observation time series. The preset number can be determined based on actual needs. In the embodiment of the present application, the size of the sliding window is set to Win1, and the length of Win1 is equal to the length of the preset number of runoff observation data. Corresponding to the runoff observation data of the first Win1 time nodes before time node j , calculate its mean and the variance is ,Will As the target mean of the first runoff observation data, The target variance for the first runoff observation. The target mean and target variance It can be calculated by the following formula:
[0028]
[0029] in, represents the target mean, represents the target variance.
[0030] Step S103: calculating an abnormality judgment threshold of the first runoff observation data based on a target variance and a target probability value of the first runoff observation data.
[0031] For example, in the embodiment of the present application, it is set Falling The probability of being outside the left and right target range is no more than , the abnormal judgment threshold can be calculated by the following formula:
[0032] in, Indicates the abnormality judgment threshold, represents the target probability.
[0033] Step S104: determining whether the first runoff observation data is abnormal observation data based on the first runoff observation data, the target mean value of the first runoff observation data, and the abnormality judgment threshold, and obtaining an abnormality detection result of the first runoff observation data.
[0034] Exemplarily, in an embodiment of the present application, if the deviation value between the first runoff observation data and the target mean is less than the abnormality judgment threshold, the first runoff observation data is considered to be non-abnormal observation data, otherwise, the first runoff observation data is abnormal observation data.
[0035] The hydrological series outlier detection method provided in the present embodiment calculates the target mean and target variance of the first runoff observation data through a preset number of runoff observation data before the time node corresponding to the first runoff observation data in the runoff observation time series data, calculates the anomaly judgment threshold based on the target variance and target probability value of the first runoff observation data, judges whether the first runoff observation data is abnormal data based on the first runoff observation data, the target mean and the anomaly judgment threshold, and obtains the anomaly judgment result, which can accurately detect the abnormal data in the runoff observation time series data, and effectively solves the problem that the runoff abnormal data cannot be accurately identified in the related technology.
[0036] In this embodiment, a hydrological sequence outlier detection method is provided, which can be used in the above-mentioned server. Figure 2 is a flow chart of a method for detecting hydrological sequence outliers according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps: Step S201, obtain the runoff observation time series data of the target area and the preset target probability value. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0037] Step S202, when performing anomaly detection on the first runoff observation data in the runoff observation time series data, calculate the target mean and target variance corresponding to the first runoff observation data, the target mean of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, the target variance of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, the first runoff observation data is any runoff observation data in the runoff observation time series. For details, please refer to Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0038] Step S203: Calculate the abnormality judgment threshold of the first runoff observation data based on the target variance and target probability value of the first runoff observation data. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0039] Step S204: determining whether the first runoff observation data is abnormal observation data based on the first runoff observation data, the target mean value of the first runoff observation data, and the abnormality judgment threshold, and obtaining an abnormality detection result of the first runoff observation data.
[0040] Specifically, the above step S204 includes: Step S2041, calculating the absolute value of the difference between the first runoff observation data and the corresponding target mean.
[0041] Step S2042, comparing the absolute value of the difference between the first runoff observation data and the corresponding target mean with the abnormality judgment threshold to obtain the abnormality detection result of the first runoff observation data.
[0042] In some optional implementations, the above step S2042 includes: Step a1: if the absolute value of the difference between the first runoff observation data and the corresponding target mean value is greater than or equal to the abnormality judgment threshold, the first runoff observation data is determined to be abnormal data.
[0043] Step a2: If the absolute value of the difference between the first runoff observation data and the corresponding target mean value is less than the abnormality judgment threshold, the first runoff observation data is determined to be non-abnormal data.
[0044] For example, in the present application, if , then it is believed that is abnormal observation data; if , then it is believed that is non-abnormal observation data.
[0045] In this embodiment, a hydrological sequence outlier detection method is provided, which can be used in the above-mentioned server. Figure 3 is a flow chart of a method for detecting hydrological sequence outliers according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps: Step S301, obtain the runoff observation time series data of the target area and the preset target probability value. Figure 2 Step S201 of the illustrated embodiment will not be described in detail here.
[0046] Step S302, when performing anomaly detection on the first runoff observation data in the runoff observation time series data, calculate the target mean and target variance corresponding to the first runoff observation data, the target mean of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, the target variance of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, the first runoff observation data is any runoff observation data in the runoff observation time series. For details, please refer to Figure 2 Step S202 of the illustrated embodiment will not be described in detail here.
[0047] Step S303: Calculate the abnormality judgment threshold of the first runoff observation data based on the target variance and target probability value of the first runoff observation data. Figure 2 Step S203 of the illustrated embodiment will not be described in detail here.
[0048] Step S304: determine whether the first runoff observation data is abnormal observation data based on the first runoff observation data, the target mean value of the first runoff observation data, and the abnormality judgment threshold, and obtain an abnormality detection result of the first runoff observation data. Figure 2 Step S204 of the illustrated embodiment will not be described in detail here.
[0049] Step S305: If the first runoff observation data is abnormal data and the second runoff observation data is non-abnormal data, the first runoff observation data in the runoff observation time series data is replaced by the second runoff observation data to obtain target runoff observation sequence data, and the second runoff observation data is the runoff observation data at a time node before the first runoff observation data.
[0050] For example, in the embodiment of the present application, when it is detected that the first runoff observation data is abnormal data, the non-abnormal data of the previous time node is used for interpolation. That is, if If it is abnormal data, update = , count the time node j into the abnormal data index set IndexNormal.
[0051] Step S306, using a preset number of runoff observation data before the time node corresponding to the third runoff observation data in the target runoff observation sequence data, calculate the target mean and target variance of the third runoff observation data, the third runoff observation data being the runoff observation data at a time node after the first runoff observation data.
[0052] For example, in the embodiment of the present application, the third runoff observation data is used The Win1 runoff observation data before the corresponding time node calculates the third runoff observation data The target mean and target variance of .
[0053] Step S307: calculate the abnormality judgment threshold of the third runoff observation data by using the target variance and the target probability value of the third runoff observation data.
[0054] Exemplarily, the calculation process of the abnormality judgment threshold of the third runoff observation data refers to the description of the relevant contents in the above embodiment, which will not be repeated here.
[0055] Step S308: using the third runoff observation data, the target variance of the third runoff observation data and the abnormality judgment threshold, it is determined whether the third runoff observation data is abnormal observation data, and an abnormality detection result of the third runoff observation data is obtained.
[0056] For example, the third runoff observation data abnormality judgment process is described in the above embodiment and will not be described in detail here.
[0057] Step S309, determining a plurality of non-abnormal data in the runoff observation time series data, a time node of each non-abnormal data, and a time node corresponding to each of the different abnormal data.
[0058] Exemplarily, in an embodiment of the present application, by performing anomaly detection on each runoff observation data in the runoff observation time series data, multiple non-abnormal data in the runoff observation time series data, the time nodes of each non-abnormal data, and the time nodes corresponding to different abnormal data are determined, and the index set IndexNormal of all abnormal data is obtained, and IndexNormal contains the time node information of each abnormal data.
[0059] Step S310: construct a target model based on a plurality of non-abnormal data and time nodes of each non-abnormal data.
[0060] Exemplarily, the target model is used to characterize the correlation between the time nodes of non-abnormal data and the non-abnormal data. In the embodiment of the present application, the time nodes of all non-abnormal data are taken as X, and all non-abnormal data are taken as Y. The cubic spline interpolation method is used to fit the cubic spline function f, which satisfies the form of Y=f(X), and the fitted cubic spline function f is used as the target model.
[0061] Step S311, input the time node of each abnormal data into the target model, and calculate and obtain the correction data corresponding to the abnormal data.
[0062] Exemplarily, in the embodiment of the present application, all abnormal data subscripts are set as X0, and the cubic spline function is input to obtain the corresponding value Y0 as the correction data corresponding to the abnormal data of the cubic spline interpolation method, and the corresponding Y0=f(X0).
[0063] Step S312: using each correction data to replace the corresponding abnormal data in the runoff observation time series data to obtain the corrected runoff observation time series data.
[0064] In this embodiment, a hydrological sequence abnormal value detection device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0065] This embodiment provides a hydrological sequence abnormal value detection device, such as Figure 4 As shown, including: An acquisition module 401 is used to acquire the runoff observation time series data of the target area and a preset target probability value; A first calculation module 402 is used to calculate a target mean and a target variance corresponding to the first runoff observation data when performing anomaly detection on the first runoff observation data in the runoff observation time series data, wherein the target mean of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, and the target variance of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, and the first runoff observation data is any runoff observation data in the runoff observation time series; The second calculation module 403 is used to calculate the abnormality judgment threshold of the first runoff observation data based on the target variance and the target probability value of the first runoff observation data; The first judgment module 404 is used to judge whether the first runoff observation data is abnormal observation data based on the first runoff observation data, the target mean value of the first runoff observation data and the abnormal judgment threshold, and obtain an abnormal detection result of the first runoff observation data.
[0066] In some optional embodiments, the device further comprises: A replacement module, for replacing the first runoff observation data in the runoff observation time series data with the second runoff observation data to obtain target runoff observation sequence data if the first runoff observation data is abnormal data and the second runoff observation data is non-abnormal data, wherein the second runoff observation data is the runoff observation data at a time node before the first runoff observation data; A third calculation module is used to calculate the target mean and target variance of the third runoff observation data by using a preset number of runoff observation data before the time node corresponding to the third runoff observation data in the target runoff observation sequence data, where the third runoff observation data is the runoff observation data at a time node after the first runoff observation data; A fourth calculation module, used for calculating the abnormality judgment threshold of the third runoff observation data by using the target variance and the target probability value of the third runoff observation data; The second judgment module is used to judge whether the third runoff observation data is abnormal observation data by using the third runoff observation data, the target variance of the third runoff observation data and the abnormal judgment threshold, and obtain the abnormal detection result of the third runoff observation data.
[0067] In some optional embodiments, the device further comprises: A determination module, used to determine a plurality of non-abnormal data in the runoff observation time series data, a time node of each non-abnormal data, and a time node corresponding to each of different abnormal data; A construction module, used to construct a target model based on multiple non-abnormal data and the time nodes of each non-abnormal data, wherein the target model is used to characterize the correlation between the time nodes of the non-abnormal data and the non-abnormal data; A fifth calculation module, used for inputting the time node of each abnormal data into the target model, and calculating and obtaining the correction data corresponding to the abnormal data; The correction module is used to replace the corresponding abnormal data in the runoff observation time series data with each correction data to obtain the corrected runoff observation time series data.
[0068] In some optional implementations, the first determination module 404 includes: A calculation submodule, used for calculating the absolute value of the difference between the first runoff observation data and the corresponding target mean value; The comparison submodule is used to compare the absolute value of the difference between the first runoff observation data and the corresponding target mean with the abnormality judgment threshold to obtain the abnormality detection result of the first runoff observation data.
[0069] In some optional embodiments, the comparison submodule includes: A first determination unit, configured to determine that the first runoff observation data is abnormal data if the absolute value of the difference between the first runoff observation data and the corresponding target mean value is greater than or equal to an abnormality judgment threshold; The second determination unit is used to determine that the first runoff observation data is non-abnormal data if the absolute value of the difference between the first runoff observation data and the corresponding target mean value is less than the abnormality judgment threshold.
[0070] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0071] The hydrological sequence anomaly detection device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0072] The embodiment of the present invention also provides a computer device having the above Figure 4 The hydrological sequence outlier detection device shown.
[0073] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0074] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0075] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0076] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0077] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0078] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0079] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0080] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0081] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for detecting outliers in a hydrological sequence, characterized in that: The method comprises: Obtain the runoff observation time series data of the target area and the preset target probability value; When performing anomaly detection on the first runoff observation data in the runoff observation time series data, a target mean and a target variance corresponding to the first runoff observation data are calculated, wherein the target mean of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, and the target variance of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, and the first runoff observation data is any runoff observation data in the runoff observation time series; Calculate the abnormality judgment threshold of the first runoff observation data based on the target variance and the target probability value of the first runoff observation data; Based on the first runoff observation data, the target mean value of the first runoff observation data and the abnormality judgment threshold, it is judged whether the first runoff observation data is abnormal observation data to obtain an abnormality detection result of the first runoff observation data.
2. The method according to claim 1, characterized in that The method further comprises: If the first runoff observation data is abnormal data and the second runoff observation data is non-abnormal data, the first runoff observation data in the runoff observation time series data is replaced by the second runoff observation data to obtain target runoff observation sequence data, wherein the second runoff observation data is the runoff observation data at a time node before the first runoff observation data; Calculating a target mean and a target variance of the third runoff observation data using a preset number of runoff observation data before a time node corresponding to the third runoff observation data in the target runoff observation sequence data, wherein the third runoff observation data is the runoff observation data at a time node after the first runoff observation data; The abnormality judgment threshold of the third runoff observation data is calculated by using the target variance of the third runoff observation data and the target probability value; The third runoff observation data, the target variance of the third runoff observation data and the abnormality judgment threshold are used to judge whether the third runoff observation data is abnormal observation data, and obtain an abnormality detection result of the third runoff observation data.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Determine multiple non-abnormal data in the runoff observation time series data, the time nodes of each non-abnormal data, and the time nodes corresponding to different abnormal data; Building a target model based on multiple non-abnormal data and time nodes of each non-abnormal data, wherein the target model is used to characterize the correlation between the time nodes of the non-abnormal data and the non-abnormal data; Inputting the time node of each abnormal data into the target model, and calculating and obtaining the correction data corresponding to the abnormal data; The corresponding abnormal data in the runoff observation time series data are replaced by each correction data to obtain the corrected runoff observation time series data.
4. The method according to claim 1, characterized in that: The step of determining whether the first runoff observation data is abnormal observation data based on the first runoff observation data, the target mean value of the first runoff observation data, and the abnormality judgment threshold, and obtaining an abnormality detection result of the first runoff observation data includes: Calculate the absolute value of the difference between the first runoff observation data and the corresponding target mean; The absolute value of the difference between the first runoff observation data and the corresponding target mean is compared with the abnormality judgment threshold to obtain the abnormality detection result of the first runoff observation data.
5. The method according to claim 4, characterized in that The absolute value of the difference between the first runoff observation data and the corresponding target mean is compared with the abnormality judgment threshold to obtain the abnormality detection result of the first runoff observation data, including: If the absolute value of the difference between the first runoff observation data and the corresponding target mean value is greater than or equal to the abnormality judgment threshold, determining that the first runoff observation data is abnormal data; If the absolute value of the difference between the first runoff observation data and the corresponding target mean value is less than the abnormality judgment threshold, it is determined that the first runoff observation data is non-abnormal data.
6. A hydrological sequence abnormal value detection device, characterized in that: The device comprises: An acquisition module is used to obtain the runoff observation time series data of the target area and the preset target probability value; a first calculation module, for calculating a target mean and a target variance corresponding to the first runoff observation data when performing anomaly detection on the first runoff observation data in the runoff observation time series data, wherein the target mean of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, and the target variance of the first runoff observation data is calculated based on a preset number of runoff observation data before the time node corresponding to the first runoff observation data, and the first runoff observation data is any runoff observation data in the runoff observation time series; A second calculation module is used to calculate the abnormality judgment threshold of the first runoff observation data based on the target variance and the target probability value of the first runoff observation data; The first judgment module is used to judge whether the first runoff observation data is abnormal observation data based on the first runoff observation data, the target mean value of the first runoff observation data and the abnormal judgment threshold, and obtain an abnormality detection result of the first runoff observation data.
7. The device according to claim 6, characterized in that The device also includes: a replacement module, configured to replace the first runoff observation data in the runoff observation time series data with the second runoff observation data to obtain target runoff observation sequence data if the first runoff observation data is abnormal data and the second runoff observation data is non-abnormal data, wherein the second runoff observation data is the runoff observation data at a time node before the first runoff observation data; A third calculation module is used to calculate the target mean and target variance of the third runoff observation data by using a preset number of runoff observation data before the time node corresponding to the third runoff observation data in the target runoff observation sequence data, wherein the third runoff observation data is the runoff observation data at a time node after the first runoff observation data; A fourth calculation module, configured to calculate an abnormality judgment threshold of the third runoff observation data by using the target variance of the third runoff observation data and the target probability value; The second judgment module is used to judge whether the third runoff observation data is abnormal observation data by using the third runoff observation data, the target variance of the third runoff observation data and the abnormal judgment threshold, and obtain the abnormal detection result of the third runoff observation data.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the hydrological sequence anomaly detection method according to any one of claims 1 to 5 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the hydrological sequence outlier detection method according to any one of claims 1 to 5.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the hydrological sequence outlier detection method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Hydropower station abnormal data processing method and device
CN110634081A
Network flow anomaly detection method based on space-time IP address portrait
CN114050922A
Measurement jump identification method and system based on time series data and medium
CN117951441A