Water quality monitoring and early warning method and system

By constructing a multi-parameter prediction network and capturing the long-term dependencies between water quality characteristics, the problem of inaccurate prediction in existing water quality monitoring technologies is solved, and accurate and timely early warning of water quality monitoring is achieved.

CN120687758APending Publication Date: 2025-09-23HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES

Patent Information

Application Number
CN202510633930.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

Existing water quality monitoring technologies are unable to capture the long-term dependencies between features, resulting in inaccurate and intime water quality prediction results.

Method used

A multi-parameter prediction network is adopted, including a time series decomposition module with an attention mechanism, a feature reconstruction module and a time series prediction module. By decomposing and reconstructing water quality data, the long-term dependency between features is captured to achieve accurate prediction.

Benefits of technology

It improves the accuracy and timeliness of water quality prediction, enables timely early warning, avoids the model from falling into local optimality, and enhances the accuracy of water quality assessment and the timeliness of early warning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687758A_ABST
    Figure CN120687758A_ABST
Patent Text Reader

Abstract

The invention discloses a water quality monitoring and early warning method. The method comprises the following steps: acquiring various parameter data related to water quality, and preprocessing to obtain standardized time sequence data; constructing a multi-parameter prediction network for prediction, wherein the multi-parameter prediction network comprises a time sequence decomposition module with an attention mechanism, a feature reconstruction module and a time sequence prediction module which are connected in sequence; the method comprises the following steps: respectively inputting trend feature reconstruction and periodic feature reconstruction into a feature reconstruction module, performing maximum pooling and average pooling on input data by the feature reconstruction module to obtain two sequences, performing information interaction on information between the two sequences, and fusing to capture a long-term dependency relationship between features; the two feature reconstruction modules respectively output a trend feature sequence and a periodic feature sequence; the method has the advantages that the long-term dependency relationship between the characteristics can be captured, the water quality prediction result is accurate, and accurate and timely early warning is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of aquaculture water quality monitoring, and in particular to a water quality monitoring and early warning method and system. Background Art

[0002] Current aquaculture water quality monitoring technologies are generally limited by a single monitoring dimension and insufficient predictive capabilities. At the monitoring level, conventional systems typically only collect discrete data for core parameters such as water temperature, dissolved oxygen, and pH. They employ a threshold-triggered passive alarm mechanism, issuing delayed warnings when key indicators such as ammonia nitrogen and nitrite concentrations reach preset alert levels. This discrete monitoring model struggles to capture the dynamic coupling effects between multiple parameters. In high-density aquaculture environments, water quality deterioration often exhibits nonlinear characteristics characterized by coordinated mutations across multiple indicators. The abnormal threshold triggering mechanism for a single parameter can easily lead to misjudgments or omissions in overall water quality assessments. At the prediction level, existing water quality prediction models are mostly limited to univariate time series analysis. Whether based on traditional time series algorithms such as autoregressive integrated moving average method and exponential smoothing, or using deep learning models such as LSTM and GRU, it is necessary to independently construct prediction channels for each parameter. This not only leads to redundant consumption of computing resources, but also ignores the complex spatiotemporal correlations between parameters such as water temperature, dissolved oxygen, and turbidity, resulting in the inability of the prediction system to effectively model the coordinated evolution of multiple parameters. The prediction results often deviate significantly from the multi-dimensional dynamic evolution process of the real water quality system. This univariate prediction paradigm seriously restricts the accuracy of the global water quality status assessment and the timeliness of the early warning.

[0003] Chinese Patent Publication No. CN118395108A discloses a method, device, and medium for estimating irrigation district water demand based on convolutional sparse self-attention. This method decomposes data into long-term trend sequences and seasonal cycle sequences, extracting long-term sequence features. This method addresses the aforementioned discrete monitoring model's difficulty capturing the dynamic coupling effects between multiple parameters and overcomes the limitations of single-variable prediction. However, it fails to extract interactive information between features, failing to capture long-term dependencies between features and thus easily falling into local optima. Consequently, when applied to water quality monitoring, water quality predictions are inaccurate, making it impossible to provide accurate and timely warnings. Summary of the Invention

[0004] The technical problem to be solved by the present invention is that the existing water quality monitoring and early warning methods are unable to capture the long-term dependencies between features, resulting in inaccurate water quality prediction results and the inability to provide accurate and timely early warnings.

[0005] The present invention solves the above technical problems through the following technical means: a water quality monitoring and early warning method, comprising: collecting multiple parameter data related to water quality and preprocessing them to obtain standardized time series data; constructing a multi-parameter prediction network, the multi-parameter prediction network comprising a time series decomposition module with an attention mechanism, a feature reconstruction module and a time series prediction module connected in sequence; the time series decomposition module with an attention mechanism is used to decompose the standardized time series data into trend features and periodic features, reconstruct the trend features and the periodic features and input them into a feature reconstruction module respectively, the feature reconstruction module performs maximum pooling and average pooling on the input data to obtain two sequences, the information between the two sequences is exchanged and then fused to capture the long-term dependency between the features, the two feature reconstruction modules respectively output a trend feature sequence and a periodic feature sequence; the time series prediction module is used to predict the results of multiple parameter data related to water quality in future time periods based on the trend feature sequence and the periodic feature sequence to obtain a multivariate time series.

[0006] The feature reconstruction module of the present invention performs maximum pooling and average pooling on the input data to obtain two sequences, generating two subsequences with coarser temporal resolution, retaining most of the information of the input sequence. The information between the two sequences is then fused after information interaction to capture the long-term dependency between features, preventing the model from falling into local optimality. The output water quality prediction results are therefore more accurate, thus helping to achieve accurate and timely early warning.

[0007] Furthermore, the working process of the time series decomposition module with attention mechanism is as follows:

[0008] The standardized time series data X is input into the multi-core time series decomposition module with an attention mechanism. The padding operation is first performed, and then the decomposition process is performed using N decomposition kernels. Finally, the decomposed sequence is average pooled to obtain N different development trends. The N different development trends are spliced ​​together, and the splicing results are subjected to global average pooling to generate a channel-level statistic C with a dimension of N. The channel-level statistic C is input into a fully connected layer and then processed using the ReLU activation function. The processed result is then input into another fully connected layer and then processed by the Sigmoid activation function to obtain the weight matrix. Using the weight matrix Assign corresponding weights to N development trends to obtain trend characteristics, and subtract the standardized time series data from the trend characteristics to obtain the periodic characteristics.

[0009] Furthermore, the trend feature is input into a feature reconstruction module to obtain a trend feature sequence, and the periodic feature is input into another feature reconstruction module to obtain a periodic feature sequence. The processing procedures of the two feature reconstruction modules are the same, and the processing procedures of the feature reconstruction modules are as follows:

[0010] The data of the input feature reconstruction module is first downsampled, and then the maximum pooling operation and the average pooling operation are performed respectively to generate two sequences X max and X avg ; Sequence X max The result of one-dimensional convolution and sequence X avg The results of projection by projection module F2 are added to obtain the first feature sequence after information interaction, sequence X avg The result of one-dimensional convolution and sequence X max The results of projection by projection module F1 are added to obtain the second feature sequence after information interaction; projection module F2 and projection module F1 are two different one-dimensional convolution kernels; the first feature sequence and the second feature sequence are added and then an upsampling operation is performed, and then the standardized time series data is added to obtain the reconstructed feature sequence.

[0011] Furthermore, the working process of the time series prediction module is as follows:

[0012] The trend feature sequence and the periodic feature sequence are respectively input into a linear layer to obtain the trend feature prediction sequence and the periodic feature prediction sequence, and the trend feature prediction sequence and the periodic feature prediction sequence are summed to obtain a multivariate time series.

[0013] Furthermore, the method further comprises:

[0014] The multi-parameter prediction network is trained, and the real-time collected water quality data is standardized and input into the trained multi-parameter prediction network to obtain the water quality prediction result for a certain period of time in the future. The water quality prediction result is compared with the corresponding water quality warning threshold. If the water quality warning threshold is exceeded, an alarm is issued.

[0015] Furthermore, various parameter data related to water quality include water temperature, dissolved oxygen, pH value, ammonia nitrogen content, nitrite content, turbidity and salinity.

[0016] Furthermore, the water quality prediction result is compared with the corresponding water quality warning threshold, and an alarm is issued if the water quality warning threshold is exceeded, including:

[0017] Each element in the multivariate time series corresponds to the prediction results of water temperature, dissolved oxygen, pH value, ammonia nitrogen content, nitrite content, turbidity, and salinity for the future period. The dissolved oxygen threshold is set at 6 mg / L. If the predicted dissolved oxygen result is less than the threshold, an alarm will be automatically triggered. The water temperature threshold range is 22-28°C. If the predicted water temperature result is less than or higher than the threshold range, an alarm will be triggered. The pH threshold range is 6.8-8.0. If the predicted pH result is less than or higher than the threshold range, an alarm will be triggered. The ammonia nitrogen threshold is 0.1 mg / L. If the predicted ammonia nitrogen content result is higher than the threshold, an alarm will be triggered. The nitrite threshold is 0.05 mg / L. If the predicted nitrite content result is higher than the threshold, an alarm will be triggered. The turbidity threshold of the aquaculture water body is set to 0.8 NTU. If the turbidity prediction result is higher than the threshold, an alarm will be triggered. The salinity threshold of the aquaculture water body is set to 0.4‰. If the salinity prediction result is higher than the threshold, an alarm will be triggered.

[0018] The present invention also provides a water quality monitoring and early warning system, comprising:

[0019] Data acquisition module, used to collect various parameter data related to water quality and pre-process them to obtain standardized time series data;

[0020] The model building module is used to construct a multi-parameter prediction network prediction. The multi-parameter prediction network includes a sequentially connected time series decomposition module with an attention mechanism, a feature reconstruction module and a time series prediction module; the time series decomposition module with an attention mechanism is used to decompose the standardized time series data into trend features and periodic features, and reconstruct the trend features and periodic features into a feature reconstruction module respectively. The feature reconstruction module performs maximum pooling and average pooling on the input data to obtain two sequences. The information between the two sequences is interacted and then fused to capture the long-term dependency between the features. The two feature reconstruction modules output trend feature sequences and periodic feature sequences respectively; the time series prediction module is used to predict the results of multiple parameter data related to water quality in future time periods based on trend feature sequences and periodic feature sequences to obtain a multivariate time series.

[0021] Furthermore, the working process of the time series decomposition module with attention mechanism is as follows:

[0022] The standardized time series data X is input into the multi-core time series decomposition module with an attention mechanism. The padding operation is first performed, and then the decomposition process is performed using N decomposition kernels. Finally, the decomposed sequence is average pooled to obtain N different development trends. The N different development trends are spliced ​​together, and the splicing results are subjected to global average pooling to generate a channel-level statistic C with a dimension of N. The channel-level statistic C is input into a fully connected layer and then processed using the ReLU activation function. The processed result is then input into another fully connected layer and then processed by the Sigmoid activation function to obtain the weight matrix. Using the weight matrix Assign corresponding weights to N development trends to obtain trend characteristics, and subtract the standardized time series data from the trend characteristics to obtain the periodic characteristics.

[0023] Furthermore, the trend feature is input into a feature reconstruction module to obtain a trend feature sequence, and the periodic feature is input into another feature reconstruction module to obtain a periodic feature sequence. The processing procedures of the two feature reconstruction modules are the same, and the processing procedures of the feature reconstruction modules are as follows:

[0024] The data of the input feature reconstruction module is first downsampled, and then the maximum pooling operation and the average pooling operation are performed respectively to generate two sequences X max and X avg ; Sequence X max The result of one-dimensional convolution and the sequence X avg The results of projection by projection module F2 are added to obtain the first feature sequence after information interaction, sequence X avg The result of one-dimensional convolution and the sequence X max The results of projection by projection module F1 are added to obtain the second feature sequence after information interaction; projection module F2 and projection module F1 are two different one-dimensional convolution kernels; the first feature sequence and the second feature sequence are added and then an upsampling operation is performed, and then the standardized time series data is added to obtain the reconstructed feature sequence.

[0025] Furthermore, the working process of the time series prediction module is as follows:

[0026] The trend feature sequence and the periodic feature sequence are respectively input into a linear layer to obtain the trend feature prediction sequence and the periodic feature prediction sequence, and the trend feature prediction sequence and the periodic feature prediction sequence are summed to obtain a multivariate time series.

[0027] Furthermore, the system also includes a training and early warning module, which is used to:

[0028] The multi-parameter prediction network is trained, and the real-time collected water quality data is standardized and input into the trained multi-parameter prediction network to obtain the water quality prediction result for a certain period of time in the future. The water quality prediction result is compared with the corresponding water quality warning threshold. If the water quality warning threshold is exceeded, an alarm is issued.

[0029] Furthermore, various parameter data related to water quality include water temperature, dissolved oxygen, pH value, ammonia nitrogen content, nitrite content, turbidity and salinity.

[0030] Furthermore, the water quality prediction result is compared with the corresponding water quality warning threshold, and an alarm is issued if the water quality warning threshold is exceeded, including:

[0031] Each element in the multivariate time series corresponds to the prediction results of water temperature, dissolved oxygen, pH value, ammonia nitrogen content, nitrite content, turbidity, and salinity for the future period. The dissolved oxygen threshold is set at 6 mg / L. If the predicted dissolved oxygen result is less than the threshold, an alarm will be automatically triggered. The water temperature threshold range is 22-28°C. If the predicted water temperature result is less than or higher than the threshold range, an alarm will be triggered. The pH threshold range is 6.8-8.0. If the predicted pH result is less than or higher than the threshold range, an alarm will be triggered. The ammonia nitrogen threshold is 0.1 mg / L. If the predicted ammonia nitrogen content result is higher than the threshold, an alarm will be triggered. The nitrite threshold is 0.05 mg / L. If the predicted nitrite content result is higher than the threshold, an alarm will be triggered. The turbidity threshold of the aquaculture water body is set to 0.8 NTU. If the turbidity prediction result is higher than the threshold, an alarm will be triggered. The salinity threshold of the aquaculture water body is set to 0.4‰. If the salinity prediction result is higher than the threshold, an alarm will be triggered.

[0032] The advantages of the present invention are:

[0033] (1) The feature reconstruction module of the present invention performs maximum pooling and average pooling on the input data to obtain two sequences, generating two subsequences with coarser temporal resolution, which retains most of the information of the input sequence. The information between the two sequences is then fused after information interaction to capture the long-term dependency between features, thus preventing the model from falling into local optimality. The output water quality prediction results are more accurate, which helps to achieve accurate and timely early warning.

[0034] (2) The S12 step of the document recorded in the background technology describes that it uses a single-kernel moving average to perform a smoothing operation, which will lead to incomplete feature extraction. This is because in the moving average operation, the size of the kernel determines the range and details of the features it can capture. Smaller kernels only consider short-term fluctuations in the data and are more sensitive to short-term changes and trends, but they are also more susceptible to noise and outliers. Larger kernels reduce the impact of short-term fluctuations and pay more attention to long-term trends, but larger windows may lead to over-smoothing. The trends and seasonal patterns obtained by decomposing using kernels of different sizes may be very different. Therefore, the present invention introduces a time series decomposition module with an attention mechanism, first performs a filling operation, then uses N decomposition kernels for decomposition processing, and finally performs an average pooling operation on the decomposed sequence to obtain N different development trends, comprehensively considering the results of decomposition using kernels of different sizes.

[0035] (3) The literature recorded in the background technology does not integrate different data after performing moving average operation on the data, while the present invention calculates the weight matrix Using the weight matrix N development trends are assigned corresponding weights, and a weight distribution strategy based on the attention mechanism is designed, which allows the network to autonomously determine the weight of each pattern during training.

[0036] (4) The literature described in the background technology uses linear fitting regression to directly process the decomposed trend items for long-term feature prediction. However, the present invention uses a feature sequence reconstruction module and a time series prediction module to reconstruct the decomposed time series and predict future series. The weight of each trend pattern can be continuously adjusted through gradient updates, so that each weight can adapt to the needs of a specific task, thereby automatically focusing on the trend features and periodic features that are more important to the task. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a flow chart of a water quality monitoring and early warning method disclosed in Example 1 of the present invention;

[0038] Figure 2 This is a schematic diagram of standardized time series data in a water quality monitoring and early warning method disclosed in Example 1 of the present invention;

[0039] Figure 3 This is a schematic diagram of a multi-parameter prediction network architecture in a water quality monitoring and early warning method disclosed in Example 1 of the present invention;

[0040] Figure 4 This is a structural diagram of a feature reconstruction module in a water quality monitoring and early warning method disclosed in Example 1 of the present invention. DETAILED DESCRIPTION

[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0042] Example 1

[0043] like Figure 1 As shown, embodiment 1 of the present invention provides a water quality monitoring and early warning method, comprising the following steps:

[0044] S1. Data collection and preprocessing: First, the time series of seven water quality data such as water temperature, dissolved oxygen, pH value, ammonia nitrogen content, nitrite content, turbidity, and salinity of the aquaculture pond are obtained through different types of sensors and standardized. Figure 2 As shown, the water quality data after standardization is the standardized time series data X, which is a multivariate time series containing the above-mentioned multiple variables. The purpose of the present invention is to input the standardized time series data into a multi-parameter prediction network, and use the data from time t-T+1 to time t within T-1 steps to predict the data from time t+1 to t+τ-1 within τ-1 steps after time t.

[0045] The multi-parameter prediction network includes a time series decomposition module with an attention mechanism, a feature reconstruction module, and a time series prediction module. Figure 3 As shown, the multivariate time series X is input into the time series decomposition module with attention mechanism to obtain the trend feature X t and the periodic characteristic X s , trend feature X t and the periodic characteristic X s Input a feature reconstruction module respectively to obtain the reconstructed trend feature sequence and the reconstructed periodic characteristic sequence Reconstructed trend feature sequence and the reconstructed periodic characteristic sequence Input a time series prediction module to obtain the prediction sequence Y of trend characteristics t And periodic feature prediction sequence Y s , the forecast sequence Y of trend characteristics t And periodic feature prediction sequence Y s The sum is performed to obtain the final target prediction window multivariate time series Y.

[0046] The following is an introduction to each module in the multi-parameter prediction network.

[0047] S11. Introduction to the working process of the multi-core time series decomposition module with attention mechanism

[0048] 1) The standardized time series data X is input into the multi-core time series decomposition module with an attention mechanism. The processing process of the multi-core time series decomposition module with an attention mechanism is as follows: a padding operation is performed first, then decomposition is performed using N decomposition cores, and finally an average pooling operation is performed on the decomposed sequence to obtain N different development trends. The process can be expressed by the following formula:

[0049]

[0050] Among them, X t (i) represents the N different development trends obtained, AvgPool represents the moving average operation, Padding represents the filling operation, and kernel i Represents different decomposition kernels, which refer to average pooling operations of different sizes. By calculating the average of a preset number of data points around each data point in the multivariate time series X, a new series is obtained, which is more stable and easier to observe. The preset number can be adjusted to form average pooling operations of different sizes.

[0051] 2) The N different development trends obtained are spliced ​​together, and global average pooling is used to generate a channel-level statistic C with dimension N. The process is expressed by the following formula:

[0052]

[0053] Where T represents the time step, n represents the number of multi-parameter parameters. Since this dataset contains seven types of water quality data, n = 7. Concat represents the concatenation operation, and p and q represent the two dimensions of the concatenated trend.

[0054] 3) Use two fully connected layers as the attention mechanism to automatically learn the weight of each trend, thereby obtaining the weight matrix of the entire network The process can be expressed as:

[0055]

[0056] Among them, [w1, w2, ..., w N ] represents the composition weight matrix N weight vectors, θ linear1 ,θ linear2 represents two consecutive fully connected layers, φ ReLU 、φ Sigmoid Represent the activation functions ReLU and Sigmoid respectively.

[0057] 4) Using the weight matrix Assign corresponding weights to N development trends and output trend features and periodic features in the high-dimensional features of the data. The process can be expressed by the following formula:

[0058]

[0059] X s =XX t

[0060] Among them, X t Represents the trend characteristics in the high-dimensional features of the data, X s Represents the periodic characteristics in the high-dimensional features of the data.

[0061] S12, Introduction to the working process of the feature reconstruction module. The trend features and periodic features in the high-dimensional features of the data are input into a feature reconstruction module respectively, and the processing process is the same, such as Figure 4 As shown, the data X input to the feature reconstruction module start is the trend feature X t When the following process is executed, the reconstructed trend feature sequence is obtained Input data X to the feature reconstruction module start is the periodic characteristic X s When the following process is executed, the reconstructed periodic characteristic sequence is obtained Therefore, the following describes the common processing procedures for both.

[0062] 1) If Figure 4 As shown, the data X input to the feature reconstruction module start , it is necessary to first perform downsampling, and then perform maximum pooling and average pooling operations respectively to generate two sequences X that retain most feature information max and X avg , the process can be expressed by the following formula:

[0063] X max =MoxPooling(Downsample(X start ))

[0064] X avg =AvgPooling(Dounsample(X start ))

[0065] Among them, Downsample represents the downsampling operation, MaxPooling represents the maximum pooling operation, and Avgpooling represents the average pooling operation.

[0066] 2) A bidirectional information interaction pathway is constructed through the mutual learning mechanism of cross-branch affine transformation parameters, which enhances the two feature sequences and compensates for the feature loss during the downsampling process. This process can be expressed as follows:

[0067]

[0068] in, and Represents the two feature sequences after the jth information interaction, F1 and F2 respectively represent the max With X avg The projection module based on heterogeneous one-dimensional convolution kernels is encoded into the hidden state space. The convolution kernels of F1 and F2 are the same size, but the parameters are learned, so they are different. Therefore, F1 and F2 are different convolution kernels. Conv1d represents a one-dimensional convolution operation. j represents the jth information interaction, and K represents the total number of preset interaction layers. max (j-1) and X avg (j-1) represents the sequence X at the j-1th information interaction max and X avg In this embodiment, Figure 4 Only one information interaction process is shown. In actual applications, multiple information interactions can be performed. The result of the first information interaction is used as the input for the next information interaction, and F1 and F2 are used to continue the information interaction, and multiple interactions can be performed in this way.

[0069] 3) By aggregating the enhanced dual-branch features and performing upsampling reconstruction operations, the heterogeneous features are mapped to the original sequence resolution, and the original input signals are fused through the residual connection mechanism to obtain an enhanced overall representation for generating prediction tasks. The process can be expressed by the following formula:

[0070]

[0071] in, and Represents two feature sequences after all K information interactions, and Upsample represents the upsampling reconstruction operation. The data X input to the feature reconstruction module start is the trend feature X t When the above process is executed, the is the reconstructed trend feature sequence Input data X to the feature reconstruction module start is the periodic characteristic X s When the above process is executed, the is the reconstructed periodic characteristic sequence

[0072] It should be noted that the most popular long-term dependency feature reconstruction structure is based on the Transformer's self-attention mechanism. However, this method is insufficient in capturing local patterns, and the self-attention mechanism will weaken such signals due to global averaging. In addition, the Transformer relies on positional encoding to model temporal relationships, but this type of encoding is sensitive to noise and distribution shifts. Therefore, in non-stationary time series, fixed positional encoding may not be able to dynamically adapt to changes in the temporal structure.

[0073] However, the feature reconstruction module proposed in this paper successfully captures long-term dependencies through convolution operations. Specifically, the input time series data is first processed through different pooling operations, producing two subsequences with coarser temporal resolution, preserving most of the information in the input sequence. Separate convolutional filters are then applied to the two subsequences to extract local features. The information exchange module exchanges information between all features extracted from the two subsequences, thereby obtaining a global view of the entire sequence.

[0074] S13. Introduction to the time series prediction module.

[0075] Directly use the linear layer to realize the reconstructed trend feature sequence and the reconstructed periodic characteristic sequence Perform multivariate multi-step forward prediction, map high-dimensional features to the target prediction window, and obtain the prediction sequence Y of trend features t And periodic feature prediction sequence Y s . The forecast sequence Y of trend characteristics t And periodic feature prediction sequence Y s The sum is performed to obtain the final target prediction window multivariate time series Y. Each element in the target prediction window multivariate time series Y corresponds to the prediction result of water temperature, dissolved oxygen, pH value, ammonia nitrogen content, nitrite content, turbidity, and salinity.

[0076] In practical applications, a water quality monitoring and alarm system is constructed, and the target prediction window multivariate time series Y is input into the water quality monitoring and alarm system. Thresholds are set for water temperature, dissolved oxygen, pH value, ammonia nitrogen content, nitrite content, turbidity, and salinity, and corresponding alarms are issued. Specifically, the dissolved oxygen threshold is set to 6 mg / L, and an automatic alarm is triggered when it is lower than the threshold; the temperature threshold range is 22-28°C, and an alarm is triggered when it is lower than or higher than the threshold range; the pH threshold range is 6.8-8.0, and an alarm is triggered when it is lower than or higher than the threshold range; the ammonia nitrogen threshold is 0.1 mg / L, and an alarm is triggered when it is higher than the threshold; the nitrite threshold is 0.05 mg / L, and an alarm is triggered when it is higher than the threshold; the water turbidity threshold of the aquaculture waters is set to 0.8 NTU, and an alarm is triggered when it is higher than the threshold; the salinity threshold of the aquaculture waters is set to 0.4‰, and an alarm is triggered when it is higher than the threshold.

[0077] S2. Model construction and training: Input the preprocessed data into the high-density aquaculture water quality parameter prediction network based on feature decomposition and multi-parameter interaction, that is, the multi-parameter prediction network involved in S1 above, iteratively train the network to achieve the expected accuracy, and save the network model file.

[0078] S3. Water quality prediction and early warning: Collect the above-mentioned various water quality data and perform standardization processing on them. Input the processed data into the above-mentioned saved network model file to obtain the prediction results of various water quality data for a certain period of time in the future, and compare the results with the water quality warning threshold. If one or more water quality parameters reach or exceed the warning threshold, the system will issue an alarm reminder; if no water quality parameter reaches or exceeds the warning threshold, the system will continue to predict future water quality parameters.

[0079] Through the above technical solution, the present invention obtains water quality data such as water temperature, dissolved oxygen, pH value, ammonia nitrogen content, nitrite content, turbidity, salinity, etc. that need to be monitored in real time for high-density fish farming through different sensors; standardizes the time series of different types of data to be suitable for input into the prediction network; constructs a high-density aquaculture water quality parameter change prediction model based on feature decomposition and multi-parameter interaction, that is, a multi-parameter prediction model, and uses a multi-core time series decomposition module with an attention mechanism to decompose the nonlinear water quality monitoring data so that the data has different trends and periodicities, and autonomously learns the weight of each pattern; uses a feature reconstruction module based on information interaction to perform deep representation learning on the local features of the decomposed data, and at the same time establishes its cross-level full-scale prediction model. The system uses a multivariate, multi-step time series prediction module, based on the multi-scale time series feature representation extracted by the preceding module, and a lightweight linear projection layer to model the long-term spatiotemporal dependencies of high-dimensional features into the future multi-step prediction window. This ultimately outputs a multivariate water quality parameter sequence prediction result that meets the target dimensional constraints. The model is trained and the model file is saved. A variety of water quality data collected in real time is input into the saved model file to obtain water quality data prediction results for a certain period in the future. Finally, the predicted water quality data is compared with the set warning thresholds. If one or more water quality parameters reach or exceed the warning threshold, the system issues an alarm. If no water quality parameter reaches or exceeds the warning threshold, the system continues to predict future water quality parameters. This high-density aquaculture water quality parameter change prediction model, based on feature decomposition and multi-parameter interaction, can effectively predict multiple water quality data simultaneously, improving the accuracy and efficiency of water quality prediction. Furthermore, the system can accurately identify water quality parameters that may exceed the warning threshold, providing essential support for aquaculture farmers to regulate water quality.

[0080] Example 2

[0081] Based on Example 1, Example 2 of the present invention further provides a water quality monitoring and early warning system, including:

[0082] Data acquisition module, used to collect various parameter data related to water quality and pre-process them to obtain standardized time series data;

[0083] The model building module is used to construct a multi-parameter prediction network prediction. The multi-parameter prediction network includes a sequentially connected time series decomposition module with an attention mechanism, a feature reconstruction module and a time series prediction module; the time series decomposition module with an attention mechanism is used to decompose the standardized time series data into trend features and periodic features, and reconstruct the trend features and periodic features into a feature reconstruction module respectively. The feature reconstruction module performs maximum pooling and average pooling on the input data to obtain two sequences. The information between the two sequences is interacted and then fused to capture the long-term dependency between the features. The two feature reconstruction modules output trend feature sequences and periodic feature sequences respectively; the time series prediction module is used to predict the results of multiple parameter data related to water quality in future time periods based on trend feature sequences and periodic feature sequences to obtain a multivariate time series.

[0084] Specifically, the working process of the time series decomposition module with attention mechanism is as follows:

[0085] The standardized time series data X is input into the multi-core time series decomposition module with an attention mechanism. The padding operation is first performed, and then the decomposition process is performed using N decomposition kernels. Finally, the decomposed sequence is average pooled to obtain N different development trends. The N different development trends are spliced ​​together, and the splicing results are subjected to global average pooling to generate a channel-level statistic C with a dimension of N. The channel-level statistic C is input into a fully connected layer and then processed using the ReLU activation function. The processed result is then input into another fully connected layer and then processed by the Sigmoid activation function to obtain the weight matrix. Using the weight matrix Assign corresponding weights to N development trends to obtain trend characteristics, and subtract the standardized time series data from the trend characteristics to obtain the periodic characteristics.

[0086] Specifically, the trend feature is input into a feature reconstruction module to obtain a trend feature sequence, and the periodic feature is input into another feature reconstruction module to obtain a periodic feature sequence. The processing procedures of the two feature reconstruction modules are the same, and the processing procedures of the feature reconstruction modules are as follows:

[0087] The data of the input feature reconstruction module is first downsampled, and then the maximum pooling operation and the average pooling operation are performed respectively to generate two sequences X max and X avg ; Sequence Xmax The result of one-dimensional convolution and sequence X avg The results of projection by projection module F2 are added to obtain the first feature sequence after information interaction, sequence X avg The result of one-dimensional convolution and sequence X max The results of projection by projection module F1 are added together to obtain a second feature sequence after information interaction; projection module F2 and projection module F1 are two different one-dimensional convolution kernels; the first feature sequence and the second feature sequence are used as input values ​​for the next information interaction, and information interaction is continued using projection module F2 and projection module F1 respectively. After multiple information interactions, the first feature sequence and the second feature sequence finally obtained are added together, an upsampling operation is performed, and then the standardized time series data is added to obtain a reconstructed feature sequence. In this embodiment, only one information interaction is performed, but in actual applications, multiple information interactions can be performed as needed.

[0088] Specifically, the working process of the time series prediction module is as follows:

[0089] The trend feature sequence and the periodic feature sequence are respectively input into a linear layer to obtain the trend feature prediction sequence and the periodic feature prediction sequence, and the trend feature prediction sequence and the periodic feature prediction sequence are summed to obtain a multivariate time series.

[0090] Specifically, the system further includes a training and warning module, which is used to:

[0091] The multi-parameter prediction network is trained, and the real-time collected water quality data is standardized and input into the trained multi-parameter prediction network to obtain the water quality prediction result for a certain period of time in the future. The water quality prediction result is compared with the corresponding water quality warning threshold. If the water quality warning threshold is exceeded, an alarm is issued.

[0092] More specifically, the various parameter data related to water quality include water temperature, dissolved oxygen, pH value, ammonia nitrogen content, nitrite content, turbidity and salinity.

[0093] More specifically, the water quality prediction result is compared with the corresponding water quality warning threshold, and an alarm is issued if the water quality warning threshold is exceeded, including:

[0094] Each element in the multivariate time series corresponds to the prediction results of water temperature, dissolved oxygen, pH value, ammonia nitrogen content, nitrite content, turbidity, and salinity for the future period. The dissolved oxygen threshold is set at 6 mg / L. If the predicted dissolved oxygen result is less than the threshold, an alarm will be automatically triggered. The water temperature threshold range is 22-28°C. If the predicted water temperature result is less than or higher than the threshold range, an alarm will be triggered. The pH threshold range is 6.8-8.0. If the predicted pH result is less than or higher than the threshold range, an alarm will be triggered. The ammonia nitrogen threshold is 0.1 mg / L. If the predicted ammonia nitrogen content result is higher than the threshold, an alarm will be triggered. The nitrite threshold is 0.05 mg / L. If the predicted nitrite content result is higher than the threshold, an alarm will be triggered. The turbidity threshold of the aquaculture water body is set to 0.8 NTU. If the turbidity prediction result is higher than the threshold, an alarm will be triggered. The salinity threshold of the aquaculture water body is set to 0.4‰. If the salinity prediction result is higher than the threshold, an alarm will be triggered.

[0095] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A water quality monitoring and early warning method, characterized in that: include: Collect various parameter data related to water quality and pre-process them to obtain standardized time series data; Construct a multi-parameter prediction network. The multi-parameter prediction network includes a sequentially connected time series decomposition module with an attention mechanism, a feature reconstruction module, and a time series prediction module. The time series decomposition module with an attention mechanism is used to decompose the standardized time series data into trend features and periodic features. The trend features and periodic features are reconstructed and input into a feature reconstruction module respectively. The feature reconstruction module performs maximum pooling and average pooling on the input data to obtain two sequences. The information between the two sequences is exchanged and then fused to capture the long-term dependency between the features. The two feature reconstruction modules output trend feature sequences and periodic feature sequences respectively. The time series prediction module is used to predict the results of various parameter data related to water quality in future time periods based on trend characteristic sequences and periodic characteristic sequences to obtain multivariate time series.

2. A water quality monitoring and early warning method according to claim 1, characterized in that: The working process of the time series decomposition module with attention mechanism is as follows: The standardized time series data X is input into the multi-core time series decomposition module with an attention mechanism. The module first performs a padding operation, then decomposes the data using N decomposition kernels, and finally performs an average pooling operation on the decomposed sequence to obtain N different development trends. The N different development trends obtained are spliced ​​together, and the splicing results are subjected to global average pooling to generate a channel-level statistic C with a dimension of N; the channel-level statistic C is input into a fully connected layer and then processed using the ReLU activation function. The processed result is then input into another fully connected layer and then processed by the Sigmoid activation function to obtain the weight matrix Using the weight matrix Assign corresponding weights to N development trends to obtain trend characteristics, and subtract the standardized time series data from the trend characteristics to obtain the periodic characteristics.

3. A water quality monitoring and early warning method according to claim 1, characterized in that: The trend feature is input into a feature reconstruction module to obtain a trend feature sequence, and the periodic feature is input into another feature reconstruction module to obtain a periodic feature sequence. The processing process of the two feature reconstruction modules is the same, and the processing process of the feature reconstruction module is: The data of the input feature reconstruction module is first downsampled, and then the maximum pooling operation and the average pooling operation are performed respectively to generate two sequences X max and X avg ; Sequence X max The result of one-dimensional convolution and sequence X avg The results of projection by projection module F2 are added to obtain the first feature sequence after information interaction, sequence X avg The result of one-dimensional convolution and sequence X max The results of projection by projection module F1 are added to obtain the second feature sequence after information interaction; projection module F2 and projection module F1 are two different one-dimensional convolution kernels; the first feature sequence and the second feature sequence are added and then an upsampling operation is performed, and then the standardized time series data is added to obtain the reconstructed feature sequence.

4. A water quality monitoring and early warning method according to claim 1, characterized in that: The working process of the time series prediction module is as follows: The trend feature sequence and the periodic feature sequence are respectively input into a linear layer to obtain the trend feature prediction sequence and the periodic feature prediction sequence, and the trend feature prediction sequence and the periodic feature prediction sequence are summed to obtain a multivariate time series.

5. A water quality monitoring and early warning method according to claim 1, characterized in that: The method further comprises: The multi-parameter prediction network is trained, and the real-time collected water quality data is standardized and input into the trained multi-parameter prediction network to obtain the water quality prediction result for a certain period of time in the future. The water quality prediction result is compared with the corresponding water quality warning threshold. If the water quality warning threshold is exceeded, an alarm is issued.

6. A water quality monitoring and early warning method according to claim 5, characterized in that: Various parameters related to water quality include water temperature, dissolved oxygen, pH value, ammonia nitrogen content, nitrite content, turbidity and salinity.

7. A water quality monitoring and early warning method according to claim 6, characterized in that: The water quality prediction result is compared with the corresponding water quality warning threshold. If the water quality warning threshold is exceeded, an alarm is issued, including: Each element in the multivariate time series corresponds to the prediction results of water temperature, dissolved oxygen, pH value, ammonia nitrogen content, nitrite content, turbidity, and salinity for the future period. The dissolved oxygen threshold is set at 6 mg / L. If the predicted dissolved oxygen result is less than the threshold, an alarm will be automatically triggered. The water temperature threshold range is 22-28°C. If the predicted water temperature result is less than or higher than the threshold range, an alarm will be triggered. The pH threshold range is 6.8-8.

0. If the predicted pH result is less than or higher than the threshold range, an alarm will be triggered. The ammonia nitrogen threshold is 0.1 mg / L. If the predicted ammonia nitrogen content result is higher than the threshold, an alarm will be triggered. The nitrite threshold is 0.05 mg / L. If the predicted nitrite content result is higher than the threshold, an alarm will be triggered. The turbidity threshold of the aquaculture water body is set to 0.8 NTU. If the turbidity prediction result is higher than the threshold, an alarm will be triggered. The salinity threshold of the aquaculture water body is set to 0.4‰. If the salinity prediction result is higher than the threshold, an alarm will be triggered.

8. A water quality monitoring and early warning system, characterized in that: include: Data acquisition module, used to collect various parameter data related to water quality and pre-process them to obtain standardized time series data; The model building module is used to construct a multi-parameter prediction network. The multi-parameter prediction network includes a sequentially connected time series decomposition module with an attention mechanism, a feature reconstruction module, and a time series prediction module. The time series decomposition module with an attention mechanism is used to decompose the standardized time series data into trend features and periodic features. The trend features and periodic features are reconstructed and input into a feature reconstruction module respectively. The feature reconstruction module performs maximum pooling and average pooling on the input data to obtain two sequences. The information between the two sequences is exchanged and then fused to capture the long-term dependency between the features. The two feature reconstruction modules output trend feature sequences and periodic feature sequences respectively. The time series prediction module is used to predict the results of various parameter data related to water quality in future time periods based on trend characteristic sequences and periodic characteristic sequences to obtain multivariate time series.

9. A water quality monitoring and early warning system according to claim 8, characterized in that: The working process of the time series decomposition module with attention mechanism is as follows: The standardized time series data X is input into the multi-core time series decomposition module with an attention mechanism. The module first performs a padding operation, then decomposes the data using N decomposition kernels, and finally performs an average pooling operation on the decomposed sequence to obtain N different development trends. The N different development trends obtained are spliced ​​together, and the splicing results are subjected to global average pooling to generate a channel-level statistic C with a dimension of N; the channel-level statistic C is input into a fully connected layer and then processed using the ReLU activation function. The processed result is then input into another fully connected layer and then processed by the Sigmoid activation function to obtain the weight matrix Using the weight matrix Assign corresponding weights to N development trends to obtain trend characteristics, and subtract the standardized time series data from the trend characteristics to obtain the periodic characteristics.

10. A water quality monitoring and early warning system according to claim 8, characterized in that: The trend feature is input into a feature reconstruction module to obtain a trend feature sequence, and the periodic feature is input into another feature reconstruction module to obtain a periodic feature sequence. The processing process of the two feature reconstruction modules is the same, and the processing process of the feature reconstruction module is: The data of the input feature reconstruction module is first downsampled, and then the maximum pooling operation and the average pooling operation are performed respectively to generate two sequences X max and X avg ; Sequence X max The result of one-dimensional convolution and the sequence X avg The results of projection by projection module F2 are added to obtain the first feature sequence after information interaction, sequence X avg The result of one-dimensional convolution and the sequence X max The results of projection by projection module F1 are added to obtain the second feature sequence after information interaction; projection module F2 and projection module F1 are two different one-dimensional convolution kernels; the first feature sequence and the second feature sequence are added and then an upsampling operation is performed, and then the standardized time series data is added to obtain the reconstructed feature sequence.

Citation Information

Patent Citations

  • Convolutional sparse self-attention-based irrigation area water demand estimation method, equipment and medium

    CN118395108A

Cited By

  • Aquaculture multivariable water quality parameter prediction method and system

    CN121365367A

  • An aquaculture multivariate water quality parameter prediction method and system

    CN121365367B