Intelligent water affair non-negative pressure water supply system
Through data collection and deep reinforcement learning technology, the water consumption of buildings is predicted and the operating frequency of the water pump is dynamically adjusted, which solves the problem of inflexible control of the water supply system without negative pressure and achieves more efficient and flexible water use management.
Patent Information
- Application Number
- CN202411031272.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-15
AI Technical Summary
The existing negative pressure-free water supply system has shortcomings in control flexibility and response to complex water quality changes and emergencies. In particular, traditional methods rely on simple statistical models and fixed rules, making it difficult to dynamically adapt to complex environments and real-time demand changes.
The data acquisition module is used to collect building water data, predict water consumption through SVR-DNN prediction model, and build a state space, action space and reward function framework with the MDP model. The DDPG-ATT model is used to dynamically adjust the operating frequency of the water pump to realize real-time monitoring of the system and Strategy adjustment.
It improves the control flexibility and responsiveness of the system, can promptly respond to changes in building water demand, reduce water supply fluctuations, and enhance the stability and energy-saving effect of the system.
Smart Images

Figure CN118958445A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent control technology, and in particular to a smart water supply system without negative pressure. Background Art
[0002] Building an environmentally friendly and resource-saving society and reducing the energy consumption of water supply pumping stations are one of the important ways to achieve this goal. As a key link in delivering municipal water to the user end, the optimization of energy consumption is particularly important for secondary water supply. Although high-level water tank water supply has high reliability, the initial construction cost is high and the sealing is poor. The initial cost of air pressure tank water supply is low, but the water supply safety is poor and the energy saving effect is not good. Although the variable frequency speed regulation constant pressure water supply has significant energy saving effect, it needs to be operated continuously.
[0003] The existing technology solves many problems existing in traditional secondary water supply through a non-negative pressure water supply system. The non-negative pressure water supply system directly uses the water pressure of the municipal pipe network to deliver water to the user end through a booster device without the need to pressurize from zero in the initial stage. It not only reduces energy consumption, but also avoids secondary pollution in traditional secondary water supply methods, and further optimizes the water supply quality and system stability. The Chinese patent with the document publication number CN114658062B proposes a non-negative pressure water supply system for smart water affairs, which improves the practicality of maintenance operations by mechanical drive and adjustment of the delivery route without affecting normal water supply. However, its mechanical drive method may lead to high maintenance costs, and the wear and failure rate of mechanical parts will also affect the long-term stability of the system. The Chinese patent with the document publication number CN114809195B introduces a remote monitoring system and method for non-negative pressure water supply equipment, which can solve the water quality pollution problem of the steady flow compensator through remote monitoring and early warning modules, avoid secondary pollution, and optimize water quality. However, it mainly relies on remote monitoring, and there may be delays or errors in the data transmission process, affecting real-time and accuracy. In addition, remote monitoring alone may not be enough to fully respond to complex water quality changes and emergencies. A Chinese patent with publication number CN114197587B introduces a non-negative pressure water supply device that improves the stability of the water supply system and water quality safety by automatically adjusting pressure and effectively disinfecting. However, the system is highly dependent on automatic control systems and may lack sufficient flexibility and robustness when responding to extreme situations and emergencies.
[0004] Although the current non-negative pressure water supply system has solved some problems of traditional secondary water supply, it still has the problem of inflexible control. Therefore, a smart water service non-negative pressure water supply system is proposed. Summary of the invention
[0005] The purpose of the present invention is to provide a smart water service non-negative pressure water supply system, which collects and processes building water data sets through a data acquisition module; uses the SVR-DNN prediction model in the building water consumption prediction module to predict water flow; uses the MDP model construction module to define the state space, action space and reward function framework suitable for the non-negative pressure water supply system; the optimization module uses the DDPG-ATT model on the basis of the MDP model to dynamically adjust the operating frequency of the water pump according to the water consumption prediction value; the control result generation module uses the trained model to make the optimal decision based on real-time data, realizes real-time monitoring of the system operation status and strategy adjustment, and ensures that the system ensures efficient and flexible operation under different water demand conditions.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A smart water service non-negative pressure water supply system, comprising:
[0008] A data acquisition module is used to obtain a building water data set, and perform data cleaning, missing value processing and feature extraction on the building water data set, and divide the building water data set into a training set and a test set;
[0009] A building water consumption prediction module is used to predict future building water consumption, use the training set to offline train the SVR-DNN prediction model, adjust the parameters of the SVR-DNN prediction model, input the test set into the optimized SVR-DNN prediction model, and generate the future building water consumption;
[0010] An MDP model construction module is used to construct the MDP model, input the future building water consumption into the state space, design the state space, action space and reward function, and describe the learning process of the non-negative pressure water supply system;
[0011] An optimization module is used to train and test the DDPG-ATT model. Based on the MDP model, the DDPG-ATT model is designed. After multiple iterations and training, the parameters of the DDPG-ATT model are adjusted to obtain an optimized DDPG-ATT model.
[0012] The control result generation module uses the DDPG-ATT model to generate a control strategy according to the current state of the non-negative pressure water supply system and water demand.
[0013] Furthermore, the data acquisition module includes:
[0014] A data collection unit, used to collect the building water use data set at each moment;
[0015] A data processing unit, used for preprocessing the building water use data set;
[0016] The missing values are processed using the mean imputation method, and the mean calculation formula is:
[0017]
[0018] Where n is the number of samples, X i is the characteristic value of the i-th sample, and the missing value is replaced by the calculated mean m.
[0019] Furthermore, the triple standard deviation method is used to detect and process outliers. The standard deviation s formula is:
[0020]
[0021] According to the triple standard deviation method, the threshold of outliers is set as the mean and three times the standard deviation.
[0022] The sum of the differences is checked to see if the feature value exceeds the threshold range, and if so, it is replaced with the mean value.
[0023] Furthermore, all data are normalized to the range of [0,1], and the normalization formula is:
[0024]
[0025] Among them, X norm is the normalized value, X is the original data, min(X) and max(X) are the minimum and maximum values of feature X respectively;
[0026] Furthermore, the processed data is randomly divided into the training set and the test set according to 80% and 20%.
[0027] Furthermore, the building water consumption prediction module includes:
[0028] A model structure determination unit, used to determine the network structure of the SVR-DNN prediction model, including an input layer, a hidden layer, an output layer, and the number of neurons;
[0029] Function selection unit, used to select RBF kernel as kernel function, ReLU as activation function, and mean square error as loss function;
[0030] A training and adjustment unit, used to train the SVR-DNN prediction model, adjust the parameters of the SVR-DNN prediction model, and evaluate the performance of the SVR-DNN prediction model;
[0031] The prediction application unit uses the trained SVR-DNN prediction model to predict the non-negative pressure water supply system and outputs the future building water consumption.
[0032] Further, the training adjustment unit includes:
[0033] The SVR model is used to predict the future building water consumption:
[0034]
[0035] in, represents the SVR prediction value, Ψ SVR represents the SVR prediction model, O t represents the number of households at time t, K represents the number of kitchens, B represents the number of bathrooms, price t represents the water price at time t, P t is the water supply pressure at time t, T t represents the temperature at time t, H t represents the humidity at time t, D t Indicates whether time t is a holiday;
[0036] Solve the SVR optimization problem, the optimization objective is:
[0037]
[0038] The constraints are:
[0039]
[0040] The decision function is f(x i )=wx i +b,f(x i ) is the i-th predicted value, w is the weight vector, b is the bias vector, x i represents the i-th sample, C is the regularization parameter, ξ i and is the relaxation factor, M i represents the i-th label value, ε SVR represents f(x i ) and M i The maximum deviation between them, i is the sample number, n is the total number of samples;
[0041] The SVR predicted value As input, the SVR-DNN prediction model is trained to predict the water flow at time t+1 as:
[0042]
[0043] Among them, SVR-DNN is a water flow prediction model, is the future building water consumption at time t+1. Divided into peak traffic, normal traffic and valley traffic;
[0044] Cost function of SVR-DNN with L2 regularization for:
[0045]
[0046] Among them, M′ i is the predicted value of SVR-DNN, λ is the weight of the regularization term, m is the number of weights in the neural network, ω j is the jth weight, j is the weight number;
[0047] The MSE mean square error is used to evaluate the prediction effect of the SVR-DNN prediction model, which is expressed as:
[0048]
[0049] Among them, L MSE is the error value, z i is the true value, p i is the predicted value.
[0050] Furthermore, the MDP model building module includes:
[0051] A state space definition unit, used to describe the state information of the water supply system at different time points;
[0052] an action space definition unit, for determining a control action to be taken under the state space;
[0053] A reward function unit, used to evaluate the effect of the action, and to give rewards and penalties according to the energy saving effect and water supply stability;
[0054] The transfer function unit is used to describe the probability of the system transferring from one state to another. The environment determines the next state based on the action and the feedback of the state space.
[0055] A discount factor unit that is used to balance the relative importance of current rewards versus future rewards during long-term optimization.
[0056] Further, the state space includes:
[0057]
[0058] Among them, S t is the state space at time t, F 1,t is the operating frequency of pump 1 at time t, F 2,t is the operating frequency of pump 2 at time t, F 3,t is the operating frequency of pump 3 at time t, G t is the actual water flow at time t.
[0059] Furthermore, the action space includes:
[0060] A t ={F 1,t ,F 2,t ,F 3,t};
[0061] Among them, A t is the action space at time t.
[0062] Furthermore, the rules followed by the action space are:
[0063] When the non-negative pressure water supply system cannot meet the most unfavorable point demand, the water pump operation frequency is increased until the water supply reaches the set value;
[0064] When the building water consumption increases, the pump operation frequency is increased, and F is calculated. n And judge F n >F target Is it true? If so, switch to the power frequency mode and add one more water pump to run; otherwise, continue to run with the current number of water pumps;
[0065] When the building water consumption decreases, the pump operation frequency is reduced, and F is calculated. n And judge F n <F target Is it true? If so, one water pump is reduced to operate, and the power frequency mode is switched to the variable frequency mode; otherwise, the current number of water pumps continues to operate;
[0066] Among them, F n is the total frequency when the non-negative pressure water supply system has n water pumps, F target is the calculated target frequency.
[0067] Furthermore, the reward function includes:
[0068]
[0069] Among them, R t is the reward function at time t, is the energy consumption reward at time t, is the reward for stable water supply at time t, is the system pressure reward value, a, b, c are the trade-off factors;
[0070] The water supply stability reward is expressed as:
[0071]
[0072] in, is the water supply stability reward of the three water pumps at time t, is the water supply stability reward of the i-th water pump at time t;
[0073] Said It is expressed as:
[0074]
[0075] Among them, F i,t is the operating frequency of the ith pump at time t, F i,t-1 is the operating frequency of the i-th pump at time t-1, and the threshold ΔF th is the maximum frequency change allowed;
[0076] The system pressure reward value It is expressed as:
[0077]
[0078] Among them, P t is the water supply pressure at time t, P t target is the target pressure value at time t, and different values are set according to peak flow, normal flow and valley flow, ΔP th is the maximum allowed deviation value.
[0079] Further, the optimization module includes:
[0080] Initialize the DDPG-ATT agent, including the Actor-ATT network μ(s|θ μ ) and Critic network Q(s,a|θ Q ), the parameters of the two networks are θ μ and θ Q Represents, and also initializes their target network μ(s|θ μ' ) and Q(s,a|θ Q' ), the network parameters are θ μ' and θ Q' express;
[0081] The predicted building water flow at the next moment is extended to the original state. The agent observes the state S t ;
[0082] The state S t Through the Actor-ATT network processing, the weight of each state component is calculated using the Softmax activation function, and the weight and state S t Multiply them together to get a new weighted state vector, which is then processed by two fully connected layers;
[0083] Use ReLU activation function and Sigmoid activation function to get the current action A t;
[0084] With t as the control interval, the action is input into the environment, and the DDPG-ATT agent observes the next state S t+1 And get reward R t , the DDPG-ATT agent converts the experience sample {S t ,A t ,R t ,S t+1}Store in the experience pool. When the experience pool has accumulated enough capacity, randomly select a small batch of transfer samples. Perform training and learning, where i is the sample number;
[0085] Calculate the target Q value y i :
[0086] y i =R i +γQ′(S t+1 ,μ′(S t+1 ∣θ μ′ )|θ Q′ );
[0087] Among them, γ is the discount factor;
[0088] The gradient descent method is used to minimize the difference between the Critic network evaluation value and the target value, and the Critic network parameters are updated. The loss function L is:
[0089]
[0090] The Actor network updates the network parameters through the policy gradient method according to the evaluation value calculated by the Critic network. for:
[0091]
[0092] The DDPG-ATT model uses a soft update method to update the target network:
[0093]
[0094] Among them, τ is the soft update coefficient.
[0095] Furthermore, the control result generation module uses the DDPG-ATT model to generate a control strategy according to the current state of the non-negative pressure water supply system and water demand.
[0096] Furthermore, the control result generation module includes:
[0097] The trained SVR-DNN prediction model and the DDPG-ATT model are saved, and after preprocessing the real-time data, the real-time data is input into the SVR-DNN prediction model, the future building water consumption is output, and input into the DDPG-ATT model to generate a control strategy.
[0098] Compared with the prior art, the present invention has the following beneficial effects:
[0099] 1. Traditional methods rely only on simple statistical models and are unable to capture complex water usage patterns. The SVR-DNN prediction model combines the regression capability of SVR and the nonlinear characteristics of DNN. It is trained using a building water usage dataset and uses the results of SVR prediction as the input of DNN. It can predict the water consumption at the next moment, allowing the non-negative pressure water supply system to adjust the water supply strategy before actual demand changes, thereby improving control flexibility.
[0100] 2. Traditional control methods are based on fixed rules or simple feedback, which makes it difficult to dynamically adapt to complex environments. The MDP model comprehensively considers the operating characteristics of the non-negative pressure water supply system, changes in user demand, and changes in environmental conditions. By defining the state space, action space, and reward function, an intelligent decision-making framework is formed to achieve global optimization. Based on the MDP model, the intelligent agent can dynamically and timely respond to the water demand of the building according to environmental changes, thereby improving control flexibility.
[0101] 3. Traditional methods are not responsive to changes in real-time demand. Based on the SVR-DNN prediction model and the MDP model, the DDPG-ATT model combines deep reinforcement learning and attention mechanisms to monitor and adjust the working status of the water pump in real time, adaptively adjust the control strategy, dynamically adjust the operating frequency of the water pump, and quickly respond to changes in water consumption. In addition, in order to maximize the reward function, the system reduces water supply fluctuations, thereby improving control flexibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0102] Figure 1 This is a schematic diagram of water consumption patterns of different buildings in this embodiment for a week;
[0103] Figure 2 It is a schematic diagram of the process of the present invention;
[0104] Figure 3 It is a schematic diagram of the water consumption prediction SVR-DNN prediction model of the present invention;
[0105] Figure 4 This is a schematic diagram of an Actor network with an Attention mechanism of the present invention;
[0106] Figure 5 Schematic diagram of the DDPG-ATT model based on the SVR-DNN prediction model of the present invention. DETAILED DESCRIPTION
[0107] 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.
[0108] Although the current non-negative pressure water supply system has solved some problems of traditional secondary water supply, it still has the problem of inflexible control. Therefore, a smart water service non-negative pressure water supply system is proposed.
[0109] This embodiment draws on the system operation mode of the ZWG series water supply equipment. The pipelines are connected to the water supply network and the user network respectively. It is equipped with a remote pressure gauge to detect the pressure of the water supply network. There are 3 water pumps in the variable frequency speed regulation pump group, and the power is 7.5kW. After the system calculation, the adjustment parameters are obtained, and the water pump frequency is controlled by the variable frequency control cabinet to realize intelligent regulation.
[0110] Reference Figure 3 As shown, the present invention provides a smart water supply system without negative pressure, and the technical solution is as follows:
[0111] A data acquisition module is used to obtain a building water data set, and perform data cleaning, missing value processing and feature extraction on the building water data set, and divide the building water data set into a training set and a test set;
[0112] A building water consumption prediction module is used to predict future building water consumption, use the training set to offline train the SVR-DNN prediction model, adjust the parameters of the SVR-DNN prediction model, input the test set into the optimized SVR-DNN prediction model, and generate the future building water consumption;
[0113] An MDP model construction module is used to construct an MDP model, input the future building water consumption into a state space, design the state space, action space and reward function, and describe the learning process of the non-negative pressure water supply system;
[0114] An optimization module is used to train and test the DDPG-ATT model. Based on the MDP model, the DDPG-ATT model is designed. After multiple iterations and training, the parameters of the DDPG-ATT model are adjusted to obtain an optimized DDPG-ATT agent.
[0115] The control result generation module uses the DDPG-ATT agent to generate a control strategy according to the current state of the non-negative pressure water supply system and water demand.
[0116] Specifically, the data acquisition module includes two units, namely a data collection unit and a data processing unit.
[0117] Among them, the data collection unit is used to collect the building water consumption data set at each moment. The weather data (average daily precipitation and average daily temperature) used in this embodiment is obtained from the China Weather Network; the information related to the building (the number of households, the number of kitchens and the number of bathrooms) is obtained from the property; the water price information is obtained from the China Water Network; the residential water consumption is obtained from the "Standards for Urban Residential Water Consumption" issued by the Ministry of Construction; the historical water consumption data such as water flow data and inlet pressure are obtained through the remote monitoring system of the non-negative pressure water supply equipment; in addition, the holidays corresponding to the dates must also be recorded.
[0118] Take a certain community as an example, refer to Figure 2 As shown, the daily variation pattern of residents' water consumption is extremely strong, with periodic changes on a daily basis. Peak flow and trough flow occur in fixed time periods every day, with water consumption on Saturdays and Sundays increasing significantly. Based on the water use pattern, the average water consumption in each time period can be determined through statistical analysis of historical water use data.
[0119] Furthermore, the data processing unit is used to pre-process the building water use data set.
[0120] Specifically, data cleaning is first performed. There may be missing values and outliers in the original data, which will interfere with model training and prediction. The mean filling method is used to process the missing values. The mean calculation formula is:
[0121]
[0122] Where n is the number of samples, X i is the characteristic value of the i-th sample, and the missing value is replaced by the calculated mean m.
[0123] Furthermore, the triple standard deviation method is used to detect and process outliers. The standard deviation s formula is:
[0124]
[0125] According to the triple standard deviation method, the threshold of the outlier is set as the sum of the mean and three times the standard deviation, and the characteristic value is checked to see if it exceeds the threshold range. If it exceeds the threshold, it is replaced by the mean.
[0126] Furthermore, all data are normalized to the range of [0,1], and the normalization formula is:
[0127]
[0128] Among them, X normis the normalized value, X is the original data, min(X) and max(X) are the minimum and maximum values of feature X respectively.
[0129] Furthermore, the processed data is randomly divided into the training set and the test set according to 80% and 20%, and the preprocessed data provides a reliable input for the model.
[0130] Through these preprocessing methods, the SVR-DNN and DDPG-ATT models are less susceptible to data anomalies, allowing the non-negative pressure control system to more flexibly adjust the pump operation frequency when facing weather changes, holiday impacts, and normal changes in residents' living habits, and water consumption changes are constantly changing, avoiding frequent false alarms or misadjustments. For example, if the system receives an abnormally large actual water consumption value, if no preprocessing is performed, it may cause the model to misjudge future water consumption during the learning process, and the water pump cannot be adjusted in time to meet the sudden high-frequency demand, which in turn affects the normal water use of residents.
[0131] Furthermore, the building water consumption prediction module includes:
[0132] A model structure determination unit, used to determine the network structure of the SVR-DNN prediction model, including an input layer, a hidden layer, an output layer, and the number of neurons;
[0133] Function selection unit, used to select ReLU as the activation function and mean square error as the loss function;
[0134] A training and adjustment unit, used to train the SVR-DNN prediction model, adjust the parameters of the SVR-DNN prediction model, and evaluate the performance of the SVR-DNN prediction model;
[0135] The prediction application unit uses the trained SVR-DNN prediction model to predict the building water consumption and output the prediction result.
[0136] Specifically, the operating conditions of the non-negative pressure water supply system are not only related to the water consumption of residents in the building, but also affected by a variety of complex factors. Traditional calculations are based only on population, which can easily lead to inaccurate results. Combined with previous research results, the factors affecting the water consumption of buildings are summarized into 8 aspects, including the number of households, the number of kitchens, the number of bathrooms, water prices, water supply pressure, temperature, humidity and holiday characteristics.
[0137] Further, the model structure determination unit refers to Figure 2As shown in Figure 1, the SVR model input layer dimension is 8 and the output dimension is 1, such as time, environmental parameters and daily usage. The output of the SVR model is used as the input of the DNN. The DNN model has 3 hidden layers with 128, 64 and 32 neurons respectively. The output layer only needs 1 neuron to output the future building water consumption.
[0138] Furthermore, the function selection unit selects the RBF kernel as the kernel function of the SVR model, which can consider the variable data characteristics in the building water system, and the DNN model selects ReLU as the activation function, Adam as the optimizer, and the mean square error as the loss function.
[0139] Further, the training adjustment unit includes:
[0140] The SVR model is used to predict the water flow of the building at the next moment:
[0141] M SVRt+1 =Ψ SVR (O t ,K,B,price t ,P t ,T t ,H t ,D t );
[0142] Among them, M SVRt+1 represents the SVR prediction value, Ψ SVR represents the SVR prediction model, O t represents the number of households at time t, K represents the number of kitchens, B represents the number of bathrooms, price t represents the water price at time t, P t is the water supply pressure at time t, T t represents the temperature at time t, H t represents the humidity at time t, D t Indicates whether time t is a holiday, D t It is represented by 1 and 0. In addition, the time interval is designed to be 1 hour, and the changes in data are observed every 1 hour;
[0143] Solve the SVR optimization problem, the optimization objective is as follows:
[0144]
[0145] The constraints are:
[0146]
[0147] The decision function is f(x i )=wx i +b,f(x i) is the i-th predicted value, w is the weight vector, b is the bias vector, x i represents the i-th sample, C is the regularization parameter, ξ i and is the relaxation factor, M i represents the i-th label value, ε SVR represents f(x i ) and M i The maximum deviation between them, i is the sample number, n is the total number of samples, and provides a preliminary prediction of building water consumption;
[0148] Specifically, suppose there are 100 samples, 80 samples in the training set, 20 samples in the test set, and a total of 8 features. The regularization parameter C determines the degree of penalty for the error, and the maximum deviation ε SVR Determines the error range within which the model is not penalized. C is initially set to 1, ε SVR It is set to 0.01, and the cross-validation method is used to indirectly determine the appropriate relaxation factor, so that the model can find a balance between complexity and accuracy when predicting future building water consumption.
[0149] Taking the predicted value of the SVR model as input, the SVR-DNN prediction model is trained to predict the water flow at time t+1:
[0150]
[0151] Among them, SVR-DNN is a water flow prediction model, represents the predicted value of the water flow prediction model at time t+1. It is divided into peak flow, normal flow and valley flow, with the average water consumption as the boundary, fluctuating up and down by 3 cubic meters to determine the peak flow, normal flow and valley flow.
[0152] Furthermore, the cost function of SVR-DNN with L2 regularization is as follows:
[0153]
[0154] Among them, M′ i is the predicted value of SVR-DNN, λ is the weight of the regularization term, which is set to 0.01, m is the number of weights in the neural network, ω j is the jth weight, and j is the weight number.
[0155] The MSE mean square error is used to evaluate the prediction effect of the SVR-DNN prediction model, which is expressed as:
[0156]
[0157] Among them, z i represents the true value, p i represents the predicted value, N water is the number of samples.
[0158] Nonlinear characteristics, that is, dynamic water use patterns related to time, such as peaks and troughs in water use in different time periods, and complex change patterns affected by environmental conditions and residents' behaviors. For example, the SVR-DNN model can identify the difference between peak hours in the morning and evening on weekdays and uniform water use throughout the day on holidays. Through the SVR model, water consumption patterns in different time periods can be predicted, while the DNN model further handles complex nonlinear relationships. The optimization setting of the SVR-DNN model helps to extract complex nonlinear characteristics, so that the SVR-DNN model can comprehensively analyze and capture changing factors, especially in terms of dynamic water use, and improve its response speed. This not only lays a solid foundation for achieving more accurate water consumption predictions, but also helps the non-negative pressure water supply system to be more flexibly regulated during operation to respond to changes in residents' needs, thereby achieving optimized management and flexible control of the non-negative pressure water supply system.
[0159] Specifically, after 500 training rounds, the evaluation results are shown in Table 1. The SVR-DNN prediction model has the smallest error and the best prediction performance. SVR-DNN combines the advantages of SVR and DNN. The knowledge accumulated in the training phase effectively copes with the complex nonlinear relationship of the building water system and improves the responsiveness to dynamic water demand. Therefore, in the testing phase, the prediction error is the lowest. The prediction error of SVR-DNN is reduced by about 0.09 and 0.11 respectively compared with SVR and DNN, and the prediction error is reduced by about 0.13 compared with the commonly used linear regression method. Through SVR-DNN, future peak water consumption can be more accurately predicted, the management decision of the non-negative pressure water supply system can be guided, the frequency and operation strategy of the water pump can be automatically adjusted, and more flexible control can be achieved to meet the daily needs of residents.
[0160] Table 1 Prediction error
[0161]
[0162] Furthermore, the MDP model building module includes:
[0163] A state space definition unit is used to describe the state information of the water supply system at different time points. The agent needs to observe and record the state information of the water supply system at different time points, such as water pressure, water flow, equipment operation status, etc.;
[0164] An action space definition unit, used to determine the control action taken in the state space, such as adjusting the frequency of a water pump, opening and closing a valve, etc.;
[0165] A reward function unit is used to evaluate the effect of the action, give rewards and penalties according to the energy saving effect and water supply stability, and guide the agent to learn how to make the best decision in different situations;
[0166] The transfer function unit is used to describe the probability of the system transferring from one state to another. The environment determines the next state according to the feedback of the action and the state space. Since deep reinforcement learning does not require the information of the state transfer function, the specific implementation process of the transfer function is not concerned in this embodiment;
[0167] The discount factor unit, used to balance the relative importance of current rewards versus future rewards during long-term optimization, is set to 0.9.
[0168] Specifically, MDP, or Markov decision process, is used to describe systems with randomness and decision-making. MDP is widely used in fields such as reinforcement learning and optimization control. In MDP, the entire learning process is an iterative process. The agent continuously observes, learns, and adjusts strategies in interaction with the environment to optimize its decision-making ability and system operation efficiency. Through the construction and learning of the MDP model, the agent can gradually improve its adaptability and management level to the complex environment of the water supply system.
[0169] Further, the state space definition unit includes:
[0170]
[0171] Among them, S t is the state space at time t, F 1 is the operating frequency of pump 1 at time t, F 2 is the operating frequency of pump 2 at time t, F 3 is the operating frequency of pump 3 at time t, G t is the actual water flow at time t. The important factors affecting the operation of the non-negative pressure water supply system are added to the state space.
[0172] It is worth noting that the future construction water consumption is taken into account here. By adding it to the state space, the intelligent agent can observe the water demand at time t+1. For example, it is currently 7 o'clock and the water consumption is 6 cubic meters per hour, but most residents in the community wash at 8 o'clock. When the future water consumption is predicted to be 12 cubic meters per hour, the non-negative pressure water supply system can adjust the water supply strategy before the actual demand changes and increase the frequency of water pump operation in advance, thereby reducing the problem of untimely water supply and improving the flexibility of system control.
[0173] Further, the action space definition unit includes:
[0174] A t ={F1,t ,F 2,t ,F 3,t};
[0175] Among them, A t is the action space, F 1,t 、F 2,t and F 3,t They correspond to the operating frequencies of the three variable-frequency water pumps in the community. Here, the control frequency of each water pump is defined as a continuous control variable. For example, the general operating frequency is 40, but the designed operating frequency can be displayed as 40.0052. This not only allows the water pump to be adjusted within a finer range, but also enables the non-negative pressure water supply system to adjust the frequency more finely according to real-time environmental requirements and operating conditions, thereby making the system more flexible when controlling.
[0176] Furthermore, the rules followed by the action space are:
[0177] When the non-negative pressure water supply system cannot meet the most unfavorable point demand, the water pump operation frequency is increased until the water supply reaches the set value;
[0178] When the building water consumption increases, increase the pump operation frequency and calculate F n And judge F n >F target Is it true? If so, switch to the power frequency mode and add one more water pump to run; otherwise, continue to run with the current number of water pumps;
[0179] When the building water consumption decreases, the pump operation frequency is gradually reduced to calculate F n And judge F n <F target Is it true? If so, reduce one water pump and switch from power frequency mode to variable frequency mode. Otherwise, continue to operate with the current number of water pumps.
[0180] Among them, F n represents the total frequency when the non-negative pressure water supply system has n water pumps, F target is the calculated target frequency.
[0181] For example, if the industrial frequency water pump is a 50HZ water pump, if the target frequency is 75HZ and the current frequency is calculated to be 40HZ, the operating frequency of the first water pump is increased and switched to industrial frequency mode, and the second water pump is automatically turned on until it reaches 75HZ. Otherwise, turning on three water pumps at the same time will generate a lot of energy consumption and bring cost burden. The above rules enable the non-negative pressure water supply system to run multiple pumps in parallel, and can automatically adjust the operating frequency and mode of the water pumps according to the increase or decrease of the building's water consumption, reducing the energy consumption pressure caused by the simultaneous operation of multiple pumps. In addition, the parallel operation of multiple pumps can also improve the stability and flexibility of the system and reduce the need for human intervention.
[0182] Furthermore, the reward function includes:
[0183]
[0184] Among them, R t is the reward function at time t, is the energy consumption reward at time t, which is automatically calculated by the non-negative pressure water supply system. is the reward for stable water supply at time t, is the system pressure reward value, a, b, c are trade-off factors. Compared with other rewards, this embodiment pays more attention to the water supply stability reward, so a is set to 0.4, b and c are set to 0.3;
[0185] Furthermore, the water supply stability reward is expressed as:
[0186]
[0187] in, Reward for the stability of water supply of three water pumps, is the water supply stability reward for the i-th water pump;
[0188] Further, the It is expressed as:
[0189]
[0190] Among them, F i,t is the operating frequency of the ith pump at time t, F i,t-1 is the operating frequency of the ith pump at time t-1, and the threshold ΔF th The maximum frequency variation allowed is set to 10HZ.
[0191] Furthermore, the system pressure reward value It is expressed as:
[0192]
[0193] Among them, P tis the water supply pressure at time t, P t target is the target pressure value at time t. Different values are set according to peak flow, normal flow and valley flow. According to regulations, under normal water supply pressure, the water supply pressure per square meter should be between 150 kPa and 350 kPa, so P t target Set to 300, 240 and 170 kPa, respectively. th It is the maximum allowable deviation value. It is set to 20 kPa deviation at peak and trough times. For normal flow, the pressure fluctuation is small and it is set to 10 kPa deviation.
[0194] Through the design of rewards for energy consumption, frequency and pressure, the system can adapt and respond to complex operating environments and actual demand changes, and autonomously learn better decisions, thereby achieving optimized management and flexible control of the non-negative pressure water supply system. For example, by limiting frequency changes, at night, in order to avoid penalties for exceeding the threshold, the system will choose a lower operating frequency or even shut down the water pump to achieve a higher reward.
[0195] Furthermore, an optimization module is used to train and test the DDPG-ATT model. Based on the MDP model, the DDPG-ATT model is designed. After multiple iterations and training, the parameters of the DDPG-ATT model are adjusted to obtain an optimized DDPG-ATT agent.
[0196] Further, if Figure 5 As shown in the figure, the Actor network of the DDPG-ATT prediction model in the optimization module is no longer a simple fully connected layer network, but an Attention network is added, which is denoted as the Actor-ATT network.
[0197] Further, state S t Input the Actor network with Attention mechanism, pass through a fully connected layer, and then apply the Softmax activation function to obtain the weight W of each state component i , and then multiply it with the original vector to get a new state vector, and then pass through two fully connected layers and ReLU activation function and Sigmoid activation function to get the future building water flow. The Critic network, the target Actor network with attention mechanism (target Actor-ATT network) and the target Critic network assisted Actor-ATT network in this model improve the prediction strategy.
[0198] Specifically, as shown in Table 2, for the DDPG-ATT model, its network includes an Actor-ATT network for outputting actions and a Critic network, a target Actor-ATT network, and a target Critic network that assists the Actor-ATT network in improving its strategy. In the Actor-ATT network with the Attention mechanism, the Attention network is a fully connected layer with 32 neurons, and the Attention network is followed by 2 hidden layers with 128 and 64 neurons respectively; the Critic network has 2 hidden layers with 64 and 32 neurons respectively; the target Actor-ATT network, the target Critic network and their corresponding main network parameters are the same.
[0199] Table 2 Network parameter settings
[0200]
[0201] Further, similarly Figure 5 As shown, the optimization module process includes:
[0202] All data related to the non-negative pressure water supply system constitutes the environment for the agent to learn;
[0203] Initialize the DDPG-ATT agent, including the Actor-ATT network μ(s|θ μ ) and Critic network Q(s,a|θ Q ), the parameters of the two networks are θ μ and θ Q Represents, and also initializes their target network μ(s|θ μ' ) and Q(s,a|θ Q' ), the network parameters are θ μ' and θ Q' express;
[0204] The predicted building water flow at the next moment is extended to the original state. The agent observes the state S t ;
[0205] Use ReLU activation function and Sigmoid activation function to get the current action A t ;
[0206] At control intervals of one hour, the action is input into the environment, and the DDPG-ATT agent observes the next state S t+1 And get reward R t , the DDPG-ATT agent converts the experience sample {S t ,A t ,R t ,St+1}Store in the experience pool. When the experience pool has accumulated enough capacity, randomly select a small batch of transfer samples. Perform training and learning, where i is the sample number;
[0207] Calculate the target Q value y i :
[0208] y i =R i +γQ′(S t+1 ,μ′(S t+1 ∣θ μ′ )|θ Q′ );
[0209] Among them, γ is the discount factor, which is 0.9;
[0210] The gradient descent method is used to minimize the difference between the Critic network evaluation value and the target value, and the Critic network parameters are updated. The loss function L is:
[0211]
[0212] The Actor network updates the network parameters through the policy gradient method based on the evaluation value calculated by the Critic network. for:
[0213]
[0214] DDPG-ATT uses a soft update method to update the target network:
[0215]
[0216] Among them, τ is the soft update coefficient, which is set to 0.003, which can give full play to the advantages of each model.
[0217] By introducing the attention mechanism, the DDPG-ATT model can better focus on the important factors that affect the operation of the water pump during the learning process, such as the water consumption pattern in different time periods and the trend of system pressure changes. These factors are weighted through the attention mechanism to help the system more accurately select and adjust the operating frequency of the water pump to maximize the current and future water demand, thereby improving the flexibility of system operation. For example, when the system detects abnormal pressure or flow, the attention mechanism can help the system focus on the part that needs to be adjusted most under abnormal conditions, reducing frequent water pump start and stop operations.
[0218] In order to demonstrate the effectiveness of the present invention, three comparative schemes are introduced. A small residential building is used as a simulated environment to compare the performance for one week. Specifically, comparative scheme 1 does not use the SVR-DNN prediction model, and uses the original PID method to control the non-negative pressure water supply system; comparative scheme 2 does not use the SVR-DNN prediction model, but uses the DDPG-ATT model; comparative scheme 3 uses the SVR-DNN prediction model and the DDPG model.
[0219] As shown in Table 3, the system designed by the present invention shows significant advantages in many aspects. First, the system performs best in energy consumption, which means that it can operate in a more efficient way, save energy and reduce operating costs. Secondly, the system obtained the highest comprehensive reward score, which reflects its comprehensive superiority in various performance indicators. The comparison with Scheme 2 shows that the SVR-DNN prediction model can effectively predict the future building water consumption, thereby optimizing the operation strategy of the water supply system and improving the efficiency of system control. The comparison with Scheme 3 shows the effectiveness of the DDPG-ATT model in complex action space, and the flexibility and efficiency of the system are further improved by introducing the attention mechanism. The comparison with Scheme 1, i.e. the prior art, shows that the present invention can save energy to the greatest extent and ensure the stability and timeliness of water supply. The results show that the present invention can not only better meet the daily water needs of residents in the building, but also adapt to different operating environments and demand changes, and achieve more flexible and efficient system control.
[0220] Table 3 Performance comparison of different solutions
[0221]
[0222] Furthermore, the control result generation module uses the DDPG-ATT agent to generate a control strategy according to the current state of the non-negative pressure water supply system and water demand.
[0223] Furthermore, the trained SVR-DNN prediction model and the DDPG-ATT model parameters are saved, and the real data of the community is obtained through sensors and other equipment. These data are pre-processed, and the non-negative pressure water supply system receives real-time data and inputs the data into the SVR-DNN prediction model to generate a future building water consumption forecast value, that is, the water consumption in the next hour. The forecast value is input into the DDPG-ATT model, and based on the previously designed MDP model and the effective information learned previously, the three water pumps are reasonably controlled to generate an intelligent control strategy. Through the collaborative work of multiple modules, closed-loop management of data collection, processing, prediction, optimization and control is realized, thereby improving the overall operational flexibility of the non-negative pressure water supply system.
[0224] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A smart water supply system without negative pressure, characterized in that: include: A data acquisition module is used to obtain a building water data set, perform data cleaning and missing value processing on the building water data set, and divide the building water data set into a training set and a test set; A building water consumption prediction module is used to predict future building water consumption, use the training set to offline train the SVR-DNN prediction model, adjust the parameters of the SVR-DNN prediction model, input the test set into the optimized SVR-DNN prediction model, and generate the future building water consumption; An MDP model construction module is used to construct the MDP model, input the future building water consumption into the state space, design the state space, action space and reward function, and describe the learning process of the non-negative pressure water supply system; An optimization module is used to train and test the DDPG-ATT model. Based on the MDP model, the DDPG-ATT model is designed. After multiple iterations and training, the parameters of the DDPG-ATT model are adjusted to obtain the optimized DDPG-ATT model. The control result generation module uses the optimized DDPG-ATT model to generate a control strategy according to the state of the non-negative pressure water supply system and water demand.
2. According to claim 1, a smart water supply system without negative pressure is characterized in that: The data acquisition module comprises: A data collection unit, used to collect the building water use data set at each moment; The data processing unit is used to preprocess the building water data set, process the missing values using the mean filling method, detect and process outliers using the triple standard deviation method, and normalize the building water data set and divide it into the training set and the test set.
3. The smart water supply system without negative pressure according to claim 1 is characterized in that: The building water consumption prediction module includes: A model structure determination unit, used to determine the network structure of the SVR-DNN prediction model, including an input layer, a hidden layer, an output layer, and the number of neurons; Function selection unit, used to select ReLU as the activation function and mean square error as the loss function; A training and adjustment unit, used to train the SVR-DNN prediction model, adjust the parameters of the SVR-DNN prediction model, and evaluate the performance of the SVR-DNN prediction model; The prediction application unit uses the trained SVR-DNN prediction model to predict the non-negative pressure water supply system and outputs the future building water consumption.
4. The smart water supply system without negative pressure according to claim 3 is characterized in that: The training adjustment unit comprises: The SVR model is used to predict the future building water consumption: in, represents the SVR prediction value at time t+1, Ψ SVR represents the SVR model, O t represents the number of households at time t, K represents the number of kitchens, B represents the number of bathrooms, price t represents the water price at time t, P t represents the water supply pressure at time t, T t represents the temperature at time t, H t represents the humidity at time t, D t Indicates whether time t is a holiday; Solve the SVR model optimization problem, the optimization goal is: The constraints are: The decision function is f(x i )=wx i +b,f(x i ) is the i-th predicted value, w is the weight vector, b is the bias vector, x i represents the i-th sample, C is the regularization parameter, ξ i and is the relaxation factor, M i represents the i-th label value, ε SVR represents f(x i ) and M i The maximum deviation between them, i is the sample number, n is the total number of samples; The SVR predicted value As input, the SVR-DNN prediction model is trained, which is expressed as: Among them, SVR-DNN is the SVR-DNN prediction model, is the future building water consumption at time t+1, and Divided into peak traffic, normal traffic and valley traffic; Cost function of the SVR-DNN prediction model with L2 regularization for: Among them, M′ i is the predicted value of the SVR-DNN prediction model, λ is the weight of the regularization term, m is the number of weights in the neural network, ω j is the jth weight, j is the weight number, and n is the total number of samples; The MSE mean square error is used to evaluate the prediction effect of the SVR-DNN prediction model, which is expressed as: Among them, L MSE is the error value, z i is the true value, p i is the predicted value.
5. The smart water supply system without negative pressure according to claim 1 is characterized in that: The state space includes: Among them, S t is the state space at time t, F 1,t is the operating frequency of pump 1 at time t, F 2,t is the operating frequency of pump 2 at time t, F 3,t is the operating frequency of pump 3 at time t, G t is the actual water flow at time t.
6. The smart water supply system without negative pressure according to claim 1 is characterized in that: The action space includes: A t ={F 1,t ,F 2,t ,F 3,t }; Among them, A t is the action space at time t.
7. The smart water supply system without negative pressure according to claim 6 is characterized in that: The rules followed by the action space are: When the non-negative pressure water supply system cannot meet the most unfavorable point demand, the water pump operation frequency is increased until the water supply reaches the set value; When the building water consumption increases, the pump operation frequency is increased, and F is calculated. n And judge F n >F target Is it true? If so, switch to the power frequency mode and add one more water pump to run; otherwise, continue to run with the current number of water pumps; When the building water consumption decreases, the pump operation frequency is reduced, and F is calculated. n And judge F n <F target Is it true? If so, one water pump is reduced to operate, and the power frequency mode is switched to the variable frequency mode; otherwise, the current number of water pumps continues to operate; Among them, F n is the total frequency when the non-negative pressure water supply system has n water pumps, F target is the calculated target frequency.
8. The smart water supply system without negative pressure according to claim 1 is characterized in that: The reward function includes: Among them, R t is the reward function at time t, is the energy consumption reward at time t, is the reward for stable water supply at time t, is the system pressure reward value, a, b, c are the trade-off factors; The water supply stability reward is expressed as: in, is the water supply stability reward of the three water pumps at time t, is the water supply stability reward of the i-th water pump at time t; Said It is expressed as: Among them, F i,t is the operating frequency of the ith pump at time t, F i,t-1 is the operating frequency of the i-th pump at time t-1, and the threshold ΔF th is the maximum frequency change allowed; The system pressure reward value It is expressed as: Among them, P t represents the water supply pressure at time t, P t target is the target pressure value at time t, and different values are set according to peak flow, normal flow and valley flow, ΔP th is the maximum allowed deviation value.
9. The smart water supply system without negative pressure according to claim 1 is characterized in that: The optimization module includes: Initialize the DDPG-ATT model, including the Actor-ATT network, the Critic network, the target Actor-ATT network, the target Critic network, and the experience replay buffer; The state S t Through the Actor-ATT network processing, the weight of each state component is calculated using the Softmax activation function, and the weight of the state component and the state S t Multiply them together to get a new weighted state vector, which is then processed by two fully connected layers; Use ReLU activation function and Sigmoid activation function to get the current action A t ; The current action A t Input environment, the agent observes the next state S t+1 And get reward R t , storing the experience samples in an experience pool, and when the experience pool accumulates to a fixed capacity, using the experience samples for training and learning; The difference between the evaluation value of the Critic network and the target value is minimized by using the gradient descent method, and the parameters of the Critic network are updated. The Actor-ATT network calculates the evaluation value according to the Critic network and updates the network parameters by using the policy gradient method. The target Actor-ATT network and the target Critic network are updated using a soft update method.
10. The smart water supply system without negative pressure according to claim 1, characterized in that: The control result generation module comprises: The trained SVR-DNN prediction model and the DDPG-ATT model are saved, and after preprocessing the real-time data, the real-time data is input into the SVR-DNN prediction model, the future building water consumption is output, and input into the DDPG-ATT model to generate a control strategy.
Citation Information
Cited By
Intelligent accounting method for industrial water consumption
CN120069220A
Fluid transmission and distribution pipe network pump valve joint debugging control method based on reinforcement learning
CN120871646A
Self-adaptive adjustment control method and system for parameters of water pump controller
CN121165434A
