Variable frequency water supply pressure setting method and system based on flow prediction
By using a flow prediction-based variable frequency water supply system, and employing a time-period attention mechanism and online identification algorithm, the pressure setpoint is dynamically calculated, solving the problems of control response lag and high energy consumption in variable frequency constant pressure water supply systems, and achieving high-precision, low-energy adaptive control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TAIZHOU JINCHUAN PUMP
- Filing Date
- 2026-04-08
- Publication Date
- 2026-06-05
AI Technical Summary
Existing variable frequency constant pressure water supply systems suffer from problems such as control response lag, high energy consumption, insufficient prediction accuracy, and poor parameter adaptability, making it difficult to achieve a balance between accuracy, energy saving, and long-term adaptability.
A long short-term memory network model with fusion time-period attention mechanism is used for flow prediction. Combined with the pipeline hydraulic characteristic model and online identification algorithm, the pressure setpoint is dynamically calculated, and the synergistic effect of feedforward prediction and feedback correction is realized through a dual closed-loop control architecture.
It improves the accuracy and time-period adaptability of flow forecasting, reduces pressure overshoot, enhances control accuracy and system stability, realizes active optimization of pressure setpoint and model adaptation, and solves the passive response limitation of traditional control methods.
Smart Images

Figure CN122147947A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of variable frequency water supply control technology, and more specifically, to a method and system for setting variable frequency water supply pressure based on flow prediction. Background Technology
[0002] Variable frequency constant pressure water supply technology, as the core control method of modern urban water supply systems, has been widely used in high-rise building secondary water supply, regional booster pump stations and rural centralized water supply. This technology adjusts the speed of the water pump motor through a frequency converter to achieve continuous regulation of flow and pressure. Compared with the traditional valve throttling regulation method, it has significant energy-saving effect.
[0003] Variable frequency constant pressure water supply systems generally suffer from control response lag and high energy consumption. There are two main existing control methods: one is pure feedback control based on PID, which causes pressure regulation delay due to pipeline inertia when water consumption changes suddenly, resulting in pressure fluctuations and energy waste; the other is feedforward control combined with simple flow prediction, but the existing prediction model cannot effectively distinguish the differences in water consumption patterns during different periods such as morning and evening peaks and off-peak periods, and the prediction accuracy is insufficient. Furthermore, the parameters of the pipeline hydraulic model upon which the pressure setpoint is calculated, such as the friction coefficient, are usually fixed and cannot adapt to changes in resistance caused by pipeline aging and scaling, resulting in a decrease in control accuracy over time. Simultaneously, the intelligent models used for prediction cannot adapt to new water usage patterns after long-term operation, leading to high retraining costs and poor stability. Existing technologies struggle to achieve a balance between accuracy, energy efficiency, and long-term adaptability. Summary of the Invention
[0004] In order to overcome the above-mentioned defects of the prior art, the present invention provides a method and system for setting variable frequency water supply pressure based on flow prediction, so as to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for setting variable frequency water supply pressure based on flow prediction, comprising the following steps: S1. Obtain historical flow data, water usage period characteristic data, and water pressure response data of the target water supply area to construct a multi-dimensional water usage characteristic database. S2. Based on the multi-dimensional water use feature database, a long short-term memory network model with a fusion time-period attention mechanism is used to predict water use flow to obtain a predicted flow sequence. S3. Based on the predicted flow sequence and the hydraulic characteristic model of the pipeline network constructed based on the pipeline network topology, calculate the reference pressure; the parameters of the hydraulic characteristic model of the pipeline network are updated in real time through an online identification algorithm. S4. Calculate the volatility index of the predicted flow sequence. If the volatility exceeds a preset threshold, calculate the pressure pre-adjustment amount based on the trend of the predicted flow and add it to the benchmark pressure to generate the target pressure setpoint. If it does not exceed the threshold, use the benchmark pressure directly as the target pressure setpoint. S5. The target pressure setpoint is transmitted to the frequency converter to drive the water pump unit to adjust the operating frequency.
[0006] Preferably, the long short-term memory network model in S2 that integrates a time-period attention mechanism includes an input layer, at least one LSTM hidden layer, a time-period attention sublayer, and an output layer. The time-period attention sublayer extracts time-period feature vectors from the time-period embedding matrix trained synchronously with the network weights based on the time-period type corresponding to the timestamp of the input sample, and adaptively weights the LSTM hidden state. The time-period types include morning peak hours, evening peak hours, off-peak hours, and late-night off-peak hours. The predicted traffic sequence includes traffic prediction values for the next 1 hour, 4 hours, and 24 hours, and the logical consistency of the prediction results at each scale is ensured by a time-scale consistency constraint loss function.
[0007] Preferably, the specific processing flow of the time-segment attention sublayer includes: The timestamps of the input samples are converted into time-type encoding vectors in one-hot encoding form according to preset time-segmentation rules. ; Encode the time period type vector Input a fully connected embedding layer, through a learnable embedding matrix. Mapped to time period feature vector ; Calculate attention weight coefficients ,in , represents the hidden state of LSTM. and For learnable attention parameters, This represents a vector concatenation operation; The attention weight coefficient With LSTM hidden state Perform element-wise multiplication to obtain the weighted hidden state. This serves as the output of the attention sublayer for the specified time period.
[0008] Preferably, the construction of the time-scale consistency constraint loss function includes: The multi-task loss function is defined as the weighted sum of the mean squared error losses of predictions at each time scale plus a consistency constraint loss term. The consistency constraint loss term forces the sum of adjacent short-scale predictions to be equal to the corresponding long-scale prediction, ensuring the logical consistency of the multi-timescale prediction results.
[0009] Preferably, the online identification algorithm in S3 adopts the recursive least squares method, and the specific execution steps include: Establish a time-varying model for pipe friction coefficient. ,in To address process noise; establish measurement equations. ,in This represents the measured pressure difference between the two ends of the pipeline. This is the measured value of the pipeline flow rate. For measuring noise; Perform recursive least squares update: compute the gain matrix
[0010] Update covariance: Update the estimated friction coefficient: in To estimate the error covariance, To measure the noise covariance, Let be the process noise covariance.
[0011] Preferably, the volatility index in S4 is the coefficient of variation of the predicted flow rate sequence within a preset sliding window; the calculation of the pressure pre-adjustment includes: When the predicted flow rate shows an upward trend, calculate the positive pressure pre-rise. Superimposed on the reference pressure, wherein This is the pipeline resistance coefficient. To predict traffic increments, This is the pressure response hysteresis compensation coefficient; When the predicted flow rate shows a downward trend, calculate the negative pressure pre-drop amount. This is superimposed on the reference pressure.
[0012] Preferably, the pressure response hysteresis compensation coefficient The pressure response time constant of the pipeline system was determined by step response experiments. It was later determined that... ,in This is the sampling control cycle of the frequency converter.
[0013] Preferably, it further includes: S6. Real-time acquisition of actual flow data in the pipeline network, and calculation of the deviation between the current actual flow and the corresponding predicted flow. And calculate the mean absolute percentage error (MAPE) within the sliding window as a prediction error index; S7. When the MAPE exceeds the preset prediction error threshold For more than the preset number of time periods When the time is right, the online model correction mechanism is triggered: the input layer and LSTM hidden layer parameters of the long short-term memory network model are frozen, and incremental learning is performed only on the attention parameters and output layer parameters of the attention sub-layer of the time period. Gradient descent iteration is performed using the latest M sets of measured data within the sliding window to update the network parameters. S8. Based on the aforementioned deviation The feedback fine-tuning amount is calculated through the PI controller. and will The values are superimposed on the target pressure setpoint to construct a dual closed-loop pressure control architecture of feedforward prediction and feedback correction.
[0014] A variable frequency water supply pressure setting system based on flow prediction is also provided, including: The data acquisition module is used to acquire historical flow data, water usage period characteristic data, and water pressure response data of the target water supply area, and to build a multi-dimensional water usage characteristic database. The flow prediction module has a built-in long short-term memory network model that integrates time-period attention mechanism to predict the water consumption of the target water supply area in the future preset time period, and obtain a predicted flow sequence containing multiple time scales. The benchmark pressure calculation module is used to calculate the minimum water supply pressure value that meets the pressure requirements of end users as the benchmark pressure based on the predicted flow sequence and the hydraulic characteristic model of the pipeline network constructed based on the pipeline network topology. The benchmark pressure calculation module includes an online identification unit, which is used to update the parameters of the hydraulic characteristic model of the pipeline network in real time through an online identification algorithm. The dynamic pressure setting module is used to calculate the volatility index of the predicted flow sequence. When the volatility exceeds a preset threshold, the pressure pre-adjustment amount is calculated based on the trend of the predicted flow and superimposed on the benchmark pressure to generate the target pressure setting value; otherwise, the benchmark pressure is maintained as the target pressure setting value. The variable frequency control execution module is used to transmit the target pressure setpoint to the variable frequency controller, drive the water pump unit to adjust the operating frequency, and make the actual pressure of the pipeline track the target pressure setpoint.
[0015] Preferably, it further includes: The prediction error monitoring module is used to collect real-time actual flow data from the pipeline network and calculate the deviation between the current actual flow and the corresponding predicted flow. And calculate the mean absolute percentage error (MAPE) within the sliding window as a prediction error index; The online model calibration module is used when the MAPE exceeds a preset prediction error threshold. For more than the preset number of time periods When the time is right, the online model correction mechanism is triggered: the input layer and LSTM hidden layer parameters of the long short-term memory network model are frozen, and incremental learning is performed only on the attention parameters and output layer parameters of the attention sub-layer of the time period. Gradient descent iteration is performed using the latest M sets of measured data within the sliding window to update the network parameters. The feedback fine-tuning module is used to adjust the settings based on the deviation. The feedback fine-tuning amount is calculated through the PI controller. and will The values are superimposed on the target pressure setpoint to construct a dual closed-loop pressure control architecture of feedforward prediction and feedback correction. The visualization monitoring module is used to display predicted flow, pressure setpoint, actual pressure curve and prediction error information, and provides a manual intervention interface; The safety protection module is used to set pressure upper and lower limit protection, flow change protection and predictive failure protection mechanism. When abnormal operating conditions are detected, it automatically switches to the traditional constant pressure control mode and issues an alarm.
[0016] The technical effects and advantages of this invention are as follows: 1. By integrating the time-period attention mechanism into the LSTM network structure, and through the time-period embedding matrix and adaptive weighting strategy, the model can dynamically adjust the attention weights for features of different historical time periods based on the timestamps of the input samples. At the same time, by using the time-scale consistency constraint loss function, the logical consistency between short-scale and long-scale predictions is enforced, which improves the prediction accuracy of the model during key periods such as morning and evening peak hours compared to traditional LSTM, and reduces the consistency error of multi-time-scale prediction results. This lays a reliable data foundation for subsequent pressure-based control. Through the time-period attention mechanism and multi-time-scale prediction, the accuracy and time-period adaptability of flow prediction are significantly improved, solving the problem of insufficient capture of peak water consumption features by traditional models. 2. Through an active control chain that combines predicted flow rate, volatility judgment, and feedforward pre-adjustment, the severity of fluctuations is identified based on the coefficient of variation of the predicted flow rate. The system inertia is quantified by the pressure response lag compensation coefficient, and the pressure pre-adjustment is calculated in advance and superimposed on the reference pressure. At the same time, the pipeline friction coefficient is identified online using the recursive least squares method, and the hydraulic model is corrected in real time. The synergistic mechanism of prediction feedforward and parameter adaptation enables the system to complete pressure regulation preparation before the flow rate changes, reducing pressure overshoot and improving the end pressure compliance rate. It also avoids the accumulation of control deviations caused by fixed parameter models. Through the synergistic effect of prediction-driven dynamic pressure feedforward compensation and online identification of pipeline parameters, active optimization of pressure setting and model adaptation are achieved, breaking through the limitations of passive response in traditional constant pressure control. 3. By employing an incremental learning strategy of freezing the backbone and fine-tuning the head, when the prediction error index continues to exceed the limit, the general feature extraction parameters of the LSTM input layer and hidden layer are frozen. Only the time-sensitive parameters of the time-period attention sublayer and the output layer are subjected to small-sample gradient descent iterations. This allows for rapid adaptation to new water use patterns while retaining the learned general knowledge. Simultaneously, the prediction deviation is converted into pressure feedback fine-tuning through a PI controller, which is superimposed with the feedforward setpoint to form a dual closed-loop control. This architecture improves the efficiency of retraining the entire model when the water use pattern changes seasonally. Furthermore, the feedback loop eliminates the prediction residual, ensuring that the system can maintain pressure control accuracy during the model calibration transition period. This achieves an organic unity of prediction intelligence and control reliability. Through the dual closed-loop architecture of online calibration with model layer freezing and PI feedback fine-tuning, a robust control system with self-learning capabilities is constructed, ensuring the stability and reliability of long-term operation. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the method flow structure of the present invention.
[0018] Figure 2 This is a schematic diagram of the system structure of the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] Example 1: Variable Frequency Water Supply Pressure Setting Method Based on Flow Prediction This embodiment provides a variable frequency water supply pressure setting method based on flow prediction, the process of which is as follows: Figure 1 As shown.
[0021] The specific steps include: S1: Construct a multi-dimensional water use characteristic database.
[0022] By deploying flow meters and pressure sensors at key nodes such as pump station outlets, main pipeline junctions, and pipeline ends, historical operating data of the target water supply area is continuously collected in 5-minute cycles.
[0023] The collected data includes: Historical flow data of pipeline network: forming a time series data sequence .
[0024] Water usage time period characteristic data: Based on the preset time period division rules, the timestamp t is mapped to a "time period type" label; specifically, 7:00-9:00 is marked as "morning peak period", 17:00-20:00 is marked as "evening peak period", 23:00-5:00 the next day is marked as "late night off-peak period", and the rest of the time period is marked as "off-peak period"; at the same time, "weekday" or "rest day" is marked according to calendar information; finally, this time period type is encoded into a uniquely heated encoded vector. Its dimensions are 4, corresponding to four time periods: morning peak, evening peak, off-peak, and late-night off-peak.
[0025] Pipeline pressure response data: Record the pressure at key monitoring points and the pressure difference between upstream and downstream.
[0026] The above data is stored in a time-series database to construct a multi-dimensional water use characteristic database.
[0027] Typical parameter configuration Network structure parameters: LSTM hidden layers: 2 layers, 128 units per layer, dropout rate of 0.2 during training.
[0028] Time period embedding matrix Dimensions: 4,128; 4 represents the number of time period types, and 128 represents the hidden state dimension.
[0029] Attention parameters Dimensions: 256,1 Dimension: 1.
[0030] RLS algorithm parameters: Process noise covariance Q: 10 -6 This reflects the slow time-varying characteristics of the parameters.
[0031] Measurement noise covariance R: calibrated to 0.001 based on the pressure sensor accuracy (0.1%FS).
[0032] Initial estimation error covariance 10 6 .
[0033] Pressure preset parameters: Pipeline resistance coefficient The typical range was determined through offline hydraulic model verification: 0.001-0.01 MPa·h² / .
[0034] Pipeline resistance coefficient Take 0.8 This demonstrates the system's characteristic that boost response is stronger than buck response.
[0035] The hysteresis compensation coefficient R is determined by the step response experiment in subsequent step S4.3, with a typical range of 3-6.
[0036] S2: Traffic prediction based on an LSTM model with a fusion time-period attention mechanism.
[0037] The dataset constructed in S1 is input into a long short-term memory network model that incorporates a time-based attention mechanism for training and prediction.
[0038] S2.1 Model Structure and Training: Includes an input layer, two LSTM hidden layers, a time-period attention sublayer, and an output layer; the model receives traffic flow sequences (288 points) from the past 24 hours and the corresponding time-period feature vectors. Output traffic flow forecasts for the next 1 hour, 4 hours, and 24 hours. .
[0039] S2.2 Implementation of the Time-Based Attention Mechanism: Execution of the processing flow of the time-based attention sub-layer: 1. Convert the time period type label into a one-hot encoded vector. .
[0040] 2. Through learnable embedding matrices Mapping yields time-period feature vectors .
[0041] 3. Calculate attention weights ,in For LSTM hidden states, , , This indicates vector concatenation.
[0042] 4. Output weighted hidden state .
[0043] S2.3 Multi-timescale consistency constraints: During model training, the loss term includes mean squared error loss and consistency constraint loss term. ; Force the sum of four consecutive 1-hour forecasts to be equal to the corresponding 4-hour forecast, i.e. This ensures the logical consistency of multi-scale prediction.
[0044] S3: Baseline pressure calculation and online parameter identification.
[0045] The goal is to calculate the minimum water supply pressure, or benchmark pressure, to meet end-point demand based on predicted flow rates.
[0046] S3.1 Establishing a hydraulic characteristic model of the pipeline network: Based on the pipeline network topology, the Hayzen-Williams formula is used to establish the model, the core of which is the relationship between pipeline pressure loss and the square of flow rate, i.e. ,in The coefficient of friction of the pipe is time-varying.
[0047] S3.2 Online Recursive Least Squares Identification: Real-time updating using the Recursive Least Squares (RLS) method. .
[0048] The specific execution steps are as follows: 1. Establish a time-varying model: 2. Establish the measurement equation: Where ΔP(t) and Q(t) are the real-time collected pipeline pressure difference and flow rate.
[0049] 3. Perform RLS update: Gain matrix: Update covariance: Updated estimates: S3.3 Calculate the baseline pressure: Use the predicted flow sequence obtained in S2 Input the updated hydraulic model; for small and medium-sized pipe networks, use the EPANET Toolkit for hydraulic adjustment calculations; for large pipe networks, a simplified method is used, calculating only the sum of the friction head loss from the pumping station to the most unfavorable point and the minimum service head at the end, as the reference pressure. This method significantly improves computational efficiency while ensuring accuracy.
[0050] S4: Dynamic pressure setting and feedforward compensation.
[0051] The final pressure setpoint is dynamically generated based on the fluctuation characteristics of the predicted flow.
[0052] S4.1 Calculate the volatility index: Calculate the coefficient of variation of the predicted flow series for the next hour over a sliding window, such as 6 points, within 30 minutes. As a volatility indicator, =Standard deviation / Mean.
[0053] S4.2 Pressure Pre-Adjustment Calculation: Setting Volatility Threshold .
[0054] like ≤ Then the target pressure setpoint .
[0055] like > Then, further judgment is made on the predicted flow rate trend. The least squares method is used to perform linear fitting on the recent predicted flow rate sequence, such as the next 20 minutes. If the slope... It is determined to be an upward trend. The trend is determined to be downward, then the pressure pre-adjustment is calculated: Upward trend: Downward trend: in, For the predicted traffic increase in the next 5 minutes, , For pre-tuning parameters, Let be the pressure response hysteresis compensation coefficient, then .
[0056] S4.3 Determination of the hysteresis compensation coefficient: The time required for the pipeline system pressure to reach 63.2% of its steady-state value from the initial value is determined through a step response experiment; this is the pressure response time constant. ,but ,in The sampling control period of the frequency converter is 1 second.
[0057] S5: Variable frequency control execution.
[0058] Set the target pressure value The signal is transmitted to the frequency converter control module in the PLC. This module uses a PID algorithm to generate control signals, which drive the water pump frequency converter to adjust the motor frequency, so that the actual pressure in the pipeline network tracks the target pressure setpoint.
[0059] Example 2: Online Model Calibration and Dual Closed-Loop Control This embodiment is an enhancement of Embodiment 1.
[0060] S6: Prediction error monitoring, real-time collection of actual flow in the pipeline network. Calculate the deviation between the actual flow rate and the corresponding predicted flow rate at the current moment. Meanwhile, the sliding window is calculated, and the mean absolute percentage error (MAPE) of the predictions over the past hour is used as the prediction error index.
[0061] S7: Online model calibration mechanism, calculates MAPE every 5 minutes, if MAPE exceeds a preset threshold. For more than the preset number of time periods If the error persists for 15 consecutive minutes, the online model correction mechanism is triggered. This mechanism works by freezing the input layer and LSTM hidden layer parameters of the Long Short-Term Memory (LSTM) network model, and only adjusting the attention parameters of the time-segment attention sublayer. , Incremental learning is performed on the output layer parameters. The latest M=30 sets of actual test data within the sliding window are used to perform 10 gradient descent iterations with a learning rate of 0.0001 to update the network parameters.
[0062] S8: Feedback fine-tuning and dual closed-loop architecture, based on deviation The feedback fine-tuning amount is calculated through an independent PI controller: The points time window is 30 minutes. The pressure is superimposed on the target pressure setpoint obtained in step S4 of Example 1 to achieve the final pressure closed-loop control, thereby constructing a dual closed-loop pressure control architecture of feedforward prediction and feedback correction.
[0063] Example 3: Variable Frequency Water Supply Pressure Setting System Based on Flow Prediction This embodiment provides a system for implementing the above method, the structure of which is as follows: Figure 2 As shown.
[0064] Data acquisition module: used to acquire historical flow data, water usage period characteristic data and water pressure response data of the target water supply area, and to build a multi-dimensional water usage characteristic database.
[0065] Flow prediction module: This module incorporates a long short-term memory network model with a built-in time-segment attention mechanism to predict water flow in a target water supply area over a preset time period, resulting in a predicted flow sequence with multiple time scales. This module is deployed on edge computing nodes at the pumping station site.
[0066] The baseline pressure calculation module is used to calculate the minimum water supply pressure value that meets the pressure requirements of end users based on the predicted flow sequence and the hydraulic characteristic model of the pipeline network constructed based on the pipeline network topology. This module includes an online identification unit, which is used to update the parameters of the pipeline network hydraulic characteristic model in real time through the recursive least squares method.
[0067] Dynamic pressure setpoint module: used to calculate the volatility index of the predicted flow sequence. When the volatility exceeds the preset threshold, the pressure pre-adjustment is calculated based on the trend of the predicted flow and superimposed on the benchmark pressure to generate the target pressure setpoint; otherwise, the benchmark pressure is maintained as the target pressure setpoint.
[0068] Variable frequency control execution module: used to transmit the target pressure setpoint to the variable frequency controller, drive the water pump unit to adjust the operating frequency, so that the actual pressure of the pipeline network tracks the target pressure setpoint.
[0069] Prediction error monitoring module: Used to collect real-time actual flow data of the pipeline network and calculate the deviation between the current actual flow and the corresponding predicted flow. The mean absolute percentage error (MAPE) within the sliding window is calculated as a prediction error metric.
[0070] Online model calibration module: used when MAPE exceeds a preset prediction error threshold.
[0071] For more than the preset number of time periods When the time is right, the online model correction mechanism is triggered: the input layer and LSTM hidden layer parameters of the Long Short-Term Memory Network model are frozen, and only the attention parameters and output layer parameters of the time-segment attention sub-layer are incrementally learned. The gradient descent iteration is performed using the latest M sets of measured data within the sliding window to update the network parameters.
[0072] Feedback fine-tuning module: used to adjust based on deviation The feedback fine-tuning amount is calculated through the PI controller. and will By superimposing the target pressure setpoint, a dual closed-loop pressure control architecture of feedforward prediction and feedback correction is constructed.
[0073] Visual monitoring module: Used to display the predicted flow sequence curve, target pressure setpoint curve, actual pipeline pressure curve, and prediction error statistics through a human-machine interface, and provides a manual intervention interface.
[0074] Safety protection module: used to set the pressure upper limit protection threshold. Pressure lower limit protection threshold Flow mutation protection threshold When the target pressure setpoint is detected to be out of limit or the flow rate changes transiently beyond the limit, If continuous failures are predicted, the protection will be automatically triggered, the control authority will be switched to the traditional constant voltage control mode, and an alarm signal will be sent to the upper-level system.
[0075] Finally, it should be noted that the accompanying drawings of the embodiments disclosed in this invention only involve the structures involved in the embodiments disclosed in this invention. Other structures can be referred to with ordinary designs. In the absence of conflict, the same embodiment and different embodiments of this invention can be combined with each other. In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for setting the pressure of variable frequency water supply based on flow prediction, characterized in that: Includes the following steps: S1. Obtain historical flow data, water usage period characteristic data, and water pressure response data of the target water supply area to construct a multi-dimensional water usage characteristic database. S2. Based on the multi-dimensional water use feature database, a long short-term memory network model with a fusion time-period attention mechanism is used to predict water use flow to obtain a predicted flow sequence. S3. Based on the predicted flow sequence and the hydraulic characteristic model of the pipeline network constructed based on the pipeline network topology, calculate the reference pressure; the parameters of the hydraulic characteristic model of the pipeline network are updated in real time through an online identification algorithm. S4. Calculate the volatility index of the predicted flow sequence. If the volatility exceeds a preset threshold, calculate the pressure pre-adjustment amount based on the trend of the predicted flow and add it to the benchmark pressure to generate the target pressure setpoint. If the pressure does not exceed the limit, the reference pressure will be used directly as the target pressure setpoint. S5. The target pressure setpoint is transmitted to the frequency converter to drive the water pump unit to adjust the operating frequency.
2. The variable frequency water supply pressure setting method based on flow prediction according to claim 1, characterized in that: The long short-term memory network model in S2 that incorporates a time-period attention mechanism includes an input layer, at least one LSTM hidden layer, a time-period attention sublayer, and an output layer. The time-period attention sublayer extracts time-period feature vectors from the time-period embedding matrix trained synchronously with the network weights, based on the time-period type corresponding to the timestamp of the input sample, and adaptively weights the LSTM hidden state; the time-period types include morning peak hours, evening peak hours, off-peak hours, and late-night off-peak hours; the predicted traffic sequence includes traffic prediction values for three time scales: the next 1 hour, 4 hours, and 24 hours, and the logical consistency of the prediction results at each scale is ensured by a time scale consistency constraint loss function.
3. The variable frequency water supply pressure setting method based on flow prediction according to claim 2, characterized in that: The specific processing flow of the attention sublayer for the specified time period includes: The timestamps of the input samples are converted into time-type encoding vectors in one-hot encoding form according to preset time-segmentation rules. ; Encode the time period type vector Input a fully connected embedding layer, through a learnable embedding matrix. Mapped to time period feature vector ; Calculate attention weight coefficients ,in , represents the hidden state of LSTM. and For learnable attention parameters, This represents a vector concatenation operation; The attention weight coefficient With LSTM hidden state Perform element-wise multiplication to obtain the weighted hidden state. This serves as the output of the attention sublayer for the specified time period.
4. The variable frequency water supply pressure setting method based on flow prediction according to claim 2, characterized in that: The construction of the time-scale consistency constraint loss function includes: The multi-task loss function is defined as the weighted sum of the mean squared error losses of predictions at each time scale plus a consistency constraint loss term. The consistency constraint loss term forces the sum of adjacent short-scale predictions to be equal to the corresponding long-scale prediction, ensuring the logical consistency of the multi-timescale prediction results.
5. The variable frequency water supply pressure setting method based on flow prediction according to claim 1, characterized in that: The online identification algorithm in S3 uses the recursive least squares method, and the specific execution steps include: Establish a time-varying model for pipe friction coefficient ,in To address process noise; establish measurement equations. ,in This represents the measured pressure difference between the two ends of the pipeline. This is the measured value of the pipeline flow rate. For measuring noise; Perform recursive least squares update: compute the gain matrix ; Update covariance: ; Update the estimated friction coefficient: ; in To estimate the error covariance, To measure the noise covariance, Let be the process noise covariance.
6. The variable frequency water supply pressure setting method based on flow prediction according to claim 1, characterized in that: In S4, the volatility index is the coefficient of variation of the predicted flow sequence within a preset sliding window. The calculation of the pressure pre-adjustment includes: When the predicted flow rate shows an upward trend, calculate the positive pressure pre-rise. Superimposed on the reference pressure, wherein This is the pipeline resistance coefficient. To predict traffic increments, This is the pressure response hysteresis compensation coefficient; When the predicted flow rate shows a downward trend, calculate the negative pressure pre-drop amount. This is superimposed on the reference pressure.
7. The variable frequency water supply pressure setting method based on flow prediction according to claim 6, characterized in that: The pressure response hysteresis compensation coefficient The pressure response time constant of the pipeline system was determined by step response experiments. It was later determined that... ,in This is the sampling control cycle of the frequency converter.
8. The variable frequency water supply pressure setting method based on flow prediction according to claim 1, characterized in that: Also includes: S6. Real-time acquisition of actual flow data in the pipeline network, and calculation of the deviation between the current actual flow and the corresponding predicted flow. And calculate the mean absolute percentage error (MAPE) within the sliding window as a prediction error index; S7. When the MAPE exceeds the preset prediction error threshold For more than the preset number of time periods When the time is right, the online model correction mechanism is triggered: the input layer and LSTM hidden layer parameters of the long short-term memory network model are frozen, and incremental learning is performed only on the attention parameters and output layer parameters of the attention sub-layer of the time period. Gradient descent iteration is performed using the latest M sets of measured data within the sliding window to update the network parameters. S8. Based on the aforementioned deviation The feedback fine-tuning amount is calculated through the PI controller. and will The values are superimposed on the target pressure setpoint to construct a dual closed-loop pressure control architecture of feedforward prediction and feedback correction.
9. A variable frequency water supply pressure setting system based on flow prediction, characterized in that, include: The data acquisition module is used to acquire historical flow data, water usage period characteristic data, and water pressure response data of the target water supply area, and to build a multi-dimensional water usage characteristic database. The flow prediction module has a built-in long short-term memory network model that integrates time-period attention mechanism to predict the water consumption of the target water supply area in the future preset time period, and obtain a predicted flow sequence containing multiple time scales. The benchmark pressure calculation module is used to calculate the minimum water supply pressure value that meets the pressure requirements of end users as the benchmark pressure, based on the predicted flow sequence and the hydraulic characteristic model of the pipeline network constructed based on the pipeline network topology. The reference pressure calculation module includes an online identification unit, which is used to update the parameters of the pipeline hydraulic characteristic model in real time through an online identification algorithm; The dynamic pressure setting module is used to calculate the volatility index of the predicted flow sequence. When the volatility exceeds a preset threshold, the pressure pre-adjustment amount is calculated according to the trend of the predicted flow and superimposed on the benchmark pressure to generate the target pressure setting value. Otherwise, maintain the reference pressure as the target pressure setpoint; The variable frequency control execution module is used to transmit the target pressure setpoint to the variable frequency controller, drive the water pump unit to adjust the operating frequency, and make the actual pressure of the pipeline track the target pressure setpoint.
10. The variable frequency water supply pressure setting system based on flow prediction according to claim 9, characterized in that, Also includes: The prediction error monitoring module is used to collect real-time actual flow data from the pipeline network and calculate the deviation between the current actual flow and the corresponding predicted flow. And calculate the mean absolute percentage error (MAPE) within the sliding window as a prediction error index; The online model calibration module is used when the MAPE exceeds a preset prediction error threshold. For more than the preset number of time periods When the time is right, the online model correction mechanism is triggered: the input layer and LSTM hidden layer parameters of the long short-term memory network model are frozen, and incremental learning is performed only on the attention parameters and output layer parameters of the attention sub-layer of the time period. Gradient descent iteration is performed using the latest M sets of measured data within the sliding window to update the network parameters. The feedback fine-tuning module is used to adjust the settings based on the deviation. The feedback fine-tuning amount is calculated through the PI controller. and will The values are superimposed on the target pressure setpoint to construct a dual closed-loop pressure control architecture of feedforward prediction and feedback correction. The visualization monitoring module is used to display predicted flow, pressure setpoint, actual pressure curve and prediction error information, and provides a manual intervention interface; The safety protection module is used to set pressure upper and lower limit protection, flow change protection and predictive failure protection mechanism. When abnormal operating conditions are detected, it automatically switches to the traditional constant pressure control mode and issues an alarm.