Method, system and equipment for predicting total nitrogen concentration of river channel station and storage medium
By employing adaptive wavelet packet decomposition, hydraulic time delay maps, and cross-band self-attention fusion, the problem of insufficient accuracy in predicting total nitrogen in water quality in existing technologies is solved, achieving high-precision and stable prediction of total nitrogen concentration, which is applicable to river water quality management and pollution control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 广东省广州生态环境监测中心站
- Filing Date
- 2025-12-01
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies struggle to simultaneously address the multi-scale time-varying characteristics and spatial transport patterns of total nitrogen in water quality prediction, resulting in limited prediction accuracy, especially in accurately capturing abnormal water quality changes during sudden events.
A method based on single-element frequency domain joint prediction is adopted, which uses adaptive dynamic wavelet packet decomposition, weighted directed hydraulic time delay map, graph convolutional network and cross-frequency band self-attention fusion, combined with stacked dilated convolutional temporal network, to achieve high-precision prediction of total nitrogen concentration.
It improves the accuracy and stability of total nitrogen concentration prediction, effectively captures long-term trends and sudden anomalies, and is suitable for multi-site, multi-scale river water quality management and pollution control.
Smart Images

Figure CN121880906A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of water environment monitoring and prediction technology, specifically to a method, system, equipment and storage medium for predicting total nitrogen concentration at river stations, and particularly to a method for predicting total nitrogen concentration at river stations based on single-element frequency domain joint prediction, which falls under the category of water quality modeling and early warning technology. Background Technology
[0002] Total nitrogen in rivers is an important water quality indicator, reflecting eutrophication and pollution levels, and has a significant impact on the ecological environment and human health. Current total nitrogen prediction methods mostly employ time series models or machine learning approaches, but these methods struggle to account for the multi-scale time-varying characteristics of the signal and the spatial transmission patterns of river networks, thus limiting prediction accuracy.
[0003] Especially during sudden events such as torrential rains, total nitrogen in water quality exhibits significant and abnormal changes, which traditional models struggle to accurately capture. In recent years, with the development of artificial intelligence technology, deep learning-based water quality prediction methods have gradually emerged. These methods can automatically learn features from data, improving prediction accuracy. However, existing deep learning models primarily focus on time series modeling, neglecting the impact of hydraulic time delays on water quality changes, and have not yet achieved significant breakthroughs in multi-frequency band information fusion.
[0004] Therefore, there is an urgent need for a water quality prediction method that can simultaneously consider multi-dimensional information such as time, frequency, and space to comprehensively improve the accuracy and stability of total nitrogen concentration prediction. Summary of the Invention
[0005] This disclosure provides a method, system, device, and storage medium for predicting total nitrogen concentration at river stations, in order to solve or alleviate one or more of the above-mentioned technical problems in the prior art, such as overcoming the problem of insufficient consideration of time-frequency characteristics and hydraulic transmission effects in the prior art, and improving the accuracy and stability of total nitrogen concentration prediction.
[0006] This disclosure proposes a method for predicting total nitrogen concentration at river stations based on single-element frequency domain joint prediction. The core of this method lies in dynamic time-frequency decoupling, multi-scale hydraulic time delay map construction, and cross-frequency band self-attention fusion. Combined with a stacked dilated convolutional time-series network, it achieves high-precision medium- and long-term total nitrogen prediction.
[0007] According to one aspect of this disclosure, a method for predicting total nitrogen concentration at river stations is provided, comprising: Obtain time series of total nitrogen concentrations from multiple river stations; Adaptive dynamic wavelet packet decomposition is performed on the total nitrogen concentration time series of each river station to obtain signal components of multiple frequency bands corresponding to each river station. The signal components include components representing seasonal cycles and components representing anomalous changes. A weighted directed hydraulic time delay graph is constructed based on the river network topology of multiple river stations. Using the signal components of the multiple frequency bands as node features, a graph convolutional network is used to perform spatial convolution on the weighted directed hydraulic time delay map to extract spatial enhancement features. By utilizing the cross-band self-attention mechanism and combining the aforementioned spatial enhancement features, the weights between frequency bands are calculated, and multi-band signal weighted fusion and phase alignment are performed to output the fused spatiotemporal features. A stacked dilated convolutional temporal prediction network is constructed to perform deep temporal modeling on the fused spatiotemporal features and output the predicted total nitrogen concentration for future time periods. The predicted total nitrogen concentration for the future period is continuously evaluated and optimized by combining sliding window backtesting and anomaly threshold self-correction mechanism, and the optimization results are obtained and published.
[0008] In one possible implementation, the total nitrogen concentration time series of each river station is subjected to adaptive dynamic wavelet packet decomposition to obtain signal components in multiple frequency bands corresponding to each river station, including: Calculate the signal rate of change of the total nitrogen concentration time series at the multiple river stations; The number of wavelet packet decomposition layers is dynamically determined based on the rate of change of the signal. Using the aforementioned wavelet packet decomposition level, adaptive dynamic wavelet packet decomposition is performed on the total nitrogen concentration time series of multiple river stations to obtain signal components in different frequency bands; Calculate the energy spectrum of signal components in each frequency band and identify abnormal frequency band components; The abnormal frequency band components are separated into components that characterize seasonal cycles and components that characterize anomalous mutations.
[0009] In one possible implementation, a weighted directed hydraulic time delay map is constructed based on the river network topology of multiple river stations, including: Based on the geographic information system data of the river channel, construct the river network topology of the river stations; The nodes of the river network topology are defined as river stations, and the edges represent river connections. The hydraulic time delay of each edge is calculated based on the river flow velocity and length, and used as the edge weight to form a weighted directed hydraulic time delay graph. Calculate the hydraulic time delay of each side based on the river's flow velocity and length, and use it as the weight of the side. The flow velocity and length data of the river channel are updated regularly, and the weights of the edges are adjusted to reflect real-time hydraulic conditions.
[0010] In one possible implementation, the graph convolutional network employs a weighted adjacency matrix with self-loops to perform multi-layer spatial convolution on node features.
[0011] In one possible implementation, the cross-band self-attention mechanism filters key frequency bands based on inter-band mutual information and uses self-attention weights to perform weighted fusion of multi-band signals.
[0012] In one possible implementation, the stacked dilated convolutional temporal prediction network includes multiple dilated convolutional layers and residual connections.
[0013] In one possible implementation, the component representing anomalous mutations is input as an independent feature channel along with the component representing seasonal cycles into a graph convolutional network and a self-attention module.
[0014] According to one aspect of this disclosure, a system for predicting total nitrogen concentration at river stations is provided, comprising: The acquisition unit is used to acquire the time series of total nitrogen concentrations from multiple river stations. The decomposition unit is used to perform adaptive dynamic wavelet packet decomposition on the total nitrogen concentration time series of each river station to obtain signal components of multiple frequency bands corresponding to each river station. The signal components include components representing seasonal cycles and components representing anomalous changes. The building unit is used to construct a weighted directed hydraulic time delay map based on the river network topology of multiple river stations; The extraction unit is used to take the signal components of the multiple frequency bands as node features, and use a graph convolutional network to perform spatial convolution on the weighted directed hydraulic time delay map to extract spatial enhancement features. The fusion unit is used to utilize the cross-band self-attention mechanism, combined with the spatial enhancement features, to calculate the inter-band weights, perform multi-band signal weighted fusion and phase alignment, and output the fused spatiotemporal features. The output unit is used to construct a stacked dilated convolutional temporal prediction network, perform deep temporal modeling on the fused spatiotemporal features, and output the predicted value of total nitrogen concentration for future time periods. The optimization unit is used to continuously evaluate and optimize the predicted total nitrogen concentration for the future time period by combining sliding window backtesting and anomaly threshold self-correction mechanism, and to obtain and publish the optimization results.
[0015] According to one aspect of this disclosure, an apparatus is provided, comprising: Processor and memory; The memory is used to store computer programs, and the processor calls the computer programs stored in the memory to execute the total nitrogen concentration prediction method for river stations described above.
[0016] According to one aspect of this disclosure, a computer-readable storage medium is provided, wherein a computer program is stored therein, which, when executed by a processor, enables the processor to perform the total nitrogen concentration prediction method for river stations as described in any of the preceding claims.
[0017] This disclosure has the following beneficial effects: (1) Multi-scale feature extraction: Through adaptive wavelet packet decomposition, signals at different time scales can be effectively separated, improving the model's ability to capture multi-scale features.
[0018] (2) Accurate modeling of hydraulic time delay effect: The constructed hydraulic time delay map can accurately depict the hydraulic transmission time delay between stations, and improve the model's ability to model spatial correlation.
[0019] (3) Multi-band information fusion: The introduced cross-band self-attention mechanism can fully explore the information sharing between different frequency bands and improve the information fusion capability of the model.
[0020] (4) Long-term trend and anomaly capture: Stacked dilated convolutional temporal prediction network can expand the receptive field of the model and enhance the ability to capture long-term trends and sudden anomalies.
[0021] (5) Real-time prediction and early warning: The integrated prediction, evaluation and real-time release mechanism can ensure the stability and practicality of the model, and provide scientific basis and technical support for river water quality management and pollution control.
[0022] Details of one or more embodiments of this application are set forth in the following drawings and description. Other features and advantages of this application will become apparent from the accompanying drawings. It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not intended to limit this disclosure. Attached Figure Description
[0023] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0024] Figure 1 This is a flowchart of a method for predicting total nitrogen concentration at river stations, as exemplified in this embodiment. Figure 2 This is a flowchart of a method for predicting total nitrogen concentration at river stations based on single-element frequency domain joint prediction, as described in this exemplary embodiment. Figure 3This is a schematic diagram of the dynamic time-frequency decoupling and anomaly separation process of this exemplary embodiment; Figure 4 This is a schematic diagram of the process of constructing a hydraulic delay-weighted directed graph based on a river network in this exemplary embodiment; Figure 5 This is a schematic diagram of the cross-band self-attention fusion process in this exemplary embodiment; Figure 6 This is a schematic diagram of the prediction process using a stacked dilated convolutional temporal prediction network in this exemplary embodiment; Figure 7 This is a block diagram of a total nitrogen concentration prediction system for river stations, as exemplified in this embodiment. Figure 8 This is a schematic diagram of the structure of a device according to an exemplary embodiment of this invention. Detailed Implementation
[0025] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0026] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware units or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0027] The flowchart shown in the attached diagram is merely an illustrative example and does not necessarily include all steps. For example, some steps may be broken down, while others may be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0028] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in a sequence other than those illustrated or described herein.
[0029] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or device that includes a series of steps or sub-modules is not necessarily limited to those steps or sub-modules that are explicitly listed, but may include other steps or sub-modules that are not explicitly listed or that are inherent to such process, method, product, or device.
[0030] Figure 1 This is a flowchart of a method for predicting total nitrogen concentration at river stations, as described in this exemplary embodiment. Figure 1 As shown, an exemplary embodiment of this disclosure provides a method for predicting total nitrogen concentration at river stations, including: Obtain time series of total nitrogen concentrations from multiple river stations; Adaptive dynamic wavelet packet decomposition is performed on the total nitrogen concentration time series of each river station to obtain signal components of multiple frequency bands corresponding to each river station. The signal components include components representing seasonal cycles and components representing anomalous changes. A weighted directed hydraulic time delay graph is constructed based on the river network topology of multiple river stations. Using the signal components of the multiple frequency bands as node features, a graph convolutional network is used to perform spatial convolution on the weighted directed hydraulic time delay map to extract spatial enhancement features. By utilizing the cross-band self-attention mechanism and combining the aforementioned spatial enhancement features, the weights between frequency bands are calculated, and multi-band signal weighted fusion and phase alignment are performed to output the fused spatiotemporal features. A stacked dilated convolutional temporal prediction network is constructed to perform deep temporal modeling on the fused spatiotemporal features and output the predicted total nitrogen concentration for future time periods. The predicted total nitrogen concentration for the future period is continuously evaluated and optimized by combining sliding window backtesting and anomaly threshold self-correction mechanism, and the optimization results are obtained and published.
[0031] like Figure 2As shown, this embodiment proposes a method for predicting total nitrogen concentration at river stations based on single-element frequency domain joint prediction. Addressing the shortcomings of existing models in simultaneously considering complex spatiotemporal frequency domain features and hydraulic transmission effects, this method improves the accuracy and stability of total nitrogen concentration prediction. First, this embodiment employs adaptive dynamic wavelet packet decomposition to perform multi-level frequency domain decomposition on the total nitrogen concentration time series, dynamically selecting the decomposition level to effectively separate short-term anomalous components caused by extreme weather events such as rainstorms from seasonal periodic components, obtaining clean signal input at multiple scales. Subsequently, based on the river network topology, a weighted directed hydraulic time delay graph is constructed. Edge weights are calculated using river flow velocity and length to reflect the time delay effect of hydraulic transmission between stations, and a rolling update mechanism is used to dynamically adjust the graph, ensuring the temporal alignment of spatial dependencies. Based on this time delay graph, a graph convolutional network (GCN) is applied to extract spatially enhanced multi-band features, capturing the spatial dependencies and transmission patterns of upstream and downstream stations. Next, utilizing a cross-band self-attention mechanism and combining GCN output features, inter-band mutual information is calculated to screen key frequency bands, achieving frequency band weight recalibration and phase alignment, thus completing the weighted fusion of multi-band spatiotemporal information. Finally, a stacked dilated convolutional temporal prediction network is constructed to perform deep temporal modeling of the fused features, capturing long-term trends and sudden anomalies. Combined with a sliding window backtesting and anomaly threshold self-correction mechanism, stable evaluation and real-time release of prediction results are achieved, providing scientific basis and technical support for river water quality management and pollution early warning. This embodiment has good generalization ability and application prospects, suitable for high-precision prediction of total nitrogen concentration at multiple sites and scales, especially demonstrating superior prediction performance and stability compared to traditional methods under abnormal events such as heavy rainstorms.
[0032] Specifically, adaptive dynamic wavelet packet decomposition is performed on the total nitrogen concentration time series of each river station to obtain signal components in multiple frequency bands corresponding to each river station, including: Calculate the signal rate of change of the total nitrogen concentration time series at the multiple river stations; The number of wavelet packet decomposition layers is dynamically determined based on the rate of change of the signal. Using the aforementioned wavelet packet decomposition level, adaptive dynamic wavelet packet decomposition is performed on the total nitrogen concentration time series of multiple river stations to obtain signal components in different frequency bands; Calculate the energy spectrum of signal components in each frequency band and identify abnormal frequency band components; The abnormal frequency band components are separated into components that characterize seasonal cycles and components that characterize anomalous mutations.
[0033] like Figure 3 As shown, adaptive wavelet packet decomposition: wavelet packet decomposition is performed on the total nitrogen concentration time series, and the decomposition level is dynamically selected to effectively separate the sudden signals caused by extreme weather such as rainstorms from seasonal periodic signals, ensuring the purity of subsequent model inputs and multi-scale representation capabilities.
[0034] Specifically, the dynamic time-frequency decoupling and anomaly separation steps include: An adaptive wavelet packet decomposition strategy is adopted to dynamically select the decomposition level based on the characteristic change rate of total nitrogen time series, decomposing the signal into rainstorm impact mutation component and seasonal periodic component, removing noise influence and ensuring the effectiveness of subsequent modeling input.
[0035] To effectively separate the seasonal periodic components and abrupt anomalous components in the time series of total nitrogen concentration at river stations, this embodiment employs an adaptive wavelet packet decomposition method.
[0036] Wavelet packet decomposition was performed on the total nitrogen concentration time series to obtain signal components in different frequency bands. The energy spectrum of each frequency band component was calculated to identify the main periodic components. By setting a threshold, frequency band components with abrupt changes in the energy spectrum were identified as anomalous components. Anomalous signals were treated as independent channels, and their temporal information was preserved as auxiliary inputs for spatial feature extraction and frequency band fusion. Anomalous signals and periodic signals were reconstructed separately and then input into a GCN (Graph Convolutional Network) to ensure that the model can account for the impact of anomalous events on total nitrogen concentration, thereby improving the robustness and accuracy of predictions.
[0037] The criteria for anomaly detection are: ; The original total nitrogen concentration time series is The i-th frequency band component obtained by wavelet packet decomposition Its energy spectrum is , is the energy threshold of the i-th frequency band.
[0038] Specifically, based on the river network topology of multiple river stations, a weighted directed hydraulic time delay map is constructed, including: Based on the geographic information system data of the river channel, construct the river network topology of the river stations; The nodes of the river network topology are defined as river stations, and the edges represent river connections. The hydraulic time delay of each edge is calculated based on the river flow velocity and length, and used as the edge weight to form a weighted directed hydraulic time delay graph. Calculate the hydraulic time delay of each side based on the river's flow velocity and length, and use it as the weight of the side. The flow velocity and length data of the river channel are updated regularly, and the weights of the edges are adjusted to reflect real-time hydraulic conditions.
[0039] like Figure 4As shown, a weighted directed hydraulic time-delay graph is constructed: based on the river network topology, a weighted directed hydraulic time-delay graph is built, where nodes represent monitoring stations and edges represent river connections. The edge weights are calculated using water flow transmission delay, accurately characterizing the time-delay effect of hydraulic transmission between stations, dynamically updating hydraulic conditions, and ensuring time-shift alignment of spatial associations. Based on this weighted directed graph, a graph convolutional network (GCN) is used for spatial feature extraction. The GCN utilizes the adjacency matrix of the weighted hydraulic time-delay graph to perform spatial convolution on the frequency domain features of each station, capturing the spatial dependence and propagation patterns between upstream and downstream stations. The GCN output serves as the graph fusion feature, which is then input into the subsequent self-attention mechanism.
[0040] Specifically, the hydraulic time delay map is constructed and updated as follows: To account for the time delay effect of river flow, this embodiment constructs a hydraulic time delay map based on the river network topology. Using river stations as nodes, a weighted directed graph is constructed according to the river flow direction and river segment length, with edge weights calculated using water flow transmission delay. A rolling update mechanism synchronizes changes in hydraulic conditions, ensuring the time-shift alignment and dynamic adjustment of spatial dependencies.
[0041] Based on Geographic Information System (GIS) data of the river channel, a topological map of the river channel is constructed, where nodes represent monitoring stations and edges represent river connections. The hydraulic delay of each edge is calculated based on the river's flow velocity and length, serving as the edge weight. The flow velocity and length data are periodically updated, and the edge weights are adjusted to maintain the timeliness of the graph.
[0042] The formula for calculating hydraulic time delay is: ; in, The hydraulic delay between station i and station j is... Let the flow rate be between the i-th and j-th stations. Let be the length of the river channel between stations i and j.
[0043] Specifically, the graph convolutional network uses a weighted adjacency matrix with self-loops to perform multi-layer spatial convolution on node features.
[0044] In this embodiment, after the hydraulic time delay graph is constructed, a graph convolutional layer is introduced: ; in, It is the adjacency matrix A plus the identity matrix I of the original weighted hydraulic time delay graph. For the node features of the (l+1)th layer, for The degree matrix, For activation function, The weights are for the l-th layer. The node feature matrix is initialized with multi-band feature vectors obtained from frequency domain decomposition, and spatial context features are extracted through GCN. The GCN output is used as input to the cross-band self-attention fusion module to achieve joint modeling of spatiotemporal information.
[0045] Specifically, the cross-band self-attention mechanism filters key frequency bands based on inter-band mutual information and uses self-attention weights to perform weighted fusion of multi-band signals.
[0046] like Figure 5 As shown, cross-band self-attention fusion: This stage receives spatial enhancement features extracted by GCN and performs weighted fusion with frequency band information. Mutual information is used to drive the selection of key upstream frequency bands, and a self-attention mechanism is employed to weightedly fuse multi-band information, enhancing the spatial-frequency domain feature representation. A mutual information-driven cross-band self-attention mechanism is introduced to recalibrate the weights and align the phases of information from different frequency bands, fully exploring the multi-band influence of upstream sites on the total nitrogen concentration of the target site. Self-attention not only fuses frequency bands but also fuses the spatial relationships obtained from graph convolution.
[0047] In this embodiment, the cross-band self-attention mechanism is implemented as follows: Based on the spatially enhanced multi-band features extracted by GCN, and combined with mutual information-driven filtering, key frequency bands and upstream sites that significantly contribute to the target site are selected. Using the GCN output features as input, the self-attention mechanism completes cross-band weight recalibration and phase alignment, ensuring the effective transmission and fusion of key information. The self-attention module calculates the correlation between signals in different frequency bands, assigning higher weights to important frequency bands to achieve joint modeling of multi-band spatiotemporal information.
[0048] The total nitrogen concentration time series was divided into multiple frequency bands, each containing a certain range of frequency components. For each frequency band signal, its correlation with signals from other frequency bands was calculated to obtain attention weights. Based on the attention weights, the information from each frequency band was weighted and fused to obtain a comprehensive feature representation.
[0049] The formula for calculating attention weights is: ; Wherein, the signal of the i-th frequency band is Its signal in the j-th frequency band The correlation is , for and The similarity, where k is the index of all frequency bands. This indicates a signal in the k-band. for and The similarity.
[0050] Specifically, the stacked dilated convolutional temporal prediction network includes multiple dilated convolutional layers and residual connections.
[0051] like Figure 6 As shown, the stacked dilated convolutional temporal network expands the model's receptive field, enhances the ability to capture long-term trends and sudden anomalies, and utilizes the fusion features from self-attention and GCN for temporal prediction, effectively improving the medium- and long-term prediction performance of total nitrogen concentration.
[0052] Specifically, the component representing abnormal mutations is input as an independent feature channel, along with the component representing seasonal cycles, into the graph convolutional network and the self-attention module.
[0053] In this embodiment, a stacked dilated convolutional temporal prediction network is used to model the spatiotemporal features after cross-frequency band fusion. The input feature shape is (number of sites × time step × feature dimension), which includes spatial information fused by GCN and frequency band information weighted by self-attention. Multiple layers of dilated convolutions expand the receptive field to capture long-term trends and sudden anomalies in total nitrogen concentration. Residual connections alleviate gradient vanishing and ensure the stability of deep network training. The network outputs a prediction of total nitrogen concentration for future time periods through a fully connected layer at the end.
[0054] Dilated convolutional layers are used to expand the receptive field and capture dependencies over long time spans. Multiple dilated convolutional layers are stacked sequentially to form a deep network structure. Residual connections are introduced between each layer to alleviate the vanishing gradient problem and facilitate information flow. Predicted total nitrogen concentration values for future time periods are output through fully connected layers.
[0055] The dilated convolution operation is as follows: ; in, This represents the output value calculated by the convolution operation at time step t, where the dilation rate is d and ke is the size of the convolution kernel. This means retrieving data from a specific point in the past from the input. This indicates the position of the input data involved in the calculation, determined based on the current output time t, dilation rate d, and convolution kernel i. This represents the weight parameters corresponding to the dilated convolution kernel i.
[0056] In this embodiment, prediction evaluation and real-time publishing are implemented: Model stability and anomaly early warning functions are achieved through sliding window backtesting and anomaly threshold self-correction, and the prediction results are output to the business platform. The introduction of a prediction evaluation and real-time publishing mechanism ensures the model's stability and usability, and the prediction results and anomaly alarm information are published to the water environment management platform in real time for relevant departments to reference.
[0057] In this embodiment, evaluation and real-time publishing are implemented to ensure the stability and usability of the model. A predictive evaluation and real-time publishing mechanism is introduced. A sliding window method is used to periodically backtest the model and evaluate its predictive performance. Based on the backtest results, the anomaly detection threshold is automatically adjusted to improve the accuracy of anomaly detection. The prediction results and anomaly alarm information are published in real-time to the water environment management platform for relevant departments to reference.
[0058] ; ; in, Let be the prediction error value at time t; The actual observed value at time t; Let be the model prediction value at time t; and These are the mean and standard deviation of the prediction error, respectively. This is for adjusting the coefficient.
[0059] Example: A method for predicting total nitrogen concentration at river stations based on single-element frequency domain joint prediction includes the following steps: Adaptive dynamic wavelet packet decomposition is performed on the total nitrogen concentration time series to separate anomalous change signals from seasonal periodic components; a weighted directed hydraulic time delay graph based on the river network topology is constructed, and hydraulic time delay is calculated using river flow velocity and length, with edge weights dynamically updated to reflect changes in hydraulic conditions; based on this weighted directed graph, a graph convolutional network (GCN) is used to spatially convolve the multi-frequency band features of each station to extract spatially enhanced features; using a cross-frequency band self-attention mechanism, combined with the output features of the GCN, the weights between frequency bands are calculated, and multi-frequency band information is weighted, fused, and phase-aligned; a stacked dilated convolutional temporal prediction network is constructed to temporally model the fused features, capture long-term trends and sudden anomalies, and complete the prediction of total nitrogen concentration for future periods; combined with a sliding window backtesting and anomaly threshold self-correction mechanism, the prediction results are continuously evaluated and released in real time.
[0060] The adaptive dynamic wavelet packet decomposition dynamically adjusts the decomposition level based on the signal change rate, ensuring effective separation of signals at different time scales. The edge weights of the hydraulic time delay graph are calculated using the water flow transmission delay and defined as the ratio of river segment length to flow velocity, and are periodically updated to adapt to real-time hydraulic conditions. The graph convolutional network employs a weighted adjacency matrix with self-loops, performing multi-layer spatial convolution on the multi-frequency band features of nodes to enhance spatial dependency modeling capabilities. The cross-frequency band self-attention mechanism filters key frequency bands based on inter-band mutual information and uses self-attention weights to weightedly fuse multi-frequency band signals, enhancing the spatiotemporal frequency domain feature representation. The stacked dilated convolutional temporal prediction network includes multiple dilated convolutional layers and residual connections. The input is a spatiotemporal fusion feature with a shape of number of stations × time step × feature dimension, and the output is a predicted value for future total nitrogen concentration. Abnormal signal components are treated as independent feature channels and input together with periodic signal components into the graph convolutional network and self-attention module, ensuring that abnormal information is fully utilized. This embodiment also includes a sliding window-based prediction backtesting mechanism to dynamically adjust the anomaly detection threshold, improving the accuracy and stability of anomaly warnings. This embodiment also includes real-time publishing of prediction results and anomaly warning information to the river water quality management platform to assist in environmental monitoring and pollution control.
[0061] Figure 7 This is a block diagram of a total nitrogen concentration prediction system for river stations, as described in this exemplary embodiment. Figure 7 As shown, an exemplary embodiment of this disclosure provides a total nitrogen concentration prediction system for river stations, comprising: The acquisition unit is used to acquire the time series of total nitrogen concentrations from multiple river stations. The decomposition unit is used to perform adaptive dynamic wavelet packet decomposition on the total nitrogen concentration time series of each river station to obtain signal components of multiple frequency bands corresponding to each river station. The signal components include components representing seasonal cycles and components representing anomalous changes. The building unit is used to construct a weighted directed hydraulic time delay map based on the river network topology of multiple river stations; The extraction unit is used to take the signal components of the multiple frequency bands as node features, and use a graph convolutional network to perform spatial convolution on the weighted directed hydraulic time delay map to extract spatial enhancement features. The fusion unit is used to utilize the cross-band self-attention mechanism, combined with the spatial enhancement features, to calculate the inter-band weights, perform multi-band signal weighted fusion and phase alignment, and output the fused spatiotemporal features. The output unit is used to construct a stacked dilated convolutional temporal prediction network, perform deep temporal modeling on the fused spatiotemporal features, and output the predicted value of total nitrogen concentration for future time periods. The optimization unit is used to continuously evaluate and optimize the predicted total nitrogen concentration for the future time period by combining sliding window backtesting and anomaly threshold self-correction mechanism, and to obtain and publish the optimization results.
[0062] Figure 8 This is a schematic diagram of the structure of a device according to an exemplary embodiment of this invention. Figure 8 As shown, corresponding to the above-described method for predicting total nitrogen concentration at river stations, this disclosure also provides a device. Since the embodiments of this device are similar to the above-described method embodiments, the description is relatively simple; relevant details can be found in the description of the above-described method embodiments. The device described below is merely illustrative. The device may include: a processor 1, a memory 2, a communication bus (i.e., the aforementioned device bus), and a lookup engine. The processor 1 and the memory 2 communicate with each other via the communication bus and communicate with external systems via a communication interface. The processor 1 can call logical instructions in the memory 2 to execute the method for predicting total nitrogen concentration at river stations.
[0063] Furthermore, the logical instructions in the aforementioned memory 2 can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as memory chips, USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0064] On the other hand, this disclosure also provides a processor-readable storage medium storing a computer program 3, which, when executed by a processor 1, is implemented to perform the river station total nitrogen concentration prediction method provided in the above embodiments.
[0065] The processor-readable storage medium can be any available medium or data storage device that the processor 1 can access, including but not limited to magnetic memory (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO)), optical memory (e.g., CD, DVD, BD, HVD), and semiconductor memory (e.g., ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)).
[0066] The above are merely preferred embodiments of this disclosure. The scope of protection of this disclosure is not limited to the above embodiments. All technical solutions falling within the scope of this disclosure are protected. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of this disclosure should be considered within the scope of protection of this disclosure.
Claims
1. A method of predicting total nitrogen concentration at a river site, characterized by, include: Obtain time series of total nitrogen concentrations from multiple river stations; Adaptive dynamic wavelet packet decomposition is performed on the total nitrogen concentration time series of each river station to obtain signal components of multiple frequency bands corresponding to each river station. The signal components include components representing seasonal cycles and components representing anomalous changes. A weighted directed hydraulic time delay graph is constructed based on the river network topology of multiple river stations. Using the signal components of the multiple frequency bands as node features, a graph convolutional network is used to perform spatial convolution on the weighted directed hydraulic time delay map to extract spatial enhancement features. By utilizing the cross-band self-attention mechanism and combining the aforementioned spatial enhancement features, the weights between frequency bands are calculated, and multi-band signal weighted fusion and phase alignment are performed to output the fused spatiotemporal features. A stacked dilated convolutional temporal prediction network is constructed to perform deep temporal modeling on the fused spatiotemporal features and output the predicted total nitrogen concentration for future time periods. The predicted total nitrogen concentration for the future period is continuously evaluated and optimized by combining sliding window backtesting and anomaly threshold self-correction mechanism, and the optimization results are obtained and published.
2. The riverway site total nitrogen concentration prediction method according to claim 1, characterized by, Adaptive dynamic wavelet packet decomposition was performed on the total nitrogen concentration time series of each river station to obtain signal components in multiple frequency bands corresponding to each river station, including: Calculate the signal rate of change of the total nitrogen concentration time series at the multiple river stations; The number of wavelet packet decomposition layers is dynamically determined based on the rate of change of the signal. Using the aforementioned wavelet packet decomposition level, adaptive dynamic wavelet packet decomposition is performed on the total nitrogen concentration time series of multiple river stations to obtain signal components in different frequency bands; Calculate the energy spectrum of signal components in each frequency band and identify abnormal frequency band components; The abnormal frequency band components are separated into components that characterize seasonal cycles and components that characterize anomalous mutations.
3. The riverway site total nitrogen concentration prediction method according to claim 1, characterized by, Based on the river network topology of multiple river stations, a weighted directed hydraulic time delay map is constructed, including: Based on the geographic information system data of the river channel, construct the river network topology of the river stations; The nodes of the river network topology are defined as river stations, and the edges represent river connections. The hydraulic time delay of each edge is calculated based on the river flow velocity and length, and used as the edge weight to form a weighted directed hydraulic time delay graph. Calculate the hydraulic time delay of each side based on the river's flow velocity and length, and use it as the weight of the side. The flow velocity and length data of the river channel are updated regularly, and the weights of the edges are adjusted to reflect real-time hydraulic conditions.
4. The method for predicting total nitrogen concentration at river stations according to claim 1, characterized in that, The graph convolutional network employs a weighted adjacency matrix with self-loops to perform multi-layer spatial convolution on node features.
5. The method for predicting total nitrogen concentration at river stations according to claim 1, characterized in that, The cross-band self-attention mechanism filters key frequency bands based on inter-band mutual information and uses self-attention weights to perform weighted fusion of multi-band signals.
6. The method for predicting total nitrogen concentration at river stations according to claim 1, characterized in that, The stacked dilated convolutional temporal prediction network includes multiple dilated convolutional layers and residual connections.
7. The method for predicting total nitrogen concentration at river stations according to claim 1, characterized in that, The component representing abnormal mutations is used as an independent feature channel and is input into the graph convolutional network and self-attention module along with the component representing seasonal cycles.
8. A river course site total nitrogen concentration prediction system characterized by comprising: a river course site total nitrogen concentration prediction device according to any one of claims 1 to 7. include: The acquisition unit is used to acquire the time series of total nitrogen concentrations from multiple river stations. The decomposition unit is used to perform adaptive dynamic wavelet packet decomposition on the total nitrogen concentration time series of each river station to obtain signal components of multiple frequency bands corresponding to each river station. The signal components include components that characterize the seasonal cycle and components that characterize anomalous changes. The building unit is used to construct a weighted directed hydraulic time delay graph based on the river network topology of multiple river stations; The extraction unit is used to take the signal components of the multiple frequency bands as node features, and use a graph convolutional network to perform spatial convolution on the weighted directed hydraulic delay map to extract spatial enhancement features. The fusion unit is used to utilize the cross-band self-attention mechanism, combined with the spatial enhancement features, to calculate the inter-band weights, perform multi-band signal weighted fusion and phase alignment, and output the fused spatiotemporal features. The output unit is used to construct a stacked dilated convolutional temporal prediction network, perform deep temporal modeling on the fused spatiotemporal features, and output the predicted value of total nitrogen concentration for future time periods. The optimization unit is used to continuously evaluate and optimize the predicted total nitrogen concentration for the future time period by combining sliding window backtesting and anomaly threshold self-correction mechanism, and to obtain and publish the optimization results.
9. A device, characterized in that, include: Processor and memory; The memory is used to store computer programs, and the processor calls the computer programs stored in the memory to execute the method for predicting total nitrogen concentration at river stations as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, enables the processor to perform the method for predicting total nitrogen concentration at river stations as described in any one of claims 1 to 8.