Method and device for detecting COD of pipe network water quality based on multi-parameter collaborative compensation
Patent Information
- Application Number
- CN202611242246.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-17
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2046-08-17
AI Technical Summary
Existing spectroscopic methods for COD detection in water quality suffer from problems such as baseline instability due to light source drift, insufficient handling of nonlinear coupling interference from environmental parameters, significant impact from suspended particulate matter scattering effects, and poor adaptability to cleaning optical windows in drainage networks, making it difficult to achieve long-term, stable, and accurate online monitoring.
A dual-optical-path detection structure is adopted to eliminate the influence of light source drift. Combined with a multi-parameter collaborative compensation model, the optical window self-cleaning is achieved by real-time monitoring of light source intensity fluctuations, collecting environmental parameter data, performing spectral denoising and scattering correction, constructing multi-modal feature vectors and performing dynamic compensation.
It improves the measurement accuracy and stability of COD detection, reduces operation and maintenance costs, enhances the robustness and engineering life of the equipment in drainage pipe networks, and achieves long-term, stable and accurate online monitoring.
Smart Images

Figure CN122793676B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pipeline water quality testing technology, and in particular to a method and apparatus for detecting COD in pipeline water quality based on multi-parameter collaborative compensation. Background Technology
[0002] With the deepening of smart city construction, the need for real-time and accurate monitoring of the operational status of drainage pipe networks, as the core infrastructure of urban water circulation systems, is becoming increasingly urgent. Chemical oxygen demand (COD) is a key indicator for measuring the degree of organic pollution in water bodies. Achieving long-term, stable, and accurate online monitoring of COD in drainage pipe networks has significant engineering value and environmental benefits for timely detection of sewage mixing, assessment of pipe network operating load, and support for refined water environment management. Spectroscopic water quality monitoring technology, due to its advantages such as fast detection speed, no need for chemical reagents, and ability to achieve in-situ simultaneous measurement of multiple parameters, has become an important development direction in the field of online water quality monitoring.
[0003] Existing spectroscopic methods for COD detection in water quality have the following main shortcomings in practical pipeline network applications: First, conventional spectroscopic detection systems mostly adopt a single-path structure, and the self-drift of the light source intensity directly couples to the absorbance measurement results, causing instability in the measurement baseline and making it difficult to meet the accuracy requirements of long-term in-situ deployment. Second, existing methods mostly use simple empirical formulas for linear correction to handle environmental interference, which cannot handle the complex interference caused by the coupling and nonlinear superposition of multiple environmental parameters such as water temperature, pH, and conductivity in the pipeline network environment, resulting in significant deviations in measurement results when the environment changes drastically. Third, the light scattering effect caused by suspended particulate matter in the water can mask the characteristic absorption information of COD. Existing pretreatment methods often cannot effectively separate the signal superposition of physical scattering and chemical absorption, which restricts the accuracy of COD prediction. Fourth, optical windows are easily attached to biofilms and dirt when immersed in the pipeline network environment for a long time, resulting in continuous attenuation of light transmittance. Conventional cleaning solutions either rely on external air sources or other auxiliary facilities, or the cleaning power is insufficient to deal with stubborn deposits, making it impossible to achieve reliable self-maintenance in the narrow and confined space of the pipeline network.
[0004] Therefore, this invention is proposed. Summary of the Invention
[0005] To address these issues, this invention provides a method and apparatus for detecting COD in pipeline water quality based on multi-parameter collaborative compensation. This method overcomes the problems in existing technologies, such as baseline instability caused by light source drift in single-path structures, the inability of simple empirical formulas to handle nonlinear coupling interference from multiple environmental parameters, the difficulty in effectively removing scattering effects from chemical absorption signals, and the insufficient adaptability of optical window cleaning schemes within the confined space of pipeline networks.
[0006] To achieve the above objectives, this invention provides a method for detecting COD in pipe network water quality based on multi-parameter collaborative compensation, comprising: S1, through the dual-optical-path detection structure, the light output from the light source is divided into a reference optical path and a measurement optical path; the light source intensity fluctuation is monitored in real time through the reference optical path, and the transmitted light intensity after the measurement optical path penetrates the water sample to be tested is differentially processed with the light intensity of the reference optical path to eliminate the influence of the light source's own drift on the absorbance measurement; S2, collect environmental parameter data and full-band absorption spectrum data within a preset wavelength range of the water sample to be tested. The environmental parameter data includes at least temperature, pH value and conductivity. S3, perform denoising and scattering correction processing on the full-band absorption spectrum data to eliminate the influence of scattering interference and noise on the spectral signal; S4. Extract COD-related spectral feature variables from the processed full-band absorption spectrum data and input them into the pre-constructed spectral-COD quantitative model to obtain the initial COD value. S5, perform feature fusion between the spectral feature variables and the environmental parameter data to construct a multimodal input feature vector; S6, the multimodal input feature vector is input into the pre-constructed collaborative compensation model. The collaborative compensation model dynamically compensates the initial COD value based on the learned mapping relationship between environmental parameters and measurement errors, and outputs the compensated COD detection value.
[0007] Furthermore, the step of differentially processing the transmitted light intensity after the measuring optical path penetrates the water sample to be tested with the light intensity of the reference optical path to eliminate the influence of the light source's own drift on the absorbance measurement includes: S11. In the absence of a water sample to be tested, the initial light intensity signals of the reference optical path and the measurement optical path are collected respectively to obtain the initial light intensity value of the reference channel and the initial light intensity value of the measurement channel, and the initial light intensity ratio is calculated. S12, with a water sample to be tested, the reference light intensity signal of the reference optical path and the transmitted light intensity signal after the measurement optical path penetrates the water sample to be tested are simultaneously collected and recorded as the reference light intensity and the measurement light intensity, respectively. S13, Based on the reference light intensity, perform differential correction on the measured light intensity and calculate the corrected measured light intensity value. The differential correction is to multiply the measured light intensity by the ratio of the initial light intensity ratio to the reference light intensity to eliminate the change in measured light intensity caused by the fluctuation of the light source intensity. S14, the corrected measured light intensity value is converted to absorbance by the reference light intensity to generate the true absorbance of the water sample to be tested, which eliminates the influence of the light source's own drift.
[0008] Furthermore, the collection of environmental parameter data and full-band absorption spectrum data within a preset wavelength range from the water sample to be tested includes: S21, activate the broadband light source so that the continuous light output by the light source is collimated and enters the water sample to be tested; S22, collect the transmitted light after penetrating the water sample to be tested, guide the transmitted light into the spectral dispersive module for wavelength dispersion, and synchronously collect the light intensity signal at each wavelength position by the photodetector array to generate the full-band absorption spectrum data of the water sample to be tested within the preset band range. S23, synchronously drive several environmental parameter sensors to collect environmental parameter data of the water sample to be tested. The environmental parameter sensors include at least a temperature sensor, a pH sensor and a conductivity sensor. S24, bind the full-band absorption spectrum data and the environmental parameter data collected within the same measurement period into time-aligned data pairs.
[0009] Furthermore, the denoising and scattering correction processing of the full-band absorption spectrum data to eliminate the influence of scattering interference and noise on the spectral signal includes: S31, Perform smoothing filtering on the full-band absorption spectrum data to remove high-frequency random noise from the spectral signal and obtain the denoised spectral data. S32, the denoised spectral data is processed by a multivariate scattering correction algorithm, specifically including: selecting a representative spectrum as the ideal spectrum; performing linear regression on each sample spectrum against the ideal spectrum to obtain the baseline shift and offset coefficient of each sample spectrum relative to the ideal spectrum; and using the baseline shift and offset coefficient to correct each sample spectrum to eliminate the spectral baseline shift and tilt offset caused by scattering of suspended particulate matter.
[0010] Furthermore, the step of correcting each sample spectrum using the baseline shift and offset coefficient includes: S321, the correction calculation formula is: ; Among them, X o X represents the raw absorbance values of the sample spectrum at each wavelength. c , where b is the corrected absorbance value, b is the baseline shift of the sample spectrum relative to the ideal spectrum, and a is the offset coefficient of the sample spectrum relative to the ideal spectrum; S322, subtract the baseline shift b from the original absorbance value of each sample spectrum at each wavelength to eliminate the overall rise or fall of the entire spectral baseline caused by scattering of suspended particulate matter; S323, after subtracting the baseline shift, divide the spectral values one by one by the offset coefficient a to eliminate the overall spectral tilt or amplitude scaling caused by the difference in scattering degree. S324. After completing wavelength-by-wavelength correction, a multivariate scattering correction spectrum is obtained. The scattering difference between the multivariate scattering correction spectrum and the ideal spectrum is effectively eliminated, preserving the true spectral information of the absorption characteristics of chemical components in the water sample to be tested.
[0011] Furthermore, the step of extracting COD-related spectral feature variables from the processed full-band absorption spectral data and inputting them into a pre-constructed spectral-COD quantitative model to obtain initial COD values includes: S41, Principal component analysis is used to perform feature dimensionality reduction on the processed full-band absorption spectrum data, and the top principal components whose cumulative variance contribution rate meets the preset threshold are extracted as spectral feature variables related to COD. S42, the extracted spectral feature variables are input into the pre-constructed spectral-COD quantitative model, which is a regression model based on the partial least squares regression algorithm, to calculate the initial COD value.
[0012] Furthermore, the step of fusing the spectral feature variables with the environmental parameter data to construct a multimodal input feature vector includes: S51, acquire the spectral feature variables extracted and the environmental parameter data collected within the same measurement period; S52, standardize the environmental parameter data to match the numerical range of the environmental parameters with the numerical range of the spectral characteristic variables, so as to eliminate the fusion deviation caused by the difference in dimensions between different parameters. S53 concatenates the spectral feature variables with the standardized environmental parameter data to generate a multimodal input feature vector.
[0013] Furthermore, the step of inputting the multimodal input feature vector into a pre-constructed collaborative compensation model, which dynamically compensates the initial COD value based on the learned mapping relationship between environmental parameters and measurement errors, and outputs the compensated COD detection value, includes: S61, the multimodal input feature vector is input into a pre-constructed collaborative compensation model, which is a machine learning model that has been trained and learned, and has internally learned and stored the nonlinear mapping relationship between environmental parameters and COD measurement error. S62, the collaborative compensation model performs forward reasoning calculation on the multimodal input feature vector, identifies and quantifies the comprehensive interference caused by environmental factors to COD measurement based on the current input environmental parameter data, and generates a dynamic compensation amount that matches the current measurement conditions. S63, The dynamic compensation amount is superimposed and corrected with the initial COD value to obtain the compensated COD detection value; S64 outputs the compensated COD detection value as the final measurement result.
[0014] This invention also provides a pipe network water quality COD detection device based on multi-parameter collaborative compensation, the device being used to implement any of the pipe network water quality COD detection methods based on multi-parameter collaborative compensation described above, the device comprising: The baseline calibration module is used to divide the light output from the light source into a reference optical path and a measurement optical path through a dual-optical-path detection structure; the reference optical path is used to monitor the intensity fluctuation of the light source in real time, and the intensity of the transmitted light after the measurement optical path penetrates the water sample to be tested is differentially processed with the intensity of the light in the reference optical path to eliminate the influence of the light source's own drift on the absorbance measurement; The multi-source signal acquisition module is used to acquire environmental parameter data and full-band absorption spectrum data within a preset wavelength range of the water sample to be tested. The spectral preprocessing module is used to perform denoising and scattering correction on the full-band absorption spectral data to eliminate the influence of scattering interference and noise on the spectral signal. The COD initial prediction module is used to extract COD-related spectral feature variables from the processed full-band absorption spectral data and input them into the pre-built spectral-COD quantitative model to obtain the initial COD value. The feature fusion module is used to fuse the spectral feature variables with the environmental parameter data to construct a multimodal input feature vector; The collaborative compensation module is used to input the multimodal input feature vector into a pre-constructed collaborative compensation model. The collaborative compensation model dynamically compensates the initial COD value based on the learned mapping relationship between environmental parameters and measurement errors, and outputs the compensated COD detection value.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: Firstly, this invention acquires spectral feature variables extracted within the same measurement period and collected environmental parameter data. The environmental parameter data is standardized to eliminate dimensional differences between different parameters. Then, the spectral feature variables and the standardized environmental parameter data are vector-concatenated to generate a multimodal input feature vector. This multimodal input feature vector is input into a pre-constructed collaborative compensation model. The collaborative compensation model performs forward inference calculations based on the learned nonlinear mapping relationship between environmental parameters and COD measurement errors. It identifies and quantifies the comprehensive interference caused by environmental factors to COD measurement under the current operating conditions, generates a dynamic compensation value, and then superimposes and corrects the initial COD value. This solves the problem that traditional empirical formula correction methods can only handle linear interference from a single factor and cannot cope with the nonlinear cross-coupling effects of multiple environmental parameters such as water temperature, pH, and conductivity in drainage pipe networks. It overcomes the defect that the compensation effect of fixed correction coefficients is inconsistent under different operating conditions, and improves the measurement accuracy and adaptability of the COD detection method when the pipe network environment fluctuates drastically. Secondly, this invention employs a dual-optical-path detection structure, dividing the light output from the light source into a reference optical path and a measurement optical path. The reference optical path monitors the intensity fluctuations of the light source in real time, and the intensity of the transmitted light after the measurement optical path penetrates the water sample is differentially processed with the intensity of the reference optical path. Simultaneously, the intensity attenuation state of the reference optical path is monitored. This solves the problems in existing single-optical-path detection systems where the intensity drift of the light source itself directly couples to the absorbance measurement results, causing the measurement baseline to shift over time. It also addresses the issues of optical window contamination leading to continuous attenuation of transmittance, and the insufficient adaptability of conventional cleaning solutions in the confined space of the pipe network. This effectively eliminates the influence of light source drift on absorbance measurement, realizes automatic sensing and autonomous mechanical cleaning of the degree of optical window contamination, and improves the stability of the measurement baseline and self-maintenance capability of the equipment when deployed in situ for a long time in the drainage pipe network. Thirdly, this invention constructs a closed-loop detection system from hardware anti-interference to algorithm self-correction through a complete technical chain including dual-optical-path differential baseline calibration, optical window self-cleaning, multi-source signal synchronous acquisition, spectral denoising and scattering correction, spectral feature extraction and initial COD prediction, multi-modal feature fusion, and machine learning collaborative dynamic compensation. This enables long-term, stable, and accurate online monitoring of COD in complex and harsh environments of drainage pipe networks, reduces equipment operation and maintenance costs, and improves the robustness and service life of pipe network water quality detection in different environments. Attached Figure Description
[0016] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating the method for detecting COD in pipeline water based on multi-parameter collaborative compensation, as provided in an embodiment of the present invention. Figure 2 This is a structural block diagram of a pipeline water quality COD detection device based on multi-parameter collaborative compensation provided in an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0019] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0020] It should be noted that in the description of this invention, the terms "upper", "lower", "left", "right", "inner", "outer", etc., which indicate directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings. This is only for the convenience of description and is not intended to indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this invention.
[0021] Furthermore, it should be noted that, in the description of this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0022] Example 1 like Figure 1 As shown, this invention provides a method for detecting COD in pipe network water quality based on multi-parameter collaborative compensation, comprising: S1, through the dual-optical-path detection structure, the light output from the light source is divided into a reference optical path and a measurement optical path; the light source intensity fluctuation is monitored in real time through the reference optical path, and the transmitted light intensity after the measurement optical path penetrates the water sample to be tested is differentially processed with the light intensity of the reference optical path to eliminate the influence of the light source's own drift on the absorbance measurement; The intensity of the transmitted light after the measuring optical path penetrates the water sample is compared with the intensity of the light in the reference optical path to eliminate the influence of light source drift on absorbance measurement, including: S11. In the absence of a water sample to be tested, the initial light intensity signals of the reference optical path and the measurement optical path are collected respectively to obtain the initial light intensity value of the reference channel and the initial light intensity value of the measurement channel, and the initial light intensity ratio is calculated. S12, with a water sample to be tested, the reference light intensity signal of the reference optical path and the transmitted light intensity signal after the measurement optical path penetrates the water sample to be tested are simultaneously collected and recorded as the reference light intensity and the measurement light intensity, respectively. S13, Based on the reference light intensity, perform differential correction on the measured light intensity and calculate the corrected measured light intensity value. The differential correction is to multiply the measured light intensity by the ratio of the initial light intensity ratio to the reference light intensity to eliminate the change in measured light intensity caused by the fluctuation of the light source intensity. S14, the corrected measured light intensity value is converted to absorbance by the reference light intensity to generate the true absorbance of the water sample to be tested, which eliminates the influence of the light source's own drift.
[0023] In one possible implementation, the present invention is equipped with a xenon lamp light source, a beam splitter, a sample cell, a reference optical fiber, and two photodetectors. The beam splitter divides the light emitted by the light source into two beams according to a preset ratio. One beam passes through the sample cell to form a measurement optical path, and the other beam passes through the reference optical fiber directly to the reference detector to form a reference optical path.
[0024] Before measurement begins, the equipment is initialized. At this point, the sample cell in the measurement optical path is empty, either without the water sample to be tested, or filled with deionized water as a blank reference. After the system control light source is lit and stabilized, the light intensity signals of the reference and measurement optical paths are acquired synchronously. The signal value output by the reference detector is the initial light intensity value of the reference channel, and the signal value output by the measurement detector is the initial light intensity value of the measurement channel. The light intensity ratio K is the ratio of the initial light intensity value of the measurement channel to the initial light intensity value of the reference channel. The ratio K reflects the inherent light intensity difference in the dual optical paths under the initial state caused by differences in the splitting ratio, fiber attenuation, and detector response, and is a dimensionless constant.
[0025] After real-time monitoring begins, the sample cell is connected to the water body in the pipeline to be tested, allowing the water sample to continuously flow through the sample cell. In each measurement cycle, the system synchronously acquires the reference light intensity signal and the measured light intensity signal at the current moment. Using the pre-stored initial light intensity ratio K and the real-time acquired reference light intensity, differential correction is performed on the real-time measured light intensity. The physical model underlying this correction is: if the light source intensity drifts from its initial state by a certain factor, the reference light intensity and the measured light intensity should theoretically change proportionally.
[0026] After obtaining the corrected measured light intensity value to eliminate the influence of light source drift, absorbance is converted according to the Lambert-Beer law to generate the true absorbance of the water sample. The calculation formula can adopt the absorbance conversion formula commonly used in this field, such as using the initial reference light intensity or the corrected light intensity as a benchmark. Since the light source drift factor has been effectively eliminated, the obtained absorbance can more accurately reflect the degree of absorption of characteristic wavelength light by the chemical components in the water sample.
[0027] This invention employs a dual-optical-path detection structure, dividing the light output from the light source into a reference optical path and a measurement optical path. The reference optical path monitors the intensity fluctuations of the light source in real time, and the intensity of the transmitted light after the measurement optical path penetrates the water sample is differentially processed with the intensity of the light in the reference optical path. This solves the problem in existing single-optical-path detection systems where the intensity drift of the light source itself is directly coupled to the absorbance measurement results, causing the measurement baseline to shift over time. It effectively eliminates the influence of light source drift caused by factors such as light source aging, temperature changes, and power supply fluctuations on absorbance measurement, and improves the stability of the measurement baseline and data repeatability when the equipment is deployed in place for a long time in the drainage network.
[0028] S2, Collect environmental parameter data and full-band absorption spectrum data within a preset wavelength range of the water sample to be tested. The environmental parameter data includes at least temperature, pH value, and conductivity, including: S21, activate the broadband light source so that the continuous light output by the light source is collimated and enters the water sample to be tested; S22, collect the transmitted light after penetrating the water sample to be tested, guide the transmitted light into the spectral dispersive module for wavelength dispersion, and synchronously collect the light intensity signal at each wavelength position by the photodetector array to generate the full-band absorption spectrum data of the water sample to be tested within the preset band range. S23, synchronously drive several environmental parameter sensors to collect environmental parameter data of the water sample to be tested. The environmental parameter sensors include at least a temperature sensor, a pH sensor and a conductivity sensor. S24, bind the full-band absorption spectrum data and the environmental parameter data collected within the same measurement period into time-aligned data pairs.
[0029] In one possible implementation, the acquisition device of this embodiment includes a broadband xenon lamp light source with an output spectrum covering the ultraviolet-visible band from 190 nm to 720 nm; a set of collimating lenses for collimating the divergent light output from the light source into a parallel beam that is perpendicularly incident on the optical window of the sample cell; a sample cell with an inlet and outlet for continuous flow of the water in the pipeline to be tested; a beam splitting module using a holographic concave grating as a beam splitting element to disperse the incident transmitted light according to wavelength; a photodetector array using a linear CMOS image sensor with pixels arranged along the dispersion direction, capable of synchronously acquiring light intensity signals at each wavelength position; several environmental parameter sensors, including at least a temperature sensor, a pH sensor, and a conductivity sensor, installed at the outlet of the sample cell and in direct contact with the water being tested; and a control and data processing unit responsible for coordinating the acquisition timing and data packaging.
[0030] The control unit issues a command to activate the broadband xenon lamp light source. After the light source is lit, and after a preset preheating time until the output energy stabilizes, the continuous light emitted from the light source (190nm to 720nm) is collimated by a collimating lens group, forming a parallel beam that passes perpendicularly through the optical window of the sample cell and enters the water sample to be tested flowing within the sample cell. After penetrating the water sample, the transmitted light carries absorption and scattering information from organic matter and suspended particles in the sample. This transmitted light is collected and guided into the spectrophotometer. The holographic concave grating within the spectrophotometer disperses the incident composite light along wavelengths, forming a spectral band linearly arranged according to wavelength. Each pixel of the linear CMOS image sensor synchronously receives the light energy at its corresponding wavelength position, and after photoelectric conversion, outputs an electrical signal proportional to the light intensity. The control unit reads the output value of each pixel of the CMOS sensor, performs analog-to-digital conversion, and obtains the light intensity value at each wavelength position. The control unit calculates the full-band absorption spectrum data of the water sample to be tested in the 190nm to 720nm band according to the absorbance definition formula based on the pre-stored blank reference light intensity, and temporarily stores it in memory in the form of an array.
[0031] Within the same measurement cycle of the aforementioned spectral data acquisition, acquisition commands are simultaneously sent to the temperature sensor, pH sensor, and conductivity sensor. The temperature sensor measures the water sample temperature (T), the pH sensor measures the water sample pH value, and the conductivity sensor measures the water sample conductivity (EC). The sensors feed back the measurement data via analog-to-digital converters. In this embodiment, the trigger signal for synchronous acquisition is generated by the same clock source, ensuring that the sampling time deviation between the spectral data and the environmental parameter data does not exceed 1 millisecond.
[0032] After completing the acquisition of full-band absorption spectral data and environmental parameter data for a measurement cycle, the two are bound together according to the acquisition timestamp. Specifically, a unique measurement cycle identifier is generated for this acquisition, and this identifier, along with the full-band absorption spectral data, temperature value T, and pH value, is packaged into a structured data pair. The spectral data and environmental parameter data in this data pair are strictly aligned in time, and can be directly accessed in subsequent spectral preprocessing, initial COD prediction, and multi-parameter collaborative compensation steps.
[0033] This invention solves the data mismatch problem caused by asynchronous acquisition time between spectral and environmental parameter sensors, including temperature and pH sensors, while simultaneously activating a broadband light source for full-band absorption spectral acquisition. It also binds the spectral data and environmental parameter data acquired within the same measurement period into time-aligned data pairs. This addresses the data mismatch problem caused by asynchronous acquisition time between spectral and environmental parameter data in existing methods, avoids compensation deviations caused by changes in environmental conditions but spectral data corresponding to historical environmental conditions, improves the matching accuracy of input data in the time dimension during multi-parameter collaborative compensation, and enhances the environmental adaptability and dynamic compensation effectiveness of COD detection results.
[0034] S3, performing denoising and scattering correction processing on the full-band absorption spectrum data to eliminate the influence of scattering interference and noise on the spectral signal, including: S31, Perform smoothing filtering on the full-band absorption spectrum data to remove high-frequency random noise from the spectral signal and obtain the denoised spectral data. S32, the denoised spectral data is processed by a multivariate scattering correction algorithm, specifically including: selecting a representative spectrum as the ideal spectrum; performing linear regression on each sample spectrum against the ideal spectrum to obtain the baseline shift and offset coefficient of each sample spectrum relative to the ideal spectrum; and using the baseline shift and offset coefficient to correct each sample spectrum to eliminate the spectral baseline shift and tilt offset caused by scattering of suspended particulate matter.
[0035] The baseline shift and offset coefficient are used to correct each sample spectrum, including: S321, the correction calculation formula is: ; Among them, X o X represents the raw absorbance values of the sample spectrum at each wavelength. c , where b is the corrected absorbance value, b is the baseline shift of the sample spectrum relative to the ideal spectrum, and a is the offset coefficient of the sample spectrum relative to the ideal spectrum; S322, subtract the baseline shift b from the original absorbance value of each sample spectrum at each wavelength to eliminate the overall rise or fall of the entire spectral baseline caused by scattering of suspended particulate matter; S323, after subtracting the baseline shift, divide the spectral values one by one by the offset coefficient a to eliminate the overall spectral tilt or amplitude scaling caused by the difference in scattering degree. S324. After completing wavelength-by-wavelength correction, a multivariate scattering correction spectrum is obtained. The scattering difference between the multivariate scattering correction spectrum and the ideal spectrum is effectively eliminated, preserving the true spectral information of the absorption characteristics of chemical components in the water sample to be tested.
[0036] In one possible implementation, raw full-band absorption spectrum data is first received. This data consists of a vector of absorbance values at various wavelengths within the 190nm to 720nm band. To remove high-frequency random noise superimposed on the spectral signal, a smoothing filter is performed. This embodiment employs the Savitzky-Golay convolution smoothing algorithm, specifically: a window width of 11 wavelength points is selected, and a third-order polynomial is fitted; with each wavelength point as the center, a polynomial least-squares fit is performed using multiple data points within its neighborhood window, and the fitted value replaces the original measured value at that point; this operation is repeated point-by-point along the entire band to obtain the denoised spectral data. After this step, the jagged random fluctuations in the spectral curve are effectively suppressed, while the broad-spectrum characteristic peaks caused by the absorption of chemical components are completely preserved.
[0037] Multivariate scattering correction is performed on the denoised spectral data to eliminate the translation and tilting effects of suspended particulate scattering on the spectral baseline. Specifically, from several sample spectra in the same batch, the average absorbance at each wavelength is calculated for each spectrum, and the average spectrum is selected as the ideal spectrum. This ideal spectrum represents the typical scattering level of the samples in that batch and serves as a reference for scattering correction. For each sample spectrum X to be corrected... d Using the absorbance of the sample spectrum at each wavelength as the dependent variable, and the ideal spectrum X... i Using the absorbance value at the corresponding wavelength as the independent variable, a univariate linear regression was performed. The regression equation is: X d = a × X i + b + e; Where 'a' is the offset coefficient, reflecting the degree of tilt of the sample spectrum relative to the ideal spectrum; 'b' is the baseline shift, reflecting the overall rise or fall of the sample spectrum relative to the ideal spectrum; and 'e' is the random error term. The regression coefficients are solved using the least squares method to obtain the baseline shift 'b' and offset coefficient 'a' corresponding to the sample spectrum.
[0038] After obtaining the baseline shift *b* and offset coefficient *a* for each sample spectrum, wavelength-by-wavelength correction is performed on the absorbance values of that sample spectrum at each wavelength. The correction process consists of two steps. The first step involves converting the original absorbance values *X* of the sample spectrum at each wavelength... d First, subtract the baseline shift amount *b* one by one. This operation eliminates the overall rise or fall of the spectral baseline caused by scattering from suspended particulate matter. For example, if *b* is positive, it indicates that the spectral baseline of this sample has shifted upward due to scattering; subtracting *b* shifts the baseline downward to align with the ideal spectrum. Second, divide the spectral values after subtracting the baseline shift amount one by one by the offset coefficient *a*. This operation eliminates the overall spectral tilt or amplitude scaling caused by differences in scattering intensity. For example, if *a* is greater than 1, it indicates that scattering amplifies the overall spectral amplitude; dividing by *a* restores the spectral amplitude to a normal level. After completing the above wavelength-by-wavelength correction operation, the multivariate scattering corrected spectrum *X* corresponding to the sample spectrum is obtained. c .
[0039] This invention first smooths and filters the full-band absorption spectral data to remove high-frequency random noise, then employs a multivariate scattering correction algorithm to select an ideal spectrum and obtains the baseline shift and offset coefficients by performing linear regression on each sample spectrum. These baseline shift and offset coefficients are then used to correct each sample spectrum wavelength by wavelength. This solves the problem of existing preprocessing methods failing to effectively separate the physical scattering effect of suspended particulate matter from the absorption signals of chemical components in water. It eliminates the overall baseline shift and tilt caused by suspended particulate scattering, while suppressing the interference of random noise on spectral feature extraction, thus improving the purity and signal-to-noise ratio of chemical component absorption feature information in the spectral data.
[0040] S4. Extract COD-related spectral feature variables from the processed full-band absorption spectral data and input them into a pre-constructed spectral-COD quantitative model to obtain initial COD values, including: S41, Principal component analysis is used to perform feature dimensionality reduction on the processed full-band absorption spectrum data, and the top principal components whose cumulative variance contribution rate meets the preset threshold are extracted as spectral feature variables related to COD. S42, the extracted spectral feature variables are input into the pre-constructed spectral-COD quantitative model, which is a regression model based on the partial least squares regression algorithm, to calculate the initial COD value.
[0041] In one possible implementation, a spectral-COD quantitative model needs to be pre-constructed before online prediction. The specific construction process is as follows: Under laboratory conditions, a series of standard solution samples covering the expected COD concentration range are prepared, and actual pipeline water samples are collected to increase sample diversity; for each sample, full-band absorption spectral data are collected and preprocessed according to steps S1 to S4, while its COD concentration is determined using the standard dichromate method as a reference true value; using the calibrated spectral data of all samples as the independent variable matrix and the corresponding COD reference true value as the dependent variable vector, a partial least squares regression algorithm is executed, and the optimal number of latent variables is determined through cross-validation to obtain the regression coefficient vector and intercept term; the above model parameters are stored in the non-volatile memory of the data processing unit, completing the model construction.
[0042] The system receives calibrated spectral data, which is a vector composed of calibrated absorbance values at various wavelengths within the 190nm to 720nm band. To reduce data dimensionality, eliminate collinearity, and extract the most COD-related features, principal component analysis is performed. Specifically, the calibrated spectral data is mean-centered to ensure the mean of each wavelength variable is zero; the covariance matrix of the centered data is calculated; eigenvalue decomposition is performed on the covariance matrix to obtain the principal components arranged in descending order of eigenvalues and their corresponding variance contribution rates; the cumulative variance contribution rate is calculated, and the top k principal components whose cumulative variance contribution rate first reaches or exceeds a preset threshold, such as 95%, are selected as COD-related spectral feature variables. In this embodiment, after principal component analysis, the dimensionality of the original spectral data is reduced from hundreds of wavelength points to k, for example, k is 5 to 8, and the resulting k principal component scores constitute the spectral feature variable vector.
[0043] The extracted spectral feature variable vectors are input into the pre-built partial least squares regression model stored in the model module. The prediction calculation formula of the partial least squares regression model is: COD i = w1·f1 + w2·f2 + ... + w k ·f k + w0; Among them, COD i The initial values for COD are w1 to w k Here, represents the regression coefficients corresponding to each spectral characteristic variable, and w0 is the model intercept term. All these parameters are determined during the model training phase and pre-stored in the data processing unit. Performing the above multiplication and addition operations, the initial COD value of the current water sample is calculated.
[0044] This invention employs principal component analysis (PCA) to perform feature dimensionality reduction on preprocessed full-band absorption spectral data. It extracts the top principal components whose cumulative variance contribution rate meets a preset threshold as spectral feature variables. These spectral feature variables are then input into a pre-constructed spectral-COD quantitative model based on partial least squares regression to calculate the initial COD value. This addresses the adverse effects of multicollinearity and redundancy in high-dimensional spectral data on the predictive stability of the regression model, reduces the risk of model overfitting due to the high dimensionality and high correlation between variables in full-band spectral data, and removes residual noise from the spectrum through PCA dimensionality reduction, thereby improving the calculation efficiency and prediction accuracy of the initial COD value.
[0045] S5, perform feature fusion between the spectral feature variables and the environmental parameter data to construct a multimodal input feature vector, including: S51, acquire the spectral feature variables extracted and the environmental parameter data collected within the same measurement period; S52, standardize the environmental parameter data to match the numerical range of the environmental parameters with the numerical range of the spectral characteristic variables, so as to eliminate the fusion deviation caused by the difference in dimensions between different parameters. S53 concatenates the spectral feature variables with the standardized environmental parameter data to generate a multimodal input feature vector.
[0046] In one possible implementation, after completing the acquisition and processing of a full measurement cycle, two sets of data are retrieved from the memory buffer. The first set is a vector of spectral feature variables; the second set is environmental parameter data acquired within the same measurement cycle, which in this embodiment includes at least water temperature (T), pH value, and conductivity (EC). Both sets of data carry the same measurement cycle identifier. The data processing unit confirms that the two sets of data belong to the same sampling time by comparing the measurement cycle identifiers, thus completing the data alignment verification.
[0047] Because spectral characteristic variables and different types of environmental parameters have different physical dimensions and numerical ranges, direct fusion would cause the subsequent collaborative compensation model to be overly sensitive to variables with large numerical ranges. For example, the spectral principal component score f1 may range from -1 to 1, while the water temperature T may range from 5 to 40, the pH range from 6 to 9, and the conductivity EC range from 200 to 2000 μS / cm, showing significant differences in dimensions and amplitude. Therefore, the data processing unit performs standardization on the environmental parameter data. This embodiment uses the Z-score standardization method. After standardization, the numerical ranges of each environmental parameter are converted to a scale similar to that of the spectral characteristic variables, eliminating dimensional differences.
[0048] The spectral feature variable vector is concatenated with the standardized environmental parameter data vector. The concatenation method involves sequentially appending the environmental parameter vector to the spectral feature variable vector, generating an extended multimodal input feature vector. This multimodal input feature vector integrates spectral features reflecting the chemical absorption characteristics of the water sample and environmental features reflecting the physicochemical state of the water sample. Its dimension is k plus the number of environmental parameters, and it can be directly used by the collaborative compensation model in subsequent steps.
[0049] This invention acquires spectral feature variables extracted within the same measurement period and collected environmental parameter data. The environmental parameter data is standardized to eliminate dimensional differences between different parameters. Then, the spectral feature variables and the standardized environmental parameter data are vector-concatenated to generate a multimodal input feature vector. This solves the problem that directly fusing spectral feature variables and environmental parameter data due to inconsistencies in physical dimensions and numerical ranges leads to the subsequent collaborative compensation model being overly sensitive to parameters with larger values and underlearning parameters with smaller values. This improves the data standardization and feature balance of the fused multimodal feature vector, avoids model training convergence difficulties and compensation biases caused by dimensional differences, and ultimately enhances the collaborative compensation model's ability to comprehensively utilize multi-source heterogeneous input information and the compensation accuracy of the final COD detection value.
[0050] S6, the multimodal input feature vector is input into a pre-constructed collaborative compensation model. Based on the learned mapping relationship between environmental parameters and measurement errors, the collaborative compensation model dynamically compensates for the initial COD value and outputs the compensated COD detection value, including: S61, the multimodal input feature vector is input into a pre-constructed collaborative compensation model, which is a machine learning model that has been trained and learned, and has internally learned and stored the nonlinear mapping relationship between environmental parameters and COD measurement error. S62, the collaborative compensation model performs forward reasoning calculation on the multimodal input feature vector, identifies and quantifies the comprehensive interference caused by environmental factors to COD measurement based on the current input environmental parameter data, and generates a dynamic compensation amount that matches the current measurement conditions. S63, The dynamic compensation amount is superimposed and corrected with the initial COD value to obtain the compensated COD detection value; S64 outputs the compensated COD detection value as the final measurement result.
[0051] In one possible implementation, a collaborative compensation model needs to be pre-built and trained before performing online dynamic compensation. The specific training process is as follows: Under laboratory conditions, a series of standard solution samples with different COD concentrations are prepared, and various complex operating conditions that may occur in the drainage network are simulated by adjusting water temperature, pH, and conductivity. For each sample, the initial COD value is obtained according to steps S1 to S5, and a multimodal input feature vector is constructed according to step S6. Simultaneously, the COD concentration of the sample under this operating condition is determined using the standard dichromate method as a reference true value. The difference between the initial COD value and the reference true value is calculated as the measurement error label. The machine learning model is trained using the multimodal input feature vectors of all samples as model input and the corresponding measurement error as the model output label. In this embodiment, the machine learning model uses a support vector regression model, the kernel function is a radial basis function, and the optimal hyperparameter combination is determined through grid search and cross-validation. After training, the model internally learns and stores the nonlinear mapping relationship between environmental parameters such as water temperature and pH and the COD measurement error. The trained model parameters are stored in the non-volatile memory of the data processing unit to complete model construction.
[0052] At the end of each measurement cycle, the multimodal input feature vector for the current measurement cycle is obtained, along with the initial COD value for the same cycle. The multimodal input feature vector is loaded into the input buffer of the collaborative compensation model module. The collaborative compensation model performs forward inference calculations on the input multimodal input feature vector. Based on the environmental parameter portion of the current input multimodal input feature vector, the collaborative compensation model identifies the environmental state under the current measurement conditions. Combining the spectral feature portion with the learned nonlinear mapping relationship between environmental parameters and measurement errors, it quantifies the comprehensive interference caused by environmental factors such as current water temperature, pH, and conductivity on COD spectral measurement, and calculates and generates a dynamic compensation amount matching the current measurement conditions. For example, when the model identifies that the current water temperature is high, the pH is alkaline, and the conductivity is high, it has internally learned that this combination of conditions usually leads to a certain degree of underestimation of the COD measurement value, and outputs a corresponding positive compensation amount to correct this deviation. The generated dynamic compensation amount is superimposed with the initial COD value for correction, and the COD detection value after eliminating environmental interference is calculated.
[0053] The compensated COD detection value is used as the final measurement result for the current measurement cycle and output to a host computer or remote monitoring platform via a communication interface for display, storage, and subsequent analysis. Simultaneously, the result can include a timestamp of the current measurement cycle, the original values of various environmental parameters, and dynamic compensation amounts, allowing maintenance personnel to trace the measurement process and assess data quality.
[0054] This invention inputs a multimodal input feature vector, which integrates spectral characteristic variables and environmental parameter data, into a pre-constructed collaborative compensation model. A machine learning model then performs forward inference calculations based on the nonlinear mapping relationship between the environmental parameters and COD measurement errors that it has learned and stored internally. This identifies and quantifies the comprehensive interference caused by environmental factors on COD measurement under the current operating conditions, generates a dynamic compensation value, and then superimposes and corrects the dynamic compensation value with the initial predicted COD value to output the compensated COD detection value. This solves the problem that traditional empirical formula correction methods can only handle linear interference from a single factor and cannot cope with the nonlinear cross-coupling effects of multiple environmental parameters such as water temperature, pH, and conductivity in drainage networks. It overcomes the defect that the compensation effect is inconsistent under different operating conditions due to fixed correction coefficients, improves the measurement accuracy and adaptability of COD detection methods when the network environment fluctuates drastically, and reduces the deviation of COD measurement under complex environmental conditions.
[0055] Example 2 like Figure 2 As shown, the present invention also provides a pipe network water quality COD detection device based on multi-parameter collaborative compensation. The device is used to implement the pipe network water quality COD detection method based on multi-parameter collaborative compensation as described in any of Embodiment 1. The device includes: The baseline calibration module is used to divide the light output from the light source into a reference optical path and a measurement optical path through a dual-optical-path detection structure; the reference optical path is used to monitor the intensity fluctuation of the light source in real time, and the intensity of the transmitted light after the measurement optical path penetrates the water sample to be tested is differentially processed with the intensity of the light in the reference optical path to eliminate the influence of the light source's own drift on the absorbance measurement; The multi-source signal acquisition module is used to acquire environmental parameter data and full-band absorption spectrum data within a preset wavelength range of the water sample to be tested. The spectral preprocessing module is used to perform denoising and scattering correction on the full-band absorption spectral data to eliminate the influence of scattering interference and noise on the spectral signal. The COD initial prediction module is used to extract COD-related spectral feature variables from the processed full-band absorption spectral data and input them into the pre-built spectral-COD quantitative model to obtain the initial COD value. The feature fusion module is used to fuse the spectral feature variables with the environmental parameter data to construct a multimodal input feature vector; The collaborative compensation module is used to input the multimodal input feature vector into a pre-constructed collaborative compensation model. The collaborative compensation model dynamically compensates the initial COD value based on the learned mapping relationship between environmental parameters and measurement errors, and outputs the compensated COD detection value.
[0056] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
Claims
1. A method for detecting COD in pipe network water quality based on multi-parameter collaborative compensation, characterized in that, include: S1, through the dual-optical-path detection structure, the light output from the light source is divided into a reference optical path and a measurement optical path; the light source intensity fluctuation is monitored in real time through the reference optical path, and the transmitted light intensity after the measurement optical path penetrates the water sample to be tested is differentially processed with the light intensity of the reference optical path to eliminate the influence of the light source's own drift on the absorbance measurement; S2, collect environmental parameter data and full-band absorption spectrum data within a preset wavelength range of the water sample to be tested. The environmental parameter data includes at least temperature, pH value and conductivity. S3, perform denoising and scattering correction processing on the full-band absorption spectrum data to eliminate the influence of scattering interference and noise on the spectral signal; S4. Extract COD-related spectral feature variables from the processed full-band absorption spectrum data and input them into the pre-constructed spectral-COD quantitative model to obtain the initial COD value. S5, perform feature fusion between the spectral feature variables and the environmental parameter data to construct a multimodal input feature vector; S6, the multimodal input feature vector is input into the pre-constructed collaborative compensation model. The collaborative compensation model dynamically compensates the initial COD value based on the learned mapping relationship between environmental parameters and measurement errors, and outputs the compensated COD detection value.
2. The method for detecting COD in pipeline water quality based on multi-parameter collaborative compensation according to claim 1, characterized in that, The step of differentiating the intensity of the transmitted light after the measuring optical path penetrates the water sample with the intensity of the reference optical path to eliminate the influence of light source drift on absorbance measurement includes: S11. In the absence of a water sample to be tested, the initial light intensity signals of the reference optical path and the measurement optical path are collected respectively to obtain the initial light intensity value of the reference channel and the initial light intensity value of the measurement channel, and the initial light intensity ratio is calculated. S12, with a water sample to be tested, the reference light intensity signal of the reference optical path and the transmitted light intensity signal after the measurement optical path penetrates the water sample to be tested are simultaneously collected and recorded as the reference light intensity and the measurement light intensity, respectively. S13, Based on the reference light intensity, perform differential correction on the measured light intensity and calculate the corrected measured light intensity value. The differential correction is to multiply the measured light intensity by the ratio of the initial light intensity ratio to the reference light intensity to eliminate the change in measured light intensity caused by the fluctuation of the light source intensity. S14, the corrected measured light intensity value is converted to absorbance by the reference light intensity to generate the true absorbance of the water sample to be tested, which eliminates the influence of the light source's own drift.
3. The method for detecting COD in pipeline water quality based on multi-parameter collaborative compensation according to claim 1, characterized in that, The environmental parameter data and full-band absorption spectrum data within the preset wavelength range collected from the water sample to be tested include: S21, activate the broadband light source so that the continuous light output by the light source is collimated and enters the water sample to be tested; S22, collect the transmitted light after penetrating the water sample to be tested, guide the transmitted light into the spectral dispersive module for wavelength dispersion, and synchronously collect the light intensity signal at each wavelength position by the photodetector array to generate the full-band absorption spectrum data of the water sample to be tested within the preset band range. S23, synchronously drive several environmental parameter sensors to collect environmental parameter data of the water sample to be tested. The environmental parameter sensors include at least a temperature sensor, a pH sensor and a conductivity sensor. S24, bind the full-band absorption spectrum data and the environmental parameter data collected within the same measurement period into time-aligned data pairs.
4. The method for detecting COD in pipeline water quality based on multi-parameter collaborative compensation according to claim 1, characterized in that, The denoising and scattering correction processing of the full-band absorption spectrum data to eliminate the influence of scattering interference and noise on the spectral signal includes: S31, Perform smoothing filtering on the full-band absorption spectrum data to remove high-frequency random noise from the spectral signal and obtain the denoised spectral data. S32, the denoised spectral data is processed by a multivariate scattering correction algorithm, specifically including: selecting a representative spectrum as the ideal spectrum; performing linear regression on each sample spectrum against the ideal spectrum to obtain the baseline shift and offset coefficient of each sample spectrum relative to the ideal spectrum; and using the baseline shift and offset coefficient to correct each sample spectrum to eliminate the spectral baseline shift and tilt shift caused by scattering of suspended particulate matter.
5. The method for detecting COD in pipe network water quality based on multi-parameter collaborative compensation according to claim 4, characterized in that, The correction of each sample spectrum using the baseline shift and offset coefficient includes: S321, the correction calculation formula is: ; Among them, X o X represents the raw absorbance values of the sample spectrum at each wavelength. c , where b is the corrected absorbance value, b is the baseline shift of the sample spectrum relative to the ideal spectrum, and a is the offset coefficient of the sample spectrum relative to the ideal spectrum; S322, subtract the baseline shift b from the original absorbance value of each sample spectrum at each wavelength to eliminate the overall rise or fall of the entire spectral baseline caused by scattering of suspended particulate matter; S323, after subtracting the baseline shift, divide the spectral values one by one by the offset coefficient a to eliminate the overall spectral tilt or amplitude scaling caused by the difference in scattering degree. S324. After completing wavelength-by-wavelength correction, a multivariate scattering correction spectrum is obtained. The scattering difference between the multivariate scattering correction spectrum and the ideal spectrum is effectively eliminated, preserving the true spectral information of the absorption characteristics of chemical components in the water sample to be tested.
6. The method for detecting COD in pipeline water quality based on multi-parameter collaborative compensation according to claim 1, characterized in that, The process of extracting COD-related spectral feature variables from the processed full-band absorption spectral data and inputting them into a pre-constructed spectral-COD quantitative model to obtain initial COD values includes: S41, Principal component analysis is used to perform feature dimensionality reduction on the processed full-band absorption spectrum data, and the top principal components whose cumulative variance contribution rate meets the preset threshold are extracted as spectral feature variables related to COD. S42, the extracted spectral feature variables are input into the pre-constructed spectral-COD quantitative model, which is a regression model based on the partial least squares regression algorithm, to calculate the initial COD value.
7. The method for detecting COD in pipe network water quality based on multi-parameter collaborative compensation according to claim 1, characterized in that, The step of fusing the spectral feature variables with the environmental parameter data to construct a multimodal input feature vector includes: S51, acquire the spectral feature variables extracted and the environmental parameter data collected within the same measurement period; S52, standardize the environmental parameter data to match the numerical range of the environmental parameters with the numerical range of the spectral characteristic variables, so as to eliminate the fusion deviation caused by the difference in dimensions between different parameters. S53 concatenates the spectral feature variables with the standardized environmental parameter data to generate a multimodal input feature vector.
8. The method for detecting COD in pipeline water quality based on multi-parameter collaborative compensation according to claim 1, characterized in that, The step of inputting the multimodal input feature vector into a pre-constructed collaborative compensation model, which dynamically compensates the initial COD value based on the learned mapping relationship between environmental parameters and measurement errors, and outputs the compensated COD detection value, includes: S61, the multimodal input feature vector is input into a pre-constructed collaborative compensation model, which is a machine learning model that has been trained and learned, and has internally learned and stored the nonlinear mapping relationship between environmental parameters and COD measurement error. S62, the collaborative compensation model performs forward reasoning calculation on the multimodal input feature vector, identifies and quantifies the comprehensive interference caused by environmental factors to COD measurement based on the current input environmental parameter data, and generates a dynamic compensation amount that matches the current measurement conditions. S63, The dynamic compensation amount is superimposed and corrected with the initial COD value to obtain the compensated COD detection value; S64 outputs the compensated COD detection value as the final measurement result.
9. A pipe network water quality COD detection device based on multi-parameter collaborative compensation, characterized in that, The device is used to implement the COD detection method for pipeline water quality based on multi-parameter collaborative compensation as described in any one of claims 1 to 8, and the device comprises: The baseline calibration module is used to divide the light output from the light source into a reference optical path and a measurement optical path through a dual-optical-path detection structure; the reference optical path is used to monitor the light source intensity fluctuation in real time, and the intensity of the transmitted light after the measurement optical path penetrates the water sample to be tested is differentially processed with the intensity of the light in the reference optical path to eliminate the influence of the light source drift on the absorbance measurement. The multi-source signal acquisition module is used to acquire environmental parameter data and full-band absorption spectrum data within a preset wavelength range of the water sample to be tested. The spectral preprocessing module is used to perform denoising and scattering correction on the full-band absorption spectral data to eliminate the influence of scattering interference and noise on the spectral signal. The COD initial prediction module is used to extract COD-related spectral feature variables from the processed full-band absorption spectral data and input them into the pre-built spectral-COD quantitative model to obtain the initial COD value. The feature fusion module is used to fuse the spectral feature variables with the environmental parameter data to construct a multimodal input feature vector; The collaborative compensation module is used to input the multimodal input feature vector into a pre-constructed collaborative compensation model. The collaborative compensation model dynamically compensates the initial COD value based on the learned mapping relationship between environmental parameters and measurement errors, and outputs the compensated COD detection value.
Citation Information
Patent Citations
Multi-parameter water quality intelligent spectrum analysis system and self-adaptive correction method
CN120741360A
Portable water quality multi-parameter detection system based on improved CT spectrum structure
CN122330026A
