Pipe network residual chlorine optimization method based on residual chlorine attenuation mechanism model and intelligent model

By combining the residual chlorine attenuation mechanism model and intelligent model, the Patch-Transformer model is used to predict residual chlorine in the pipeline network, and the residual chlorine attenuation mechanism model is constructed based on the topological structure, the accuracy and explanatory prediction of residual chlorine attenuation in the existing technology are solved. The problem of efficient control of residual chlorine in the pipeline network and water quality safety guarantee.

CN118982117APending Publication Date: 2024-11-19ZHONG QING SHI YU NAN ZI LAI SHUI YOU XIAN GONG SI
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411070508.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-11-19

AI Technical Summary

Technical Problem

The existing micromechanical model and machine learning model have problems such as many parameters and difficulty in determining the rate and simplification in the prediction of residual chlorine in the pipeline network, resulting in inaccurate prediction. The machine learning model cannot give the residual chlorine in the entire pipeline network, and lacks Interpretability.

Method used

Combining the residual chlorine attenuation mechanism model and intelligent model, by obtaining the residual chlorine concentration and turbidity of the factory water, using the Patch-Transformer model for prediction, and constructing the residual chlorine attenuation mechanism model based on the topological structure, providing a chlorine prediction solution to realize the pipe adjustment Overall interpretability and visual control of recycled chlorine in the net.

Benefits of technology

Accurate prediction and abnormal judgment of the residual chlorine control nodes of the pipeline network are achieved, interpretable and visual chlorine adjustment schemes are provided, and water quality safety of the pipeline network is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982117A_ABST
    Figure CN118982117A_ABST
Patent Text Reader

Abstract

The invention relates to a pipe network residual chlorine optimization method based on a residual chlorine attenuation mechanism model and an intelligent model. The pipe network residual chlorine optimization method comprises the following steps: obtaining factory water residual chlorine concentration and / or factory water turbidity of a target pipe network; inputting the obtained factory water residual chlorine concentration and / or factory water turbidity into a pre-constructed target pipe network residual chlorine attenuation intelligent prediction model, and outputting the residual chlorine concentration of a pipe network residual chlorine control node after T time as a predicted value; when it is judged that the predicted value is an abnormal value, abnormal feedback is carried out; and performing chlorination adjustment by means of a pre-constructed residual chlorine attenuation mechanism model of the target pipe network so as to adjust the residual chlorine concentration of factory water. According to the method, abnormity judgment can be carried out based on advanced prediction of the residual chlorine concentration of the pipe network residual chlorine control node, and when it is judged that the residual chlorine concentration is abnormal in the future, a chlorine adding pre-judgment scheme can be guided based on a residual chlorine attenuation mechanism model simulated by the pipe network residual chlorine condition given on the whole, so that the water quality safety of the pipe network is better guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of water quality safety and water quality prediction of water supply pipe networks, and in particular to a pipe network residual chlorine optimization method based on a residual chlorine attenuation mechanism model and an intelligent model. In addition, it also relates to a pipe network residual chlorine optimization system based on a residual chlorine attenuation mechanism model and an intelligent model, and an electronic device for realizing a pipe network residual chlorine optimization method based on a residual chlorine attenuation mechanism model and an intelligent model. Background Art

[0002] Chlorine disinfection is the most widely used method in pipe network disinfection. Residual chlorine refers to the effective chlorine remaining in water after a certain period of contact with water after chlorination disinfection. The appropriate residual chlorine concentration in the water supply network is an important guarantee for the safety of the water quality in the pipe network. However, after chlorine is added to the water, it will react with organic and inorganic substances in the water and begin to decrease. Or, in old metal pipes, the corrosion of the pipe wall will cause the consumption of residual chlorine, which is collectively referred to as residual chlorine attenuation.

[0003] In order to ensure that there is an appropriate residual chlorine concentration in the water supply network, a variety of residual chlorine attenuation models have been proposed in existing studies to predict the attenuation of residual chlorine. Among them, the more typical microscopic mechanism model, also known as the network hydraulic model, is based on the kinetic model of residual chlorine attenuation and simulates the operating status of the urban water supply and drainage network system through computer software and hardware technology.

[0004] In addition, in recent years, with the continuous improvement of computer computing power, machine learning technology has also developed rapidly, and has made important contributions in various industries, including the water treatment industry. For example, in some studies, classification models, which are an important branch of machine learning technology, are used to warn of water quality events, that is, water quality data is divided into normal and abnormal data when the model is input, and the classification model is used to warn of abnormal water quality data that may appear in the future. In addition, compared with the use of classification models for early warning of water quality events, most studies use regression models to predict the attenuation of residual chlorine in the pipe network. For example, Tang Yu et al. used an improved radial basis function neural network (RBFNN) model to optimize the amount of chlorine added to the water plant, Bowden et al. used a generalized regression neural network (GRNN) to predict residual chlorine, Wakdar et al. used a feedforward neural network (FFNN) model to predict 27 indicators including residual chlorine, Mao et al. used a BP neural network (BPNN) model combined with EPANET software to study the odor produced by chlorine disinfection, and Soyupak et al. used a multilayer perceptron (MLP) model to predict node residual chlorine.

[0005] However, both the above-mentioned microscopic mechanism model and the machine learning model have their own advantages and disadvantages, and it is difficult to perfectly predict the residual chlorine attenuation.

[0006] Specifically, the microscopic mechanism model can predict the residual chlorine at any point in the topological structure of the pipe network through the construction of the topological structure of the pipe network, and the results are easy to explain, but its disadvantages are that there are many parameters and it is difficult to calibrate through experiments. In addition, due to the complexity of the actual pipe network, there is no way to achieve a completely consistent model construction, and it needs to be simplified. However, the simplification of the pipe network will reduce the accuracy of the prediction, especially when predicting the residual chlorine at the end of the pipe network, the impact of the simplification of the pipe network will be greater. At the same time, in order to accurately predict the daily residual chlorine attenuation, it is necessary to continuously adjust the parameters of the microscopic mechanism model according to the hydraulic conditions of the day, the water quality of the factory water, etc., which is inconvenient to use. Moreover, the residual chlorine attenuation law affected by factors such as the age, material, and biofilm of the pipe network is relatively complex. The traditional microscopic mechanism model is difficult to accurately predict the residual chlorine concentration of the pipe network, and the online residual chlorine monitoring feedback water plant chlorination adjustment has serious lag defects.

[0007] When using machine learning models to predict residual chlorine attenuation, it is only possible to predict the residual chlorine values ​​of some monitoring points in the pipeline network, but it is unable to give the residual chlorine situation of the entire pipeline network. In addition, when using machine learning to predict residual chlorine attenuation, due to the characteristics of its black box model, it can only directly output the prediction results, and cannot give an explanation of the reaction mechanism, which lacks interpretability. Summary of the invention

[0008] In view of this, the present invention provides a pipeline network residual chlorine optimization method and system based on a residual chlorine attenuation mechanism model and an intelligent model, which can accurately predict the residual chlorine concentration of the pipeline network residual chlorine control node based on the intelligent model in advance, so as to make an abnormal judgment based on the advanced prediction of the residual chlorine concentration of the pipeline network residual chlorine control node and feedback the abnormal values ​​that may appear in the future. When it is judged that the residual chlorine concentration will be abnormal in the future, the chlorine addition prediction plan can be guided based on the residual chlorine attenuation mechanism model that simulates the residual chlorine situation of the pipeline network as a whole, so as to provide explainability and visualization for the adjustment of residual chlorine from the pipeline network as a whole, thereby better ensuring the water quality safety of the pipeline network.

[0009] The first aspect of the present invention discloses a method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model, comprising the following steps:

[0010] Step S1, obtaining the residual chlorine concentration and / or turbidity of the outgoing water of the target pipe network; the residual chlorine concentration and / or turbidity of the outgoing water in the present invention refers to the residual chlorine concentration and / or turbidity of the outgoing water in the clear water tank of the water plant;

[0011] Step S2, inputting the obtained residual chlorine concentration of the outgoing water and / or the turbidity of the outgoing water into a pre-built target pipe network residual chlorine attenuation intelligent prediction model, wherein the residual chlorine attenuation intelligent prediction model is constructed to output the residual chlorine concentration of the pipe network residual chlorine control node after T time as a predicted value based on the residual chlorine concentration of the outgoing water and / or the turbidity of the outgoing water as input features;

[0012] Step S3, judging the predicted value output by the target pipe network residual chlorine attenuation intelligent prediction model, and providing abnormal feedback when it is judged to be an abnormal value;

[0013] Step S4, receiving abnormal feedback, and adjusting chlorine addition with the help of a pre-constructed target pipe network residual chlorine attenuation mechanism model to adjust the residual chlorine concentration of the outlet water; wherein the target pipe network residual chlorine attenuation mechanism model is constructed based on the topological structure of the target pipe network, and is constructed to simulate the residual chlorine concentration of all nodes of the target pipe network in different time periods.

[0014] In the present invention, it is necessary to pre-construct a target pipe network residual chlorine attenuation intelligent prediction model and a target pipe network residual chlorine attenuation mechanism model, wherein in the target pipe network residual chlorine attenuation intelligent prediction model, the residual chlorine concentration of the outlet water and the turbidity of the outlet water are used as input features, and after prediction by the target pipe network residual chlorine attenuation intelligent prediction model, the residual chlorine concentration of the pipe network residual chlorine control node can be output as an output feature. In other embodiments, in the target pipe network residual chlorine attenuation intelligent prediction model, one of the residual chlorine concentration of the outlet water and the turbidity of the outlet water can be used as an input feature, and the residual chlorine concentration of the output pipe network residual chlorine control node can be used as an output feature.

[0015] In addition, the residual chlorine attenuation mechanism model of the target pipe network is constructed based on the topological structure of the target pipe network, which can be based on EPANET 2 software. The so-called topological structure of the target pipe network refers to a visualization structure that simplifies the overall pipe network of the target area and represents the interconnection relationship and physical layout between the pipe sections and pipe segments of the pipe network, which can be based on EPANET 2 software.

[0016] The so-called target pipe network is the entire pipe network area within the target area (or region) where the layout prediction model is required to optimize the residual chlorine in the pipe network. In addition, the step of receiving abnormal feedback and adjusting chlorine addition with the help of the pre-built target pipe network residual chlorine attenuation mechanism model refers to predicting the water quality abnormality of the pipe network control point through the deep learning model. When it is determined to be abnormal, the parameters of the target pipe network residual chlorine attenuation mechanism model are further adjusted according to the temperature and hydraulic conditions at the time of the abnormality, and the target pipe network residual chlorine attenuation mechanism model is used to give a specific residual chlorine range of the factory water according to the desired residual chlorine concentration of the pipe network, so as to achieve the purpose of adjusting the residual chlorine concentration of the factory water based on the given residual chlorine range of the factory water.

[0017] In the above implementation process, the residual chlorine concentration and turbidity of the factory water of the target pipeline network are first obtained. This can be achieved with the help of sensors and signal transmission and processing, which is a prior art and will not be repeated here. After obtaining the relevant data on the residual chlorine concentration and turbidity of the factory water, it is input into the pre-built intelligent prediction model of residual chlorine attenuation of the target pipeline network. The intelligent prediction model of residual chlorine attenuation of the target pipeline network can predict the residual chlorine concentration of the pipeline network residual chlorine control node after T time based on the residual chlorine concentration and turbidity of the factory water, and output it as the output result; based on the output of the intelligent prediction model, it will be judged whether its value is abnormal. When it is judged that the output value of the intelligent prediction model is less than the rated value of the residual chlorine concentration set for the target pipeline network, it is judged that the residual chlorine concentration is abnormal. At this time, Feedback is issued, such as displaying abnormal residual chlorine concentration values ​​and issuing an alarm prompt; after receiving abnormal feedback based on the output value of the intelligent prediction model, the chlorine addition prediction plan can be guided based on the pre-constructed target pipeline network residual chlorine attenuation mechanism model, and because the target pipeline network residual chlorine attenuation mechanism model can simulate the residual chlorine concentration of all nodes in the target pipeline network in different time periods, it can be visualized and explained from the overall perspective whether the residual chlorine concentration of all nodes in the target pipeline network meets the preset residual chlorine concentration rating after adjusting the residual chlorine concentration of the factory water by adding chlorine or replenishing chlorine.

[0018] According to the pipeline network residual chlorine optimization method based on the residual chlorine attenuation mechanism model and the intelligent model disclosed in the first aspect of the present invention, the pipeline network residual chlorine control node is at least one of the multiple pipeline network water quality monitoring nodes set in the target pipeline network, and the pipeline network water quality monitoring node is selected based on the size ranking of the flow sensitivity matrix of each pipe section in the target pipeline network.

[0019] According to the pipeline network residual chlorine optimization method based on the residual chlorine attenuation mechanism model and the intelligent model disclosed in the first aspect of the present invention, the target pipeline network residual chlorine attenuation intelligent prediction model is a Transformer model including multiple Patch modules, which is constructed as follows: the multiple Patch modules divide the input matrix in the Transformer model into n sub-input matrices and input them separately.

[0020] Specifically, the Patch module divides the original input matrix into n 1×P matrices and inputs them separately. Compared with the original Transformer model that directly uses the entire M×L matrix as input, it reduces the computational complexity and enables the model to better learn the time dependence of the delay within each Patch. This is consistent with the characteristics of the data set in this study, that is, changes in residual chlorine and turbidity in factory water need to wait for a period of time before they can be reflected in the changes in residual chlorine at the pipe network control point. Training with the Patch-Transformer model with the Patch module can enable the model to better capture the delayed effects of changes in residual chlorine and turbidity in factory water on changes in residual chlorine at the pipe network control point.

[0021] According to the method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model disclosed in the first aspect of the present invention, the construction of an intelligent prediction model for residual chlorine attenuation in a target pipe network includes the following steps:

[0022] Configure a Transformer model including multiple Patch modules as the original model;

[0023] Acquire characteristic data, including: residual chlorine concentration of outgoing water, turbidity of outgoing water, pH value of outgoing water, and residual chlorine concentration of pipe network control nodes;

[0024] Preprocess the feature data;

[0025] Based on the preprocessed feature data, the original model is used to conduct feature ablation experiments to determine the feature combination; the feature combination is: residual chlorine concentration of outgoing water, turbidity of outgoing water, and residual chlorine concentration of pipe network control nodes;

[0026] Based on the feature combination, determine the sequence length and prediction length of the model;

[0027] A feature data set is constructed based on the feature combination and divided into a training set and a test set to train and test the original model until the final target pipe network residual chlorine attenuation intelligent prediction model is obtained.

[0028] According to the method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model disclosed in the first aspect of the present invention, the step of preprocessing characteristic data includes:

[0029] Interpolation method was used to fill missing values;

[0030] The completed data series of residual chlorine concentration at the control node of the pipe network is subjected to a time series test to determine whether it is stable, specifically, an ADF (Augmented Dickey-Fuller) test of the time series is performed.

[0031] According to the pipeline network residual chlorine optimization method based on the residual chlorine attenuation mechanism model and the intelligent model disclosed in the first aspect of the present invention, the construction of the target pipeline network residual chlorine attenuation mechanism model includes the following steps:

[0032] Collect basic data of target pipeline network;

[0033] Based on the collected basic data of the target pipe network, the topological structure of the target pipe network is established;

[0034] Based on the topological structure of the target pipe network, the parameters of each node and pipe section of the target pipe network are assigned, and a preliminary hydraulic model of the target pipe network is established;

[0035] The preliminary hydraulic model of the target pipe network is calibrated according to the data of the pipe network pressure monitoring points to obtain the final hydraulic model of the target pipe network;

[0036] Determine the residual chlorine main water attenuation coefficient and the residual chlorine pipe wall attenuation coefficient of the target pipe network, and import them into the hydraulic model of the target pipe network. At the same time, set the initial residual chlorine value of the effluent to obtain the preliminary model of the residual chlorine attenuation mechanism of the target pipe network.

[0037] The preliminary model of residual chlorine attenuation mechanism is calibrated to obtain the final residual chlorine attenuation mechanism model of the target pipeline network.

[0038] According to the method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model disclosed in the first aspect of the present invention, the step of obtaining a preliminary model of the residual chlorine attenuation mechanism of the target pipe network includes:

[0039] Select a sampling period and obtain the residual chlorine data of the residual chlorine control nodes in the pipe network within the sampling period;

[0040] The sampling period is divided into a high temperature period and a low temperature period, and the residual chlorine main water attenuation coefficient and the residual chlorine pipe wall attenuation coefficient in the high temperature period and the low temperature period are determined respectively; the accuracy of the model can be greatly improved by distinguishing the high temperature period and the low temperature period;

[0041] The determined residual chlorine main water attenuation coefficient and residual chlorine pipe wall attenuation coefficient of the high temperature period and the low temperature period are imported into the target pipe network hydraulic model, and the initial residual chlorine value of the outlet water is set to obtain the preliminary residual chlorine attenuation mechanism model of the high temperature period and the preliminary residual chlorine attenuation mechanism model of the low temperature period, respectively.

[0042] According to the method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model disclosed in the first aspect of the present invention, the step of verifying the preliminary residual chlorine attenuation mechanism model to obtain the final residual chlorine attenuation mechanism model of the target pipe network includes:

[0043] Based on the obtained residual chlorine data of the residual chlorine control node of the pipe network, the hourly average value of residual chlorine in the high temperature period and the coefficient of variation of the hourly average value of residual chlorine in the high temperature period are calculated, and the hourly average value of residual chlorine in the low temperature period and the coefficient of variation of the hourly average value of residual chlorine in the low temperature period are obtained;

[0044] Based on the calculated hourly average value and variation coefficient of residual chlorine in the high temperature period, the preliminary residual chlorine attenuation mechanism model in the high temperature period is calibrated to obtain the final residual chlorine attenuation mechanism model in the high temperature period; the calibration method based on the hourly average value and variation coefficient of residual chlorine is not easy to think of according to the existing technology, and can improve the accuracy of the calibration from a microscopic perspective;

[0045] At the same time, the preliminary residual chlorine attenuation mechanism model in the low-temperature period was calibrated based on the calculated hourly average value of residual chlorine in the low-temperature period and the coefficient of variation of the hourly average value of residual chlorine in the low-temperature period to obtain the final residual chlorine attenuation mechanism model in the low-temperature period.

[0046] The second aspect of the present invention discloses a pipe network residual chlorine optimization system based on a residual chlorine attenuation mechanism model and an intelligent model, comprising:

[0047] An acquisition unit, used for acquiring residual chlorine concentration and / or turbidity of outgoing water of a target pipe network;

[0048] An input unit, used for inputting the obtained residual chlorine concentration of the outgoing water and / or the turbidity of the outgoing water into a pre-built intelligent prediction model for residual chlorine attenuation of the target pipe network;

[0049] The target pipe network residual chlorine attenuation intelligent prediction unit includes a target pipe network residual chlorine attenuation intelligent prediction model, wherein the residual chlorine attenuation intelligent prediction model is constructed to output the residual chlorine concentration of the pipe network residual chlorine control node after T time as a predicted value based on the residual chlorine concentration of the outgoing water and / or the turbidity of the outgoing water as input characteristics;

[0050] A judgment feedback unit is used to judge the predicted value output by the target pipe network residual chlorine attenuation intelligent prediction model, and to provide abnormal feedback when it is judged to be an abnormal value;

[0051] A feedback receiving and adjusting unit includes a target pipe network residual chlorine attenuation mechanism model for receiving abnormal feedback, and adjusting the residual chlorine concentration of the outlet water by chlorination adjustment with the help of a pre-constructed target pipe network residual chlorine attenuation mechanism model; wherein the target pipe network residual chlorine attenuation mechanism model is constructed based on the topological structure of the target pipe network, and is constructed to simulate the residual chlorine concentration of all nodes of the target pipe network in different time periods.

[0052] The third aspect of the present invention also discloses an electronic device, which includes a processor and a memory; the memory stores a program, which is loaded and executed by the processor to implement the pipeline residual chlorine optimization method based on the residual chlorine attenuation mechanism model and the intelligent model as in the first aspect of the present invention.

[0053] Beneficial effect: The method and system for optimizing residual chlorine in a pipeline network based on the residual chlorine attenuation mechanism model and the intelligent model of the present invention can firstly make an abnormal judgment based on the advance prediction of the residual chlorine concentration of the residual chlorine control node in the pipeline network, and provide feedback on abnormal values ​​that may appear in the future. When it is judged that the residual chlorine concentration will be abnormal in the future, the chlorine addition prediction plan can be guided based on the residual chlorine attenuation mechanism model that simulates the residual chlorine situation in the pipeline network as a whole, thereby providing explainability and visualization for the adjustment of residual chlorine from the perspective of the pipeline network as a whole, thereby better ensuring the water quality safety of the pipeline network.

[0054] The following discloses in detail the method and system for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model in conjunction with the embodiments shown in the accompanying drawings and the accompanying figure numerals. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 The present invention shows a flow chart of the steps of the pipeline network residual chlorine optimization method based on the residual chlorine attenuation mechanism model and the intelligent model.

[0056] Figure 2 A schematic diagram of the Transformer intelligent algorithm structure is shown.

[0057] Figure 3 A schematic diagram showing the patch module adjusting the input matrix.

[0058] Figure 4 Shows the schematic diagram of the destabilizing attention module structure

[0059] Figure 5 A schematic diagram showing the topology of the pipe network

[0060] Figure 6 Schematic diagram showing the distribution of water quality monitoring nodes in the pipe network DETAILED DESCRIPTION

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

[0062] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.

[0063] Figure 1 The flowchart of the steps of the pipeline network residual chlorine optimization method based on the residual chlorine attenuation mechanism model and the intelligent model of the present invention is shown. Figure 1 As shown, the first aspect of the present invention discloses a method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model, comprising the following steps:

[0064] Step S1, obtaining the residual chlorine concentration and / or turbidity of the outgoing water of the target pipe network;

[0065] Step S2, inputting the obtained residual chlorine concentration of the outgoing water and / or the turbidity of the outgoing water into a pre-built target pipe network residual chlorine attenuation intelligent prediction model, wherein the residual chlorine attenuation intelligent prediction model is constructed to output the residual chlorine concentration of the pipe network residual chlorine control node after T time as a predicted value based on the residual chlorine concentration of the outgoing water and / or the turbidity of the outgoing water as input features;

[0066] Step S3, judging the predicted value output by the target pipe network residual chlorine attenuation intelligent prediction model, and providing abnormal feedback when it is judged to be an abnormal value;

[0067] Step S4, receiving abnormal feedback, and adjusting chlorine addition with the help of a pre-constructed target pipe network residual chlorine attenuation mechanism model to adjust the residual chlorine concentration of the outlet water; wherein the target pipe network residual chlorine attenuation mechanism model is constructed based on the topological structure of the target pipe network, and is constructed to simulate the residual chlorine concentration of all nodes of the target pipe network in different time periods.

[0068] In the present invention, the pipe network residual chlorine control node is at least one of the multiple pipe network water quality monitoring nodes set in the target pipe network, and the pipe network water quality monitoring node is selected based on the size ranking of the flow sensitivity matrix of each pipe section in the target pipe network. In other words, the arrangement of the pipe network water quality monitoring nodes can be carried out based on the ranking of the flow sensitivity matrix of each pipe section, so as to select relatively important pipe network nodes for monitoring. Figure 6 A schematic diagram showing the distribution determination of water quality monitoring nodes in the pipe network is shown.

[0069] For example, for a pipe network with m pipe segments and n nodes, the flow sensitivity matrix is ​​calculated as follows:

[0070] First, calculate the influence coefficient X of the pipe section ik :

[0071]

[0072] Where: Q i ——The flow rate of the i-th pipe section under the selected working condition;

[0073] Q′ i——The flow rate of the i-th pipe section when the flow rate of the k-node is changed;

[0074] q k ——Node flow of the kth node under the selected working condition;

[0075] q′ k ——The traffic of k nodes after the change.

[0076] Get X ik After that, the sensitivity S of each pipe section is further calculated. i :

[0077]

[0078] Matlab software can be used to read EPANET 2 software parameter data and output data, so this application uses Matlab 2022a software to calculate and sort the sensitivity of the pipe sections. At the same time, the EPANET-Matlab Toolkit toolbox also provides visualization tools to facilitate direct visualization output of results and mark the end nodes of the top five pipe sections in terms of sensitivity. Combined with the actual situation of the pipeline network, including the sampling points reserved during the construction of the pipeline network, the convenience of power supply, the difficulty of management, etc., multiple pipeline network monitoring points (four or more) were determined, and one of the pipeline network monitoring points at the end of the pipeline network was used as the residual chlorine control node of the pipeline network. A residual chlorine online monitoring instrument with data transmission function was installed to obtain the actual water quality of the pipeline network, laying the foundation for the construction of the residual chlorine attenuation model.

[0079] In the present invention, the target pipe network residual chlorine attenuation intelligent prediction model is constructed such that the residual chlorine concentration of the outlet water and the turbidity of the outlet water are used as input features. After prediction by the target pipe network residual chlorine attenuation intelligent prediction model, the residual chlorine concentration of the pipe network residual chlorine control node can be output as an output feature.

[0080] In a specific preferred embodiment, the target pipe network residual chlorine attenuation intelligent prediction model is constructed based on the Transformer intelligent algorithm structure, which includes a Transformer model of multiple Patch modules. The structure is that the multiple Patch modules divide the input matrix in the Transformer model into n sub-input matrices and input them separately.

[0081] Figure 2 Figure 2 shows a schematic diagram of the Transformer intelligent algorithm structure. Figure 2As shown in Figure 1, the Transformer intelligent algorithm mainly consists of two parts: an n-layer encoder and an n-layer decoder. The core of the Transformer intelligent algorithm is the self-attention mechanism, which can learn the correlations between different positions in the sequence and use these correlations to capture the long-term dependencies of time series data during prediction. Specifically, the self-attention mechanism uses the attention weight matrix W Q , W K and W V The weights are used to determine the importance of each input position for the current prediction. These weights are used to weight the sum of the encoded representations of the input sequence to produce the output of the model. The three matrices Q (Query), K (Key), and V (Value) all come from the same input and are calculated as follows. First, the dot product between Q and K is calculated. To prevent the result from being too large, it is divided by This is to keep the gradient stable throughout the training process and avoid the problem of gradient disappearance. k is the dimension of the Key vector, and then the Softmax operation is used to normalize it into a probability distribution, and then multiplied by the matrix V to get the weighted sum representation. The entire calculation process can be expressed as:

[0082]

[0083] In the encoder, the input matrix is ​​calculated by the self-attention mechanism and then output through a feedforward network. In the decoder, there are two self-attention calculations, and the matrices K and V in the second calculation come from the output of the encoder. Finally, the whole model is output through a feedforward network.

[0084] In general, the principle of using the Transformer intelligent algorithm for time series prediction is to capture the long-term dependencies in the sequence through the self-attention mechanism and consider the correlations at different positions when predicting. Accurate time series prediction can be achieved by reasonably designing the model structure, selecting appropriate loss functions and optimization algorithms, and dealing with specific problems of time series data.

[0085] In the intelligent model of the present invention, the original Transformer model includes a Patch module, and the included Patch module adjusts the matrix input of the Transformer model, such as Figure 3 As shown. Combined Figure 3As shown in the figure, the Patch module divides the original input matrix into n 1×P matrices and inputs them separately. Compared with the original Transformer model that directly uses the entire M×L matrix as input, it reduces the computational complexity and enables the model to better learn the time dependence of the delay within each Patch. This is consistent with the characteristics of the data set in this study, that is, changes in residual chlorine and turbidity in factory water need to wait for a period of time before they can be reflected in the changes in residual chlorine at the pipe network control point. Training with the Patch-Transformer model with the Patch module can enable the model to better capture the delayed effects of changes in residual chlorine and turbidity in factory water on changes in residual chlorine at the pipe network control point.

[0086] In the present invention, the construction of the target pipe network residual chlorine attenuation intelligent prediction model includes the following steps:

[0087] Configure the Transformer model including multiple Patch modules as the original model;

[0088] Acquire characteristic data, including: residual chlorine concentration of outgoing water, turbidity of outgoing water, pH value of outgoing water, and residual chlorine concentration of pipe network control nodes;

[0089] Preprocess the feature data;

[0090] Based on the preprocessed feature data, the original model is used to conduct feature ablation experiments to determine the feature combination; the feature combination is: residual chlorine concentration of outgoing water, turbidity of outgoing water, and residual chlorine concentration of pipe network control nodes;

[0091] Based on the feature combination, determine the sequence length and prediction length of the model;

[0092] A feature data set is constructed based on the feature combination and divided into a training set and a test set to train and test the original model until the final target pipe network residual chlorine attenuation intelligent prediction model is obtained.

[0093] In the present invention, the data set collected is the target pipe network from 13:00:00 on September 27, 2023 to 00:00:00 on March 1, 2024, with a total of 4 columns of data, factory water residual chlorine (C0), factory water pH value (pH), factory water turbidity (Turb), and pipe network control point residual chlorine (C3), which are recorded every 10 minutes. As shown in Table 1, there are a total of 22388 rows.

[0094] Table 1 Collection of datasets

[0095]

[0096] In the present invention, the step of preprocessing the feature data includes:

[0097] The missing values ​​were filled by interpolation. Specifically, the integrity of the data set was checked and it was found that the data at some moments were missing, mainly due to instrument abnormalities or offline conditions. The missing values ​​were filled by interpolation.

[0098] The data series of residual chlorine concentration at the completed pipe network control node is tested for time series to determine whether it is stable, specifically, the ADF (Augmented Dickey-Fuller) test of the time series is performed; specifically, the ADF (Augmented Dickey-Fuller) test of the time series is performed using Python. The ADF test results include test statistics, critical values, and p-values. If the test statistic is less than the critical value, and the p-value is less than the significance level (usually set to 0.05), the null hypothesis can be rejected, that is, the data does not have a unit root, and the data is considered to be stable. If the test statistic is greater than the critical value, or the p-value is greater than the significance level, the null hypothesis cannot be rejected, that is, the data has a unit root, and the data is considered to be non-stationary.

[0099] In the present invention, based on the preprocessed feature data, the original model is used to perform a feature ablation experiment to determine the steps of feature combination, including: using the initially constructed Transformer model to perform a feature ablation experiment, first setting the input sequence length (seq_len) and the prediction sequence length (pred_len) to 144, that is, during model training, verification, and testing, the data of the first 24 hours are used to predict the data of the next 24 hours, and the prediction ability of the model under different feature combinations is verified. Among them, the residual chlorine (C0) of the factory water is a variable with a direct time correlation with the residual chlorine (C3) of the predicted target pipe network control point, and feature ablation is not performed. Feature ablation experiments are performed on the two features of the pH value (pH) of the factory water and the turbidity (Turb) of the factory water. The experimental results are shown in Table 2.

[0100] Table 2 Prediction performance of different feature combinations

[0101]

[0102] When all four features are used as input, the water quality prediction error δ of the initially constructed Transformer model is 6.75%. The results of the feature ablation experiment show that pH value is a negative feature in this model construction. When pH is removed from the combination of all features, the water quality prediction error δ is reduced from 6.75% to 5.98%, and the prediction performance is improved by 11.4% compared with before removal; when pH is removed from the C3_C0_pH three-feature combination, the water quality prediction error δ is reduced from 8.47% to 7.53%, and the prediction performance is improved by 11.1% compared with before removal. The turbidity of the factory water (Turb) is a positive feature. When Turb is removed from the combination of all features, the water quality prediction error δ is increased from 6.75% to 8.47%, and the prediction performance is reduced by 25.5% compared with before removal; when Turb is removed from the C3_C0_Turb three-feature combination, the water quality prediction error δ is increased from 5.98% to 7.53%, and the prediction performance is reduced by 25.9% compared with before removal.

[0103] Therefore, according to the results of the ablation experiment, when the residual chlorine of the outlet water (C0), the residual chlorine of the control point (C3) and the turbidity of the outlet water (Turb) are used to predict the residual chlorine of the control point of the pipeline network, the model prediction performance reaches the best level.

[0104] Then, the optimal sequence length and prediction length of the model were explored using the three feature combinations of residual chlorine in factory water (C0), residual chlorine at the control point (C3) and turbidity of factory water (Turb). The experimental results are shown in Table 3.

[0105] Table 3 Prediction performance of different sequence lengths and prediction lengths

[0106]

[0107] As shown in Table 3, in the model test results, when the sequence length is 144 (i.e. 24 hours) and the prediction length is 72 (i.e. 12 hours), the Transformer residual chlorine attenuation intelligent model initially constructed has the best accuracy, and the water quality prediction error δ reaches 5.95%. Considering the actual water age and prediction requirements of the pipeline network, the prediction length of 12 hours can already meet the needs of residual chlorine adjustment of factory water. When the sequence length is 144, the prediction effect of the model is more stable compared with the shorter sequence length. This is because when the sequence length is longer, the model can better capture the features in the sequence, thereby obtaining a more stable prediction result. Therefore, in subsequent experiments, the three-feature combination of C3, C0, and Turb is determined as the model input, and the sequence length is determined to be 144 and the prediction length is determined to be 72.

[0108] Based on the previously determined feature combinations, sequence lengths, and prediction lengths, the data set is uniformly divided into 60% training sets, 20% validation sets, and 20% test sets. The original model built based on the Transformer intelligent algorithm structure is then trained and tested. Normalization and denormalization operations are performed when data is input into the model and prediction results are output until an intelligent model that meets the requirements is obtained.

[0109] In the present invention, the construction and optimization of the residual chlorine attenuation intelligent model is carried out based on the Transformer intelligent algorithm, which can predict the possible abnormal changes of residual chlorine at the pipe network control point up to 12 hours in advance. Finally, the optimized Patch-Transformer model achieved the best results, and the water quality prediction error δ can be as low as 5.34% for the residual chlorine concentration of the pipe network control point in the next 12 hours. If the constructed residual chlorine attenuation mechanism model is used to directly predict the actual daily residual chlorine concentration of the pipe network control point, the water quality prediction error δ is 9.13%, and the prediction performance of the optimized Patch-Transformer model is improved by 41.51% compared with the residual chlorine attenuation mechanism model, which can better predict the residual chlorine concentration of the pipe network control point without manual verification and adjustment of parameters.

[0110] The present invention also provides another Transformers model with an additional de-static attention (DA) module, wherein the structural diagram of the de-static attention module is as follows: Figure 3 As shown in Figure 1, a destabilizing attention module is introduced into the original Transformers model. The destabilizing attention module enhances the feature learning ability of the model by introducing a new destabilizing factor. First, after normalizing the input, the mean μ of the input is calculated. X With variance As shown in Equation 1 and Equation 2, the normalized x i ′ can be recorded as formula 3:

[0111]

[0112] After the normalized sequence enters the self-attention mechanism, the calculation of matrices Q and K can be written as Equation 4:

[0113]

[0114] Substitute the obtained matrices Q′ and K′ into the Softmax calculation of the self-attention mechanism. Since the Softmax calculation is translation invariant, the Softmax calculation can be written as the following formula 4.5:

[0115]

[0116] Compared with directly inputting the original data, normalizing the data before inputting it will increase the Softmax calculation. Items and Therefore, the core of the destabilized self-attention mechanism is to introduce a scale scaling factor Translation Factor And use an MLP layer to learn these two factors:

[0117] logτ=MLP(σ X ,X),Δ=MLP(μ X ,X) (6)

[0118] The Transformer model with the destabilization attention module added is used for prediction, and it is named DA-Transformer model. Due to the introduction of a new MLP layer, the parameters, namely the dimension of the hidden layer, need to be further determined. The dimension of the hidden layer affects the learning ability of the MLP layer for the destabilization factor. The hidden layer dimension can be empirically taken as a power of 2. The hidden layer dimensions of 64, 128, 256, and 512 are used for experiments. The remaining parameters are set to be consistent with the previously constructed Transformer model. The three feature combinations of factory water residual chlorine (C0), factory water turbidity (Turb), and pipe network control point residual chlorine (C3) are still used for input, and the sequence length of 144 and the prediction length of 72 are set. The experimental results are shown in Table 4.

[0119] Table 4 Prediction performance of DA-Transformer model with different hidden layer dimensions

[0120]

[0121] According to the experimental results shown in Table 4, regardless of the value of the hidden layer dimension, the MSE, MAE and water quality prediction error δ are all increased compared to the initial Transformer model.

[0122] In another preferred embodiment of the present invention, an intelligent prediction model is provided, which is constructed based on the original Transformer model, including a Patch module for adjusting the matrix input of the Transformer model, and also including a destabilizing attention module, so as to form a final target pipe network residual chlorine attenuation intelligent prediction model after training and testing with a data set.

[0123] In addition, in the present invention, the construction of the target pipe network residual chlorine attenuation mechanism model includes the following steps:

[0124] Collect the basic data of the target pipe network; the basic data includes the number, location, elevation, water volume of the node, the number, length, diameter, material and laying year of the pipe section;

[0125] Based on the collected basic data of the target pipe network, the topological structure of the target pipe network is established; it means that after a certain simplification of the actual water supply pipe network system, it is visualized as a pipe network graph in the software interface, such as Figure 5 As shown;

[0126] Based on the topological structure of the target pipe network, the parameters of each node and pipe section of the target pipe network are assigned, and a preliminary hydraulic model of the target pipe network is established; the parameters come from the pipe network census and GIS data provided by the water company, and the parameters are assigned in EPANET2 software;

[0127] The preliminary hydraulic model of the target pipe network is calibrated according to the data of the pipe network pressure monitoring points to obtain the final hydraulic model of the target pipe network;

[0128] Determine the residual chlorine main water attenuation coefficient and the residual chlorine pipe wall attenuation coefficient of the target pipe network, and import them into the hydraulic model of the target pipe network. At the same time, set the initial residual chlorine value of the effluent to obtain the preliminary model of the residual chlorine attenuation mechanism of the target pipe network.

[0129] The preliminary model of residual chlorine attenuation mechanism is calibrated to obtain the final residual chlorine attenuation mechanism model of the target pipeline network.

[0130] According to the method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model disclosed in the first aspect of the present invention, the step of obtaining a preliminary model of the residual chlorine attenuation mechanism of the target pipe network includes:

[0131] Select a sampling period and obtain the residual chlorine data of the residual chlorine control nodes in the pipe network within the sampling period;

[0132] The sampling period is divided into a high temperature period and a low temperature period, and the residual chlorine main body water attenuation coefficient and the residual chlorine pipe wall attenuation coefficient in the high temperature period and the low temperature period are determined respectively;

[0133] The determined residual chlorine main water attenuation coefficient and residual chlorine pipe wall attenuation coefficient of the high temperature period and the low temperature period are imported into the target pipe network hydraulic model, and the initial residual chlorine value of the outlet water is set to obtain the preliminary residual chlorine attenuation mechanism model of the high temperature period and the preliminary residual chlorine attenuation mechanism model of the low temperature period, respectively.

[0134] Among them, the specific method for calibrating the target network hydraulic preliminary model based on the data of the network pressure monitoring point is: first take a pressure monitoring point as an example, use the real-time pressure value of the network pressure measuring point to form a calibration file, adjust the parameters in the EPANET model, and at the same time, change the node water demand calculated by the flow rate ratio method to collect the actual water sales volume and average it before assigning the water demand of each node. In addition, the actual operation of all water pumps in the area was collected, and the water pump scheduling during software simulation was refined; after optimization, the pressure of the node was compared with the actual pressure again. According to the calculation, the average error of the pressure point after calibration was reduced from the original 1.74m to 0.97m. At the same time, the data of the remaining pressure monitoring points of the network were used for calibration, and some node parameters were adjusted until the most accurate hydraulic model under the existing data was obtained, and the pressure error of all pressure monitoring points was within 5m.

[0135] After the hydraulic module is calibrated, if the accuracy meets the requirements, the model is output; if the accuracy does not meet the requirements, it returns to the parameter assignment step until the accuracy meets the requirements and the model is output.

[0136] The sampling period represents a time period. As mentioned earlier in the present invention, the collected data set is the target network from 13:00:00 on September 27, 2023 to 00:00:00 on March 1, 2024. Based on this, the residual chlorine data collected this time is divided into two stages: high temperature period and low temperature period with December 15 as the boundary; regarding the determination of the main water attenuation coefficient of residual chlorine in the network, the factory water sample can be taken out for a bottle test of the main water attenuation coefficient of residual chlorine in the network. Specifically, a 500mL brown glass bottle is used to sample the factory water, and the free chlorine content is tested during sampling. The sample is placed in a dark place in the laboratory, and the room temperature is ensured to be close to the sampling water temperature. In 12 hours, the free chlorine content of the sample is tested every 2 hours, and ln(Ct / C0) is calculated.

[0137] In the present invention, the residual chlorine main water attenuation coefficient k in the high temperature period and the low temperature period are respectively b Set to -0.75d -1 and -0.44d -1 According to the residual chlorine data of the four monitoring points obtained during actual sampling, the residual chlorine pipe wall attenuation coefficient was estimated and initially determined to be 0.8d -1 In EPANET, the residual chlorine in the factory water was set to 0.7 mg / L, and the residual chlorine attenuation mechanism model of the pipeline network was initially constructed. The hourly average residual chlorine of the pipeline network control point during high and low temperature periods was used to calibrate the model.

[0138] In addition, in the present invention, the steps of verifying the preliminary model of residual chlorine attenuation mechanism and obtaining the final residual chlorine attenuation mechanism model of the target pipe network include:

[0139] Based on the obtained residual chlorine data of the residual chlorine control node of the pipe network, the hourly average value of residual chlorine in the high temperature period and the coefficient of variation of the hourly average value of residual chlorine in the high temperature period are calculated, and the hourly average value of residual chlorine in the low temperature period and the coefficient of variation of the hourly average value of residual chlorine in the low temperature period are obtained;

[0140] Based on the calculated hourly average value and variation coefficient of residual chlorine in the high temperature period, the preliminary residual chlorine attenuation mechanism model in the high temperature period is calibrated to obtain the final residual chlorine attenuation mechanism model in the high temperature period;

[0141] At the same time, the preliminary residual chlorine attenuation mechanism model in the low-temperature period was calibrated based on the calculated hourly average value of residual chlorine in the low-temperature period and the coefficient of variation of the hourly average value of residual chlorine in the low-temperature period to obtain the final residual chlorine attenuation mechanism model in the low-temperature period.

[0142] In the prior art, the mechanism model and the intelligent model each have their own advantages and disadvantages. The network residual chlorine attenuation mechanism model can grasp the water quality of the entire network based on the accurate hydraulic model constructed, and can quickly adjust to adapt to changes in working conditions, new pipelines, etc., but its main disadvantage is that it requires researchers to adjust its parameters in a timely manner, which is inconvenient to use; the residual chlorine attenuation intelligent model can predict the residual chlorine concentration of the network control point in real time based on big data with high accuracy, and does not require researchers to frequently check and update parameters, but the intelligent model can only output the prediction results of the network control point where the model training data is located, and cannot predict the residual chlorine concentration of the rest of the network.

[0143] The present invention simultaneously constructs a residual chlorine attenuation mechanism model of the target area pipe network and a residual chlorine attenuation intelligent model of the pipe network control node, and uses the intelligent model to predict the residual chlorine concentration of the control point in the next 12 hours. When the predicted value is abnormal, the mechanism model is used to guide the formulation of the chlorination pre-judgment plan, and the residual chlorine of the factory water is adjusted to ensure the safety of the pipe network water quality. Compared with the previous judgment of the pipe network water quality through water quality complaints or only based on the real-time data of online monitoring equipment, this solution can predict the residual chlorine concentration of the pipe network monitoring point 12 hours in advance and feedback the results, and formulate a chlorination plan in advance. The present invention puts the two models into use at the same time in the project, taking advantage of their strengths and avoiding their weaknesses, so as to achieve the purpose of optimizing the addition of residual chlorine and further ensuring the safety of the pipe network water quality.

[0144] For ease of description, spatially relative terms such as "above", "above", "on the upper surface of", "above", etc. may be used here to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" can include both "above" and "below". The device can also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatially relative descriptions used here are interpreted accordingly.

[0145] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0146] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0147] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.

Claims

1. A method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model, characterized in that: The following steps are included: Step S1, obtaining the residual chlorine concentration and / or turbidity of the outgoing water of the target pipe network; Step S2, inputting the obtained residual chlorine concentration of the outgoing water and / or the turbidity of the outgoing water into a pre-built target pipe network residual chlorine attenuation intelligent prediction model, wherein the residual chlorine attenuation intelligent prediction model is constructed to output the residual chlorine concentration of the pipe network residual chlorine control node after T time as a predicted value based on the residual chlorine concentration of the outgoing water and / or the turbidity of the outgoing water as input features; Step S3, judging the predicted value output by the target pipe network residual chlorine attenuation intelligent prediction model, and providing abnormal feedback when it is judged to be an abnormal value; Step S4, receiving abnormal feedback, and adjusting chlorine addition by means of a pre-built target pipe network residual chlorine attenuation mechanism model to adjust the residual chlorine concentration of the factory water; The residual chlorine attenuation mechanism model of the target pipe network is constructed based on the topological structure of the target pipe network, and its structure is capable of simulating the residual chlorine concentration of all nodes in the target pipe network in different time periods.

2. The method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model according to claim 1, characterized in that: The pipe network residual chlorine control node is at least one of a plurality of pipe network water quality monitoring nodes provided in the target pipe network, and the pipe network water quality monitoring node is selected based on the size ranking of the flow sensitivity matrix of each pipe section in the target pipe network.

3. The method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model according to claim 2, characterized in that: The target pipe network residual chlorine attenuation intelligent prediction model is a Transformer model including multiple Patch modules, and its structure is that the multiple Patch modules divide the input matrix in the Transformer model into n sub-input matrices and input them separately.

4. The method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model according to claim 3, characterized in that: in, The construction of the target pipe network residual chlorine attenuation intelligent prediction model includes the following steps: Configure a Transformer model including multiple Patch modules as the original model; Acquire characteristic data, wherein the characteristic data includes: residual chlorine concentration of outgoing water, turbidity of outgoing water, pH value of outgoing water, and residual chlorine concentration of a pipe network control node; Preprocess the feature data; Based on the preprocessed feature data, the original model is used to conduct feature ablation experiments to determine the feature combination; the feature combination is: residual chlorine concentration of outgoing water, turbidity of outgoing water, and residual chlorine concentration of pipe network control nodes; Based on the feature combination, determining the sequence length and prediction length of the model; A feature data set is constructed based on the feature combination and is divided into a training set and a test set to train and test the original model until the final target pipe network residual chlorine attenuation intelligent prediction model is obtained.

5. The method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model according to claim 4, characterized in that: in, The steps for preprocessing feature data include: Interpolation method was used to fill missing values; The completed data series of residual chlorine concentration at the control nodes of the pipe network is subjected to a time series test to determine whether it is stable.

6. The method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model according to claim 1, characterized in that: in, The construction of the target pipe network residual chlorine attenuation mechanism model includes the following steps: Collect basic data of target pipeline network; Based on the collected basic data of the target pipe network, the topological structure of the target pipe network is established; Based on the topological structure of the target pipe network, the parameters of each node and pipe section of the target pipe network are assigned, and a preliminary hydraulic model of the target pipe network is established; The preliminary hydraulic model of the target pipe network is calibrated according to the data of the pipe network pressure monitoring points to obtain the final hydraulic model of the target pipe network; Determine the residual chlorine main water attenuation coefficient and the residual chlorine pipe wall attenuation coefficient of the target pipe network, and import them into the hydraulic model of the target pipe network. At the same time, set the initial residual chlorine value of the effluent to obtain the preliminary model of the residual chlorine attenuation mechanism of the target pipe network. The preliminary model of residual chlorine attenuation mechanism is calibrated to obtain the final residual chlorine attenuation mechanism model of the target pipeline network.

7. The method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model according to claim 6, It is characterized in that The steps of obtaining a preliminary model of the residual chlorine attenuation mechanism of the target pipe network include: Select a sampling period and obtain the residual chlorine data of the residual chlorine control nodes in the pipe network within the sampling period; The sampling period is divided into a high temperature period and a low temperature period, and the residual chlorine main body water attenuation coefficient and the residual chlorine pipe wall attenuation coefficient in the high temperature period and the low temperature period are determined respectively; The determined residual chlorine main water attenuation coefficient and residual chlorine pipe wall attenuation coefficient of the high temperature period and the low temperature period are imported into the target pipe network hydraulic model, and the initial residual chlorine value of the outlet water is set to obtain the preliminary residual chlorine attenuation mechanism model of the high temperature period and the preliminary residual chlorine attenuation mechanism model of the low temperature period, respectively.

8. The method for optimizing residual chlorine in a pipe network based on a residual chlorine attenuation mechanism model and an intelligent model according to claim 7, It is characterized in that Among them, the steps of verifying the preliminary model of residual chlorine attenuation mechanism and obtaining the final residual chlorine attenuation mechanism model of the target pipe network include: Based on the obtained residual chlorine data of the residual chlorine control node of the pipe network, the hourly average value of residual chlorine in the high temperature period and the coefficient of variation of the hourly average value of residual chlorine in the high temperature period are calculated, and the hourly average value of residual chlorine in the low temperature period and the coefficient of variation of the hourly average value of residual chlorine in the low temperature period are obtained; Based on the calculated hourly average value and variation coefficient of residual chlorine in the high temperature period, the preliminary residual chlorine attenuation mechanism model in the high temperature period is calibrated to obtain the final residual chlorine attenuation mechanism model in the high temperature period; At the same time, the preliminary residual chlorine attenuation mechanism model in the low-temperature period was calibrated based on the calculated hourly average value of residual chlorine in the low-temperature period and the coefficient of variation of the hourly average value of residual chlorine in the low-temperature period to obtain the final residual chlorine attenuation mechanism model in the low-temperature period.

9. A pipe network residual chlorine optimization system based on residual chlorine attenuation mechanism model and intelligent model, characterized in that: include: An acquisition unit, used for acquiring residual chlorine concentration and / or turbidity of outgoing water of a target pipe network; An input unit, used for inputting the obtained residual chlorine concentration of the outgoing water and / or the turbidity of the outgoing water into a pre-built intelligent prediction model for residual chlorine attenuation of the target pipe network; The target pipe network residual chlorine attenuation intelligent prediction unit includes a target pipe network residual chlorine attenuation intelligent prediction model, wherein the residual chlorine attenuation intelligent prediction model is constructed to output the residual chlorine concentration of the pipe network residual chlorine control node after T time as a predicted value based on the residual chlorine concentration of the outgoing water and / or the turbidity of the outgoing water as input characteristics; A judgment feedback unit is used to judge the predicted value output by the target pipe network residual chlorine attenuation intelligent prediction model, and to provide abnormal feedback when it is judged to be an abnormal value; A feedback receiving and adjusting unit, which includes a target pipe network residual chlorine attenuation mechanism model, is used to receive abnormal feedback, and to adjust the residual chlorine concentration of the factory water by chlorination adjustment with the help of a pre-built target pipe network residual chlorine attenuation mechanism model; The residual chlorine attenuation mechanism model of the target pipe network is constructed based on the topological structure of the target pipe network, and its structure is capable of simulating the residual chlorine concentration of all nodes in the target pipe network in different time periods.

10. An electronic device, characterized in that: The device includes a processor and a memory; a program is stored in the memory, and the program is loaded and executed by the processor to implement the pipeline residual chlorine optimization method based on the residual chlorine attenuation mechanism model and the intelligent model as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Intelligent monitoring and adjusting method and device for rural secondary water supply quality

    CN120406085A

  • Water supply network corrosion pipe section identification and diagnosis method based on water quality inversion

    CN120746531A

  • A water quality inversion-based corrosion pipe section identification and diagnosis method for a water supply network

    CN120746531B