Specific sea area water quality change trend prediction method based on time sequence analysis

By constructing a multi-graph spatial dependency model and a deep twin encoder-decoder model, the shortcomings of traditional water quality monitoring methods in predicting future trends are addressed, enabling accurate prediction of water quality changes in specific sea areas and multi-scenario decision support.

CN121808515APending Publication Date: 2026-04-07GUANGZHOU HUANLE ECOLOGICAL ENVIRONMENT TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-26
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Traditional water quality monitoring methods are difficult to predict future trends in specific sea areas, and existing methods are inadequate in handling multi-source data, noise, nonlinear relationships, and medium- to long-term trend predictions.

Method used

A multi-graph spatial dependency model based on time series analysis is constructed. By combining a deep twin coding-decoding model and a multivariate state estimation method, multi-source heterogeneous data are fused to extract multi-scale time features and generate multi-scenario water quality prediction results.

Benefits of technology

It significantly improves the reliability of water quality forecasting and the predictability of environmental management, accurately depicts the mechanism of marine water quality changes, and provides high-precision multi-step forecasts and uncertainty quantification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121808515A_ABST
    Figure CN121808515A_ABST
Patent Text Reader

Abstract

The invention discloses a specific sea area water quality change trend prediction method based on time sequence analysis, and relates to the technical field of marine environment monitoring. The method comprises the following steps: firstly, collecting historical water quality data and time-space attributes of a target sea area monitoring station, and constructing a multi-graph structure based on geographical proximity, water quality change similarity and hydrological connectivity to represent a complex spatial dependency relationship; secondly, extracting multi-scale spatio-temporal features, and generating node embedding representation; and then, multi-graph feature aggregation is carried out by using a multi-graph convolutional network and an adaptive weight mechanism. And inputting the fusion features into a deep twin coding-decoding model to carry out multi-step water quality prediction, and finally, generating multiple groups of future scenes by disturbing key external driving factors by adopting a multivariate state estimation method, and outputting a multi-scene prediction sequence under different environmental conditions. According to the method, the accuracy, interpretability and decision support capability of water quality prediction are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of marine environment monitoring, and more particularly, to a specific sea area water quality change trend prediction method based on time series analysis. BACKGROUND

[0002] With the increasing intensity of coastal economic activities and the continuous input of land-based pollution, the water quality evolution of specific sea areas has become the core concern of marine environmental protection and ecological safety management. Although traditional water quality monitoring can reflect the history and current situation, it is difficult to make forward-looking predictions about future trends, resulting in environmental management decisions often lagging behind the development of pollution trends. Therefore, developing a method that can scientifically predict water quality trends is of great significance to achieve proactive and refined control of marine environments.

[0003] Time series analysis provides a feasible path for prediction by mining the rules of water quality parameters (such as dissolved oxygen, nutrients, etc.) changing over time. Water quality time series usually contain complex components such as long-term trends, seasonal fluctuations, and random disturbances. Early prediction mostly uses linear statistical models (such as ARIMA), but these methods have limited ability to handle nonlinear relationships. In recent years, the introduction of machine learning methods has improved prediction performance. Support vector machines, LSTM, etc. can better capture the nonlinear characteristics and long-term dependencies of water quality changes. However, existing methods still face challenges in application: first, water quality is influenced by meteorological, hydrological, and other factors, and the prediction accuracy is insufficient using only a single water quality sequence; second, actual monitoring data often has missing and noisy data; third, the applicability of the model in different sea areas needs to be optimized; fourth, the long-term trend prediction capability still needs to be improved. Therefore, for specific sea area applications, it is urgent to build a comprehensive prediction framework that can integrate multi-source driving data, adapt to data reality constraints, and consider both short-term fluctuations and long-term trends. SUMMARY

[0004] To solve the above technical problems, the present application provides a specific sea area water quality change trend prediction method based on time series analysis, which realizes the accurate description of the complex change mechanism of sea water quality by fusing multi-source heterogeneous spatio-temporal data and constructing a multi-level spatial dependence graph structure; and uses a deep twin encoding-decoding model and a multivariate state estimation method to improve the multi-step prediction accuracy while generating multi-scenario decision support results with clear uncertainty quantification, significantly enhancing the reliability of water quality prediction and the predictability of environmental management.

[0005] The present application provides a specific sea area water quality change trend prediction method based on time series analysis, comprising the following steps: The historical water quality time series data and corresponding spatio-temporal attribute information of the monitoring stations in the target sea area are collected, and the spatial relationship matrix is constructed based on the correlation characteristics between the monitoring stations, and a multi-graph structure with different spatial dependence relationships is generated, including geographical proximity, water quality parameter change similarity, and hydrological connectivity. The historical water quality time series data of each monitoring station is extracted by a parallel time convolution module to extract multi-scale time features, and a spatial attention mechanism is used to preliminarily learn the dynamic spatial correlation between nodes, and a node embedding representation is outputted which fuses the preliminary spatio-temporal features. The spatial relationship matrix of the multi-graph structure and the node embedding representation are subjected to spatial dependence modeling, the features are propagated on each graph structure through multi-graph convolution operation, and an adaptive weight fusion mechanism is used to weight and aggregate the different graph convolution results. The features fused through multi-graph convolution are inputted into a sequence model based on deep twin encoding-decoding for multi-step water quality prediction. At the same time, a multivariate state estimation method is used to generate multiple future scenario assumptions by perturbing key external driving factors, and output multiple scenario water quality prediction result sequences corresponding to different environmental conditions.

[0006] In this scheme, the historical water quality time series data and corresponding spatio-temporal attribute information of the monitoring stations in the target sea area are collected, and the spatial relationship matrix is constructed based on the correlation characteristics between the monitoring stations, and a multi-graph structure with different spatial dependence relationships is generated, including: The historical water quality time series data and related spatio-temporal attribute information of each monitoring station in the target sea area are collected, and the data is subjected to quality control and preprocessing, the historical water quality time series data includes physicochemical parameters, nutrient salt indicators, biological indicators and pollution indicators, and the spatio-temporal attribute information includes the geographical attributes, hydrological attributes and environmental driving factor data of each monitoring station; The geographical distance between the monitoring stations is calculated based on the geographical coordinates of each monitoring station, the spatial adjacency relationship is defined according to the geographical distance, and the first spatial relationship matrix reflecting the physical spatial proximity is constructed; The similarity of the key water quality parameter historical time series of each monitoring station is analyzed, the dynamic time warping distance of the time series between the stations is calculated, and the relationship weight is converted to construct the second spatial relationship matrix reflecting the similarity of the water quality parameter change; Based on the hydrodynamic characteristics of the target sea area, the hydrological connectivity relationship between the stations is determined by using water exchange rate calculation, tidal correlation analysis or water mass path analysis, and the third spatial relationship matrix reflecting the hydrological connectivity is constructed; The first, second and third spatial relationship matrices are defined as graph adjacency matrices respectively, and independent graph structures representing different spatial dependence relationships are generated to form a multi-graph structure for multi-level spatial correlation modeling.

[0007] In this scheme, multi-scale temporal features are extracted through parallel temporal convolution modules, and the dynamic spatial correlation between nodes is initially learned using a spatial attention mechanism. The output is a node embedding representation that fuses preliminary spatiotemporal features, including: By using multiple parallel temporal convolutional modules with convolutional kernels of different widths, short-term disturbance features, medium-term periodic features, and long-term trend features of water quality changes are obtained respectively. Each module adopts an expanded causal convolutional structure, and a gated linear unit is introduced after each convolutional layer to enhance nonlinear expressive power. The outputs of each branch are integrated through an adaptive weight fusion mechanism to generate multi-scale temporal feature representations. For each monitoring station, a learnable location encoding vector is generated. Combined with the temporal feature representation of the node, a node representation containing spatiotemporal prior information is generated. The dynamic spatial correlation between any two stations is calculated. A multi-layer multi-head attention architecture is used to capture spatial dependency patterns from different representation subspaces. An adaptive neighborhood selection mechanism is used to dynamically determine the relevant neighborhood range of each node. A hierarchical feature extraction architecture with local, regional, and global layers is established, and a spatiotemporal cross-attention module is introduced. Each layer adopts an attention mechanism with different resolutions to perform interaction between temporal and spatial feature representations. Temporal and spatial feature representations are combined through a gating fusion mechanism. Spatiotemporal features at different levels of abstraction are extracted through multi-hop feature propagation to generate node embedding representations that fuse preliminary spatiotemporal features.

[0008] In this scheme, spatial dependency modeling is performed using the spatial relationship matrix and node embedding representation of the multi-graph structure. Features are propagated across each graph structure through multi-graph convolution operations, and an adaptive weight fusion mechanism is used to weight and aggregate the convolution results from different graphs, including: Symmetric normalization is performed on each spatial relationship matrix, and each graph structure is independently stacked with multi-layer graph convolutional networks. Standard spectral graph convolution is used for the geographic proximity graph, attention-enhanced graph convolution is introduced for the water quality similarity graph, and direction-aware graph convolution is used for the hydrological connectivity graph to distinguish the effects of inflow and outflow. In each graph, the mean feature of all nodes is calculated to extract the global spatiotemporal context vector. The relevance score of each graph structure is calculated from four dimensions: feature consistency, spatiotemporal adaptability, prediction uncertainty, and historical performance memory. The multi-dimensional scores are fused and normalized through an attention mechanism to obtain the fusion weight. The fusion strategy is optimized using reinforcement learning. A state representation including node features, graph convolution output, and spatiotemporal context is defined. The fusion weights are used as the action space. A reward function that integrates prediction accuracy, weight stability, and exploration is designed. The optimal weight allocation strategy is learned through a deep reinforcement learning network. The confidence level of each graph's convolutional output is quantified. During fusion, the fusion weights are adjusted based on the confidence level. The adjusted adaptive fusion weights are then applied to perform weighted feature aggregation, which is combined with the original node features through residual connections. Finally, a feature representation of multi-level spatial dependence is output.

[0009] In this scheme, the relevance scores of each graph structure are calculated from four dimensions: feature consistency, spatiotemporal adaptability, prediction uncertainty, and historical performance memory. The multi-dimensional scores are then fused using an attention mechanism and normalized to obtain the fusion weights, including: Calculate the cosine similarity between the current node's features and the convolutional output features of each graph, and obtain the relevance score of the feature consistency dimension; Based on the seasonal attributes, tidal phase, meteorological conditions, and geographical region and water depth of the node at the current prediction time, a spatiotemporal adaptability function is constructed to obtain the correlation score of the spatiotemporal adaptability dimension. The prediction uncertainty of each graph's convolution output is estimated by Monte Carlo Dropout, and the inverse of the uncertainty is normalized to obtain the correlation score of the prediction uncertainty dimension. Maintain the prediction performance records of each graph structure under similar historical spatiotemporal scenarios, retrieve the historical performance under the current scenario through the memory network, calculate the average accuracy, and obtain the relevance score of the historical performance memory dimension; The relevance scores of the four dimensions are input into a lightweight attention network to learn the dynamic importance weights of each dimension. The relevance scores of the multiple dimensions are weighted and summed, and then normalized by the Softmax function to generate fusion weights.

[0010] In this scheme, the feature input after multi-graph convolutional fusion is used to perform multi-step water quality prediction using a sequence model based on deep Siamese coding-decoding, including: A twin encoder branch is constructed to extract deterministic trend components and random fluctuation components of water quality sequences. The features after multi-graph convolution fusion are input into the deterministic trend encoder branch. Multi-scale temporal convolution is used to extract the deterministic trend components of water quality changes and output a deterministic encoding vector. The stochastic fluctuation encoder receives the residual between the original historical water quality time series and the deterministic prediction, and uses a variational autoencoder architecture to learn the probability distribution of the fluctuation component, and outputs a stochastic encoding vector representing the distribution. The deterministic decoder and the random decoder each receive the corresponding encoded vector and perform decoding in parallel. In the decoding time step, based on the prediction variance output by the random decoder, the fusion weight is dynamically calculated, and the deterministic decoding features and the random decoding features are weighted and fused to generate fused decoding features. By utilizing the fused decoding features, a multi-step prediction mechanism combining recursion and direct prediction is used to generate future multi-step water quality prediction values. By running a randomness decoder and sampling, multiple sets of fluctuation trajectories are generated and superimposed on the deterministic trend prediction component to generate possible future water quality sequences. The mean and variance of the predicted values ​​at each future time step are calculated to quantify the prediction uncertainty and output multi-step water quality prediction results with confidence intervals.

[0011] In this scheme, a multi-scale loss function is designed to train the deep twin encoder-decoder sequence model, including mean squared error loss for optimizing deterministic prediction and regularization loss for constraining random distribution. The course learning strategy is implemented, and the total training process is divided into several consecutive stages. In each training stage, the model is trained to complete a multi-step prediction task with a specific step length. The prediction step length increases with the stage, and the stage transition must meet the condition of convergence of the validation set loss. Within each training phase, training samples are dynamically selected based on a defined sample difficulty metric. When moving to the next phase, the model parameters obtained from the previous phase are inherited to perform targeted initialization of the network structure that expands due to the increase in prediction step size in the new phase. In the early stage of phase training, some trained layer parameters are selectively frozen for progressive fine-tuning until the model reconverges under the phase objective.

[0012] In this scheme, a multivariate state estimation method is adopted to generate multiple sets of future scenario hypotheses by perturbing key external driving factors, and output a series of multi-scenario water quality prediction results corresponding to different environmental conditions, including: Key external driving factors affecting water quality in target sea areas are identified and classified into climate and meteorological factors, land-based input factors, marine dynamic factors, and ecological process factors. Statistical characteristics are calculated based on historical observation data of each factor, and the disturbance amplitudes of three levels—benchmark, moderate, and extreme—are set according to the historical standard deviation multiple. State vectors are constructed based on water quality parameter vectors, hydrological state vectors, and ecological state vectors. Orthogonal experimental design is used to combine perturbations of various driving factors at different levels to construct driving factor perturbation schemes. Based on the trained deep twin prediction model, a state transition function is constructed. A representative initial state is extracted from historical observations as the starting point, and different driving factor perturbation schemes are input in parallel to carry out rolling prediction, generating a set of multivariate water quality prediction trajectories corresponding to different environmental condition assumptions. The multivariate water quality prediction trajectory set is clustered using a dynamic time-warped distance-based clustering method to identify the similarity of trajectories in shape and evolution patterns, classify them into a limited number of typical pattern categories, analyze the characteristics of different categories of trajectories, and identify the key driving factor combinations and conditions for different evolution trends. For each predicted trajectory, a multidimensional risk assessment index is calculated, including the probability of water quality exceeding standards, the rate of deterioration of key parameters, and the degree of ecological impact. The trajectories are sorted according to the risk assessment results, and a representative subset of scenarios is selected from all trajectories using the K-medoids method. The water quality prediction result sequence corresponding to the representative subset of scenarios is output.

[0013] Compared with the prior art, the beneficial effects of the present invention are as follows: This method constructs a spatiotemporal tensor sequence that integrates heterogeneous data from multiple sources, and designs a multi-graph spatial relationship matrix based on geographic proximity, similarity of water quality parameter changes, and hydrological connectivity to achieve a multi-level characterization of complex spatial dependencies in marine areas. This overcomes the limitations of traditional methods that rely on single geographic distances or static topological structures to model spatial correlations, and significantly improves the model's ability to capture spatial heterogeneity and dynamic correlations.

[0014] Secondly, the spatiotemporal information multi-graph convolutional network framework proposed in this invention combines parallel multi-scale temporal convolution with a dynamic spatial attention mechanism. It can effectively extract multi-scale temporal features of water quality sequences from short-term perturbations to long-term trends, and can also adaptively learn the dynamic spatial correlations between nodes as time and environmental conditions change through the attention mechanism. This results in the node embedding representations extracted by the model containing rich spatiotemporal semantic information, laying a solid foundation for subsequent accurate predictions.

[0015] In the core of the prediction model, the deep twin encoder-decoder architecture separates and models the deterministic trends and stochastic fluctuations of water quality changes, and performs collaborative learning. It captures the inherent patterns through dedicated encoder branches, and combines multi-scale loss functions and curriculum learning strategies to output high-precision multi-step deterministic predictions. This effectively balances the accuracy and reliability of the predictions, providing a more comprehensive information basis for risk management. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments or examples of the present invention, the accompanying drawings used in the embodiments or examples will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained according to these drawings without creative effort.

[0017] Figure 1 A flowchart is shown for a method to predict the trend of water quality changes in a specific sea area based on time series analysis; Figure 2 A flowchart illustrating spatial dependency modeling of a multi-graph structure is shown; Figure 3 A flowchart for multi-step water quality prediction based on a deep twin encoder-decoder sequence model is shown. Detailed Implementation

[0018] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0019] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0020] like Figure 1 As shown in the figure, this embodiment provides a method for predicting the trend of water quality changes in a specific sea area based on time series analysis, including: Historical water quality time series data and corresponding spatiotemporal attribute information of monitoring stations within the target sea area are collected. Spatial relationship matrices are constructed based on the correlation characteristics between monitoring stations to generate multi-graph structures with different spatial dependencies. The correlation characteristics include geographical proximity, similarity of water quality parameter changes, and hydrological connectivity. The historical water quality time series data of each monitoring station are used to extract multi-scale temporal features through a parallel temporal convolution module, and the dynamic spatial correlation between nodes is initially learned using a spatial attention mechanism to output a node embedding representation that integrates preliminary spatiotemporal features. Spatial dependency modeling is performed using the spatial relationship matrix and node embedding representation of the multi-graph structure. Features are propagated on each graph structure through multi-graph convolution operations, and an adaptive weight fusion mechanism is used to weight and aggregate the convolution results of different graphs. The feature input after multi-graph convolution fusion is used to perform multi-step water quality prediction using a sequence model based on deep twin encoder-decoder. Simultaneously, a multivariate state estimation method is adopted to generate multiple sets of future scenario hypotheses by perturbing key external driving factors, and output a sequence of multi-scenario water quality prediction results corresponding to different environmental conditions.

[0021] It should be noted that historical water quality time-series data for each monitoring station in the target sea area are collected from fixed monitoring stations, mobile monitoring platforms, and satellite remote sensing data sources. This includes basic physicochemical parameters, nutrient indices, biological indices, and pollution indices. Precise geographic coordinates and water depth, among other geographic attributes, are obtained for each monitoring station. Hydrological characteristic data related to the stations are also collected, including seasonal variations in tidal direction and velocity, water exchange cycles, and stratification information. Simultaneous meteorological data (wind speed, wind direction, precipitation, and temperature), land-based input data (major river flow and sewage discharge), and adjacent land use type data are also acquired and integrated into relevant spatiotemporal attribute information.

[0022] The geographical distance between monitoring stations is calculated based on their geographic coordinates. Spatial adjacency relationships are defined based on these distances, constructing a first spatial relationship matrix reflecting physical spatial proximity. Similarity analysis is performed on the historical time series of key water quality parameters for each monitoring station. The dynamic time-normalized distance between the time series is calculated and converted into relational weights, constructing a second spatial relationship matrix reflecting the similarity of water quality parameter changes. Based on the hydrodynamic characteristics of the target sea area, hydrological connectivity relationships between stations are determined using water exchange rate calculation, tidal current correlation analysis, or water mass path analysis, constructing a third spatial relationship matrix reflecting hydrological connectivity. The water exchange rate calculation uses particle tracking or transport models to simulate the tracer transport probability between stations. The tidal current correlation analysis obtains the correlation between the tidal current direction and velocity time series between stations. The water mass path analysis identifies the main water mass movement paths and determines the hydrological connectivity paths between stations. The first, second, and third spatial relationship matrices are defined as graph adjacency matrices, generating independent graph structures representing different spatial dependencies, forming a multi-graph structure for multi-level spatial correlation modeling.

[0023] It should be noted that, considering the multi-periodic characteristics (diurnal variation, seasonal variation, and interannual variation) of water quality time series, a parallel multi-branch temporal convolutional structure was designed. Multiple parallel temporal convolutional modules, using convolutional kernels of different widths, respectively acquire short-term perturbation features, medium-term periodic features, and long-term trend features of water quality changes. Each module employs an dilated causal convolutional structure, expanding the receptive field through an exponentially increasing expansion rate while ensuring temporal causality. Furthermore, a gated linear unit is introduced after each convolutional layer to enhance nonlinear expressive power. The outputs of each branch are integrated through an adaptive weight fusion mechanism to generate multi-scale temporal feature representations. The fused features retain complete temporal pattern information from diurnal to annual scales.

[0024] Learnable location encoding vectors are generated for each monitoring station. Combined with the temporal feature representation of the nodes, node representations containing spatiotemporal prior information are generated. The dynamic spatial correlation between any two stations is calculated. A multi-layer multi-head attention architecture is used to capture spatial dependency patterns from different representation subspaces. The relevant neighborhood range of each node is dynamically determined through an adaptive neighborhood selection mechanism, including hard selection and soft selection. Based on the current hydrological and meteorological conditions and water quality status, the key areas of spatial dependency are adaptively adjusted. Hard selection only retains the k largest neighboring nodes with the highest attention weights, while soft selection encourages the sparsity of attention weights through sparsity regularization.

[0025] A hierarchical feature extraction architecture is established, consisting of a local layer (focusing on the interaction between neighboring sites), a regional layer (spatial patterns at the bay scale), and a global layer (the spatiotemporal evolution patterns of the entire sea area). During the feature extraction process, a spatiotemporal cross-attention module is introduced in the middle layer of the network. Each layer adopts an attention mechanism with different resolutions to interact with temporal and spatial feature representations. Finally, the temporal and spatial feature representations are combined through a gating fusion mechanism. Spatiotemporal features at different levels of abstraction are extracted through multi-hop feature propagation. Layer normalization and spatiotemporal smoothness regularization are applied to the output feature representation to generate a node embedding representation that integrates the initial spatiotemporal features.

[0026] It should be noted that, as Figure 2 As shown, symmetric normalization is applied to each spatial relationship matrix to enhance numerical stability and maintain consistent feature scales. Each graph structure independently stacks multiple layers of graph convolutional networks, and residual connections are introduced to alleviate the oversmoothing problem of deep graph networks. Standard spectral graph convolution is used for the geographic proximity map to capture local spatial smoothness; attention-enhanced graph convolution is introduced for the water quality similarity map. Dynamic attention weights are calculated before each convolution layer to dynamically adjust the similarity weights. The weighted spatial relationship matrix of the water quality similarity map is represented as follows: ,in This is the spatial relationship matrix of the water quality similarity graph. It is a learnable linear transformation matrix. Scaling factor The attention score matrix is ​​calculated by multiplying the query matrix and the key matrix to obtain the correlation score between each pair of nodes (i,j). The higher the score, the more relevant the features of node i and node j are in the context of the current layer representation. Direction-aware graph convolution is used to distinguish the effects of inflow and outflow on the hydrological connectivity graph, and forward propagation features (along the direction of water flow) are calculated separately. and backpropagation characteristics ,in This is the spatial relationship matrix of the hydrological connectivity graph. Let be the feature matrix of the l-th layer node. These are the learnable weights for the forward and backward directions, respectively. The activation function is used to fuse bidirectional features through a gating mechanism.

[0027] In each graph, the mean features of all nodes are calculated to extract the global spatiotemporal context vector. The relevance score of each graph structure is calculated from four dimensions: feature consistency, spatiotemporal adaptability, prediction uncertainty, and historical performance memory. Specifically, the cosine similarity between the current node's features and the convolutional output features of each graph is calculated to obtain the relevance score for the feature consistency dimension. ; ,in This is the original feature vector of the current node. Let k be the graph convolution output feature corresponding to graph structure k.

[0028] Based on the seasonal attributes, tidal phase, meteorological conditions, and the geographical region and water depth of the node at the current prediction time, a spatiotemporal adaptability function is constructed, and the correlation score of the spatiotemporal adaptability dimension is obtained. , represented as: , in This includes temporal characteristics such as seasonal attributes, tidal phases, and meteorological conditions. Spatial characteristics including geographical area and water depth, Encode the current water quality status model. , For learnable weights and biases.

[0029] The prediction uncertainty of each graph's convolutional output is estimated using Monte Carlo Dropout, and the inverse of the uncertainty is normalized to obtain the correlation score of the prediction uncertainty dimension. , represented as: , in The prediction variance of the graph structure k estimated for Monte Carlo Dropout. The total number of graph structures is given. Monte Carlo Dropout is used in a pre-trained single graph convolutional network, maintaining the activation of the Dropout layers during prediction, and forward propagating on the same input. Due to the randomness of Dropout, each forward propagation will result in a slightly different network, which is equivalent to sampling from the probability distribution of the network to obtain the prediction result, and the variance of the prediction result is calculated. Maintain a record of the predicted performance of each graph structure under similar historical spatiotemporal scenarios, retrieve historical performance under the current scenario through a memory network, calculate the average accuracy, and obtain the relevance score of the historical performance memory dimension. , is represented as; , in It is a set of historically similar scenarios retrieved from the memory network. For the contextual features of a historical situation, To obtain the true historical value from a set of similar historical scenarios, For the graph structure k obtained from the set of historical similar scenarios in the scenario Historical forecast values ​​below, For temperature parameters; The relevance scores of the four dimensions are input into a lightweight attention network to learn the dynamic importance weights of each dimension. The relevance scores of the multiple dimensions are weighted and summed, and then normalized by the Softmax function to generate fusion weights.

[0030] The fusion strategy is optimized using reinforcement learning. A state representation including node features, graph convolution output, and spatiotemporal context is defined. The fusion weights are used as the action space. A reward function that integrates prediction accuracy, weight stability, and exploration is designed. The optimal weight allocation strategy is learned through a deep reinforcement learning network. The confidence level of each graph's convolutional output is quantified. During fusion, the fusion weights are adjusted based on the confidence level. The adjusted adaptive fusion weights are then applied to perform weighted feature aggregation, which is combined with the original node features through residual connections. Finally, a feature representation of multi-level spatial dependence is output.

[0031] It should be noted that, as Figure 3 As shown, a twin encoder branch is constructed to extract deterministic trend components and stochastic fluctuation components from water quality sequences. The two branches interact through a collaborative learning mechanism to ultimately achieve high-precision multi-step water quality prediction. Features fused by multi-graph convolution are input into the deterministic trend encoder branch, which uses multi-scale temporal convolution to extract deterministic trend components of water quality changes and outputs a deterministic encoding vector. The first layer of the deterministic trend encoder branch is an dilated causal convolution with an exponentially increasing expansion rate to obtain trends at multiple time scales. The second layer is a bidirectional GRU layer that fuses past and future contextual information, and the third layer is a time attention mechanism that focuses on trend changes at key time nodes. The stochastic fluctuation encoder receives the residuals between the original historical water quality time series and the deterministic prediction, capturing nonlinear fluctuations and anomalous patterns. A variational autoencoder architecture is used to learn the probability distribution of the fluctuation components, outputting a stochastic encoding vector representing the distribution. Furthermore, a cross-attention mechanism is introduced, allowing the two branches to exchange information at each layer.

[0032] The deterministic decoder and the stochastic decoder each receive their corresponding encoded vectors and decode in parallel. During each decoding time step, based on the prediction variance output by the stochastic decoder, fusion weights are dynamically calculated, and the deterministic and stochastic decoding features are weighted and fused to generate fused decoding features. Additionally, an external memory matrix storing typical prediction patterns is introduced, and relevant memories are queried during the decoding process for reference, enabling the model to learn and reuse historical prediction patterns. Using the fused decoding features, a multi-step prediction mechanism combining recursion and direct prediction is employed to generate future multi-step water quality predictions. By running the stochastic decoder and sampling, multiple sets of fluctuation trajectories are generated and superimposed on the deterministic trend prediction components to generate possible future water quality sequences. The mean and variance of the predictions at each future time step are calculated to quantify the prediction uncertainty, and multi-step water quality prediction results with confidence intervals are output.

[0033] It should be noted that a multi-scale loss function is designed to train the deep Siamese encoder-decoder sequence model, including a mean squared error loss for optimizing deterministic predictions and a regularization loss for constraining random distributions; among which, the multi-step weighted mean squared error loss... Represented as: , The latent distribution of a constrained randomness encoder approximates a standard normal distribution. Regularization loss of random distribution Represented as: , in To predict the total step size, For the actual value at step h, The deterministic prediction value at step h is the output of the deterministic decoder. The time decay weight is determined by the prediction step size; the larger the prediction step size, the smaller the corresponding time decay weight. Let be the probability distribution of the fluctuation component learned by the branch of the randomness encoder. For potential random components, To input water quality sequences, for Divergence calculation.

[0034] The course learning strategy is implemented, and the total training process is divided into several consecutive stages. In each training stage, the model is trained to complete a multi-step prediction task with a specific step length. The prediction step length increases with each stage, gradually increasing from the initial single-step prediction to the target maximum step length. The stage transition must meet the condition of convergence of the validation set loss. Within each training phase, training samples are dynamically selected based on a defined sample difficulty metric. Low-difficulty samples are prioritized in the early stages of training, while higher-difficulty samples are gradually introduced as training progresses. The difficulty score of the training samples is defined based on the coefficient of variation of the sequence and the proportion of outliers in the sequence. Simultaneously, the weights of various sub-losses are dynamically adjusted according to the current training phase to emphasize different optimization objectives at different training stages. Upon entering the next phase, the model parameters obtained from the previous phase are inherited, and the network structure expanded due to the increased prediction step size in the new phase is selectively initialized. In the early stages of this phase, some trained layer parameters are selectively frozen for incremental fine-tuning until the model reconverges under the phase objective.

[0035] It should be noted that a multivariate state estimation method is employed, generating multiple sets of future scenario hypotheses by perturbing key external driving factors, and outputting a sequence of multi-scenario water quality prediction results corresponding to different environmental conditions. Key external driving factors affecting the water quality of the target sea area are identified and classified into climate and meteorological categories, land-based input categories, marine dynamic categories, and ecological process categories. Climate and meteorological categories include precipitation, wind speed and direction, and temperature; land-based input categories include river inflow and the load of key sewage outlets; marine dynamic categories include tidal type and amplitude, and coastal current velocity; and ecological process categories include baseline phytoplankton growth rate and microbial mineralization rate.

[0036] Statistical characteristics, such as mean, standard deviation, frequency and intensity of extreme events, are calculated based on historical observation data of various factors. The perturbation amplitudes for baseline, moderate, and extreme levels are set according to the historical standard deviation multiples. A system state vector is constructed based on water quality parameter vectors (dissolved oxygen, nutrients, etc.), hydrological state vectors (temperature, salinity, flow velocity), and ecological state vectors. Orthogonal experimental design is used to combine perturbations of various driving factors at different levels, ensuring that the scenario set can efficiently cover the multidimensional parameter space, and constructing a perturbation scheme for driving factors. A state transition function is constructed based on the trained deep twin prediction model. ,in For the trained model parameters, Let be the system state vector. For external driving factor vectors, This is potential random noise.

[0037] Starting from representative initial states extracted from historical observations, rolling predictions are performed by inputting different driving factor perturbation schemes in parallel. For each initial state and each driving factor perturbation combination, the prediction model is run in parallel to generate a set of multivariate water quality prediction trajectories corresponding to different environmental condition assumptions. The multivariate water quality prediction trajectory set is then clustered using a clustering method based on dynamic time regularization distance to identify the similarity of the trajectories in shape and evolution pattern, and classify them into a limited set of typical patterns, such as a stable type with small fluctuations in water quality parameters, a deteriorating type with continuous deterioration of key parameters, an improving type with gradual improvement in water quality, and a mutation type with drastic changes. The study detects turning points in each trajectory, analyzes the characteristics of different trajectory categories, and identifies key driving factor combinations and conditions for different evolution trends. For each predicted trajectory, a multi-dimensional risk assessment index is calculated, including the probability of water quality exceeding standards, the rate of deterioration of key parameters, and the degree of ecological impact. Trajectories are ranked according to the risk assessment results. The probability of water quality exceeding standards is calculated by statistically analyzing the proportion of time steps in which water quality parameter values ​​exceed thresholds. The rate of deterioration of key parameters is calculated by linearly fitting the time series of selected parameters in the predicted trajectory, with the slope of the fitted line representing the average deterioration rate. The degree of ecological impact is calculated by establishing threshold triggering rules for water quality parameters and ecological endpoints based on historical data. Along the predicted trajectory, the degree to which the ecological impact rules are triggered by water quality parameter values ​​is accumulated or integrated, and the result is obtained through normalized scoring. Finally, the K-medoids method is used to select a representative subset of scenarios from all trajectories, and the corresponding water quality prediction result sequence is output. The final water quality prediction result sequence is displayed using a spatiotemporal heat map to visualize the spatiotemporal evolution of water quality parameters under various scenarios, and common early warning signals are identified in each scenario for real-time monitoring and early warning.

[0038] A second embodiment of the present invention provides a computer-readable storage medium, which includes a method program for predicting the trend of water quality changes in a specific sea area based on time series analysis. When the method program is executed by a processor, it implements the steps of the method program for predicting the trend of water quality changes in a specific sea area based on time series analysis.

[0039] In the several embodiments provided in this application, it should be understood that the disclosed methods and systems can be implemented in other ways. The system embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, and can be electrical, mechanical, or other forms. Furthermore, in the various embodiments of the present invention, all functional units can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0040] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0041] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for predicting the trend of water quality changes in a specific sea area based on time series analysis, characterized in that, Includes the following steps: Historical water quality time series data and corresponding spatiotemporal attribute information of monitoring stations within the target sea area are collected. Spatial relationship matrices are constructed based on the correlation characteristics between monitoring stations to generate multi-graph structures with different spatial dependencies. The correlation characteristics include geographical proximity, similarity of water quality parameter changes, and hydrological connectivity. The historical water quality time series data of each monitoring station are used to extract multi-scale temporal features through a parallel temporal convolution module, and the dynamic spatial correlation between nodes is initially learned using a spatial attention mechanism to output a node embedding representation that integrates preliminary spatiotemporal features. Spatial dependency modeling is performed using the spatial relationship matrix and node embedding representation of the multi-graph structure. Features are propagated on each graph structure through multi-graph convolution operations, and an adaptive weight fusion mechanism is used to weight and aggregate the convolution results of different graphs. The feature input after multi-graph convolution fusion is used to perform multi-step water quality prediction using a sequence model based on deep twin encoder-decoder. Simultaneously, a multivariate state estimation method is adopted to generate multiple sets of future scenario hypotheses by perturbing key external driving factors, and output a sequence of multi-scenario water quality prediction results corresponding to different environmental conditions.

2. The method for predicting water quality change trends in a specific sea area based on time series analysis according to claim 1, characterized in that, Historical water quality time-series data and corresponding spatiotemporal attribute information from monitoring stations within the target sea area were collected. Spatial relationship matrices were constructed based on the correlation characteristics between monitoring stations, generating multi-graph structures with different spatial dependencies, including: Historical water quality time series data and related spatiotemporal attribute information of each monitoring station in the target sea area are collected, and the data are subjected to quality control and preprocessing. The historical water quality time series data includes physicochemical parameters, nutrient indexes, biological indicators and pollution indicators, and the spatiotemporal attribute information includes the geographical attributes, hydrological attributes and environmental driving factor data of each monitoring station. The geographical distance between monitoring stations is calculated based on their geographical coordinates. Spatial adjacency is defined based on the geographical distance, and a first spatial relationship matrix reflecting physical spatial proximity is constructed. Similarity analysis was performed on the historical time series of key water quality parameters of each monitoring station. The dynamic time-normalized distance between the time series of the stations was calculated and converted into relation weights to construct a second spatial relation matrix that reflects the similarity of changes in water quality parameters. Based on the hydrodynamic characteristics of the target sea area, the hydrological connectivity between stations is determined by using water exchange rate calculation, tidal current correlation analysis or water mass path analysis, and a third spatial relationship matrix reflecting hydrological connectivity is constructed. The first, second, and third spatial relation matrices are defined as graph adjacency matrices, generating independent graph structures that represent different spatial dependencies, thus forming a multi-graph structure for multi-level spatial correlation modeling.

3. The method for predicting water quality change trends in a specific sea area based on time series analysis according to claim 1, characterized in that, Multi-scale temporal features are extracted through parallel temporal convolution modules, and the dynamic spatial correlation between nodes is initially learned using a spatial attention mechanism. The output is a node embedding representation that fuses preliminary spatiotemporal features, including: By using multiple parallel temporal convolutional modules with convolutional kernels of different widths, short-term disturbance features, medium-term periodic features, and long-term trend features of water quality changes are obtained respectively. Each module adopts an expanded causal convolutional structure, and a gated linear unit is introduced after each convolutional layer to enhance nonlinear expressive power. The outputs of each branch are integrated through an adaptive weight fusion mechanism to generate multi-scale temporal feature representations. For each monitoring station, a learnable location encoding vector is generated. Combined with the temporal feature representation of the node, a node representation containing spatiotemporal prior information is generated. The dynamic spatial correlation between any two stations is calculated. A multi-layer multi-head attention architecture is used to capture spatial dependency patterns from different representation subspaces. An adaptive neighborhood selection mechanism is used to dynamically determine the relevant neighborhood range of each node. A hierarchical feature extraction architecture with local, regional, and global layers is established, and a spatiotemporal cross-attention module is introduced. Each layer adopts an attention mechanism with different resolutions to perform interaction between temporal and spatial feature representations. Temporal and spatial feature representations are combined through a gating fusion mechanism. Spatiotemporal features at different levels of abstraction are extracted through multi-hop feature propagation to generate node embedding representations that fuse preliminary spatiotemporal features.

4. The method for predicting water quality change trends in a specific sea area based on time series analysis according to claim 1, characterized in that, Spatial dependency modeling is performed using the spatial relationship matrix and node embedding representation of the multi-graph structure. Features are propagated across each graph structure through multi-graph convolution operations, and an adaptive weight fusion mechanism is used to weight and aggregate the convolution results from different graphs, including: Symmetric normalization is performed on each spatial relationship matrix, and each graph structure is independently stacked with multi-layer graph convolutional networks. Standard spectral graph convolution is used for the geographic proximity graph, attention-enhanced graph convolution is introduced for the water quality similarity graph, and direction-aware graph convolution is used for the hydrological connectivity graph to distinguish the effects of inflow and outflow. In each graph, the mean feature of all nodes is calculated to extract the global spatiotemporal context vector. The relevance score of each graph structure is calculated from four dimensions: feature consistency, spatiotemporal adaptability, prediction uncertainty, and historical performance memory. The multi-dimensional scores are fused and normalized through an attention mechanism to obtain the fusion weight. The fusion strategy is optimized using reinforcement learning. A state representation including node features, graph convolution output, and spatiotemporal context is defined. The fusion weights are used as the action space. A reward function that integrates prediction accuracy, weight stability, and exploration is designed. The optimal weight allocation strategy is learned through a deep reinforcement learning network. The confidence level of each graph's convolutional output is quantified. During fusion, the fusion weights are adjusted based on the confidence level. The adjusted adaptive fusion weights are then applied to perform weighted feature aggregation, which is combined with the original node features through residual connections. Finally, a feature representation of multi-level spatial dependence is output.

5. The method for predicting water quality change trends in a specific sea area based on time series analysis according to claim 4, characterized in that, The relevance scores of each graph structure are calculated from four dimensions: feature consistency, spatiotemporal adaptability, prediction uncertainty, and historical performance memory. The multi-dimensional scores are then fused using an attention mechanism and normalized to obtain the fusion weights, including: Calculate the cosine similarity between the current node's features and the convolutional output features of each graph, and obtain the relevance score of the feature consistency dimension; Based on the seasonal attributes, tidal phase, meteorological conditions, and geographical region and water depth of the node at the current prediction time, a spatiotemporal adaptability function is constructed to obtain the correlation score of the spatiotemporal adaptability dimension. The prediction uncertainty of each graph's convolution output is estimated by Monte Carlo Dropout, and the inverse of the uncertainty is normalized to obtain the correlation score of the prediction uncertainty dimension. Maintain the prediction performance records of each graph structure under similar historical spatiotemporal scenarios, retrieve the historical performance under the current scenario through the memory network, calculate the average accuracy, and obtain the relevance score of the historical performance memory dimension; The relevance scores of the four dimensions are input into a lightweight attention network to learn the dynamic importance weights of each dimension. The relevance scores of the multiple dimensions are weighted and summed, and then normalized by the Softmax function to generate fusion weights.

6. The method for predicting water quality change trends in a specific sea area based on time series analysis according to claim 1, characterized in that, The feature input after multi-graph convolution fusion is used to perform multi-step water quality prediction using a sequence model based on deep Siamese coding-decoding, including: A twin encoder branch is constructed to extract deterministic trend components and random fluctuation components of water quality sequences. The features after multi-graph convolution fusion are input into the deterministic trend encoder branch. Multi-scale temporal convolution is used to extract the deterministic trend components of water quality changes and output a deterministic encoding vector. The stochastic fluctuation encoder receives the residual between the original historical water quality time series and the deterministic prediction, and uses a variational autoencoder architecture to learn the probability distribution of the fluctuation component, and outputs a stochastic encoding vector representing the distribution. The deterministic decoder and the random decoder each receive the corresponding encoded vector and perform decoding in parallel. In the decoding time step, based on the prediction variance output by the random decoder, the fusion weight is dynamically calculated, and the deterministic decoding features and the random decoding features are weighted and fused to generate fused decoding features. By utilizing the fused decoding features, a multi-step prediction mechanism combining recursion and direct prediction is used to generate future multi-step water quality prediction values. By running a randomness decoder and sampling, multiple sets of fluctuation trajectories are generated and superimposed on the deterministic trend prediction component to generate possible future water quality sequences. The mean and variance of the predicted values ​​at each future time step are calculated to quantify the prediction uncertainty and output multi-step water quality prediction results with confidence intervals.

7. The method for predicting water quality change trends in a specific sea area based on time series analysis according to claim 6, characterized in that, Design multi-scale loss functions to train deep Siamese coding-decoding sequence models, including mean squared error loss for optimizing deterministic predictions and regularization loss for constraining random distributions; The course learning strategy is implemented, and the total training process is divided into several consecutive stages. In each training stage, the model is trained to complete a multi-step prediction task with a specific step length. The prediction step length increases with the stage, and the stage transition must meet the condition of convergence of the validation set loss. Within each training phase, training samples are dynamically selected based on a defined sample difficulty metric. When moving to the next phase, the model parameters obtained from the previous phase are inherited to perform targeted initialization of the network structure that expands due to the increase in prediction step size in the new phase. In the early stage of phase training, some trained layer parameters are selectively frozen for progressive fine-tuning until the model reconverges under the phase objective.

8. The method for predicting water quality change trends in a specific sea area based on time series analysis according to claim 1, characterized in that, Using a multivariate state estimation method, multiple sets of future scenario hypotheses are generated by perturbing key external driving factors, outputting a series of multi-scenario water quality prediction results corresponding to different environmental conditions, including: Key external driving factors affecting water quality in target sea areas are identified and classified into climate and meteorological factors, land-based input factors, marine dynamic factors, and ecological process factors. Statistical characteristics are calculated based on historical observation data of each factor, and the disturbance amplitudes of three levels—benchmark, moderate, and extreme—are set according to the historical standard deviation multiple. State vectors are constructed based on water quality parameter vectors, hydrological state vectors, and ecological state vectors. Orthogonal experimental design is used to combine perturbations of various driving factors at different levels to construct driving factor perturbation schemes. Based on the trained deep twin prediction model, a state transition function is constructed. A representative initial state is extracted from historical observations as the starting point, and different driving factor perturbation schemes are input in parallel to carry out rolling prediction, generating a set of multivariate water quality prediction trajectories corresponding to different environmental condition assumptions. The multivariate water quality prediction trajectory set is clustered using a dynamic time-warped distance-based clustering method to identify the similarity of trajectories in shape and evolution patterns, classify them into a limited number of typical pattern categories, analyze the characteristics of different categories of trajectories, and identify the key driving factor combinations and conditions for different evolution trends. For each predicted trajectory, a multidimensional risk assessment index is calculated, including the probability of water quality exceeding standards, the rate of deterioration of key parameters, and the degree of ecological impact. The trajectories are sorted according to the risk assessment results, and a representative subset of scenarios is selected from all trajectories using the K-medoids method. The water quality prediction result sequence corresponding to the representative subset of scenarios is output.

Citation Information

Cited By

  • A sewage state prediction method and system for a sewage treatment plant

    CN122198271A

  • Method and device for in-situ sampling and dynamic monitoring of shallow damaged groundwater stratification

    CN122218184A