Swimming pool water quality detection method and system based on optical sensing

By using an optical sensing-based swimming pool water quality detection method, which simultaneously collects multi-parameter data and combines algorithms and dynamic weight update mechanisms, the problems of poor accuracy and timeliness in traditional detection methods are solved. This enables real-time monitoring and multi-parameter evaluation of swimming pool water quality, reduces operational difficulty and cost, and improves detection efficiency and reliability.

CN121409896APending Publication Date: 2026-01-27UNIV OF JINAN
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202511616045.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-01-27

AI Technical Summary

Technical Problem

Traditional swimming pool water quality testing methods suffer from poor accuracy and timeliness, limited testing parameters, and a lack of real-time feedback mechanisms, failing to meet the monitoring needs for various pollutants and microorganisms in swimming pool water.

Method used

An optical sensing-based swimming pool water quality detection method is adopted. By simultaneously collecting ultraviolet to near-infrared optical signals, water temperature, turbidity, and pH data, combined with partial least squares algorithm and dynamic weight update mechanism, the spectral matching degree is monitored in real time, the characteristic spectral peaks corresponding to each pollutant are separated, and the maintenance difficulty is reduced by anti-corrosion coating and periodic cleaning design, realizing automated data transmission and optimization.

Benefits of technology

It enables real-time monitoring of pool water quality, improves the accuracy and timeliness of detection, enriches the detection parameters, reduces the difficulty and cost of operation, forms an effective feedback mechanism, and significantly improves detection efficiency and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121409896A_ABST
    Figure CN121409896A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of water quality detection, and discloses a swimming pool water quality detection method and system based on optical sensing, and the method comprises the following steps: synchronously collecting ultraviolet to near-infrared optical signals and water temperature, turbidity and pH value data by controlling the flow of a water sample, processing the optical signals, and calculating the water quality of a swimming pool according to the data; and comparing the actually measured spectrum with a standard library separated pollutant characteristic peak by using a partial least squares algorithm, generating and fusing a calibration coefficient correction characteristic peak to obtain a calibration spectrum by combining water quality data, performing anti-corrosion and periodic cleaning on the sensing probe, and finally compressing the calibration spectrum and comprehensively transmitting the calibration coefficient. Through multi-parameter collaborative acquisition, optical signal precise processing, dynamic weight optimization comparison and calibration correction, and in combination with probe maintenance, pollutant feature detection and data transmission can be efficiently and precisely realized, and the accuracy and reliability of water quality monitoring are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water quality testing technology, and more specifically, to a method and system for testing swimming pool water quality based on optical sensing. Background Technology

[0002] Optical sensing is a technology that combines optical principles with recognition elements to achieve highly specific and sensitive detection and analysis of target substances. It offers advantages such as fast detection speed, real-time monitoring, and ease of operation, showing promising application prospects in the field of swimming pool water quality testing.

[0003] Traditional swimming pool water quality testing methods suffer from difficulties in guaranteeing the accuracy and timeliness of results. The testing cycle is lengthy, often requiring water samples to be brought back to the laboratory for analysis, making it impossible to reflect real-time dynamic changes in pool water quality and potentially leading to undetected and unaddressed water quality issues. Furthermore, the testing parameters are relatively limited, typically only a few indicators can be measured, making it difficult to comprehensively assess pool water quality and meet the monitoring needs for multiple pollutants and microorganisms in pool water. Simultaneously, the testing process is complex, requiring high levels of professional skills from operators, increasing testing costs and difficulty. The lack of an effective feedback mechanism during the testing process prevents timely adjustments to the testing strategy based on real-time data, further impacting the efficiency and reliability of the testing.

[0004] Therefore, it is necessary to design a swimming pool water quality detection method and system based on optical sensing to solve the problems of poor accuracy and timeliness of detection results, single detection parameters, and lack of real-time feedback mechanism in traditional swimming pool water quality detection methods. Summary of the Invention

[0005] In view of this, the present invention proposes a swimming pool water quality detection method and system based on optical sensing, aiming to solve the problems of poor accuracy and timeliness of detection results, single detection parameters, and lack of real-time feedback mechanism in traditional swimming pool water quality detection methods.

[0006] In one aspect, the present invention proposes a swimming pool water quality detection method based on optical sensing, comprising: The flow of water samples is controlled within the channel, and optical signals, water temperature, turbidity, and pH data of the water samples in the ultraviolet to near-infrared bands are collected simultaneously through sensors. The optical signal is processed to extract the dark current baseline value and eliminate baseline drift. The partial least squares algorithm is used to compare the measured spectrum with the standard spectral library to separate the characteristic spectral peaks corresponding to each pollutant. Based on water temperature, turbidity, and pH data, corresponding calibration coefficients are generated, and these calibration coefficients are fused to obtain a comprehensive calibration coefficient. The comprehensive calibration coefficient is then used to correct the separated characteristic spectral peaks to obtain calibrated spectral data. An anti-corrosion coating is applied to the surface of the sensor probe, and periodic physical cleaning is performed. The calibrated spectral data and comprehensive calibration coefficients are compressed and transmitted externally. In particular, when using the partial least squares algorithm for comparison, the matching degree between the spectrum and the standard spectral library is monitored in real time, and the preset standard matching degree is: When the matching degree is greater than or equal to the standard matching degree, the separated characteristic spectral peaks are directly output; When the matching degree is less than the standard matching degree, the dynamic weight update mechanism is invoked to correct the weight coefficients of the standard spectral library based on historical water quality data. After correction, the comparison and separation are performed again until the matching degree is greater than or equal to the standard matching degree.

[0007] Furthermore, when compressing the calibrated spectral data and the comprehensive calibration coefficients and transmitting them externally, the process also includes: Obtain the swimming pool's geographical location and operation type information, determine the corresponding water quality standard type for the region based on the geographical location information, and determine the priority ranking of water quality parameters based on the operation type information; Based on the determined water quality standard type, the compressed spectral data and comprehensive calibration coefficients are converted into a data format that conforms to the standard type. Then, the converted data is reorganized according to the priority of the water quality parameters to obtain the adapted transmission data. According to the preset transmission cycle, the adapted transmission data is sent to the corresponding monitoring platform and swimming pool operation terminal.

[0008] Furthermore, when invoking the dynamic weight update mechanism to correct the weight coefficients of the standard spectral library based on historical water quality data, the following steps are included: A database of water quality parameter changes is established based on historical monitoring data, from which historical spectral matching records and corresponding weight adjustment records with the same type of current water sample are extracted. The similarity between the current measured spectrum and the historical spectrum is calculated to obtain the spectral similarity, and a preset standard spectral similarity is used. Compare the spectral similarity with the standard spectral similarity: When the spectral similarity is within the allowable range of the standard spectral similarity, the coefficients in the corresponding historical weight adjustment records are directly used as the correction weight coefficients for the current standard spectral library. When the spectral similarity is outside the allowable range of the standard spectral similarity, the coefficients in the corresponding historical weight adjustment records are scaled and adjusted according to the difference between the spectral similarity and the standard spectral similarity, and then used as the correction weight coefficients for the current standard spectral library.

[0009] Furthermore, when using the partial least squares algorithm to compare the measured spectra with the standard spectral library and separate the characteristic spectral peaks corresponding to each pollutant, the following steps are included: Obtain the light intensity values ​​at each wavelength point in the measured spectrum, and extract the characteristic wavelengths of 12 common swimming pool pollutants from the standard spectral library; A first characteristic peak intensity threshold, a second characteristic peak intensity threshold, and a third characteristic peak intensity threshold are preset, and the first characteristic peak intensity threshold is less than the second characteristic peak intensity threshold and less than the third characteristic peak intensity threshold; When the light intensity value of the measured spectrum at a certain characteristic wavelength is greater than or equal to the intensity threshold of the third characteristic peak, the pollutant corresponding to that wavelength is determined to be a high-concentration pollutant and marked as a first-level characteristic peak; When the light intensity value of the measured spectrum at a certain characteristic wavelength is greater than or equal to the intensity threshold of the second characteristic peak and less than the intensity threshold of the third characteristic peak, the pollutant corresponding to that wavelength is determined to be a medium-concentration pollutant and marked as a secondary characteristic peak. When the light intensity value of the measured spectrum at a certain characteristic wavelength is greater than or equal to the first characteristic peak intensity threshold and less than the second characteristic peak intensity threshold, the pollutant corresponding to that wavelength is determined to be a low-concentration pollutant and marked as a third-level characteristic peak. When the light intensity value of the measured spectrum at a certain characteristic wavelength is less than the intensity threshold of the first characteristic peak, it is determined that the pollutant corresponding to that wavelength is not detected.

[0010] Furthermore, when generating the corresponding calibration coefficients based on water temperature, turbidity, and pH data, the following are included: The first water temperature calibration range, the second water temperature calibration range, and the third water temperature calibration range are preset, and the corresponding temperature calibration coefficients are arranged in ascending order as the first temperature calibration coefficient, the second temperature calibration coefficient, and the third temperature calibration coefficient; The first turbidity calibration interval, the second turbidity calibration interval, and the third turbidity calibration interval are preset, and the corresponding turbidity calibration coefficients are arranged in ascending order as the first turbidity calibration coefficient, the second turbidity calibration coefficient, and the third turbidity calibration coefficient; Preset a first pH calibration range, a second pH calibration range, and a third pH calibration range. The corresponding pH calibration coefficients are arranged in ascending order as the first pH calibration coefficient, the second pH calibration coefficient, and the third pH calibration coefficient. When the water temperature falls within the first water temperature calibration range, the first temperature calibration coefficient is selected as the temperature calibration coefficient; when the water temperature falls within the second water temperature calibration range, the second temperature calibration coefficient is selected as the temperature calibration coefficient; when the water temperature falls within the third water temperature calibration range, the third temperature calibration coefficient is selected as the temperature calibration coefficient. When the turbidity falls within the first turbidity calibration range, the first turbidity calibration coefficient is selected as the turbidity calibration coefficient; when the turbidity falls within the second turbidity calibration range, the second turbidity calibration coefficient is selected as the turbidity calibration coefficient; when the turbidity falls within the third turbidity calibration range, the third turbidity calibration coefficient is selected as the turbidity calibration coefficient. When the pH value falls within the first pH calibration range, the first pH calibration coefficient is used as the pH calibration coefficient; when the pH value falls within the second pH calibration range, the second pH calibration coefficient is used as the pH calibration coefficient; when the pH value falls within the third pH calibration range, the third pH calibration coefficient is used as the pH calibration coefficient.

[0011] Furthermore, when fusing the calibration coefficients to obtain the comprehensive calibration coefficient, the following steps are included: The overall calibration coefficient is equal to the temperature calibration coefficient multiplied by the first weighting coefficient, plus the turbidity calibration coefficient multiplied by the second weighting coefficient, plus the pH calibration coefficient multiplied by the third weighting coefficient, where the sum of the first weighting coefficient, the second weighting coefficient, and the third weighting coefficient equals one. The first weight combination is preset for the first-level feature peak, the second weight combination is preset for the second-level feature peak, and the third weight combination is preset for the third-level feature peak. When the pollutant is a first-level characteristic peak, the comprehensive calibration coefficient is calculated using the first weighted combination. When the pollutant has a secondary characteristic peak, the comprehensive calibration coefficient is calculated using the second weighted combination. When the pollutant has a third-level characteristic peak, the comprehensive calibration coefficient is calculated using the third weight combination.

[0012] Furthermore, when correcting the separated characteristic spectral peaks using comprehensive calibration coefficients, the following steps are included: The corrected characteristic peak area is equal to the uncorrected characteristic peak area multiplied by the overall calibration factor; Preset first-level feature peak correction threshold, second-level feature peak correction threshold, and third-level feature peak correction threshold, wherein the first-level feature peak correction threshold is less than the second-level feature peak correction threshold and less than the third-level feature peak correction threshold; If the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the original characteristic peak is less than or equal to the first-level characteristic peak correction threshold, and the characteristic spectral peak is a first-level characteristic peak, then the correction is deemed effective. If the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the original characteristic peak is less than or equal to the correction threshold for the secondary characteristic peak, then the correction is deemed effective if the characteristic spectral peak is a secondary characteristic peak. If the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the original characteristic peak is less than or equal to the correction threshold of the third-order characteristic peak, then the correction is deemed effective if the characteristic spectral peak is a third-order characteristic peak. When the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the uncorrected characteristic peak is greater than the corresponding correction threshold, regardless of whether the characteristic spectral peak is a first-level, second-level, or third-level characteristic peak, the dynamic weight update mechanism is invoked again. The weight coefficients of the standard spectral library are adjusted based on historical water quality data, and then the comprehensive calibration coefficient is adjusted. The corrected characteristic peak area is then recalculated, and the judgment process is repeated until the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the uncorrected characteristic peak is less than or equal to the corresponding correction threshold, at which point the correction is deemed effective.

[0013] Furthermore, when applying an anti-corrosion coating to the surface of the sensor probe and performing periodic physical cleaning, the following steps are included: A preset standard range for coating thickness is defined. When the coating thickness is detected to be less than the minimum value of the standard range, coating generation is initiated. Preset cleaning trigger threshold: Physical cleaning is initiated immediately when the reflectivity exceeds the set value or the fluctuation value of the detection signal exceeds the set fluctuation value; After cleaning, the light transmittance of the probe is tested. When the light transmittance is greater than or equal to the standard light transmittance, the cleaning is deemed qualified. When the light transmittance is less than the standard light transmittance, the cleaning time is extended to 1.5 times the original time before retesting.

[0014] Furthermore, when compressing the calibrated spectral data and the comprehensive calibration coefficients, the following steps are included: Three compression ratios are preset, listed in ascending order as the first compression ratio, the second compression ratio, and the third compression ratio; When the number of primary characteristic peaks is greater than or equal to three, the first compression ratio is used for compression. When the number of primary characteristic peaks is greater than or equal to one and less than three, the second compression ratio is used for compression. When the number of primary characteristic peaks is zero, compression is performed using the third compression ratio; The compression is considered effective when the deviation between the compressed data verification value and the original data verification value is less than or equal to the set compression deviation value.

[0015] Compared with existing technologies, the advantages of this invention are as follows: In terms of detection accuracy and timeliness, by simultaneously collecting multi-parameter data and combining partial least squares algorithm and dynamic weight update mechanism, the precision of characteristic spectral peak separation is ensured, enabling real-time monitoring of water quality and timely detection of water quality problems; the detection parameters are rich, covering ultraviolet to near-infrared optical signals as well as water temperature, turbidity, pH value, etc., which can comprehensively assess pool water quality and meet the monitoring needs of various pollutants and microorganisms; in terms of operation, the anti-corrosion coating of the sensor probe and the periodic cleaning design reduce maintenance difficulty, the overall process is highly automated, reducing reliance on the professional skills of operators and lowering detection costs and difficulty; at the same time, by monitoring the spectral matching degree in real time and dynamically adjusting it, an effective feedback mechanism is formed, which can optimize the detection process in a timely manner based on the detection data, significantly improving detection efficiency and reliability.

[0016] On the other hand, this application also provides a swimming pool water quality detection system based on optical sensing, comprising: The optical signal acquisition module is used to control the flow of water samples in the channel and simultaneously acquire optical signals of water samples in the ultraviolet to near-infrared bands, as well as water temperature, turbidity, and pH value data through sensors. The spectral processing module is used to process optical signals, extract dark current baseline values ​​and eliminate baseline drift, and use partial least squares algorithm to compare the measured spectrum with the standard spectral library to separate the characteristic spectral peaks corresponding to each pollutant. The spectral processing module generates corresponding calibration coefficients based on water temperature, turbidity, and pH data, and merges the calibration coefficients to obtain a comprehensive calibration coefficient. The comprehensive calibration coefficient is then used to correct the separated characteristic spectral peaks to obtain calibrated spectral data. The cleaning and maintenance module is used to apply an anti-corrosion coating to the surface of the sensor probe and perform periodic physical cleaning. The data processing module is used to compress the calibrated spectral data and the comprehensive calibration coefficients and then transmit them externally.

[0017] It is understandable that the above-mentioned optical sensing-based swimming pool water quality detection method and system have the same beneficial effects, and will not be elaborated further here. Attached Figure Description

[0018] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A first flowchart of a swimming pool water quality detection method based on optical sensing provided in an embodiment of the present invention; Figure 2 A second flowchart of a swimming pool water quality detection method based on optical sensing provided in an embodiment of the present invention; Figure 3 This is a functional block diagram of a swimming pool water quality detection system based on optical sensing, provided in an embodiment of the present invention. Detailed Implementation

[0019] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the disclosure to those skilled in the art. It should be noted that, unless otherwise specified, embodiments and features in the embodiments of the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0020] Reference Figure 1 In some embodiments of this application, a swimming pool water quality detection method based on optical sensing includes the following steps: Step S100: Control the flow of water sample in the channel, and simultaneously collect optical signals of water sample in the ultraviolet to near-infrared bands, as well as water temperature, turbidity, and pH value data through sensors; Step S200: Process the optical signal, extract the dark current baseline value and eliminate baseline drift, and use the partial least squares algorithm to compare the measured spectrum with the standard spectral library to separate the characteristic spectral peaks corresponding to each pollutant. Step S300: Generate corresponding calibration coefficients based on water temperature, turbidity, and pH data, and fuse the calibration coefficients to obtain a comprehensive calibration coefficient. Use the comprehensive calibration coefficient to correct the separated characteristic spectral peaks to obtain calibrated spectral data. Step S400: Apply an anti-corrosion coating to the surface of the sensor probe and perform periodic physical cleaning; Step S500: Compress the calibrated spectral data and the comprehensive calibration coefficients and transmit them externally; In particular, when using the partial least squares algorithm for comparison, the matching degree between the spectrum and the standard spectral library is monitored in real time, and the preset standard matching degree is: When the matching degree is greater than or equal to the standard matching degree, the separated characteristic spectral peaks are directly output; When the matching degree is less than the standard matching degree, the dynamic weight update mechanism is invoked to correct the weight coefficients of the standard spectral library based on historical water quality data. After correction, the comparison and separation are performed again until the matching degree is greater than or equal to the standard matching degree.

[0021] The above embodiments, in terms of detection accuracy and timeliness, ensure the precision of characteristic spectral peak separation by synchronously collecting multi-parameter data, combined with partial least squares algorithm and dynamic weight update mechanism, enabling real-time monitoring of water quality and timely detection of water quality problems. The rich range of detection parameters, covering ultraviolet to near-infrared optical signals as well as water temperature, turbidity, and pH value, comprehensively assesses pool water quality and meets the monitoring needs for various pollutants and microorganisms. Operationally, the anti-corrosion coating of the sensor probe and the periodic cleaning design reduce maintenance difficulty, and the high degree of automation of the overall process reduces reliance on operators' professional skills, lowering detection costs and difficulty. Simultaneously, by monitoring spectral matching degree in real time and dynamically adjusting, an effective feedback mechanism is formed, allowing for timely optimization of the detection process based on detection data, significantly improving detection efficiency and reliability.

[0022] Reference Figure 2 When compressing and transmitting the calibrated spectral data and integrated calibration coefficients, the following steps are also included: Step S600: Obtain the geographical location information and operation type information of the swimming pool, determine the water quality standard type corresponding to the area based on the geographical location information, and determine the priority order of water quality parameters based on the operation type information; Based on the determined water quality standard type, the compressed spectral data and comprehensive calibration coefficients are converted into a data format that conforms to the standard type. Then, the converted data is reorganized according to the priority of the water quality parameters to obtain the adapted transmission data. According to the preset transmission cycle, the adapted transmission data is sent to the corresponding monitoring platform and swimming pool operation terminal.

[0023] Specifically, the geographical location information is automatically collected by the GPS module built into the sensing system to collect latitude and longitude data, or manually entered by the operator into the administrative region (such as province / city / district) to which the pool belongs. The system matches this information with the preset regional water quality standard database and automatically retrieves the mandatory or recommended standards for the corresponding region. The operation type information is determined by the category selected by the user during system initialization (such as public pool, commercial hotel pool, private club pool, etc.). The system presets parameter priorities according to the risk level of different operation scenarios. For example, public pools list "total bacterial count" and "residual chlorine content" as the first priority, while commercial pools additionally include "urea concentration" as the first priority.

[0024] Specifically, during the data format conversion stage, the system has multiple built-in standard format templates. Based on the determined water quality standard type, the corresponding template is automatically called to parse the compressed spectral data into pollutant concentration values ​​(such as converting the intensity of characteristic spectral peaks into specific contents such as cyanide and nitrate). The comprehensive calibration coefficient is appended as a verification field to the end of the data to form a structured data frame containing "detection time - location identifier - standard code - pollutant value - calibration coefficient". During field reorganization, the data frame fields are rearranged according to priority. First-priority parameters occupy the first segment of the data frame, second-priority parameters (such as water temperature and turbidity) follow closely behind, and low-priority parameters (such as original spectral characteristic values) are placed at the end, which facilitates the receiver to quickly extract key information.

[0025] Specifically, in terms of the transmission mechanism, the preset cycle can be dynamically adjusted according to the operation type (once every 30 minutes for public pools and once every 2 hours for private pools). The transmission process uses an encrypted protocol (such as HTTPS). The data packets sent to the monitoring platform contain complete parameters and calibration basis, supporting data traceability and compliance verification by the monitoring end. The data packets sent to the pool operation terminal are simplified to real-time values ​​of the first-priority parameters and over-limit warning indicators, along with standard limit comparison charts, facilitating quick handling by the operator. If transmission fails, the system will activate a local caching and breakpoint resume mechanism, prioritizing the retransmission of unsuccessfully sent data after the network is restored.

[0026] The above embodiments, by accurately matching regional water quality standards, scientifically prioritizing parameters, adapting data formats, and optimizing transmission mechanisms, not only ensure data compliance and efficient extraction of key information by the receiving end, but also improve transmission security, relevance, and stability, thus helping regulators and operators to efficiently handle water quality issues.

[0027] Specifically, when invoking the dynamic weight update mechanism to correct the weight coefficients of the standard spectral library based on historical water quality data, the following is included: A database of water quality parameter changes is established based on historical monitoring data, from which historical spectral matching records and corresponding weight adjustment records with the same type of current water sample are extracted. The similarity between the current measured spectrum and the historical spectrum is calculated to obtain the spectral similarity, and a preset standard spectral similarity is used. Compare the spectral similarity with the standard spectral similarity: When the spectral similarity is within the allowable range of the standard spectral similarity, the coefficients in the corresponding historical weight adjustment records are directly used as the correction weight coefficients for the current standard spectral library. When the spectral similarity is outside the allowable range of the standard spectral similarity, the coefficients in the corresponding historical weight adjustment records are scaled and adjusted according to the difference between the spectral similarity and the standard spectral similarity, and then used as the correction weight coefficients for the current standard spectral library.

[0028] Specifically, a water quality parameter change database is established based on historical monitoring data from the past three months. Historical spectral matching records and corresponding weight adjustment records for the same water sample type are extracted (the weight coefficient adjustment range is 0.8-1.5). The similarity between the current measured spectrum and the historical records is calculated, with a value range of 0-1. The preset standard spectral similarity is 0.85, and the allowable fluctuation range is ±0.05 (i.e., 0.8-0.9). When the spectral similarity is 0.83 (within the allowable range), the coefficient (e.g., 1.2) in the corresponding historical weight adjustment record is directly used as the current value. Adjust the weighting coefficients; when the spectral similarity is 0.76 (below the lower limit of the allowable range), the difference is calculated as 0.76-0.85=-0.09. The historical coefficient 1.2 is scaled according to the proportion of the difference to the standard value (0.76 / 0.85≈0.894) to obtain 1.2×0.894≈1.07 as the adjustment coefficient; when the spectral similarity is 0.92 (above the upper limit of the allowable range), the difference is 0.07. After scaling according to the proportion (0.92 / 0.85≈1.082), 1.2×1.082≈1.30 is obtained as the adjustment coefficient.

[0029] Specifically, water sample type refers to the source or state of pool water, including but not limited to: pool circulating water, newly added tap water, rainwater seepage, and high-load water containing a large amount of swimmers' metabolic waste. The same water sample type refers to water samples with the same source and pollution characteristics.

[0030] The above embodiments, by combining historical data to selectively extract similar water sample records and flexibly adjusting weight coefficients based on spectral similarity, not only ensure the high efficiency of correction under similar water quality, but also adapt to water quality conditions with large differences through difference scaling, effectively improving the matching accuracy of the standard spectral library, enhancing adaptability to complex and variable water quality, ensuring the accuracy of characteristic spectral peak separation, and thus improving the overall reliability and stability of detection.

[0031] Specifically, when using the partial least squares algorithm to compare the measured spectra with the standard spectral library and separate the characteristic spectral peaks corresponding to each pollutant, the following steps are included: Obtain the light intensity values ​​at each wavelength point in the measured spectrum, and extract the characteristic wavelengths of 12 common swimming pool pollutants from the standard spectral library; A first characteristic peak intensity threshold, a second characteristic peak intensity threshold, and a third characteristic peak intensity threshold are preset, and the first characteristic peak intensity threshold is less than the second characteristic peak intensity threshold and less than the third characteristic peak intensity threshold; When the light intensity value of the measured spectrum at a certain characteristic wavelength is greater than or equal to the intensity threshold of the third characteristic peak, the pollutant corresponding to that wavelength is determined to be a high-concentration pollutant and marked as a first-level characteristic peak; When the light intensity value of the measured spectrum at a certain characteristic wavelength is greater than or equal to the intensity threshold of the second characteristic peak and less than the intensity threshold of the third characteristic peak, the pollutant corresponding to that wavelength is determined to be a medium-concentration pollutant and marked as a secondary characteristic peak. When the light intensity value of the measured spectrum at a certain characteristic wavelength is greater than or equal to the first characteristic peak intensity threshold and less than the second characteristic peak intensity threshold, the pollutant corresponding to that wavelength is determined to be a low-concentration pollutant and marked as a third-level characteristic peak. When the light intensity value of the measured spectrum at a certain characteristic wavelength is less than the intensity threshold of the first characteristic peak, it is determined that the pollutant corresponding to that wavelength is not detected.

[0032] Specifically, the light intensity values ​​at each wavelength in the measured spectrum are expressed in relative light intensity units (0-1000). The 12 common swimming pool contaminants include residual chlorine, urea, total bacterial count, total coliforms, turbidity substances, pH buffering substances, iron ions, manganese ions, sulfate, nitrate, algal metabolites, and surfactants, with characteristic wavelengths corresponding to 290nm, 205nm, 600nm, 450nm, 550nm, 420nm, 305nm, 280nm, 210nm, 220nm, 410nm, and 230nm, respectively. The preset intensity thresholds for the first characteristic peak are 50, the second characteristic peak is 200, and the third characteristic peak is 500. For example: when the measured light intensity at 290nm (the characteristic wavelength of residual chlorine) is 600, residual chlorine is determined to be a high-concentration pollutant and marked as a first-level characteristic peak; when the light intensity is 300, it is determined to be a medium-concentration pollutant and marked as a second-level characteristic peak; when the light intensity is 100, it is determined to be a low-concentration pollutant and marked as a third-level characteristic peak; when the light intensity is 30, residual chlorine is determined to be undetectable.

[0033] The above embodiments, by clearly defining the characteristic wavelengths and three-level intensity thresholds of 12 common swimming pool pollutants, can comprehensively cover the detection needs of major pollutants, accurately classify and determine the concentration level of each pollutant, and not only achieve clear distinction between high, medium and low concentration pollutants, but also identify undetected pollutants, making the detection results more objective and targeted, providing accurate basis for subsequent water quality assessment and treatment, and improving the accuracy and effectiveness of pollutant characteristic identification.

[0034] Specifically, when generating corresponding calibration coefficients based on water temperature, turbidity, and pH data, the following is included: The first water temperature calibration range, the second water temperature calibration range, and the third water temperature calibration range are preset, and the corresponding temperature calibration coefficients are arranged in ascending order as the first temperature calibration coefficient, the second temperature calibration coefficient, and the third temperature calibration coefficient; The first turbidity calibration interval, the second turbidity calibration interval, and the third turbidity calibration interval are preset, and the corresponding turbidity calibration coefficients are arranged in ascending order as the first turbidity calibration coefficient, the second turbidity calibration coefficient, and the third turbidity calibration coefficient; Preset a first pH calibration range, a second pH calibration range, and a third pH calibration range. The corresponding pH calibration coefficients are arranged in ascending order as the first pH calibration coefficient, the second pH calibration coefficient, and the third pH calibration coefficient. When the water temperature falls within the first water temperature calibration range, the first temperature calibration coefficient is selected as the temperature calibration coefficient; when the water temperature falls within the second water temperature calibration range, the second temperature calibration coefficient is selected as the temperature calibration coefficient; when the water temperature falls within the third water temperature calibration range, the third temperature calibration coefficient is selected as the temperature calibration coefficient. When the turbidity falls within the first turbidity calibration range, the first turbidity calibration coefficient is selected as the turbidity calibration coefficient; when the turbidity falls within the second turbidity calibration range, the second turbidity calibration coefficient is selected as the turbidity calibration coefficient; when the turbidity falls within the third turbidity calibration range, the third turbidity calibration coefficient is selected as the turbidity calibration coefficient. When the pH value falls within the first pH calibration range, the first pH calibration coefficient is used as the pH calibration coefficient; when the pH value falls within the second pH calibration range, the second pH calibration coefficient is used as the pH calibration coefficient; when the pH value falls within the third pH calibration range, the third pH calibration coefficient is used as the pH calibration coefficient.

[0035] Specifically, the water temperature calibration ranges and corresponding coefficients are as follows: the first water temperature calibration range is <24℃, corresponding to a first temperature calibration coefficient of 0.9; the second water temperature calibration range is 24-28℃, corresponding to a second temperature calibration coefficient of 1.0; and the third water temperature calibration range is >28℃, corresponding to a third temperature calibration coefficient of 1.1.

[0036] Specifically, the turbidity calibration intervals and corresponding coefficients (unit: NTU) are as follows: the first turbidity calibration interval is ≤0.5 NTU, corresponding to a first turbidity calibration coefficient of 1.2; the second turbidity calibration interval is 0.5-1.0 NTU, corresponding to a second turbidity calibration coefficient of 1.0; and the third turbidity calibration interval is >1.0 NTU, corresponding to a third turbidity calibration coefficient of 0.8.

[0037] Specifically, the pH calibration ranges and corresponding coefficients are as follows: the first pH calibration range is <7.2, corresponding to a first pH calibration coefficient of 0.95; the second pH calibration range is 7.2-7.8, corresponding to a second pH calibration coefficient of 1.0; and the third pH calibration range is >7.8, corresponding to a third pH calibration coefficient of 1.05.

[0038] The above embodiments, by dividing water temperature, turbidity, and pH into specific ranges and matching corresponding calibration coefficients, can specifically adapt to the actual state of each parameter, accurately obtain calibration basis that meets the current water quality conditions, provide reliable support for the correction of characteristic spectral peaks, effectively improve the accuracy and adaptability of spectral data calibration, and thus ensure the accuracy of overall water quality detection.

[0039] Specifically, when fusing calibration coefficients to obtain a comprehensive calibration coefficient, the following is included: The overall calibration coefficient is equal to the temperature calibration coefficient multiplied by the first weighting coefficient, plus the turbidity calibration coefficient multiplied by the second weighting coefficient, plus the pH calibration coefficient multiplied by the third weighting coefficient, where the sum of the first weighting coefficient, the second weighting coefficient, and the third weighting coefficient equals one. The first weight combination is preset for the first-level feature peak, the second weight combination is preset for the second-level feature peak, and the third weight combination is preset for the third-level feature peak. When the pollutant is a first-level characteristic peak, the comprehensive calibration coefficient is calculated using the first weighted combination. When the pollutant has a secondary characteristic peak, the comprehensive calibration coefficient is calculated using the second weighted combination. When the pollutant has a third-level characteristic peak, the comprehensive calibration coefficient is calculated using the third weight combination.

[0040] Specifically, the overall calibration coefficient = temperature calibration coefficient × first weighting coefficient + turbidity calibration coefficient × second weighting coefficient + pH calibration coefficient × third weighting coefficient, and the sum of the first, second, and third weighting coefficients is 1. The preset weighting combinations are as follows: The first weighted combination corresponding to the primary characteristic peak (high concentration of pollutants): first weighting coefficient (temperature) = 0.2, second weighting coefficient (turbidity) = 0.5, third weighting coefficient (pH value) = 0.3; The second weighted combination corresponding to the secondary characteristic peak (medium concentration pollutant): first weight coefficient = 0.3, second weight coefficient = 0.4, third weight coefficient = 0.3; The third weighted combination corresponding to the third-level characteristic peak (low-concentration pollutant): first weight coefficient = 0.4, second weight coefficient = 0.3, third weight coefficient = 0.3.

[0041] If a pollutant has a first-order characteristic peak, and its temperature calibration coefficient is 1.2, turbidity calibration coefficient is 0.8, and pH calibration coefficient is 1.0, then the comprehensive calibration coefficient = 1.2 × 0.2 + 0.8 × 0.5 + 1.0 × 0.3 = 0.24 + 0.4 + 0.3 = 0.94.

[0042] The above embodiments, by matching differentiated weight combinations to characteristic peaks of different levels, enable the comprehensive calibration coefficient to accurately adapt to the pollutant concentration level, fully integrate the calibration effects of temperature, turbidity, and pH value, improve the pertinence of calibration and the reliability of comprehensive calibration coefficient, provide a more accurate basis for characteristic spectral peak correction, and thus improve the overall accuracy of water quality detection.

[0043] Specifically, when correcting the separated characteristic spectral peaks using comprehensive calibration coefficients, the following steps are included: The corrected characteristic peak area is equal to the uncorrected characteristic peak area multiplied by the overall calibration factor; Preset first-level feature peak correction threshold, second-level feature peak correction threshold, and third-level feature peak correction threshold, wherein the first-level feature peak correction threshold is less than the second-level feature peak correction threshold and less than the third-level feature peak correction threshold; If the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the original characteristic peak is less than or equal to the first-level characteristic peak correction threshold, and the characteristic spectral peak is a first-level characteristic peak, then the correction is deemed effective. If the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the original characteristic peak is less than or equal to the correction threshold for the secondary characteristic peak, then the correction is deemed effective if the characteristic spectral peak is a secondary characteristic peak. If the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the original characteristic peak is less than or equal to the correction threshold of the third-order characteristic peak, then the correction is deemed effective if the characteristic spectral peak is a third-order characteristic peak. When the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the uncorrected characteristic peak is greater than the corresponding correction threshold, regardless of whether the characteristic spectral peak is a first-level, second-level, or third-level characteristic peak, the dynamic weight update mechanism is invoked again. The weight coefficients of the standard spectral library are adjusted based on historical water quality data, and then the comprehensive calibration coefficient is adjusted. The corrected characteristic peak area is then recalculated, and the judgment process is repeated until the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the uncorrected characteristic peak is less than or equal to the corresponding correction threshold, at which point the correction is deemed effective.

[0044] Specifically, the area of ​​characteristic peaks is expressed in relative area units (0-5000), and the corrected characteristic peak area = the area of ​​characteristic peaks before correction × the comprehensive calibration coefficient. The preset correction thresholds are 50 for first-level characteristic peaks, 100 for second-level characteristic peaks, and 150 for third-level characteristic peaks. For example: if the area of ​​a first-level characteristic peak before correction is 2000, the comprehensive calibration coefficient is 1.02, and the area after correction is 2040, the absolute difference is 40 (≤50), and the correction is considered valid; if the area of ​​a second-level characteristic peak before correction is 1000, the comprehensive calibration coefficient is 0.95, and the area after correction is 950, the absolute difference is 50 (≤100), and the correction is considered valid; if the area of ​​a third-level characteristic peak before correction is 500, the comprehensive calibration coefficient is 1.1, and the area after correction is 550, the absolute difference is 50 (≤150), and the correction is considered valid. If the area of ​​a certain characteristic peak before correction is 1500, the comprehensive calibration coefficient is 1.04, the area after correction is 1560, and the absolute value of the difference is 60 (>50), then the dynamic weight update mechanism is called again to adjust the weight coefficient of the standard spectral library, and then the comprehensive calibration coefficient is updated (e.g., adjusted to 1.03). The area after correction is recalculated to be 1545, and the absolute value of the difference is 45 (≤50), and the correction is deemed effective.

[0045] The above embodiments, by setting graded correction thresholds and combining them with a dynamic weight update mechanism, can ensure the rationality and effectiveness of corrections for characteristic peaks at different levels, and avoid over- or under-correction through cyclic adjustment. This significantly improves the accuracy and reliability of characteristic spectral peak corrections, laying a solid foundation for the accuracy of subsequent water quality data.

[0046] Specifically, when applying an anti-corrosion coating to the surface of the sensor probe and performing periodic physical cleaning, the following steps are included: A preset standard range for coating thickness is defined. When the coating thickness is detected to be less than the minimum value of the standard range, coating generation is initiated. Preset cleaning trigger threshold: Physical cleaning is initiated immediately when the reflectivity exceeds the set value or the fluctuation value of the detection signal exceeds the set fluctuation value; After cleaning, the light transmittance of the probe is tested. When the light transmittance is greater than or equal to the standard light transmittance, the cleaning is deemed qualified. When the light transmittance is less than the standard light transmittance, the cleaning time is extended to 1.5 times the original time before retesting.

[0047] Specifically, the preset standard range of the coating thickness is 50 - 100 μm. When the detected coating thickness is 45 μm (less than 50 μm), the coating generation mechanism is activated to supplement the coating. In the preset cleaning trigger threshold, the set value of the reflectance is 80% and the set value of the detection signal fluctuation is 5%. When the reflectance of the probe reaches 85% or the signal fluctuation value is 6%, physical cleaning is immediately initiated. The standard light transmittance is set to 90%, and the original cleaning duration is 30 seconds. For example: after cleaning, if the detected light transmittance is 92% (≥90%), it is determined that the cleaning is qualified; if the light transmittance after cleaning is 85% (<90%), the cleaning time is extended to 45 seconds (30 seconds × 1.5) and then re-detected until the light transmittance meets the standard.

[0048] Through real-time monitoring and timely supplementation of the coating thickness, the above embodiments ensure the anti-corrosion performance of the probe. Based on the reflectance and signal fluctuation, cleaning is triggered in a timely manner. Combining the mechanism of light transmittance detection and extended cleaning time, the cleaning effect of the probe is ensured, effectively avoiding the interference of stains on the detection signal, improving the stability and accuracy of the sensing data, extending the service life of the probe, and providing hardware guarantee for the continuous and reliable water quality detection.

[0049] Specifically, when compressing the calibrated spectral data with the comprehensive calibration coefficient, it includes: Three compression ratios are preset, which are the first compression ratio, the second compression ratio, and the third compression ratio in ascending order; When the number of primary characteristic peaks is greater than or equal to three, compression is performed using the first compression ratio; When the number of primary characteristic peaks is greater than or equal to one and less than three, compression is performed using the second compression ratio; When the number of primary characteristic peaks is zero, compression is performed using the third compression ratio; When the deviation between the data check value after compression and the original data check value is less than or equal to the set compression deviation value, the compression is determined to be effective.

[0050] Specifically, the first compression ratio is preset as 1:2 (the least compression degree), the second compression ratio is 1:5, and the third compression ratio is 1:10 (the greatest compression degree); the set compression deviation value is 5%. For example: when it is detected that the number of primary characteristic peaks (high-concentration pollutants) is 4 (≥3), compression is performed using 1:2; when the number is 2 (≥1 and <3), compression is performed using 1:5; when the number is 0, compression is performed using 1:10. After compression, calculate the data check value (such as the hash value deviation rate). If the deviation is 3% (≤5%), the compression is determined to be effective; if the deviation is 6% (>5%), then re-compress according to the original compression ratio until the deviation meets the requirements.

[0051] The above embodiments dynamically select the compression ratio based on the number of primary characteristic peaks, retaining more data details when there are many high-concentration pollutants and efficiently compressing to save resources when there are fewer. Combined with compression deviation verification to ensure data accuracy, this not only improves data transmission efficiency but also ensures the integrity and reliability of key water quality information.

[0052] Reference Figure 3 In another preferred embodiment based on the above embodiments, this embodiment provides a swimming pool water quality detection system based on optical sensing, comprising: The optical signal acquisition module is used to control the flow of water samples in the channel and simultaneously acquire optical signals of water samples in the ultraviolet to near-infrared bands, as well as water temperature, turbidity, and pH value data through sensors. The spectral processing module is used to process optical signals, extract dark current baseline values ​​and eliminate baseline drift, and use partial least squares algorithm to compare the measured spectrum with the standard spectral library to separate the characteristic spectral peaks corresponding to each pollutant. The spectral processing module generates corresponding calibration coefficients based on water temperature, turbidity, and pH data, and merges these calibration coefficients to obtain a comprehensive calibration coefficient. The comprehensive calibration coefficient is then used to correct the separated characteristic spectral peaks to obtain calibrated spectral data. The cleaning and maintenance module is used to apply an anti-corrosion coating to the surface of the sensor probe and perform periodic physical cleaning. The data processing module is used to compress the calibrated spectral data and the comprehensive calibration coefficients and then transmit them externally.

[0053] It is understandable that the above-mentioned optical sensing-based swimming pool water quality detection method and system have the same beneficial effects, and will not be elaborated further here.

[0054] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program goods. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program goods embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0055] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program goods according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0056] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0057] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0058] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for detecting swimming pool water quality based on optical sensing, characterized in that, include: The flow of water samples is controlled within the channel, and optical signals, water temperature, turbidity, and pH data of the water samples in the ultraviolet to near-infrared bands are collected simultaneously through sensors. The optical signal is processed to extract the dark current baseline value and eliminate baseline drift. The partial least squares algorithm is used to compare the measured spectrum with the standard spectral library to separate the characteristic spectral peaks corresponding to each pollutant. Based on water temperature, turbidity, and pH data, corresponding calibration coefficients are generated, and these calibration coefficients are fused to obtain a comprehensive calibration coefficient. The comprehensive calibration coefficient is then used to correct the separated characteristic spectral peaks to obtain calibrated spectral data. An anti-corrosion coating is applied to the surface of the sensor probe, and periodic physical cleaning is performed. The calibrated spectral data and comprehensive calibration coefficients are compressed and transmitted externally. In particular, when using the partial least squares algorithm for comparison, the matching degree between the spectrum and the standard spectral library is monitored in real time, and the preset standard matching degree is: When the matching degree is greater than or equal to the standard matching degree, the separated characteristic spectral peaks are directly output; When the matching degree is less than the standard matching degree, the dynamic weight update mechanism is invoked to correct the weight coefficients of the standard spectral library based on historical water quality data. After correction, the comparison and separation are performed again until the matching degree is greater than or equal to the standard matching degree.

2. The swimming pool water quality detection method based on optical sensing according to claim 1, characterized in that, When compressing the calibrated spectral data and the comprehensive calibration coefficients and transmitting them externally, the process also includes: Obtain the swimming pool's geographical location and operation type information, determine the corresponding water quality standard type for the region based on the geographical location information, and determine the priority ranking of water quality parameters based on the operation type information; Based on the determined water quality standard type, the compressed spectral data and comprehensive calibration coefficients are converted into a data format that conforms to the standard type. Then, the converted data is reorganized according to the priority of the water quality parameters to obtain the adapted transmission data. According to the preset transmission cycle, the adapted transmission data is sent to the corresponding monitoring platform and swimming pool operation terminal.

3. The swimming pool water quality detection method based on optical sensing according to claim 2, characterized in that, When invoking the dynamic weight update mechanism to correct the weight coefficients of the standard spectral library based on historical water quality data, the following is included: A database of water quality parameter changes is established based on historical monitoring data, from which historical spectral matching records and corresponding weight adjustment records with the same type of current water sample are extracted. The similarity between the current measured spectrum and the historical spectrum is calculated to obtain the spectral similarity, and a preset standard spectral similarity is used. Compare the spectral similarity with the standard spectral similarity: When the spectral similarity is within the allowable range of the standard spectral similarity, the coefficients in the corresponding historical weight adjustment records are directly used as the correction weight coefficients for the current standard spectral library. When the spectral similarity is outside the allowable range of the standard spectral similarity, the coefficients in the corresponding historical weight adjustment records are scaled and adjusted according to the difference between the spectral similarity and the standard spectral similarity, and then used as the correction weight coefficients for the current standard spectral library.

4. The swimming pool water quality detection method based on optical sensing according to claim 3, characterized in that, When using the partial least squares algorithm to compare the measured spectra with the standard spectral library and separate the characteristic spectral peaks corresponding to each pollutant, the following steps are taken: Obtain the light intensity values ​​at each wavelength point in the measured spectrum, and extract the characteristic wavelengths of 12 common swimming pool pollutants from the standard spectral library; A first characteristic peak intensity threshold, a second characteristic peak intensity threshold, and a third characteristic peak intensity threshold are preset, and the first characteristic peak intensity threshold is less than the second characteristic peak intensity threshold and less than the third characteristic peak intensity threshold; When the light intensity value of the measured spectrum at a certain characteristic wavelength is greater than or equal to the intensity threshold of the third characteristic peak, the pollutant corresponding to that wavelength is determined to be a high-concentration pollutant and marked as a first-level characteristic peak; When the light intensity value of the measured spectrum at a certain characteristic wavelength is greater than or equal to the intensity threshold of the second characteristic peak and less than the intensity threshold of the third characteristic peak, the pollutant corresponding to that wavelength is determined to be a medium-concentration pollutant and marked as a secondary characteristic peak. When the light intensity value of the measured spectrum at a certain characteristic wavelength is greater than or equal to the first characteristic peak intensity threshold and less than the second characteristic peak intensity threshold, the pollutant corresponding to that wavelength is determined to be a low-concentration pollutant and marked as a third-level characteristic peak. When the light intensity value of the measured spectrum at a certain characteristic wavelength is less than the intensity threshold of the first characteristic peak, it is determined that the pollutant corresponding to that wavelength is not detected.

5. The swimming pool water quality detection method based on optical sensing according to claim 4, characterized in that, When generating corresponding calibration coefficients based on water temperature, turbidity, and pH data, the following is included: The first water temperature calibration range, the second water temperature calibration range, and the third water temperature calibration range are preset, and the corresponding temperature calibration coefficients are arranged in ascending order as the first temperature calibration coefficient, the second temperature calibration coefficient, and the third temperature calibration coefficient; The first turbidity calibration interval, the second turbidity calibration interval, and the third turbidity calibration interval are preset, and the corresponding turbidity calibration coefficients are arranged in ascending order as the first turbidity calibration coefficient, the second turbidity calibration coefficient, and the third turbidity calibration coefficient; Preset a first pH calibration range, a second pH calibration range, and a third pH calibration range. The corresponding pH calibration coefficients are arranged in ascending order as the first pH calibration coefficient, the second pH calibration coefficient, and the third pH calibration coefficient. When the water temperature falls within the first water temperature calibration range, the first temperature calibration coefficient is selected as the temperature calibration coefficient; when the water temperature falls within the second water temperature calibration range, the second temperature calibration coefficient is selected as the temperature calibration coefficient; when the water temperature falls within the third water temperature calibration range, the third temperature calibration coefficient is selected as the temperature calibration coefficient. When the turbidity falls within the first turbidity calibration range, the first turbidity calibration coefficient is selected as the turbidity calibration coefficient; when the turbidity falls within the second turbidity calibration range, the second turbidity calibration coefficient is selected as the turbidity calibration coefficient; when the turbidity falls within the third turbidity calibration range, the third turbidity calibration coefficient is selected as the turbidity calibration coefficient. When the pH value falls within the first pH calibration range, the first pH calibration coefficient is used as the pH calibration coefficient; when the pH value falls within the second pH calibration range, the second pH calibration coefficient is used as the pH calibration coefficient; when the pH value falls within the third pH calibration range, the third pH calibration coefficient is used as the pH calibration coefficient.

6. The swimming pool water quality detection method based on optical sensing according to claim 5, characterized in that, When fusing calibration coefficients to obtain a comprehensive calibration coefficient, the following is included: The overall calibration coefficient is equal to the temperature calibration coefficient multiplied by the first weighting coefficient, plus the turbidity calibration coefficient multiplied by the second weighting coefficient, plus the pH calibration coefficient multiplied by the third weighting coefficient, where the sum of the first weighting coefficient, the second weighting coefficient, and the third weighting coefficient equals one. The first weight combination is preset for the first-level feature peak, the second weight combination is preset for the second-level feature peak, and the third weight combination is preset for the third-level feature peak. When the pollutant is a first-level characteristic peak, the comprehensive calibration coefficient is calculated using the first weighted combination. When the pollutant has a secondary characteristic peak, the comprehensive calibration coefficient is calculated using the second weighted combination. When the pollutant has a third-level characteristic peak, the comprehensive calibration coefficient is calculated using the third weight combination.

7. The swimming pool water quality detection method based on optical sensing according to claim 6, characterized in that, When correcting the separated characteristic spectral peaks using comprehensive calibration coefficients, the following is included: The corrected characteristic peak area is equal to the uncorrected characteristic peak area multiplied by the overall calibration factor; Preset first-level feature peak correction threshold, second-level feature peak correction threshold, and third-level feature peak correction threshold, wherein the first-level feature peak correction threshold is less than the second-level feature peak correction threshold and less than the third-level feature peak correction threshold; If the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the original characteristic peak is less than or equal to the first-level characteristic peak correction threshold, and the characteristic spectral peak is a first-level characteristic peak, then the correction is deemed effective. If the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the original characteristic peak is less than or equal to the correction threshold for the secondary characteristic peak, then the correction is deemed effective if the characteristic spectral peak is a secondary characteristic peak. If the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the original characteristic peak is less than or equal to the correction threshold of the third-order characteristic peak, then the correction is deemed effective if the characteristic spectral peak is a third-order characteristic peak. When the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the uncorrected characteristic peak is greater than the corresponding correction threshold, regardless of whether the characteristic spectral peak is a first-level, second-level, or third-level characteristic peak, the dynamic weight update mechanism is invoked again. The weight coefficients of the standard spectral library are adjusted based on historical water quality data, and then the comprehensive calibration coefficient is adjusted. The corrected characteristic peak area is then recalculated, and the judgment process is repeated until the absolute value of the difference between the area of ​​the corrected characteristic peak and the area of ​​the uncorrected characteristic peak is less than or equal to the corresponding correction threshold, at which point the correction is deemed effective.

8. The swimming pool water quality detection method based on optical sensing according to claim 7, characterized in that, When applying an anti-corrosion coating to the surface of the sensor probe and performing periodic physical cleaning, the following steps are included: A preset standard range for coating thickness is defined. When the coating thickness is detected to be less than the minimum value of the standard range, coating generation is initiated. Preset cleaning trigger threshold: Physical cleaning is initiated immediately when the reflectivity exceeds the set value or the fluctuation value of the detection signal exceeds the set fluctuation value; After cleaning, the light transmittance of the probe is tested. When the light transmittance is greater than or equal to the standard light transmittance, the cleaning is deemed qualified. When the light transmittance is less than the standard light transmittance, the cleaning time is extended to 1.5 times the original time before retesting.

9. The swimming pool water quality detection method based on optical sensing according to claim 8, characterized in that, When compressing the calibrated spectral data and the comprehensive calibration coefficients, the following steps are included: Three compression ratios are preset, listed in ascending order as the first compression ratio, the second compression ratio, and the third compression ratio; When the number of primary characteristic peaks is greater than or equal to three, the first compression ratio is used for compression. When the number of primary characteristic peaks is greater than or equal to one and less than three, the second compression ratio is used for compression. When the number of primary characteristic peaks is zero, compression is performed using the third compression ratio; The compression is considered effective when the deviation between the compressed data verification value and the original data verification value is less than or equal to the set compression deviation value.

10. A swimming pool water quality detection system based on optical sensing, characterized in that, The method for performing the optical sensing-based swimming pool water quality detection method as described in any one of claims 1-9 includes: The optical signal acquisition module is used to control the flow of water samples in the channel and simultaneously acquire optical signals of water samples in the ultraviolet to near-infrared bands, as well as water temperature, turbidity, and pH value data through sensors. The spectral processing module is used to process optical signals, extract dark current baseline values ​​and eliminate baseline drift, and use partial least squares algorithm to compare the measured spectrum with the standard spectral library to separate the characteristic spectral peaks corresponding to each pollutant. The spectral processing module generates corresponding calibration coefficients based on water temperature, turbidity, and pH data, and merges the calibration coefficients to obtain a comprehensive calibration coefficient. The comprehensive calibration coefficient is then used to correct the separated characteristic spectral peaks to obtain calibrated spectral data. The cleaning and maintenance module is used to apply an anti-corrosion coating to the surface of the sensor probe and perform periodic physical cleaning. The data processing module is used to compress the calibrated spectral data and the comprehensive calibration coefficients and then transmit them externally.

Citation Information

Patent Citations

  • Water quality sensing

    CN109923414A

  • Water quality concentration calculation system and method based on neural network and full spectrum absorbance

    CN113484257A

  • Water quality monitoring method and device based on ultraviolet-visible spectroscopy

    CN118362525A

  • Water quality multi-parameter detection method based on ultraviolet-visible absorption spectrum technology

    CN119223907A

  • Water quality monitoring method and system based on hyperspectral image intelligent analysis

    CN119942356A