A water quality change trend rapid prediction method based on multi-source data fusion and physical constraint
By using multi-source data fusion and physical constraints, a hydrodynamic-water quality coupling model and sensor network are constructed. Combined with spectral analysis and real-time prediction models, the timeliness and cost issues of traditional COD detection are solved, and high-precision prediction of water quality change trends is achieved. This model is suitable for real-time monitoring of large-scale complex water areas.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HOHAI UNIV
- Filing Date
- 2025-05-23
- Publication Date
- 2026-06-23
AI Technical Summary
Traditional COD detection methods suffer from poor timeliness, high cost, insufficient spatial coverage, inadequate coupling of hydrodynamic and water quality models, and unoptimized environmental interference factors, making it difficult to achieve high-precision prediction of pollutant spatial distribution.
A multi-source data fusion and physical constraint approach is adopted, and a hydrodynamic-water quality coupling model is constructed by combining a low-cost DO sensor network with spectral technology. The sensor network is deployed by combining information entropy assessment and multi-objective optimization algorithms to construct water quality sensitive areas. Kriging interpolation and spectral feature analysis are used to generate a global water quality distribution map, and real-time prediction is performed by combining ensemble Kalman filtering and RF-LSTM model.
It enables rapid prediction of global COD change trends at low cost and high accuracy, improving the timeliness and coverage of monitoring. It can dynamically respond to pollution changes in complex waters within minutes, reducing hardware and operation and maintenance costs, and improving prediction accuracy and adaptability.
Smart Images

Figure CN120598102B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of water environment monitoring technology, specifically involving a method for rapidly predicting the spatiotemporal distribution of chemical oxygen demand (COD) in water bodies by combining a hydrodynamic-water quality coupling model with a dissolved oxygen (DO) sensor network and cross-correlation analysis between multi-source optical characteristic values and DO-COD data. Background Technology
[0002] Chemical oxygen demand (COD) is a key indicator for measuring the degree of organic pollution in water bodies. Traditional COD detection mainly relies on laboratory chemical analysis methods, primarily the potassium dichromate method and the potassium permanganate method, both of which require on-site sampling and completion in a laboratory environment. While laboratory chemical analysis methods offer high accuracy, they suffer from inherent drawbacks such as poor timeliness, high cost, and the risk of human interference, making them unsuitable for real-time monitoring of pollution events and hindering widespread adoption. Existing technologies have seen some studies attempting to indirectly predict COD using a single water quality parameter (such as dissolved oxygen DO), but the following technical bottlenecks remain:
[0003] (1) Insufficient monitoring spatial coverage: It is difficult to capture the spatial heterogeneity of pollutants by relying solely on discrete monitoring stations, especially in sensitive areas such as river bends and tributary confluences;
[0004] (2) Insufficient coupling of hydrodynamic-water quality model: The hydrodynamic-water quality model was not combined with the simulation of the impact of water flow on pollutant diffusion, which limited the prediction accuracy;
[0005] (3) Environmental interference factors were not optimized: the dynamic effects of environmental variables such as temperature and pH on the correlation between DO and COD were not effectively eliminated;
[0006] (4) Spectroscopic techniques are not quantitative: Hyperspectral and multispectral techniques are mostly used for qualitative identification of pollutant types, but lack quantitative relationship between spectral characteristic values and COD concentration.
[0007] Therefore, this invention proposes a rapid prediction method for water quality change trends based on multi-source data fusion and physical constraints. By combining a low-cost DO sensor network with spectral technology, it addresses the shortcomings of traditional COD detection methods in terms of spatiotemporal resolution, operating costs, and anti-interference capabilities. Summary of the Invention
[0008] In view of the shortcomings of the above-mentioned COD prediction technologies, the purpose of this invention is to provide a rapid prediction method for water quality change trends based on multi-source data fusion and physical constraints, which can achieve low-cost and high-precision rapid prediction of global COD change trends.
[0009] The technical solution adopted in this invention is: a method for rapid prediction of water quality change trends based on multi-source data fusion and physical constraints, the specific steps of which include:
[0010] Step 1: Simultaneously collect spectral information, DO, COD, temperature and pH data at key monitoring stations. Construct a hydrodynamic-water quality coupling model based on shallow water equation and convection-diffusion equation to simulate the dynamic distribution of water quality parameters (DO, COD) under the action of water flow, providing physical mechanism support for subsequent machine learning modeling of optical features and COD.
[0011] S11: Use a sampler to collect water samples at key monitoring sites, measure water temperature, pH value and dissolved oxygen (DO) content on site, and then take the supernatant as a sample after the water has been allowed to stand.
[0012] Furthermore, the sampler used in S11 is an automatic sampler, which can be controlled by a preset program to automatically sample. The automatic sampler collects water from deep below the water surface, and after standing for 30 minutes, the supernatant is collected. The sample should be stored in parallel in brown glass bottles according to the water quality sampling specifications and stored at 4°C. The water temperature (Temp), pH value, and dissolved oxygen content are measured at the sampling site. After sampling, the sampler sends the collected water sample to the laboratory. Half of the sample is randomly selected to determine the chemical oxygen demand (COD) of the water, and the remaining half is used for subsequent spectroscopic detection. The sample used for spectroscopic detection should be filtered through a 0.45μm filter membrane before the test to remove the interference of suspended particulate matter on the optical characteristic values.
[0013] S12: Based on the two-dimensional shallow water equations, a hydrodynamic model is constructed to simulate the flow velocity, flow direction, and water level changes of the water body. Specifically, it includes the following governing equations:
[0014] Continuity equation:
[0015]
[0016] Momentum equation:
[0017]
[0018] Where h is the water depth; t is the time; u = u(x,y,t) and v = v(x,y,t) are the components of the water flow velocity in the x and y directions, respectively; g is the acceleration due to gravity; and H is the water surface elevation, H = h + z. b , z b τ is the elevation of the riverbed. bx τ by These are the components of the riverbed shear stress in the x and y directions, respectively, calculated based on Manning's formula:
[0019] τ bx =ρghS f
[0020] Where ρ is the density of water; S f The energy gradient is approximately equal to the water surface gradient.
[0021] The finite volume method is used to discretize the equations, and the numerical flux is solved based on the Roe flux difference scheme. The third-order Runge-Kutta method is used for time integration to ensure the stability of the solution process.
[0022] S13: A water quality model is constructed based on the convection-diffusion equation to simulate the transport process and concentration changes of solutes in water. Specifically, it includes the following equations:
[0023] Convection-diffusion-reaction equation:
[0024]
[0025] Where C is the concentration of water quality parameters; Dx and Dy are the diffusion coefficients in the x and y directions, respectively; S(C) is the external source-sink term; and R(C) is the chemical / biological reaction term.
[0026] DO dynamics model (Streeter-Phelps modified equations):
[0027]
[0028] Among them, C DO D represents the concentration of DO; DO DO is the molecular diffusion coefficient of dissolved oxygen. s K represents the saturated dissolved oxygen concentration in water. a K represents the atmospheric reoxygenation rate. r K is the rate of oxygen consumption during respiration. d The oxygen consumption rate during deposition.
[0029] COD degradation model:
[0030] R(C COD )=-K COD C COD
[0031] Among them, C COD COD concentration; K COD is the COD degradation rate constant.
[0032] S14: Determine the coupling mechanism; the data transfer process includes:
[0033] Hydrodynamic model → Water quality model: The hydrodynamic model outputs the velocity field u(x,y,t) as the convection term to drive the water quality model;
[0034] Water quality model → Hydrodynamic model: Pollutant concentration gradient is used to correct the riverbed shear stress τ through sedimentation / resuspension processes. bx τ by.
[0035] S15: Solve the coupled model using a partitioned iterative algorithm. The specific steps include:
[0036] S151: Initialize the hydrodynamic field u0, calculate h, u, v using the hydrodynamic model and output the results to the water quality model;
[0037] S152: With a fixed flow velocity field, solve for the COD and DO distributions in the water quality model and update the pollutant concentrations;
[0038] S153: Use the new concentration field to correct the source and sink terms and resolve the hydrodynamic equations;
[0039] S154: Repeat steps 1-2 until the residuals converge, i.e., the relative errors of the hydrodynamic variables and pollutant concentrations in adjacent iterations are all less than 10. -2 Using low-cost water quality sensors as monitoring equipment avoids the problems of high cost, need for chemical reagents, and professional maintenance associated with traditional COD monitoring equipment.
[0040] Step 2: Output the water quality sensitive area through the hydrodynamic-water quality model, combine information entropy assessment and spatial clustering to screen sensor deployment points, realize low-cost water quality sensor network deployment through multi-objective optimization algorithm, and calculate the global water quality distribution map of the water body using spatial interpolation method.
[0041] S21: Calculate the range of the hydraulically sensitive area and the chemically sensitive area based on the hydrodynamic model, and couple the two to generate the output water quality sensitive area.
[0042] Specifically, by calculating the velocity gradient field G(x,y), regions with G values greater than a threshold are defined as hydraulically sensitive zones, with a corresponding weight of w1; by simulating pollutant diffusion to generate a cumulative concentration field S(x,y), regions with S values greater than a threshold are selected as chemically sensitive zones, with a corresponding weight of w2. The relevant calculation formulas are as follows:
[0043]
[0044] S22: Based on the location of the water quality sensitive area output by S21, a low-cost water quality sensor is deployed accordingly;
[0045] S221: Calculate the information entropy of candidate points within the sensitive area. x i p is the coordinate of the i-th candidate point within the sensitive area. k The probability distribution of historical water quality parameters in category k is given by K, where K is the total number of discretized categories. The top N points with the highest entropy values are selected to cover the region with the greatest spatiotemporal variation.
[0046] S222: Perform K-means clustering on the sensitive area to generate M spatial clusters; deploy one sensor in each cluster to ensure that the Voronoi Diagram covers the entire area.
[0047] For each cluster C j Select locations that meet the following conditions:
[0048] And H(x) i >0.5H th
[0049] Final output of initial deployment plan Among them, C j It is the j-th spatial cluster, c j It is cluster C j The center of mass, It is cluster C j The final selected sensor location.
[0050] S223: Establish a multi-objective optimization algorithm and perform fine-tuning.
[0051] (1) NSGA-III Algorithm Configuration
[0052] ① Decision variables: Define binary choice variables s i ∈{0,1} indicates whether x is in x i Deploy sensors.
[0053] ② Objective function
[0054] Maximize spatial coverage: Where A i Let A be the area of the Thiessen polygon of sensor i. 总 This represents the total area of the sensitive zone;
[0055] Minimize cost: Where c i For deployment costs;
[0056] Maximize information entropy: Where H(x) i ) represents the information entropy of the candidate points.
[0057] ③Constraints:
[0058] Sensor spacing, and coverage area of the sensitive area ≥ d min ;
[0059] Coverage of sensitive areas ≥95%;
[0060] Candidate points must be located in sensitive area grid nodes.
[0061] (2) Optimize the process
[0062] Phase 1: with For the initial population, run the NSGA-III algorithm;
[0063] Phase 2: If the optimal solution f1 < 98%, merge. Re-optimization;
[0064] Termination conditions:
[0065] S224: Automation Solution Output
[0066] (1) Optimal solution selection
[0067] Scoring function: in
[0068] Output result:
[0069] The type determination method is as follows:
[0070] Priority calculation:
[0071] (2) Effect verification and incremental optimization:
[0072] Coverage gap detection:
[0073] Calculate the uncovered area A gap =A 总 -∑s i A i If A gap =A 总 -∑s i A i This triggers incremental deployment, supplementing sensors in descending priority order:
[0074] S23: Collect the DO data output from the DO sensor in S22, and fuse the discrete DO data using Kriging interpolation. Specific steps include:
[0075] S231: Filtering outlier DO values based on the IQR method;
[0076] S232: Calculate all sensor point pairs (x i ,x i The semivariance γ(d) of +d) is calculated using the following formula:
[0077]
[0078] Where d is the distance between sensor point pairs; N(d) is the number of point pairs with a spacing within [d, d + Δd]; z(x i (x) represents the point. i The estimated value of DO at that location.
[0079] S233: Solve using the Kriging equations:
[0080]
[0081] Where, γ ij =(‖x i -x j ‖)
[0082] S24: Generate a global DO distribution map based on the solution results. This step, based on the water quality sensitive areas output by the hydrodynamic-water quality model, combines information entropy assessment, spatial clustering, and multi-objective optimization algorithms to achieve optimized configuration of a low-cost water quality sensor network; simultaneously, through spatial interpolation methods, a global water quality distribution map of the water body is constructed, realizing a leap in water quality monitoring capabilities from "point observation" to "global distribution".
[0083] Step 3: Based on the synchronous collection of spectral information from key monitoring stations, analyze the main pollution sources, and use principal component analysis and attention mechanism neural networks to reduce the dimensionality of spectral feature values and assign weights to generate a comprehensive optical index.
[0084] S31: Simultaneously acquire three-dimensional fluorescence spectral data from water samples collected at key monitoring stations, acquire hyperspectral and multispectral remote sensing data from remote sensing images, realize multi-source spectral data acquisition, and perform data preprocessing.
[0085] Furthermore, each of the three methods possesses different spectral coverage and spatiotemporal resolution advantages, complementing each other to construct a comprehensive spatiotemporal optical data system. Hyperspectral remote sensing is a technique that uses very narrow and continuous spectral channels to continuously remotely image ground objects. Based on the HyperGlobal-450K large-scale hyperspectral image dataset, it acquires reflectance data in continuous narrow bands and extracts characteristic bands of dissolved organic matter (DOM) in water bodies through spectral differentiation. Multispectral remote sensing is a technique that uses light of different wavelength ranges for remote sensing detection and analysis. Based on Landsat satellite remote sensing data, it selects target-sensitive bands (such as visible light, infrared, etc.), extracts the differences between different spectral bands, and normalizes them. It uses normalized water indexes and algae indices to identify the characteristics of pollutants in water bodies. Three-dimensional fluorescence spectroscopy systematically measures the fluorescence intensity of samples under different combinations of excitation and emission wavelengths, obtaining a graph showing the relationship between fluorescence intensity and changes in excitation wavelength (Ex) and emission wavelength (Em). Through three-dimensional fluorescence spectroscopy, it obtains spectral matrices for specific excitation and emission wavelengths, analyzing the source and activity of pollutants.
[0086] Specifically, the operating steps of S31 include:
[0087] S311: Collect three-dimensional fluorescence spectral data from water samples collected at key monitoring stations to construct a spectral matrix with an excitation wavelength range of Ex = 200-500 nm and an emission wavelength range of Em = 250-600 nm;
[0088] S312: Based on the HyperGlobal-450K large-scale hyperspectral image dataset, extract continuous narrow band (5-10nm interval) hyperspectral remote sensing features; based on Landsat satellite remote sensing data, extract multispectral wide band remote sensing data, with blue / green light used to detect plankton and red / near-infrared light used to characterize algae.
[0089] S313: Preprocess the acquired multi-source spectral data.
[0090] Specifically, the hyperspectral and multispectral data were converted into surface reflectance using standard atmospheric correction tools. The Savitzky-Golay filtering algorithm was used to smooth and denoise the hyperspectral data, and the heterogeneous remote sensing data were unified to the same spatial coordinate system. Rayleigh scattering and Raman scattering interference were eliminated by the instrument’s built-in algorithm, and blank water sample signals in the three-dimensional fluorescence data were removed. Parallel factor analysis was used to analyze the fluorescence intensity of each sample point on the three-dimensional fluorescence spectrum.
[0091] S32: Extract spectral feature values from hyperspectral data, multispectral remote sensing data, and three-dimensional fluorescence spectral data respectively. Principal component analysis is used to reduce the dimensionality of the high-dimensional spectral features. Then, an attention-based neural network is used to assign weights to each spectral variable to generate a comprehensive optical index. Specific steps include:
[0092] S321: Extract spectral feature values from hyperspectral data, multispectral remote sensing data, and three-dimensional fluorescence spectral data.
[0093] (1) Extracting hyperspectral feature bands based on the spectral differential method, the specific steps include:
[0094] ① Numerical difference processing is used to obtain the trend of spectral line changes in hyperspectral data. The equations involved include:
[0095] a. The first derivative reflects the slope change of the spectral curve, eliminating differences in illumination:
[0096]
[0097] b. The second derivative identifies abrupt changes in spectral curvature (such as absorption peak positions), further suppressing linear background:
[0098]
[0099] Where R is reflectivity, λ is wavelength, i is band number, and Δλ is band spacing.
[0100] ② The extreme point analysis method is adopted, and the zero point of the derivative corresponds to the absorption peak boundary of the original spectrum. Combined with correlation analysis, the differential features with strong discrimination are screened to realize the selection of DOM sensitive bands.
[0101] (2) Based on multispectral remote sensing data, the characteristics of water pollutants are identified using the Normalized Difference Water Index (NDWI) and the Facial Algae Index (FAI). The specific steps include:
[0102] a. Cropping the preprocessed remote sensing image data to the study area to remove cloud interference;
[0103] b. Calculate NDWI and FAI separately, involving the following formulas:
[0104] NDWI calculation formula:
[0105]
[0106] FAI calculation formula:
[0107] FAI=R NIR -R′ NIR
[0108]
[0109] Among them, R Green R Red R NIR R SWIR R' represents the reflectance in the green, red, near-infrared, and short-wave infrared bands. NIR λ is a linear estimate based on the red and SWIR bands. Red , λ NIR , λ SWIR These refer to the wavelengths of the red light band, near-infrared band, and short-wave infrared band.
[0110] Furthermore, NDWI utilizes the normalization processing of the reflectance difference between the green light band and the near-infrared (NIR) band to highlight water body information and suppress vegetation and soil interference. The level of NDWI value can reflect the degree of water pollution. FAI suppresses water body background noise and enhances the sensitivity of algae signal detection through linear fitting and residual calculation of the red light (Red), near-infrared (NIR), and short-wave infrared (SWIR) bands. The level of FAI value can quantify algal biomass.
[0111] (3) Obtain the spectral matrix of specific excitation and emission wavelengths by sharing three-dimensional fluorescence spectroscopy to distinguish the sources of COD pollution. The specific steps include:
[0112] a. Calculate the fluorescence intensity matrix of the water sample in the range of excitation wavelength Ex = 200-500 nm and emission wavelength Em = 250-600 nm. Combine this with the constructed pollutant fluorescence fingerprint database to identify the characteristic peak positions corresponding to typical pollutants:
[0113] Humus-like peak (Ex = 250-280 nm, Em = 380-480 nm); protein-like peak (Ex = 220-230 nm, Em = 320-350 nm); humic acid-like peak (Ex = 320-350, Em = 420-480).
[0114] b. Calculate the fluorescence index (FI), humification index (HIX), and biological index (BIX) from the fluorescence matrix data for optical feature fusion. Specific calculation formulas include:
[0115] FI calculation formula:
[0116]
[0117] HIX calculation formula:
[0118]
[0119] BIX calculation formula:
[0120]
[0121] Among them, I λ This represents the fluorescence intensity value at an emission wavelength of λnm.
[0122] c. Determine the main pollution source category based on the Mahalanobis distance between the real-time fluorescence index (FI, HIX, BIX) and the historical pattern.
[0123] S322: Principal component analysis and attention mechanism neural networks are used to reduce the dimensionality of spectral feature values and assign weights to them, generating a comprehensive optical index. Specific steps include:
[0124] (1) To eliminate the dimensional differences between different optical characteristics (reflectivity, index value, fluorescence intensity), all spectral characteristic values S are standardized. The formulas involved include:
[0125]
[0126] (2) Principal component analysis is used to reduce the dimensionality of spectral eigenvalues. The specific steps include:
[0127] a. Calculate the covariance matrix ∑ of the high-dimensional feature matrix X. X :
[0128]
[0129] Among them, X T Let represent the transpose of matrix X, where n is the number of samples.
[0130] b. For the covariance matrix ∑ X Perform eigenvalue decomposition to obtain eigenvalues and eigenvectors.
[0131] c. Select the first k principal components V(V1,V2,...,V...). k This generates low-dimensional features.
[0132] (3) Attention Mechanism: The neural network weighting assigns weights to spectral feature values. The formula for calculating attention weights is as follows:
[0133]
[0134] Where, α i represents the weight corresponding to each spectral feature value; Sim represents the weight coefficient of different spectral feature values; i and j represent the i-th and j-th spectral feature values; L represents the number of spectral feature values.
[0135] (4) Calculate the comprehensive optical index F based on the corresponding weights of each spectral feature value.
[0136]
[0137] Among them, V i This represents the dimensionality-reduced spectral feature value corresponding to the direction of the i-th principal component. This step integrates multi-source data to form a multi-dimensional dataset, enhancing the ability to identify pollution and express model inputs; it constructs a dynamic relationship model of multi-source optical feature values-DO-COD, which, compared to the traditional method relying on chemical modules, improves accuracy and timeliness without relying on expensive instruments.
[0138] Step 4: Based on real-time optical eigenvalues (DO) data, combined with spatial topology networks, water quality gradients, and cross-regional covariance to capture the spatial correlation of water quality parameters between different locations, construct an optical eigenvalues-DO-COD dynamic prediction model; combine pollution source tracing and spectral features to correct COD prediction values, and use ensemble Kalman filtering to assimilate multi-source data to improve model accuracy.
[0139] S41: Based on the different sources of COD in step S321, analyze the differences in degradation kinetics, introduce a pollution source weighting factor β into the coupled model, and correct the COD degradation rate. The relevant formulas are as follows:
[0140]
[0141] Where m is the pollution source category number, M is the total number of pollution source categories, and β m The contribution weight of the m-th pollution source (∑β) m =1), K COD,m This represents the COD degradation rate constant corresponding to the pollution source.
[0142] S42: Combine hyperspectral characteristic bands to retrieve the concentration of specific pollutants, and use this as a basis to dynamically correct the COD concentration. Specific steps include:
[0143] S421: Based on the hyperspectral feature bands extracted in step 4, a partial least squares regression model (PLSR) is constructed to retrieve the concentration of a specific pollutant. The relevant formulas are as follows:
[0144]
[0145] Among them, w i These are the weight coefficients for the PLSR model. For wavelength λ i The band reflectivity, b is the intercept term, C spec This represents the concentration of pollutants obtained through inversion.
[0146] S422: Calculate the correction term ΔCOD based on the pollutant-COD conversion coefficient α calibrated in the laboratory, using the following formula:
[0147] ΔCOD=α·C spec
[0148] S423: Superimpose ΔCOD onto the COD concentration field output from the water quality model in step 2 to obtain the corrected COD concentration C′. COD The formulas involved are as follows:
[0149] C′ COD =C COD +ΔCOD
[0150] S43: Introducing a time lag factor and integrating the spatial correlation characteristics of monitoring points, this study analyzes the lag response of optical feature values and DO concentration changes to COD concentration. Based on a collaborative modeling system of Random Forest (RF) and Long Short-Term Memory Network (LSTM) (RF-LSTM), a dynamic relationship model of optical feature values, DO, and COD is constructed to achieve minute-level COD prediction. Specific steps include:
[0151] S431: Spatial correlation between captured water quality factors and monitoring locations:
[0152] (1) Construct a topology map of monitoring points and establish the connection relationship between adjacent points based on Delaunay triangulation;
[0153] (2) Calculate the gradient characteristics of water quality parameters between adjacent points:
[0154]
[0155] Among them, C i C j The values represent the concentrations of water quality factors (DO, temperature, pH, etc.) at monitoring points i and j, respectively, and x represents the concentrations at x. i ,x j Let N be the spatial coordinates of the point, and N(i) be the set of Delaunay neighboring points of point i.
[0156] (3) Extract the cross-regional covariance matrix:
[0157] Σ cross =cov(C core C sensor )
[0158] Among them, C core For the key monitoring point water quality parameters in step 1, C sensor This refers to the sensor location data from step 2.
[0159] S432: Acquire DO sensor network data and optical feature values F in real time through IoT terminals to construct a dynamic input matrix X. t_real =[F t ,ΔF t ,DO t ,ΔDO t Temp t pH t G adj (x i ),Σ cross ],
[0160] S433: Introducing data with a first τ time step to capture lag effects, resulting in a characteristic matrix with a lag factor.
[0161] S434: Employs RF-LSTM collaborative modeling, by selecting key features and establishing the spatiotemporal dependency of COD.
[0162] (1) Random Forest Feature Selection: Define Spatial Weight Factor:
[0163]
[0164] Where, ||x i -x j ‖ represents the Euclidean distance between points i and j.
[0165] Extended matrix X tInput the random forest model and perform importance filtering to extract the top K key variables to form a subset X. t_selected ,
[0166] (2) Using a sliding time window (length w), X t_selected Input an LSTM model and output a real-time COD prediction value C. t_pred ,
[0167] S44: C t_pred As boundary conditions for the water quality model, the coupled model is recalculated, and Newton's iteration method is introduced to accelerate model convergence, ensuring a response time within minutes. The relevant formulas are as follows:
[0168]
[0169] in, For model operators, Let be the Jacobian matrix, and m be the number of iterations.
[0170] S45: To further improve the accuracy of COD simulation, ensemble Kalman filtering is used to assimilate multi-source data and improve model accuracy. Specific steps include:
[0171] S451: By disturbing hydrodynamic parameters (diffusion coefficient Dx / y) and degradation rate K COD And the initial concentration field, generate N=100 model state sets Xi.
[0172] S452: Run the coupled model up to the current time step to obtain the prediction set Xi. f .
[0173] S453: Calculate the Kalman gain, involving the following formulas:
[0174]
[0175] Among them, P f For the prediction error covariance matrix, For the observation operator (mapping the model mesh to sensor points), C obs This represents the observation error covariance.
[0176] S454: Fusion of real-time DO observation concentration Z and optical characteristic value F to update the state set, involving the following formulas:
[0177]
[0178] S455: Take The mean value is used as the optimal estimated state and fed back to the coupled model for further calculation.
[0179] S46: Output the corrected spatiotemporal distribution map of COD, mark high-pollution-risk areas, and generate a pollution source contribution report. This scheme introduces dynamic data assimilation and temporal learning mechanisms, enabling the model to be continuously updated, achieving real-time prediction and adaptive evolution. Combined with hyperspectral remote sensing time-series data, it elevates monitoring from single-point observation to comprehensive evolution analysis.
[0180] A rapid water quality change trend prediction device based on multi-source data fusion and physical constraints includes: a dynamic coupling modeling module, which acquires parameters such as DO, COD, temperature, and pH data from key stations, constructs a coupling model based on hydrodynamic equations, simulates the spatiotemporal dynamic distribution of DO and COD, and identifies water quality sensitive areas; a sensor optimization mapping module, which deploys low-cost DO sensors according to sensitive areas, uses information entropy assessment, spatial clustering, and multi-objective optimization algorithms to deploy a low-cost DO sensor network, and combines Kriging interpolation to fuse discrete monitoring data to reconstruct a high-resolution water quality distribution map; a pollution source tracing and analysis module, which generates a comprehensive optical pollution index by principal component dimensionality reduction and weighting based on spectral data, and uses surface sewage discharge data to trace pollution sources; and a multi-source collaborative prediction module, which integrates optical feature values, water quality time-series data, and spatial correlation features of locations, constructs an RF-LSTM hybrid model to predict COD concentration, introduces ensemble Kalman filtering to assimilate multi-source observation data, dynamically corrects the predicted values, and outputs a pollution risk map.
[0181] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the aforementioned method for rapid prediction of water quality change trends based on multi-source data fusion and physical constraints.
[0182] A computer-readable storage medium storing computer instructions thereon, which, when executed by a processor, implement the aforementioned method for rapid prediction of water quality change trends based on multi-source data fusion and physical constraints.
[0183] Compared with the prior art, the advantages of the present invention are as follows:
[0184] This invention innovatively employs a low-cost sensor network to replace traditional high-frequency COD online monitoring equipment, and combines multi-source data collaborative sensing equipment to achieve indirect COD retrieval, forming a low-cost, high-coverage water quality monitoring method, system, and device. Compared to traditional water quality monitoring methods that rely on precision spectrometers or chemical analysis modules, the low-cost water quality sensor effectively avoids problems such as high cost of single-point equipment, the need for regular reagent replacement and professional maintenance, and significantly reduces hardware deployment and long-term operation and maintenance costs.
[0185] Traditional methods are limited by discrete site deployment and insufficient spatial coverage density, making it difficult to accurately depict pollutant distribution patterns. This invention integrates hydrodynamic simulation with multi-scale sensing technology. Based on the water quality sensitive areas output by the hydrodynamic-water quality model, it combines information entropy assessment, spatial clustering, and a multi-objective optimization algorithm (NSGA-III) to achieve efficient deployment of a low-cost sensor network. Furthermore, it uses spatial interpolation technology to calculate a global water quality distribution map of the water body, upgrading water quality monitoring capabilities from point observation to full-area distribution. This approach offers excellent cost-effectiveness and scalability, making it particularly suitable for long-term deployment in large-scale, complex aquatic environments.
[0186] This invention integrates multi-source data, including 3D fluorescence, hyperspectral, multispectral, and water quality parameters, and innovatively introduces the spatiotemporal correlation characteristics between water quality parameters and monitoring points to construct a dynamic relationship model of multi-source optical characteristic values, DO, and COD, enabling indirect and high-precision estimation of COD concentration. The model combines multivariate data and physical models, and specifically incorporates pollution source tracing information and spectral feature correction mechanisms, overcoming the limitation that single spectral data cannot reflect complex water quality changes, and effectively enhancing adaptability to COD fluctuations in complex polluted environments. Compared to traditional methods, this method significantly improves the accuracy and timeliness of COD estimation without relying on expensive chemical analysis modules.
[0187] This invention employs a dynamic data assimilation and real-time prediction framework to achieve rapid response to water quality changes. Traditional monitoring relies on fixed-period laboratory analysis or offline sampling, making it difficult to capture sudden pollution events. This invention, however, acquires water quality parameters, optical indices, and environmental parameters in real time through IoT terminals. Combining the spatiotemporal correlation characteristics of water quality parameters with sensor deployment locations, it dynamically identifies major pollutants using a random forest algorithm and incorporates a long short-term memory network to achieve minute-level dynamic prediction of COD. Through spatiotemporal modeling and online learning algorithms, the model can continuously update input data and dynamically optimize parameters, significantly shortening monitoring response latency and improving monitoring accuracy and real-time self-updating capabilities.
[0188] Furthermore, this invention introduces hyperspectral remote sensing inversion technology to realize spatial correlation mapping between optical features and chemical parameters. Combined with spatiotemporal modeling methods, it can effectively predict the long-term evolution trend of water quality, providing high-resolution, full-time-domain prediction of water quality evolution trends for complex water areas, and further improving the accuracy and predictability of water quality monitoring. Attached Figure Description
[0189] Figure 1 A flowchart of a method for rapid prediction of water quality change trends based on multi-source data fusion and physical constraints;
[0190] Figure 2 A structural diagram of a device for rapid prediction of water quality change trends based on multi-source data fusion and physical constraints;
[0191] Figure 3 This is a schematic diagram of the physical structure of an electronic device. Detailed Implementation
[0192] The technical solution of the present invention will be clearly and completely described below with reference to specific embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0193] Example: The technical solution adopted in this invention is: a method for rapid prediction of water quality change trends based on multi-source data fusion and physical constraints, which realizes rapid prediction of COD spatiotemporal distribution changes, mainly including the following steps:
[0194] Step 1: Long-term collection of spectral information, DO, COD, temperature and pH data at 5 key monitoring stations along the river. Based on shallow water equations, the changes in water flow velocity, direction and water level are simulated. Convection-diffusion equations are used to simulate the spatiotemporal distribution of COD and DO. The two are coupled to construct a hydrodynamic-water quality coupled model to simulate the dynamic relationship between COD and DO as they change with water flow.
[0195] S11: Use a sampler to collect water samples at key monitoring sites, measure water temperature, pH value and dissolved oxygen (DO) content on site, and then take the supernatant as a sample after the water has been allowed to stand.
[0196] Furthermore, the sampler used in S11 is an automatic sampler, which can be controlled by a preset program to automatically sample. The automatic sampler collects water from deep below the water surface, and after standing for 30 minutes, the supernatant is collected. The sample should be stored in parallel in brown glass bottles according to the water quality sampling specifications and stored at 4°C. The water temperature (Temp), pH value, and dissolved oxygen content are measured at the sampling site. After sampling, the sampler sends the collected water sample to the laboratory. Half of the sample is randomly selected to determine the chemical oxygen demand (COD) of the water, and the remaining half is used for subsequent spectroscopic detection. The sample used for spectroscopic detection should be filtered through a 0.45μm filter membrane before the test to remove the interference of suspended particulate matter on the optical characteristic values.
[0197] S12: Based on the two-dimensional shallow water equations, a hydrodynamic model is constructed to simulate the flow velocity, flow direction, and water level changes of the water body. Specifically, it includes the following governing equations:
[0198] Continuity equation:
[0199]
[0200] Momentum equation:
[0201]
[0202] Where h is the water depth; t is the time; u = u(x,y,t) and v = v(x,y,t) are the components of the water flow velocity in the x and y directions, respectively; g is the acceleration due to gravity; and H is the water surface elevation, H = h + z. b , z b τ is the elevation of the riverbed. bx τ by These are the riverbed shear stresses, calculated based on Manning's formula:
[0203] τ bx =ρghS f
[0204] Where ρ is the density of water; S f The energy gradient is approximately equal to the water surface gradient.
[0205] The numerical flux is solved by discretizing the equations using the finite volume method based on the Roe flux difference scheme, and time integration is performed using the third-order Runge-Kutta method to ensure the stability of the solution process.
[0206] S13: A water quality model is constructed based on the convection-diffusion equation to simulate the transport processes and concentration changes of solutes such as COD and DO in water bodies. Specifically, it includes the following equations:
[0207] Convection-diffusion-reaction equation:
[0208]
[0209] Where C is the pollutant concentration (i.e., COD or DO concentration); Dx and Dy are the diffusion coefficients in the x and y directions, respectively; S(C) is the external source-sink term; and R(C) is the chemical / biological reaction term.
[0210] DO dynamics model (Streeter-Phelps modified equations):
[0211]
[0212] Among them, C DO D represents the concentration of DO; DO DO is the molecular diffusion coefficient of dissolved oxygen. s K represents the saturated dissolved oxygen concentration in water. a K represents the atmospheric reoxygenation rate. r K is the rate of oxygen consumption during respiration. d This represents the oxygen consumption rate during deposition.
[0213] COD degradation model:
[0214] R(CCOD )=-K COD C COD
[0215] Among them, C COD COD concentration; K COD is the COD degradation rate constant.
[0216] S14: Determine the coupling mechanism; the data transfer process includes:
[0217] Hydrodynamic model → Water quality model: The hydrodynamic model outputs the velocity field u(x,y,t) as the convection term to drive the water quality model;
[0218] Water quality model → Hydrodynamic model: Pollutant concentration gradient is used to correct the riverbed shear stress τ through sedimentation / resuspension processes. bx τ by .
[0219] S15: Solve the coupled model using a partitioned iterative algorithm. The specific steps include:
[0220] S151: Initialize the hydrodynamic field u0, calculate h, u, v using the hydrodynamic model and output the results to the water quality model;
[0221] S152: With a fixed flow velocity field, solve for the COD and DO distributions in the water quality model and update the pollutant concentrations;
[0222] S153: Use the new concentration field to correct the source and sink terms and resolve the hydrodynamic equations;
[0223] S154: Repeat steps 1-2 until the residuals converge, i.e., the relative errors of the hydrodynamic variables and pollutant concentrations in adjacent iterations are all less than 10. -2 .
[0224] Step 2: Output the water quality sensitive area through the hydrodynamic model and deploy low-cost DO sensors in the corresponding area. Use spatial interpolation method to calculate the global water quality distribution map of the water body.
[0225] S21: Calculate the range of the hydraulically sensitive area and the chemically sensitive area based on the hydrodynamic model, and couple the two to generate the output water quality sensitive area.
[0226] Specifically, by calculating the velocity gradient field G(x,y), regions with G values greater than a threshold are defined as hydraulically sensitive zones, with a corresponding weight of w1; by simulating pollutant diffusion to generate a cumulative concentration field S(x,y), regions with S values greater than a threshold are selected as chemically sensitive zones, with a corresponding weight of w2. The relevant calculation formulas are as follows:
[0227]
[0228] Set threshold G th=0.2s -1 The weight w1 = 0.6.
[0229]
[0230] Set a threshold and a weight w2 = 0.4.
[0231] S22: Sensor Deployment Optimization and Automation Solution:
[0232] S221: Candidate site selection based on information entropy
[0233] (1) Calculate the information entropy of the grid nodes in the sensitive area:
[0234]
[0235] Where, x i p is the coordinate of the i-th candidate point within the sensitive area. k Here is the probability distribution of historical water quality parameters in category k, where K is the total number of discretized categories; historical DO data are classified into K=3 (low / medium / high), and candidate points (H) with the highest entropy values (N=30) are selected. th =1.2).
[0236] S222: Perform K-means clustering on the sensitive area to generate 8 spatial clusters; deploy 1 sensor in each cluster to ensure that the Voronoi Diagram covers the entire area.
[0237] For each cluster C j Select locations that meet the following conditions:
[0238] And H(x) i >0.6
[0239] Final output of initial deployment plan Where C j It is the j-th spatial cluster, c j It is cluster C j The center of mass, It is cluster C j The final selected sensor location.
[0240] S223: Establish a multi-objective optimization algorithm and perform fine-tuning.
[0241] (1) NSGA-III Algorithm Configuration
[0242] ① Decision variables: Define binary choice variables s i ∈{0,1} indicates whether x is in x i Deploy sensors (30 candidate points).
[0243] ② Objective function
[0244] Maximize spatial coverage: Where A i Let A be the area of the Thiessen polygon of sensor i. 总 The total area of the sensitive zone is 12.5 km². 2 ;
[0245] Minimize cost: Where c i For deployment costs;
[0246] Maximize information entropy: Where H(x) i ) represents the information entropy of the candidate points.
[0247] ③Constraints:
[0248] Sensor spacing, and coverage area of sensitive area ≥ 200m;
[0249] Coverage of sensitive areas ≥95% A 总 ;
[0250] Candidate points must be located in sensitive area grid nodes.
[0251] (2) Optimize the process
[0252] Phase 1: with For the initial population, run the NSGA-III algorithm;
[0253] Phase 2: If the optimal solution f1 < 98%, merge. Re-optimization;
[0254] Termination conditions:
[0255] (3) Optimization results: The optimal solution is N = 10 sensors, covering f1 = 97.5%, triggering incremental deployment of N. add =2.
[0256] S224: Automation Solution Output
[0257] Scoring function: in
[0258] Type determination: Core monitoring point: H(x) i )>1.08, a total of 6; auxiliary monitoring points: the remaining 4.
[0259] Priority calculation:
[0260] Final deployment plan: 10 sensors (including 5 new ones).
[0261] S23: Collect the DO data output from the DO sensor in S32, and fuse the discrete DO data using Kriging interpolation. Specific steps include:
[0262] S231: Filtering outlier DO values based on the IQR method, with outlier DO values accounting for 2.3%;
[0263] S232: Calculate all sensor point pairs (x i ,x i The semivariance γ(d) of +d) is calculated using the following formula:
[0264]
[0265] Where d is the distance between sensor point pairs; N(d) is the number of point pairs with a spacing within [d, d + Δd]; z(x i (x) represents the point. i The estimated value of DO at that location.
[0266] During the calculation, Δd = 50m, and the final result is:
[0267] S233: Solved using the Kriging equations, with weight λ. i The mean is 0.08, and μ = 2.1.
[0268]
[0269] Where, γ ij =(‖x i -x j ‖)
[0270] S24: Generate a global DO distribution map based on the solution results.
[0271] Step 3: Based on the synchronous collection of spectral information from key monitoring stations, analyze the main pollution sources, and use principal component analysis and attention mechanism neural networks to reduce the dimensionality of spectral feature values and assign weights to generate a comprehensive optical index.
[0272] S31: Simultaneously acquire three-dimensional fluorescence spectral data from water samples collected at five key monitoring stations, acquire hyperspectral and multispectral remote sensing data using remote sensing images, achieve multi-source spectral data acquisition, and perform data preprocessing.
[0273] Furthermore, each of the three methods possesses different spectral coverage and spatiotemporal resolution advantages, complementing each other to form a comprehensive spatiotemporal optical data system. Hyperspectral remote sensing is a technique that uses very narrow and continuous spectral channels to continuously remotely image ground objects. Based on the HyperGlobal-450K large-scale hyperspectral image dataset, it acquires reflectance data in continuous narrow bands and extracts characteristic bands of dissolved organic matter (DOM) in water bodies using spectral differentiation. Multispectral remote sensing is a technique that uses light of different wavelength ranges for remote sensing detection and analysis. Based on Landsat satellite remote sensing data, it selects target-sensitive bands (such as visible light and infrared light), extracts the differences between different spectral bands, and normalizes them. It uses normalized water indexes and algae indices to identify the characteristics of pollutants in water bodies. Three-dimensional fluorescence spectroscopy systematically measures the fluorescence intensity of samples under different combinations of excitation and emission wavelengths, obtaining a graph showing the relationship between fluorescence intensity and changes in excitation wavelength (Ex) and emission wavelength (Em). It obtains spectral matrices for specific excitation and emission wavelengths using three-dimensional fluorescence spectroscopy to analyze the source and activity of DOM.
[0274] Specifically, the operating steps of S31 include:
[0275] S311: Collect three-dimensional fluorescence spectral data from water samples collected at key monitoring stations to construct a spectral matrix with an excitation wavelength range of Ex = 200-500 nm and an emission wavelength range of Em = 250-600 nm;
[0276] S312: Based on the HyperGlobal-450K large-scale hyperspectral image dataset, extract continuous narrow band (5-10nm interval) hyperspectral remote sensing features; based on Landsat satellite remote sensing data, extract multispectral wide band remote sensing data, with blue / green light used to detect plankton and red / near-infrared light used to characterize algae.
[0277] S313: Preprocess the acquired multi-source spectral data.
[0278] Specifically, the hyperspectral and multispectral data were converted into surface reflectance using standard atmospheric correction tools. The Savitzky-Golay filtering algorithm was used to smooth and denoise the hyperspectral data, and the heterogeneous remote sensing data were unified to the same spatial coordinate system. Rayleigh scattering and Raman scattering interference were eliminated by the instrument’s built-in algorithm, and blank water sample signals in the three-dimensional fluorescence data were removed. Parallel factor analysis was used to analyze the fluorescence intensity of each sample point on the three-dimensional fluorescence spectrum.
[0279] S32: Extract spectral feature values from hyperspectral data, multispectral remote sensing data, and three-dimensional fluorescence spectral data respectively. Principal component analysis is used to reduce the dimensionality of the high-dimensional spectral features. Then, an attention-based neural network is used to assign weights to each spectral variable to generate a comprehensive optical index. Specific steps include:
[0280] S321: Extract spectral feature values from hyperspectral data, multispectral remote sensing data, and three-dimensional fluorescence spectral data.
[0281] (1) Extracting hyperspectral feature bands based on the spectral differential method, the specific steps include:
[0282] ① Numerical difference processing is used to obtain the trend of spectral line changes in hyperspectral data. The equations involved include:
[0283] a. The first derivative reflects the slope change of the spectral curve, eliminating differences in illumination:
[0284]
[0285] b. The second derivative identifies abrupt changes in spectral curvature (such as absorption peak positions), further suppressing linear background:
[0286]
[0287] Where R is reflectivity, λ is wavelength, i is band number, and Δλ is band spacing.
[0288] ② Using the extreme point analysis method, the zero point of the derivative corresponds to the absorption peak boundary of the original spectrum. Combined with correlation analysis, highly discriminative differential features are screened, and the DOM sensitive band is selected:
[0289] The characteristic bands of the first-order guide are 265nm and 340nm; the characteristic bands of the second-order guide are 270mm and 355mm.
[0290] (2) Based on multispectral remote sensing data, the characteristics of water pollutants are identified using the Normalized Difference Water Index (NDWI) and the Facial Algae Index (FAI). The specific steps include:
[0291] a. Cropping the preprocessed remote sensing image data to the study area to remove cloud interference;
[0292] b. Calculate NDWI and FAI separately, involving the following formulas:
[0293] NDWI calculation formula:
[0294]
[0295] FAI calculation formula:
[0296] FAI=R NIR-R′ NIR
[0297]
[0298] Among them, R Green R Red R NIR R SWIR R' represents the reflectance in the green, red, near-infrared, and short-wave infrared bands. NIR λ is a linear estimate based on the red and SWIR bands. Red , λ NIR , λ SWIR These refer to the wavelengths of the red light band, near-infrared band, and short-wave infrared band.
[0299] Furthermore, NDWI utilizes the normalization processing of the reflectance difference between the green light band and the near-infrared (NIR) band to highlight water body information and suppress vegetation and soil interference. The level of NDWI value can reflect the degree of water pollution. FAI suppresses water body background noise and enhances the sensitivity of algae signal detection through linear fitting and residual calculation of the red light (Red), near-infrared (NIR), and short-wave infrared (SWIR) bands. The level of FAI value can quantify algal biomass.
[0300] c. Set NDWI thresholds: clean water (>0.2), slightly polluted (0-0.2), heavily polluted (<0);
[0301] Set the FAI threshold for algae enrichment areas (FAI>0.01-0.05).
[0302] d. Overlay the NDWI and FAI results to generate a pollution type zoning map:
[0303] High FAI + low NDWI: Algal pollution; Low FAI + low NDWI: Inorganic suspended solids pollution; High NDWI + low FAI: Clean water.
[0304] (3) Differentiating COD pollution sources based on preprocessed three-dimensional fluorescence spectral data, specifically including:
[0305] a. Identify the location of characteristic peaks by comparing three-dimensional fluorescence spectral data with historical fingerprint database:
[0306] Humus-like peaks: Ex = 270nm, Em = 420nm (matching the domestic sewage fingerprint database, similarity 92%);
[0307] Protein-like peaks: Ex = 225 nm, Em = 330 nm (matching agricultural runoff fingerprint database, similarity 85%);
[0308] Determine the contribution weight of pollution sources: domestic sewage (β1 = 0.6), agricultural runoff (β2 = 0.4).
[0309] b. Calculate the Mahalanobis distance between the real-time fluorescence index (FI, HIX, BIX) and the historical pattern to determine the main pollution source category.
[0310] Fluorescence index (FI):
[0311]
[0312] HIX calculation formula:
[0313]
[0314] BIX calculation formula:
[0315]
[0316] Among them, I λ This represents the fluorescence intensity value at an emission wavelength of λnm.
[0317] Output: FI = 1.85, HIX = 8.7, BIX = 0.88.
[0318] c. The Mahalanobis distance between the fluorescence index and the historical pollution source pattern (domestic sewage: FI = 1.8 ± 0.1, HIX = 9.0 ± 0.5, BIX = 0.9 ± 0.05) is:
[0319]
[0320] The threshold D is calculated. M <1.5, indicating that the pollution is mainly caused by domestic sewage.
[0321] S322: Principal component analysis and attention mechanism neural networks are used to reduce the dimensionality of spectral feature values and assign weights to them, generating a comprehensive optical index. Specific steps include:
[0322] (1) To eliminate the dimensional differences between different optical characteristics (reflectivity, index value, fluorescence intensity), all spectral characteristic values S are standardized. The formulas involved include:
[0323]
[0324] (2) Principal component analysis is used to reduce the dimensionality of spectral eigenvalues. The specific steps include:
[0325] a. Calculate the covariance matrix ∑ of the high-dimensional feature matrix X. X :
[0326]
[0327] Among them, X T Let represent the transpose of matrix X, where n is the number of samples.
[0328] b. For the covariance matrix ∑ X Perform eigenvalue decomposition to obtain eigenvalues and eigenvectors.
[0329] c. Select the first k principal components V(V1,V2,...,V...). k This generates low-dimensional features.
[0330] (3) Attention Mechanism: The neural network weighting assigns weights to spectral feature values. The formula for calculating attention weights is as follows:
[0331]
[0332] Where, α i represents the weight corresponding to each spectral feature value; Sim represents the weight coefficient of different spectral feature values; i and j represent the i-th and j-th spectral feature values; L represents the number of spectral feature values.
[0333] (4) Calculate the comprehensive optical index F based on the corresponding weights of each spectral feature value.
[0334]
[0335] Among them, V i This represents the dimension-reduced spectral eigenvalue corresponding to the direction of the i-th principal component.
[0336] Step 4: Based on real-time optical eigenvalues (DO) data, combined with spatial topology networks, water quality gradients, and cross-regional covariance to capture the spatial correlation of water quality parameters between different locations, construct an optical eigenvalues-DO-COD dynamic prediction model; combine pollution source tracing and spectral features to correct COD prediction values, and use ensemble Kalman filtering to assimilate multi-source data to improve model accuracy.
[0337] S41: Based on the different sources of COD in step S321, analyze the differences in degradation kinetics, introduce a pollution source weighting factor β into the coupled model, and correct the COD degradation rate. The relevant formulas are as follows:
[0338]
[0339] Where m is the pollution source category number, M is the total number of pollution source categories, and β m The contribution weight of the m-th pollution source (∑β) m =1), K COD,m This represents the COD degradation rate constant corresponding to the pollution source.
[0340] Specifically, based on the contribution ratio of fluorescence characteristics, weights were set for β1 = 0.7 (domestic sewage), β2 = 0.2 (agricultural runoff), and β3 = 0.1 (industrial wastewater). The degradation rate K′ was then adjusted according to the pollution source weights. COD .
[0341] K′ COD =0.7 × 0.12 days -1 +0.2×0.08day -1 +0.1×0.05day -1 =0.105day -1
[0342] This reduces the COD degradation rate from the default value of 0.12 days. -1 Adjusted to 0.105 days -1 This is closer to the characteristics of actual pollution sources.
[0343] S42: Combine hyperspectral characteristic bands to retrieve the concentration of specific pollutants, and use this as a basis to dynamically correct the COD concentration. Specific steps include:
[0344] S421: Based on the hyperspectral feature bands extracted in step 3, a partial least squares regression model (PLSR) is constructed to invert the concentration of a specific pollutant. The relevant formulas are as follows:
[0345]
[0346] Among them, w i These are the weight coefficients for the PLSR model. For wavelength λ i The band reflectivity, b is the intercept term, C spec This represents the concentration of pollutants obtained through inversion.
[0347] Specifically, based on the hyperspectral characteristic bands (265nm and 355nm reflectance) and laboratory-calibrated ammonia nitrogen concentration data (100 sets), a PLSR model was constructed, and the ammonia nitrogen concentration was obtained by inversion:
[0348]
[0349] The performance of this model is: R 2 =0.89, RMSE=0.23.
[0350] S422: Calculate the correction term ΔCOD based on the pollutant-COD conversion coefficient α calibrated in the laboratory, using the following formula:
[0351] ΔCOD=α·C spec
[0352] Specifically, by fitting the ammonia nitrogen-COD relationship using historical data, the conversion coefficient α = 1.2 was determined; the correction term ΔCOD = 1.2 × 2.1 = 2.52 mg / L was calculated.
[0353] S423: Superimpose ΔCOD onto the COD concentration field output from the water quality model in step 2 to obtain the corrected COD concentration C′. COD The formulas involved are as follows:
[0354] C′ COD =C COD +ΔCOD
[0355] Specifically, COD concentration is corrected within the inversion region (coordinates X = 1200-1500m, Y = 500-800m).
[0356] C′ COD (x,y)=C COD (x,y)+2.52×δ(x,y)
[0357] The corrected local COD concentration increased by 12%-15%, improving consistency with on-site sampling data.
[0358] S43: Introducing a time lag factor and integrating the spatial correlation characteristics of monitoring points, this study analyzes the lag response of optical feature values and DO concentration changes to COD concentration. Based on a collaborative modeling system of Random Forest (RF) and Long Short-Term Memory Network (LSTM) (RF-LSTM), a dynamic relationship model of optical feature values, DO, and COD is constructed to achieve minute-level COD prediction. Specific steps include:
[0359] S431: Spatial correlation between captured water quality factors and monitoring locations:
[0360] (1) Delaunay triangulation: Connect 10 sensors to generate a topology network with a maximum distance of 800m between adjacent points;
[0361] (2) Calculate the gradient characteristics of water quality parameters between adjacent points:
[0362]
[0363] Among them, C i C j The values represent the concentrations of water quality factors (DO, temperature, pH, etc.) at monitoring points i and j, respectively, and x represents the concentrations at x. i ,x j Let N be the spatial coordinates of the point, and N(i) be the set of Delaunay neighboring points of point i.
[0364] The average gradient at the core monitoring point was 0.15 mg / L / m.
[0365] (3) Extract the cross-regional covariance matrix:
[0366]
[0367] S432: Real-time acquisition of DO sensor network data and optical feature values F through IoT terminals to construct a dynamic input matrix.
[0368] Specifically, the data sources are as follows:
[0369] Optical characteristic value F t =0.68 (10-minute mean), ΔF t =0.05;
[0370] DO sensor network data: In addition to the existing 5 monitoring points, 5 new monitoring points are added in the water quality sensitive area identified in step 3 to detect real-time data: DO t =5.2 mg / L, ΔDO t =DO t -DO t-1 = -0.3mg / L.
[0371] Water temperature t =18.5℃, pH=7.3.
[0372] Extended matrix: X t_real =[0.68,0.05,5.2,-0.3,18.5,7.3,0.15,0.45],
[0373] S433: Introducing data with a time step of τ to capture the lag effect, taking a lag window of τ = 6 (i.e., 1 hour of historical data), the extended feature matrix is as follows:
[0374]
[0375] S434: Employs RF-LSTM collaborative modeling, which involves filtering key features and establishing temporal dependencies of COD.
[0376] (1) Input X′ into the random forest model and output the top 5 features by importance.
[0377] (2) A sliding time window mechanism is adopted (w=6, i.e., the sliding window length is 60min), and X is... t_selected Input an LSTM model and output a real-time COD prediction value C. t_pred =24.7 mg / L.
[0378] The error between the predicted value and the laboratory measured value was ±1.5 mg / L (confidence level 95%).
[0379] S44: C t_pred As boundary conditions for the water quality model, the coupled model is recalculated to update the global COD distribution field. Newton's iteration method is used to accelerate model convergence and ensure a response time within minutes. The relevant formulas are as follows:
[0380]
[0381] in, For model operators, Let be the Jacobian matrix, and m be the number of iterations.
[0382] Specifically, the initial residual is accelerated using Newton's iteration method. After three iterations, the concentration converged to 0.08 mg / L. The COD concentration in the downstream region (X = 2000-2200m) was corrected from 26.1 mg / L to 24.9 mg / L, reducing the error by 8.2%.
[0383] S45: To further improve the accuracy of COD simulation, ensemble Kalman filtering is used to assimilate multi-source data and improve model accuracy. Specific steps include:
[0384] S451: By disturbing hydrodynamic parameters (diffusion coefficient Dx / Dy) and degradation rate K COD And the initial concentration field, generate N=100 model state sets Xi.
[0385] Specifically, the Dx / Dy perturbation range is set to 10%, and the perturbed interval is [2.25, 2.75]; K COD The perturbation range is set to 15%, and the perturbation interval is [0.089, 0.121].
[0386] S452: Run the coupled model up to the current time step to obtain the prediction set Xi. f .
[0387] S453: Calculate the Kalman gain, involving the following formulas:
[0388]
[0389] Among them, P f For the prediction error covariance matrix, For the observation operator (mapping the model mesh to sensor points), C obs This represents the observation error covariance.
[0390] Specifically, the calculation results The main diagonal represents the weights of DO and F.
[0391] S454: Fusion of real-time DO observations Z and optical eigenvalues F to update the state set, involving the following formulas:
[0392]
[0393] The updated ensemble mean COD concentration has been revised from 24.7 mg / L to 23.9 mg / L.
[0394] S455: Take The mean value is used as the optimal estimate and fed back to the coupled model for further calculation.
[0395] Specifically, the RMSE before assimilation was 2.8 mg / L, and the RMSE after assimilation was 2.1 mg / L, representing a 25% improvement; the maximum single-point error decreased from 4.5 mg / L to 2.7 mg / L.
[0396] S46: Output the corrected spatiotemporal distribution map of COD, mark high pollution risk areas (COD>25mg / L), and generate a pollution source contribution report.
[0397] Figure 2 The structural diagram of the water quality change trend rapid prediction device based on multi-source data fusion and physical constraints provided in the embodiments of the present invention is as follows: Figure 2 As shown, the prediction device includes: a dynamic coupling modeling module 201, a sensor optimization mapping module 202, a pollution source tracing and analysis module 203, and a multi-source collaborative prediction module 204. The dynamic coupling modeling module 201 acquires multi-parameter water quality data from key sites, constructs a dynamic coupling model based on hydrodynamic equations, simulates the spatiotemporal distribution characteristics of DO and COD, and identifies water quality sensitive areas. The sensor optimization mapping module 202 deploys low-cost sensors in sensitive areas, uses information entropy assessment, spatial clustering, and multi-objective optimization algorithms to deploy a low-cost water quality sensor network, and fuses sensor data based on spatial interpolation algorithms to generate a global water quality distribution map. The pollution source tracing and analysis module 203 analyzes the principal component dimensionality reduction features of spectral data, generates a weighted comprehensive optical pollution index, and combines it with discharge data to achieve reverse tracing of pollution sources. The multi-source collaborative prediction module 204 constructs an RF-LSTM hybrid model to correlate optical features, water quality time-series data, and spatial correlation features of locations, calibrates prediction bias through pollution source tracing, and optimizes COD prediction values by assimilating time-series data using ensemble Kalman filtering.
[0398] The apparatus embodiments provided in this invention are for implementing the above-described method embodiments. For specific processes and details, please refer to the above-described method embodiments, which will not be repeated here.
[0399] Figure 3 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as... Figure 3As shown, the electronic device may include a processor 301, a communication interface 302, a memory 303, and a bus 304. The processor 301, communication interface 302, and memory 303 communicate with each other via the bus 304. The communication interface 302 can be used for information transmission within the electronic device. The processor 301 can call logical instructions in the memory 303 to execute methods including: constructing a hydrodynamic-water quality coupled model based on shallow water equations and convection-diffusion equations to simulate the spatiotemporal dynamic distribution of water quality parameters (DO, COD) under the influence of hydrodynamics; outputting water quality sensitive areas through the hydrodynamic-water quality model, deploying low-cost water quality sensors using information entropy assessment, spatial clustering, and multi-objective optimization algorithms, and calculating a global DO distribution map of the water body using spatial interpolation methods; performing principal component analysis (PCA) dimensionality reduction on the spectral information of key monitoring stations, generating a comprehensive optical pollution index through attention mechanism network weighting, and conducting pollution source tracing in conjunction with surface / outlet distribution data; constructing a dynamic prediction model based on real-time optical feature values, water quality time-series data, and spatial correlation features of points, correcting COD prediction values by combining pollution source tracing results and spectral features, and using ensemble Kalman filtering to assimilate multi-source data to improve model accuracy.
[0400] Furthermore, the logical instructions in the aforementioned memory 303 can be implemented as software functional modules and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this, the technical solution of the present invention can be embodied as a computer software product including the following functions: executing a complete process such as hydrodynamic model construction, spectral data dimensionality reduction and weighting, dynamic prediction model training, and multi-source data assimilation via instruction-driven devices. 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 above-described method embodiments of the present invention. The aforementioned storage medium includes: USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc.
[0401] On the other hand, embodiments of the present invention also provide a non-transitory computer-readable storage medium storing a computer program thereon. This computer program is executed by a processor to perform the operations provided in the above embodiments, such as: synchronously collecting spectral, DO, COD, temperature, and pH data; constructing a hydrodynamic-water quality coupling model and simulating the spatiotemporal distribution of water quality parameters; deploying a sensor network according to the model output; generating a global DO distribution map through spatial interpolation; performing PCA dimensionality reduction and attention mechanism weighting on the spectral data; and tracking pollution paths by combining pollution source distribution data; establishing an optical feature value-DO-COD dynamic prediction model; and using ensemble Kalman filtering to fuse multi-source observation data to optimize COD prediction results.
[0402] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0403] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0404] It should be noted that the above embodiments are not intended to limit the scope of protection of the present invention. Equivalent transformations or substitutions made based on the above technical solutions all fall within the scope of protection of the claims of the present invention.
Claims
1. A method for rapid prediction of water quality change trends based on multi-source data fusion and physical constraints, characterized in that, The method includes the following steps: Step 1: Simultaneously collect spectral information, DO, COD, temperature, and pH data at key monitoring stations. Construct a hydrodynamic-water quality coupled model based on the shallow water equation and convection-diffusion equation to simulate the spatiotemporal dynamic distribution of water quality parameters under the influence of hydrodynamics. Step 2: Output water quality sensitive areas through the hydrodynamic-water quality model, combine information entropy assessment and spatial clustering to select sensor deployment sites, achieve low-cost water quality sensor network deployment through multi-objective optimization algorithms, and calculate the global water quality distribution map of the water body using spatial interpolation methods. Step 3: Based on the spectral information collected synchronously from key monitoring stations, Principal Component Analysis (PCA) is first used for dimensionality reduction, and then the principal components are weighted using an attention mechanism network to combine the comprehensive optical pollution index; simultaneously, pollution source tracing is carried out by combining surface / sewage outlet distribution data. Step 4: Based on real-time optical eigenvalue-DO data, combined with spatial topology networks, water quality gradients, and cross-regional covariance to capture the spatial correlation of water quality parameters between different locations, construct an optical eigenvalue-DO-COD dynamic prediction model; combine pollution source tracing and spectral features to correct COD prediction values, and use ensemble Kalman filtering to assimilate multi-source data to improve model accuracy; Step 4 is as follows: S41: Based on the different sources of COD in step S321, analyze the differences in degradation kinetics, introduce a pollution source weighting factor β into the coupled model, and correct the COD degradation rate. The relevant formulas are as follows: in, Here, M represents the total number of pollution source categories. Contribution weight for pollution source of type m , This represents the COD degradation rate constant corresponding to the pollution source. S42: Combine hyperspectral characteristic bands to retrieve the concentration of specific pollutants, and use this as a basis to dynamically correct the COD concentration. Specific steps include: S421: Based on the hyperspectral feature bands extracted in step 4, a partial least squares regression model (PLSR) is constructed to retrieve the concentration of specific pollutants. The relevant formulas are as follows: in, These are the weight coefficients for the PLSR model. For wavelength The reflectivity of the band, For the intercept term, The concentration of pollutants obtained through inversion, S422: Calculate the correction term ΔCOD based on the pollutant-COD conversion coefficient α calibrated in the laboratory, using the following formula: S423: Superimpose ΔCOD onto the COD concentration field output from the water quality model in step 2 to obtain the corrected COD concentration. The formulas involved are as follows: S43: Introducing a time lag factor and integrating the spatial correlation characteristics of monitoring points, the lag response of optical feature values and DO concentration changes to COD concentration is analyzed. Based on the collaborative modeling system RF-LSTM of Random Forest and Long Short-Term Memory Network, a dynamic relationship model of optical feature values-DO-COD is constructed to achieve minute-level COD prediction. Specific steps include: S431: Spatial correlation between captured water quality factors and monitoring locations: (1) Construct a topology map of monitoring points and establish the connection relationship between adjacent points based on Delaunay triangulation; (2) Calculate the gradient characteristics of water quality parameters between adjacent points: in, , These represent the monitoring points. , Concentration of water quality factors , For the spatial coordinates of the point, For point The set of adjacent points of Delaunay, (3) Extract the cross-regional covariance matrix: in, For the key monitoring points of step 1, the water quality parameters are as follows: For the sensor location data in step 2, S432: Acquires DO sensor network data and optical feature values F in real time through IoT terminals to construct a dynamic input matrix. , S433: Introducing data with a first τ time step to capture lag effects, resulting in a characteristic matrix with a lag factor. , S434: Employs RF-LSTM collaborative modeling, by selecting key features and establishing the spatiotemporal dependency of COD. (1) Random Forest Feature Selection: Define Spatial Weight Factor: in, For point , The Euclidean distance between them Extended matrix Input the random forest model and perform importance filtering to extract the top K key variables to form a subset. , (2) Using a sliding time window of length w, Input an LSTM model and output real-time COD predictions. , S44: Will As boundary conditions for the water quality model, the coupled model is recalculated, and Newton's iteration method is introduced to accelerate model convergence, ensuring a response time within minutes. The relevant formulas are as follows: Where ℱ is the model operator and 𝒥 is the Jacobian matrix. For the number of iterations, S45: To further improve the accuracy of COD simulation, ensemble Kalman filtering is used to assimilate multi-source data. Specific steps include: S451: By disturbing hydrodynamic parameters and degradation rate K COD And the initial concentration field, generating N=100 model state sets. Hydrodynamic parameters include the diffusion coefficient Dx / y. S452: Run the coupled model up to the current time step to obtain the prediction set. , S453: Calculate the Kalman gain, involving the following formulas: in, For the prediction error covariance matrix, For the observation operator, the model mesh is mapped to the sensor locations. For observation error covariance, S454: Fusion of real-time DO observation concentration Z and optical characteristic value F to update the state set, involving the following formulas: S455: Take The mean value is used as the optimal estimated state and fed back to the coupled model for further computation. S46: Output the corrected spatiotemporal distribution map of COD, mark high-pollution-risk areas, and generate a pollution source contribution report.
2. The method for rapid prediction of water quality change trends based on multi-source data fusion and physical constraints according to claim 1, characterized in that, Step 1 is as follows: S11: Use a sampler to collect water samples at key monitoring sites, measure water temperature, pH, and dissolved oxygen (DO) content on-site, and then collect the supernatant after allowing the water to settle for preservation. S12: Based on the two-dimensional shallow water equations, a hydrodynamic model is constructed to simulate the flow velocity, flow direction, and water level changes of the water body. Specifically, it includes the following governing equations: Continuity equation: Momentum equation: Where h is the water depth; t is the time; u=u(x,y,t) and v=v(x,y,t) are the components of the water flow velocity in the x and y directions, respectively; g is the acceleration due to gravity; and H is the water surface elevation, H=h+z b , z b Riverbed elevation; τ bx τ by These are the components of the riverbed shear stress in the x and y directions, respectively, calculated based on Manning's formula: in, The density of water; The energy gradient is approximately equal to the water surface gradient. The equations are discretized using the finite volume method, and the numerical flux is solved based on the Roe flux difference scheme. Time integration is performed using the third-order Runge-Kutta method to ensure the stability of the solution process. S13: A water quality model is constructed based on the convection-diffusion equation to simulate the transport process and concentration changes of solutes in water. Specifically, it includes the following equations: Convection-diffusion-reaction equation: Where C represents the concentration of water quality parameters; Dx and Dy are the diffusion coefficients in the x and y directions, respectively; S(C) represents the external source-sink term; and R(C) represents the chemical / biological reaction term. DO dynamics model, Streeter-Phelps modified equations: Among them, C DO D represents the concentration of DO; DO DO is the molecular diffusion coefficient of dissolved oxygen. s K represents the saturated dissolved oxygen concentration in the water body. a K represents the atmospheric reoxygenation rate. r K is the rate of oxygen consumption during respiration. d The oxygen consumption rate during deposition. COD degradation model: Among them, C COD COD concentration; K COD This is the COD degradation rate constant. S14: Determine the coupling mechanism; the data transfer process includes: Hydrodynamic model → Water quality model: The hydrodynamic model outputs the velocity field u(x,y,t) as the convection term to drive the water quality model; Water quality model → Hydrodynamic model: Pollutant concentration gradient is used to correct the riverbed shear stress τ through sedimentation / resuspension processes. bx τ by , S15: Solve the coupled model using a partitioned iterative algorithm. The specific steps include: S151: Initialize the hydrodynamic field u0, calculate h, u, v using the hydrodynamic model and output the results to the water quality model; S152: With a fixed flow velocity field, solve for the distribution of COD and DO water quality parameters in the water quality model and update the pollutant concentration; S153: Use the new concentration field to correct the source and sink terms and resolve the hydrodynamic equations; S154: Repeat steps S151-S153 until the residuals converge, i.e., the relative errors of hydrodynamic variables and pollutant concentrations in adjacent iterations are all less than 1. .
3. The method for rapid prediction of water quality change trends based on multi-source data fusion and physical constraints according to claim 2, characterized in that, Step 2 is as follows: S21: Calculate the range of hydraulically sensitive and chemically sensitive zones based on a hydrodynamic model, and couple the two to generate the output water quality sensitive zone. By calculating the velocity gradient field G(x,y), regions with G values greater than a threshold are defined as hydraulically sensitive zones, with a corresponding weight of w1. By simulating pollutant diffusion to generate a cumulative concentration field S(x,y), regions with S values greater than a threshold are selected as chemically sensitive zones, with a corresponding weight of w2. The calculation formulas are as follows: S22: Based on the location of the water quality sensitive area output by S21, a low-cost water quality sensor is deployed accordingly; S221: Calculate the information entropy of candidate points within the sensitive area. ,in, It is the first in the sensitive area Coordinates of candidate points Historical water quality parameters in category The probability distribution is given by K, where K is the total number of discretized categories. The top N points with the highest entropy values are selected, covering the region with the greatest spatiotemporal variation. S222: Perform K-means clustering on the sensitive area to generate M spatial clusters; deploy one sensor within each cluster to ensure that the Voronoi Diagram covers the entire area. For each cluster Select locations that meet the following conditions: and Final output of initial deployment plan ,in, It is the first A spatial cluster, It is a cluster The center of mass, It is a cluster The final selected sensor location, S223: Establish a multi-objective optimization algorithm and perform fine-tuning. (1) NSGA-III Algorithm Configuration ① Decision variables: Define binary choice variables Indicates whether or not in x i Deploy sensors, ② Objective function Maximize spatial coverage: ,in Let be the area of the Thiessen polygon of sensor i. This represents the total area of the sensitive zone; Minimize cost: ,in For deployment costs; Maximize information entropy: ,in The information entropy of the candidate points, ③Constraints: Sensor spacing and coverage area of sensitive areas ; Coverage of sensitive areas ; Candidate points must be located in sensitive area grid nodes. (2) Optimize the process Phase 1: with For the initial population, run the NSGA-III algorithm; Phase 2: If the optimal solution ,merge Re-optimization; Termination conditions: S224: Automation solution output, (1) Optimal solution selection Scoring function: ,in Budget cap; Output result: The type determination method is as follows: Priority calculation: (2) Effect verification and incremental optimization: Coverage gap detection: Calculate the uncovered area ,like This triggers incremental deployment, supplementing sensors in descending priority order: ; S23: Collect water quality data output from the sensor in S22, and fuse the discrete water quality data using Kriging interpolation. Specific steps include: S231: Filtering outlier DO values based on the IQR method; S232: Calculate all sensor point pairs semivariance The calculation formula is: in, The distance between sensor point pairs; For spacing at Logarithm of points within; For point DO estimate at [location] S233: Solve using the Kriging equations: in, S24: Generate a global DO distribution map based on the solution results.
4. The method for rapid prediction of water quality change trends based on multi-source data fusion and physical constraints according to claim 3, characterized in that, Step 3 is as follows: S31: Simultaneously acquire three-dimensional fluorescence spectral data from water samples collected at key monitoring stations, and acquire hyperspectral and multispectral remote sensing data using remote sensing imagery to achieve multi-source spectral data acquisition, followed by data preprocessing. The operating steps of S31 include: S311: Collect three-dimensional fluorescence spectral data from water samples collected at key monitoring stations to construct a spectral matrix with an excitation wavelength range of Ex=200-500nm and an emission wavelength range of Em=250-600nm; S312: Based on the HyperGlobal-450K large-scale hyperspectral image dataset, continuous narrow-band hyperspectral remote sensing features are extracted; based on Landsat satellite remote sensing data, multispectral wide-band remote sensing data are extracted, with blue / green light used to detect plankton and red / near-infrared light used to characterize algae. S313: Preprocess the acquired multi-source spectral data. Specifically, the following steps were taken: Hyperspectral and multispectral data were converted to surface reflectance using standard atmospheric correction tools; the Savitzky-Golay filtering algorithm was used to smooth and denoise the hyperspectral data; and heterogeneous remote sensing data were unified to the same spatial coordinate system. Rayleigh and Raman scattering interferences were eliminated using the instrument's built-in algorithm, and blank water sample signals were removed from the three-dimensional fluorescence data. Parallel factor analysis was used to analyze the fluorescence intensity of each sample point on the three-dimensional fluorescence spectrum. S32: Extract spectral feature values from hyperspectral data, multispectral remote sensing data, and three-dimensional fluorescence spectral data respectively. Principal component analysis is used to reduce the dimensionality of the high-dimensional spectral features. Then, an attention-based neural network is used to assign weights to each spectral variable to generate a comprehensive optical index. The specific steps of S32 include: S321: Extract spectral feature values from hyperspectral data, multispectral remote sensing data, and three-dimensional fluorescence spectral data. (1) Extracting hyperspectral feature bands based on the spectral differential method, the specific steps include: ① Numerical difference processing is used to obtain the trend of spectral line changes in hyperspectral data. The equations involved include: a. The first derivative reflects the slope change of the spectral curve, eliminating differences in illumination: b. The second derivative identifies abrupt changes in spectral curvature, further suppressing linear background: in, For reflectivity, For wavelength, For band number, For band spacing, ② Using the extreme point analysis method, the zero point of the derivative corresponds to the absorption peak boundary of the original spectrum. Combined with correlation analysis, highly discriminative differential features are screened to select the DOM sensitive band. (2) Based on multispectral remote sensing data, the characteristics of water pollutants are identified using the Normalized Difference Water Index (NDWI) and the Facial Algae Index (FAI). The specific steps include: a. Cropping the preprocessed remote sensing image data to the study area to remove cloud interference; b. Calculate NDWI and FAI separately, involving the following formulas: NDWI calculation formula: FAI calculation formula: Among them, R Green R Red R NIR R SWIR R' represents the reflectance in the green, red, near-infrared, and short-wave infrared bands. NIR λ is a linear estimate based on the red and SWIR bands. Red , λ NIR , λ SWIR The wavelengths of the red light band, near-infrared band, and short-wave infrared band. NDWI highlights water body information and suppresses vegetation and soil interference by normalizing the difference in reflectance between the green light band and the near-infrared (NIR) band. The level of NDWI value can reflect the degree of water pollution. FAI suppresses water body background noise and enhances the sensitivity of algae signal detection by linear fitting and residual calculation of the red light (Red), near-infrared (NIR), and short-wave infrared (SWIR) bands. The level of FAI value quantifies algal biomass. (3) Obtain the spectral matrix of specific excitation and emission wavelengths by sharing three-dimensional fluorescence spectroscopy to distinguish the sources of COD pollution. The specific steps include: a. Calculate the fluorescence intensity matrix of the water sample in the range of excitation wavelength Ex=200-500nm and emission wavelength Em=250-600nm. Combine this with the constructed pollutant fluorescence fingerprint database to identify the characteristic peak positions corresponding to typical pollutants: Humic substances peak Ex=250-280nm, Em=380-480nm; protein-like peak Ex=220-230nm, Em=320-350nm; humic acid-like peak Ex=320-350, Em=420-480; b. Calculate the fluorescence index FI, humification index HIX, and biological index BIX from the fluorescence matrix data for optical feature fusion. The specific calculation formulas include: FI calculation formula: HIX calculation formula: BIX calculation formula: in, Indicates the emission wavelength is fluorescence intensity value at nm c. Determine the main pollution source category based on the Mahalanobis distance between the real-time fluorescence indices FI, HIX, and BIX and historical patterns; S322: Using principal component analysis and attention mechanism neural networks, spectral feature values are reduced in dimensionality and weighted to generate a comprehensive optical index. Specific steps include: (1) To eliminate the dimensional differences between different optical characteristics, namely reflectance, index value, and fluorescence intensity, all spectral characteristic values were... Standardization involves formulas including: (2) Principal component analysis is used to reduce the dimensionality of spectral eigenvalues. The specific steps include: a. Calculate the covariance matrix of the high-dimensional feature matrix X. , in, Representation matrix The transpose of , where n is the sample size. b. For the covariance matrix Perform eigenvalue decomposition to obtain eigenvalues and eigenvectors. c. Select the first k principal components V, V1, V2, ..., V... k Generate low-dimensional features. (3) Attention Mechanism: The neural network weighting assigns weights to spectral feature values. The formula for calculating attention weights is as follows: in, represents the weights corresponding to each spectral feature value; Sim represents the weighting coefficients for different spectral feature values. , For the first , L is the number of spectral eigenvalues; (4) Calculate the comprehensive optical index F based on the corresponding weights of each spectral characteristic value. , in, Indicates the first The dimensionality-reduced spectral eigenvalues corresponding to each principal component direction.
5. A device for rapid prediction of water quality change trends based on multi-source data fusion and physical constraints, characterized in that, This device is used to implement the rapid prediction method for water quality change trends based on multi-source data fusion and physical constraints as described in any one of claims 1-4. The device comprises: The dynamic coupling modeling module acquires parameters such as DO, COD, temperature and pH data of key sites, and constructs a coupling model by combining hydrodynamic equations to simulate the spatiotemporal dynamic distribution of DO and COD and identify water quality sensitive areas. The sensor optimization mapping module deploys low-cost DO sensors according to the sensitive area, uses information entropy assessment, spatial clustering and multi-objective optimization algorithms to deploy a low-cost DO sensor network, and combines Kriging interpolation to fuse discrete monitoring data to reconstruct a high-resolution water quality distribution map. The pollution source tracing and analysis module generates a comprehensive optical pollution index by performing principal component dimensionality reduction and weighting based on spectral data, and combines it with surface sewage discharge data to achieve pollution source tracing. The multi-source collaborative prediction module integrates optical feature values, water quality time series data, and spatial correlation features of locations to construct an RF-LSTM hybrid model to predict COD concentration. It also introduces ensemble Kalman filtering to assimilate multi-source observation data, dynamically corrects the predicted values, and outputs a pollution risk map.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements a method for rapid prediction of water quality change trends based on multi-source data fusion and physical constraints as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing computer instructions thereon, characterized in that, When the computer instructions are executed by the processor, they implement the method for rapid prediction of water quality change trends based on multi-source data fusion and physical constraints as described in any one of claims 1-4.