A method, system, device, and medium for predicting water environment quality by integrating spatiotemporal attention mechanisms.

By integrating a spatiotemporal attention mechanism, the water environment quality prediction method solves the problem that traditional methods cannot take into account the characteristics of multiple time scales and sparse cross-regional monitoring in water quality prediction, and achieves accurate prediction and reliable early warning of the future state of water quality indicators.

CN122364708APending Publication Date: 2026-07-10YANGTZE BASIN ECOLOGY & ENVIRONMENT MONITORING & SCIENTIFIC RESEARCH CENTER YANGTZE BASIN ECOLOGY & ENVIRONMENT ADMINISTRATION MINISTRY OF ECOLOGY & ENVIRONMENT OF THE PEOPLES REPUBLIC OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
YANGTZE BASIN ECOLOGY & ENVIRONMENT MONITORING & SCIENTIFIC RESEARCH CENTER YANGTZE BASIN ECOLOGY & ENVIRONMENT ADMINISTRATION MINISTRY OF ECOLOGY & ENVIRONMENT OF THE PEOPLES REPUBLIC OF CHINA
Filing Date
2026-03-27
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Traditional water quality prediction methods are ill-suited to the non-stationary nature of aquatic environmental systems and the sparsity of cross-regional data. They cannot effectively characterize the trend and periodic evolution of water quality parameters at different time scales, and their prediction accuracy drops significantly under sparse monitoring points, making it impossible to achieve reliable early warning and precise control.

Method used

By adopting a spatiotemporal attention mechanism, spatiotemporal alignment and feature decoupling are performed by acquiring multi-source heterogeneous data. Combined with adaptive decomposition and multi-scale reconstruction, the spatiotemporal correlation coding network is used to mine the spatial correlation characteristics between monitoring points, identify key driving factors, and perform spatiotemporal fusion prediction to quantify uncertainty.

Benefits of technology

Accurately characterize the trend and periodic evolution of water quality indicators at different time scales, improve the feature representation accuracy in cross-regional sparse monitoring scenarios, enhance the reliability and interpretability of water quality prediction, and achieve accurate prediction in cross-regional water ecological monitoring scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122364708A_ABST
    Figure CN122364708A_ABST
Patent Text Reader

Abstract

This application relates to a method, system, device, and medium for predicting water environment quality by incorporating a spatiotemporal attention mechanism. The method includes: acquiring multi-source heterogeneous data from a target area; obtaining spatiotemporal collaborative feature data through spatiotemporal alignment and feature decoupling; adaptively decomposing and reconstructing this data at multiple scales to obtain multi-scale temporal series feature data representing the evolution patterns at multiple time scales; inputting this data into a spatiotemporal correlation coding network containing long short-term memory units and spatiotemporal attention mechanism units to obtain spatial attention-weighted feature data representing regional contributions; identifying and quantifying key influencing factor data; and inputting both data into a spatiotemporal fusion prediction network, combining uncertainty quantification and adaptive correction to obtain water quality prediction results. This method effectively addresses the challenges of traditional methods in handling the non-stationary characteristics of the water environment and the sparsity of cross-regional data, improving prediction reliability and interpretability, and providing support for reliable early warning and precise control of water environment quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of water quality monitoring, and in particular relates to a method, system, device and medium for predicting water environment quality by integrating a spatiotemporal attention mechanism. Background Technology

[0002] With the rapid development of water environment monitoring technology, water quality prediction has shifted from traditional empirical models to data-driven models. Water quality models based on physical mechanisms (such as WASP and QUAL2K) simulate the migration and transformation of pollutants in water bodies, enabling theoretical deductions of key indicators such as dissolved oxygen and total phosphorus. These methods possess clear physical meaning and interpretability. In recent years, with the widespread deployment of IoT monitoring devices, a large amount of multi-source heterogeneous monitoring data has accumulated in the water environment field, providing a data foundation for data-driven prediction methods based on machine learning.

[0003] Traditional techniques primarily employ statistical time-series analysis methods (such as the ARIMA model) or shallow machine learning methods (such as support vector machines and random forests) to model and predict water quality time-series data from a single monitoring point. These methods, by mining statistical patterns in historical data, establish a mapping relationship between input features and water quality indicators, and to some extent, can capture short-term trends in water quality parameters.

[0004] However, current traditional forecasting methods struggle to effectively address the challenges posed by the non-stationary nature of aquatic environmental systems and the sparsity of cross-regional data. On one hand, water quality indicators (such as dissolved oxygen and total phosphorus) are influenced by multiple factors, including hydrology, meteorology, and human activities, exhibiting significant nonlinear and non-stationary time-varying characteristics. Traditional methods struggle to simultaneously characterize their trend and periodic evolution patterns across different time scales. On the other hand, existing methods often focus on time-series modeling of single monitoring points, neglecting the spatial correlation and propagation characteristics of water quality parameters. This leads to a significant decrease in forecast accuracy in cross-regional scenarios with sparse monitoring points, hindering reliable early warning and precise control of water environmental quality. Summary of the Invention

[0005] Therefore, it is necessary to provide a method, system, device, and medium for predicting water environment quality that integrates a spatiotemporal attention mechanism to address the aforementioned technical problems.

[0006] Firstly, this application provides a water environment quality prediction method that integrates a spatiotemporal attention mechanism, including:

[0007] S1. Acquire multi-source heterogeneous data of the target monitoring area, and perform spatiotemporal alignment and feature decoupling on the multi-source heterogeneous data to obtain spatiotemporal collaborative feature data; wherein, the multi-source heterogeneous data includes time series monitoring data, spatial geographic data and environmental factor data;

[0008] S2. Adaptive decomposition and multi-scale reconstruction of the spatiotemporal collaborative feature data are performed to obtain multi-scale time series feature data; among which, the multi-scale time series feature data is used to characterize the trend and periodic evolution of water quality indicators at different time granularities.

[0009] S3. Input the multi-scale temporal feature data into the spatiotemporal correlation coding network to obtain spatial attention-weighted feature data; wherein, the spatiotemporal correlation coding network includes long short-term memory units and spatiotemporal attention mechanism units, and the spatial attention-weighted feature data is used to characterize the distribution of the contribution of different geographical regions to the water quality changes at the target location;

[0010] S4. Identify and quantify the importance of key driving factors in the spatial attention-weighted feature data to obtain key influencing factor data;

[0011] S5. Input the key influencing factor data and spatial attention weighted feature data into the spatiotemporal fusion prediction network to obtain the water quality prediction results; among them, the water quality prediction results are used to characterize the future state of water quality indicators in cross-regional water ecological monitoring scenarios.

[0012] In one embodiment, S1 includes:

[0013] S11. Standardize and normalize the timestamps of each monitoring point in the time series monitoring data to obtain unified time base data;

[0014] S12. Based on unified time-based data, the coordinates of monitoring points in spatial geographic data are encoded with geographic topology to obtain spatial adjacency matrix data.

[0015] S13. Based on the spatial adjacency matrix data, perform spatial lag feature extraction on the environmental factor data to obtain the spatial feature data of the environmental factors.

[0016] S14. Decouple and reconstruct the spatiotemporal features of the unified time reference data and the spatial feature data of environmental factors to obtain spatiotemporal collaborative feature data.

[0017] In one embodiment, S2 includes:

[0018] S21. Perform adaptive variational mode decomposition on the temporal components in the spatiotemporal co-feature data to obtain the intrinsic mode function component set data.

[0019] S22. Based on the intrinsic mode function component set data, perform Hilbert transform and instantaneous frequency extraction on each intrinsic mode function component to obtain time-frequency feature data;

[0020] S23. Based on the time-frequency characteristic data, perform trend discrimination and multi-scale aggregation processing on each intrinsic mode function component to obtain trend component data and periodic component data; among them, the trend component data is used to characterize the long-term evolution trend of water quality indicators, and the periodic component data is used to characterize the periodic fluctuation pattern of water quality indicators.

[0021] S24. Perform multi-scale time series reconstruction and hierarchical feature encoding on the trend component data and periodic component data to obtain multi-scale time series feature data.

[0022] In one embodiment, S3 includes:

[0023] S31. Long short-term memory encoding is performed on the features of each time scale in the multi-scale time series feature data to obtain hidden state sequence data.

[0024] S32. Dynamic attention weights are calculated on the hidden state sequence data and spatial adjacency matrix data through the spatiotemporal attention mechanism unit to obtain spatial attention coefficient matrix data; wherein, the spatial attention coefficient matrix data is used to characterize the dynamic importance of spatial association between monitoring points;

[0025] S33. Based on the spatial attention coefficient matrix data, the hidden state sequence data is subjected to spatial dimension attention weighted aggregation to obtain spatial aggregated feature data; wherein, the spatial aggregated feature data is used to characterize the point feature representation after fusing spatial context information;

[0026] S34. Perform spatiotemporal synergistic enhancement and residual connection on the spatial aggregated feature data to obtain spatial attention-weighted feature data.

[0027] In one embodiment, S4 includes:

[0028] S41. Perform nonlinear causal correlation mining on spatial attention-weighted feature data and environmental factor data to obtain candidate driving factor set data;

[0029] S42. Input the candidate driving factor set data into the factor importance assessment network, perform gradient backpropagation calculation on the predicted contribution of each environmental factor, and obtain factor gradient importance data.

[0030] S43. Based on the factor gradient importance data, adaptive threshold screening and redundancy elimination are performed on the candidate driving factors to obtain preliminary key factor data.

[0031] S44. Perform nonlinear redundancy analysis based on mutual information and minimum collinearity set optimization on the preliminary key factor data to obtain key influencing factor data.

[0032] In one embodiment, S5 includes:

[0033] S51. Perform dynamic embedding encoding and factor interaction feature extraction on key influencing factor data to obtain factor embedding feature data;

[0034] S52. Input the factor embedding feature data and spatial attention weighted feature data into the spatiotemporal fusion prediction network, and perform adaptive weighted fusion of the temporal spatial features and factor features to obtain fused feature data.

[0035] S53. Based on the fused feature data, perform sequence generative prediction of water quality indicators for multiple future time steps to obtain preliminary prediction sequence data; wherein, the preliminary prediction sequence data is used to characterize the predicted values ​​of water quality indicators for future time steps.

[0036] S54. Perform uncertainty quantification and confidence interval estimation on the preliminary predicted sequence data based on Monte Carlo dropout to obtain the predicted uncertainty data; wherein, the expression for the predicted uncertainty data is:

[0037]

[0038] In the formula, For predicting uncertain data, it is used to characterize the confidence level of the prediction results. For the number of samples taken in Monte Carlo, For the first The predicted value from the next sample. To predict the mean, The variance of the model's inherent noise;

[0039] S55. Based on the prediction uncertainty data, adaptive correction and sparse region enhancement are performed on the preliminary prediction sequence data to obtain the water quality prediction results.

[0040] Secondly, this application also provides a water environment quality prediction system that integrates a spatiotemporal attention mechanism, comprising:

[0041] The multi-source data fusion and feature decoupling module is used to acquire multi-source heterogeneous data of the target monitoring area, and to perform spatiotemporal alignment and feature decoupling on the multi-source heterogeneous data to obtain spatiotemporally coordinated feature data; among which, the multi-source heterogeneous data includes time-series monitoring data, spatial geographic data and environmental factor data;

[0042] The adaptive multi-scale decomposition module is used to adaptively decompose and reconstruct spatiotemporal collaborative feature data to obtain multi-scale time-series feature data. Among them, the multi-scale time-series feature data is used to characterize the trend and periodic evolution of water quality indicators at different time granularities.

[0043] The spatiotemporal attention coding module is used to input multi-scale temporal feature data into the spatiotemporal correlation coding network to obtain spatial attention-weighted feature data. The spatiotemporal correlation coding network includes long short-term memory units and spatiotemporal attention mechanism units. The spatial attention-weighted feature data is used to characterize the distribution of the contribution of different geographical regions to the water quality changes at the target location.

[0044] The factor importance quantification module is used to identify and quantify the importance of key driving factors in spatial attention-weighted feature data to obtain key influencing factor data.

[0045] The spatiotemporal fusion prediction module is used to input key influencing factor data and spatial attention-weighted feature data into the spatiotemporal fusion prediction network to obtain water quality prediction results; among which, the water quality prediction results are used to characterize the future state of water quality indicators in cross-regional water ecological monitoring scenarios.

[0046] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.

[0047] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0048] The aforementioned method, system, equipment, and medium for predicting water environment quality by integrating spatiotemporal attention mechanisms accurately characterize the trend and periodic evolution of water quality indicators at different time scales by performing spatiotemporal alignment and feature decoupling on multi-source heterogeneous data, combined with adaptive decomposition and multi-scale reconstruction. This overcomes the shortcomings of traditional methods that cannot take into account features at multiple time scales. By leveraging spatiotemporal correlation coding networks and spatial attention mechanisms, the spatial correlation characteristics between monitoring points are fully explored, which can improve the feature representation accuracy in cross-regional sparse monitoring scenarios. Through the identification and quantification of key driving factors, redundant factors are eliminated and model complexity is simplified. Combined with spatiotemporal fusion prediction and uncertainty quantification, the reliability and interpretability of water quality prediction can be improved. This enables accurate prediction of the future state of water quality indicators in cross-regional water ecological monitoring scenarios, providing strong support for reliable early warning and precise regulation of water environment quality. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 This is a flowchart illustrating a water environment quality prediction method that integrates a spatiotemporal attention mechanism in one embodiment.

[0051] Figure 2 This is a schematic diagram of the structure of a water environment quality prediction system that integrates a spatiotemporal attention mechanism in one embodiment. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0053] In one embodiment, reference Figure 1 The document presents a flowchart illustrating a water environment quality prediction method integrating a spatiotemporal attention mechanism, as provided in this application. This embodiment uses the application of this method to a water quality prediction terminal (hereinafter referred to as the terminal) as an example. It is understood that this method can also be applied to a server, or to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0054] S1. Acquire multi-source heterogeneous data of the target monitoring area, and perform spatiotemporal alignment and feature decoupling on the multi-source heterogeneous data to obtain spatiotemporal collaborative feature data.

[0055] The multi-source heterogeneous data includes time-series monitoring data, spatial geographic data, and environmental factor data. Time-series monitoring data mainly refers to water quality parameters continuously collected from fixed or mobile monitoring points over a period of time. These parameters may include, but are not limited to, time-series values ​​of indicators such as dissolved oxygen, total phosphorus, ammonia nitrogen, and permanganate index. Spatial geographic data can include the latitude and longitude coordinates, elevation information, river flow direction, river cross-sectional morphology, and watershed boundaries of each monitoring point. Environmental factor data can cover external factors that may affect water quality changes, including rainfall, temperature, sunshine duration, upstream inflow, and emission loads from surrounding industrial and agricultural pollution sources.

[0056] For example, the water quality prediction terminal acquires raw data from various sensor networks, online monitoring platforms, geographic information system databases, and meteorological and hydrological departments deployed in the target monitoring area via a data communication interface. This data comes from diverse sources and has different formats, constituting multi-source heterogeneous data. After acquiring this multi-source heterogeneous data, the water quality prediction terminal performs spatiotemporal alignment operations. This involves standardizing all data to the same time reference through timestamps and unifying all geographic information to the same projected coordinate system through spatial coordinate transformation. The water quality prediction terminal then performs feature decoupling on the spatiotemporally aligned data. Through feature decoupling, the raw data can be decomposed into feature components reflecting different physical origins. The water quality prediction terminal ultimately generates spatiotemporally coordinated feature data, which can integrate temporal evolution information and spatial location relationships.

[0057] S2. Adaptive decomposition and multi-scale reconstruction of spatiotemporal collaborative feature data are performed to obtain multi-scale temporal feature data.

[0058] For example, the water quality prediction terminal can use an adaptive decomposition algorithm to adaptively split the time-series components in the spatiotemporal collaborative feature data, decomposing the complex time-series signal into feature components of different frequencies and time granularities. Then, a multi-scale reconstruction algorithm can be used to integrate and optimize the decomposed feature components, retaining the key features that can reflect the long-term trend, medium-term cycle and short-term fluctuation of water quality indicators, and finally obtaining multi-scale time-series feature data. The multi-scale time-series feature data can be used to characterize the trend and periodic evolution of water quality indicators at different time granularities.

[0059] S3. Input the multi-scale temporal feature data into the spatiotemporal correlation coding network to obtain spatial attention-weighted feature data.

[0060] The spatiotemporal correlation coding network includes long short-term memory units and spatiotemporal attention mechanism units. Spatial attention-weighted feature data is used to characterize the distribution of the contribution of different geographical regions to the water quality changes at the target location.

[0061] For example, the spatiotemporal correlation coding network can capture temporal dependencies through long short-term memory units and mine spatial correlations through spatiotemporal attention mechanism units, thereby achieving collaborative encoding of spatiotemporal features. The water quality prediction terminal can input multi-scale temporal feature data into the spatiotemporal correlation coding network. First, the temporal features are encoded through long short-term memory units, then the spatial correlations are quantified through the spatiotemporal attention mechanism units, finally outputting spatial attention-weighted feature data. This attention-weighted feature data can highlight regional features that have a significant impact on water quality changes at target locations, improving the accuracy of feature representation.

[0062] S4. Identify and quantify the key driving factors and importance of the spatial attention-weighted feature data to obtain key influencing factor data.

[0063] For example, a water quality prediction terminal can filter and quantify environmental factor features in spatial attention-weighted feature data to identify key driving factors that dominate water quality changes and quantify the importance of these key driving factors, thus obtaining key influencing factor data. Since spatial attention-weighted feature data integrates spatiotemporal features but contains a large number of environmental factor-related features, the degree of influence of different environmental factors on water quality changes varies significantly, and some factors are redundant, increasing the complexity of subsequent prediction models and reducing prediction accuracy. By identifying and quantifying the importance of key driving factors in spatial attention-weighted feature data, the complexity of the prediction model is simplified, and the accuracy and interpretability of the prediction are improved.

[0064] S5. Input the key influencing factor data and spatial attention-weighted feature data into the spatiotemporal fusion prediction network to obtain the water quality prediction results.

[0065] Among them, the water quality prediction results are used to characterize the future state of water quality indicators in cross-regional water ecological monitoring scenarios.

[0066] For example, the water quality prediction terminal inputs key influencing factor data and spatial attention-weighted feature data into a spatiotemporal fusion prediction network to obtain water quality prediction results. Key influencing factor data reflects the core driving factors affecting water quality changes, while spatial attention-weighted feature data integrates the spatiotemporal synergistic features of water quality. The combination of these two provides comprehensive and accurate input features for water quality prediction. The spatiotemporal fusion prediction network achieves deep fusion of key factor features and spatiotemporal synergistic features, accurately predicting the future state of water quality indicators through time-series prediction algorithms. Simultaneously, it quantifies prediction uncertainty, improves the reliability of prediction results, and meets the needs of water quality early warning and precise regulation in cross-regional water ecological monitoring scenarios.

[0067] The aforementioned water environment quality prediction method, which integrates a spatiotemporal attention mechanism, accurately depicts the trend and periodic evolution of water quality indicators at different time scales by performing spatiotemporal alignment and feature decoupling on multi-source heterogeneous data, combined with adaptive decomposition and multi-scale reconstruction. This overcomes the shortcomings of traditional methods that cannot comprehensively capture the time-varying characteristics of water quality. By leveraging a spatiotemporal correlation coding network to mine spatial correlations between monitoring points and highlighting the contributions of key areas through spatial attention weighting, the accuracy of feature representation in cross-regional sparse monitoring scenarios can be improved. By simplifying model complexity through key driving factor identification and redundancy elimination, combined with spatiotemporal fusion prediction and uncertainty quantification, the reliability and accuracy of water quality prediction can be improved. This enables accurate prediction of the future state of water quality indicators in cross-regional water ecological monitoring scenarios, providing strong support for reliable early warning and precise regulation of water environment quality.

[0068] In an optional embodiment, S1 includes:

[0069] S11. Standardize and normalize the timestamps of each monitoring point in the time series monitoring data to obtain unified time base data.

[0070] Optionally, the water quality prediction terminal can standardize the timestamps of all monitoring points using a unified time format, converting timestamps of different formats into a unified time encoding form, and then mapping the timestamps to a preset time interval through a normalization algorithm. This eliminates errors caused by differences in time references and ensures that the time series data of each monitoring point are consistent in the time dimension, resulting in unified time reference data. The time format can be UTC time.

[0071] S12. Based on unified time-based data, the coordinates of monitoring points in spatial geographic data are encoded using geographic topology to obtain spatial adjacency matrix data.

[0072] Optionally, after unifying the time base, the water quality prediction terminal extracts the latitude and longitude coordinates of each monitoring point from the spatial geographic data. Combined with the water system topology of the target area, the water quality prediction terminal can use a geographic topology coding algorithm to construct the spatial association between monitoring points. Specifically, the water quality prediction terminal can determine the spatial adjacency between monitoring points by calculating the Euclidean distance and water system connectivity between each monitoring point, quantifying the spatial association into a spatial adjacency matrix. The elements in the matrix can be used to characterize the spatial association strength between two monitoring points. The closer the spatial distance and the stronger the water system connectivity, the larger the corresponding matrix element value, and vice versa, thus obtaining spatial adjacency matrix data that can accurately reflect the spatial distribution and association of monitoring points.

[0073] S13. Based on the spatial adjacency matrix data, perform spatial lag feature extraction on the environmental factor data to obtain the spatial feature data of the environmental factors.

[0074] Optionally, environmental factor data exhibits significant spatial correlations. Environmental factors in one region can influence the water quality of surrounding areas through water flow, atmospheric diffusion, and other mechanisms. Based on spatial adjacency matrix data, the water quality prediction terminal can employ a spatial lag model to extract spatial lag features from the environmental factor data. By calculating the mean, extreme values, and other statistical characteristics of environmental factors at neighboring points around each monitoring point, the terminal can uncover the spatial propagation patterns and correlations of environmental factors. The extracted spatial lag features are then fused with the original environmental factor data to obtain spatial feature data of environmental factors, thereby achieving effective mining of spatial information about environmental factors. These environmental factors may include, but are not limited to, rainfall and wastewater discharge.

[0075] S14. Decouple and reconstruct the spatiotemporal features of the unified time reference data and the spatial feature data of environmental factors to obtain spatiotemporal collaborative feature data.

[0076] Optionally, the water quality prediction terminal can use a feature decoupling algorithm to extract the temporal trend features and periodic features from the unified time reference data, as well as the spatial correlation features and regional difference features from the spatial feature data of environmental factors, and remove duplicate and redundant feature information. Then, through a feature fusion and reconstruction algorithm, the temporal features and spatial features are deeply fused to construct spatiotemporal collaborative feature data that takes into account both the evolution law of the time dimension and the correlation characteristics of the spatial dimension.

[0077] In an optional embodiment, S2 includes:

[0078] S21. Adaptive variational mode decomposition is performed on the temporal components in the spatiotemporal co-feature data to obtain the intrinsic mode function component set data.

[0079] Optionally, the water quality prediction terminal can use the time-series components in the spatiotemporal collaborative feature data as input to obtain preset core parameters such as the number of decomposition modes and penalty factors. Through iterative optimization of the adaptive variational mode decomposition algorithm, the time-series components can be adaptively decomposed into multiple intrinsic mode function components. Each component corresponds to the variation characteristics of water quality indicators in a certain frequency range. All components together constitute the intrinsic mode function component set data, thereby achieving the initial decomposition of time-series features.

[0080] S22. Based on the intrinsic mode function component set data, perform Hilbert transform and instantaneous frequency extraction on each intrinsic mode function component to obtain time-frequency feature data.

[0081] Optionally, the water quality prediction terminal can perform a Hilbert transform on each component in the intrinsic mode function component set to obtain the corresponding complex-valued signal. Then, by calculating the amplitude change of the complex-valued signal, the instantaneous frequency and instantaneous amplitude of each component are extracted. The water quality prediction terminal can integrate the instantaneous frequencies and instantaneous amplitudes of all intrinsic mode function components to obtain time-frequency characteristic data that can comprehensively reflect the time-frequency distribution characteristics of water quality time series. The instantaneous frequency can be used to characterize the rate of time change corresponding to that component, and the instantaneous amplitude can be used to characterize the signal strength of that component.

[0082] S23. Based on the time-frequency characteristic data, perform trend discrimination and multi-scale aggregation processing on each intrinsic mode function component to obtain trend component data and periodic component data.

[0083] Among them, the trend component data can be used to characterize the long-term evolution trend of water quality indicators, while the periodic component data can be used to characterize the periodic fluctuation pattern of water quality indicators.

[0084] Optionally, the water quality prediction terminal can perform trend discrimination on each intrinsic mode function component based on the instantaneous frequency in the time-frequency characteristic data, identifying components with low instantaneous frequency and gradual changes as trend-related components, i.e., trend component data; the water quality prediction terminal can identify components with high instantaneous frequency and periodic fluctuations as periodic-related components, i.e., periodic component data; the water quality prediction terminal can use a multi-scale aggregation algorithm to fuse and aggregate all trend-related components to obtain trend component data; the water quality prediction terminal can classify and aggregate all periodic-related components to obtain periodic component data at different periodic scales, thereby enabling the classification and extraction of water quality time-series characteristics.

[0085] S24. Perform multi-scale time series reconstruction and hierarchical feature encoding on the trend component data and periodic component data to obtain multi-scale time series feature data.

[0086] Optionally, the water quality prediction terminal can employ a multi-scale time series reconstruction algorithm to spatiotemporally align trend component data with periodic component data at different periodic scales, and hierarchically integrate them according to the order of time granularity from large to small to construct a multi-scale time series feature framework. Then, through a hierarchical feature encoding algorithm, the reconstructed multi-scale time series features are encoded to convert features at different time scales into feature vectors of a unified dimension, highlighting the correlation and differences of features at each time scale, and finally obtaining multi-scale time series feature data.

[0087] In an optional embodiment, S3 includes:

[0088] S31. Long short-term memory encoding is performed on the features of each time scale in the multi-scale time series feature data to obtain the hidden state sequence data.

[0089] Optionally, the water quality prediction terminal can split the multi-scale time series feature data according to the time scale and input them into the Long Short-Term Memory (LSTM) unit respectively. The input gate controls the input of time series features, the forget gate discards irrelevant historical features, and the output gate outputs the hidden state at the current moment. The time series features of each time scale are encoded time by time, and finally the hidden state sequence data that can comprehensively reflect the multi-scale time series dependencies can be obtained.

[0090] S32. Dynamic attention weights are calculated on the hidden state sequence data and spatial adjacency matrix data through the spatiotemporal attention mechanism unit to obtain spatial attention coefficient matrix data.

[0091] Among them, the spatiotemporal attention mechanism unit can be used to adaptively mine the influence weights of different monitoring points on the target point, overcoming the defect of fixed weights in traditional spatial feature fusion.

[0092] Optionally, the water quality prediction terminal can input hidden state sequence data and spatial adjacency matrix data into the spatiotemporal attention mechanism unit. First, spatial feature mapping is performed on the hidden state sequence data to obtain spatial feature representations of each monitoring point. Then, combined with the spatial correlation strength in the spatial adjacency matrix data, an attention weight calculation algorithm dynamically calculates the attention weight of each monitoring point relative to the target point. The larger the weight value, the greater the influence of that monitoring point on the water quality changes at the target point. All weight values ​​constitute the spatial attention coefficient matrix data, thereby enabling dynamic quantification of the importance of spatial correlation. The spatial attention coefficient matrix data can be used to characterize the dynamic importance of spatial correlations between monitoring points.

[0093] S33. Based on the spatial attention coefficient matrix data, perform spatial attention weighted aggregation on the hidden state sequence data to obtain spatial aggregated feature data.

[0094] Optionally, after obtaining the spatial attention coefficient matrix data, the water quality prediction terminal can employ a weighted aggregation algorithm to multiply each weight value in the spatial attention coefficient matrix with the corresponding monitoring point feature in the hidden state sequence data, thereby weighting the features of different monitoring points. Then, all weighted monitoring point features are summed and aggregated to deeply fuse the spatial features of surrounding monitoring points with the temporal features of the target point, resulting in spatially aggregated feature data. This spatially aggregated feature data can be used to characterize the point feature representation after fusing spatial context information.

[0095] S34. Perform spatiotemporal synergistic enhancement and residual connection on the spatial aggregated feature data to obtain spatial attention-weighted feature data.

[0096] Optionally, the water quality prediction terminal can perform spatiotemporal collaborative enhancement processing on the spatially aggregated feature data. Through feature enhancement algorithms, the correlation and recognizability of spatiotemporal features are strengthened, and key feature information is highlighted. The water quality prediction terminal can introduce residual connections to perform residual fusion between the spatially aggregated feature data and the original multi-scale temporal feature data, retaining key information in the original features and making up for information loss in the feature encoding process, thereby obtaining spatial attention-weighted feature data.

[0097] In an optional embodiment, S4 includes:

[0098] S41. Perform nonlinear causal correlation mining on spatial attention-weighted feature data and environmental factor data to obtain candidate driving factor set data.

[0099] Optionally, the water quality prediction terminal can employ a nonlinear causal correlation mining algorithm to perform causal correlation analysis on water quality-related features in spatial attention-weighted feature data and the features of each factor in environmental factor data. This determines the strength of the causal relationship between each environmental factor and water quality changes, and filters out environmental factors with a causal relationship strength greater than a preset threshold to form a candidate driving factor set. Redundant factors with no obvious correlation to water quality changes are initially eliminated, thus obtaining the candidate driving factor set. The nonlinear causal correlation mining algorithm can be a Bayesian network, Granger causality test, etc.

[0100] S42. Input the candidate driving factor set data into the factor importance assessment network, perform gradient backpropagation calculation on the predicted contribution of each environmental factor, and obtain factor gradient importance data.

[0101] Optionally, the factor importance assessment network can be constructed based on a deep learning framework, which can be used to quantify the contribution of each candidate driving factor to the water quality prediction results. The water quality prediction terminal can input the set of candidate driving factor data into the factor importance assessment network, calculate the preliminary prediction contribution value of each factor through forward propagation, and then calculate the gradient influence value of each candidate driving factor on the prediction results through the gradient backpropagation algorithm. The larger the absolute value of the gradient influence value, the higher the contribution of the factor to the water quality prediction results. By integrating the gradient influence values ​​of all candidate driving factors, factor gradient importance data can be obtained, thereby realizing the quantification of the contribution of candidate driving factors.

[0102] S43. Based on the factor gradient importance data, adaptive threshold screening and redundancy elimination are performed on the candidate driving factors to obtain preliminary key factor data.

[0103] Optionally, to further screen out core driving factors, the water quality prediction terminal can use an adaptive threshold algorithm based on factor gradient importance data. According to the distribution characteristics of gradient importance, the terminal can automatically determine the screening threshold, retain candidate driving factors with gradient importance values ​​greater than the screening threshold, and remove candidate driving factors with gradient importance values ​​less than the threshold. The water quality prediction terminal can also perform redundancy elimination processing on the retained candidate driving factors. By calculating the correlation coefficient between factors, redundant factors with high correlation can be removed to avoid information redundancy between factors, and finally, preliminary key factor data can be obtained.

[0104] S44. Perform nonlinear redundancy analysis based on mutual information and minimum collinearity set optimization on the preliminary key factor data to obtain key influencing factor data.

[0105] Optionally, mutual information can be used to measure the degree of nonlinear correlation between preliminary key factors. The water quality prediction terminal can calculate the mutual information value between any two factors in the preliminary key factor data, determine the degree of redundancy between factors based on the mutual information value, and further screen factors with high redundancy. The water quality prediction terminal can also use a minimum collinearity set optimization algorithm to optimize the combination of preliminary key factors, construct a minimum collinearity key factor set, avoid the multicollinearity problem between factors from affecting subsequent prediction models, and finally obtain key influencing factor data.

[0106] In an optional embodiment, S5 includes:

[0107] S51. Perform dynamic embedding encoding and factor interaction feature extraction on key influencing factor data to obtain factor embedding feature data.

[0108] Optionally, the water quality prediction terminal can use a dynamic embedding coding algorithm to standardize the key influencing factor data, map each factor to a unified feature space, and obtain standardized factor feature vectors. The water quality prediction terminal can also use a factor interaction feature extraction algorithm to mine the interaction relationships between factors, extract factor interaction features, and fuse the standardized factor feature vectors with the factor interaction features to obtain factor embedding feature data.

[0109] S52. Input the factor embedding feature data and spatial attention weighted feature data into the spatiotemporal fusion prediction network, and perform adaptive weighted fusion of the temporal spatial features and factor features to obtain fused feature data.

[0110] Optionally, the spatiotemporal fusion prediction network can incorporate an adaptive weighted fusion module, which can be used to dynamically allocate fusion weights based on the contribution of the two features to the prediction results. The water quality prediction terminal can input factor-embedded feature data and spatial attention-weighted feature data into the spatiotemporal fusion prediction network. Through a weight calculation algorithm, the fusion weights of the two features are calculated separately. The weight values ​​are positively correlated with the predictive contribution of the features. The two features are then weighted and fused according to their corresponding weights, achieving deep synergy between temporal spatial features and key factor features, resulting in fusion feature data that comprehensively characterizes the driving factors and spatiotemporal evolution patterns of water quality changes.

[0111] S53. Based on the fused feature data, perform sequence generative prediction of water quality indicators for multiple future time steps to obtain preliminary prediction sequence data.

[0112] Optionally, the water quality prediction terminal can employ a sequence generation algorithm. Using fused feature data as input, it generates predicted water quality indicators for multiple future time steps through forward propagation computation. The predicted values ​​for all time steps constitute preliminary prediction sequence data, which can be used to initially reflect the future trends in water quality indicators. Specifically, the preliminary prediction sequence data characterizes the predicted water quality indicator values ​​for future time steps. The sequence generation algorithm can employ temporal generative adversarial networks, long short-term memory prediction networks, etc.

[0113] S54. Perform uncertainty quantification and confidence interval estimation based on Monte Carlo dropout on the preliminary predicted sequence data to obtain the predicted uncertainty data.

[0114] Alternatively, the expression for predicting uncertain data can be:

[0115]

[0116] In the formula, For predicting uncertain data, it is used to characterize the confidence level of the prediction results. For the number of samples taken in Monte Carlo, For the first The predicted value from the next sample. To predict the mean, This represents the inherent noise variance of the model.

[0117] Schematic, in the above expression for predicting uncertainty data, For predicting uncertain data, the confidence level of the prediction result can be characterized. The larger the value, the higher the uncertainty and the lower the confidence level of the prediction result; conversely, the smaller the value, the more reliable the prediction result. Monte Carlo sampling count refers to the total number of independent samplings performed by the water quality prediction terminal during the spatiotemporal fusion prediction network inference process. Multiple samplings can reduce the impact of random errors on uncertainty quantification and improve the stability of quantification results. For the first The predicted values ​​from each sampling, i.e., the water quality index predictions obtained through forward propagation of the network after randomly discarding some nodes each time, are the basic data constituting the quantification of uncertainty. To predict the mean, from The second sampling obtained Group The arithmetic mean is obtained by calculating the arithmetic mean and can be used to characterize... The central tendency of the subsampled prediction results is a benchmark for measuring prediction bias. The inherent noise variance refers to the inherent error of the spatiotemporal fusion prediction network itself due to factors such as model structure and parameter settings. It is not affected by the sampling process and can be used to correct the uncertainty of the model itself that is not covered during the sampling process, thus ensuring the integrity of the prediction uncertainty data.

[0118] For example, during the inference process of the spatiotemporal fusion prediction network, the water quality prediction terminal can randomly discard some nodes in the network multiple times to perform... Sub-independent sampling yields Group predicted values, calculation mean of group predicted values Then, based on the expression for the predicted uncertainty data mentioned above, the predicted uncertainty data is calculated. Meanwhile, confidence interval estimation is performed based on uncertain data to obtain water quality prediction confidence intervals at different confidence levels.

[0119] S55. Based on the prediction uncertainty data, adaptive correction and sparse region enhancement are performed on the preliminary prediction sequence data to obtain the water quality prediction results.

[0120] Optionally, the water quality prediction terminal can adaptively correct the preliminary prediction sequence data based on the prediction uncertainty data. For prediction values ​​with high uncertainty, it can be corrected by combining key influencing factor data and spatial adjacency matrix data to reduce prediction bias. The water quality prediction terminal can also use a sparse region enhancement algorithm for sparse monitoring points, combining the prediction information of surrounding monitoring points and spatial correlation characteristics to enhance and optimize the prediction values ​​of the sparse region, thereby improving the prediction accuracy of the sparse region. After correction and enhancement processing, water quality prediction results can be obtained. These results can be used to characterize the future state of water quality indicators in cross-regional water ecological monitoring scenarios, providing data support for reliable early warning and precise control of water environment quality.

[0121] The aforementioned water environment quality prediction method integrating spatiotemporal attention mechanisms acquires multi-source heterogeneous data and performs spatiotemporal alignment and feature decoupling. Combined with adaptive decomposition and multi-scale reconstruction, it can accurately characterize the trend and periodic evolution of water quality indicators at different time scales, overcoming the shortcomings of traditional methods that cannot take into account features at multiple time scales. By mining the spatial correlation characteristics between monitoring points through a spatiotemporal correlation coding network and quantifying the contribution of different regions to the target points through a spatial attention mechanism, it can improve the feature representation accuracy in sparse cross-regional monitoring point scenarios. By identifying and quantifying key driving factors, eliminating redundant factors, and optimizing feature inputs, it simplifies model complexity while improving prediction interpretability. Finally, through spatiotemporal fusion prediction and uncertainty quantification, it can achieve accurate prediction of the future state of water quality indicators, providing strong support for reliable early warning and precise control of cross-regional water environment quality, and effectively making up for the shortcomings of traditional methods.

[0122] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0123] Based on the same inventive concept, this application also provides a water environment quality prediction system that integrates a spatiotemporal attention mechanism for implementing the aforementioned method for predicting water environment quality using a spatiotemporal attention mechanism. The solution provided by this system is similar to the implementation described in the above method. Therefore, the specific limitations of one or more embodiments of a water environment quality prediction system integrating a spatiotemporal attention mechanism provided below can be found in the limitations of the water environment quality prediction method integrating a spatiotemporal attention mechanism described above, and will not be repeated here.

[0124] In one exemplary embodiment, such as Figure 2 As shown, a schematic diagram of a water environment quality prediction system 10 integrating a spatiotemporal attention mechanism is provided, including:

[0125] The multi-source data fusion and feature decoupling module 11 is used to acquire multi-source heterogeneous data of the target monitoring area, and to perform spatiotemporal alignment and feature decoupling on the multi-source heterogeneous data to obtain spatiotemporal collaborative feature data; wherein, the multi-source heterogeneous data includes time series monitoring data, spatial geographic data and environmental factor data;

[0126] The adaptive multi-scale decomposition module 12 is used to adaptively decompose and reconstruct the spatiotemporal collaborative feature data to obtain multi-scale time series feature data; among which, the multi-scale time series feature data is used to characterize the trend and periodic evolution of water quality indicators at different time granularities.

[0127] The spatiotemporal attention coding module 13 is used to input multi-scale temporal feature data into the spatiotemporal correlation coding network to obtain spatial attention weighted feature data; wherein, the spatiotemporal correlation coding network includes long short-term memory units and spatiotemporal attention mechanism units, and the spatial attention weighted feature data is used to characterize the distribution of the contribution of different geographical regions to the water quality changes of the target point;

[0128] The factor importance quantification module 14 is used to identify and quantify the importance of key driving factors in spatial attention-weighted feature data to obtain key influencing factor data.

[0129] The spatiotemporal fusion prediction module 15 is used to input key influencing factor data and spatial attention weighted feature data into the spatiotemporal fusion prediction network to obtain water quality prediction results; among which, the water quality prediction results are used to characterize the future state of water quality indicators in cross-regional water ecological monitoring scenarios.

[0130] Furthermore, the multi-source data fusion and feature decoupling module 11 can also be used for:

[0131] S11. Standardize and normalize the timestamps of each monitoring point in the time series monitoring data to obtain unified time base data;

[0132] S12. Based on unified time-based data, the coordinates of monitoring points in spatial geographic data are encoded with geographic topology to obtain spatial adjacency matrix data.

[0133] S13. Based on the spatial adjacency matrix data, perform spatial lag feature extraction on the environmental factor data to obtain the spatial feature data of the environmental factors.

[0134] S14. Decouple and reconstruct the spatiotemporal features of the unified time reference data and the spatial feature data of environmental factors to obtain spatiotemporal collaborative feature data.

[0135] Furthermore, the adaptive multi-scale decomposition module 12 can also be used for:

[0136] S21. Perform adaptive variational mode decomposition on the temporal components in the spatiotemporal co-feature data to obtain the intrinsic mode function component set data.

[0137] S22. Based on the intrinsic mode function component set data, perform Hilbert transform and instantaneous frequency extraction on each intrinsic mode function component to obtain time-frequency feature data;

[0138] S23. Based on the time-frequency characteristic data, perform trend discrimination and multi-scale aggregation processing on each intrinsic mode function component to obtain trend component data and periodic component data; among them, the trend component data is used to characterize the long-term evolution trend of water quality indicators, and the periodic component data is used to characterize the periodic fluctuation pattern of water quality indicators.

[0139] S24. Perform multi-scale time series reconstruction and hierarchical feature encoding on the trend component data and periodic component data to obtain multi-scale time series feature data.

[0140] Furthermore, the spatiotemporal attention encoding module 13 can also be used for:

[0141] S31. Long short-term memory encoding is performed on the features of each time scale in the multi-scale time series feature data to obtain hidden state sequence data.

[0142] S32. Dynamic attention weights are calculated on the hidden state sequence data and spatial adjacency matrix data through the spatiotemporal attention mechanism unit to obtain spatial attention coefficient matrix data; wherein, the spatial attention coefficient matrix data is used to characterize the dynamic importance of spatial association between monitoring points;

[0143] S33. Based on the spatial attention coefficient matrix data, the hidden state sequence data is subjected to spatial dimension attention weighted aggregation to obtain spatial aggregated feature data; wherein, the spatial aggregated feature data is used to characterize the point feature representation after fusing spatial context information;

[0144] S34. Perform spatiotemporal synergistic enhancement and residual connection on the spatial aggregated feature data to obtain spatial attention-weighted feature data.

[0145] Furthermore, the factor importance quantification module 14 can also be used for:

[0146] S41. Perform nonlinear causal correlation mining on spatial attention-weighted feature data and environmental factor data to obtain candidate driving factor set data;

[0147] S42. Input the candidate driving factor set data into the factor importance assessment network, perform gradient backpropagation calculation on the predicted contribution of each environmental factor, and obtain factor gradient importance data.

[0148] S43. Based on the factor gradient importance data, adaptive threshold screening and redundancy elimination are performed on the candidate driving factors to obtain preliminary key factor data.

[0149] S44. Perform nonlinear redundancy analysis based on mutual information and minimum collinearity set optimization on the preliminary key factor data to obtain key influencing factor data.

[0150] Furthermore, the spatiotemporal fusion prediction module 15 can also be used for:

[0151] S51. Perform dynamic embedding encoding and factor interaction feature extraction on key influencing factor data to obtain factor embedding feature data;

[0152] S52. Input the factor embedding feature data and spatial attention weighted feature data into the spatiotemporal fusion prediction network, and perform adaptive weighted fusion of the temporal spatial features and factor features to obtain fused feature data.

[0153] S53. Based on the fused feature data, perform sequence generative prediction of water quality indicators for multiple future time steps to obtain preliminary prediction sequence data; wherein, the preliminary prediction sequence data is used to characterize the predicted values ​​of water quality indicators for future time steps.

[0154] S54. Perform uncertainty quantification and confidence interval estimation based on Monte Carlo dropout on the preliminary predicted sequence data to obtain the predicted uncertainty data;

[0155] S55. Based on the prediction uncertainty data, adaptive correction and sparse region enhancement are performed on the preliminary prediction sequence data to obtain the water quality prediction results.

[0156] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of a water environment quality prediction method incorporating a spatiotemporal attention mechanism as described above.

[0157] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0158] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0159] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.

Claims

1. A water environment quality prediction method integrating spatiotemporal attention mechanisms, characterized in that, The method includes: S1. Acquire multi-source heterogeneous data of the target monitoring area, and perform spatiotemporal alignment and feature decoupling on the multi-source heterogeneous data to obtain spatiotemporal collaborative feature data; wherein, the multi-source heterogeneous data includes time-series monitoring data, spatial geographic data and environmental factor data; S2. Adaptive decomposition and multi-scale reconstruction are performed on the spatiotemporal collaborative feature data to obtain multi-scale time-series feature data; wherein, the multi-scale time-series feature data is used to characterize the trend and periodic evolution of water quality indicators at different time granularities. S3. Input the multi-scale temporal feature data into the spatiotemporal correlation coding network to obtain spatial attention-weighted feature data; wherein, the spatiotemporal correlation coding network includes long short-term memory units and spatiotemporal attention mechanism units, and the spatial attention-weighted feature data is used to characterize the distribution of the contribution of different geographical regions to the water quality changes at the target location; S4. Identify and quantify the importance of key driving factors in the spatial attention-weighted feature data to obtain key influencing factor data; S5. Input the key influencing factor data and the spatial attention weighted feature data into the spatiotemporal fusion prediction network to obtain the water quality prediction results; wherein, the water quality prediction results are used to characterize the future state of water quality indicators in cross-regional water ecological monitoring scenarios.

2. The method according to claim 1, characterized in that, S1 includes: S11. Standardize and normalize the timestamps of each monitoring point in the time-series monitoring data to obtain unified time reference data; S12. Based on the unified time reference data, the coordinates of the monitoring points in the spatial geographic data are encoded using geographic topology to obtain spatial adjacency matrix data. S13. Based on the spatial adjacency matrix data, perform spatial lag feature extraction processing on the environmental factor data to obtain spatial feature data of environmental factors. S14. Perform spatiotemporal feature decoupling and fusion reconstruction on the unified time reference data and the spatial feature data of environmental factors to obtain the spatiotemporal collaborative feature data.

3. The method according to claim 2, characterized in that, S2 includes: S21. Perform adaptive variational mode decomposition on the temporal components in the spatiotemporal collaborative feature data to obtain the intrinsic mode function component set data. S22. Based on the intrinsic mode function component set data, perform Hilbert transform and instantaneous frequency extraction on each intrinsic mode function component to obtain time-frequency feature data; S23. Based on the time-frequency characteristic data, perform trend discrimination and multi-scale aggregation processing on each intrinsic mode function component to obtain trend component data and periodic component data; wherein, the trend component data is used to characterize the long-term evolution trend of water quality indicators, and the periodic component data is used to characterize the periodic fluctuation law of water quality indicators. S24. Perform multi-scale time series reconstruction and hierarchical feature encoding on the trend component data and the periodic component data to obtain the multi-scale time series feature data.

4. The method according to claim 3, characterized in that, S3 includes: S31. Long short-term memory encoding is performed on each time scale feature in the multi-scale time series feature data through the long short-term memory unit to obtain hidden state sequence data. S32. The spatiotemporal attention mechanism unit performs dynamic attention weight calculation on the hidden state sequence data and the spatial adjacency matrix data to obtain spatial attention coefficient matrix data; wherein, the spatial attention coefficient matrix data is used to characterize the dynamic importance of spatial association between monitoring points; S33. Based on the spatial attention coefficient matrix data, the hidden state sequence data is subjected to spatial dimension attention weighted aggregation to obtain spatial aggregated feature data; wherein, the spatial aggregated feature data is used to characterize the point feature representation after fusing spatial context information; S34. Perform spatiotemporal dimensional collaborative enhancement and residual connection on the spatial aggregated feature data to obtain the spatial attention-weighted feature data.

5. The method according to claim 4, characterized in that, S4 includes: S41. Perform nonlinear causal correlation mining processing on the spatial attention-weighted feature data and environmental factor data to obtain candidate driving factor set data; S42. Input the candidate driving factor set data into the factor importance assessment network, perform gradient backpropagation calculation on the predicted contribution of each environmental factor, and obtain factor gradient importance data. S43. Based on the factor gradient importance data, adaptive threshold screening and redundancy elimination are performed on the candidate driving factors to obtain preliminary key factor data. S44. Perform nonlinear redundancy analysis based on mutual information and minimum collinearity set optimization on the preliminary key factor data to obtain the key influencing factor data.

6. The method according to claim 5, characterized in that, S5 includes: S51. Dynamically embedding and encoding the key influencing factor data and extracting factor interaction features to obtain factor embedding feature data; S52. Input the factor embedding feature data and the spatial attention weighted feature data into the spatiotemporal fusion prediction network, and perform adaptive weighted fusion of the temporal spatial features and factor features to obtain fused feature data. S53. Based on the fused feature data, perform sequence-generative prediction of water quality indicators for multiple future time steps to obtain preliminary prediction sequence data; wherein, the preliminary prediction sequence data is used to characterize the predicted values ​​of water quality indicators for future time steps. S54. Perform uncertainty quantification and confidence interval estimation based on Monte Carlo dropout on the preliminary predicted sequence data to obtain predicted uncertainty data; wherein, the expression for the predicted uncertainty data is: In the formula, For predicting uncertain data, it is used to characterize the confidence level of the prediction results. For the number of samples taken in Monte Carlo, For the first The predicted value from the next sample. To predict the mean, The variance of the model's inherent noise; S55. Based on the prediction uncertainty data, adaptive correction and sparse region enhancement are performed on the preliminary prediction sequence data to obtain the water quality prediction result.

7. A water environment quality prediction system integrating spatiotemporal attention mechanisms, characterized in that, The system includes: The multi-source data fusion and feature decoupling module is used to acquire multi-source heterogeneous data of the target monitoring area, and to perform spatiotemporal alignment and feature decoupling on the multi-source heterogeneous data to obtain spatiotemporal collaborative feature data; wherein, the multi-source heterogeneous data includes time-series monitoring data, spatial geographic data and environmental factor data; An adaptive multi-scale decomposition module is used to adaptively decompose and reconstruct the spatiotemporal collaborative feature data to obtain multi-scale time-series feature data; wherein, the multi-scale time-series feature data is used to characterize the trend and periodic evolution of water quality indicators at different time granularities. The spatiotemporal attention coding module is used to input the multi-scale temporal feature data into the spatiotemporal correlation coding network to obtain spatial attention weighted feature data; wherein, the spatiotemporal correlation coding network includes long short-term memory units and spatiotemporal attention mechanism units, and the spatial attention weighted feature data is used to characterize the distribution of the contribution of different geographical regions to the water quality changes at the target location; The factor importance quantification module is used to identify and quantify the importance of key driving factors in the spatial attention-weighted feature data to obtain key influencing factor data. The spatiotemporal fusion prediction module is used to input the key influencing factor data and the spatial attention weighted feature data into the spatiotemporal fusion prediction network to obtain water quality prediction results; wherein, the water quality prediction results are used to characterize the future state of water quality indicators in cross-regional water ecological monitoring scenarios.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.