A water quality monitoring method and system based on full spectrum analysis

By using full spectrum analysis methods in water quality monitoring, machine learning models and optimization processing models for correcting spectral data are trained, which solves the problem of data deviation caused by changes in environmental factors and improves the accuracy and stability of water quality monitoring.

CN118225713BActive Publication Date: 2024-09-13JIANGSU GUOCHUANG ENVIRO PROTECTION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410636275.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2024-09-13
Estimated Expiration
2044-05-22

AI Technical Summary

Technical Problem

Due to changes in environmental factors, the existing spectral technology in water quality monitoring causes deviations between the collected spectral data and the data during training, which reduces the accuracy and stability of the analysis.

Method used

Using a method based on full spectrum analysis, the first machine learning model is trained by collecting reference spectral data and environmental data, and the real-time spectral data is corrected; at the same time, water quality index data is collected to train the second machine learning model, and the spectral data are optimized to improve monitoring. accuracy of results.

Benefits of technology

By correcting spectral data and optimizing processing, the accuracy and stability of water quality monitoring are improved, the impact of changes in environmental factors on the results is reduced, and the accuracy and reliability of model predictions are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118225713B
    Figure CN118225713B
Patent Text Reader

Abstract

The present invention belongs to the technical field of water quality monitoring, and discloses a water quality monitoring method and system based on full spectrum analysis; including: collecting reference spectral data and real-time environmental data, and training two machine learning models; the first machine learning model is used to predict the influence of environmental factors on the spectrum, and the second machine learning model is used to predict water quality parameters; in the monitoring process, the spectral data and environmental data of the water body are collected in real time, and the first model is used to predict the influence of the environment on the spectrum, and the real-time spectral data is corrected; the corrected spectral data is then input into the second model to predict the water quality index value after optimization processing; finally, the predicted water quality index value is compared with a preset threshold value, and an alarm message is sent if the threshold value is exceeded. By collecting reference data to train the machine learning model, the influence of the environment on the spectral data is predicted and corrected, the accuracy of the spectral data is improved, and then the accuracy of water quality monitoring is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of water quality monitoring, and more specifically, to a water quality monitoring method and system based on full spectrum analysis. Background Art

[0002] With the rapid development of industrialization and population growth, water pollution has gradually become a common challenge faced by the world. To meet this challenge, water quality monitoring has become an important means, which can provide real-time data on water quality, types and concentrations of pollutants, and provide a basis for decision-making in environmental protection and water resources management.

[0003] Traditional water quality monitoring methods mainly rely on chemical analysis, which is accurate but complex, costly and time-sensitive. In recent years, spectral analysis technology has been widely used in the field of water quality monitoring. This technology uses the principle of spectroscopy to quickly and accurately obtain a variety of information about water bodies, providing a new way to monitor water quality.

[0004] However, in the existing spectral technology analysis, the spectral data used in the analysis model training stage is often obtained by a spectrometer in a relatively stable environment. However, in actual monitoring, the spectrometer is often in a variable working environment. Due to fluctuations in environmental factors such as temperature, humidity, and light intensity, the performance of the spectrometer will change, thereby affecting the spectral data collected by the spectrometer, resulting in a deviation between the actual spectral data collected and the spectral data collected during model training. This deviation reduces the accuracy, stability, and reliability of spectral analysis, and thus reduces the accuracy of water quality monitoring results. Summary of the invention

[0005] In order to overcome the problem in the prior art that due to the different working environments of the spectrometers, there is a deviation between the spectral data actually collected and the spectral data collected during model training, thereby reducing the accuracy of water quality monitoring results, the present invention proposes a water quality monitoring method based on full spectrum analysis to solve the above problem.

[0006] The present invention provides the following technical solutions:

[0007] A water quality monitoring method based on full spectrum analysis, comprising:

[0008] Collecting reference spectral data and corresponding reference environmental data;

[0009] Training a first machine learning model that predicts impact spectral data based on the reference spectral data and the corresponding reference environmental data;

[0010] Collecting experimental spectral data and a corresponding water quality index set, wherein the water quality index set includes N water quality indexes and N water quality values ​​corresponding to the N water quality indexes;

[0011] Optimizing the experimental spectral data, and recording the optimized experimental spectral data as optimized data;

[0012] Based on the optimized data and the corresponding water quality indicator set, a second machine learning model for predicting the water quality indicator set is trained;

[0013] Collect real-time spectral data of monitored water bodies and collect real-time environmental data at the same time;

[0014] Inputting the real-time environmental data into the trained first machine learning model to obtain the impact spectrum data, and correcting the real-time spectrum data according to the obtained impact spectrum data to obtain the corrected spectrum data;

[0015] Optimizing the corrected spectral data, and inputting the optimized corrected spectral data into a second machine learning model to obtain a water quality index set;

[0016] The N water quality indicators and the N corresponding water quality values ​​in the water quality indicator set are output. At the same time, according to the N thresholds corresponding to the preset N water quality indicators, if the water quality value of any water quality indicator exceeds the corresponding threshold, an alarm message is sent.

[0017] By collecting reference spectral data and corresponding reference environmental data, a first machine learning model is trained, which can predict the impact of environmental factor changes on spectral data. During the monitoring process, the model is used to correct the real-time spectral data to reduce the impact of environmental factor changes on spectral data, thereby improving the accuracy of the data.

[0018] Preferably, the reference environmental data includes temperature data, humidity data and light intensity data; the reference spectral data is an absorption spectrum of pure water collected by a spectrometer, and the temperature data, humidity data and light intensity data are obtained by corresponding sensors arranged at the spectrometer.

[0019] Preferably, the training method of the first machine learning model includes:

[0020] Preset standard values ​​for temperature data, humidity data, and light intensity data;

[0021] Select any reference environment data whose temperature data, humidity data and light intensity are equal to the corresponding standard values ​​as the standard reference environment, and use the reference spectrum data corresponding to the standard reference environment as the standard reference spectrum data;

[0022] Subtracting the standard reference spectrum data from the reference spectrum data to obtain corresponding difference spectrum data, and recording the difference spectrum data as the corresponding impact spectrum data;

[0023] Using reference environmental data and corresponding impact spectrum data as sample sets;

[0024] The reference environmental data will be used to construct the feature vector G; use keras to define the input layer and output layer and build a machine learning framework; the feature vector G is used as the input layer data, and the impact spectrum data is used as the output layer data;

[0025] The sample set is divided into a training set and a test set, a first machine learning model is constructed, the first machine learning model is trained to obtain an initial first machine learning model, the initial first machine learning model is tested using the test set, and the initial first machine learning model that meets the preset accuracy is output, wherein the machine learning model is one of a logistic regression model, a naive Bayes model or a neural network model.

[0026] Preferably, the reference spectral data is an absorption spectrum of a prepared solution collected by a spectrometer under a standard reference environment, the prepared solution is manually prepared, and the water quality value is a value of a water quality index corresponding to the prepared solution.

[0027] Preferably, the optimization process includes:

[0028] Acquire spectral data, and according to the wavelength range covered by the spectral data, take each integer wavelength and the corresponding absorbance as a data point to obtain a data point set US;

[0029] All data points in the data set US are replaced in turn, and the smooth spectrum number is obtained according to the replaced data set US;

[0030] Take the first-order derivative of the smooth spectral data graph to obtain the optimized data.

[0031] Preferably, the replacement operation includes:

[0032] Get the data points in the data set US and record them as ,in represents the wavelength of the data point, Indicates the absorbance corresponding to the wavelength;

[0033] Get Position in the dataset US ;

[0034] Get the pth to qth elements in the data set US to form a fitting set UN. The values ​​of p and q are obtained by the following formula:

[0035]

[0036] in is the preset window value, and is an odd number;

[0037] Use the data in the fitting set UN to perform a trinomial fit and obtain the fitting function ;

[0038] use Replace the value of middle The value of Represents the fitting function exist The value at .

[0039] Preferably, the training method of the second machine learning model includes:

[0040] Use the optimized data and the corresponding water quality indicator set as the sample set;

[0041] Construct the feature vector H from the optimized data; use keras to define the input layer and output layer and build a machine learning framework; the feature vector H is used as the input layer data, and the water quality index set is used as the output layer data;

[0042] The sample set is divided into a training set and a test set, a first machine learning model is constructed, the first machine learning model is trained to obtain an initial first machine learning model, the initial first machine learning model is tested using the test set, and the initial first machine learning model that meets the preset accuracy is output, wherein the machine learning model is one of a logistic regression model, a naive Bayes model or a neural network model.

[0043] Preferably, the real-time spectral data is the absorption spectrum of the water body in the monitored water area collected by a spectrometer arranged at the monitored water area, and the real-time environmental data is the corresponding data collected by a temperature sensor, a humidity sensor and a light intensity sensor arranged at the spectrometer.

[0044] Preferably, the corrected spectral data is obtained by subtracting the influencing spectral data from the real-time spectral data to obtain corresponding difference spectral data, and recording the difference spectral data as the corrected spectral data.

[0045] Preferably, the present invention further provides a water quality monitoring system based on full spectrum analysis, which is used to implement a water quality monitoring method based on full spectrum analysis, and the system comprises:

[0046] A first acquisition module, used for acquiring reference spectrum data and corresponding reference environment data;

[0047] A first machine learning module is used to train a first machine learning model for predicting the influence of the spectral data based on the reference spectral data and the corresponding reference environmental data;

[0048] A second acquisition module is used to acquire experimental spectral data and a corresponding water quality index set, wherein the water quality index set includes N water quality indexes and N water quality values ​​corresponding to the N water quality indexes;

[0049] An optimization module is used to optimize the experimental spectrum data, record the optimized experimental spectrum data as optimized data, and optimize the corrected spectrum data;

[0050] A second machine learning module, which trains a second machine learning model for predicting a water quality indicator set based on the optimized data and the corresponding water quality indicator set;

[0051] The third acquisition module is used to collect real-time spectral data of monitored water bodies and real-time environmental data;

[0052] A spectrum correction module, used for inputting the real-time environmental data into the trained first machine learning model to obtain the influence spectrum data, and correcting the real-time spectrum data according to the obtained influence spectrum data to obtain the corrected spectrum data;

[0053] A water quality index acquisition module, used for inputting the optimized corrected spectral data into a second machine learning model to obtain a water quality index set;

[0054] The output alarm module is used to output the N water quality indicators and the N corresponding water quality values ​​in the water quality indicator set, and at the same time, according to the N thresholds corresponding to the preset N water quality indicators, if the water quality value of any water quality indicator exceeds the corresponding threshold, an alarm message is sent.

[0055] The present invention provides a water quality monitoring method and system based on full spectrum analysis, which has the following beneficial effects:

[0056] 1. By collecting reference spectral data and corresponding reference environmental data, a first machine learning model is trained, which can predict the impact of changes in environmental factors on spectral data. During the monitoring process, the model is used to correct real-time spectral data to reduce the impact of changes in environmental factors on spectral data, thereby improving the accuracy of the data. By collecting experimental spectral data and the corresponding water quality index set, a second machine learning model is trained, which can predict water quality index values. During the monitoring process, the corrected spectral data is input into the second machine learning model to obtain more accurate water quality index values, thereby improving the accuracy of water quality monitoring;

[0057] 2. By optimizing the experimental spectral data, the influence of baseline drift is reduced, and the degree of change of the spectral data is amplified. This optimization process enhances the characteristic performance of the spectral data, making the optimized data characteristics more significant. When these optimized data are used as the input of the second machine learning model, the accuracy and stability of the model prediction are enhanced. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 The present invention is a schematic flow chart of a water quality monitoring method based on full spectrum analysis.

[0059] Figure 2 The present invention is a schematic diagram of an optimized processing flow of a water quality monitoring method based on full spectrum analysis.

[0060] Figure 3 The module schematic diagram of a water quality monitoring system based on full spectrum analysis of the present invention. DETAILED DESCRIPTION

[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] Example 1, please refer to Figure 1 As shown, the water quality monitoring method based on full spectrum analysis described in this embodiment includes:

[0063] S10, collecting reference spectrum data and corresponding reference environment data;

[0064] It should be noted that the data collected by the spectrometer used in this embodiment are all spectral data in the 200-800nm ​​band.

[0065] The reference environmental data includes temperature data, humidity data and light intensity data; the reference spectral data is the absorption spectrum of pure water collected by a spectrometer, and the temperature data, humidity data and light intensity data are obtained by corresponding sensors arranged at the spectrometer.

[0066] In this embodiment, the reference spectral data can be the absorption spectrum of pure water obtained in an artificially arranged experimental environment using an existing spectrometer. The reference environmental data is used to reflect the working environment of the spectrometer, where the spectrometer under different temperatures, humidity and light intensities will collect different spectral data for the same object.

[0067] S20, training a first machine learning model that predicts the impact on the spectral data based on the reference spectral data and the corresponding reference environmental data;

[0068] Preset standard values ​​for temperature data, humidity data, and light intensity data;

[0069] Select any reference environment data whose temperature data, humidity data and light intensity are equal to the corresponding standard values ​​as the standard reference environment, and use the reference spectrum data corresponding to the standard reference environment as the standard reference spectrum data;

[0070] Subtracting the standard reference spectrum data from the reference spectrum data to obtain corresponding difference spectrum data, and recording the difference spectrum data as the corresponding impact spectrum data;

[0071] It should be noted that subtracting the standard reference spectrum data from the reference spectrum means using the absorbance corresponding to the wavelength in the reference spectrum minus the absorbance corresponding to the same wavelength in the standard reference spectrum data.

[0072] Using reference environmental data and corresponding impact spectrum data as sample sets;

[0073] The reference environmental data will be used to construct the feature vector G; use keras to define the input layer and output layer and build a machine learning framework; the feature vector G is used as the input layer data, and the impact spectrum data is used as the output layer data;

[0074] The sample set is divided into a training set and a test set, a first machine learning model is constructed, the first machine learning model is trained to obtain an initial first machine learning model, the initial first machine learning model is tested using the test set, and the initial first machine learning model that meets the preset accuracy is output.

[0075] In this embodiment, we set the standard value of temperature data to 25 degrees, the standard value of humidity data to 40%, and the standard value of light intensity data to 10,000 lux. When all environmental data reach the standard value, the pure water absorption spectrum collected by the spectrometer can be used as a standard reference spectrum. By calculating the difference between the pure water absorption spectrum collected by the spectrometer under different environmental data and the standard reference spectrum, we can correct the absorption spectrum under non-standard environmental data to the spectrum when all environmental data reach the standard value. This method can provide more accurate spectral data to improve the accuracy of subsequent analysis.

[0076] In this embodiment, the first machine learning model includes but is not limited to a convolutional neural network model, a support vector machine model, and a logistic regression model.

[0077] S30, collecting experimental spectral data and a corresponding water quality index set, wherein the water quality index set includes N water quality indexes and N water quality values ​​corresponding to the N water quality indexes;

[0078] The reference spectral data is the absorption spectrum of the prepared solution collected by a spectrometer under a standard reference environment. The prepared solution is manually prepared, and the water quality value is the value of the water quality index corresponding to the prepared solution.

[0079] In this embodiment, spectral data of multiple prepared solutions are collected, and the environment in which the spectrometer is located is arranged to be the same as the standard environmental data. The water quality indicators in the water quality index set in this embodiment include, but are not limited to, turbidity, chemical oxygen demand, total organic carbon, ammonia nitrogen, and total phosphorus. The prepared solution is a combination of water quality indicators. It should be noted that the water quality value corresponding to the water quality indicator can be zero, indicating that no substance related to the corresponding water quality indicator was added during configuration.

[0080] S40, optimizing the experimental spectrum data, and recording the optimized experimental spectrum data as optimized data;

[0081] See also Figure 2 , the optimization process includes:

[0082] S41, acquiring spectral data, taking each integer wavelength and the corresponding absorbance as a data point according to the wavelength range covered by the spectral data, and obtaining a data point set US;

[0083] S42, performing a replacement operation on all data points in the data set US in sequence, and obtaining a smooth spectrum number according to the replaced data set US;

[0084] The replacement operation includes:

[0085] Get the data points in the data set US and record them as ,in represents the wavelength of the data point, Indicates the absorbance corresponding to the wavelength;

[0086] Get Position in the dataset US ;

[0087] Get the pth to qth elements in the data set US to form a fitting set UN. The values ​​of p and q are obtained by the following formula:

[0088]

[0089] in is the preset window value, and is an odd number;

[0090] Use the data in the fitting set UN to perform a trinomial fit and obtain the fitting function ;

[0091] use Replace the value of middle The value of Represents the fitting function exist The value at .

[0092] S43, taking a first-order derivative of the smoothed spectral data graph to obtain optimized data.

[0093] In this example, the optimization operation is used to optimize the experimental spectral data, which reduces the impact of baseline drift and amplifies the degree of change of the experimental spectral data. That is, the optimized data has greater characteristics. When the optimized data is used as the input of the second machine learning model, better model performance can be obtained.

[0094] S50, training a second machine learning model for predicting the water quality indicator set based on the optimized data and the corresponding water quality indicator set;

[0095] The training method of the second machine learning model includes:

[0096] Use the optimized data and the corresponding water quality indicator set as the sample set;

[0097] Construct the feature vector H from the optimized data; use keras to define the input layer and output layer and build a machine learning framework; the feature vector H is used as the input layer data, and the water quality index set is used as the output layer data;

[0098] The sample set is divided into a training set and a test set, a second machine learning model is constructed, the second machine learning model is trained to obtain an initial second machine learning model, the initial second machine learning model is tested using the test set, and an initial second machine learning model that meets a preset accuracy is output.

[0099] In this embodiment, the second machine learning model includes but is not limited to a convolutional neural network model, a support vector machine model, and a logistic regression model.

[0100] S60, collecting real-time spectral data of the monitored water body and simultaneously collecting real-time environmental data;

[0101] The real-time spectral data is the absorption spectrum of the water body in the monitored water area collected by a spectrometer set at the monitored water area, and the real-time environmental data is the corresponding data collected by a temperature sensor, a humidity sensor and a light intensity sensor set at the spectrometer.

[0102] S70, inputting the real-time environmental data into the trained first machine learning model to obtain the impact spectrum data, and correcting the real-time spectrum data according to the obtained impact spectrum data to obtain the corrected spectrum data;

[0103] The corrected spectral data is obtained by subtracting the influencing spectral data from the real-time spectral data to obtain corresponding difference spectral data, and recording the difference spectral data as the corrected spectral data.

[0104] It should be noted that subtracting the affected spectrum data from the real-time spectrum data is to use the absorbance corresponding to the wavelength in the real-time spectrum data minus the absorbance corresponding to the same wavelength in the affected spectrum data.

[0105] S80, optimizing the corrected spectral data, and inputting the optimized corrected spectral data into a second machine learning model to obtain a water quality index set.

[0106] S90, outputting the N water quality indicators and the N corresponding water quality values ​​in the water quality indicator set, and at the same time, according to the N thresholds corresponding to the preset N water quality indicators, if the water quality value of any water quality indicator exceeds the corresponding threshold, sending an alarm message.

[0107] By collecting reference spectral data and corresponding reference environmental data, a first machine learning model is trained, which can predict the impact of changes in environmental factors on spectral data. During the monitoring process, the model is used to correct the real-time spectral data to reduce the impact of changes in environmental factors on the spectral data, thereby improving the accuracy of the data. By collecting experimental spectral data and the corresponding water quality index set, a second machine learning model is trained, which can predict water quality index values. During the monitoring process, the corrected spectral data is input into the second machine learning model to obtain more accurate water quality index values, thereby improving the accuracy of water quality monitoring.

[0108] Example 2, please refer to Figure 3 The present invention provides a water quality monitoring system based on full spectrum analysis, which is used to implement a water quality monitoring method based on full spectrum analysis, including:

[0109] A first acquisition module, used for acquiring reference spectrum data and corresponding reference environment data;

[0110] A first machine learning module is used to train a first machine learning model for predicting the influence of the spectral data based on the reference spectral data and the corresponding reference environmental data;

[0111] A second acquisition module is used to acquire experimental spectral data and a corresponding water quality index set, wherein the water quality index set includes N water quality indexes and N water quality values ​​corresponding to the N water quality indexes;

[0112] An optimization module is used to optimize the experimental spectrum data, record the optimized experimental spectrum data as optimized data, and optimize the corrected spectrum data;

[0113] A second machine learning module, which trains a second machine learning model for predicting a water quality indicator set based on the optimized data and the corresponding water quality indicator set;

[0114] The third acquisition module is used to collect real-time spectral data of monitored water bodies and real-time environmental data;

[0115] A spectrum correction module, used for inputting the real-time environmental data into the trained first machine learning model to obtain the influence spectrum data, and correcting the real-time spectrum data according to the obtained influence spectrum data to obtain the corrected spectrum data;

[0116] A water quality index acquisition module, used for inputting the optimized corrected spectral data into a second machine learning model to obtain a water quality index set;

[0117] The output alarm module is used to output the N water quality indicators and the N corresponding water quality values ​​in the water quality indicator set, and at the same time, according to the preset N thresholds corresponding to the N water quality indicators, if the water quality value of any water quality indicator exceeds the corresponding threshold, an alarm message is sent. Each module is connected by wired and / or wireless means to realize data transmission between modules.

[0118] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0119] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only one, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0120] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0121] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A water quality monitoring method based on full spectrum analysis, It is characterized in that include: Collecting reference spectral data and corresponding reference environmental data; Training a first machine learning model that predicts impact spectral data based on the reference spectral data and the corresponding reference environmental data; Collecting experimental spectral data and a corresponding water quality index set, wherein the water quality index set includes N water quality indexes and N water quality values ​​corresponding to the N water quality indexes; Optimizing the experimental spectral data, and recording the optimized experimental spectral data as optimized data; Based on the optimized data and the corresponding water quality indicator set, a second machine learning model for predicting the water quality indicator set is trained; Collect real-time spectral data of monitored water bodies and collect real-time environmental data at the same time; Inputting the real-time environmental data into the trained first machine learning model to obtain the impact spectrum data, and correcting the real-time spectrum data according to the obtained impact spectrum data to obtain the corrected spectrum data; Optimizing the corrected spectral data, and inputting the optimized corrected spectral data into a second machine learning model to obtain a water quality index set; Output the N water quality indicators and the N corresponding water quality values ​​in the water quality indicator set, and at the same time, according to the N thresholds corresponding to the preset N water quality indicators, if the water quality value of any water quality indicator exceeds the corresponding threshold, an alarm message is sent; The training method of the first machine learning model includes: Preset standard values ​​for temperature data, humidity data, and light intensity data; Select any reference environment data whose temperature data, humidity data and light intensity are equal to the corresponding standard values ​​as the standard reference environment, and use the reference spectrum data corresponding to the standard reference environment as the standard reference spectrum data; Subtracting the standard reference spectrum data from the reference spectrum data to obtain corresponding difference spectrum data, and recording the difference spectrum data as the corresponding impact spectrum data; Using reference environmental data and corresponding impact spectrum data as sample sets; The reference environmental data will be used to construct the feature vector G; use keras to define the input layer and output layer and build a machine learning framework; the feature vector G is used as the input layer data, and the impact spectrum data is used as the output layer data; Divide the sample set into a training set and a test set, construct a first machine learning model, train the first machine learning model to obtain an initial first machine learning model, test the initial first machine learning model using the test set, and output the initial first machine learning model that meets a preset accuracy; The optimization process includes: Acquire spectral data, and according to the wavelength range covered by the spectral data, take each integer wavelength and the corresponding absorbance as a data point to obtain a data point set US; All data points in the data set US are replaced in turn, and the smooth spectrum number is obtained according to the replaced data set US; Take the first-order derivative of the smooth spectrum data graph to obtain the optimized data; The replacement operation includes: Get the data points in the data set US and record them as ,in represents the wavelength of the data point, Indicates the absorbance corresponding to the wavelength; Get Position in the dataset US ; Get the pth to qth elements in the data set US to form a fitting set UN. The values ​​of p and q are obtained by the following formula: , in is the preset window value, and is an odd number; Use the data in the fitting set UN to perform a trinomial fit and obtain the fitting function ; use Replace the value of middle The value of Represents the fitting function exist The value at; The training method of the second machine learning model includes: Use the optimized data and the corresponding water quality indicator set as the sample set; Construct the feature vector H from the optimized data; use keras to define the input layer and output layer and build a machine learning framework; the feature vector H is used as the input layer data, and the water quality index set is used as the output layer data; The sample set is divided into a training set and a test set, a second machine learning model is constructed, the second machine learning model is trained to obtain an initial second machine learning model, the initial second machine learning model is tested using the test set, and an initial second machine learning model that meets a preset accuracy is output.

2. A water quality monitoring method based on full spectrum analysis according to claim 1, It is characterized in that The reference environmental data includes temperature data, humidity data and light intensity data; the reference spectral data is the absorption spectrum of pure water collected by a spectrometer, and the temperature data, humidity data and light intensity data are obtained by corresponding sensors arranged at the spectrometer.

3. A water quality monitoring method based on full spectrum analysis according to claim 2, It is characterized in that The reference spectral data is the absorption spectrum of the prepared solution collected by a spectrometer under a standard reference environment. The prepared solution is manually prepared, and the water quality value is the value of the water quality index corresponding to the prepared solution.

4. A water quality monitoring method based on full spectrum analysis according to claim 1, It is characterized in that The real-time spectral data is the absorption spectrum of the water body in the monitored water area collected by a spectrometer set at the monitored water area, and the real-time environmental data is the corresponding data collected by a temperature sensor, a humidity sensor and a light intensity sensor set at the spectrometer.

5. A water quality monitoring method based on full spectrum analysis according to claim 4, It is characterized in that The corrected spectral data is obtained by subtracting the influencing spectral data from the real-time spectral data to obtain corresponding difference spectral data, and recording the difference spectral data as the corrected spectral data.

6. A water quality monitoring system based on full spectrum analysis, used to implement a water quality monitoring method based on full spectrum analysis as claimed in any one of claims 1 to 5, It is characterized in that include: A first acquisition module, used for acquiring reference spectrum data and corresponding reference environment data; A first machine learning module is used to train a first machine learning model for predicting the influence of the spectral data based on the reference spectral data and the corresponding reference environmental data; A second acquisition module is used to acquire experimental spectral data and a corresponding water quality index set, wherein the water quality index set includes N water quality indexes and N water quality values ​​corresponding to the N water quality indexes; An optimization module is used to optimize the experimental spectrum data, record the optimized experimental spectrum data as optimized data, and optimize the corrected spectrum data; A second machine learning module, which trains a second machine learning model for predicting a water quality indicator set based on the optimized data and the corresponding water quality indicator set; The third acquisition module is used to collect real-time spectral data of monitored water bodies and real-time environmental data; A spectrum correction module, used for inputting the real-time environmental data into the trained first machine learning model to obtain the influence spectrum data, and correcting the real-time spectrum data according to the obtained influence spectrum data to obtain the corrected spectrum data; A water quality index acquisition module, used for inputting the optimized corrected spectral data into a second machine learning model to obtain a water quality index set; The output alarm module is used to output the N water quality indicators and the N corresponding water quality values ​​in the water quality indicator set, and at the same time, according to the N thresholds corresponding to the preset N water quality indicators, if the water quality value of any water quality indicator exceeds the corresponding threshold, an alarm message is sent.