CN117664888B - Water quality monitoring method, device, equipment and medium based on water quality prediction model library - Google Patents

Water quality monitoring method, device, equipment and medium based on water quality prediction model library Download PDF

Info

Publication number
CN117664888B
CN117664888B CN202410130355.6A CN202410130355A CN117664888B CN 117664888 B CN117664888 B CN 117664888B CN 202410130355 A CN202410130355 A CN 202410130355A CN 117664888 B CN117664888 B CN 117664888B
Authority
CN
China
Prior art keywords
water
water quality
data
historical
gene
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410130355.6A
Other languages
Chinese (zh)
Other versions
CN117664888A (en
Inventor
孙悦丽
吉克斌
张萌
常鹏慧
王伟
郭东宸
邹克旭
田启明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yingshi Ruida Technology Co ltd
Original Assignee
Beijing Yingshi Ruida Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Yingshi Ruida Technology Co ltd filed Critical Beijing Yingshi Ruida Technology Co ltd
Priority to CN202410130355.6A priority Critical patent/CN117664888B/en
Publication of CN117664888A publication Critical patent/CN117664888A/en
Application granted granted Critical
Publication of CN117664888B publication Critical patent/CN117664888B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A20/00Water conservation; Efficient water supply; Efficient water use
    • Y02A20/152Water filtration

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a water quality monitoring method, a device, equipment and a medium based on a water quality prediction model library, which relate to the technical field of water quality prediction and comprise the steps of acquiring a plurality of water quality data and corresponding water-based data in a first preset time period of a water sample to be monitored adjacent to a time point to be predicted; determining the water factor type corresponding to each water factor data; setting weight for the water-based factor type corresponding to each time point in the first preset time period, and carrying out weighted summation on the same water-based factor type to obtain a weight score of the water-based factor type of each type; taking the water factor type with the highest weight score as the water factor type with the time point to be measured; searching a water quality prediction model corresponding to the water factor type of the time point to be detected in a water quality prediction model library; and inputting the acquired water quality data into the water quality prediction model to acquire the water quality data of the time point to be detected. According to the scheme, the prediction cost is reduced, and the water quality prediction efficiency and accuracy are improved.

Description

Water quality monitoring method, device, equipment and medium based on water quality prediction model library
Technical Field
The invention relates to the technical field of water quality prediction, in particular to a water quality monitoring method, device, equipment and medium based on a water quality prediction model library.
Background
In order to better manage and protect water resources, it is important to predict water quality. By collecting and analyzing various indexes and data in the water body, the water quality condition and the development trend can be mastered in time, the future water quality change condition can be predicted, and scientific basis is provided for water resource management, pollution control and environment planning. Meanwhile, the water quality prediction can also improve the disaster prevention and reduction effect, guide the reasonable allocation and use of water resources, and promote the continuous utilization of the water resources and the improvement of ecological environment. Therefore, the water quality prediction has important significance for protecting water resources, guaranteeing public health, promoting ecological balance and realizing sustainable development.
At present, two main techniques are adopted for water quality prediction, one is to use a hydrodynamic model for prediction, such as efdc, mike and the like, the modeling flow of the model is complex, the required data amount is large, the calculation complexity is low, and the model is not suitable for real-time prediction; the model has poor robustness, but the final measured value has larger deviation due to the variety and complexity of factors influencing the water quality; the pollution source calculation methods in different areas have great difference, and the prediction model is built by collecting data in a new area.
For water sample monitoring in different areas, the same model is limited in adaptability and accuracy. And a new water quality prediction model needs to be established in a new area, and resampling modeling is needed, so that the workload is high and the cost is high.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a water quality monitoring method based on a water quality prediction model library, which aims to solve the technical problems of poor adaptability and poor accuracy of water sample monitoring in different areas by using the same prediction model in the prior art. The method comprises the following steps:
Acquiring a plurality of water quality data of a water sample to be monitored in a first preset time period adjacent to a time point to be predicted and a plurality of water gene data corresponding to the water quality data, wherein the water gene data are spectrum data of the water sample, and each time point in the first preset time period corresponds to one water quality data and one water gene data;
determining the water factor type corresponding to each water factor data;
Setting weight for the water-based factor type corresponding to each time point in the first preset time period;
carrying out weighted summation on the water-based factor types of the same type in the first preset time period to obtain a weight score of the water-based factor type of each type;
taking the water-based factor type with the highest weight score as the water-based factor type corresponding to the water-based factor of the time point to be predicted;
searching a water quality prediction model corresponding to the water-based factor type corresponding to the water-based factor of the time point to be predicted in a water quality prediction model library;
Inputting a plurality of water quality data of the first preset time period adjacent to the time point to be predicted into the searched water quality prediction model to obtain the water quality data of the water sample to be monitored at the time point to be predicted.
The embodiment of the invention also provides a water quality monitoring device based on the water quality prediction model library, so as to solve the technical problems of poor adaptability and poor accuracy of water sample monitoring in different areas by using the same prediction model in the prior art. The device comprises:
The water quality monitoring system comprises an acquisition module, a prediction module and a prediction module, wherein the acquisition module is used for acquiring a plurality of water quality data of a water sample to be monitored in a first preset time period adjacent to a time point to be predicted and a plurality of water gene data corresponding to the water quality data, the water gene data are spectrum data of the water sample, and each time point in the first preset time period corresponds to one water quality data and one water gene data;
The first water factor type determining module is used for determining the water factor type corresponding to each water factor data;
The weight setting module is used for setting weight for the water-based factor type corresponding to each time point in the first preset time period;
The weight score calculation module is used for carrying out weighted summation on the water-based factor types of the same type in the first preset time period to obtain a weight score of the water-based factor type of each type;
A water gene type second determining module, configured to use the water gene type with the highest weight score as a water gene type corresponding to the water gene data of the time point to be predicted;
the water quality prediction model searching module is used for searching a water quality prediction model corresponding to the water-based factor type corresponding to the water-based factor of the time point to be predicted in the water quality prediction model library;
The water quality prediction module is used for inputting a plurality of water quality data of the first preset time period adjacent to the time point to be predicted into the searched water quality prediction model to obtain the water quality data of the water sample to be monitored at the time point to be predicted.
The embodiment of the invention also provides computer equipment, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes any water quality monitoring method based on a water quality prediction model library when executing the computer program so as to solve the technical problems of poor adaptability and poor accuracy of using the same prediction model for monitoring water samples in different areas in the prior art.
The embodiment of the invention also provides a computer readable storage medium which stores a computer program for executing the water quality monitoring method based on the water quality prediction model library, so as to solve the technical problems of poor adaptability and poor accuracy of using the same prediction model for monitoring water samples in different areas in the prior art.
Compared with the prior art, the beneficial effects that above-mentioned at least one technical scheme that this description embodiment adopted can reach include at least: acquiring a plurality of water quality data of a water sample to be monitored in a first preset time period adjacent to a time point to be predicted and a plurality of water gene data corresponding to the water quality data, wherein the water gene data are spectrum data of the water sample, and each time point in the first preset time period corresponds to one water quality data and one water-based data; determining the water factor type corresponding to each water factor data; setting weight for the water-based factor type corresponding to each time point in the first preset time period; weighting and summing the water-based factor types of the same type in a first preset time period to obtain a weight score of each type of water-based factor type; taking the water-based factor type with the highest weight score as the water-based factor type corresponding to the water-based factor at the time point to be measured; searching a water quality prediction model corresponding to the water-based factor type corresponding to the water-based factor of the time point to be detected in a water quality prediction model library; inputting a plurality of water quality data of a first preset time period adjacent to a time point to be predicted into the searched water quality prediction model to obtain the water quality data of the water sample to be monitored at the time point to be detected. Therefore, the application establishes the water quality prediction model by collecting the water quality data of different areas and different water-based cause types in continuous time, and forms a water quality prediction model library. In an unknown region, according to the water factor type, the water quality is predicted by automatically screening a prediction model in a model library, so that water quality monitoring is realized, a new prediction model is not required to be constructed, the water quality monitoring cost of the new region is greatly reduced on the premise of ensuring calculation accuracy, and the water quality monitoring efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a water quality monitoring method based on a water quality prediction model library provided by an embodiment of the invention;
FIG. 2 is a block diagram of a computer device according to an embodiment of the present invention;
FIG. 3 is a block diagram of a water quality monitoring device based on a water quality prediction model library according to an embodiment of the present invention.
Detailed Description
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Other advantages and effects of the present application will become apparent to those skilled in the art from the following disclosure, which describes the embodiments of the present application with reference to specific examples. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. The application may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present application. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In an embodiment of the present invention, a water quality monitoring method based on a water quality prediction model library is provided, as shown in fig. 1, and the method includes:
Step S101, acquiring a plurality of water quality data of a water sample to be monitored in a first preset time period adjacent to a time point to be predicted and a plurality of water gene data corresponding to the water quality data, wherein the water gene data are spectral data of the water sample, and each time point in the first preset time period corresponds to one water quality data and one water gene data, and the first preset time period is a time period adjacent to the time point to be predicted and positioned before the time point to be predicted;
step S102, determining the water factor type corresponding to each water factor data;
Step S103, weight is set for the water-based factor type corresponding to each time point in the first preset time period;
Step S104, carrying out weighted summation on the water-based types of the same type in the first preset time period to obtain a weight score of the water-based type of each type;
Step S105, taking the water-based factor type with the highest weight score as the water-based factor type corresponding to the water-based factor of the time point to be predicted;
step S106, searching a water quality prediction model corresponding to the water-based factor type corresponding to the water-based factor of the time point to be predicted in a water quality prediction model library;
And step S107, inputting a plurality of water quality data of the first preset time period adjacent to the time point to be predicted into the searched water quality prediction model to obtain the water quality data of the water sample to be monitored at the time point to be predicted.
Therefore, the application establishes the water quality prediction model by collecting the water quality data of different areas and different water-based cause types in continuous time, and forms a water quality prediction model library. In an unknown region, according to the water factor type, the water quality is predicted by automatically screening a prediction model in a model library, a new prediction model is not required to be constructed, the prediction cost of the new region is greatly reduced on the premise of ensuring the calculation accuracy, and the prediction efficiency is improved.
In one embodiment, for the sake of understanding, taking the to-be-predicted time point t of the water sample in the area to be monitored as an example, the first preset time period is 4 hours, then the first 4 hours adjacent to the predicted time point t are t-4, t-3, t-2, t-1 respectively, then the water gene data p= [ p t-4,pt-3,pt-2,pt-1 ], the water quality data x= [ x t-4,xt-3,xt-2,xt-1 ], the water gene data p= [ p t-4,pt-3,pt-2,pt-1 ] are input into the recognition model for recognizing the water-based factor type, and the water-based factor type l= [ l t-4,lt-3,lt-2,lt-1 ] of the first 4 hours of the to-be-predicted time point t is obtained.
Then, weights are set for the water-based type corresponding to each time point within 4 hours, for example, the weights corresponding to [ t-4, t-3, t-2, t-1] are [1,2,3,4], and since the time t-1 is closest to the predicted time point t, the water quality at the time t-1 is closest, the weight value of the water-based type at the time t-1 is set to be maximum, and the weight value of the water-based type at the time t-4 is set to be minimum.
When the weight score is calculated, the water-based factor types at some time are probably the same, and when the weight score is calculated, the same weight of the water-based factor types is summed, for example, l t-4 of the water-based factor type at the time t-4 is the A type, l t-3 of the water-based factor type at the time t-3 is the B type, l t-2 of the water-based factor type at the time t-2 is the B type, and l t-1 of the water-based factor type at the time t-1 is the C type; since the water-based types at the time t-3 and the time t-2 are the same, the water-based types are weighted and summed, the weight at the time t-3 is 2, the weight at the time t-2 is 3, the weight score of the B type is 2+3=5, the weight score of the A type is 1, the weight score of the C type is 4, and when the water-based type of the time point t to be predicted is determined, the water-based type with the highest weight score is selected, namely the water-based type of the time point t to be predicted is B (weight score is 5).
In particular, when calculating the weight score of the water cause type, for example, l t-4 of the water cause type at time t-4 is D type, l t-3 of the water cause type at time t-3 is E type, l t-2 of the water cause type at time t-2 is D type, l t-1 of the water cause type at time t-1 is F type, both of the water gene types at time t-4 and time t-2 are D type, the weight score of the D type is 1+3=4, the weight score of the E type is 2,F is 4, the weight scores of the D type and the F type are the same, and both are the water cause type with the highest weight score, at this time, the water cause type at the time closest to the time point t to be predicted is selected as the water cause type at the time point t to be predicted, i.e., the water cause type at the time point t-1 at the time point to be predicted is F type, since the water quality is closer to the time point to be predicted.
In the specific implementation, when the weight scores of the water-based factor types are calculated, when a plurality of identical weight score highest values appear, the water-based factor type closest to the time point to be predicted is selected from the identical weight score highest values as the water-based factor type of the time point to be predicted.
In one embodiment, the water quality monitoring method based on the water quality prediction model library further comprises:
Acquiring a plurality of historical water quality data of sample water samples in different areas in a historical continuous time period and a plurality of historical water gene data corresponding to the historical water quality data;
Clustering a plurality of historical water gene data based on the spectral characteristics of each historical water gene data to obtain a plurality of historical water gene types;
Aiming at each historical water gene type, training a model by taking the historical water quality data corresponding to each historical water gene type as sample data to obtain a water quality prediction model corresponding to each historical water gene type;
And forming the water quality prediction model library based on the water quality prediction models respectively corresponding to all the historical water-based factor types.
In this embodiment, according to the classified historical water factor types, a water quality prediction model under different historical water factor types is built.
In particular, sample water samples of different regions are collected, the historical water quality data of the historical continuous time period and the historical water gene data corresponding to the historical water quality data are expressed as x [ x1, x2, …, xi, … xm ], the historical water gene data corresponding to the historical water quality data are expressed as p [ p1, p2, …, pi, … pm ], i is the data of the ith moment, the historical water gene data are the spectrum data of the water sample at 200-710nm, and the spectrum data detect a value every 2nm, so each spectrum data is 256 dimensions, namely pi= [ pi200, pi202, …, pij, …, pi710], and j represents the wavelength.
In specific implementation, the historical water quality data are divided into an input x and an output y, the input x and the output y of the historical water quality data of the same historical water base type are respectively input into a plurality of models such as support vector regression, multiple nonlinear regression, xgboost, bp neural network and the like, the calculation results of the models are compared with actual test results, the average relative standard deviation, the fitting goodness and the qualification rate of the models are counted, and the model with the highest comprehensive score is selected as the water quality prediction model under the historical water base type, wherein the calculation of the comprehensive score refers to the following formula:
Composite score = (1-mean of the model mean relative standard deviation/mean of all model mean relative standard deviations) + (1-mean of the model goodness-of-fit/all model goodness-of-fit) + (1-mean of the model yield/all model yield);
Then, training the historical water quality data of each historical water base type in turn to respectively obtain a water quality prediction model corresponding to each historical water base type, and forming a water quality prediction model library.
Therefore, when water sample monitoring is carried out on an unknown region, a water quality prediction model corresponding to the water factor type can be automatically screened in a model library directly according to the water factor type obtained by prediction, and resampling modeling is not needed, so that the water quality monitoring cost of a new region is greatly reduced, and the timeliness and the efficiency of water quality monitoring are improved; and different water quality prediction models are corresponding to different water-based cause types, so that the accuracy of water quality prediction is improved.
In one embodiment, the clustering the plurality of historical water gene data based on the spectral characteristics of each of the historical water gene data to obtain a plurality of historical water gene types includes:
After normalizing each historical water gene data, extracting the spectral characteristics of each historical water gene data;
Constructing a spectrum characteristic matrix based on each historical water gene data and the spectrum characteristic corresponding to each historical water gene data, and obtaining a plurality of spectrum characteristic matrices corresponding to a plurality of historical water-based data one by one;
clustering a plurality of the spectrum feature matrixes, and taking each clustered category as one historical water factor type.
In specific implementation, the historical water gene data p [ p1, p2, …, pi, … pm ] are taken as an example for illustration, and the historical water gene data p [ p1, p2, …, pi, … pm ] are normalized, specifically: one of the historical water gene data pi is selected, the historical water gene data pi is normalized, and the normalized calculation formula is as follows:
Pij=(pij-min(pij))/(max(pij)-min(pij)),
Wherein Pij is a spectral value at a single wavelength normalized by the historical water gene data Pi, i.e., the historical water gene data Pi is expressed as Pi, pi= [ Pi200, pi202, …, pij, …, pi710] normalized by the historical water gene data Pi. The historical water gene data P [ P1, P2, …, pi, … Pm ] are normalized to P [ P1, P2, …, pi, … Pm ], and then the spectral feature matrix is constructed based on the historical water gene data P [ P1, P2, …, pi, … Pm ].
When a spectral feature matrix is constructed, respectively extracting spectral features of each historical water gene data, wherein the spectral features comprise a peak position lambda M, an absorbance value rho M of the peak, an absorption left shoulder position lambda L, an absorption right shoulder position lambda R, an absorbance value rho L of the absorption left shoulder, an absorbance value rho R of the absorption right shoulder and an absorption intensity H of the peak; when a spectral feature matrix is constructed, a historical water gene data Pi and lambda M, rho M, lambda L, lambda R, rho L, rho R and H of the historical water gene data are used as a group of data to construct the spectral feature matrix gi; and clustering the historical water-based data by using a clustering model by taking the spectral feature matrixes g1, g2, …, gi, … and gm corresponding to each historical water-based data as input, and taking one class after clustering as one historical water-based factor type. For example, in this embodiment, n historical water cause types are obtained after clustering m historical water cause data, which are respectively historical water cause type 1, historical water cause type 2, historical water cause type n-1, and historical water cause type n, where n is less than m. In this embodiment, the waveform characteristics of the historical water-based data curve are clustered, and the matrices with similar waveforms are classified into the same type.
In one embodiment, the water quality monitoring method based on the water quality prediction model library further comprises:
And constructing corresponding relations between the plurality of spectral feature matrixes and the plurality of historical water gene types by using an SVM method to form an identification model for identifying the water gene type.
In specific implementation, the corresponding relation between a plurality of spectrum feature matrixes and a plurality of historical water gene types is constructed by utilizing an SVM method, and the step is to construct a water gene type identification model. Specifically, by using an SVM method, a plurality of spectral feature matrixes corresponding to a historical water factor type are used as input sample data of a model, the historical water factor type is used as output sample data of the model, all the historical water factor types and the corresponding spectral feature matrixes are used as sample data of model training to train the model, and a water factor type identification model is obtained. The water-based factor type identification model can be used for identifying the water-based factor type of any new water-based factor for preparing for subsequent water quality prediction.
The SVM (support vector machines, SVM) support vector machine is a two-class model, and the basic idea of the SVM algorithm is to map data into a high-dimensional space and find a hyperplane in the space so that the distance from various data points to the hyperplane is maximum. Specifically, for a given training data set, the SVM determines the best decision boundary by calculating the distance between each sample point and the hyperplane. In order to avoid overfitting and improve generalization performance, the SVM also introduces a kernel function, which can map linear inseparable data into a high-dimensional space, thereby realizing nonlinear classification.
The SVM method mainly comprises the following steps:
(1) Data preprocessing: the method comprises the steps of data cleaning, feature extraction, feature scaling and the like;
(2) Feature mapping: mapping data into a high-dimensional space using a kernel function;
(3) Calculating a hyperplane: searching a hyperplane in the high-dimensional space, so that the distance from each data point to the hyperplane is the largest;
(4) And (3) predicting: the new samples are classified using the learned model.
In one embodiment, the training the model by using the historical water quality data corresponding to each historical water gene type as sample data includes:
Each time point in the continuous time period corresponds to one piece of historical water quality data, the historical water quality data of a second preset time period before the time point is taken as one piece of input data of a model to be trained for each time point, the historical water quality data of the time point is taken as one piece of output data of the model to be trained, and the one piece of input data and the one piece of output data form sample data of the historical water quality data of the time point;
obtaining sample data of historical water quality data at all time points in the historical continuous time period;
Dividing the sample data of the historical water quality data at all time points into a plurality of groups of sample data based on each historical water gene type, wherein one historical water gene type corresponds to one group of sample data;
and inputting each group of sample data into a plurality of models to be trained for training, and obtaining a water quality prediction model corresponding to each historical water gene type.
In specific implementation, the historical water quality data q [ q1, q2, …, qi, … qm ] in the continuous historical time period is taken as an example, and one piece of historical water quality data is taken every hour, namely qi is the historical water quality data of the ith hour in the continuous historical time period.
In this embodiment, the second preset period is set to 4 hours, the continuous historical water quality data is slid to construct input data, the historical water quality data of the next hour is predicted by the historical water quality data of the first 4 hours, that is, the historical water quality data of the next 4 hours in succession is used as one input data, the historical water quality data of the next hour in succession is used as one input data, for example, [ q1, q2, q3, q4] is one input data, and [ q5] is the corresponding output data, that is, x= [ q1, q2, q3, q4] and y= [ q5] is one sample data corresponding to the historical water quality data of one time point.
The input data and the output data for all hours are constructed in a sliding manner, and are specifically shown as follows:
x=[[q1,q2,q3,q4],[q2,q3,q4,q5],…,[qt-4,qt-3,qt-2,qt-1],…,[qm-4,qm-3,qm-2,qm-1]];
y = [q5,q6,…,qt,…,qm]。
by processing the historical water quality data, input data and output data of the historical water quality data at all time points in a historical continuous time period are obtained, and all sample data for training of a water quality prediction model are obtained.
Then, according to the historical water gene data included in each historical water gene type, sample data corresponding to the historical water quality data corresponding to the historical water gene data in the same historical water gene type is used as a group of sample data, sample data of historical water quality data corresponding to each historical water gene type is obtained, for example, the number of the historical water gene types is n, and the number of the historical water gene types is respectively historical water gene type 1, historical water gene type 2. And respectively inputting the obtained n groups of sample data corresponding to the historical water factor type into a plurality of models for model training, for example, respectively inputting a group of sample data corresponding to the historical water factor type 1 into models such as support vector regression, multiple nonlinear regression, xgboost, bp neural network and the like, comparing the calculation result of each model with the actual test result, counting the average relative standard deviation, fitting goodness and qualification rate of each model, and selecting the model with the highest comprehensive score as the water quality prediction model under the historical water factor type 1. Model training is sequentially carried out on the n historical water-based factor types respectively to obtain n water quality prediction models, and one historical water-based factor type corresponds to one water quality prediction model.
In the specific implementation, in the step of inputting the plurality of water quality data of the first preset time period adjacent to the time point to be predicted into the water quality prediction model obtained by searching, the water quality data of the water sample to be monitored at the time point to be predicted is obtained, the first preset time period can be set to be 4 hours, namely, the plurality of water quality data of the first 4 small data adjacent to the time point to be predicted is also input into the water quality prediction model obtained by searching, and the water quality data of the water sample to be monitored at the time point to be predicted can be obtained, so that the monitoring of the water sample in the area to be monitored is realized.
In one embodiment, the water quality monitoring method based on the water quality prediction model library further comprises:
searching null values existing in a plurality of historical water quality data in the historical continuous time period, and obtaining a first null value position;
Detecting abnormal values in a plurality of historical water quality data in the historical continuous time period by adopting a random forest abnormal value detection method, and eliminating the abnormal values to obtain a second null value position;
Filling the first null position by using the average value of a plurality of water quality data adjacent to the first null position, and filling the second null position by using the average value of a plurality of water quality data adjacent to the second null position.
In this embodiment, the historical water quality data is preprocessed to remove abnormal data, and the empty data is filled, so that the continuity of the data is ensured. In general, before the steps of sliding construction of input data and output data for all hours, preprocessing of historical water quality data is performed, construction of sample data is performed after continuous and effective data are obtained, effectiveness of the data is guaranteed, and accuracy of a water quality prediction model is further improved.
In one embodiment, the water quality monitoring method based on the water quality prediction model library further comprises:
acquiring environment attribute information corresponding to each historical water gene data;
based on each historical water gene type, carrying out statistical grouping on the environmental attribute information to obtain an environmental attribute information group corresponding to each historical water gene type;
Acquiring an environment attribute information group of the time point to be predicted based on the water factor type corresponding to the water factor data of the time point to be predicted;
And analyzing the environmental characteristics of the time point to be detected of the water sample to be detected based on the environmental attribute information group of the time point to be predicted.
In specific implementation, the classified historical water gene types are m, and the environmental attribute information of various waveform characteristics in the m historical water gene types is counted, wherein the environmental attribute information comprises a plurality of environmental attributes such as a river basin (localized data), a pollution type (regional data), a Feng Ping withered period (seasonal data) and the like, and each environmental attribute comprises a plurality of categories, for example, the river basin comprises a plurality of categories. The proportion of each category in the different environmental attributes under each historical water-based factor type is counted. Taking environmental attributes of a historical water factor type, the duty ratio of categories in the environmental attributes and other parameters as an environmental attribute information set, and analyzing the environmental characteristics of the historical water factor type by utilizing the environmental attribute information set; acquiring an environment attribute information group of the time point to be measured based on the water-based factor type corresponding to the water-based factor of the time point to be measured; and analyzing the environmental characteristics of the time point to be detected of the water sample to be detected based on the environmental attribute information group of the time point to be detected.
According to the application, the water quality prediction model is built by collecting the water quality data of different areas and different water-based cause types in continuous time, so as to form a water quality prediction model library. In an unknown region, according to the water factor type, the water quality is predicted by automatically screening a prediction model in a model library, a new prediction model is not required to be constructed, the prediction cost of the new region is greatly reduced on the premise of ensuring the calculation accuracy, and the prediction efficiency is improved.
In this embodiment, a computer device is provided, as shown in fig. 2, including a memory 201, a processor 202, and a computer program stored in the memory and capable of running on the processor, where the processor implements any of the above water quality monitoring methods based on a water quality prediction model library when executing the computer program.
In particular, the computer device may be a computer terminal, a server or similar computing means.
In the present embodiment, a computer-readable storage medium storing a computer program for executing any of the above water quality monitoring methods based on a water quality prediction model library is provided.
In particular, computer-readable storage media, including both permanent and non-permanent, removable and non-removable media, may be used to implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer-readable storage media include, but are not limited to, phase-change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable storage media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
Based on the same inventive concept, the embodiment of the invention also provides a water quality monitoring device based on a water quality prediction model library, as described in the following embodiment. Because the principle of solving the problem of the water quality monitoring device based on the water quality prediction model library is similar to that of the water quality monitoring method based on the water quality prediction model library, the implementation of the water quality monitoring device based on the water quality prediction model library can be referred to the implementation of the water quality monitoring method based on the water quality prediction model library, and the repeated parts are not repeated. As used below, the term "unit" or "module" may be a combination of software and/or hardware that implements the intended function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
FIG. 3 is a block diagram of a water quality monitoring device based on a water quality prediction model library according to an embodiment of the present invention, as shown in FIG. 3, including: the configuration is described below, which is an acquisition module 301, a water cause type first determination module 302, a weight setting module 303, a weight score calculation module 304, a water cause type second determination module 305, a water quality prediction model search module 306, and a water quality prediction module 307.
The obtaining module 301 is configured to obtain a plurality of water quality data of a water sample to be monitored in a first preset time period adjacent to a time point to be predicted and a plurality of water gene data corresponding to the water quality data, where the water gene data is spectral data of the water sample, and each time point in the first preset time period corresponds to one water quality data and one water gene data;
A water-based factor type first determination module 302, configured to determine a water-based factor type corresponding to each of the water-based factors;
A weight setting module 303, configured to set a weight for the water-based factor type corresponding to each time point in the first preset time period;
The weight score calculation module 304 is configured to perform weighted summation on the water-based cause types of the same type in the first preset time period, so as to obtain a weight score of the water-based cause type of each type;
A water gene type second determining module 305 for taking the water gene type with the highest weight score as the water gene type corresponding to the water gene data of the time point to be predicted;
The water quality prediction model searching module 306 is configured to search a water quality prediction model corresponding to a water-based factor type corresponding to the water-based factor at the time point to be predicted in a water quality prediction model library;
the water quality prediction module 307 is configured to input a plurality of water quality data of the first preset time period adjacent to the time point to be predicted into the found water quality prediction model, and obtain water quality data of the water sample to be monitored at the time point to be predicted.
In one embodiment, the water quality monitoring device based on the water quality prediction model library further comprises:
the first acquisition module is used for acquiring a plurality of historical water quality data of historical continuous time periods of sample water samples in different areas and a plurality of historical water gene data corresponding to the historical water quality data;
The clustering module is used for clustering a plurality of historical water gene data based on the spectral characteristics of each historical water gene data to obtain a plurality of historical water gene types;
the model training module is used for training the model by taking the historical water quality data corresponding to each historical water gene type as sample data aiming at each historical water gene type to obtain a water quality prediction model corresponding to each historical water gene type respectively;
And the water quality prediction model library forming module is used for forming the water quality prediction model library based on the water quality prediction models respectively corresponding to all the historical water-based factor types.
In one embodiment, the clustering module is further configured to:
After normalizing each historical water gene data, extracting the spectral characteristics of each historical water gene data;
Constructing a spectrum characteristic matrix based on each historical water gene data and the spectrum characteristic corresponding to each historical water gene data, and obtaining a plurality of spectrum characteristic matrices corresponding to a plurality of historical water-based data one by one;
clustering a plurality of the spectrum feature matrixes, and taking each clustered category as one historical water factor type.
In one embodiment, the water quality monitoring device based on the water quality prediction model library further comprises:
the identification model construction module is used for identifying the water gene type, and is used for constructing the corresponding relation between a plurality of spectrum characteristic matrixes and a plurality of historical water gene types by using an SVM method to form an identification model for identifying the water gene type.
In one embodiment, the water quality monitoring device based on the water quality prediction model library further comprises:
The null value searching module is used for searching null values existing in a plurality of historical water quality data in the historical continuous time period and acquiring a first null value position;
The abnormal value eliminating module is used for detecting abnormal values in a plurality of historical water quality data in the historical continuous time period by adopting a random forest abnormal value detection method and eliminating the abnormal values to obtain a second null value position;
And the data filling module is used for filling the first null position by using the average value of the plurality of water quality data adjacent to the first null position and filling the second null position by using the average value of the plurality of water quality data adjacent to the second null position.
In one embodiment, the model training module is further configured to:
Each time point in the continuous time period corresponds to one piece of historical water quality data, the historical water quality data of a second preset time period before the time point is taken as one piece of input data of a model to be trained for each time point, the historical water quality data of the time point is taken as one piece of output data of the model to be trained, and the one piece of input data and the one piece of output data form sample data of the historical water quality data of the time point;
obtaining sample data of historical water quality data at all time points in the historical continuous time period;
Dividing the sample data of the historical water quality data at all time points into a plurality of groups of sample data based on each historical water gene type, wherein one historical water gene type corresponds to one group of sample data;
and inputting each group of sample data into a plurality of models to be trained for training, and obtaining a water quality prediction model corresponding to each historical water gene type.
In one embodiment, the water quality monitoring device based on the water quality prediction model library further comprises:
The second acquisition module is used for acquiring environment attribute information corresponding to each historical water gene data;
The environment attribute information grouping module is used for carrying out statistics grouping on the environment attribute information based on each historical water gene type to obtain an environment attribute information group corresponding to each historical water gene type;
the environment attribute information acquisition module is used for acquiring an environment attribute information group of the time point to be predicted based on the water factor type corresponding to the water factor data of the time point to be predicted;
and the environmental characteristic analysis module is used for analyzing the environmental characteristics of the time point to be detected of the water sample to be detected based on the environmental attribute information group.
The embodiment of the application realizes the following technical effects: acquiring a plurality of water quality data of a water sample to be monitored in a first preset time period adjacent to a time point to be predicted and a plurality of water gene data corresponding to the water quality data, wherein the water gene data are spectrum data of the water sample, and each time point in the first preset time period corresponds to one water quality data and one water-based data; determining the water factor type corresponding to each water factor data; setting weight for the water-based factor type corresponding to each time point in the first preset time period; weighting and summing the water-based factor types of the same type in a first preset time period to obtain a weight score of each type of water-based factor type; taking the water-based factor type with the highest weight score as the water-based factor type corresponding to the water-based factor at the time point to be measured; searching a water quality prediction model corresponding to the water-based factor type corresponding to the water-based factor of the time point to be detected in a water quality prediction model library; inputting a plurality of water quality data of a first preset time period adjacent to a time point to be predicted into the searched water quality prediction model to obtain the water quality data of the water sample to be monitored at the time point to be detected. Therefore, the application establishes the water quality prediction model by collecting the water quality data of different areas and different water-based cause types in continuous time, and forms a water quality prediction model library. In an unknown region, according to the water factor type, the water quality is predicted by automatically screening a prediction model in a model library, a new prediction model is not required to be constructed, the prediction cost of the new region is greatly reduced on the premise of ensuring the calculation accuracy, and the prediction efficiency is improved.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be separately fabricated into individual integrated circuit modules, or a plurality of modules or steps in them may be fabricated into a single integrated circuit module. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, and various modifications and variations can be made to the embodiments of the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A water quality monitoring method based on a water quality prediction model library is characterized by comprising the following steps:
Acquiring a plurality of water quality data of a water sample to be monitored in a first preset time period adjacent to a time point to be predicted and a plurality of water gene data corresponding to the water quality data, wherein the water gene data are spectrum data of the water sample, and each time point in the first preset time period corresponds to one water quality data and one water gene data;
determining the water factor type corresponding to each water factor data;
Setting weight for the water-based factor type corresponding to each time point in the first preset time period;
carrying out weighted summation on the water-based factor types of the same type in the first preset time period to obtain a weight score of the water-based factor type of each type;
taking the water-based factor type with the highest weight score as the water-based factor type corresponding to the water-based factor of the time point to be predicted;
searching a water quality prediction model corresponding to the water-based factor type corresponding to the water-based factor of the time point to be predicted in a water quality prediction model library;
Inputting a plurality of water quality data of the first preset time period adjacent to the time point to be predicted into the searched water quality prediction model to obtain the water quality data of the water sample to be monitored at the time point to be predicted.
2. The water quality monitoring method based on a water quality prediction model base according to claim 1, further comprising:
Acquiring a plurality of historical water quality data of sample water samples in different areas in a historical continuous time period and a plurality of historical water gene data corresponding to the historical water quality data;
Clustering a plurality of historical water gene data based on the spectral characteristics of each historical water gene data to obtain a plurality of historical water gene types;
Aiming at each historical water gene type, training a model by taking the historical water quality data corresponding to each historical water gene type as sample data to obtain a water quality prediction model corresponding to each historical water gene type;
And forming the water quality prediction model library based on the water quality prediction models respectively corresponding to all the historical water-based factor types.
3. The method for monitoring water quality based on a water quality prediction model base according to claim 2, wherein the clustering the plurality of historical water gene data based on the spectral characteristics of each of the historical water gene data to obtain a plurality of historical water gene types comprises:
After normalizing each historical water gene data, extracting the spectral characteristics of each historical water gene data;
Constructing a spectrum characteristic matrix based on each historical water gene data and the spectrum characteristic corresponding to each historical water gene data, and obtaining a plurality of spectrum characteristic matrices corresponding to a plurality of historical water-based data one by one;
clustering a plurality of the spectrum feature matrixes, and taking each clustered category as one historical water factor type.
4. A water quality monitoring method based on a library of water quality prediction models as claimed in claim 3, wherein the method further comprises:
And constructing corresponding relations between the plurality of spectral feature matrixes and the plurality of historical water gene types by using an SVM method to form an identification model for identifying the water gene type.
5. The water quality monitoring method based on a water quality prediction model base according to claim 2, further comprising:
searching null values existing in a plurality of historical water quality data in the historical continuous time period, and obtaining a first null value position;
Detecting abnormal values in a plurality of historical water quality data in the historical continuous time period by adopting a random forest abnormal value detection method, and eliminating the abnormal values to obtain a second null value position;
Filling the first null position by using the average value of a plurality of water quality data adjacent to the first null position, and filling the second null position by using the average value of a plurality of water quality data adjacent to the second null position.
6. The water quality monitoring method based on a water quality prediction model base according to claim 2, wherein the training the model by using the historical water quality data corresponding to each historical water gene type as sample data comprises:
Each time point in the continuous time period corresponds to one piece of historical water quality data, the historical water quality data of a second preset time period before the time point is taken as one piece of input data of a model to be trained for each time point, the historical water quality data of the time point is taken as one piece of output data of the model to be trained, and the one piece of input data and the one piece of output data form sample data of the historical water quality data of the time point;
obtaining sample data of historical water quality data at all time points in the historical continuous time period;
Dividing the sample data of the historical water quality data at all time points into a plurality of groups of sample data based on each historical water gene type, wherein one historical water gene type corresponds to one group of sample data;
and inputting each group of sample data into a plurality of models to be trained for training, and obtaining a water quality prediction model corresponding to each historical water gene type.
7. The water quality monitoring method based on a water quality prediction model base according to claim 2, further comprising:
acquiring environment attribute information corresponding to each historical water gene data;
based on each historical water gene type, carrying out statistical grouping on the environmental attribute information to obtain an environmental attribute information group corresponding to each historical water gene type;
Acquiring an environment attribute information group of the time point to be predicted based on the water factor type corresponding to the water factor data of the time point to be predicted;
and analyzing the environmental characteristics of the time point to be detected of the water sample to be monitored based on the environmental attribute information group of the time point to be predicted.
8. A water quality monitoring device based on a water quality prediction model library is characterized by comprising:
The water quality monitoring system comprises an acquisition module, a prediction module and a prediction module, wherein the acquisition module is used for acquiring a plurality of water quality data of a water sample to be monitored in a first preset time period adjacent to a time point to be predicted and a plurality of water gene data corresponding to the water quality data, the water gene data are spectrum data of the water sample, and each time point in the first preset time period corresponds to one water quality data and one water gene data;
The first water factor type determining module is used for determining the water factor type corresponding to each water factor data;
The weight setting module is used for setting weight for the water-based factor type corresponding to each time point in the first preset time period;
The weight score calculation module is used for carrying out weighted summation on the water-based factor types of the same type in the first preset time period to obtain a weight score of the water-based factor type of each type;
A water gene type second determining module, configured to use the water gene type with the highest weight score as a water gene type corresponding to the water gene data of the time point to be predicted;
the water quality prediction model searching module is used for searching a water quality prediction model corresponding to the water-based factor type corresponding to the water-based factor of the time point to be predicted in the water quality prediction model library;
The water quality prediction module is used for inputting a plurality of water quality data of the first preset time period adjacent to the time point to be predicted into the searched water quality prediction model to obtain the water quality data of the water sample to be monitored at the time point to be predicted.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the water quality monitoring method based on a library of water quality prediction models according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the water quality monitoring method based on the water quality prediction model library according to any one of claims 1 to 7.
CN202410130355.6A 2024-01-31 2024-01-31 Water quality monitoring method, device, equipment and medium based on water quality prediction model library Active CN117664888B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410130355.6A CN117664888B (en) 2024-01-31 2024-01-31 Water quality monitoring method, device, equipment and medium based on water quality prediction model library

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410130355.6A CN117664888B (en) 2024-01-31 2024-01-31 Water quality monitoring method, device, equipment and medium based on water quality prediction model library

Publications (2)

Publication Number Publication Date
CN117664888A CN117664888A (en) 2024-03-08
CN117664888B true CN117664888B (en) 2024-05-03

Family

ID=90079234

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410130355.6A Active CN117664888B (en) 2024-01-31 2024-01-31 Water quality monitoring method, device, equipment and medium based on water quality prediction model library

Country Status (1)

Country Link
CN (1) CN117664888B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170112404A (en) * 2016-03-31 2017-10-12 광주과학기술원 Method for predicting concentration of pathogenic microorganism using remote sensing hiperspectral images
AU2020100179A4 (en) * 2020-02-04 2020-03-19 Huang, Shuying DR Optimization Details-Based Injection Model for Remote Sensing Image Fusion
CN111950942A (en) * 2020-10-19 2020-11-17 平安国际智慧城市科技股份有限公司 Model-based water pollution risk assessment method and device and computer equipment
KR102355001B1 (en) * 2021-08-24 2022-01-24 서울대학교 산학협력단 Estimation of spatial distribution of suspended sediment concentration from hyperspectral images using machine learning regression models and probabilistic clustering method in rivers
CN114022052A (en) * 2022-01-04 2022-02-08 北京英视睿达科技股份有限公司 Water quality abnormity monitoring method and device, storage medium and computer equipment
CN115561176A (en) * 2022-10-13 2023-01-03 中电莱斯信息系统有限公司 Water quality inversion method based on feature adaptive operation and machine learning fusion
CN116861777A (en) * 2023-06-29 2023-10-10 武汉理工大学 Water quality prediction method and system based on time sequence
CN116934558A (en) * 2023-09-18 2023-10-24 共享数据(福建)科技有限公司 Automatic patrol monitoring method and system for unmanned aerial vehicle

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170112404A (en) * 2016-03-31 2017-10-12 광주과학기술원 Method for predicting concentration of pathogenic microorganism using remote sensing hiperspectral images
AU2020100179A4 (en) * 2020-02-04 2020-03-19 Huang, Shuying DR Optimization Details-Based Injection Model for Remote Sensing Image Fusion
CN111950942A (en) * 2020-10-19 2020-11-17 平安国际智慧城市科技股份有限公司 Model-based water pollution risk assessment method and device and computer equipment
KR102355001B1 (en) * 2021-08-24 2022-01-24 서울대학교 산학협력단 Estimation of spatial distribution of suspended sediment concentration from hyperspectral images using machine learning regression models and probabilistic clustering method in rivers
CN114022052A (en) * 2022-01-04 2022-02-08 北京英视睿达科技股份有限公司 Water quality abnormity monitoring method and device, storage medium and computer equipment
CN115561176A (en) * 2022-10-13 2023-01-03 中电莱斯信息系统有限公司 Water quality inversion method based on feature adaptive operation and machine learning fusion
CN116861777A (en) * 2023-06-29 2023-10-10 武汉理工大学 Water quality prediction method and system based on time sequence
CN116934558A (en) * 2023-09-18 2023-10-24 共享数据(福建)科技有限公司 Automatic patrol monitoring method and system for unmanned aerial vehicle

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于IGA-BP网络的水质预测方法;张旭东等;环境工程学报;20160305;第10卷(第03期);1566-1571 *

Also Published As

Publication number Publication date
CN117664888A (en) 2024-03-08

Similar Documents

Publication Publication Date Title
CN104321794B (en) A kind of system and method that the following commercial viability of an entity is determined using multidimensional grading
CN101714273A (en) Rule engine-based method and system for monitoring exceptional service of bank
CN112700324A (en) User loan default prediction method based on combination of Catboost and restricted Boltzmann machine
CN108364107A (en) A kind of investment data processing method and processing device
CN115358481A (en) Early warning and identification method, system and device for enterprise ex-situ migration
CN114863170A (en) Deep learning-based new energy vehicle battery spontaneous combustion early warning method and device
Gautam et al. Adaptive discretization using golden section to aid outlier detection for software development effort estimation
CN117664888B (en) Water quality monitoring method, device, equipment and medium based on water quality prediction model library
CN116561569A (en) Industrial power load identification method based on EO feature selection and AdaBoost algorithm
Albaji et al. Investigation on Machine Learning Approaches for Environmental Noise Classifications
CN117686447A (en) Water quality monitoring method, device, equipment and medium based on multichannel model
CN114244549A (en) GSSK-means abnormal flow detection method, memory and processor for industrial internet
WO1992017853A2 (en) Direct data base analysis, forecasting and diagnosis method
CN117577227B (en) PM2.5 point location high value identification method, system, equipment and medium
CN115965137B (en) Specific object relevance prediction method, system, terminal and storage medium
Reyes et al. Data Stream Processing Method for Clustering of Trajectories
Javed Cluster Analysis of Time Series Data with Application to Hydrological Events and Serious Illness Conversations
CN113344696B (en) Position forecast evaluation method, device, equipment and storage medium
CN114266925B (en) DLSTM-RF-based user electricity stealing detection method and system
Murali Analysis of COVID-19 in different countries using Wigner energy distribution and clustering
Fitriani et al. Growth Externalities on the Environmental Quality Index of East Java Indonesia, Spatial Econometrics Model of STIRPAT
Menaka et al. Data Transformation, Modelling and Prediction of Customer Churn using Deep Learning
Liu et al. Expressway traffic flow forecasting based on a combined model
CN116882563A (en) Industry prediction method and equipment based on dynamic strategy
CN117829362A (en) Method and device for predicting intention index of account execution transaction behavior

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant