Water quality index prediction method, system and equipment and storage medium
Through the wavelet transformation and graph learning module, the multi-scale frequency representation and global relationship information of water quality data are analysed, which solves the shortcomings of existing water quality prediction methods in frequency domain information processing and time-dependent relationship capture, and improves the accuracy and long-term prediction capabilities of water quality indicator prediction.
Patent Information
- Application Number
- CN202510255465.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-06-20
AI Technical Summary
Existing water quality prediction methods have shortcomings in treating frequency domain information of water quality data and capturing complex time dependencies, resulting in limited prediction accuracy and long-term prediction capabilities.
The wavelet transformation is used to decompose the time series of water quality data into multi-scale frequency representations, and the global relationship information between water quality indicators is analyzed through the graph learning module, a water quality indicator relationship chart is constructed, and the multi-scale wavelet coefficient of water quality indicators is predicted in the future time.
By capturing the potential correlation between complex time dependencies and utilizing water quality indicators, the accuracy and long-term prediction capabilities of water quality indicators are improved.
Smart Images

Figure CN120183556A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water quality data monitoring, and particularly to a water quality index prediction method, system, device and storage medium. Background Art
[0002] Surface water is an indispensable part of human life and production. The management and protection of surface water are crucial for maintaining the sustainable utilization of water resources and ecological balance. With the development of Internet of Things technology and the popularization of water quality monitoring stations, by modeling a large amount of multi-index high-frequency water quality data collected by sensors, complex features can be extracted and the changing trend of water quality can be analyzed. Water quality prediction plays an important role in environmental monitoring, sustainable development of ecosystem and aquaculture by scientifically and efficiently analyzing water quality indicators to accurately predict future trends. Water quality indicators include biological indicators, physical indicators and chemical indicators. Biological indicators include algae, fecal coliforms, etc.; physical indicators include pH value, water temperature, turbidity, etc.; chemical indicators include dissolved oxygen, ammonia nitrogen content, biological oxygen demand, etc. By predicting multi-index water quality data for a period of time in the future, the water quality pollution status can be timely warned and corresponding preventive measures can be taken as early as possible. Water quality prediction algorithms can help monitor water quality, predict future trends of water quality, and assist in better managing water resources and coping with emergencies.
[0003] Although existing water quality prediction methods have achieved many research results and meet the requirements of water quality prediction to a certain extent, a large number of studies show that there are still some problems and challenges in existing water quality prediction methods:
[0004] (1) Water quality data has slow time-varying and strong periodicity. Fine-grained mining of the time-dependent relationship of water quality data has always been the focus of water quality index prediction work. Many models usually ignore the frequency domain information of data in the modeling process, and insufficient mining of the complex time-dependent relationship of water quality data will bring difficulties to prediction.
[0005] (2) Due to the complexity of water environment quality, there are often potential correlations and influences between different water quality indicators. At present, most models lack clear modeling of the dependence relationship between multiple water quality indicators, so it is difficult to further improve the accuracy of water quality prediction.
[0006] (3) At present, many water quality prediction models focus on short sequence prediction, and their long-term water quality prediction ability is limited and cannot meet the requirements in actual prediction tasks. Summary of the Invention
[0007] This application aims to at least solve the technical problems existing in the prior art, and provides a water quality index prediction method, system, device and storage medium.
[0008] In a first aspect, a water quality index prediction method provided by the present invention includes:
[0009] Obtain a time series of water quality data including multiple water quality indices;
[0010] Perform wavelet transform on the time series of water quality data to obtain a multi-scale frequency representation of the time series of water quality data;
[0011] Analyze the time series of water quality data to obtain global relationship information between multiple water quality indices;
[0012] Predict the multi-scale wavelet coefficients of water quality indices at future times according to the global relationship information and the multi-scale frequency representation, and convert the multi-scale wavelet coefficients into time-domain signals to obtain the predicted values of the future time series.
[0013] Optionally, the time series of water quality data includes multiple subsequences of water quality indices; the analyzing the time series of water quality data to obtain global relationship information between multiple water quality indices includes:
[0014] Analyze the time series of water quality data to obtain the correlation relationships between multiple subsequences of water quality indices;
[0015] Construct a water quality index relationship graph according to the correlation relationships between multiple subsequences of water quality indices to obtain global relationship information; the water quality index relationship graph includes at least two nodes, and adjacent nodes are connected by edges, where the nodes represent subsequences of water quality indices and the edges represent the correlation relationships between the corresponding subsequences of water quality indices of adjacent nodes.
[0016] Optionally, represent the correlation relationships of neighbor nodes in the water quality index relationship graph through a graph adjacency matrix;
[0017] The calculation expression of the graph adjacency matrix is
[0018] W1 represents the variable representation obtained from the feature embedding corresponding to node m1 in the water quality index relationship graph, W2 represents the variable representation obtained from the feature embedding corresponding to node m2 in the water quality index relationship graph, m 1≠ m2, represents the transpose of W1, represents the transpose of W2, tanh(.) is the hyperbolic tangent function, relu(.) is the activation function, and α is a hyperparameter used to control the saturation rate of the activation function.
[0019] Optionally, the performing wavelet transform on the time series of water quality data to obtain a multi-scale frequency representation of the time series of water quality data includes:
[0020] For each subsequence of water quality indicators, use multi-level discrete wavelet to decompose the subsequence of water quality indicators layer by layer to obtain multi-layer low-frequency sequences and multi-layer high-frequency sequences. The multi-layer low-frequency sequences include low-frequency subsequences at multiple levels, and the multi-layer high-frequency sequences include high-frequency subsequences at multiple levels;
[0021] Extract the features of the low-frequency subsequences at multiple levels respectively to obtain low-frequency wavelet features at multiple levels;
[0022] Extract the features of the high-frequency subsequences at multiple levels respectively to obtain high-frequency wavelet features at multiple levels;
[0023] Fuse the low-frequency wavelet features at multiple levels and the high-frequency wavelet features at multiple levels to obtain a multi-scale frequency sub-representation of the subsequence of water quality indicators;
[0024] Integrate the multi-scale frequency sub-representations of multiple subsequences of water quality indicators to obtain a multi-scale frequency representation of the time series of water quality data.
[0025] Optionally, use multi-level discrete wavelet to decompose the subsequence of water quality indicators layer by layer to obtain multi-layer low-frequency sequences and multi-layer high-frequency sequences, including:
[0026] Select a wavelet basis according to the subsequence of water quality indicators and set the decomposition level j of the discrete wavelet transform, where j is a positive integer;
[0027] Decompose the subsequence of water quality indicators layer by layer. In each layer, input the input signal into a low-pass filter for convolution operation to obtain the low-frequency subsequence of the current layer, and input the input signal into a high-pass filter for convolution operation to obtain the high-frequency subsequence of the current layer. The input signal of the first layer is the subsequence of water quality indicators, and the input signal of the kth layer is the low-frequency subsequence output by the (k - 1)th layer, where the value range of k is [2, j] and k is a positive integer;
[0028] Integrate the low-frequency subsequences output by j decomposition layers to obtain multi-layer low-frequency sequences;
[0029] Integrate the high-frequency subsequences output by j decomposition layers to obtain multi-layer high-frequency sequences.
[0030] Optionally, use multiple dilated convolutional filters with different kernel sizes to capture the wavelet coefficient features of the high-frequency subsequences to obtain high-frequency wavelet features;
[0031] Use multiple dilated convolutional filters with different kernel sizes to capture the wavelet coefficient features of the low-frequency subsequences to obtain low-frequency wavelet features.
[0032] Optionally, predicting the multi-scale wavelet coefficients of the water quality indicators at future times according to the global relationship information and the multi-scale frequency representation, and converting the multi-scale wavelet coefficients into a time-domain signal to obtain the predicted values of the future time series, including:
[0033] Process the water quality index relationship graph using a graph convolutional layer, and transfer the local information corresponding to each node to all nodes in the water quality index relationship graph structure;
[0034] Update the frequency representation of each node in the water quality index relationship graph according to the multi-scale frequency representation to obtain the multi-scale wavelet coefficients of the future time series;
[0035] Convert the multi-scale wavelet coefficients into a time-domain signal to obtain the predicted values of the future time series.
[0036] To solve the above problems, the present invention also provides a water quality index prediction system, which includes:
[0037] An acquisition module for acquiring a time series of water quality data containing multiple water quality indices;
[0038] A multi-level wavelet decomposition module for performing wavelet transform on the time series of water quality data to obtain the multi-scale frequency representation of the time series of water quality data;
[0039] A graph learning module for analyzing the time series of water quality data to obtain the global relationship information between multiple water quality indices;
[0040] A graph prediction module for predicting the multi-scale wavelet coefficients of water quality indices at future times according to the global relationship information and the multi-scale frequency representation;
[0041] A conversion module for converting the multi-scale wavelet coefficients into a time-domain signal to obtain the predicted values of the future time series.
[0042] To solve the above problems, the present invention also provides an electronic device, which includes:
[0043] At least one processor; and,
[0044] A memory communicatively connected to the at least one processor; wherein,
[0045] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned water quality index prediction method.
[0046] To solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is executed by a processor in an electronic device to implement the above-mentioned water quality index prediction method.
[0047] In summary, the present application includes the following beneficial technical effects:
[0048] By decomposing the water quality data time series into multiple high-frequency components and low-frequency components through wavelet transform, a multi-scale frequency representation of the water quality data time series can be obtained, enabling the capture of complex time-dependent relationships. During the prediction of new data, the potential correlations between water quality indicators in the water quality data time series are utilized to predict wavelet coefficients at different levels, making the predicted values of the future time series obtained ultimately more accurate and improving the accuracy of water quality indicator prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a schematic flowchart of the water quality indicator prediction method provided by an embodiment of the present invention;
[0050] Figure 2 It is a schematic diagram of data multi-frequency decomposition based on multi-level wavelet decomposition provided by an embodiment of the present invention;
[0051] Figure 3 It is a model diagram based on multi-level wavelet decomposition and the graph convolution part provided by an embodiment of the present invention;
[0052] Figure 4 It is a schematic diagram of the graph convolution and hybrid skip propagation layer in the graph prediction module provided by an embodiment of the present invention;
[0053] Figure 5 It is a schematic overall flowchart represented by modules in the water quality indicator prediction system provided by an embodiment of the present invention;
[0054] Figure 6 It is a schematic structural diagram of an electronic device for implementing the water quality indicator prediction method provided by an embodiment of the present invention.
[0055] Reference Numerals: 10, processor; 11, memory; 12, communication bus; 13, communication interface.
[0056] The realization, functional characteristics, and advantages of the objectives of the present invention will be further described in conjunction with the embodiments with reference to the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0057] The embodiments of the present invention will be described in detail below. The examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions from beginning to end. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present invention and should not be construed as a limitation to the present invention.
[0058] In the description of the present invention, it should be understood that the orientation or positional relationships indicated by the terms "longitudinal", "lateral", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. are based on the orientation or positional relationships shown in the drawings. These are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to the present invention.
[0059] In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "installation", "connection", and "coupling" should be understood in a broad sense. For example, it can be a mechanical connection or an electrical connection, or it can be the communication inside two elements. It can be directly connected or indirectly connected through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms can be understood according to specific circumstances.
[0060] Refer to Figure 1 As shown, it is a schematic flowchart of the water quality index prediction method provided by an embodiment of the present invention. In this embodiment, the water quality index prediction method includes:
[0061] S1. Obtain a time series of water quality data including multiple water quality indices.
[0062] Specifically, the time series of water quality data is a set of water quality indices of multiple variables monitored and observed within time T. The time series of water quality data includes multiple water quality index subsequences. In this embodiment, the water quality indices include monitoring time, water temperature (WT, unit: °C), pH value (dimensionless), dissolved oxygen (DO, unit: mg / L), conductivity (Cond, unit: μS / cm), turbidity (TUR, unit: NTU), permanganate index (CODMn, unit: mg / L), ammonia nitrogen content (NH3-N, unit: mg / L), total phosphorus content (TP, unit: mg / L), and total nitrogen content (TN, unit: mg / L), etc.
[0063] In this embodiment, the time series of water quality data is expressed as X = {X(1), X(2),..., X(i),..., X(t)}, where X(1) represents the first water quality index monitored within time T, X(i) represents the i-th water quality index monitored within time T, X(t) represents the t-th water quality index monitored within time T, i represents the index of the water quality index subsequence; t represents the total number of water quality indices monitored within time T;
[0064] The time series of water quality data can be manually input by the staff, imported by external devices, or obtained through the cloud platform. This embodiment does not make any restrictions.
[0065] S2. Perform wavelet transform on the water quality data time series to obtain the multi-scale frequency representation of the water quality data time series.
[0066] In this embodiment, the discrete wavelet transform is used to decompose the water quality data time series into multi-level low-frequency components and high-frequency components, so as to extract the features and details of the data at different scales.
[0067] Refer to Figure 2 , perform wavelet transform on the water quality data time series to obtain the multi-scale frequency representation of the water quality data time series, including:
[0068] S21. For each water quality index subsequence, use the multi-level discrete wavelet to decompose the water quality index subsequence layer by layer to obtain a multi-layer low-frequency sequence and a multi-layer high-frequency sequence.
[0069] The multi-layer low-frequency sequence includes multiple levels of low-frequency subsequences, and the multi-layer high-frequency sequence includes multiple levels of high-frequency subsequences.
[0070] Specifically, using the multi-level discrete wavelet to decompose the water quality index subsequence layer by layer to obtain a multi-layer low-frequency sequence and a multi-layer high-frequency sequence, including:
[0071] Select a wavelet basis according to the water quality index subsequence, and set the decomposition level j of the discrete wavelet transform. j is a positive integer, usually taking values from 3 to 5;
[0072] Decompose the water quality index subsequence layer by layer. In each layer, input the input signal into the low-pass filter for convolution operation to obtain the low-frequency subsequence of the current layer, and input the input signal into the high-pass filter for convolution operation to obtain the high-frequency subsequence of the current layer. The input signal of the first layer is the water quality index subsequence, and the input signal of the kth layer is the low-frequency subsequence output by the (k - 1)th layer, where the value range of k is [2, j], and k is a positive integer;
[0073] Integrate the low-frequency subsequences output by j decomposition layers to obtain a multi-layer low-frequency sequence;
[0074] Integrate the high-frequency subsequences output by j decomposition layers to obtain a multi-layer high-frequency sequence.
[0075] S22. Extract the features of the low-frequency subsequences at multiple levels respectively to obtain the low-frequency wavelet features at multiple levels.
[0076] S23. Extract the features of the high-frequency subsequences at multiple levels respectively to obtain the high-frequency wavelet features at multiple levels.
[0077] Use multiple dilated convolutional filters with different kernel sizes to capture the wavelet coefficient features of the high-frequency subsequences to obtain the high-frequency wavelet features;
[0078] Use multiple dilated convolutional filters with different kernel sizes to capture the wavelet coefficient features of the low-frequency subsequence, and obtain the low-frequency wavelet features.
[0079] S24. Fuse the low-frequency wavelet features at multiple levels and the high-frequency wavelet features at multiple levels to obtain the multi-scale frequency sub-representation of the water quality index subsequence.
[0080] S25. Integrate the multi-scale frequency sub-representations of multiple water quality index subsequences to obtain the multi-scale frequency representation of the water quality data time series.
[0081] Refer to Figure 2 , in this embodiment, the decomposition process of the discrete wavelet transform is as follows:
[0082] Step 1. Initial data decomposition.
[0083] Input data: At the beginning, the input data is the water quality index subsequence x.
[0084] Low-frequency filtering and high-frequency filtering: First, decompose through a low-frequency filter and a high-frequency filter to obtain the low-frequency component a l (1) and the high-frequency component a h (1).
[0085] The low-frequency part a l (1) contains the rough features (low-frequency information) of the signal, that is, the general trend of the signal.
[0086] The high-frequency part a h (1) contains the detailed information (high-frequency information) of the signal, such as edges and high-frequency fluctuations.
[0087] Step 2. Downsampling processing.
[0088] Average pooling (downsampling): By performing average pooling or downsampling on the low-frequency and high-frequency parts, reduce the resolution of the signal and reduce the data volume.
[0089] The low-frequency part a l (1) and the high-frequency part a h (1) respectively undergo pooling operations to obtain the downsampled low-frequency part x l (1) and the downsampled high-frequency part x h (1), making the processing of subsequent layers more efficient and reducing the computational amount.
[0090] Step 3. Recursive decomposition.
[0091] Recursive application: Use the downsampled low-frequency part x l (1) as the input signal of the next layer of wavelet transform and continue to decompose:
[0092] For the downsampled low-frequency part xl (1) Perform the same low - frequency and high - frequency filtering to obtain a more refined low - frequency component a l (2) and a more refined high - frequency component a h (2).
[0093] This recursive process further refines the signal to obtain low - frequency and high - frequency information at multiple levels.
[0094] Step 4: Decompose layer by layer.
[0095] Output data: After several layers of decomposition, the final output is the low - frequency and high - frequency parts at each level, representing the information of the signal at different scales.
[0096] S3. Analyze the water quality data time series to obtain the global relationship information among multiple water quality indicators.
[0097] The steps to analyze the water quality data time series to obtain the global relationship information among multiple water quality indicators include:
[0098] Analyze the water quality data time series to obtain the correlation relationship among multiple water quality indicator subsequences;
[0099] Refer to Figure 3 , construct a water quality indicator relationship graph based on the correlation relationship among multiple water quality indicator subsequences to obtain the global relationship information; the water quality indicator relationship graph includes at least two nodes, and adjacent nodes are connected by edges. The nodes represent water quality indicator subsequences, and the edges represent the correlation relationship between the water quality indicator subsequences corresponding to the adjacent nodes.
[0100] To learn and represent the hidden relationships between different water quality indicators, the present invention designs a graph learning module to learn the relationships between nodes. The calculation method of the graph adjacency matrix is as follows:
[0101] Among them, W1 represents the variable representation obtained from the feature embedding corresponding to node m1 in the water quality indicator relationship graph, W2 represents the variable representation obtained from the feature embedding corresponding to node m2 in the water quality indicator relationship graph, m 1≠ m2, represents the transpose of W1, represents the transpose of W2, tanh(.) is the hyperbolic tangent function, relu(.) is the non - linear activation function, and α is a hyperparameter used to control the saturation rate of the activation function; apply the hyperbolic tangent function tanh to perform element - by - element operations on the matrix product. Each element in A represents the correlation weight between two variables. First, calculate the matrix product, then apply the hyperbolic tangent function tanh to the difference between the two, and finally apply the relu activation function. The relu function sets all negative values in the matrix to 0 and keeps positive values unchanged.
[0102] The calculation formulas for W1 and W2 are as follows:
[0103] W1 = tanh(αE1Φ1)
[0104] W2 = tanh(αE2Φ2)
[0105] Where, E1 represents the embedding variable of node m1 initialized randomly, and E2 represents the embedding variable of node m1 initialized randomly. In other words, E1 and E2 are the nodes after assigning each node / variable an integer scalar. Let N = {1, 2,..., N} represent the index set of nodes / variables, E1 = E1(N) ∈ R N×d , E2 = E2(N) ∈ R N×d , d represents the dimension, and both Φ1 and Φ2 are model parameters.
[0106] S4. Predict the multi-scale wavelet coefficients of water quality indicators at future time according to the global relationship information and multi-scale frequency representation, and convert the multi-scale wavelet coefficients into time-domain signals to obtain the predicted values of the future time series.
[0107] Refer to Figure 3 , step S4 includes:
[0108] S41. Use the graph convolutional layer to process the water quality indicator relationship graph, and transfer the local information corresponding to each node to all nodes in the water quality indicator relationship graph structure;
[0109] S42. Update the frequency representation of each node in the water quality indicator relationship graph according to the multi-scale frequency representation to obtain the multi-scale wavelet coefficients of the future time series;
[0110] S43. Convert the multi-scale wavelet coefficients into time-domain signals to obtain the predicted values of the future time series.
[0111] Refer to Figure 3 and Figure 4 , specifically, we use the Mixhop layer proposed by (Abu-El-Haija et al., 2019; Wu et al., 2020) to capture the complex relationships of neighbors. The MixHop layer is a mixed jump propagation layer used to alleviate the over-smoothing problem in graph convolution; the structural diagram of the graph convolution module is as Figure 4 (a) shown. The graph convolution module consists of two mixed jump propagation layers, and the specific structure of the mixed jump propagation layer is as Figure 4 (b). The MixHop layer includes two main steps: message propagation and message aggregation. These two steps recursively transfer the local formation to the nodes in the global graph structure. Given that the adjacency matrix A represents the process of k-layer mixed jumps as follows:
[0112]
[0113] Among them, β is a hyperparameter used to control the proportion of retaining the original state of the root node.
[0114]
[0115] Among them, k represents the propagation depth, and H (k) represents performing mixed-hop processing at the k-th layer, and H in represents the input hidden state of the output of the previous layer, and H out is the output hidden state of the current layer, H1 = H in . β can control the proportion of information retained from the previous representation, which helps to alleviate the over-smoothing problem. Next, two MixHop layers are used to obtain detailed information by separately processing the information flow through the nodes and the output information. The meaning of the MixHop layer is the mixed-hop layer. The MixHop layer is divided into two parts: message propagation and message aggregation. The role of message propagation is to alleviate the over-smoothing problem caused by the deepening of the network layers during the training of the multi-layer graph convolutional network (that is, the node representations will tend to the same value, resulting in the inability to distinguish different nodes). Message aggregation is to filter important information during propagation and enter the next layer.
[0116] Finally, given the output Y of the dilated convolutional component, the process of the graph convolutional module can be described as H out = MixHop1(Y, A) + MixHop2(Z, A T ), where k is the propagation layer number of MixHop.
[0117] Figure 4 (b) shows the information propagation step and information selection step in the proposed mixed-hop propagation layer. The mixed-hop propagation layer first propagates information in the horizontal direction and selects information in the vertical direction. The parameter matrix W (k) is used as a feature selector. When the given graph structure does not have spatial dependence, MixHop(H in , A) can still retain the self-information of the original nodes by adjusting all W (k) with k > 0 to 0.
[0118] After passing through all N layers of stacked graph prediction modules, the final output representation can be obtained as the prediction of the wavelet coefficients. Finally, their corresponding sequences are reconstructed in the time domain through the inverse discrete wavelet transform (IDWT), that is, the predicted water quality data sequence is obtained.
[0119] In another embodiment of this embodiment, the water quality index prediction method further includes:
[0120] Collect multiple water quality data time series collected by multiple water quality stations during a preset collection period, and predict the daily peak of the data volume of the water quality stations based on the multiple water quality data time series collected by the multiple water quality stations during the preset collection period.
[0121] For the water quality station data, the daily peak is specifically defined as: the maximum value of the downsampling of T interval data collected by the sensor every day. Predict the future daily peak time period sequence based on the historical water quality data time series. By predicting the daily peak of the water quality station data volume, the computing power can be coordinated in advance, and the possibility of slow prediction speed caused by excessive data volume can be reduced.
[0122] Assume that the future window length is P, then the future peak prediction length is P / T.
[0123] First, we perform periodic normalization on the original input sequence to learn the internal correlation between different time periods within the same period, so as to separate non-stationary content. We apply the standard normalization Norm(.) to each of the T historical water quality data time series, extract the mean value and divide it by the standard deviation:
[0124] {X' (i) ,μ i ,σ i}=Norm(X (i) )
[0125] Here, X (i) represents the historical water quality data time series of the original input, X’ (i) represents the normalized time series, i refers to the index of different water quality indicators, μ i represents the mean value of the i-th water quality indicator, σ i represents the standard deviation of the i-th water quality indicator, M={μ1,μ2,μ3,...,μ i ,...,μ T} is the set of mean values, ∑={σ1,σ2,σ3,...,σ i ,...,σ T} is the set of standard deviations, the value range of i is [1, T], and i is a positive integer. Use the normalized time series X’ (i) to perform peak prediction to obtain more stable data correlation. Since different water quality indicators have different units, we use standard normalization to convert different water quality indicators to the same dimension and map the data to [0,1] to avoid the problem of model overfitting caused by excessive parameters.
[0126] To execute this strategy without introducing more trainable parameters, a max pooling layer with a stride and kernel size of 6 is selected and appended to the end of the previous standard prediction result. The difference between the max pooling operation and manual processing of peak time series is that max pooling allows backpropagation. Then, the following combined loss function l h Optimizes the parameters of the model:
[0127] l h = ωl gp + (1 - ω)l peak
[0128] where l gp is the MSE loss of the graph prediction module, and l peak is the MSE loss between the true value of the peak time series and the peak prediction output. ω is a weight factor that varies between 0 and 1. By using the above combined loss function, the prediction model can obtain stronger generalization ability, emphasizing the prediction performance of the peak time series while fully capturing the information of the original sequence.
[0129] Referring to Figure 5 , based on the same inventive concept, an embodiment of the present invention provides a water quality index prediction system.
[0130] The water quality index prediction system described in the present invention can be installed in an electronic device. According to the functions achieved, the water quality index prediction system includes an acquisition module 51, a multi-level wavelet decomposition module 52, a graph learning module 53, a conversion module 54, and a prediction module 55.
[0131] The acquisition module 51 is used to acquire the water quality data time series containing multiple water quality indexes;
[0132] The multi-level wavelet decomposition module 52 is used to perform wavelet transform on the water quality data time series to obtain the multi-scale frequency representation of the water quality data time series;
[0133] The graph learning module 53 is used to analyze the water quality data time series to obtain the global relationship information between multiple water quality indexes;
[0134] The graph prediction module 54 is used to predict the multi-scale wavelet coefficients of the water quality indexes at future times according to the global relationship information and the multi-scale frequency representation;
[0135] The conversion module 55 is used to convert the multi-scale wavelet coefficients into time domain signals to obtain the predicted values of the future time series.
[0136] The various variations and specific examples in the water quality index prediction method provided by the above embodiments are equally applicable to the water quality index prediction system of this embodiment. Through the foregoing detailed description of the water quality index prediction method, those skilled in the art can clearly know the implementation method of the water quality index prediction system in this embodiment. For the sake of brevity of the specification, it will not be elaborated herein.
[0137] This application also discloses an electronic device, such as Figure 6 shown, which is a schematic structural diagram of an electronic device for the water quality index prediction method provided by an embodiment of the present invention. The electronic device may include at least one processor 10, a memory 11 communicatively connected to the at least one processor, a communication bus 12, and a communication interface 13. It may also include a computer program stored in the memory 11 and executable on the processor 10, such as a water quality index prediction method program.
[0138] Among them, the processor 10 may be composed of integrated circuits in some embodiments. For example, it may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same or different functions, including a combination of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control core (Control Unit) of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. By running or executing programs or modules stored in the memory 11 (such as executing the water quality index prediction method, etc.), and calling data stored in the memory 11, it performs various functions of the electronic device and processes data.
[0139] The memory 11 includes at least one type of readable storage medium. The readable storage medium includes flash memory, mobile hard disks, multimedia cards, card-type memories (such as SD or DX memories, etc.), magnetic memories, magnetic disks, optical disks, etc. The memory 11 may be an internal storage unit of the electronic device in some embodiments, such as the mobile hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the memory 11 may include both an internal storage unit and an external storage device of the electronic device. The memory 11 can be used not only to store application software installed in the electronic device and various types of data, such as the code of the water quality index prediction method program, but also to temporarily store data that has been output or will be output.
[0140] The communication bus 12 can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to implement connection communication between the memory 11 and at least one processor 10, etc.
[0141] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface can include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), and is generally used to establish a communication connection between this electronic device and other electronic devices. The user interface can be a display, an input unit (such as a keyboard), and optionally, the user interface can also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) toucher, etc. Among them, the display can also be appropriately referred to as a display screen or a display unit, and is used to display the information processed in the electronic device and to display a visual user interface.
[0142] Figure 6 Only the electronic device with components is shown. Those skilled in the art can understand that Figure 6 the shown structure does not constitute a limitation on the electronic device, and it can include fewer or more components than shown, or combine certain components, or have different component arrangements. For example, although not shown, the electronic device can also include a power source (such as a battery) for powering each component. Preferably, the power source can be logically connected to at least one processor 10 through a power management device, so as to implement functions such as charge management, discharge management, and power consumption management through the power management device. The power source can also include any components such as one or more DC or AC power sources, a recharge device, a power failure detection circuit, a power converter or inverter, and a power status indicator. The electronic device can also include various sensors, a Bluetooth module, a Wi-Fi module, etc., which will not be elaborated here.
[0143] It should be understood that the embodiments are only for illustration purposes and are not limited by this structure in the scope of the patent application.
[0144] Furthermore, if the modules / units integrated in the electronic device are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile.
[0145] An embodiment of the present application provides a computer-readable storage medium, for example, including: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM, Read-Only Memory). The computer-readable storage medium stores a computer program that can be loaded and executed by a processor to perform the water quality index prediction method in the above embodiments.
[0146] In the description of this specification, the descriptions referring to terms such as "an embodiment", "some embodiments", "examples", "specific examples", "a way of implementation", "a preferred way of implementation" or "some examples", etc., mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0147] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and purposes of the present invention. The scope of the present invention is defined by the claims and their equivalents.
Claims
1. A method for predicting water quality indicators, characterized in that: The method comprises: Obtain water quality data time series containing multiple water quality indicators; Perform wavelet transform on the time series of water quality data to obtain multi-scale frequency representation of the time series of water quality data; Analyze the time series of water quality data to obtain the global relationship information between multiple water quality indicators; The multi-scale wavelet coefficients of water quality indicators in the future are predicted based on the global relationship information and multi-scale frequency representation, and the multi-scale wavelet coefficients are converted into time domain signals to obtain the predicted values of future time series.
2. The water quality index prediction method according to claim 1, characterized in that: The water quality data time series includes multiple water quality index subsequences; the water quality data time series is parsed to obtain global relationship information between the multiple water quality indexes, including: Analyze the time series of water quality data to obtain the correlation between multiple water quality indicator subsequences; A water quality indicator relationship graph is constructed according to the association relationship between multiple water quality indicator subsequences to obtain global relationship information; the water quality indicator relationship graph includes at least two nodes, adjacent nodes are connected by edges, the nodes represent water quality indicator subsequences, and the edges represent the association relationship between the water quality indicator subsequences corresponding to adjacent nodes.
3. The water quality index prediction method according to claim 2, characterized in that: The graph adjacency matrix is used to represent the association relationship between neighbor nodes in the water quality index relationship graph; The calculation expression of the graph adjacency matrix is W1 represents the variable representation obtained by embedding the feature corresponding to node m1 in the water quality index relationship graph, and W2 represents the variable representation obtained by embedding the feature corresponding to node m2 in the water quality index relationship graph, m1≠m2, represents the transpose of W1, represents the transpose of W2, tanh(.) is the hyperbolic tangent function, relu(.) is the activation function, and α is a hyperparameter used to control the saturation rate of the activation function.
4. The water quality index prediction method according to claim 2, characterized in that: The wavelet transform is performed on the water quality data time series to obtain a multi-scale frequency representation of the water quality data time series, including: For each water quality index subsequence, multi-level discrete wavelet is used to decompose the water quality index subsequence layer by layer to obtain a multi-layer low-frequency sequence and a multi-layer high-frequency sequence. The multi-layer low-frequency sequence includes multiple levels of low-frequency subsequences, and the multi-layer high-frequency sequence includes multiple levels of high-frequency subsequences. The features of low-frequency subsequences at multiple levels are extracted respectively to obtain low-frequency wavelet features at multiple levels; Extract the features of high-frequency subsequences at multiple levels respectively to obtain high-frequency wavelet features at multiple levels; By fusing multiple levels of low-frequency wavelet features and multiple levels of high-frequency wavelet features, a multi-scale frequency sub-representation of the water quality index sub-sequence is obtained; The multi-scale frequency sub-representations of multiple water quality index sub-sequences are integrated to obtain the multi-scale frequency representation of the water quality data time series.
5. The water quality index prediction method according to claim 4, characterized in that: The water quality index subsequences are decomposed layer by layer using multi-level discrete wavelets to obtain multi-layer low-frequency sequences and multi-layer high-frequency sequences, including: Select the wavelet basis according to the water quality index subsequence, and set the decomposition level j of discrete wavelet transform, where j is a positive integer; Decompose the water quality index subsequence layer by layer. Each layer inputs the input signal into a low-pass filter for convolution operation to obtain the low-frequency subsequence of the current layer, and inputs the input signal into a high-pass filter for convolution operation to obtain the high-frequency subsequence of the current layer. The input signal of the first layer is the water quality index subsequence, and the input signal of the kth layer is the low-frequency subsequence output by the k-1th layer. The value range of k is [2, j], and k is a positive integer. Integrate the low-frequency subsequences output by j decomposition layers to obtain a multi-layer low-frequency sequence; Integrate the high-frequency subsequences output by j decomposition layers to obtain multi-layer high-frequency sequences.
6. The water quality index prediction method according to claim 4, characterized in that: Multiple dilated convolution filters with different kernel sizes are used to capture the wavelet coefficient characteristics of high-frequency subsequences and obtain high-frequency wavelet features; Multiple dilated convolution filters with different kernel sizes are used to capture the wavelet coefficient characteristics of the low-frequency subsequence and obtain the low-frequency wavelet features.
7. The water quality index prediction method according to claim 6, characterized in that: The method of predicting the multi-scale wavelet coefficients of water quality indicators in the future time according to the global relationship information and the multi-scale frequency representation, and converting the multi-scale wavelet coefficients into time domain signals to obtain the predicted value of the future time series includes: The graph convolution layer is used to process the water quality index relationship graph, and the local information corresponding to each node is transmitted to all nodes in the water quality index relationship graph structure; Update the frequency representation of each node in the water quality index relationship diagram according to the multi-scale frequency representation, and obtain the multi-scale wavelet coefficients of the future time series; The multi-scale wavelet coefficients are converted into time domain signals to obtain the predicted values of future time series.
8. A water quality index prediction system, used to implement the water quality index prediction method according to any one of claims 1 to 7, characterized in that: include: An acquisition module (51) is used to acquire a time series of water quality data including a plurality of water quality indicators; A multi-level wavelet decomposition module (52) is used to perform wavelet transformation on the water quality data time series to obtain a multi-scale frequency representation of the water quality data time series; A graph learning module (53) is used to analyze the time series of water quality data to obtain global relationship information between multiple water quality indicators; A graph prediction module (54) for predicting multi-scale wavelet coefficients of water quality indicators at future times based on global relationship information and multi-scale frequency representation; The conversion module (55) is used to convert the multi-scale wavelet coefficients into time domain signals to obtain the predicted value of the future time series.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor (10); and, a memory (11) communicatively connected to the at least one processor (10); The memory (11) stores a computer program executable by the at least one processor (10), and the computer program is executed by the at least one processor (10) so that the at least one processor (10) can execute the water quality index prediction method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program; when the computer program is executed by a processor, the water quality index prediction method according to any one of claims 1 to 7 is implemented.