Inlet water quality prediction method and device, electronic equipment and storage medium

By constructing a multilayer perceptron and modular gradient propagation influent water quality prediction model, the problem of influent water quality fluctuation in sewage treatment plants was solved, early warning of influent water quality anomalies was achieved, treatment efficiency was improved and operating costs were reduced.

CN120782074BActive Publication Date: 2025-11-25ZHEJIANG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511203880.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-27
Publication Date
2025-11-25
Estimated Expiration
2045-08-27

AI Technical Summary

Technical Problem

Traditional wastewater treatment plants struggle to cope with fluctuations in influent water quality, leading to low treatment efficiency and increased operating costs.

Method used

By employing multilayer perceptron and modular gradient propagation technology, an initial influent water quality prediction model is constructed by acquiring multiple target influent water quality data sets from wastewater treatment plants. Data cleaning and normalization are performed, and predictions are made using trend, seasonal, and general sub-models until the error reaches a preset rule, thereby achieving early warning of influent water quality anomalies.

Benefits of technology

This improved the timeliness of operators in adjusting process parameters and reduced operating costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120782074B_ABST
    Figure CN120782074B_ABST
Patent Text Reader

Abstract

The application provides a water quality prediction method and device, electronic equipment and storage medium. The method comprises the following steps: obtaining a plurality of target influent water quality data sets of a sewage treatment plant; inputting the target influent water quality data set into an initial influent water quality prediction model to output a plurality of initial influent water quality prediction values; dividing the initial influent water quality prediction values to determine a plurality of batches of original sequences; each batch comprises a plurality of original sequences; inputting a first group of original sequences into a multi-layer perception machine to output a final influent water quality prediction value; performing module gradient propagation based on the final influent water quality prediction value and the remaining original sequences to obtain a target influent water quality prediction model; and inputting real-time influent water quality data into the target influent water quality prediction model to output a target influent water quality prediction value. In this way, the influent water quality anomaly is warned in advance, and the timeliness of the operator adjusting the process parameters is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of water quality prediction, and in particular to an influent water quality prediction method and device, electronic equipment and a storage medium. BACKGROUND

[0002] With the increase of urbanization and industrial activities, wastewater treatment plants (WWTPs) play a more and more important role in environmental protection.

[0003] However, the fluctuation of influent water quality poses a great challenge to wastewater treatment, and traditional management methods are difficult to cope with complex water quality changes, resulting in low treatment efficiency and increased operating costs. SUMMARY

[0004] Therefore, the purpose of the present application is to provide an influent water quality prediction method and device, electronic equipment and a storage medium, which can provide early warning for abnormal influent water quality, improve the timeliness of operators adjusting process parameters, and reduce operating costs.

[0005] In a first aspect, the present application provides an influent water quality prediction method applied to a wastewater treatment plant, which comprises: obtaining a plurality of target influent water quality data sets of the wastewater treatment plant; wherein the target influent water quality data set comprises a plurality of historical influent water quality data obtained at a preset time interval; inputting the target influent water quality data set into an initial influent water quality prediction model to output a plurality of initial influent water quality prediction values; dividing the initial influent water quality prediction values to determine a plurality of batches of original sequences; each batch includes a plurality of original sequences; inputting the first group of original sequences into a multi-layer perception machine to output a final influent water quality prediction value; performing module gradient propagation based on the final influent water quality prediction value and the remaining original sequences to update the initial influent water quality prediction model until the error of the initial influent water quality prediction model reaches a preset rule, obtaining a target influent water quality prediction model; the remaining original sequences are the original sequences other than the first group of original sequences in the plurality of batches; inputting real-time influent water quality data into the target influent water quality prediction model to output a target influent water quality prediction value.

[0006] In a preferred embodiment of the present application, the above-mentioned obtaining a plurality of target influent water quality data sets of the wastewater treatment plant comprises: obtaining a plurality of influent water quality data sets of the wastewater treatment plant; performing data cleaning and normalization processing on the plurality of influent water quality data sets respectively to obtain a plurality of target influent water quality data sets.

[0007] In the preferable embodiment of the present application, the data cleaning and normalization processing of the multiple sets of water quality data are performed to obtain the multiple sets of target water quality data, including: eliminating the historical water quality data in the set of water quality data that does not meet the preset standard deviation range to obtain multiple sets of target historical water quality data; and performing linear filling of the missing values and normalization processing based on the distance between adjacent target historical water quality data to obtain the set of target water quality data.

[0008] In the preferable embodiment of the present application, the initial water quality prediction model includes a trend sub-model, a seasonal sub-model and a general sub-model; the set of target water quality data is input into the initial water quality prediction model to output multiple initial water quality prediction values, including: inputting the set of target water quality data into the trend sub-model to output a first water quality prediction value; inputting the set of target water quality data into the seasonal sub-model to output a second water quality prediction value; inputting the set of target water quality data into the general sub-model to output a third water quality prediction value; and taking the first water quality prediction value, the second water quality prediction value and the third water quality prediction value as the initial water quality prediction value; wherein the set of target water quality data is simultaneously input into the trend sub-model, the seasonal sub-model and the general sub-model.

[0009] In the preferable embodiment of the present application, the set of target water quality data is input into the trend sub-model to output the first water quality prediction value, including: inputting the set of target water quality data into a polynomial function to output a first prediction value and a first prediction error; inputting the set of target water quality data into a spline function to output a second prediction error; and determining the first water quality prediction value output by the trend sub-model based on the first prediction value, the first prediction error and the second prediction error.

[0010] In the preferable embodiment of the present application, the module gradient propagation based on the final water quality prediction value and the remaining original sequence includes: determining a loss function based on the final water quality prediction value and a preset true value; updating the weights and biases of the trend sub-model, the seasonal sub-model and the general sub-model and the multi-layer perceptron through the chain rule based on the loss function; and if the error of the initial water quality prediction model does not meet the preset rule, inputting the remaining original sequence into the initial water quality prediction model until the error of the initial water quality prediction model meets the preset rule to obtain the target water quality prediction model.

[0011] In the preferred embodiment of the present application, the weights and biases of the trend sub-model, the seasonal sub-model and the general sub-model and the multi-layer perceptron are updated based on the loss function by back propagation through the chain rule, comprising: determining the gradient of the loss function with respect to the final influent water quality prediction value; based on the loss function, back propagation through the chain rule, the gradient is passed back to each layer of the multi-layer perceptron to update the weights of the trend sub-model, the seasonal sub-model and the general sub-model and the multi-layer perceptron.

[0012] In a second aspect, the embodiments of the present application also provide an influent water quality prediction device, applied to a sewage treatment plant, the device comprising: a target influent water quality data set acquisition module, configured to acquire a plurality of target influent water quality data sets of the sewage treatment plant; wherein the target influent water quality data set comprises a plurality of historical influent water quality data acquired at a preset time interval; a target influent water quality data set input module, configured to input the target influent water quality data set into an initial influent water quality prediction model, and output a plurality of initial influent water quality prediction values; an initial influent water quality prediction value division module, configured to divide the initial influent water quality prediction values to determine a plurality of batches of original sequences; each batch comprises a plurality of groups of original sequences; a final influent water quality prediction value output module, configured to input a first group of original sequences into a multi-layer perceptron, and output a final influent water quality prediction value; an initial influent water quality prediction model update module, configured to perform module gradient propagation based on the final influent water quality prediction value and the remaining original sequences, so as to update the initial influent water quality prediction model until the error of the initial influent water quality prediction model reaches a preset rule, and obtain a target influent water quality prediction model; the remaining original sequences are the original sequences other than the first group of original sequences in the plurality of batches; and a target influent water quality prediction value output module, configured to input real-time influent water quality data into the target influent water quality prediction model, and output a target influent water quality prediction value.

[0013] In a third aspect, the embodiments of the present application also provide an electronic device, comprising a processor and a memory, the memory stores computer executable instructions capable of being executed by the processor, and the processor executes the computer executable instructions to implement the influent water quality prediction method of the first aspect.

[0014] In a fourth aspect, the embodiments of the present application also provide a computer readable storage medium, the computer readable storage medium stores computer executable instructions, and when the computer executable instructions are called and executed by a processor, the computer executable instructions cause the processor to implement the influent water quality prediction method of the first aspect.

[0015] The embodiments of the present application have the following beneficial effects:

[0016] The embodiment of the present application provides a water quality prediction method, device, electronic equipment and storage medium, a plurality of target water quality data sets of a sewage treatment plant are acquired, the target water quality data set is input into an initial water quality prediction model, a plurality of initial water quality prediction values are output, the initial water quality prediction values are divided to determine a plurality of batches of original sequences, each batch includes a plurality of original sequences, a first group of original sequences is input into a multi-layer perception machine, and a final water quality prediction value is output; module gradient propagation is performed based on the final water quality prediction value and the remaining original sequences, so that the initial water quality prediction model is updated until the error of the initial water quality prediction model reaches a preset rule, a target water quality prediction model is obtained, the remaining original sequences are original sequences except the first group of original sequences in the plurality of batches, real-time water quality data is input into the target water quality prediction model, and a target water quality prediction value is output. In this way, the water quality anomaly is early warned, the timeliness of the operation personnel in adjusting the process parameters is improved, and the operation cost is reduced.

[0017] Other features and advantages of the present disclosure will be described in the following description, or some features and advantages can be inferred from the description or determined without doubt, or can be known by implementing the above-mentioned technologies of the present disclosure.

[0018] In order to make the above-mentioned purposes, features and advantages of the present disclosure more obvious and easy to understand, the following preferred embodiments are specifically described, and the accompanying drawings are described in detail as follows. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.

[0020] Figure 1 A flowchart of a water quality prediction method provided by the embodiment of the present application is provided.

[0021] Figure 2 A flowchart of another water quality prediction method provided by the embodiment of the present application is provided.

[0022] Figure 3 A flowchart of another water quality prediction method provided by the embodiment of the present application is provided.

[0023] Figure 4 A structure schematic diagram of a water quality prediction device provided by the embodiment of the present application is provided.

[0024] Figure 5 A structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be described below in connection with the drawings. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of the present application.

[0026] With the increase of urbanization and industrial activities, wastewater treatment plants (WWTP) play a more and more important role in environmental protection. However, the fluctuation of influent water quality brings great challenges to wastewater treatment, and traditional management methods are difficult to cope with complex water quality changes, resulting in low treatment efficiency and increased operating costs.

[0027] Based on this, the embodiment of the present application provides an influent water quality prediction method, device, electronic equipment and storage medium, which can obtain a plurality of target influent water quality data sets of a wastewater treatment plant, input the target influent water quality data set into an initial influent water quality prediction model, output a plurality of initial influent water quality prediction values, divide the initial influent water quality prediction values to determine a plurality of batches of original sequences, each batch including a plurality of original sequences, input the first group of original sequences into a multi-layer perception machine, output a final influent water quality prediction value, perform module gradient propagation based on the final influent water quality prediction value and the remaining original sequences to update the initial influent water quality prediction model until the error of the initial influent water quality prediction model reaches a preset rule, obtain a target influent water quality prediction model, and the remaining original sequences are the original sequences other than the first group of original sequences in the plurality of batches. Input real-time influent water quality data into the target influent water quality prediction model, and output a target influent water quality prediction value. In this way, the influent water quality anomaly is warned in advance, the timeliness of the operator adjusting the process parameters is improved, and the operating cost is reduced.

[0028] To facilitate understanding of the present embodiment, first, a kind of influent water quality prediction method disclosed by the embodiment of the present application will be described in detail.

[0029] Embodiment 1

[0030] The embodiment of the present application provides an influent water quality prediction method, Figure 1 A flowchart of an influent water quality prediction method provided by an embodiment of the present application is shown in Figure Figure 1 As shown in the figure, the influent water quality prediction method can include the following steps:

[0031] Step S101, obtain a plurality of target influent water quality data sets of the sewage treatment plant.

[0032] The target influent water quality data set includes a plurality of historical influent water quality data obtained at a preset time interval.

[0033] The historical influent water quality data can include influent chemical oxygen demand, ammonia nitrogen, total nitrogen, total phosphorus, suspended solids, biochemical pool dissolved oxygen, biochemical pool suspended solids, biochemical pool aeration quantity, transmembrane pressure difference, and transmembrane flow.

[0034] Specifically, obtaining a plurality of target influent water quality data sets of the sewage treatment plant can include: obtaining a plurality of influent water quality data sets of the sewage treatment plant; and performing data cleaning and normalization processing on the plurality of influent water quality data sets respectively to obtain the plurality of target influent water quality data sets.

[0035] The data cleaning and normalization processing on the plurality of influent water quality data sets respectively to obtain the plurality of target influent water quality data sets can include: removing historical water quality data in the influent water quality data set that does not conform to a preset standard deviation range to obtain a plurality of target historical influent water quality data; and performing linear filling of missing values and normalization processing based on the distance between adjacent target historical influent water quality data to obtain the target influent water quality data set.

[0036] The target influent water quality data set includes a plurality of historical influent water quality data values, which are in a range of 0 to 1.

[0037] The historical influent water quality data in the influent water quality data set that does not conform to three times the standard deviation can be removed to obtain a plurality of target historical influent water quality data.

[0038] The standard deviation range is a range of the average value of the historical influent water quality data plus or minus three times. The standard deviation is calculated according to the conventional standard deviation formula. Each historical influent water quality data is removed after the standard deviation is calculated. The historical influent water quality data outside the average value plus or minus three times the standard deviation range is removed.

[0039] The standard deviation formula can be: ;

[0040] Wherein, represents the standard deviation, represents the number of time points, represents the historical influent water quality data of the i-th time point in the influent water quality data set, represents the average value of all time points of the historical influent water quality data, represents the difference between each time point of the historical influent water quality data and the average value. ​

[0041] Specifically, ;in, This represents the average of historical influent water quality data at all points in time. Indicates the number of time points. This indicates the first in the influent water quality data set. Historical water quality data for each point in time.

[0042] Specifically, missing values ​​can be filled based on the distance between adjacent target historical influent water quality data, according to a pre-set linear missing value filling rule, to obtain an initial influent water quality data set. Then, the initial influent water quality data set is normalized to obtain the target influent water quality data set.

[0043] Step S102: Input the target influent water quality data set into the initial influent water quality prediction model and output multiple initial influent water quality prediction values.

[0044] The initial influent water quality prediction model can include a trend sub-model, a seasonal sub-model, and a general sub-model. The initial influent water quality prediction value can be the prediction value output by the trend sub-model, the seasonal sub-model, and the general sub-model, respectively.

[0045] Step S103: Divide the initial influent water quality prediction values ​​into multiple batches to determine the original sequence.

[0046] Each batch contains multiple sets of original sequences.

[0047] The original sequence corresponds to the data in the target influent water quality data set that meets the preset time length n, and is used to predict future influent water quality indicators.

[0048] For example, there are 36 initial influent water quality prediction values, which can be divided into 4 batches of raw sequences. Each batch has 3 sets of raw sequences, and each set of raw sequences has 3 initial influent water quality prediction values.

[0049] Step S104: Input the original sequence of the first group into the multilayer sensor and output the final influent water quality prediction value.

[0050] Step S105: Based on the final influent water quality prediction value and the remaining original sequences, perform module gradient propagation to update the initial influent water quality prediction model until the error of the initial influent water quality prediction model reaches the preset rule, and obtain the target influent water quality prediction model.

[0051] The remaining original sequences are: the original sequences from multiple batches excluding the original sequences from the first group.

[0052] Specifically, module gradient propagation can be performed based on the final influent water quality prediction value and the original sequence of the second group to update the initial influent water quality prediction model. After the update, the original sequence of the third group in the batch is input into the updated initial influent water quality prediction model, and the corresponding influent water quality prediction value is output and the error is determined. If the error meets the preset rules, the updated initial influent water quality prediction model is used as the target influent water quality prediction model. If the error does not meet the preset rules, module gradient propagation is continued based on the influent water quality prediction value output by the updated initial influent water quality prediction model and the original sequence of another batch to continue to update the model.

[0053] The prediction rule can be that the error reaches a set allowable range or a set repeatability value, or the average error of multiple batches reaches an allowable range or the average error is lower than a certain value.

[0054] Alternatively, you can set the update cycle to end after a certain number of updates has been completed.

[0055] Step S106: Input the real-time influent water quality data into the target influent water quality prediction model and output the target influent water quality prediction value.

[0056] The influent water quality prediction method provided in this invention can acquire multiple target influent water quality datasets from a wastewater treatment plant, input these datasets into an initial influent water quality prediction model, output multiple initial influent water quality prediction values, divide these initial influent water quality prediction values ​​into multiple batches of original sequences, each batch including multiple sets of original sequences, input the first set of original sequences into a multilayer perceptron, outputting a final influent water quality prediction value, and perform module gradient propagation based on the final influent water quality prediction value and the remaining original sequences to update the initial influent water quality prediction model until the error of the initial influent water quality prediction model reaches a preset rule, thus obtaining the target influent water quality prediction model. The remaining original sequences are the original sequences from the multiple batches excluding the first set of original sequences. Real-time influent water quality data is input into the target influent water quality prediction model, outputting the target influent water quality prediction value. This method provides early warning of influent water quality anomalies, improves the timeliness of operators adjusting process parameters, and reduces operating costs.

[0057] Example 2

[0058] This invention also provides another method for predicting influent water quality; this method is implemented based on the method in the above embodiments; the method focuses on describing the specific implementation of inputting the target influent water quality data set into the initial influent water quality prediction model and outputting multiple initial influent water quality prediction values.

[0059] Figure 2A flowchart of another influent water quality prediction method provided in an embodiment of the present invention is shown below. Figure 3 As shown, the initial influent water quality prediction model includes a trend sub-model, a seasonal sub-model, and a general sub-model. This model, which inputs the target influent water quality dataset into the initial influent water quality prediction model and outputs multiple initial influent water quality prediction values, may include the following steps:

[0060] Step S201: Input the target influent water quality data set into the trend sub-model and output the first influent water quality prediction value.

[0061] The trend sub-model includes the following basic models: polynomial functions and spline functions.

[0062] Specifically, the target influent water quality data set is input into the trend sub-model to output a first predicted influent water quality value, including: inputting the target influent water quality data set into a polynomial function to output a first predicted value and a first prediction error; inputting the target influent water quality data set into a spline function to output a second prediction error; and determining the first predicted influent water quality value based on the first predicted value, the first prediction error, and the second prediction error.

[0063] Step S202: Input the target influent water quality data set into the seasonal sub-model and output the second influent water quality prediction value.

[0064] The seasonal sub-model includes the following basic models: the Prophet model and the LSTM model.

[0065] Specifically, inputting the target influent water quality dataset into the seasonal sub-model and outputting a second predicted influent water quality value can include: inputting the target influent water quality dataset into the Prophet model and outputting a second predicted value and a third prediction error; inputting the target influent water quality dataset into the LSTM model and outputting a fourth prediction error; and determining the second predicted influent water quality value output by the seasonal sub-model based on the second predicted value, the third prediction error, and the fourth prediction error.

[0066] Step S203: Input the target influent water quality data set into the general sub-model and output the third influent water quality prediction value.

[0067] The basic models included in the general sub-models are: fully connected neural networks and convolutional neural networks.

[0068] Specifically, inputting the target influent water quality data set into a general sub-model and outputting a third influent water quality prediction value can include: inputting the target influent water quality data set into a fully connected neural network and outputting a third prediction value and a fifth prediction error; inputting the target influent water quality data set into a convolutional neural network and outputting a sixth prediction error; and determining a trend sub-model based on the third prediction value, the fifth prediction error, and the sixth prediction error to output the third influent water quality prediction value.

[0069] Step S204: Use the first influent water quality prediction value, the second influent water quality prediction value, and the third influent water quality prediction value as the initial influent water quality prediction value.

[0070] It should be noted that the target influent water quality data set is simultaneously input into the trend sub-model, the seasonal sub-model, and the general sub-model.

[0071] Example 3

[0072] This invention also provides another method for predicting influent water quality; this method is implemented based on the method in the above embodiments; the method focuses on describing the specific implementation of module gradient propagation based on the final predicted influent water quality value and the remaining original sequence.

[0073] Figure 3 A flowchart of another influent water quality prediction method provided in an embodiment of the present invention is shown below. Figure 3 As shown, the module gradient propagation based on the final influent water quality prediction and the remaining original sequences can include the following steps:

[0074] Step S301: Determine the loss function based on the final predicted influent water quality value and the preset true value.

[0075] Specifically, the error between the predicted and actual influent water quality values ​​is calculated using the mean squared error as the loss function. The specific formula is as follows: .

[0076] in, Let m represent the loss function, and m represent the number of final influent water quality prediction values. Y represents the predicted final influent water quality, and Y represents the actual value.

[0077] Step S302: Based on the loss function, the weights and biases of the trend sub-model, seasonal sub-model, and general sub-model, as well as the multilayer perceptron, are updated through backpropagation using the chain rule.

[0078] Step S303: If the error of the initial influent water quality prediction model does not reach the preset rule, the remaining original sequences are input into the initial influent water quality prediction model until the error of the initial influent water quality prediction model reaches the preset rule, and the target influent water quality prediction model is obtained.

[0079] Specifically, updating the weights and biases of the trend sub-model, seasonal sub-model, and general sub-model, as well as the multilayer perceptron, based on the loss function through backpropagation using the chain rule can include: determining the gradient of the loss function with respect to the final influent water quality prediction; performing backpropagation based on the loss function using the chain rule to pass the gradient back to each layer of the multilayer perceptron to update the weights of the trend sub-model, seasonal sub-model, and general sub-model, as well as the multilayer perceptron.

[0080] Among them, the loss function can be determined. Predicted values ​​of final influent water quality gradient Multilayer perceptron gradient propagation is performed, and the gradient is passed back to each layer of the multilayer perceptron for updating.

[0081] Among these, the gradient of the last layer of the multilayer perceptron can be calculated. and The gradient is propagated layer by layer forward until the first layer, updating the parameters of all multilayer perceptrons.

[0082] This allows for module gradient propagation, which propagates the input gradient of the multilayer perceptron. , , The parameters of each module are updated and returned to the trend module, seasonal module, and general module respectively.

[0083] Specifically, gradients are calculated based on polynomial functions. To update the parameters of the polynomial function, the gradient is calculated based on the spline function. To update the parameters of the spline function.

[0084] Specifically, gradients are calculated based on the Prophet model. To update the parameters of the Prophet model, such as hyperparameters for trend, seasonality, and holiday effects; to calculate the gradient based on the LSTM model. To update the weights and biases of the LSTM model.

[0085] Specifically, gradients are calculated based on fully connected neural networks. To update the weights and biases of a fully connected neural network, gradients are calculated based on a convolutional neural network. This is used to update the convolution kernels and bias terms of the convolutional neural network.

[0086] Furthermore, the update of weights and biases is specifically as follows: Stochastic Gradient Descent (SGD), Adam, and other optimization algorithms can be used to update the weights and biases of each base model's multilayer perceptron based on the calculated gradients. The update formula can be: , ;in, and These represent the weights before and after the update, respectively. and These represent the bias before and after the update, respectively; This represents the learning rate, used to control the step size for each update; and These represent the gradients of the loss function with respect to the weights and biases, respectively.

[0087] Example 4

[0088] Corresponding to the above method embodiments, this invention provides an influent water quality prediction device. Figure 4 This is a schematic diagram of the structure of an influent water quality prediction device provided in an embodiment of the present invention, as shown below. Figure 4 As shown, the influent water quality prediction device may include:

[0089] The target influent water quality data set acquisition module 401 is used to acquire multiple target influent water quality data sets of the sewage treatment plant; wherein, the target influent water quality data set includes multiple historical influent water quality data acquired at preset time intervals.

[0090] The target influent water quality data set input module 402 is used to input the target influent water quality data set into the initial influent water quality prediction model and output multiple initial influent water quality prediction values.

[0091] The initial influent water quality prediction value division module 403 is used to divide the initial influent water quality prediction value into multiple batches of original sequences; each batch includes multiple sets of original sequences.

[0092] The final influent water quality prediction output module 404 is used to input the original sequence of the first group into the multilayer sensor and output the final influent water quality prediction value.

[0093] The initial influent water quality prediction model update module 405 is used to perform module gradient propagation based on the final influent water quality prediction value and the remaining original sequences to update the initial influent water quality prediction model until the error of the initial influent water quality prediction model reaches the preset rule, thereby obtaining the target influent water quality prediction model; the remaining original sequences are: original sequences other than the original sequences of the first group in multiple batches.

[0094] The target influent water quality prediction output module 406 is used to input real-time influent water quality data into the target influent water quality prediction model and output the target influent water quality prediction value.

[0095] The influent water quality prediction device provided in this embodiment of the invention can acquire multiple target influent water quality data sets from a wastewater treatment plant, input these target influent water quality data sets into an initial influent water quality prediction model, output multiple initial influent water quality prediction values, divide the initial influent water quality prediction values ​​into multiple batches of original sequences, each batch including multiple sets of original sequences, input the first set of original sequences into a multilayer sensor, output a final influent water quality prediction value, perform module gradient propagation based on the final influent water quality prediction value and the remaining original sequences to update the initial influent water quality prediction model until the error of the initial influent water quality prediction model reaches a preset rule, thus obtaining the target influent water quality prediction model. The remaining original sequences are the original sequences from the multiple batches excluding the first set of original sequences. Real-time influent water quality data is input into the target influent water quality prediction model, and the target influent water quality prediction value is output. In this method, early warning of influent water quality anomalies is provided, improving the timeliness of operators adjusting process parameters and reducing operating costs.

[0096] In some embodiments, the target influent water quality data set acquisition module is further configured to acquire multiple influent water quality data sets of the wastewater treatment plant; and to perform data cleaning and normalization processing on the multiple influent water quality data sets respectively to obtain multiple target influent water quality data sets.

[0097] In some embodiments, the target influent water quality data set acquisition module is further configured to remove historical water quality data that do not conform to the preset standard deviation range from the influent water quality data set, thereby obtaining multiple target historical influent water quality data; based on the distance between adjacent target historical influent water quality data, missing values ​​are linearly filled and then normalized to obtain the target influent water quality data set.

[0098] In some embodiments, the initial influent water quality prediction model includes: a trend sub-model, a seasonal sub-model, and a general sub-model. The target influent water quality data set input module is further configured to input the target influent water quality data set into the trend sub-model and output a first influent water quality prediction value; input the target influent water quality data set into the seasonal sub-model and output a second influent water quality prediction value; input the target influent water quality data set into the general sub-model and output a third influent water quality prediction value; and use the first, second, and third influent water quality prediction values ​​as the initial influent water quality prediction value; wherein the target influent water quality data set is simultaneously input into the trend sub-model, the seasonal sub-model, and the general sub-model.

[0099] In some embodiments, the trend sub-model includes the following basic models: a polynomial function and a spline function. The target influent water quality data set input module is further configured to input the target influent water quality data set into the trend sub-model and output a first predicted influent water quality value, including: inputting the target influent water quality data set into the polynomial function and outputting a first predicted value and a first prediction error; inputting the target influent water quality data set into the spline function and outputting a second prediction error; and determining the first predicted influent water quality value output by the trend sub-model based on the first predicted value, the first prediction error, and the second prediction error.

[0100] In some embodiments, the initial influent water quality prediction model update module is further configured to determine a loss function based on the final influent water quality prediction value and the preset true value; update the weights and biases of the trend sub-model, seasonal sub-model, and general sub-model, as well as the multilayer perceptron, based on the loss function through backpropagation using the chain rule; if the error of the initial influent water quality prediction model does not reach the preset rule, then input the remaining original sequences into the initial influent water quality prediction model until the error of the initial influent water quality prediction model reaches the preset rule, thereby obtaining the target influent water quality prediction model.

[0101] In some embodiments, the initial influent water quality prediction model update module is further used to determine the gradient of the loss function with respect to the final influent water quality prediction value; and to perform backpropagation based on the loss function using the chain rule to pass the gradient back to each layer of the multilayer perceptron to update the weights of the trend sub-model, the seasonal sub-model, and the general sub-model, as well as the multilayer perceptron.

[0102] The device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0103] Example 5

[0104] This invention also provides an electronic device for running the above-described influent water quality prediction method; see [link to related documentation]. Figure 5 The diagram shows the structure of an electronic device, which includes a memory 500 and a processor 501. The memory 500 stores one or more computer instructions, which are executed by the processor 501 to implement the above-mentioned influent water quality prediction method.

[0105] Furthermore, Figure 5 The electronic device shown also includes a bus 502 and a communication interface 503. The processor 501, the communication interface 503 and the memory 500 are connected via the bus 502.

[0106] The memory 500 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 503 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 502 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0107] Processor 501 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 501 or by instructions in software form. Processor 501 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 500, and processor 501 reads information from memory 500 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0108] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the above-described influent water quality prediction method. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0109] The computer program product for the influent water quality prediction method provided in this embodiment of the invention includes a computer-readable storage medium storing non-volatile program code executable by a processor. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0110] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0111] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0112] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0113] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0114] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0115] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for predicting influent water quality, characterized in that, Applied to wastewater treatment plants, the method includes: Acquire multiple target influent water quality data sets for the wastewater treatment plant; wherein, the target influent water quality data sets include multiple historical influent water quality data acquired at preset time intervals; The target influent water quality data set is input into the initial influent water quality prediction model, and multiple initial influent water quality prediction values ​​are output. The initial influent water quality prediction values ​​are divided into multiple batches to determine the original sequences; each batch includes multiple sets of original sequences; The original sequence of the first group is input into the multilayer sensor, and the first final influent water quality prediction value is output. Based on the first final influent water quality prediction value and the remaining original sequences, module gradient propagation is performed to update the initial influent water quality prediction model until the error of the initial influent water quality prediction model reaches a preset rule, thereby obtaining the target influent water quality prediction model; the remaining original sequences are: original sequences other than the original sequences of the first group in multiple batches. The real-time influent water quality data is input into the target influent water quality prediction model, and the target influent water quality prediction value is output. The initial influent water quality prediction model includes: a trend sub-model, a seasonal sub-model, and a general sub-model; The trend sub-model includes the following basic models: polynomial functions and spline functions; The seasonal sub-models include the following basic models: the Prophet model and the LSTM model; The general sub-models include the following basic models: fully connected neural networks and convolutional neural networks.

2. The method according to claim 1, characterized in that, The acquisition of multiple target influent water quality data sets for the wastewater treatment plant includes: Obtain multiple sets of influent water quality data from the wastewater treatment plant; Data cleaning and normalization processes are performed on the multiple sets of influent water quality data to obtain multiple target sets of influent water quality data.

3. The method according to claim 2, characterized in that, The process involves cleaning and normalizing the data from multiple influent water quality datasets to obtain multiple target influent water quality datasets, including: By removing historical water quality data that do not conform to the preset standard deviation range from the influent water quality data set, multiple target historical influent water quality data are obtained; Based on the distance between adjacent historical influent water quality data, missing values ​​are linearly filled and then normalized to obtain the target influent water quality data set.

4. The method according to claim 1, characterized in that, The step involves inputting the target influent water quality data set into the initial influent water quality prediction model, and outputting multiple initial influent water quality prediction values, including: The target influent water quality data set is input into the trend sub-model, and the first influent water quality prediction value is output. The target influent water quality data set is input into the seasonal sub-model, and the second influent water quality prediction value is output. The target influent water quality data set is input into the general sub-model, and the third influent water quality prediction value is output. The first influent water quality prediction value, the second influent water quality prediction value, and the third influent water quality prediction value are used as the initial influent water quality prediction value; Specifically, the target influent water quality data set is simultaneously input into the trend sub-model, the seasonal sub-model, and the general sub-model.

5. The method according to claim 4, characterized in that, The trend sub-model includes the following basic models: polynomial functions and spline functions; The step of inputting the target influent water quality data set into the trend sub-model and outputting the first influent water quality prediction value includes: The target influent water quality data set is input into the polynomial function, and the first predicted value and the first prediction error are output. The target influent water quality data set is input into the spline function, and the second prediction error is output. Based on the first predicted value, the first prediction error, and the second prediction error, the trend sub-model outputs the first predicted influent water quality value.

6. The method according to claim 4, characterized in that, The module gradient propagation based on the final influent water quality prediction value and the remaining original sequence includes: The loss function is determined based on the final predicted influent water quality value and the preset true value. Based on the loss function, the weights and biases of the trend sub-model, the seasonal sub-model, and the general sub-model, as well as the multilayer perceptron, are updated through backpropagation using the chain rule. If the error of the initial influent water quality prediction model does not meet the preset rule, the remaining original sequences are input into the initial influent water quality prediction model until the error of the initial influent water quality prediction model meets the preset rule, thus obtaining the target influent water quality prediction model.

7. The method according to claim 6, characterized in that, The process of updating the weights and biases of the trend sub-model, the seasonal sub-model, and the general sub-model, as well as the multilayer perceptron, based on the loss function through backpropagation using the chain rule includes: Determine the gradient of the loss function with respect to the final predicted influent water quality; Backpropagation using the chain rule is performed based on the loss function, and the gradient is passed back to each layer of the multilayer perceptron to update the weights of the trend sub-model, the seasonal sub-model, and the general sub-model, as well as the multilayer perceptron.

8. A device for predicting influent water quality, characterized in that, Applied to a wastewater treatment plant, for implementing the influent water quality prediction method according to any one of claims 1 to 7, the apparatus comprises: The target influent water quality data set acquisition module is used to acquire multiple target influent water quality data sets of the wastewater treatment plant; wherein, the target influent water quality data set includes multiple historical influent water quality data acquired at preset time intervals; The target influent water quality data set input module is used to input the target influent water quality data set into the initial influent water quality prediction model and output multiple initial influent water quality prediction values; The initial influent water quality prediction value division module is used to divide the initial influent water quality prediction value into multiple batches of original sequences; each batch includes multiple sets of original sequences; The final influent water quality prediction output module is used to input the original sequence of the first group into the multilayer sensor and output the final influent water quality prediction value. The initial influent water quality prediction model update module is used to perform module gradient propagation based on the final influent water quality prediction value and the remaining original sequences to update the initial influent water quality prediction model until the error of the initial influent water quality prediction model reaches a preset rule, thereby obtaining the target influent water quality prediction model; the remaining original sequences are: original sequences other than the original sequences of the first group in multiple batches. The target influent water quality prediction output module is used to input real-time influent water quality data into the target influent water quality prediction model and output the target influent water quality prediction value.

9. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the influent water quality prediction method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the influent water quality prediction method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Single-village water plant energy consumption optimization scheduling method and system in combination with big data analysis

    CN119272946A

  • Space-time diagram neural network water quality prediction method based on DEM composition

    CN119917796A