A method and system for intelligent closure gate control based on three-dimensional decision-making
By adopting a three-dimensional decision-making intelligent interception gate control method in the rain-sewage diversion intelligent interception device, using the TransConv-LSTM model and uncertainty distribution to generate control instructions, the limitations of the liquid level sensor and water quality prediction model in the prior art are solved, and more efficient and reliable rain-sewage diversion control is achieved.
Patent Information
- Application Number
- CN202411216994.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-09-02
AI Technical Summary
The existing intelligent interception device for rainwater and sewage diversion has limitations in liquid level sensor control and water quality prediction model, resulting in untimely gate switches, untreated sewage may flow into natural water bodies, and the water quality prediction model has limited capabilities in dealing with space-time dependence and nonlinear distribution data.
Using an intelligent interceptor gate control method based on three-dimensional decision-making, the pipeline water inlet data is obtained for pre-processing, and the TransConv-LSTM model is input to output the predicted value of ammonia nitrogen content, and the uncertainty distribution of the predicted value is obtained based on the uncertain model, and control instructions are generated to control the interceptor gate action.
It improves the adaptability and reliability of the device, has the predictive ability to intervene in the water treatment process in advance, ensures the stability of water quality, reduces system costs and resource consumption, and improves the prediction accuracy and safety of equipment performance.
Smart Images

Figure CN119126559B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent control technology, and more particularly to an intelligent closure gate control method and system based on three-dimensional decision-making. Background Art
[0002] In recent years, with the increasing impact of global climate change and the rapid advancement of urbanization, extreme rainfall events have occurred frequently, bringing unprecedented challenges to urban drainage systems. Especially in urban areas affected by heavy rainfall in a short period of time, the amount of rainwater has increased sharply, which not only increases the risk of urban waterlogging, but also increases the pressure on urban sewage treatment systems. At the same time, the acceleration of urbanization has also led to a significant increase in the discharge of domestic sewage, which has put forward higher requirements for urban water resources management and environmental protection.
[0003] In order to deal with these problems, the development of urban drainage system has gradually evolved from the initial direct discharge combined system to the more advanced interception combined system and rainwater and sewage separation system. Among them, the rainwater and sewage separation system has become an important part of the modern urban drainage system because it can effectively separate rainwater and sewage, thereby achieving the natural discharge of rainwater runoff and the effective treatment of sewage. Rainwater and sewage separation can not only effectively alleviate the problem of urban waterlogging, but also prevent rainwater from mixing into sewage treatment plants, reduce the pressure on sewage treatment plants, and protect natural water bodies from pollution.
[0004] However, the existing intelligent interception device for rainwater and sewage diversion has some shortcomings, mainly including:
[0005] Limitations of liquid level sensor control: The current interceptor gate switch is mainly controlled based on the signal of the liquid level sensor. This single liquid level judgment mechanism may cause the gate to open and close untimely, which may cause untreated sewage to flow into natural water bodies;
[0006] Limitations of water quality prediction models: Currently, models commonly used for water quality prediction mostly use convolution to extract features. Although this can capture the changing trend of time series data to a certain extent, due to the locality of the convolution operation, its ability to handle spatiotemporal dependencies is limited. In addition, water quality data often presents a nonlinear distribution, which makes it difficult for the model to accurately grasp the law of water quality changes. Water quality results usually come from sensors, which are easily affected by environmental changes, resulting in uncertainty in the data. Therefore, how to improve the intelligent management level of the rainwater and sewage diversion system and achieve more accurate and reliable rainwater and sewage diversion control is an urgent problem that technicians in this field need to solve. Summary of the invention
[0007] In view of this, the present invention provides an intelligent closure gate control method and system based on three-dimensional decision-making, which overcomes the above-mentioned defects.
[0008] In order to achieve the above object, the present invention adopts the following technical solution:
[0009] An intelligent closure gate control method based on three-dimensional decision-making, the specific steps are:
[0010] Acquire pipeline water inlet data, and preprocess the pipeline water inlet data to obtain preprocessed data;
[0011] The preprocessed data is input into the TransConv-LSTM model, and a predicted value of ammonia nitrogen content is output;
[0012] Obtaining uncertainty distribution of the predicted value of the ammonia nitrogen content based on an uncertainty model;
[0013] Generate a control instruction according to the predicted value of ammonia nitrogen content, the uncertainty distribution of the predicted value of ammonia nitrogen content and a preset gate action condition;
[0014] The action of the shutoff gate is controlled based on the control instruction.
[0015] Optionally, the preprocessing steps are:
[0016] Performing outlier identification, elimination and value supplementation processing on the pipeline water inlet data to obtain first data;
[0017] The first data is standardized to obtain the preprocessed data.
[0018] Optionally, the steps of constructing the TransConv-LSTM model are:
[0019] Build the initial TransConv-LSTM model based on the TransConv module and the LSTM prediction module;
[0020] The initial TransConv-LSTM model is iteratively trained using a federated learning algorithm to obtain the TransConv-LSTM model.
[0021] Optionally, the TransConv-LSTM model includes:
[0022] A Trans module, configured to receive the preprocessed data, capture the long-distance dependency of the sequence in the preprocessed data, and obtain a first spatial feature;
[0023] A Conv module is used to extract features of different time scales on the first spatial features to obtain second spatial features, and perform dimensionality reduction processing on the second spatial features to obtain reduced dimensionality features;
[0024] The LSTM module is used to train the neural network using the dimension reduction features and automatically learn sequence features.
[0025] Optionally, during the construction of the TransConv-LSTM model, parameters of the initial TransConv-LSTM model are adjusted and optimized based on the Adam algorithm and the cross entropy loss function.
[0026] Optionally, the step of obtaining the uncertainty distribution of the predicted value of the ammonia nitrogen content is:
[0027] Defining probability distributions for uncertain variables in the TransConv-LSTM model;
[0028] Randomly sampling the uncertain variables based on the probability distribution to construct a sampling data set;
[0029] Obtain multiple ammonia nitrogen content sampling prediction values using the TransConv-LSTM model according to the sample data set;
[0030] The uncertainty distribution of the ammonia nitrogen content prediction value is generated based on multiple ammonia nitrogen content sampling prediction values.
[0031] Optionally, the control instruction is obtained using a DRL reinforcement learning model.
[0032] An intelligent closure gate control system based on three-dimensional decision-making, comprising:
[0033] A data acquisition module, used for acquiring pipeline water inlet data, and preprocessing the pipeline water inlet data to obtain preprocessed data;
[0034] A prediction module, used for inputting the preprocessed data into a TransConv-LSTM model and outputting a predicted value of ammonia nitrogen content;
[0035] An uncertainty distribution building module, used for obtaining the uncertainty distribution of the predicted value of the ammonia nitrogen content by using an uncertainty model;
[0036] A control instruction generation module, used for generating a control instruction according to the predicted value of ammonia nitrogen content, the uncertainty distribution of the predicted value of ammonia nitrogen content and a preset gate action condition;
[0037] The execution module is used to control the action of the intercepting gate based on the control instruction.
[0038] It can be seen from the above technical solutions that the present invention discloses a method and system for controlling an intelligent closure gate based on three-dimensional decision making, which has the following beneficial effects compared with the prior art:
[0039] Good adaptability and increased device reliability: The neural network model used in the present invention can learn from a large amount of historical data, automatically identify and capture the complex relationship between ammonia nitrogen values and other factors, and has stronger adaptability and can better adapt to changes in different environmental conditions;
[0040] Possessing prediction capability to enable early intervention: Through the TransConv (reverse convolution) and LSTM (long short-term memory network) models, the present invention can predict the ammonia nitrogen value in the future, so as to adopt control strategies in time, intervene and adjust the water treatment process in advance, and ensure stable water quality;
[0041] Cost and resource saving: The present invention can realize predictive control through existing monitoring data, reducing the need for a large number of sensor devices, and reducing the overall cost and maintenance burden of the system;
[0042] Improve reliability: Perform data preprocessing before training to eliminate invalid information, improve the accuracy of model prediction and the reliability of instructions; at the same time, reduce the amount of data, speed up model calculation, and save energy;
[0043] Improve prediction accuracy: This method combines the spatial feature extraction capability of TransConv and the time series modeling capability of LSTM, which can more comprehensively analyze the variation pattern of ammonia nitrogen values over time and space and improve prediction accuracy;
[0044] Improved accuracy: The LeakyReLU activation function enhances the learning ability of the model, helps capture complex patterns in the input, and further improves the accuracy of predictions;
[0045] Improve generalization ability: Federated learning protects data privacy, reduces data transmission volume, reduces communication costs, and promotes the generalization ability of the model on diverse data;
[0046] Optimizing device performance and safety: Through reinforcement learning, the system can learn the optimal behavior strategy through interaction with the environment to optimize device performance and safety. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0048] Figure 1 A schematic diagram of the method provided by the present invention;
[0049] Figure 2A schematic diagram of a method flow chart with training steps provided by the present invention;
[0050] Figure 3 A schematic diagram of the overall process of the TransConv-LSTM prediction model provided by the present invention;
[0051] Figure 4 A schematic diagram of the Monc uncertainty modeling process provided by the present invention;
[0052] Figure 5 This is a schematic diagram of the DRL intelligent decision-making process provided by the present invention. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] An intelligent closure gate control method based on three-dimensional decision making, such as Figure 1 As shown, the specific steps are:
[0055] Step 1, obtaining pipeline water inlet data, and preprocessing the pipeline water inlet data to obtain preprocessed data;
[0056] Step 2: Input the preprocessed data into the TransConv-LSTM model and output the predicted value of ammonia nitrogen content;
[0057] Step 3, obtaining the uncertainty distribution of the predicted value of ammonia nitrogen content based on the uncertainty model;
[0058] Step 4: Generate a control instruction according to the predicted value of ammonia nitrogen content, the uncertainty distribution of the predicted value of ammonia nitrogen content and the preset gate action condition;
[0059] Step 5: Control the action of the cut-off gate based on the control instruction.
[0060] In one embodiment, the pre-processing steps in step 1 are:
[0061] Step 11: Perform outlier identification, elimination and value supplement processing on the pipeline water inlet data to obtain first data;
[0062] Step 12: normalize the first data to obtain preprocessed data.
[0063] In one embodiment, the steps for constructing the TransConv-LSTM model in step 2 are:
[0064] Step 211: construct an initial TransConv-LSTM model based on the TransConv module and the LSTM prediction module;
[0065] Step 212: Iteratively train the TransConv-LSTM model using a federated learning algorithm to obtain a TransConv-LSTM model.
[0066] In one embodiment, the TransConv-LSTM model includes:
[0067] The Trans module is used to receive the preprocessed data and capture the long-distance dependencies of the sequences in the preprocessed data to obtain the first spatial features;
[0068] Conv module, used for extracting features of different time scales from the first spatial features to obtain the second spatial features, and performing dimensionality reduction processing on the second spatial features to obtain dimensionality reduction features;
[0069] LSTM module, which is used to train the neural network using dimensionality reduction features and automatically learn sequence features.
[0070] Furthermore, the TransConv-LSTM model, such as Figure 2 and Figure 3 As shown, including:
[0071] Trans module: receives preprocessed data and uses the attention mechanism of the Transformer architecture to capture long-distance dependencies in the input sequence. This means that the data of each time step can be calculated in parallel with its correlation with the data of other time steps, which improves the computational efficiency; and transmits the features extracted by the Trans module to the Conv module;
[0072] LeakyReLU activation function: Use the LeakyReLU nonlinear activation function to enhance the nonlinear relationships in the data, enabling the model to better capture complex patterns and trends in the preprocessed data.
[0073] Conv module: In the Conv module, multiple convolution kernels of different sizes are introduced for convolution operations to capture key features at different time scales. Adding convolution layers (ammonia nitrogen block aggregation layers) is used to increase the spatial dimension, which is convenient for recovering details and can accurately locate features in the reconstruction stage. Use wide convolution kernels to perform adaptive feature extraction on the input data and downsample in the pooling layer (ammonia nitrogen block expansion layer), which effectively reduces the spatial dimension of the data, thereby reducing computational complexity and capturing more abstract global features. Finally, the maximum pooling layer is used to reduce the data dimension and retain the main feature information.
[0074] LSTM module: The reduced feature data is used as the feature input of the LSTM module to train the neural network and automatically learn the sequence features. In this embodiment, a bidirectional LSTM (BiLSTM) layer is used to simultaneously consider the past and future information of the time series.
[0075] Furthermore, the TransConv module extracts the spatial features of the input data:
[0076] The TransConv feature extraction module is used to process the preprocessed data. After entering the encoder, it is mainly processed by multiple multi-head attention mechanisms and feedforward neural networks for position encoding and feature extraction, and then the stacked building blocks are used to capture spatial dependencies and further extract spatial features. The ammonia nitrogen data in the preprocessed data is multidimensional, including time, location, and concentration chemical indicators. Through convolution and pooling operations, higher-level spatial features are extracted from these preprocessed data. This provides a richer feature representation for the subsequent LSTM part, thereby improving the time series prediction performance.
[0077] The encoder is composed of N=6 identical layers. The output of each sub-layer is:
[0078] LayerNorm(x+Sublayer(x));
[0079] Among them, Sublayer(x) is the function implemented by the sublayer itself. In order to facilitate these residual connections, the output dimension of all sublayers and embedding layers in the model is dmodel=512.
[0080] Use multi-head attention to simultaneously process information from different representation subspaces and perform joint attention on different positions. By concatenating and projecting the output values of different heads, the model can obtain richer and more comprehensive information representation capabilities. The formula is as follows:
[0081] MultiHead(Q,K,V)=Concat(head1,…,head h )W O ;
[0082]
[0083] Among them, W O is the weight of each attention head, Used to project the query (Q) from d model The dimension is reduced to d k Dimension; Used to project the key (K) from d model The dimension is reduced to d k Dimension; Used to project the value (V) from d model The dimension is reduced to d k Dimension.
[0084] Introducing the LeakyReLU nonlinear activation function in the feedforward neural network helps the model better capture the complex patterns and relationships in the input data. By introducing nonlinearity, the model can have stronger expressive power and improve the performance of the model in processing complex tasks. The formula is as follows:
[0085] FNN(x)=max(α(xW1+b1),xW1+b1)W2+b2;
[0086] Among them, α is the hyperparameter of the LeakyReLU nonlinear activation function, which is used to control the slope when the input is negative; x is the input vector, W1 and W2 are parameter matrices, and b1 and b2 are bias vectors.
[0087] The LeakyReLU activation function max(αx,x) performs nonlinear mapping.
[0088] Conv extracts features from the input data through multiple convolutional layers and pooling layers. The convolutional layer convolves the input data with a sliding convolution kernel to capture features of different sizes. The formula is as follows:
[0089] O(i, j) = (K*I)(i, j) = ∑ m ∑ n I(im,jn)J(m,n);
[0090] Among them, (K*I) is the convolution operation of the convolution kernel K and the input image I, (i, j) is the (i, j)th value of the output feature of the convolution, ∑m and ∑n are the operations of traversal and weighted summation of the convolution kernel K and the input image I, K(m,n) is the weight of the convolution kernel at position 9m,n), and I(im,jn) is the value of the input at position (im,jn).
[0091] The pooling layer is used to reduce the spatial size of the feature map and retain the most significant features. The formula is as follows:
[0092] output[i,j]=max(input[i*pool size :(i+1)*pool size ,j*pool size :(j+1)*pool_size]);
[0093] Among them, output[i, j] is a value in the output feature after pooling, input is the input feature, and pool_size is the window size of the pooling operation. After the pooling operation, the output of ResNet will become a (batch_size, channels) shape, where each sample is represented as a feature vector.
[0094] LSTM prediction method:
[0095] After being processed by the CNN module, the model can learn spatial features of different locations from the input data, such as a certain area in the water area may be correlated with ammonia nitrogen content. These spatial features will be passed as input to the LSTM part for time series modeling and prediction. A common LSTM unit consists of three gates, namely the input gate, the forget gate, and the output gate. The LSTM unit controls the flow of information and the update of memory through these gates. Among them, the forget gate consists of a Sigmoid activation function, which is applied to the linear combination of the hidden state of the previous time step and the current input to generate a vector (output) in which the value of each element is between 0 and 1, indicating the amount of information to be retained or forgotten from the hidden state of the previous time step. The output range of the forget gate is usually between 0 and 1, where 0 means completely forgetting the previous state and 1 means completely retaining the previous state. The retention or discarding of information is determined by this layer. The output formula of the forget gate is:
[0096] f t =σ(W f ·[h t-1 ,x t ]+b f );
[0097] Among them, σ is the Sigmoid function, W f is the weight matrix, h t-1 is the current hidden state, x t is the current input, b f is the bias vector.
[0098] In the bidirectional phase of the network, the output of the forward LSTM cell sequence is calculated using the forward input, while the output of the reverse LSTM cell sequence is calculated using the reverse input. These two outputs are then concatenated and put into the SoftMax function to normalize their values into a probability distribution, thus producing the final output. The specific formula is as follows:
[0099]
[0100] Forward calculation process, is the positive hidden state at the current time t, x t is the input data, is the hidden state of the previous moment;
[0101]
[0102] Reverse calculation process, is the reverse hidden state at the current time t, x t For input data, is the reverse hidden state at the next moment.
[0103]
[0104] Among them, y t is the final output, g(·) represents the activation function, b y are the weights and biases of a given layer respectively; y t The final output is calculated by feeding the weighted sum of the forward and backward hidden states into the activation function g(·).
[0105] In one embodiment, the specific steps of the federated learning algorithm are:
[0106] Train the TransConv-LSTM model independently on multiple distributed machines to obtain model update parameters;
[0107] The model update parameters of each distributed machine are sent to the central server in real time, and the parameters of the TransConv-LSTM model are updated using the model update parameters;
[0108] The updated parameters of the TransConv-LSTM model are sent to each distributed machine for iterative training.
[0109] Furthermore, a federated learning environment is set up before training, and a communication mechanism between distributed machines and the central server is set up. In each distributed machine, the TransConv-LSTM model is trained and model update parameters are generated. These model update parameters are uploaded to the central server, and the FedAvg federated learning algorithm is used for global model aggregation. The average value of the model update parameters of the TransConv-LSTM models received from each distributed machine is calculated, and then the parameters of the global model (i.e., the TransConv-LSTM model in the central server) are updated. The weights of the updated global model are transmitted back to the distributed machines. The updated weights are used on the distributed machines to continue local training. You can choose to perform more training iterations on the distributed machines, or transmit the weights back to the server again for federated learning.
[0110] Furthermore, multiple distributed machines are used to solve the problems of data privacy and data centralization. Multiple devices participate in the training model, and each device holds its own data set. After the parameters of the local model (i.e., the TransConv-LSTM model on the distributed machine) are updated locally, the parameters of these local models are aggregated to update the global model. In actual application scenarios, the data distribution of different devices may be different. This means that the data of each device may have a different feature distribution or data distribution, that is, the data is not independent and identically distributed. In this case, due to the different data, directly uploading the parameters of the local model to the server for aggregation may lead to performance degradation. Therefore, shuffle is used to randomly disrupt the data, which can make the data uploaded by each device more representative during the training process, which helps to improve the performance and convergence speed of the global model.
[0111] First, the system obtains the initial parameter w of the global model through initialization operations. Then, the distributed machines and the central server interact and iteratively update the model parameters. The central server selects a trusted node with large computing power. The interaction process of the tth iteration is as follows:
[0112] The central server will parameter w t Send it to all distributed machines;
[0113] After receiving the parameters of the global model, the distributed machine performs training and parameter updates based on the local data set. The parameter update rules for the local model are as follows:
[0114]
[0115] in, is the local model parameter of distributed machine m after update at time step t+1, are the local model parameters of distributed machine m at time step t; is the distributed machine m on the local dataset according to the global model parameter w t The process of updating local model parameters by gradient descent, where η is the learning rate, is the gradient loss, Γ(f(x m ;w t ),y m ) is the loss function; f(x m ;w t ) is the predicted output, y m is the true label.
[0116] The distributed machines send the trained local model parameters back to the central server.
[0117] After receiving the parameters of the local model returned by all distributed machines participating in the training, the central server performs FedAvg aggregation. The aggregation rules are as follows:
[0118]
[0119] The parameters of the new global model are obtained after the parameters of the local model are aggregated after t+1 rounds of training. The purpose of the federated aggregation optimization on the central server is to find an optimal global model that has strong generalization capabilities for all ammonia nitrogen flow models. Therefore, the output model parameters can be updated in the following ways:
[0120]
[0121] in, are the updated model parameters; is the global model parameter of the previous iteration, G is the pre-set step size, which controls the length of the global model to move in the anti-gradient direction at each iteration; γ is the learning rate; α c is the weight of the central server to the cth distributed machine, balancing the contribution of each distributed machine; is the parameter of the local model obtained by the cth distributed machine after the t+1th iteration; ρβ is the weight of the local model parameter and the previous global model parameter in the global model update; w p It controls the weight ratio of the global model parameters to the previous global model parameters and local model parameters during the update process, and adjusts the convergence direction and stability of the model in multiple machine learning environments.
[0122] In one embodiment, the steps of obtaining the local data set are:
[0123] Step 2121, obtaining historical data, wherein the data at least includes environmental parameters such as ammonia nitrogen concentration, water level, and temperature;
[0124] Step 2122: Perform preliminary cleaning of historical data to remove obviously erroneous or abnormal data points;
[0125] Step 2123: Use time series analysis techniques to identify and correct missing values in the data, including but not limited to interpolation, moving average, or machine learning-based methods;
[0126] Step 2124: using a noise suppression algorithm, such as wavelet transform, Kalman filter or adaptive filter, to reduce noise interference in the data;
[0127] Step 2125, converting the processed data into a three-dimensional (3D) tensor format, where the dimensions are defined as (samples, time_steps, features), representing the number of samples, the number of time steps, and the number of features in each time step, respectively;
[0128] Step 2126: normalize the data in 3D tensor format to ensure that all features are within the same numerical range, thereby improving the stability and convergence speed of model training;
[0129] Step 2127: According to actual application requirements, the data set is divided into a training set, a validation set, and a test set, and corresponding balancing processing is performed to avoid overfitting or underfitting.
[0130] Further, in step 2121, the historical data is derived from the change value of ammonia nitrogen content in water quality detected by the intelligent control system of the urban digital pipe network outlet, and the time interval is 5 seconds. In this embodiment, the data of any one month of a pipe outlet is obtained as sample data.
[0131] In step 2122, when collecting historical data, it may be affected by external factors, such as the detachment of other parts of the underground pipeline at the pipe mouth, leakage of the upstream pipeline, etc., which may cause some data to deviate from the true value, resulting in abnormal data and false data. These data are collectively referred to as abnormal points. In this embodiment, the 3σ criterion is adopted, and the formula is as follows:
[0132]
[0133] Where x is a data point in the local dataset; is the mean of the local data set; σ is the standard deviation of the local data set, which measures the degree of dispersion of the data points.
[0134] In step 2123, when performing abnormal processing on the data set, if the value that meets the 3σ criterion accounts for less than 1% of the sample points, it can be judged as an abnormal value. At this time, it is filled with the mean of the two adjacent data.
[0135] In step 2126, in order to solve the problem of too large a data set causing the model to run time-consuming and the impact of different element categories on model training, this embodiment uses data standardization processing to unify the magnitude relationship between element indicators. Standardization is normalization, which usually requires the data range to be between [0, 1] and [-1, 1]. This embodiment unifies the data into the range of [0, 1], and the calculation formula is as follows:
[0136]
[0137] in, and x i are the values before and after normalization, xmin is the minimum value of each feature sample data, x max is the maximum value of each feature sample data.
[0138] In one embodiment, during the construction of the TransConv-LSTM model, parameters of the initial TransConv-LSTM model are adjusted and optimized based on the Adam algorithm and the cross entropy loss function.
[0139] Furthermore, the TransConv-LSTM model is initialized on each distributed machine and trained using the local dataset. During the training process, the Adam algorithm is used to back-propagate the training error and gradually update the model parameters layer by layer to minimize the gap between the prediction results and the target data. At the same time, the cross entropy loss function is used to quantify the accuracy of the prediction results.
[0140] Furthermore, the Adam adaptive momentum random optimization method is used to adjust the learning rate according to the historical gradient information of each parameter. This adaptability enables the Adam algorithm to better adapt to the changes of different parameters during the training process, thereby improving the convergence speed and optimization effect. At the same time, for the case of a large number of data sets mentioned in this embodiment, the Adam algorithm also has good adaptability to large-scale data sets and parameter spaces. Since the Adam algorithm uses the first-order moment estimation and second-order moment estimation of the gradient, it can better handle large-scale data and parameters compared to the traditional gradient descent algorithm, reducing the use of memory and the cost of calculation.
[0141] The value of the cross entropy loss function can usually be interpreted as the uncertainty or error rate of the model. A higher cross entropy loss indicates a larger difference between the model's prediction and the true label, whereas a lower cross entropy loss indicates a more accurate prediction. This interpretability makes the cross entropy loss function an important indicator for monitoring model performance and adjusting model parameters. The specific formula is as follows:
[0142]
[0143] Here, H(p,q) is the cross entropy between the true probability distribution p and the model predicted probability distribution q, which is a measure of the difference between the two probability distributions. i ) is the probability of the i-th element in the probability distribution of the true label, q(x i ) is the probability of the ith element in the probability distribution predicted by the model. is the cross entropy loss between the probability distribution p of the true label and the probability distribution q predicted by the model. For each element i, by p(x i )logq(x i) is used to measure the difference between the model prediction and the true label. The greater the difference between the probability distributions, the higher the cross entropy loss.
[0144] In one embodiment, the specific steps of step 3 are:
[0145] Step 31: Define probability distribution for uncertain variables in the TransConv-LSTM model.
[0146] Step 32: Randomly sample the uncertain variables based on the probability distribution to construct a sampling data set;
[0147] Step 33: Obtain multiple ammonia nitrogen content sampling prediction values using the TransConv-LSTM model according to the sample data set;
[0148] Step 34: Generate an uncertainty distribution of the predicted value of ammonia nitrogen content based on multiple sampled predicted values of ammonia nitrogen content.
[0149] Furthermore, if Figure 4 As shown in the figure, Monte Carlo is used for uncertainty modeling to obtain the Monc module. The Monte Carlo method is used to sample the model, generate multiple sampling samples, and use these samples to calculate the statistical characteristics of the prediction results. Through multiple samplings, each time using different model parameters or data sampling, a set of prediction results is generated, thereby providing uncertainty information about the predicted value of ammonia nitrogen content.
[0150] Furthermore, uncertainty modeling is used to display the distribution of forecast results, so as to better understand uncertainty. This can help decision makers better understand the confidence of forecast results and take corresponding measures based on uncertainty information, such as increasing monitoring frequency or taking more frequent sampling. In addition, uncertainty information can also be used to develop emergency plans and decision support systems to make timely and accurate decisions under uncertain circumstances. The specific formula is as follows:
[0151]
[0152] Where T is the number of sampling times; is the prediction result of model f given the input vector x at the tth sampling time, and E(y) is the expected value of the output y.
[0153] In one embodiment, the control instructions are obtained using a DRL reinforcement learning model.
[0154] Furthermore, if Figure 5 As shown in the figure, the agent is selected as the gate opening and closing efficiency, the environmental parameters are selected as the internal operating state of the gate, current, voltage and other external conditions, the actuator is the control system, and the optimization goal is to maximize the action value function In state S, the reward for taking action a follows π * The optimization strategy, the specific formula is as follows:
[0155]
[0156] DRL training updates parameters through the following loss function:
[0157] L(θ)=E[((r t +γmaxQ(S t+1 ,a';θ - )-Q(S t ,a t ;θ)) 2 ];
[0158] Among them, r t is the reward at time t, and γ is the discount factor used to balance current rewards and future rewards. t+1 ,a';θ - ) is the next state S t+1 The Q value of taking action a'; Q(S t ,a t ; θ)) is the current state S t Take action a t Q value.
[0159] Furthermore, when the model predicted by the Monc module is available, the DRL reinforcement learning method is used to continuously iterate and optimize the model, and finally select the optimal action of the model under a given state, so as to ensure that the model can maintain the best performance of the gate under various working conditions through intelligent control strategies, prevent failures, ensure production continuity and safety, improve operating efficiency and reliability, and reduce maintenance costs.
[0160] The preset gate action conditions are based on:
[0161] Sewage index: If the ammonia nitrogen content in the water body is greater than or equal to 1 mg / L, it can be judged as sewage.
[0162] Polluted water index: If the ammonia nitrogen content in the water body is less than 1 mg / L, it can be judged as unpolluted water. This water quality is generally considered to be clean, natural water bodies that are not obviously polluted, such as rainwater or tap water. According to the prediction results, when the prediction results reach the sewage index, a signal is sent to the mobile terminal to open the sewage discharge gate to prevent sewage from flowing into the river. When the prediction results reach the unpolluted water index, a signal is sent to the mobile terminal to open the rainwater discharge gate.
[0163] The present invention also discloses an intelligent closure gate control system based on three-dimensional decision-making, comprising:
[0164] The data acquisition module is used to obtain the pipeline water inlet data and pre-process the pipeline water inlet data to obtain pre-processed data;
[0165] The prediction module is used to input the preprocessed data into the TransConv-LSTM model and output the predicted value of ammonia nitrogen content;
[0166] Uncertain distribution building module, used to obtain the uncertainty distribution of the predicted value of ammonia nitrogen content using the uncertainty model;
[0167] A control instruction generation module, used for generating a control instruction according to the predicted value of ammonia nitrogen content, the uncertainty distribution of the predicted value of ammonia nitrogen content and the preset gate action condition;
[0168] The execution module is used to control the action of the intercepting gate based on the control instruction.
[0169] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0170] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An intelligent closure gate control method based on three-dimensional decision-making, characterized in that: The specific steps are: Acquire pipeline water inlet data, and preprocess the pipeline water inlet data to obtain preprocessed data; Input the preprocessed data into the TransConv-LSTM model and output the predicted value of ammonia nitrogen content; Obtain the uncertainty distribution of the predicted value of ammonia nitrogen content based on the uncertainty model; Generate control instructions according to the predicted value of ammonia nitrogen content, the uncertainty distribution of the predicted value of ammonia nitrogen content and the preset gate action conditions; Control the action of the throttle gate based on the control command; The steps to build the TransConv-LSTM model are: Build the initial TransConv-LSTM model based on the TransConv module and the LSTM prediction module; The initial TransConv-LSTM model is iteratively trained using the federated learning algorithm to obtain the TransConv-LSTM model, where the model parameter update expression is: In the formula, are the updated model parameters; is the global model parameter of the previous iteration; γ is the learning rate; α c is the weight of the central server to the cth distributed machine; is the parameter of the local model obtained by the cth distributed machine after the t+1th iteration; ρβ is the weight of the global model parameter for the local model parameter and the previous global model parameter in the update; w p It is the weight ratio of the global model parameters to the previous global model parameters and local model parameters during the update process; The steps to obtain the uncertainty distribution of the predicted value of ammonia nitrogen content are: Define probability distributions for uncertain variables in the TransConv-LSTM model; Randomly sample uncertain variables based on probability distribution and construct a sampling data set; According to the sample data set, the TransConv-LSTM model is used to obtain multiple sampling prediction values of ammonia nitrogen content; The uncertainty distribution of ammonia nitrogen content prediction values is generated based on multiple ammonia nitrogen content sampling prediction values.
2. The intelligent closure gate control method based on three-dimensional decision-making according to claim 1 is characterized in that: The steps of the pretreatment are: Performing outlier identification, elimination and value supplementation processing on the pipeline water inlet data to obtain first data; The first data is standardized to obtain the preprocessed data.
3. The intelligent closure gate control method based on three-dimensional decision-making according to claim 1 is characterized in that: The TransConv-LSTM model includes: A Trans module, configured to receive the preprocessed data, capture the long-distance dependency of the sequence in the preprocessed data, and obtain a first spatial feature; A Conv module is used to extract features of different time scales on the first spatial features to obtain second spatial features, and perform dimensionality reduction processing on the second spatial features to obtain reduced dimensionality features; The LSTM module is used to train the neural network using the dimension reduction features and automatically learn sequence features.
4. The intelligent closure gate control method based on three-dimensional decision-making according to claim 1 is characterized in that: During the construction of the TransConv-LSTM model, parameters of the initial TransConv-LSTM model are adjusted and optimized based on the Adam algorithm and the cross entropy loss function.
5. The intelligent closure gate control method based on three-dimensional decision-making according to claim 1 is characterized in that: The control instructions are obtained using a DRL reinforcement learning model.
6. An intelligent closure gate control system based on three-dimensional decision-making, using an intelligent closure gate control method based on three-dimensional decision-making as claimed in any one of claims 1 to 5, characterized in that: include: A data acquisition module, used for acquiring pipeline water inlet data, and preprocessing the pipeline water inlet data to obtain preprocessed data; A prediction module, used for inputting the preprocessed data into a TransConv-LSTM model and outputting a predicted value of ammonia nitrogen content; An uncertainty distribution building module, used for obtaining the uncertainty distribution of the predicted value of the ammonia nitrogen content by using an uncertainty model; A control instruction generation module, used for generating a control instruction according to the predicted value of ammonia nitrogen content, the uncertainty distribution of the predicted value of ammonia nitrogen content and a preset gate action condition; The execution module is used to control the action of the intercepting gate based on the control instruction.
Citation Information
Patent Citations
Method for predicting influence of river sewage draining exit setting in plain river network area on river water quality
CN110210674A
Method and device for predicting ammonia nitrogen content in section water quality
CN112529147A