Water quality prediction network, water quality prediction model training method and device, and water quality prediction method and device
By employing temporal decomposition, time-frequency fusion, and multi-head attention mechanisms in the water quality prediction network, the nonlinearity and multi-scale variation of water quality data are addressed, achieving high-precision and stable water quality prediction and adapting to dynamic feature modeling in complex water quality scenarios.
Patent Information
- Application Number
- CN202511478318.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2026-01-09
AI Technical Summary
Traditional linear models and shallow machine learning methods are difficult to effectively handle the nonlinear, nonstationary, and multi-scale variation characteristics of water quality parameters, resulting in insufficient prediction accuracy and stability. Furthermore, existing models have significant shortcomings in long sequence modeling and modal aliasing problems.
A water quality prediction network is adopted, including a time-series decomposition module, a time-frequency fusion module, a channel fusion module, and a time-series prediction module. The water quality time-series data is decomposed by STL algorithm and VMD, and multi-scale features are extracted and fused by dynamic convolution, wavelet transform and multi-head attention mechanism. PatchTST is used for prediction.
It improves the accuracy and reliability of water quality prediction, can accurately capture the complex characteristics of water quality data, enhances the model's generalization ability and interpretability under different water quality scenarios, and improves the accuracy and stability of medium- and long-term predictions.
Smart Images

Figure CN121306338A_ABST
Abstract
Description
Technical Field
[0001] This disclosure belongs to the field of water environment monitoring technology, and relates to the fields of artificial intelligence, deep learning and other technologies, in particular to a water quality prediction network, a water quality prediction model training method and device, a water quality prediction method and device, electronic equipment and computer-readable storage medium. Background Technology
[0002] Water quality is a key indicator for measuring the health of aquatic ecosystems, the effectiveness of pollution control, and the sustainable use of water resources. With accelerated urbanization and increased industrial emissions, water pollution is becoming increasingly serious, necessitating intelligent and high-precision water quality monitoring and prediction technologies. Common water quality parameters (such as dissolved oxygen, ammonia nitrogen, chemical oxygen demand, total phosphorus, and pH) exhibit significant nonlinearity, non-stationarity, and strong seasonal periodicity, such as runoff during the rainy season or eutrophication fluctuations during hot seasons. Furthermore, these parameters also demonstrate multi-scale variations (daily, weekly, monthly, and interannual fluctuations), sudden disturbances (such as sewage impacts and heavy rainfall events), and the coupling of long-term trends with short-term disturbances. These complex dynamics significantly increase the difficulty of prediction modeling, making traditional linear models or shallow machine learning methods insufficient to meet the requirements. Summary of the Invention
[0003] This disclosure provides a water quality prediction network, a water quality prediction model training method and apparatus, a water quality prediction method and apparatus, an electronic device, and a computer-readable storage medium.
[0004] According to the first aspect, a water quality prediction network is provided, comprising: a time-series decomposition module for extracting periodic signals from historical water quality time-series data to obtain trend components, seasonal components, and microscale components; fusing the trend components, seasonal components, and microscale components to obtain a reconstructed input sequence; and a time-frequency fusion module connected to the time-series decomposition module, comprising: a dynamic convolution submodule, a wavelet transform submodule, and a mutation detection submodule. The dynamic convolution submodule is used to extract short-term fluctuations and patterns from the reconstructed input sequence, and the wavelet transform submodule is used to extract the main variable sequence from the reconstructed input sequence and extract the multi-band energy spectrum of the main variable sequence; the mutation detection submodule is used to identify abrupt change points in the reconstructed input sequence; and channel fusion... The fusion module, connected to the time-frequency fusion module, includes: a multi-head attention submodule, which uses a cross-channel multi-head attention mechanism to fuse short-term fluctuations and patterns, multi-band energy spectra, and abrupt change points to obtain a fused feature sequence; and a time-series prediction module, connected to the channel fusion module, which includes: a partitioning submodule, an encoding submodule, and a fully connected network. The partitioning submodule divides the fused feature sequence into at least two feature blocks and maps all feature blocks to the same embedding space. The encoding submodule encodes all feature blocks and retains the temporal order information of all feature blocks to obtain an encoded feature sequence. The fully connected network performs dimensionality compression and prediction mapping on the encoded feature sequence to obtain predicted water quality time-series data.
[0005] According to the second aspect, a water quality prediction model training method is provided. The method includes: obtaining an initial water quality prediction network and a water quality training sample set, wherein the water quality prediction network adopts the water quality prediction network described by any implementation method of the first aspect; calculating the target decomposition parameters of the time series decomposition module in the water quality prediction network to obtain a water quality prediction model using the target decomposition parameters; and training the water quality prediction model based on the water quality training sample set to obtain a trained water quality prediction model.
[0006] According to the third aspect, a water quality prediction method is provided, which includes: acquiring historical water quality time series data for historical periods; inputting the historical water quality time series data into a water quality prediction model as described in any implementation of the second aspect, and obtaining predicted water quality time series data output by the water quality prediction model.
[0007] According to the fourth aspect, a water quality prediction model training device is provided, the device comprising: a network acquisition unit configured to acquire an initial water quality prediction network and a water quality training sample set, wherein the water quality prediction network adopts the water quality prediction network described in any implementation of the first aspect; a calculation unit configured to calculate the target decomposition parameters of the time series decomposition module in the water quality prediction network to obtain a water quality prediction model using the target decomposition parameters; and a training unit configured to train the water quality prediction model based on the water quality training sample set to obtain a trained water quality prediction model.
[0008] According to the fifth aspect, a water quality prediction device is provided, the device comprising: a data acquisition unit configured to acquire historical water quality time series data for historical periods; and a prediction unit configured to input the historical water quality time series data into the water quality prediction model described in the fourth aspect to obtain predicted water quality time series data output by the water quality prediction model.
[0009] According to a sixth aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method as described in any implementation of the second or third aspect.
[0010] According to a seventh aspect, a non-transitory computer-readable storage medium is provided that stores computer instructions for causing a computer to perform the method described in any implementation of the second or third aspect.
[0011] The water quality prediction network provided in the embodiments of this disclosure includes a time-series decomposition module for extracting periodic signals from historical water quality time-series data to obtain trend components, seasonal components, and microscale components; fusing the trend components, seasonal components, and microscale components to obtain a reconstructed input sequence; a time-frequency fusion module connected to the time-series decomposition module, including a dynamic convolution submodule, a wavelet transform submodule, and a mutation detection submodule. The dynamic convolution submodule is used to extract short-term fluctuations and patterns from the reconstructed input sequence; the wavelet transform submodule is used to extract the main variable sequence from the reconstructed input sequence and extract the multi-band energy spectrum of the main variable sequence; the mutation detection submodule is used to identify abrupt change points in the reconstructed input sequence; and a channel fusion module. Connected to the time-frequency fusion module, the system includes: a multi-head attention submodule, which uses a cross-channel multi-head attention mechanism to fuse short-term fluctuations and patterns, multi-band energy spectra, and abrupt change points to obtain a fused feature sequence; and a time-series prediction module, connected to the channel fusion module, which includes: a partitioning submodule, an encoding submodule, and a fully connected network. The partitioning submodule divides the fused feature sequence into at least two feature blocks and maps all feature blocks to the same embedding space. The encoding submodule encodes all feature blocks and retains the temporal order information of all feature blocks to obtain an encoded feature sequence. The fully connected network performs dimensionality compression and prediction mapping on the encoded feature sequence to obtain predicted water quality time-series data. Therefore, this water quality prediction network can accurately capture the complex characteristics of water quality data, and by combining dynamic convolution, wavelet transform, and abrupt response, the model can perceive the periodicity, high-frequency disturbances, and drastic changes in water quality signals in multiple dimensions. This effectively improves prediction accuracy and reliability, providing strong support for water quality monitoring and management.
[0012] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0013] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 This is a schematic diagram of one structure of the water quality prediction network disclosed herein; Figure 2a This is a schematic diagram of the water quality time series data disclosed herein; Figure 2b This is a schematic diagram of the trend component in water quality time series data; Figure 2c This is a schematic diagram of the seasonal component in water quality time series data; Figure 2d This is a schematic diagram of microscale components in water quality time series data; Figure 3 This is another schematic diagram of the structure of the water quality prediction network disclosed herein; Figure 4 This is a flowchart of an embodiment of the water quality prediction model training method according to the present disclosure; Figure 5 This is a flowchart of an embodiment of the water quality prediction method according to the present disclosure; Figure 6 This is a schematic diagram of the structure of one embodiment of the water quality prediction model training device disclosed herein; Figure 7 This is a schematic diagram of the structure of one embodiment of the water quality prediction device disclosed herein; Figure 8 This is a block diagram of an electronic device used to implement the water quality prediction method of the embodiments of this disclosure. Detailed Implementation
[0014] Unless otherwise expressly stated, throughout the specification and claims, the term "comprising" or its variations such as "including" or "comprises" shall be understood to include the stated elements or components without excluding other elements or other components.
[0015] The technical solutions of this disclosure are illustrated below through specific embodiments. It should be understood that one or more steps mentioned in this disclosure do not preclude the existence of other methods and steps before or after the combined steps, or that other methods and steps may be inserted between these explicitly mentioned steps. It should also be understood that these examples are for illustrative purposes only and are not intended to limit the scope of this disclosure. Unless otherwise stated, the numbering of each method step is only for the purpose of identifying each method step, and not to limit the order of each method or to limit the scope of implementation of this disclosure. Changes or adjustments to their relative relationships, without substantial changes to the technical content, can also be considered as within the scope of implementation of this disclosure.
[0016] The raw materials and instruments used in the examples are not subject to any specific restrictions on their source; they can be purchased from the market or prepared according to conventional methods known to those skilled in the art.
[0017] In existing technologies, the introduction of EEMD (Ensemble Empirical Mode Decomposition) and CNN (Convolutional Neural Network)-LSTM (Long Short-Term Memory) models to predict water quality data has improved the accuracy of water quality time-series prediction to some extent. However, it still has significant shortcomings in handling complex multi-scale water quality fluctuation characteristics, mainly in the following aspects: 1. Seasonality and trends are not explicitly modeled, resulting in significant component overlap. Decomposition using only EEMD leads to the model needing to fit multiple changing structures simultaneously, impacting prediction accuracy and stability.
[0018] 2. Modal aliasing and redundancy issues are prominent. Although EEMD can alleviate modal aliasing, its decomposition effect is extremely sensitive to parameters such as noise intensity, and the number of generated IMFs is difficult to control, resulting in redundant components and increasing modeling complexity.
[0019] 3. Insufficient long-sequence modeling capability. Although LSTM has a certain ability to model time series, it is prone to gradient vanishing when faced with long-term dependencies (such as seasonal driving forces or slow water quality change trends), which affects the stability of predictions.
[0020] 4. Traditional techniques using WOA (Whale Optimization Algorithm) are computationally complex and highly dependent on other algorithms. While WOA is a heuristic global search algorithm with some search capability, it has slow convergence speed, unstable results, and is tightly coupled with the data, lacking versatility.
[0021] 5. Fixed model structure and lack of flexible combination capabilities. The CNN-LSTM structure has problems such as fixed time window and limited spatial feature extraction, which cannot effectively mine heterogeneous dynamic features at different time scales, and it is also difficult to adapt to modal feature differences.
[0022] This disclosure proposes a water quality prediction network that can accurately capture the complex characteristics of water quality data, effectively improving prediction accuracy and reliability, and providing strong support for water quality monitoring and management. Figure 1 The diagram shown is a structural schematic of one type of water quality prediction network disclosed in this paper. Figure 1 In the water quality prediction network 100, there are: a time series decomposition module 101, a time-frequency fusion module 102, a channel fusion module 103, and a time series prediction module 104.
[0023] In this embodiment, the time-series decomposition module 101 is used to extract periodic signals from historical water quality time-series data to obtain trend components, seasonal components, and microscale components; the trend components, seasonal components, and microscale components are then fused to obtain a reconstructed input sequence. The water quality time-series data is water quality data in time-series form (over a period of time), including: water temperature, pH value, dissolved oxygen, conductivity, turbidity, permanganate index, ammonia nitrogen, total phosphorus, total nitrogen, chlorophyll, algal density, etc. Periodic signals include: seasonal rainfall, seasonal evaporation, etc.
[0024] In this embodiment, the time series decomposition module 101 may include: an STL (Seasonal and Trend Decomposition using Loess) algorithm and a component fusion submodule. The STL algorithm is used to extract periodic signals from water quality time series data. STL is a classic time series decomposition method used to decompose a time series into trend, seasonal, and residual components. The residual component can be directly used as a micro-scale component. The STL algorithm is a non-parametric method that explicitly decomposes a time series into trend, seasonal, and residual components. Its core is based on LOESS (Locally Weighted Regression) filtering to achieve multi-scale trend extraction. By reasonably setting the seasonal periodic parameter, periodic signals (such as seasonal rainfall and evaporation) in water quality time series can be effectively separated from long-term evolution trends and random disturbances. Figures 2a-2d As shown, Figure 2a It is the original water quality time series data. Figure 2b This is a schematic diagram of the trend component in water quality time series data. Figure 2c This is a schematic diagram of the seasonal component in water quality time series data. Figure 2dIt is a schematic diagram of the residual components in water quality time series data, thus providing a more structured and less noisy input for subsequent modeling.
[0025] In this embodiment, the component fusion submodule is used to fuse the trend component, seasonal component, and microscale component using a learnable weight mechanism to obtain a reconstructed input sequence. Specifically, the component fusion submodule can introduce a Softmax normalization parameter and automatically optimize the weight allocation of each component of the trend component, seasonal component, and microscale component through training, realizing dynamic perception and adaptive feature reconstruction at the component level. This structure not only improves the rationality of the prediction results but also enhances the model's generalization ability and interpretability under different water quality scenarios. The component fusion submodule dynamically fuses multiple heterogeneous features through a cross-channel multi-head attention mechanism. Compared with the traditional method of directly splicing or averaging, it has stronger feature selection ability and multi-source information perception ability, and solves the channel redundancy and weight allocation problems from a mechanism perspective.
[0026] In this embodiment, the time-frequency fusion module 102 is connected to the time-series decomposition module 101. The time-frequency fusion module 102 includes a dynamic convolution submodule, a wavelet transform submodule, and a mutation detection submodule. The dynamic convolution submodule is used to extract short-term fluctuations and patterns from the reconstructed input sequence. The wavelet transform submodule is used to extract the main variable sequence from the reconstructed input sequence and extract the multi-band energy spectrum of the main variable sequence. The mutation detection submodule is used to identify sudden change points in the reconstructed input sequence. The multi-band energy spectrum is a selected main variable sequence (such as DO), which is a multi-frequency energy spectrum structure (frequency domain).
[0027] In this embodiment, the time-frequency fusion module 102 is used to perform deep feature extraction on the reconstructed input sequence. The time-frequency fusion module 102 is a self-designed core feature extraction structure, which includes three channels: dynamic convolution, wavelet transform, and mutation detection. These channels extract time dependence, frequency domain energy structure, and local mutation response features, respectively. The dynamic convolution channel uses multi-scale convolution kernels to capture short-term fluctuations and local changes in pattern performance. The wavelet channel uses wavelet basis functions (such as the Morlet function) to extract multi-band energy spectra. The mutation detection channel uses a one-dimensional convolutional neural network to identify abrupt change points in the reconstructed input sequence and explicitly weights them, thereby improving the model's response capability to abnormal fluctuations.
[0028] In this embodiment, the channel fusion module 103 is connected to the time-frequency fusion module 102. The channel fusion module 103 includes a multi-head attention submodule, which is used to fuse short-term fluctuations and patterns, multi-band energy spectra and sudden change points using a cross-channel multi-head attention mechanism to obtain a fused feature sequence.
[0029] In this embodiment, the channel fusion module 103 fuses information from three channels—short-term fluctuations and patterns, multi-band energy spectra, and abrupt change points—using a cross-channel multi-head attention mechanism. This introduces a cross-channel multi-head attention structure during the feature convergence process, enabling the model to possess intelligent capabilities for feature selection and heterogeneous information fusion. This mechanism dynamically allocates attention weights between channels, significantly enhancing the selectivity for modeling non-stationary and nonlinear feature patterns. It allows the model to dynamically capture correlations and weight differences across different channels, ensuring that important time-frequency patterns are retained while redundant or noisy features are suppressed.
[0030] In this embodiment, the time series prediction module 104 is connected to the channel fusion module 103. The time series prediction module 104 includes a partitioning submodule, an encoding submodule, and a fully connected network. The partitioning submodule is used to divide the fused feature sequence into at least two feature blocks and map all feature blocks to the same embedding space. The encoding submodule is used to encode all feature blocks and retain the temporal order information of all feature blocks to obtain an encoded feature sequence. The fully connected network is used to perform dimensionality compression and prediction mapping on the encoded feature sequence to obtain predicted water quality time series data.
[0031] In this embodiment, the fused feature sequence is first divided into equal-length feature blocks, i.e., patch blocks, and each patch is flattened and linearly transformed to be mapped to a unified embedding space. Then, learnable positional encoding is added so that the model can still retain the temporal order information of the sequence in the subsequent modeling process. This embedding mechanism provides a standard input format for the encoding submodule, effectively reducing input redundancy and improving modeling efficiency and positional recognition capability.
[0032] In this embodiment, the encoding submodule can be PatchTST (Patch Time Series Transformer). PatchTST is a Transformer structure optimized for time series, using a multi-layer self-attention mechanism to capture short- and long-term dependencies between patches. Compared to traditional LSTM or Informer, PatchTST has a simpler structure, stronger scalability, and is more training-friendly, better adapting to complex time dependency patterns, especially excelling in long-term trend modeling and cross-period prediction. Applying PatchTST to water quality prediction and optimizing its input embedding strategy and structural depth enables it to effectively model multi-period features and complex dependency paths, especially breaking through existing performance bottlenecks in terms of medium- and long-term prediction accuracy and stability, making it a structurally improved Transformer model for time-environment data.
[0033] The water quality prediction network provided in the embodiments of this disclosure includes a time-series decomposition module for extracting periodic signals from historical water quality time-series data to obtain trend components, seasonal components, and microscale components; fusing the trend components, seasonal components, and microscale components to obtain a reconstructed input sequence; a time-frequency fusion module connected to the time-series decomposition module, including a dynamic convolution submodule, a wavelet transform submodule, and a mutation detection submodule. The dynamic convolution submodule is used to extract short-term fluctuations and patterns from the reconstructed input sequence; the wavelet transform submodule is used to extract the main variable sequence from the reconstructed input sequence and extract the multi-band energy spectrum of the main variable sequence; the mutation detection submodule is used to identify abrupt change points in the reconstructed input sequence; and a channel fusion module. Connected to the time-frequency fusion module, the system includes: a multi-head attention submodule, which uses a cross-channel multi-head attention mechanism to fuse short-term fluctuations and patterns, multi-band energy spectra, and abrupt change points to obtain a fused feature sequence; and a time-series prediction module, connected to the channel fusion module, which includes: a partitioning submodule, an encoding submodule, and a fully connected network. The partitioning submodule divides the fused feature sequence into at least two feature blocks and maps all feature blocks to the same embedding space. The encoding submodule encodes all feature blocks and retains the temporal order information of all feature blocks to obtain an encoded feature sequence. The fully connected network performs dimensionality compression and prediction mapping on the encoded feature sequence to obtain predicted water quality time-series data. Therefore, this water quality prediction network can accurately capture the complex characteristics of water quality data, and by combining dynamic convolution, wavelet transform, and abrupt response, the model can perceive the periodicity, high-frequency disturbances, and drastic changes in water quality signals in multiple dimensions. This effectively improves prediction accuracy and reliability, providing strong support for water quality monitoring and management.
[0034] In some optional implementations of this disclosure, the aforementioned time series decomposition module includes: a time series analysis submodule, a variational mode decomposition submodule, and a component fusion submodule. For example... Figure 3 The diagram shown is another structural schematic of the water quality prediction network disclosed herein. Figure 3 In this module, the time series decomposition module includes: a time series analysis submodule, a variational mode decomposition submodule, and a component fusion submodule. For example... Figure 3 As shown, the water quality time series data includes: water temperature, pH, conductivity, total phosphorus and algae density. The water quality time series data is preprocessed and sent to the time series decomposition module. The data preprocessing includes: anomaly detection and processing, data standardization and normalization, and time feature engineering processing.
[0035] In this optional implementation, the time series analysis submodule is used to decompose the water quality time series data into trend components, seasonal components, and residual components; specifically, the time series analysis submodule can use the STL algorithm. The STL algorithm is used to decompose the time series into trend components, seasonal components, and residual components.
[0036] In this optional implementation, the variational mode decomposition (VMD) submodule decomposes the residual components into multiple intrinsic mode functions (IMFs), each with a specific center frequency and finite bandwidth. Specifically, the VMD submodule performs VMD processing on the residual components after STL decomposition, further separating high-frequency noise and complex disturbances. VMD is an adaptive signal decomposition method based on variational principles, decomposing the signal into several IMFs, each corresponding to a specific frequency component. Compared to traditional empirical mode decomposition methods, VMD has advantages such as a clearer decomposition structure, more compact modes, and more stable parameters, making it an effective tool for modeling non-stationary disturbances.
[0037] In this optional implementation, the component fusion submodule is connected to both the time series analysis submodule and the variational mode decomposition submodule. It uses a learnable weight mechanism to fuse the trend component, seasonal component, and multiple intrinsic mode functions (IMFs) to obtain a reconstructed input sequence. The component fusion submodule introduces Softmax normalization parameters and automatically optimizes the weight allocation of Trend, Seasonal, and IMF components during training. This achieves dynamic perception and adaptive feature reconstruction at the component level. This structure not only improves the reasonableness of the prediction results but also enhances the model's generalization ability and interpretability under different water quality scenarios. The introduction of Softmax normalized learnable weights in the fusion stage of Trend, Seasonal, and IMF allows the model to automatically determine the contribution ratio of various structural components to the prediction results based on the training process, thereby improving the model's interpretability, structural adaptability, and dynamic responsiveness of the prediction.
[0038] The time series decomposition module provided by this optional implementation applies STL and VMD in a cascade to the structural reconstruction of water quality series, realizing the explicit decomposition of three types of components: trend, periodicity, and disturbance. This greatly improves the model's ability to understand non-stationary structures and provides an innovative paradigm for deconstructive modeling starting from the source data structure itself.
[0039] In some optional implementations of this disclosure, the aforementioned channel fusion module further includes: a layer normalization network and a feedforward network. The layer normalization network, connected to the multi-head attention submodule, is used to normalize and fuse the feature sequences. In this optional implementation, the feedforward network is connected to the layer normalization network to perform the same transformation on the features at each position of the normalized fused feature sequence.
[0040] In this optional implementation, the key to fusing the three types of heterogeneous features into a unified vector representation is through a normalization network and a feedforward network, which ensures the stable transmission and enhanced expression of information flow.
[0041] In some alternative implementations of this disclosure, the fully connected network includes: a first fully connected network and a second fully connected network.
[0042] In this optional implementation, the first fully connected network is connected to the encoding submodule to enhance the expression of the encoded feature sequence. The second fully connected network is connected to the first fully connected network to convert the enhanced encoded feature sequence into predicted water quality data.
[0043] In this optional implementation, the first fully connected network uses ReLU activation to enhance the nonlinear expression, and the second fully connected network outputs the predicted value of the target variable (such as the water quality index for the next 24 hours). To adapt to practical applications, the prediction results are converted into the original physical units through destandardization, and finally a water quality time prediction curve or data table can be formed for management decision-making.
[0044] The channel fusion module provided by this optional implementation achieves dimensionality compression and prediction mapping through a two-layer fully connected network, thereby improving the reliability of the predicted water quality data.
[0045] To address the shortcomings of traditional technologies, this disclosure proposes a method for training water quality prediction models. Figure 4 A flowchart 400 is shown as an embodiment of a water quality prediction model training method according to the present disclosure, the water quality prediction model training method comprising the following steps: Step 401: Obtain the initial water quality prediction network and water quality training sample set.
[0046] In this embodiment, the water quality prediction network mentioned above... Figures 1-3 The water quality prediction network shown in the embodiment includes: a time series decomposition module, a time-frequency fusion module, a channel fusion module, and a time series prediction module.
[0047] In this embodiment, the entity executing the water quality prediction model training method can obtain the water quality training sample set in various ways. For example, the entity can obtain an existing water quality training sample set stored in a database server via a wired or wireless connection. Alternatively, a user can collect the water quality training sample set via a terminal. In this way, the entity can receive the water quality training samples collected by the terminal and store them locally, thereby generating the water quality training sample set.
[0048] Here, the water quality training sample set may include at least one water quality training sample. The water quality training sample may include historical water quality time-series data and water quality labels, whereby the water quality labels represent the future water quality status of the historical water quality data in the water quality training sample.
[0049] Step 402: Calculate the target decomposition parameters of the time series decomposition module in the water quality prediction network to obtain the water quality prediction model using the target decomposition parameters.
[0050] In this embodiment, the target decomposition parameter is a parameter set for the time series decomposition module. The target decomposition parameter allows the time series decomposition module to achieve optimal decomposition. The time series decomposition module may include an STL algorithm and a component fusion submodule. Therefore, the target decomposition parameter is the decomposition period of the STL algorithm. Step 402 above includes: generating a candidate period list for the time series decomposition module. First, some initial periods are defined based on the frequency of the water quality time series data (e.g., 4 hours), such as 7 (approximately 1 day), 13 (approximately 2 days), etc. Then, other odd-numbered periods are generated, ranging from 5 to `min(max_period, len(data) / / 3)`, with a step size of 2 (only considering odd-numbered periods). Here, `len(data)` refers to the total length of the input water quality time-series data, i.e., the total number of data points; `len(data) / / 3` means dividing the total data length by 3, ensuring that the tested period is not too large relative to the length of the entire dataset. Each period should contain at least 3 complete cycles to guarantee decomposition stability; `max_period` is a preset maximum period value, a manually set upper limit to prevent excessively large periods from losing their practical significance; `min(...)`: This function takes the smaller of the two values within the parentheses. The initial period and other odd-numbered periods are merged, deduplicated, and sorted in ascending order to form a candidate period list. The decomposition quality of each period is evaluated. For each candidate period in the candidate period list, the STL algorithm is used to decompose the water quality time-series data, calculating the residual variance, seasonal component variance, trend component variance, and total variance after decomposition. The comprehensive score is calculated based on the variance proportion of the seasonal component (seasonal intensity) and the variance proportion of the residual component (residual proportion) (the smaller the better), and the scoring formula is shown in Equation (1). All candidate periods are traversed, and the first comprehensive score score1 of each period is recorded. The period with the smallest score is found as the optimal period.
[0051] score1 = residual_ratio - seasonal_strength(1) In equation (1), residual_ratio represents the residual ratio, which is the proportion of the variance of the residual component to the total variance after STL decomposition. The residual component is the random disturbance after removing the trend and seasonal components. The smaller this proportion, the less random noise there is, and the more stable the trend and seasonal patterns are after decomposition. seasonal_strength represents the seasonal intensity, which is the proportion of the variance of the seasonal component to the total variance after STL decomposition. The greater the seasonal intensity, the more significant the seasonal period of the data is, and the clearer the seasonal pattern is after decomposition, which is more consistent with the periodic characteristics of water quality data (such as rainy season and high-temperature season).
[0052] Step 403: Based on the water quality training sample set, train the water quality prediction model to obtain the trained water quality prediction model.
[0053] In this embodiment, the water quality prediction model is trained based on the water quality training sample set, using commonly used model training steps, which will not be repeated here.
[0054] In this embodiment, in addition to the decomposition of the time series decomposition module, the parameters of all modules, including the time-frequency fusion module, the channel fusion module, and the time series prediction module, are adjusted during model training. The loss function of the water quality prediction model is minimized through backpropagation and optimization algorithms.
[0055] In this embodiment, the water quality prediction model employs an end-to-end training strategy, using mean squared error (MSE) as the primary loss function. The AdamW optimizer is selected to support weight decay, and gradient clipping and Dropout mechanisms are introduced to prevent overfitting. During training, the model dynamically adjusts the learning rate using a validation set metric (using the ReduceLROnPlateau strategy) and records the optimal model state for final prediction. Comprehensive evaluation metrics include MAE (Mean Absolute Error), RMSE (Root Mean Squared Error), MAPE (Mean Absolute Percentage Error), and R... 2 The R-squared (coefficient of determination) system balances prediction accuracy, stability, and model interpretability. Through the coordinated efforts of the above modules, a well-structured, advanced, and high-performance water quality time series prediction system has been constructed, significantly improving the ability to model complex water quality evolution processes and providing strong technical support for smart water management.
[0056] In this embodiment, the water quality prediction model is fully integrated from structural deconstruction, feature enhancement, modeling and prediction to output generation, and has strong end-to-end trainability. At the same time, the structure has good transferability and is applicable to a variety of water environment variables, monitoring frequencies and regional conditions. It is a water quality prediction solution that combines versatility and professionalism.
[0057] The water quality prediction model training method provided in this disclosure first obtains an initial water quality prediction network and a water quality training sample set; second, it calculates the target decomposition parameters of the time-series decomposition module in the water quality prediction network to obtain a water quality prediction model using the target decomposition parameters; finally, it trains the water quality prediction model based on the water quality training sample set to obtain a trained water quality prediction model. Therefore, by pre-setting target decomposition parameters for the time-series decomposition module in the water quality prediction network and training the water quality prediction model on these target decomposition parameters, the reliability of the water quality prediction model training is improved, and the accuracy of the trained water quality prediction model is increased.
[0058] In some optional implementations of this disclosure, the aforementioned time series decomposition module includes: a time series analysis submodule, a variational mode decomposition submodule, and a component fusion submodule. The target decomposition parameters include: the target period of the time series analysis submodule and the target number of the variational mode decomposition submodule. Calculating the target decomposition parameters of the time series decomposition module in the water quality prediction network to obtain a water quality prediction model using the target decomposition parameters includes: generating a candidate period list for the decomposition period; evaluating the decomposition quality of the candidate periods in the candidate period list to obtain a quality score sequence; obtaining the target period based on the quality score sequence and the candidate period list, and setting the target period for the time series analysis submodule; generating a candidate number list for the decomposition number; evaluating the decomposition quality of the candidate numbers in the candidate number list to obtain a number score sequence; selecting the target number from the candidate number list using a selection strategy based on the number score sequence; setting the target number for the variational mode decomposition submodule, and obtaining the water quality prediction model.
[0059] In this optional implementation, the time series decomposition module includes: a time series analysis submodule, a variational mode decomposition submodule, and a component fusion submodule; the target decomposition parameters include: the target period of the time series analysis submodule and the target number of variational mode decomposition submodules, wherein the target period is the optimal value of the decomposition period of the time series analysis submodule, that is, the optimal period. The process of obtaining the optimal period has been described in the above embodiments and will not be repeated here.
[0060] In this optional implementation, the target number is the optimal value of the number of decompositions in the variational mode decomposition submodule, i.e., the optimal number. The steps to obtain the optimal number are as follows: Try multiple different decomposition quantity K values, adjusting the maximum K value according to the signal length to ensure that each IMF has at least 100 points. Perform VMD decomposition by iterating through each K value from 2 to the maximum K value. Evaluate the decomposition quality of each K value, calculate the reconstruction error (MSE), which is the mean square error between the original residual signal and the reconstructed signal; calculate the orthogonality (independence) between components by calculating the cross-correlation coefficient of each pair of IMFs and averaging it; calculate the energy ratio, which is the ratio of the sum of the energy of all IMFs to the energy of the original signal; calculate an information criterion similar to AIC, taking into account the reconstruction error and complexity penalty, and calculate the second comprehensive score using the formula shown in Equation (2).
[0061] score2= mse * (1 + orthogonality) + 0.01 * K (2) In equation (2), score2 is used to evaluate the overall quality of VMD decomposition (variational mode decomposition submodule) (the smaller the score, the better the decomposition quality), mse represents the reconstruction error, which is the mean square error between the original residual signal and the reconstructed signal after VMD decomposition. The smaller the mean square error, the more accurately the VMD decomposed component (IMF) can restore the original residual signal, and the higher the decomposition accuracy. orthogonality represents the component orthogonality, which is the average value of the cross-correlation coefficient of each pair of IMFs (intrinsic mode functions) obtained by VMD decomposition. The smaller the orthogonality value, the lower the overlap between IMF components and the stronger the independence, thus avoiding "modal aliasing" (different frequency components mixed into the same IMF). K represents the number of decompositions of the variational mode decomposition submodule, that is, the number of IMFs (intrinsic mode functions) that need to be decomposed. The addition of 0.01*K in formula (2) is to penalize the decomposition complexity, thereby avoiding the unlimited increase of K in order to reduce the error (K being too large can easily lead to decomposition redundancy and increase model complexity).
[0062] Three different strategies were used to select the optimal K value: based on the minimum AIC (Akaike Information Criterion) value; based on the minimum second comprehensive score; and based on the inflection point of the reconstruction error (elbow rule). The results of these three strategies were then voted on, and the K value that appeared most frequently was selected as the final optimal K value.
[0063] Using the above methods, the target period for STL decomposition and the target number (K value) for VMD decomposition can be automatically found, thereby achieving effective decomposition of water quality time series data. Furthermore, by setting the target period and target number before training the water quality prediction model, it can be ensured that the water quality prediction model is trained under optimal decomposition parameters, thus improving the reliability and accuracy of the water quality prediction model training.
[0064] To address the shortcomings of traditional technologies, this disclosure proposes a water quality prediction method. Figure 5 A flow 500 of an embodiment of the water quality prediction method according to the present disclosure is shown, the water quality prediction method comprising the following steps: Step 501: Obtain historical water quality time series data for historical periods.
[0065] In this embodiment, historical water quality time-series data refers to water quality data for historical periods. This data is presented in time-series format and includes parameters such as water temperature, pH, dissolved oxygen, conductivity, turbidity, permanganate index, ammonia nitrogen, total phosphorus, total nitrogen, chlorophyll, and algal density. The entity executing the water quality prediction method can acquire historical water quality time-series data in various ways. For example, the entity can obtain the historical water quality time-series data stored in a database server via a wired or wireless connection. Alternatively, the entity can receive historical water quality time-series data collected by a terminal or other devices.
[0066] Step 502: Input the historical water quality time series data into the water quality prediction model to obtain the predicted water quality time series data output by the water quality prediction model.
[0067] In this embodiment, the water quality prediction model described above can be a water quality prediction model obtained through the water quality prediction model training method described above.
[0068] In this embodiment, the execution entity running on the water quality prediction method can input the historical water quality time series data obtained in step 501 into the water quality prediction model, thereby generating predicted water quality time series data.
[0069] In this embodiment, the water quality prediction model can be as described above. Figure 4 This was generated using the method described in the embodiments. For details of the generation process, please refer to [link / reference needed]. Figure 4 The relevant descriptions of the embodiments will not be repeated here.
[0070] In this embodiment, the predicted water quality time series data is obtained by predicting future water quality data from historical water quality time series data. For example, the historical water quality time series data consists of water quality data for every 4 hours over 3 years, while the predicted water quality time series data is the next 4-hour period after the historical water quality time series data (i.e., the predicted water quality time series data) is determined based on the desired prediction time period. It should be noted that the water quality prediction method in this embodiment can be used to test the water quality prediction models generated in the above embodiments. Furthermore, the water quality prediction models can be continuously optimized based on the conversion results. This method can also be a practical application of the water quality prediction models generated in the above embodiments. Using the water quality prediction models generated in the above embodiments to predict water quality data helps improve the performance of water quality prediction.
[0071] Further reference Figure 6 As an implementation of the methods shown in the above figures, this disclosure provides an embodiment of a water quality prediction model training device, which is similar to... Figure 4 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0072] like Figure 6 As shown, the water quality prediction model training device 600 provided in this embodiment includes: a network acquisition unit 601, a calculation unit 602, and a training unit 603. The network acquisition unit 601 can be configured to acquire an initial water quality prediction network and a water quality training sample set, wherein the water quality prediction network is the water quality prediction network provided in the above embodiment. The calculation unit 602 can be configured to calculate the target decomposition parameters of the time-series decomposition module in the water quality prediction network, thereby obtaining a water quality prediction model using the target decomposition parameters. The training unit 603 is configured to train the water quality prediction model based on the water quality training sample set, thereby obtaining a trained water quality prediction model.
[0073] In this embodiment, the specific processing of the network acquisition unit 601, the calculation unit 602, and the training unit 603 in the water quality prediction device 600, and the resulting technical effects, can be found in reference to [reference needed]. Figure 4 The relevant descriptions of steps 401, 402, and 403 in the corresponding embodiments will not be repeated here.
[0074] In some embodiments of this disclosure, the aforementioned time-series decomposition module includes: a time-series analysis submodule, a variational mode decomposition submodule, and a component fusion submodule. The aforementioned target decomposition parameters include: a target period for the decomposition period of the time-series analysis submodule and a target number of decompositions for the variational mode decomposition submodule. The aforementioned calculation unit 602 is configured to: generate a candidate period list for the decomposition period; evaluate the decomposition quality of the candidate periods in the candidate period list to obtain a quality score sequence; obtain a target period based on the quality score sequence and the candidate period list, and set the target period for the time-series analysis submodule; generate a candidate number list for the decomposition number; evaluate the decomposition quality of the candidate numbers in the candidate number list to obtain a number score sequence; select a target number from the candidate number list based on the number score sequence using a selection strategy; and set a target number for the variational mode decomposition submodule to obtain a water quality prediction model.
[0075] The water quality prediction model training apparatus provided in the embodiments of this disclosure firstly involves a network acquisition unit 601 acquiring an initial water quality prediction network and a water quality training sample set; secondly, a calculation unit 602 calculating the target decomposition parameters of the time-series decomposition module in the water quality prediction network to obtain a water quality prediction model using the target decomposition parameters; and finally, a training unit 603 training the water quality prediction model based on the water quality training sample set to obtain a trained water quality prediction model. Therefore, by pre-setting target decomposition parameters for the time-series decomposition module in the water quality prediction network and training the water quality prediction model on these target decomposition parameters, the reliability of the water quality prediction model training is improved, and the accuracy of the trained water quality prediction model is enhanced.
[0076] Further reference Figure 7 As an implementation of the methods shown in the above figures, this disclosure provides an embodiment of a water quality prediction device, which is similar to... Figure 5 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0077] like Figure 7 As shown, the water quality prediction device 700 provided in this embodiment includes: a data acquisition unit 701 and a prediction unit 702. The data acquisition unit 701 can be configured to acquire historical water quality time-series data for historical periods. The prediction unit 702 can be configured to input the historical water quality time-series data into the water quality prediction model of the above embodiment to obtain predicted water quality time-series data output by the water quality prediction model.
[0078] In this embodiment, the specific processing of the data acquisition unit 701 and the prediction unit 702 in the water quality prediction device 700, and the resulting technical effects, can be found in reference to [reference needed]. Figure 5 The relevant descriptions of steps 501 and 502 in the corresponding embodiments will not be repeated here.
[0079] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0080] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their patterns are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0081] like Figure 8 As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.
[0082] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0083] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as water quality prediction model training methods or water quality prediction methods. For example, in some embodiments, the water quality prediction model training method or water quality prediction method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the water quality prediction model training method or water quality prediction method described above can be performed. Alternatively, in other embodiments, the computing unit 801 may be configured by any other suitable means (e.g., by means of firmware) to perform a water quality prediction model training method or a water quality prediction method.
[0084] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0085] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a general-purpose computer, special-purpose computer, or other programmable water quality prediction model training device or processor or controller of a water quality prediction device, such that when executed by the processor or controller, the program code causes the patterns / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0086] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0087] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0088] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0089] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0090] The foregoing description of specific exemplary embodiments of this disclosure is for illustrative and explanatory purposes. These descriptions are not intended to limit this disclosure to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of this disclosure and their practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of this disclosure, as well as various different choices and variations. The scope of this disclosure is intended to be defined by the claims and their equivalents.
Claims
1. A water quality prediction network, characterized in that, The water quality prediction network includes: The time-series decomposition module is used to extract periodic signals from water quality time-series data in historical periods to obtain trend components, seasonal components, and microscale components; the trend components, seasonal components, and microscale components are fused to obtain a reconstructed input sequence; The time-frequency fusion module, connected to the time-series decomposition module, includes: a dynamic convolution submodule, a wavelet transform submodule, and a mutation detection submodule. The dynamic convolution submodule is used to extract short-term fluctuations and patterns from the reconstructed input sequence; the wavelet transform submodule is used to extract the main variable sequence from the reconstructed input sequence and extract the multi-band energy spectrum of the main variable sequence; and the mutation detection submodule is used to identify abrupt change points in the reconstructed input sequence. The channel fusion module, connected to the time-frequency fusion module, includes: a multi-head attention submodule, which is used to fuse the short-term fluctuations and patterns, the multi-band energy spectrum and the sudden change points using a cross-channel multi-head attention mechanism to obtain a fused feature sequence; The time-series prediction module, connected to the channel fusion module, includes: a partitioning submodule, an encoding submodule, and a fully connected network. The partitioning submodule is used to divide the fused feature sequence into at least two feature blocks and map all feature blocks to the same embedding space. The encoding submodule is used to encode all feature blocks and retain the temporal order information of all feature blocks to obtain an encoded feature sequence. The fully connected network is used to perform dimensionality compression and prediction mapping on the encoded feature sequence to obtain predicted water quality time-series data.
2. The water quality prediction network according to claim 1, characterized in that, The time-series decomposition module includes: The time series analysis submodule is used to decompose the water quality time series data into trend component, seasonal component, and residual component. The variational mode decomposition submodule is used to decompose the residual components into multiple intrinsic mode functions, each of which has a specific center frequency and a finite bandwidth. The component fusion submodule is connected to the time series analysis submodule and the variational mode decomposition submodule, respectively, and is used to fuse the trend component, the seasonal component and the multiple intrinsic mode functions using a learnable weight mechanism to obtain a reconstructed input sequence.
3. The water quality prediction network according to claim 1, characterized in that, The channel fusion module also includes: A layer normalization network, connected to the multi-head attention submodule, is used to normalize the fused feature sequence; The feedforward network, connected to the layer normalization network, is used to perform the same transformation on the features at each position of the normalized fused feature sequence.
4. The water quality prediction network according to any one of claims 1-3, characterized in that, The fully connected network includes: A first fully connected network, connected to the encoding submodule, is used to enhance the expression of the encoded feature sequence; A second fully connected network, connected to the first fully connected network, is used to transform the enhanced encoded feature sequence into predicted water quality data.
5. A method for training a water quality prediction model, characterized in that, The method further includes: Obtain an initial water quality prediction network and a water quality training sample set, wherein the water quality prediction network adopts the water quality prediction network described in any one of claims 1-4; Calculate the target decomposition parameters of the time-series decomposition module in the water quality prediction network to obtain a water quality prediction model using the target decomposition parameters; Based on the water quality training sample set, the water quality prediction model is trained to obtain the trained water quality prediction model.
6. The method according to claim 5, characterized in that, The time-series decomposition module includes: a time-series analysis submodule, a variational mode decomposition submodule, and a component fusion submodule. The target decomposition parameters include: the target period of the time-series analysis submodule and the target number of the variational mode decomposition submodule. Calculating the target decomposition parameters of the time-series decomposition module in the water quality prediction network to obtain a water quality prediction model using the target decomposition parameters includes: For each decomposition period, a candidate period list is generated; the decomposition quality of the candidate periods in the candidate period list is evaluated to obtain a quality score sequence; based on the quality score sequence and the candidate period list, a target period is obtained, and the target period is set for the time series analysis submodule. For each decomposition quantity, a candidate quantity list is generated; the decomposition quality of the candidate quantities in the candidate quantity list is evaluated to obtain a quantity score sequence; Based on the quantity score sequence, a selection strategy is used to select a target quantity from the candidate quantity list; the target quantity is set for the variational mode decomposition submodule to obtain the water quality prediction model.
7. A water quality prediction method, characterized in that, The method includes: Obtain historical water quality time-series data for historical periods; The historical water quality time series data is input into the water quality prediction model of claim 5 or 6 to obtain the predicted water quality time series data output by the water quality prediction model.
8. A water quality prediction model training device, characterized in that, The device includes: The network acquisition unit is configured to acquire an initial water quality prediction network and a water quality training sample set, wherein the water quality prediction network adopts the water quality prediction network described in any one of claims 1-4; The computing unit is configured to calculate the target decomposition parameters of the time-series decomposition module in the water quality prediction network, and obtain a water quality prediction model using the target decomposition parameters. The training unit is configured to train the water quality prediction model based on the water quality training sample set to obtain the trained water quality prediction model.
9. A water quality prediction device, characterized in that, The device includes: The data acquisition unit is configured to acquire historical water quality time-series data for historical periods. The prediction unit is configured to input the historical water quality time series data into the water quality prediction model of claim 8 to obtain the predicted water quality time series data output by the water quality prediction model.
10. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 5-7.
11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 5-7.
Citation Information
Cited By
Water quality prediction method and system based on seasonal item enhanced modeling
CN122087432A