Outlet water quality parameter prediction method and device based on coupling sliding time window
By adopting a long and short-term memory network model based on coupled sliding time window in sewage treatment plants, the problem of time-consuming and costly traditional water quality monitoring methods is solved, real-time monitoring and prediction of effluent water quality parameters is achieved, and operating efficiency and compliance rate are improved.
Patent Information
- Application Number
- CN202411604393.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-03-18
AI Technical Summary
Traditional water quality monitoring methods rely on manual sampling and laboratory analysis, which is time-consuming and costly, and cannot achieve real-time monitoring. Especially in sewage treatment plants, it is difficult to predict the effluent water quality parameters in real time.
A long-term and short-term memory network model based on a coupled sliding time window is adopted. By obtaining the historical water quality data of the sewage treatment plant, a training label set is constructed, and inputting it into the long-term and short-term memory network model through the sliding time window for training, an effluent water quality prediction model is obtained, and the effluent water quality parameters are predicted in real time.
Real-time monitoring and prediction of the effluent quality parameters of the sewage treatment plant is achieved, the operation efficiency of the sewage treatment plant and the compliance rate of the effluent water quality are improved, and the monitoring cost is reduced.
Smart Images

Figure CN119647647A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water quality prediction, and in particular to a method and device for predicting effluent water quality parameters based on a coupled sliding time window. Background Art
[0002] As an important part of the urban water environment, sewage treatment plants bear the key responsibility of purifying urban sewage and protecting the quality of the water environment. In order to ensure the normal operation of sewage treatment plants and the discharge of effluent water quality that meets the standards, real-time monitoring and prediction of effluent water quality parameters become particularly important. Traditional water quality monitoring methods usually rely on manual sampling and laboratory analysis, which is not only time-consuming and costly, but also unable to achieve real-time monitoring.
[0003] In recent years, with the development of artificial intelligence technology, especially deep learning methods, the application of time series prediction has become more and more extensive. Among them, the long short-term memory network model, as an effective variant of recurrent neural network, is widely used in time series prediction tasks, including water quality parameter prediction, because it can handle long-term dependency problems. However, the performance of the long short-term memory network model is affected by the input data format. Especially when processing data with obvious time series characteristics, how to reasonably organize the input data becomes the key. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a method and device for predicting effluent water quality parameters based on a coupled sliding time window, and to use a sliding time window to take a training label set as input for model training to fully consider the temporal changes of sewage treatment.
[0005] In the first aspect, an embodiment of the present invention provides a method for predicting effluent water quality parameters based on a coupled sliding time window, which is applied to a sewage treatment plant, and the method includes: obtaining historical water quality data of the sewage treatment plant; constructing a training label set based on the historical water quality data and a pre-set target time; inputting the training label set into a pre-constructed long short-term memory network model through a sliding time window for training to obtain an effluent water quality prediction model; inputting the current water quality data of the sewage treatment plant into the effluent water quality prediction model, and outputting effluent water quality parameters.
[0006] In a preferred embodiment of the present invention, the above-mentioned construction of a training label set based on historical water quality data and a pre-set target time includes: dividing the historical water quality data based on the data monitoring time of each data in the historical water quality data to obtain a water quality data set; extracting at least one target water quality data corresponding to the target time in the water quality data set; and using at least one target water quality data as a training label set.
[0007] In a preferred embodiment of the present invention, before extracting at least one target water quality data corresponding to the target time in the water quality data set, the method also includes: screening the water quality data set based on a preset standard deviation range to obtain multiple target historical water quality data; filling missing value processing and normalizing the multiple target historical water quality data to obtain a cleaned water quality data set.
[0008] In a preferred embodiment of the present invention, the water quality data set is screened based on a preset standard deviation range to obtain multiple target historical water quality data, including: eliminating historical water quality data in the water quality data set that does not meet three times the standard deviation to obtain multiple target historical water quality data.
[0009] In a preferred embodiment of the present invention, multiple target historical water quality data are processed for filling missing values and normalization to obtain a cleaned water quality data set, including: based on the distance between adjacent target historical water quality data, filling missing values according to a preset linear filling missing value rule to obtain an initial water quality data set; normalizing the initial water quality data set to obtain a cleaned water quality data set; wherein the linear filling missing value rule is: if the distance characterizing the target historical water quality data has non-missing values only on the left side, the missing values are filled with the values on the left side; if the distance characterizing the target historical water quality data has non-missing values only on the right side, the missing values are filled with the values on the right side; if the distance characterizing the target historical water quality data has non-missing values on both the left and right sides, linear interpolation calculation is performed based on the non-missing values on the left and right sides to obtain an estimated value of the missing value, so as to fill the missing value with the estimated value.
[0010] In a preferred embodiment of the present invention, the training label set is input into a pre-built long short-term memory network model through a sliding time window for training to obtain an outlet water quality prediction model, including: inputting training label sets of multiple different target times into a pre-built long short-term memory network model through a sliding time window for training to obtain an outlet water quality prediction model.
[0011] In a preferred embodiment of the present invention, the long short-term memory network model includes six layers, the first five layers are long short-term memory network layers, and the sixth layer is a fully connected layer; the first four layers each include 128 neurons, and each layer randomly discards 20% of the neurons during the calculation process; the fifth layer includes 64 neurons; the sixth layer is a fully connected layer for outputting a single prediction value; wherein each layer of the long short-term memory network model uses a bias weight.
[0012] In the second aspect, an embodiment of the present invention also provides an effluent water quality parameter prediction device based on a coupled sliding time window, which is applied to a sewage treatment plant, and the device includes: a historical water quality data acquisition module, which is used to acquire historical water quality data of the sewage treatment plant; a training label set construction module, which is used to construct a training label set based on historical water quality data and a pre-set target time; an effluent water quality prediction model acquisition module, which is used to input the training label set into a pre-constructed long short-term memory network model through a sliding time window for training to obtain an effluent water quality prediction model; an effluent water quality parameter output module, which is used to input the current water quality data of the sewage treatment plant into the effluent water quality prediction model and output the effluent water quality parameters.
[0013] In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned first aspect of the method for predicting effluent water quality parameters based on a coupled sliding time window.
[0014] The embodiments of the present invention bring the following beneficial effects:
[0015] The embodiment of the present invention provides a method and device for predicting effluent water quality parameters based on a coupled sliding time window, by acquiring historical water quality data of a sewage treatment plant, constructing a training label set based on the historical water quality data and a preset target time, inputting the training label set into a pre-constructed long short-term memory network model through a sliding time window for training, obtaining an effluent water quality prediction model, inputting the current water quality data of the sewage treatment plant into the effluent water quality prediction model, and outputting effluent water quality parameters. In this method, the training label set can be used as input for model training through a sliding time window to fully consider the temporal changes of sewage treatment.
[0016] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.
[0017] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A flow chart of a method for predicting effluent water quality parameters based on a coupled sliding time window provided in an embodiment of the present invention;
[0020] Figure 2 A flowchart of another method for predicting effluent water quality parameters based on a coupled sliding time window provided in an embodiment of the present invention;
[0021] Figure 3 A schematic diagram of the structure of an outlet water quality parameter prediction device based on a coupled sliding time window provided in an embodiment of the present invention;
[0022] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] With the rapid development of industrialization and urbanization, water shortage and water pollution are becoming increasingly serious. As an important part of the urban water environment, sewage treatment plants bear the key responsibility of purifying urban sewage and protecting the quality of the water environment. In order to ensure the normal operation of sewage treatment plants and the discharge of effluent water quality that meets the standards, real-time monitoring and prediction of effluent water quality parameters become particularly important. Traditional water quality monitoring methods usually rely on manual sampling and laboratory analysis, which is not only time-consuming and costly, but also unable to achieve real-time monitoring.
[0025] In recent years, with the development of artificial intelligence technology, especially deep learning methods, the application of time series prediction has become more and more extensive. Among them, the long short-term memory network model, as an effective variant of recurrent neural network, is widely used in time series prediction tasks, including water quality parameter prediction, because it can handle long-term dependency problems. However, the performance of the long short-term memory network model is affected by the input data format. Especially when processing data with obvious time series characteristics, how to reasonably organize the input data becomes the key.
[0026] Based on this, an embodiment of the present invention provides a method and device for predicting effluent water quality parameters based on a coupled sliding time window. The method and device can obtain historical water quality data of a sewage treatment plant, construct a training label set based on the historical water quality data and a preset target time, input the training label set into a pre-constructed long short-term memory network model through a sliding time window for training, obtain an effluent water quality prediction model, input the current water quality data of the sewage treatment plant into the effluent water quality prediction model, and output effluent water quality parameters. In this method, the training label set can be used as input for model training through a sliding time window to fully consider the temporal changes in sewage treatment.
[0027] To facilitate understanding of this embodiment, a method for predicting effluent water quality parameters based on a coupled sliding time window disclosed in an embodiment of the present invention is first introduced in detail.
[0028] Example 1
[0029] The embodiment of the present invention provides a method for predicting effluent water quality parameters based on a coupled sliding time window, which is applied to a sewage treatment plant. Figure 1 The present invention provides a flow chart of a method for predicting effluent water quality parameters based on a coupled sliding time window. Figure 1 As shown, the method for predicting effluent water quality parameters based on the coupled sliding time window may include the following steps:
[0030] Step S101, obtaining historical water quality data of a sewage treatment plant.
[0031] Among them, historical water quality data may include influent chemical oxygen demand, ammonia nitrogen, total nitrogen, total phosphorus, suspended solids, biochemical pool dissolved oxygen, biochemical pool suspended solids, biochemical pool aeration volume, transmembrane pressure difference, and transmembrane flow.
[0032] Step S102, constructing a training label set based on historical water quality data and a preset target time.
[0033] Among them, the historical water quality data at the target time can be used as a training label set.
[0034] In order to perform model training, a time period can be determined according to demand forecast conditions, and a time point within the time period is used as the target time, thereby obtaining multiple training label sets.
[0035] Step S103: input the training label set into a pre-built long short-term memory network model through a sliding time window for training to obtain an outlet water quality prediction model.
[0036] Among them, the training label sets corresponding to multiple target times can be used as input for model training.
[0037] Among them, the sliding time window method is a commonly used data preprocessing method, which can divide continuous time series data into multiple overlapping subsequences, each of which represents data within a period of time. By sliding the time window method, the temporal information in the time series data can be effectively utilized, thereby improving the performance of the prediction model.
[0038] The window size of the sliding time window may be x hours, where x may be determined based on actual conditions.
[0039] Among them, the long short-term memory network model contains six layers, the first five layers are long short-term memory network layers, and the sixth layer is a fully connected layer; the first four layers each contain 128 neurons, and each layer randomly discards 20% of the neurons during the calculation process; the fifth layer contains 64 neurons; the sixth layer is a fully connected layer used to output a single prediction value; among them, each layer of the long short-term memory network model uses bias weights.
[0040] Specifically, the training label set is input into a pre-built long short-term memory network model through a sliding time window for training to obtain an outlet water quality prediction model, which may include: inputting training label sets of multiple different target times into a pre-built long short-term memory network model through a sliding time window for training to obtain an outlet water quality prediction model.
[0041] Step S104, inputting the current water quality data of the sewage treatment plant into the effluent water quality prediction model, and outputting the effluent water quality parameters.
[0042] The output effluent water quality parameter may be at least one of effluent chemical oxygen demand, ammonia nitrogen, total nitrogen, total phosphorus, and suspended solids.
[0043] The outputted effluent water quality parameters may be effluent water quality parameters at different time points in the future.
[0044] The method for predicting effluent water quality parameters based on a coupled sliding time window provided by an embodiment of the present invention obtains historical water quality data of a sewage treatment plant, constructs a training label set based on the historical water quality data and a preset target time, inputs the training label set into a pre-constructed long short-term memory network model through a sliding time window for training, obtains an effluent water quality prediction model, inputs the current water quality data of the sewage treatment plant into the effluent water quality prediction model, and outputs effluent water quality parameters. In this method, the training label set can be used as input for model training through a sliding time window to fully consider the temporal changes in sewage treatment.
[0045] Example 2
[0046] An embodiment of the present invention also provides another method for predicting effluent water quality parameters based on a coupled sliding time window; this method is implemented on the basis of the method in the above embodiment; this method focuses on describing the specific implementation method of constructing a training label set based on historical water quality data and a pre-set target time.
[0047] Figure 2 A flowchart of another method for predicting effluent water quality parameters based on a coupled sliding time window provided in an embodiment of the present invention is shown in FIG. Figure 2 As shown, the training label set is constructed based on historical water quality data and a preset target time, and the following steps may be included:
[0048] Step S201 , dividing the historical water quality data based on the data monitoring time of each data in the historical water quality data to obtain a water quality data set.
[0049] Adjacent data monitoring times usually have the same time interval, which may be 1 hour.
[0050] Step S202, filtering the water quality data set based on a preset standard deviation range to obtain a plurality of target historical water quality data.
[0051] Specifically, screening the water quality data set based on a preset standard deviation range to obtain multiple target historical water quality data may include: eliminating historical water quality data that does not meet three times the standard deviation in the water quality data set to obtain multiple target historical water quality data.
[0052] Among them, the standard deviation range is the range of plus or minus 3 times the average value of historical water quality data. The calculation of the standard deviation is the conventional standard deviation calculation formula. After calculating the standard deviation of each historical water quality data, the historical water quality data outside the range of plus or minus 3 times the standard deviation of the average value is eliminated.
[0053] The calculation formula of standard deviation can be:
[0054] Where s represents the standard deviation, N represents the number of time points, and x i represents the historical water quality data at the i-th time point in the water quality data set, Represents the average value of historical water quality data at all time points, Represents the square of the difference between the historical water quality data at each time point and the average value.
[0055] Specifically, in, represents the average value of historical water quality data at all time points, N represents the number of time points, x i Represents the historical water quality data at the i-th time point in the water quality data set.
[0056] Step S203, performing missing value filling processing and normalization processing on multiple target historical water quality data to obtain a cleaned water quality data set.
[0057] Specifically, filling missing values and normalizing a plurality of target historical water quality data to obtain a cleaned water quality data set may include: filling missing values according to a preset linear missing value filling rule based on the distance between adjacent target historical water quality data to obtain an initial water quality data set; and normalizing the initial water quality data set to obtain a cleaned water quality data set.
[0058] Among them, the rule for linear filling of missing values is: if the historical water quality data representing the distance target has non-missing values only on the left side, the values on the left are used to fill the missing values; if the historical water quality data representing the distance target has non-missing values only on the right side, the values on the right are used to fill the missing values; if the historical water quality data representing the distance target has non-missing values on both sides, linear interpolation is performed based on the non-missing values on both sides to obtain the estimated value of the missing value, so as to fill the missing value with the estimated value.
[0059] Specifically, the estimated value can be calculated by the following formula:
[0060] Among them, y i represents the estimated value of the missing value; t 0 Indicates the position of the non-missing value on the left, and its corresponding value is x 0 ;t 1 Indicates the position of the non-missing value on the right, and its corresponding value is x 1 .
[0061] Among them, for normalization processing, the maximum and minimum values of the values in the initial water quality data set can be determined, and then the normalization processing is performed based on the maximum, minimum and original values of the data in the initial water quality data set by the following formula:
[0062] Step S204: extract at least one target water quality data corresponding to the target time from the cleaned water quality data set.
[0063] Step S205: taking at least one target water quality data as a training label set.
[0064] The effluent water quality parameter prediction method based on a coupled sliding time window provided in an embodiment of the present invention can use at least one target water quality data corresponding to the target time as a training label set, and then perform model training based on the training label sets corresponding to multiple target times to fully consider the temporal changes of sewage treatment.
[0065] Example 3
[0066] Corresponding to the above method embodiment, the embodiment of the present invention provides a device for predicting effluent water quality parameters based on a coupled sliding time window. Figure 3 A schematic diagram of the structure of a device for predicting effluent water quality parameters based on a coupled sliding time window provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the effluent water quality parameter prediction device based on the coupled sliding time window may include:
[0067] The historical water quality data acquisition module 301 is used to acquire the historical water quality data of the sewage treatment plant.
[0068] The training label set construction module 302 is used to construct a training label set based on historical water quality data and a preset target time.
[0069] The outlet water quality prediction model acquisition module 303 is used to input the training label set into the pre-built long short-term memory network model through a sliding time window for training to obtain the outlet water quality prediction model.
[0070] The effluent water quality parameter output module 304 is used to input the current water quality data of the sewage treatment plant into the effluent water quality prediction model and output the effluent water quality parameters.
[0071] The effluent water quality parameter prediction device based on the coupled sliding time window provided by the embodiment of the present invention obtains the historical water quality data of the sewage treatment plant, constructs a training label set based on the historical water quality data and the preset target time, inputs the training label set into the pre-constructed long short-term memory network model through the sliding time window for training, obtains the effluent water quality prediction model, inputs the current water quality data of the sewage treatment plant into the effluent water quality prediction model, and outputs the effluent water quality parameters. In this method, the training label set can be used as input for model training through the sliding time window to fully consider the temporal changes of sewage treatment.
[0072] In some embodiments, the training label set construction module is also used to divide the historical water quality data based on the data monitoring time of each data in the historical water quality data to obtain a water quality data set; extract at least one target water quality data corresponding to the target time in the water quality data set; and use the at least one target water quality data as a training label set.
[0073] In some embodiments, the training label set construction module is also used to filter the water quality data set based on a preset standard deviation range to obtain multiple target historical water quality data; fill missing values and normalize the multiple target historical water quality data to obtain a cleaned water quality data set.
[0074] In some embodiments, the training label set construction module is also used to eliminate historical water quality data that does not meet three times the standard deviation in the water quality data set to obtain multiple target historical water quality data.
[0075] In some embodiments, the training label set construction module is also used to fill missing values according to a preset linear filling missing value rule based on the distance between adjacent target historical water quality data to obtain an initial water quality data set; the initial water quality data set is normalized to obtain a cleaned water quality data set; wherein the linear filling missing value rule is: if the distance characterizing the target historical water quality data has non-missing values only on the left side, the missing values are filled with the values on the left side; if the distance characterizing the target historical water quality data has non-missing values only on the right side, the missing values are filled with the values on the right side; if the distance characterizing the target historical water quality data has non-missing values on both the left and right sides, a linear interpolation calculation is performed based on the non-missing values on the left and right sides to obtain an estimated value of the missing value, so as to fill the missing value with the estimated value.
[0076] In some embodiments, the outlet water quality prediction model acquisition module is also used to input multiple training label sets of different target times into a pre-built long short-term memory network model for training through a sliding time window to obtain an outlet water quality prediction model.
[0077] In some embodiments, the long short-term memory network model includes six layers, the first five layers are long short-term memory network layers, and the sixth layer is a fully connected layer; the first four layers each include 128 neurons, and each layer randomly discards 20% of the neurons during the calculation process; the fifth layer includes 64 neurons; the sixth layer is a fully connected layer for outputting a single prediction value; wherein each layer of the long short-term memory network model uses bias weights.
[0078] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0079] Example 4
[0080] The embodiment of the present invention also provides an electronic device for running the above-mentioned method for predicting effluent water quality parameters based on coupled sliding time windows; see Figure 4 A structural schematic diagram of an electronic device is shown, which includes a memory 400 and a processor 401, wherein the memory 400 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor 401 to implement the above-mentioned method for predicting effluent water quality parameters based on a coupled sliding time window.
[0081] Further, Figure 4The electronic device shown further includes a bus 402 and a communication interface 403 , and the processor 401 , the communication interface 403 and the memory 400 are connected via the bus 402 .
[0082] The memory 400 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 403 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 402 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0083] The processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 401. The above processor 401 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 gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 400, and the processor 401 reads the information in the memory 400 and completes the steps of the method of the above embodiment in combination with its hardware.
[0084] An embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned method for predicting effluent water quality parameters based on a coupled sliding time window. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0085] The computer program product for the method for predicting effluent water quality parameters based on a coupled sliding time window provided in an embodiment of the present invention includes a computer-readable storage medium storing a non-volatile program code executable by a processor. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0086] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0087] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0088] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0089] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0090] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0091] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for predicting effluent water quality parameters based on a coupled sliding time window, characterized in that: Applied to a sewage treatment plant, the method comprises: Obtaining historical water quality data of the sewage treatment plant; Building a training label set based on the historical water quality data and a preset target time; Inputting the training label set into a pre-built long short-term memory network model through a sliding time window for training to obtain an effluent water quality prediction model; The current water quality data of the sewage treatment plant is input into the effluent water quality prediction model, and the effluent water quality parameters are output.
2. The method according to claim 1, characterized in that: The step of constructing a training label set based on the historical water quality data and a preset target time includes: Dividing the historical water quality data based on the data monitoring time of each data in the historical water quality data to obtain a water quality data set; Extracting at least one target water quality data corresponding to the target time from the water quality data set; At least one of the target water quality data is used as a training label set.
3. The method according to claim 2, characterized in that Before extracting at least one target water quality data corresponding to the target time from the water quality data set, the method further includes: Screening the water quality data set based on a preset standard deviation range to obtain a plurality of target historical water quality data; The missing value filling and normalization processing are performed on the plurality of target historical water quality data to obtain a cleaned water quality data set.
4. The method according to claim 3, characterized in that The water quality data set is screened based on a preset standard deviation range to obtain a plurality of target historical water quality data, including: The historical water quality data that does not meet three times the standard deviation in the water quality data set are eliminated to obtain a plurality of target historical water quality data.
5. The method according to claim 3, characterized in that: The step of filling missing values and normalizing the target historical water quality data to obtain a cleaned water quality data set includes: Based on the distance between adjacent target historical water quality data, the missing values are filled in according to a preset linear missing value filling rule to obtain an initial water quality data set; Normalizing the initial water quality data set to obtain a cleaned water quality data set; The linear filling missing value rule is: If the distance represents that the target historical water quality data has non-missing values only on the left side, the values on the left side are used to fill the missing values; If the distance represents that the target historical water quality data has non-missing values only on the right side, the values on the right side are used to fill the missing values; If the distance represents that there are non-missing values on both sides of the target historical water quality data, linear interpolation is performed based on the non-missing values on both sides to obtain estimated values of the missing values, so as to fill the missing values with the estimated values.
6. The method according to claim 1, characterized in that The training label set is input into a pre-built long short-term memory network model through a sliding time window for training to obtain an outlet water quality prediction model, including: The training label sets of multiple different target times are input into the pre-built long short-term memory network model through a sliding time window for training to obtain the effluent water quality prediction model.
7. The method according to claim 1, characterized in that The long short-term memory network model includes six layers, the first five layers are long short-term memory network layers, and the sixth layer is a fully connected layer; the first four layers each include 128 neurons, and each layer randomly discards 20% of the neurons during the calculation process; the fifth layer includes 64 neurons; the sixth layer is a fully connected layer for outputting a single prediction value; wherein each layer of the long short-term memory network model uses a bias weight.
8. A device for predicting effluent water quality parameters based on a coupled sliding time window, characterized in that: Applied to a sewage treatment plant, the device comprises: A historical water quality data acquisition module, used to acquire the historical water quality data of the sewage treatment plant; A training label set construction module, used to construct a training label set based on the historical water quality data and a preset target time; The effluent water quality prediction model acquisition module is used to input the training label set into a pre-built long short-term memory network model through a sliding time window for training to obtain an effluent water quality prediction model; The effluent water quality parameter output module is used to input the current water quality data of the sewage treatment plant into the effluent water quality prediction model and output the effluent water quality parameters.
9. An electronic device, characterized in that: It includes a processor and a memory, the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method for predicting effluent water quality parameters based on a coupled sliding time window as described in 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. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to implement the method for predicting effluent water quality parameters based on a coupled sliding time window as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Sewage treatment plant effluent quality prediction method based on attention mechanism and long short-term memory network
CN115345344A
Water quality monitoring and early warning method and system based on big data technology
CN117115637A
Prediction deduction and safety real-time control method for biochemical reaction tank of sewage treatment plant
CN117389142A
Self-adaptive prediction method and system for residual chlorine in effluent of waterworks
CN117952242A
Cited By
Sewage treatment model dynamic optimization method based on time sequence rolling prediction and related equipment
CN121094244A