Water quality change trend online identification and early warning method, system and equipment and storage medium
By constructing a multi-model combination of water quality trend recognition system and using the Mann-Kendall algorithm, the problem of real-time, accuracy, and stability of water quality change trends in existing technologies in the existing technology has been solved. Effective adaptation has improved the reliability of early warning information.
Patent Information
- Application Number
- CN202411942939.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-01-28
AI Technical Summary
The existing technology is difficult to achieve real-time, accurate and stable identification of water quality changes, especially in the face of sudden pollution events or extreme climate change, and the single trend identification algorithm is poorly applicable and difficult to deal with. The characteristics of different monitoring sites and water quality indicators are different.
Using STL, EMD, and PROPHET Trend recognition models to recognize the offline model group, combined with the MAN-Kendall algorithm for qualitative and quantitative analysis, the comprehensive water quality changes are calculated through the weighted fusion calculation, and early warning information is generated.
It significantly improves the real -time, accuracy and stability of water quality trend recognition, enhances the adaptability of different sites and indicators characteristics, and improves the accuracy of trend judgment and the reliability of early warning information.
Smart Images

Figure CN119377611A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water quality analysis, and in particular to a method, system, equipment and storage medium for online identification and early warning of water quality change trends. Background Art
[0002] Water quality safety is crucial to maintaining ecological balance and human health. Traditional water quality testing methods rely on on-site sampling and laboratory analysis. Although traditional water quality testing methods can provide relatively accurate water quality data, their processes are complex, time-consuming, and dependent on the operator's operating level and sample storage conditions. Moreover, traditional water quality testing methods are difficult to reflect changes in water quality, especially in the face of sudden pollution incidents, and it is difficult to provide early warning information in a timely manner, posing a challenge to pollution control and emergency response.
[0003] In the face of the above technical problems, the existing technology proposes to use a single trend recognition algorithm to judge the trend of water quality changes. However, the real-time performance of the single trend recognition algorithm is weak, and it mainly relies on historical data for offline analysis, lacking the ability to respond quickly to real-time monitoring data. Because the single trend recognition algorithm cannot reflect the immediate changes in water quality, there is a lag in the response to sudden water quality changes and abnormal fluctuations, and it is difficult to meet the real-time monitoring and early warning needs of water quality trends; in the face of sudden pollution incidents or extreme climate change, the single trend recognition algorithm still cannot provide sufficiently fast and accurate early warning information, thereby limiting the efficiency of water quality management and emergency response. In addition, due to the differences in hydrogeological conditions and the degree of influence of human activities at each monitoring station, and the fact that different water quality indicators have unique change cycles, seasonal characteristics and response mechanisms, the applicability of the single trend recognition algorithm is poor, and it is difficult to cope with the characteristic differences of different monitoring stations and water quality indicators. Therefore, the existing single trend recognition algorithm cannot be applied to all situations. In addition, water quality changes are affected by a combination of factors, including hydrological and meteorological conditions, changes in pollution sources, seasonal fluctuations, etc., but the stability of a single trend identification algorithm is relatively poor. Therefore, when dealing with these multi-dimensional and dynamically changing water quality data, it is easily affected by data fluctuations, resulting in insufficient robustness and accuracy of the identification results, and unable to fully reflect the complexity of water quality changes.
[0004] Therefore, it is urgent to solve the above problems. Summary of the invention
[0005] Purpose of the invention: The first purpose of the present invention is to provide a method for online identification and early warning of water quality change trends, which can significantly improve the real-time, accuracy and stability of water quality trend identification.
[0006] The second object of the present invention is to provide an online identification and early warning system for water quality change trends.
[0007] A third object of the present invention is to provide an electronic device.
[0008] A fourth object of the present invention is to provide a computer storage medium.
[0009] Technical solution: To achieve the above purpose, the present invention discloses an online identification and early warning method for water quality change trend, comprising the following steps: (1) Obtain historical water quality data from target surface monitoring sites and identify periodic and seasonal fluctuations in historical water quality data ; (2) Construct an offline model group for surface water quality trend identification consisting of an STL trend identification model, an EMD trend identification model, and a Prophet trend identification model, and set the model's initialization hyperparameters; input historical water quality data into the STL trend identification model, the EMD trend identification model, and the Prophet trend identification model for trend identification, and output the long-term trend part of the time series. Output of the remaining items as STL trend recognition results As the result of EMD trend identification, the trend part is output As a result of Prophet trend identification; (3) Normalize the STL trend identification results, EMD trend identification results and Prophet trend identification results to obtain the corresponding trend change indicators, and analyze the trend change indicators to obtain the corresponding trend analysis results; evaluate the historical water quality data to obtain the trend reference results, and compare each trend analysis result with the trend reference results. If the trends are inconsistent, adjust and optimize the hyperparameters of the STL trend identification model, the EMD trend identification model and the Prophet trend identification model respectively until the trends are consistent, and obtain the optimized surface water quality trend identification offline model group; (4) Dynamically obtain real-time water quality data from surface target monitoring stations, divide the collected real-time water quality data into time periods according to different time granularity requirements, and pre-process the real-time water quality data; (5) Apply the Mann-Kendall algorithm to conduct a qualitative analysis of the water quality change trend of the pre-processed real-time water quality data. If a monotonic trend exists, proceed to step (6); if no monotonic trend exists, end the identification and warning; (6) The optimized offline model group for surface water quality trend identification is used to quantitatively analyze the water quality change trend. The preprocessed real-time water quality data is input into the STL trend identification model, the EMD trend identification model and the Prophet trend identification model for trend identification. The long-term trend part of the time series is output as the STL trend identification result, the residual item is output as the EMD trend identification result, and the trend part is output as the Prophet trend identification result. The STL trend identification result, the EMD trend identification result and the Prophet trend identification result are normalized to obtain the STL trend change index, the EMD trend change index and the Prophet trend change index respectively. (7) Based on the STL trend change index, EMD trend change index and Prophet trend change index, a comprehensive water quality change index is obtained through weighted fusion calculation; (8) Based on the comprehensive water quality change indicators, quantify the water quality change trend level and generate corresponding early warning information.
[0010] Optionally, the specific method for identifying periodic and seasonal fluctuations in historical water quality data in step (1) is: The frequency domain characteristics of historical water quality data are analyzed by discrete Fourier transform DFT. The formula of discrete Fourier transform is: For a time series , whose discrete Fourier transform Defined as: , in, For historical water quality data, t=0,1,2,…,N-1 ; is the frequency corresponding to the maximum amplitude in the amplitude spectrum, indicating the different frequency components in the signal; is the number of data points, is an imaginary unit; , in, and Respectively The real and imaginary parts of Cyclic and seasonal fluctuations in historical water quality data for: .
[0011] Optionally, the hyperparameters of the STL trend identification model in step (2) include the size of the regression window and the length of the seasonal cycle; the hyperparameters of the EMD trend identification model include the number of IMFs to be decomposed and the stopping criterion; the hyperparameters of the Prophet trend identification model include a factor controlling the flexibility of the trend change point, a factor controlling the exploration range of the trend change point, a factor controlling the flexibility of the seasonal pattern, and a custom seasonal cycle length, where the periodicity and seasonal fluctuations in the historical water quality data They are used as the initial value of the seasonal cycle length for the STL trend identification model and as the initial value of the custom seasonal cycle length for the Prophet trend identification model.
[0012] Optionally, the formula of the STL trend identification model in step (2) is: , in, For historical water quality data, is the long-term trend part of the time series, is the seasonal part of the time series, is the residual part of the time series, representing the noise or unexplainable part; The formula of the EMD trend identification model is: , in, For historical water quality data, For the An intrinsic mode function, which reflects the periodicity and local fluctuations of the signal; is the number of eigenmode functions; is the residual term, representing the trend or low-frequency part; The formula of the Prophet trend identification model is: , in, For historical water quality data, For the trend part, a piecewise linear or logistic growth model is used; It is the seasonal part, which is a periodic fluctuation; The holiday effect part is used to deal with the impact of holidays and special events on the data; is the error term.
[0013] Optionally, in step (3), the specific steps of normalizing the trend recognition result of the STL trend recognition model to obtain a trend change index, and analyzing the trend change index to obtain a trend analysis result are: Taking the long-term trend part of the time series The mean of is used as the benchmark value to calculate the long-term trend of the time series. The difference between adjacent trend values in the data set is divided by the benchmark value to obtain the normalized standard value of the trend component, and then the standard values of the trend components are summed to obtain the STL trend change index. If the STL trend change index is greater than 0, it is considered that there is an upward trend. If the STL trend change index is less than 0, it is considered that there is a downward trend, and the STL trend analysis result is obtained; The specific steps of normalizing the trend identification results of the EMD trend identification model to obtain the trend change index and analyzing the trend change index to obtain the trend analysis results are as follows: With the remaining items The mean of is taken as the benchmark value, and the remaining items are calculated The difference between adjacent residual items in the equation is divided by the reference value to obtain the normalized standard value of the trend component. The standard values of the trend components are then summed to obtain the EMD trend change index. If the EMD trend change index is greater than 0, it is considered that there is an upward trend. If the EMD trend change index is less than 0, it is considered that there is a downward trend, and the EMD trend analysis result is obtained. The specific steps of normalizing the trend identification results of the Prophet trend identification model to obtain the trend change index and analyzing the trend change index to obtain the trend analysis results are as follows: By trend section The mean of is taken as the base value and the trend part is calculated The difference between adjacent trend values in the Prophet is divided by the reference value to obtain the normalized standard value of the trend component. The standard values of the trend components are then summed to obtain the Prophet trend change index. If the Prophet trend change index is greater than 0, it is considered that there is an upward trend. If the Prophet trend change index is less than 0, it is considered that there is a downward trend, and the Prophet trend analysis result is obtained. The specific steps for determining the trend reference results are: The data is split into three segments on average, and the median of each segment is calculated. The median of the second segment is used as the reference value, and the difference between two adjacent segments is calculated. The difference is divided by the reference value to obtain the standard value. The standard values are summed. If the sum is greater than 0.2, it is considered that there is an upward trend. If the sum is less than -0.2, it is considered that there is a downward trend. The trend reference result is obtained.
[0014] Optionally, step (5) specifically includes the following steps: (5.1) Calculate the Mann-Kendall statistic, which is used to measure the direction of the trend between data points in a time series. , The positive or negative direction of the value reflects the upward or downward trend of the time series data. The absolute value reflects the significance of the trend and can quantify the monotonic trend of the time series. Mann-Kendall statistic The formula is: , in, ; It is the real-time water quality time series data after preprocessing; is the number of real-time water quality data samples; The first values; is a symbolic function; (5.2) Calculation The variance is used to assess the degree of random fluctuation between data points. The calculation formula for the variance is: , (5.3) Calculate the Mann-Kendall statistic to assess whether the water quality trend is significant , the formula is as follows: ,
[0015] (5.4) Based on the calculation By comparing the value with the critical value, the significance of the water quality trend can be judged; if ∣>1.96, it is considered that there is a significant upward or downward trend in water quality changes; if ∣ ∣<1.96, it is believed that the water quality data has no significant upward or downward trend, but rather random fluctuations.
[0016] Optionally, step (8) specifically includes the following steps: When the comprehensive water quality change index is less than -0.4, the water quality trend change result is divided into the first level; when the comprehensive water quality change index is between -0.4 and -0.25, the water quality trend change result is divided into the second level; when the comprehensive water quality change index is between -0.25 and 0.25, the water quality trend change result is divided into the third level; when the comprehensive water quality change index is between 0.25 and 0.4, the water quality trend change result is divided into the fourth level; when the comprehensive water quality change index is greater than 0.4, the water quality trend change result is divided into the fifth level; generate corresponding early warning information, which includes the monitoring site name, index, time period and water quality change trend level.
[0017] Based on the same inventive concept, the present invention discloses an online recognition and early warning system for surface water quality change trends, comprising the following steps: Historical data acquisition module, which is used to obtain historical water quality data from surface target monitoring sites and identify periodic and seasonal fluctuations in historical water quality data ; Construct an offline model group module, which is used to construct an offline model group for trend identification of surface water quality consisting of an STL trend identification model, an EMD trend identification model and a Prophet trend identification model, and set the initialization hyperparameters of the model; input historical water quality data into the STL trend identification model, the EMD trend identification model and the Prophet trend identification model respectively for trend identification, and output the long-term trend part of the time series as the STL trend identification result, output the remaining item as the EMD trend identification result, and output the trend part as the Prophet trend identification result; The offline model group module is optimized to normalize the STL trend identification results, EMD trend identification results and Prophet trend identification results to obtain the corresponding trend change indicators, and analyze the trend change indicators to obtain the corresponding trend analysis results; historical water quality data are evaluated to obtain trend reference results, and each trend analysis result is compared with the trend reference results. If the trends are inconsistent, the hyperparameters of the STL trend identification model, the EMD trend identification model and the Prophet trend identification model are adjusted and optimized respectively until the trends are consistent, thereby obtaining the optimized surface water quality trend identification offline model group; The real-time data acquisition module is used to dynamically acquire the real-time water quality data of the surface target monitoring station, divide the collected real-time water quality data into time periods according to different time granularity requirements, and pre-process the real-time water quality data; The qualitative analysis module is used to apply the Mann-Kendall algorithm to the pre-processed real-time water quality data to conduct qualitative analysis of the water quality change trend. If there is a monotonic trend, it will be transferred to the quantitative analysis module. If there is no monotonic trend, the identification and warning will be terminated. The quantitative analysis module is used to use the optimized offline model group for surface water quality trend identification to conduct quantitative analysis of water quality change trends. The pre-processed real-time water quality data is input into the STL trend identification model, EMD trend identification model and Prophet trend identification model for trend identification, and the long-term trend part of the time series is output. Output of the remaining items as STL trend recognition results As the result of EMD trend identification, the trend part is output as the Prophet trend identification result; the STL trend identification result, the EMD trend identification result and the Prophet trend identification result are normalized respectively to obtain the STL trend change index, the EMD trend change index and the Prophet trend change index; A comprehensive index calculation module is used to obtain a comprehensive water quality change index through weighted fusion calculation based on the STL trend change index, the EMD trend change index and the Prophet trend change index; The graded warning module is used to quantify the level of water quality change trends and generate corresponding warning information based on comprehensive water quality change indicators.
[0018] The present invention discloses an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement an online identification and early warning method for water quality change trends as described above.
[0019] The present invention discloses a computer-readable storage medium on which a computer program is stored, characterized in that the computer program is executed by a processor to implement the above-mentioned online identification and early warning method of water quality change trend.
[0020] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: (1) The present invention improves the applicability of the water quality trend identification method. It uses STL decomposition, EMD decomposition and Prophet to construct an offline model group for surface water quality trend identification. By integrating multiple algorithms to establish a trend identification framework, it can adapt to the characteristics of different sites and indicators, enhance the robustness of trend identification, and through the complementary principles of different algorithms, consider a variety of influencing factors, and can adapt to trend analysis at different scales. (2) As a non-parametric test method, the Mann-Kendall method of the present invention is suitable for identifying monotonic trends. The Mann-Kendall algorithm provides statistical evidence for the existence of trends, and then the surface water quality trend identification offline model group is used for quantitative analysis, providing trend change information. The combination of qualitative and quantitative analysis can fully understand the trend characteristics of time series. (3) The present invention enhances the stability of water quality trend identification, proposes a voting mechanism-driven fusion consensus algorithm, realizes the effective aggregation of multi-source analysis results, and introduces a multiple verification mechanism using the one-vote veto system of the Mann-Kendall algorithm, thereby improving the accuracy of trend judgment; (4) The present invention improves the efficiency of water quality trend change, builds a complete online monitoring, analysis and early warning system, realizes real-time identification and graded early warning of water quality trend changes, and provides strong technical support for water environment management.
[0021] (5) The present invention establishes a standardized trend level evaluation system and early warning mechanism, which can be applied to trend analysis of different time scales, different sites and water quality indicators. At the same time, it simplifies the expression of early warning information, enhances the management personnel's understanding and application ability of early warning results, and can provide a scientific basis and technical means for water quality management. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1It is a flow chart of a method for online identification and early warning of water quality change trend in the present invention; Figure 2 It is a structural schematic diagram of an online identification and early warning system for water quality change trends in the present invention; Figure 3 This is a structural block diagram of an electronic device in the present invention; Figure 4 A schematic diagram of a computer-readable storage medium in the present invention; Figure 5 It is a schematic diagram of trend identification results of real-time water quality data at a short-time granularity according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0024] It should be understood that the present invention can be implemented in different forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, providing these embodiments will make the disclosure thorough and complete and fully convey the scope of the present invention to those skilled in the art. In the accompanying drawings, the sizes and relative sizes of the components may be exaggerated for clarity. The same reference numerals throughout represent the same components.
[0025] Example 1: Figure 1 As shown, the present invention discloses an online identification and early warning method for water quality change trend, comprising the following steps: (1) Obtain historical water quality data from target surface monitoring sites and identify periodic and seasonal fluctuations in historical water quality data The time span of historical water quality data is at least half a year. The historical water quality data includes but is not limited to water temperature, dissolved oxygen, turbidity, total phosphorus, total nitrogen, chemical oxygen demand and ammonia nitrogen. The historical water quality data needs to cover the data of dry season and rainy season; Identify cyclical and seasonal fluctuations in historical water quality data The specific method is: The frequency domain characteristics of historical water quality data are analyzed by discrete Fourier transform DFT. The formula of discrete Fourier transform is: For a time series , whose discrete Fourier transform Defined as: , in, For historical water quality data, t=0,1,2,…,N-1 ; is the frequency corresponding to the maximum amplitude in the amplitude spectrum, indicating the different frequency components in the signal; is the number of data points, is an imaginary unit; , in, and Respectively The real and imaginary parts of Cyclic and seasonal fluctuations in historical water quality data for: , If a frequency The amplitude is large, indicating that there are periodic and seasonal fluctuations corresponding to this frequency in the original time series.
[0026] (2) Construct an offline model group for surface water quality trend identification consisting of an STL trend identification model, an EMD trend identification model, and a Prophet trend identification model, and set the model's initialization hyperparameters; input historical water quality data into the STL trend identification model for trend identification, and output the long-term trend part of the time series as the trend identification result; input historical water quality data into the EMD trend identification model for trend identification, and output the residual item as the trend identification result; input historical water quality data into the Prophet trend identification model for trend identification, and output the trend part as the trend identification result.
[0027] The hyperparameters of the STL trend identification model include the size of the regression window and the length of the seasonal cycle; the hyperparameters of the EMD trend identification model include the number of IMFs for decomposition and the stopping criterion; the hyperparameters of the Prophet trend identification model include the factor controlling the flexibility of the trend change point, the factor controlling the exploration range of the trend change point, the factor controlling the flexibility of the seasonal pattern, and the custom seasonal cycle length, where the periodicity and seasonal fluctuations in historical water quality data They are used as the initial value of the seasonal cycle length for the STL trend identification model and as the initial value of the custom seasonal cycle length for the Prophet trend identification model.
[0028] The formula of the STL trend identification model is: , in, For historical water quality data, is the long-term trend part of the time series, is the seasonal part of the time series, is the residual part of the time series, representing the noise or unexplainable part; The STL trend identification model is a seasonal trend decomposition method based on local weighted regression, namely STL (Seasonal and Trend decomposition using Loess), which aims to decompose the time series into three parts: seasonality, trend and residual. STL models seasonality and trend through local weighted regression LOESS, and performs iterative optimization to maximize the decomposition effect; the STL trend identification model is particularly suitable for identifying data with strong seasonal fluctuations and is suitable for situations where there are obvious seasonal changes in surface water quality. The STL trend identification model can be constructed based on the STL class in the statsmodels library of python software.
[0029] The formula of the EMD trend identification model is: , in, For historical water quality data, For the An intrinsic mode function, which reflects the periodicity and local fluctuations of the signal; is the number of eigenmode functions; is the residual term, representing the trend or low-frequency part; The EMD trend identification model is an adaptive decomposition method, namely EMD (Empirical Mode Decomposition), which can decompose complex signals into a series of physically meaningful intrinsic mode functions IMF. It is particularly suitable for processing data with complex fluctuations and irregular cycles. The EMD trend identification model gradually extracts the various oscillation components in the signal through local extreme value interpolation and iterative processes. It is very suitable for capturing complex water quality change trends and their multi-scale characteristics. Especially when processing data with multiple time scale fluctuations, the EMD trend identification model shows its advantages. The EMD trend identification model can be constructed based on the PyEMD library of python software.
[0030] The formula of the Prophet trend identification model is: , in, For historical water quality data, For the trend part, a piecewise linear or logistic growth model is used; The seasonal part is a periodic fluctuation, such as annual seasonality and monthly seasonality; The holiday effect part is used to deal with the impact of holidays and special events on the data; is the error term.
[0031] The Prophet algorithm used in the Prophet trend identification model is a time series prediction method based on an additive model developed by Facebook. It is suitable for time series data with seasonal changes, holiday effects, and trend changes. The Prophet algorithm can well capture seasonal changes, long-term trends, and sudden changes in the data, and is suitable for the prediction of surface water quality trends. Especially when faced with complex seasonal fluctuations and trend changes, the Prophet trend identification model can be constructed based on the Prophet library of python software.
[0032] (3) The trend identification results of the STL trend identification model, the EMD trend identification model and the Prophet trend identification model are normalized to obtain the corresponding trend change indicators, and the trend change indicators are analyzed to obtain the corresponding trend analysis results; the historical water quality data are evaluated to obtain the trend reference results, and the trend analysis results of the STL trend identification model, the EMD trend identification model and the Prophet trend identification model are compared with the trend reference results respectively. If the trends are inconsistent, the hyperparameters of the STL trend identification model, the EMD trend identification model and the Prophet trend identification model are adjusted and optimized respectively until the trends are consistent, and the optimized surface water quality trend identification offline model group is obtained; multiple groups of historical water quality data can be selected during the optimization process. If the identification results of the surface water quality trend identification offline model group corresponding to more than 80% of the groups of historical water quality data match the trend reference results, it is considered that the optimization of the surface water quality trend identification offline model group is completed.
[0033] The specific steps of normalizing the trend recognition results of the STL trend recognition model to obtain the trend change index and analyzing the trend change index to obtain the trend analysis result are as follows: Taking the long-term trend part of the time series The mean of is used as the benchmark value to calculate the long-term trend of the time series. The difference between adjacent trend values in the data set is divided by the benchmark value to obtain the normalized standard value of the trend component, and then the standard values of the trend components are summed to obtain the STL trend change index. If the STL trend change index is greater than 0, it is considered that there is an upward trend. If the STL trend change index is less than 0, it is considered that there is a downward trend, and the STL trend analysis result is obtained; The specific steps of normalizing the trend identification results of the EMD trend identification model to obtain the trend change index and analyzing the trend change index to obtain the trend analysis results are as follows: With the remaining items The mean of is taken as the benchmark value, and the remaining items are calculated The difference between adjacent residual items in the equation is divided by the reference value to obtain the normalized standard value of the trend component. The standard values of the trend components are then summed to obtain the EMD trend change index. If the EMD trend change index is greater than 0, it is considered that there is an upward trend. If the EMD trend change index is less than 0, it is considered that there is a downward trend, and the EMD trend analysis result is obtained. The specific steps of normalizing the trend identification results of the Prophet trend identification model to obtain the trend change index and analyzing the trend change index to obtain the trend analysis results are as follows: By trend section The mean of is taken as the base value and the trend part is calculated The difference between adjacent trend values in the Prophet is divided by the reference value to obtain the normalized standard value of the trend component. The standard values of the trend components are then summed to obtain the Prophet trend change index. If the Prophet trend change index is greater than 0, it is considered that there is an upward trend. If the Prophet trend change index is less than 0, it is considered that there is a downward trend, and the Prophet trend analysis result is obtained. The specific steps for determining the trend reference results are: The data is split into three segments on average, and the median of each segment is calculated. The median of the second segment is used as the reference value, and the difference between two adjacent segments is calculated. The difference is divided by the reference value to obtain the standard value. The standard values are summed. If the sum is greater than 0.2, it is considered that there is an upward trend. If the sum is less than -0.2, it is considered that there is a downward trend. The trend reference result is obtained.
[0034] (4) Dynamically obtain real-time water quality data from surface target monitoring stations once every 24 hours; real-time water quality data include but are not limited to water temperature, dissolved oxygen, turbidity, total phosphorus, total nitrogen, chemical oxygen demand and ammonia nitrogen; divide the collected real-time water quality data into time periods according to different time granularity requirements, such as 3 days, 7 days or 30 days, and pre-process the real-time water quality data; Preprocessing includes missing value filling and outlier detection and correction. Missing value filling can be done by using interpolation methods, such as linear interpolation or spline interpolation, or by using known data from previous and subsequent periods to ensure data continuity and integrity. This can be implemented based on the NumPy library of Python software. Outlier detection and correction uses statistical methods to detect abnormal points that significantly deviate from normal values, and corrects them according to the aforementioned missing value filling algorithm. Statistical methods, such as the Z-Score or IQR method, can be implemented based on the SciPy library of Python software. (5) Use the Mann-Kendall algorithm to conduct a qualitative analysis of the water quality change trend. If a monotonic trend exists, proceed to step (6). If no monotonic trend exists, end the identification and early warning. The Mann-Kendall algorithm is a non-parametric test method widely used in time series analysis. It is mainly used to test whether the data has a monotonic trend, such as an upward or downward trend, and does not rely on the distribution assumptions of the data. The main advantage of the Mann-Kendall algorithm is that it is not affected by extreme values, can handle complex water quality data, and is widely used in water quality trend identification. If there is a monotonic trend, the subsequent change trend will be quantitatively identified. If there is no monotonic trend, it is considered that no subsequent warning is required.
[0035] Step (5) specifically includes the following steps: (5.1) Calculate the Mann-Kendall statistic, which is used to measure the direction of the trend between data points in a time series. , can be calculated based on the pymannkendall library of python software, The positive or negative direction of the value reflects the upward or downward trend of the time series data. The absolute value reflects the significance of the trend and can quantify the monotonic trend of the time series. Mann-Kendall statistic The formula is: , in, ; It is the real-time water quality time series data after preprocessing; is the number of real-time water quality data samples; The first values; is a symbolic function; (5.2) Calculation The variance is used to assess the degree of random fluctuation between data points. The calculation formula for the variance is: , (5.3) Calculate the Mann-Kendall statistic to assess whether the water quality trend is significant , the formula is as follows: , (5.4) Based on the calculation By comparing the value with the critical value, the significance of the water quality trend can be judged; if ∣>1.96, it is considered that there is a significant upward or downward trend in water quality changes; if ∣ ∣<1.96, it is considered that the water quality data has no significant upward or downward trend, but rather random fluctuations; (6) Quantitatively analyze the water quality change trend using the optimized offline model group for surface water quality trend identification; Input the preprocessed real-time water quality data into the STL trend identification model for trend identification, and output the long-term trend part of the time series as the trend identification result; input the preprocessed real-time water quality data into the EMD trend identification model for trend identification, and output the remaining item as the trend identification result; input the preprocessed real-time water quality data into the Prophet trend identification model for trend identification, and output the trend part as the trend identification result; normalize the trend identification results of the STL trend identification model, the EMD trend identification model and the Prophet trend identification model to obtain the STL trend change index, the EMD trend change index and the Prophet trend change index respectively; The normalization process in the present invention can eliminate the differences in data units and magnitudes, thereby facilitating unified analysis and comparison of trends in different time periods and water quality indicators, and improving the scientificity and reliability of trend change analysis. In the embodiment of the present invention, real-time water quality data of three-day particle size is obtained to generate trend identification results of dissolved oxygen, such as Figure 5 shown.
[0036] (7) Used to obtain a comprehensive water quality change index through weighted fusion calculation based on the STL trend change index, the EMD trend change index and the Prophet trend change index; The formula for weighted fusion calculation is as follows: , in, It is a comprehensive water quality change indicator. is the weight of the STL trend identification model, is the weight of the EMD trend identification model, is the weight of the Prophet trend identification model, It is the STL trend change indicator. It is the EMD trend change indicator. It is the Prophet trend change indicator; Take 0.3, Take 0.3, is 0.4; (8) Quantify the level of water quality change trend and generate corresponding warning information. Based on the comprehensive water quality change index, quantify the water quality change trend and classify it into different levels. When the comprehensive water quality change index is less than -0.4, the water quality trend change result is classified into the first level; when the comprehensive water quality change index is between -0.4 and -0.25, the water quality trend change result is classified into the second level; when the comprehensive water quality change index is between -0.25 and 0.25, the water quality trend change result is classified into the third level; when the comprehensive water quality change index is between 0.25 and 0.4, the water quality trend change result is classified into the fourth level; when the comprehensive water quality change index is greater than 0.4, the water quality trend change result is classified into the fifth level; generate corresponding warning information, which includes the monitoring site name, index, time period and water quality change trend level.
[0037] The first level corresponds to a water quality trend change result of "quickly deteriorating", the second level corresponds to a water quality trend change result of "slowly deteriorating", the third level corresponds to a water quality trend change result of "remaining the same", the fourth level corresponds to a water quality trend change result of "slowly improving", and the fifth level corresponds to a water quality trend change result of "quickly improving". Subsequent operators can make different early warning response suggestions according to different levels. For example, for "quickly improving", "slowly improving" or "remaining the same", it is recommended to maintain routine monitoring and regular evaluation; for "slowly deteriorating", it is recommended to strengthen monitoring and regular inspections; for "quickly deteriorating", it is recommended to immediately activate the emergency plan and take emergency measures such as pollution source control and emission adjustment; operators can take appropriate response measures in a timely manner to ensure the efficiency and effectiveness of water quality management.
[0038] Example 2: Figure 2 As shown, based on the same inventive concept, this embodiment discloses an online recognition and early warning system for surface water quality change trends, including: The historical data acquisition module is used to obtain historical water quality data from surface target monitoring sites and identify periodic and seasonal fluctuations in historical water quality data. ; The time span of historical water quality data is at least half a year. The historical water quality data includes but is not limited to water temperature, dissolved oxygen, turbidity, total phosphorus, total nitrogen, chemical oxygen demand and ammonia nitrogen. The historical water quality data needs to cover the data of dry season and rainy season; The historical data acquisition module identifies periodic and seasonal fluctuations in historical water quality data The frequency domain characteristics of historical water quality data are analyzed by discrete Fourier transform DFT. The formula of discrete Fourier transform is: For a time series , whose discrete Fourier transform Defined as: , in, For historical water quality data, t=0,1,2,…,N-1 ; is the frequency corresponding to the maximum amplitude in the amplitude spectrum, indicating the different frequency components in the signal; is the number of data points, is an imaginary unit; , in, and Respectively The real and imaginary parts of Cyclic and seasonal fluctuations in historical water quality data for: , If a frequency The amplitude is large, indicating that there are periodic and seasonal fluctuations corresponding to this frequency in the original time series.
[0039] Construct an offline model group module to construct an offline model group for surface water quality trend identification consisting of an STL trend identification model, an EMD trend identification model and a Prophet trend identification model, and set the initialization hyperparameters of the model; input historical water quality data into the STL trend identification model for trend identification, and output the long-term trend part of the time series as the trend identification result, which can be implemented based on the STL class in the statsmodels library of python software; input historical water quality data into the EMD trend identification model for trend identification, and output the remaining items as the trend identification result, which can be implemented based on the PyEMD library of python software; input historical water quality data into the Prophet trend identification model for trend identification, and output the trend part as the trend identification result, which can be implemented based on the Prophet library of python software.
[0040] The hyperparameters of the STL trend identification model include the size of the regression window and the length of the seasonal cycle; the hyperparameters of the EMD trend identification model include the number of IMFs for decomposition and the stopping criterion; the hyperparameters of the Prophet trend identification model include the factor controlling the flexibility of the trend change point, the factor controlling the exploration range of the trend change point, the factor controlling the flexibility of the seasonal pattern, and the custom seasonal cycle length, where the periodicity and seasonal fluctuations in historical water quality data They are used as the initial value of the seasonal cycle length for the STL trend identification model and as the initial value of the custom seasonal cycle length for the Prophet trend identification model.
[0041] The formula of the STL trend identification model is: , in, For historical water quality data, is the long-term trend part of the time series, is the seasonal part of the time series, is the residual part of the time series, representing the noise or unexplainable part; The formula of the EMD trend identification model is: , in, For historical water quality data, For the An intrinsic mode function, which reflects the periodicity and local fluctuations of the signal; is the number of eigenmode functions; is the residual term, representing the trend or low-frequency part; The formula of the Prophet trend identification model is: , in, For historical water quality data, For the trend part, a piecewise linear or logistic growth model is used; It is the seasonal part, which is a periodic fluctuation; The holiday effect part is used to deal with the impact of holidays and special events on the data; is the error term.
[0042] Optimize the offline model group module, normalize the STL trend identification results, EMD trend identification results and Prophet trend identification results to obtain the corresponding trend change indicators, and analyze the trend change indicators to obtain the corresponding trend analysis results; evaluate the historical water quality data to obtain the trend reference results, and compare each trend analysis result with the trend reference results. If the trends are inconsistent, adjust and optimize the hyperparameters of the STL trend identification model, the EMD trend identification model and the Prophet trend identification model respectively until the trends are consistent, and obtain the optimized surface water quality trend identification offline model group; multiple groups of historical water quality data can be selected during the optimization process. If the identification results of the surface water quality trend identification offline model group corresponding to more than 80% of the groups of historical water quality data match the trend reference results, it is considered that the optimization of the surface water quality trend identification offline model group is complete.
[0043] In the optimization offline model group module, the trend recognition results of the STL trend recognition model are normalized to obtain trend change indicators, and the trend change indicators are analyzed to obtain trend analysis results, specifically: Taking the long-term trend part of the time series The mean of is used as the benchmark value to calculate the long-term trend of the time series. The difference between adjacent trend values in the data set is divided by the benchmark value to obtain the normalized standard value of the trend component, and then the standard values of the trend components are summed to obtain the STL trend change index. If the STL trend change index is greater than 0, it is considered that there is an upward trend. If the STL trend change index is less than 0, it is considered that there is a downward trend, and the STL trend analysis result is obtained; In the optimization offline model group module, the trend recognition results of the EMD trend recognition model are normalized to obtain trend change indicators, and the trend change indicators are analyzed to obtain trend analysis results, specifically: With the remaining items The mean of is taken as the benchmark value, and the remaining items are calculated The difference between adjacent residual items in the equation is divided by the reference value to obtain the normalized standard value of the trend component. The standard values of the trend components are then summed to obtain the EMD trend change index. If the EMD trend change index is greater than 0, it is considered that there is an upward trend. If the EMD trend change index is less than 0, it is considered that there is a downward trend, and the EMD trend analysis result is obtained. In the optimization offline model group module, the trend identification results of the Prophet trend identification model are normalized to obtain trend change indicators, and the trend change indicators are analyzed to obtain trend analysis results, specifically: By trend section The mean of is taken as the base value and the trend part is calculated The difference between adjacent trend values in the Prophet is divided by the reference value to obtain the normalized standard value of the trend component. The standard values of the trend components are then summed to obtain the Prophet trend change index. If the Prophet trend change index is greater than 0, it is considered that there is an upward trend. If the Prophet trend change index is less than 0, it is considered that there is a downward trend, and the Prophet trend analysis result is obtained. Optimize the offline model group module to obtain trend reference results, specifically: historical water quality data The data is split into three segments on average, and the median of each segment is calculated. The median of the second segment is used as the reference value, and the difference between two adjacent segments is calculated. The difference is divided by the reference value to obtain the standard value. The standard values are summed. If the sum is greater than 0.2, it is considered that there is an upward trend. If the sum is less than -0.2, it is considered that there is a downward trend. The trend reference result is obtained.
[0044] The real-time data acquisition module dynamically acquires the real-time water quality data of the surface target monitoring station once every 24 hours. The real-time water quality data includes but is not limited to water temperature, dissolved oxygen, turbidity, total phosphorus, total nitrogen, chemical oxygen demand and ammonia nitrogen. According to different time granularity requirements, such as 3 days, 7 days or 30 days, the collected real-time water quality data is divided into time periods and pre-processed. Preprocessing includes missing value filling and outlier detection and correction. Missing value filling can be done by interpolation methods, such as linear interpolation or spline interpolation, or by using known data from previous and subsequent time periods to ensure data continuity and integrity. This can be implemented based on the NumPy library of python software. Outlier detection and correction uses statistical methods to detect abnormal points that deviate significantly from normal values, and corrects them according to the aforementioned missing value filling algorithm. Statistical methods, such as the Z-Score or IQR method, can be implemented based on the SciPy library of python software.
[0045] The qualitative analysis module is used to apply the Mann-Kendall algorithm to the pre-processed real-time water quality data to conduct qualitative analysis of the water quality change trend. If there is a monotonic trend, it will be transferred to the quantitative analysis module. If there is no monotonic trend, the identification and warning will be terminated. In the qualitative analysis module, the Mann-Kendall statistic is first calculated to measure the trend direction between data points in the time series. , can be calculated based on the pymannkendall library of python software, The positive or negative direction of the value reflects the upward or downward trend of the time series data. The absolute value reflects the significance of the trend and can quantify the monotonic trend of the time series. Mann-Kendall statistic The formula is: , in, ; It is the real-time water quality time series data after preprocessing; is the number of real-time water quality data samples; The first values; is a symbolic function; Then calculate The variance is used to assess the degree of random fluctuation between data points. The calculation formula for the variance is: , Then calculate the Mann-Kendall statistic to assess whether the water quality trend is significant , the formula is as follows: , Based on the calculated By comparing the value with the critical value, the significance of the water quality trend can be judged; if ∣>1.96, it is considered that there is a significant upward or downward trend in water quality changes; if ∣ ∣<1.96, it is believed that the water quality data has no significant upward or downward trend, but rather random fluctuations.
[0046] The quantitative analysis module is used to quantitatively analyze the water quality change trend using the optimized offline model group for surface water quality trend identification, input the preprocessed real-time water quality data into the STL trend identification model, the EMD trend identification model and the Prophet trend identification model for trend identification, and output the long-term trend part of the time series as the STL trend identification result, output the remaining item as the EMD trend identification result, and output the trend part as the Prophet trend identification result; the STL trend identification result, the EMD trend identification result and the Prophet trend identification result are normalized to obtain the STL trend change index, the EMD trend change index and the Prophet trend change index; A comprehensive index calculation module is used to obtain a comprehensive water quality change index through weighted fusion calculation based on the STL trend change index, the EMD trend change index and the Prophet trend change index; The formula for weighted fusion calculation is as follows: , in, It is a comprehensive water quality change indicator. is the weight of the STL trend identification model, is the weight of the EMD trend identification model, is the weight of the Prophet trend identification model, It is the STL trend change indicator. It is the EMD trend change indicator. It is the Prophet trend change indicator; Take 0.3, Take 0.3, is 0.4.
[0047] The graded warning module is used to quantify the water quality change trend level and generate corresponding warning information based on the comprehensive water quality change index. Based on the comprehensive water quality change index, the water quality change trend is quantified and divided into different levels. When the comprehensive water quality change index is less than -0.4, the water quality trend change result is divided into the first level; when the comprehensive water quality change index is between -0.4 and -0.25, the water quality trend change result is divided into the second level; when the comprehensive water quality change index is between -0.25 and 0.25, the water quality trend change result is divided into the third level; when the comprehensive water quality change index is between 0.25 and 0.4, the water quality trend change result is divided into the fourth level; when the comprehensive water quality change index is greater than 0.4, the water quality trend change result is divided into the fifth level; generate corresponding warning information, the warning information includes the monitoring site name, index, time period and water quality change trend level.
[0048] Embodiment 3: Another embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement an online identification and early warning method for water quality change trends as described above.
[0049] like Figure 3 As shown, the electronic device 10 may include: a processor 100, a memory 101, a bus 102 and a communication interface 103, wherein the processor 100, the communication interface 103 and the memory 101 are connected via the bus 102; the memory 101 stores a computer program that can be run on the processor 100, and when the processor 100 runs the computer program, an online identification and early warning method for water quality change trends provided in any of the aforementioned embodiments of the present invention is executed.
[0050] The memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the device network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0051] The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 101 is used to store a program, and the processor 100 executes the program after receiving an execution instruction. The method for online identification and early warning of water quality change trend disclosed in any implementation of the above-mentioned embodiment of the present invention may be applied to the processor 100, or implemented by the processor 100.
[0052] The processor 100 may be an integrated circuit chip having the ability to process signals. Each step of the method can be completed by an integrated logic circuit of hardware in the processor 100 or an instruction in the form of software. The above-mentioned processor 100 can be a general-purpose processor, which may include a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the above method in combination with its hardware.
[0053] The electronic device provided in the embodiment of the present application and the method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, operated or implemented by them.
[0054] Embodiment 4: Another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the method of any of the above embodiments. Figure 4 As shown, the computer-readable storage medium shown is a CD 20 on which a computer program (ie, a program product) is stored. When the computer program is run by a processor, the method provided by any of the aforementioned embodiments will be executed.
[0055] It should be noted that examples of computer-readable storage media may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.
[0056] The computer-readable storage medium provided in the above-mentioned embodiments of the present application and the method provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.
[0057] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A method for online identification and early warning of water quality change trends, characterized in that: The steps include: (1) Obtain historical water quality data from target surface monitoring sites and identify periodic and seasonal fluctuations in historical water quality data ; (2) Construct an offline model group for surface water quality trend identification consisting of the STL trend identification model, the EMD trend identification model, and the Prophet trend identification model, and set the initialization hyperparameters of the model; The historical water quality data are input into the STL trend identification model, EMD trend identification model and Prophet trend identification model for trend identification, and the long-term trend part of the time series is output. Output of the remaining items as STL trend recognition results As the result of EMD trend identification, the trend part is output As a result of Prophet trend identification; (3) Normalize the STL trend identification results, EMD trend identification results, and Prophet trend identification results to obtain corresponding trend change indicators, and analyze the trend change indicators to obtain corresponding trend analysis results; Evaluate historical water quality data to obtain trend reference results, compare each trend analysis result with the trend reference result, and if the trends are inconsistent, adjust and optimize the hyperparameters of the STL trend identification model, EMD trend identification model, and Prophet trend identification model respectively until the trends are consistent, and then obtain the optimized surface water quality trend identification offline model group; (4) Dynamically obtain real-time water quality data from surface target monitoring stations, divide the collected real-time water quality data into time periods according to different time granularity requirements, and pre-process the real-time water quality data; (5) Apply the Mann-Kendall algorithm to conduct a qualitative analysis of the water quality change trend of the pre-processed real-time water quality data. If a monotonic trend exists, proceed to step (6); if no monotonic trend exists, end the identification and warning; (6) The optimized offline model group for surface water quality trend identification is used to quantitatively analyze the water quality change trend. The preprocessed real-time water quality data is input into the STL trend identification model, the EMD trend identification model and the Prophet trend identification model for trend identification. The long-term trend part of the time series is output as the STL trend identification result, the residual item is output as the EMD trend identification result, and the trend part is output as the Prophet trend identification result. The STL trend identification results, EMD trend identification results and Prophet trend identification results are normalized respectively to obtain the STL trend change index, EMD trend change index and Prophet trend change index; (7) Based on the STL trend change index, EMD trend change index and Prophet trend change index, a comprehensive water quality change index is obtained through weighted fusion calculation; (8) Based on the comprehensive water quality change indicators, quantify the water quality change trend level and generate corresponding early warning information.
2. The method for online identification and early warning of water quality change trend according to claim 1, characterized in that: The specific method for identifying the periodicity and seasonal fluctuations in the historical water quality data in step (1) is: The frequency domain characteristics of historical water quality data are analyzed by discrete Fourier transform DFT. The formula of discrete Fourier transform is: For a time series , whose discrete Fourier transform Defined as: , in, For historical water quality data, t=0,1,2,…,N-1 ; is the frequency corresponding to the maximum amplitude in the amplitude spectrum, indicating the different frequency components in the signal; is the number of data points, is an imaginary unit; , in, and Respectively The real and imaginary parts of Cyclic and seasonal fluctuations in historical water quality data for: 。 3. The method for online identification and early warning of water quality change trend according to claim 1, characterized in that: The hyperparameters of the STL trend identification model in step (2) include the size of the regression window and the length of the seasonal cycle; The hyperparameters of the EMD trend identification model include the number of IMFs to be decomposed and the stopping criterion; the hyperparameters of the Prophet trend identification model include the factor controlling the flexibility of the trend change point, the factor controlling the exploration range of the trend change point, the factor controlling the flexibility of the seasonal pattern, and the custom seasonal cycle length, where the periodic and seasonal fluctuations in historical water quality data They are used as the initial value of the seasonal cycle length for the STL trend identification model and as the initial value of the custom seasonal cycle length for the Prophet trend identification model.
4. The method for online identification and early warning of water quality change trend according to claim 1, characterized in that: The formula of the STL trend identification model in step (2) is: , in, For historical water quality data, is the long-term trend part of the time series, is the seasonal part of the time series, is the residual part of the time series, representing the noise or unexplainable part; The formula of the EMD trend identification model is: , in, For historical water quality data, For the An intrinsic mode function, which reflects the periodicity and local fluctuations of the signal; is the number of eigenmode functions; is the residual term, representing the trend or low-frequency part; The formula of the Prophet trend identification model is: , in, For historical water quality data, For the trend part, a piecewise linear or logistic growth model is used; It is the seasonal part, which is a periodic fluctuation; The holiday effect part is used to deal with the impact of holidays and special events on the data; is the error term.
5. The method for online identification and early warning of water quality change trend according to claim 1, characterized in that: The specific steps of normalizing the trend recognition result of the STL trend recognition model in step (3) to obtain a trend change index, and analyzing the trend change index to obtain a trend analysis result are: Taking the long-term trend part of the time series The mean of is used as the benchmark value to calculate the long-term trend of the time series. The difference between adjacent trend values in the data set is divided by the benchmark value to obtain the normalized standard value of the trend component, and then the standard values of the trend components are summed to obtain the STL trend change index. If the STL trend change index is greater than 0, it is considered that there is an upward trend. If the STL trend change index is less than 0, it is considered that there is a downward trend, and the STL trend analysis result is obtained; The specific steps of normalizing the trend identification results of the EMD trend identification model to obtain the trend change index and analyzing the trend change index to obtain the trend analysis results are as follows: With the remaining items The mean of is taken as the benchmark value, and the remaining items are calculated The difference between adjacent residual items in the equation is divided by the reference value to obtain the normalized standard value of the trend component. The standard values of the trend components are then summed to obtain the EMD trend change index. If the EMD trend change index is greater than 0, it is considered that there is an upward trend. If the EMD trend change index is less than 0, it is considered that there is a downward trend, and the EMD trend analysis result is obtained. The specific steps of normalizing the trend identification results of the Prophet trend identification model to obtain the trend change index and analyzing the trend change index to obtain the trend analysis results are as follows: By trend section The mean of is taken as the base value and the trend part is calculated The difference between adjacent trend values in the Prophet is divided by the reference value to obtain the normalized standard value of the trend component. The standard values of the trend components are then summed to obtain the Prophet trend change index. If the Prophet trend change index is greater than 0, it is considered that there is an upward trend. If the Prophet trend change index is less than 0, it is considered that there is a downward trend, and the Prophet trend analysis result is obtained. The specific steps for determining the trend reference results are: The data is split into three segments on average, and the median of each segment is calculated. The median of the second segment is used as the reference value, and the difference between two adjacent segments is calculated. The difference is divided by the reference value to obtain the standard value. The standard values are summed. If the sum is greater than 0.2, it is considered that there is an upward trend. If the sum is less than -0.2, it is considered that there is a downward trend. The trend reference result is obtained.
6. The method for online identification and early warning of water quality change trend according to claim 1, characterized in that: The step (5) specifically includes the following steps: (5.1) Calculate the Mann-Kendall statistic, which is used to measure the direction of the trend between data points in a time series. , The positive or negative direction of the value reflects the upward or downward trend of the time series data. The absolute value reflects the significance of the trend and can quantify the monotonic trend of the time series. Mann-Kendall statistic The formula is: , in, ; It is the real-time water quality time series data after preprocessing; is the number of real-time water quality data samples; The first values; is a symbolic function; (5.2) Calculation The variance is used to assess the degree of random fluctuation between data points. The calculation formula for the variance is: , (5.3) Calculate the Mann-Kendall statistic to assess whether the water quality trend is significant , the formula is as follows: , (5.4) Based on the calculation By comparing the value with the critical value, the significance of the water quality trend can be judged; If ∣>1.96, it is considered that there is a significant upward or downward trend in water quality changes; if ∣ ∣<1.96, it is believed that the water quality data has no significant upward or downward trend, but rather random fluctuations.
7. The method for online identification and early warning of water quality change trend according to claim 1, characterized in that: The step (8) specifically includes the following steps: When the comprehensive water quality change index is less than -0.4, the water quality trend change result is classified as the first level; when the comprehensive water quality change index is between -0.4 and -0.25, the water quality trend change result is classified as the second level; when the comprehensive water quality change index is between -0.25 and 0.25, the water quality trend change result is classified as the third level; when the comprehensive water quality change index is between 0.25 and 0.4, the water quality trend change result is classified as the fourth level; when the comprehensive water quality change index is greater than 0.4, the water quality trend change result is classified as the fifth level; Generate corresponding early warning information, which includes monitoring site name, indicators, time period and water quality change trend level.
8. An online recognition and early warning system for surface water quality change trends, characterized in that: Includes a historical data acquisition module for historical water quality data from surface target monitoring sites and identifies periodic and seasonal fluctuations in historical water quality data ; Construct an offline model group module, which is used to construct an offline model group for surface water quality trend identification consisting of an STL trend identification model, an EMD trend identification model, and a Prophet trend identification model, and set the initialization hyperparameters of the model; The historical water quality data are input into the STL trend identification model, EMD trend identification model and Prophet trend identification model for trend identification, and the long-term trend part of the time series is output. Output of the remaining items as STL trend recognition results As the result of EMD trend identification, the trend part is output As a result of Prophet trend identification; Optimize the offline model group module to normalize the STL trend recognition results, EMD trend recognition results and Prophet trend recognition results to obtain the corresponding trend change indicators, and analyze the trend change indicators to obtain the corresponding trend analysis results; Evaluate historical water quality data to obtain trend reference results, compare each trend analysis result with the trend reference result, and if the trends are inconsistent, adjust and optimize the hyperparameters of the STL trend identification model, EMD trend identification model, and Prophet trend identification model respectively until the trends are consistent, and then obtain the optimized surface water quality trend identification offline model group; The real-time data acquisition module is used to dynamically acquire the real-time water quality data of the surface target monitoring station, divide the collected real-time water quality data into time periods according to different time granularity requirements, and pre-process the real-time water quality data; The qualitative analysis module is used to apply the Mann-Kendall algorithm to the pre-processed real-time water quality data to conduct qualitative analysis of the water quality change trend. If there is a monotonic trend, it will be transferred to the quantitative analysis module. If there is no monotonic trend, the identification and warning will be terminated. The quantitative analysis module is used to use the optimized offline model group for trend identification of surface water quality to conduct quantitative analysis of water quality change trends, input the preprocessed real-time water quality data into the STL trend identification model, the EMD trend identification model and the Prophet trend identification model for trend identification, and output the long-term trend part of the time series as the STL trend identification result, output the remaining item as the EMD trend identification result, and output the trend part as the Prophet trend identification result; The STL trend identification results, EMD trend identification results and Prophet trend identification results are normalized respectively to obtain the STL trend change index, EMD trend change index and Prophet trend change index; A comprehensive index calculation module is used to obtain a comprehensive water quality change index through weighted fusion calculation based on the STL trend change index, the EMD trend change index and the Prophet trend change index; The graded warning module is used to quantify the level of water quality change trends and generate corresponding warning information based on comprehensive water quality change indicators.
9. An electronic device, characterized in that: It comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement an online identification and early warning method for water quality change trends as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program is executed by a processor to implement an online identification and early warning method for water quality change trends as described in any one of claims 1-7.
Citation Information
Patent Citations
Vegetation monotone change trend detection method and related equipment
CN108388866A
Water consumption trend prediction method and system based on wavelet analysis and hybrid model
CN114925891A
Deep learning quantile water quality prediction method based on trend decomposition
CN117689081A
Water quality trend extraction method and system
KR1020100081088A
Cited By
Intelligent supervision and control system for steam recompression mother liquor wastewater treatment
CN120085552A
Water environment on-line monitoring system
CN120106693A
A water environment online monitoring system
CN120106693B
Hydrological element change trend comprehensive analysis system and method
CN121117459A
Hydrological element change trend comprehensive analysis system and method
CN121117459B