An online scheduling and offline optimization collaborative method for large multi-water plant water supply pipe network
Patent Information
- Application Number
- CN202610746255.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-28
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2046-05-28
AI Technical Summary
然而,微观模型在实际应用中仍存在以下问题:(1)现有方法普遍采用在线迭代求解模式,微观模型求解非线性方程组计算量大,若在线调度时采用遗传算法等全局优化方法,需调用水力模型数百上千次,难以满足实时性要求;(2)传统遗传算法处理压力约束时采用随机变异,收敛速度慢,且易产生大量不可行解,优化效率低下;(3)大量历史调度数据未能有效用于指导当前决策,优化模型在每次调度时独立求解,缺乏利用历史工况数据持续改进的自进化闭环机制
[0053](1)兼顾实时性与最优性:现有在线优化方法计算负荷大、响应慢,而离线方法又无法适应工况变化。本发明将计算量较大的遗传算法与水力模型迭代优化置于离线阶段,在线阶段仅进行轻量计算,形成“离线预计算与在线匹配”闭环架构,可满足大型管网实时调度对响应速度的要求,同时保证调度方案接近全局最优。
Smart Images

Figure CN122264486B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an online scheduling and offline optimization collaborative method for large-scale multi-water plant water supply networks, belonging to the field of smart water management and water supply network optimization scheduling technology. Background Technology
[0002] With the acceleration of urbanization, large-scale urban water supply systems typically involve multiple water plants operating jointly, resulting in complex pipeline structures characterized by nonlinearity, strong constraints, and high time-varying nature. Existing water supply network optimization and scheduling methods are mainly divided into two categories:
[0003] One approach is the scheduling method based on macroscopic models. This type of method uses overall parameters such as pressure at pressure monitoring points and water plant flow as variables, establishing empirical relationships between pump status, water demand, and pressure at the main control point through statistical regression, resulting in high computational efficiency. For example, Chinese patent application CN202310816413.6 discloses a data mining-based intelligent water supply scheduling method, device, and electronic equipment. This method first constructs a macroscopic hydraulic model, adds intraday dummy variables to the independent variables for pressure prediction, and determines the scheduling time based on the predicted parameters; then, it calculates the optimal frequency for variable frequency pumps and the optimal scheduling scheme for controlling fixed frequency pumps. However, macroscopic models treat the pipe network as a "black box," approximating the hydraulic mechanism with empirical relationships between overall parameters. This makes it difficult to accurately reflect the local hydraulic state of the pipe network, resulting in poor adaptability to changes in pipe network topology and water usage patterns, and hindering the support of refined scheduling requirements.
[0004] Second, there are scheduling methods based on microscopic hydraulic models. These methods, by establishing the topology of the pipe network and solving the hydraulic equations, can accurately simulate the pressure and flow distribution at each node of the network and in each pipe segment. Theoretically, this can overcome the shortcomings of macroscopic models, such as low accuracy and poor adaptability. For example, the article "Modeling and Analysis of Optimal Scheduling of Water Supply Networks" published in the journal *Water Supply and Drainage*, Volume 51, Issue 9, 2025, uses the goal of minimizing energy consumption costs and the constraint of satisfying the hydraulic characteristic equations of the water supply network. It employs a genetic algorithm to solve for the optimal pump operation scheme, which falls under the category of microscopic hydraulic models. However, the micro-model still has the following problems in practical applications: (1) Existing methods generally adopt online iterative solution mode. The micro-model has a large amount of computation to solve nonlinear equations. If global optimization methods such as genetic algorithms are used during online scheduling, the hydraulic model needs to be called hundreds or thousands of times, which is difficult to meet the real-time requirements; (2) Traditional genetic algorithms use random mutation when dealing with pressure constraints. The convergence speed is slow and a large number of infeasible solutions are easily generated, resulting in low optimization efficiency; (3) A large amount of historical scheduling data has not been effectively used to guide current decisions. The optimization model is solved independently each time it is scheduled, and there is a lack of a self-evolutionary closed-loop mechanism that uses historical working condition data to continuously improve.
[0005] In summary, macroscopic models lack sufficient accuracy, while microscopic models, although highly accurate, struggle to meet real-time requirements, and neither possesses self-evolutionary capabilities. Therefore, balancing optimization quality with computational real-time performance, and achieving adaptive evolution of the scheduling system, is a pressing technical challenge in this field. Summary of the Invention
[0006] The purpose of this invention is to provide a collaborative online scheduling and offline optimization method for large-scale multi-water plant water supply networks, which balances real-time performance and optimality. The computationally intensive genetic algorithm and hydraulic model iterative optimization are placed in the offline stage, while only lightweight calculations are performed in the online stage, forming a closed-loop architecture of "offline pre-computation and online matching". The system has self-evolution capabilities, improves optimization solution efficiency, and solves the aforementioned technical problems of existing technologies.
[0007] The technical solution of this invention is:
[0008] A collaborative method for online scheduling and offline optimization for large-scale multi-water plant water supply networks, comprising an offline optimization phase and an online scheduling phase;
[0009] Offline optimization phase: A historical operating condition database is constructed. Based on the historical operating condition data in the database, typical operating conditions are obtained through clustering, and the cluster center vector of each typical operating condition is calculated as its feature vector. An improved genetic algorithm coupled with a hydraulic model is executed offline to pre-calculate the optimal scheduling scheme for each typical operating condition.
[0010] Online scheduling phase: Based on real-time data, predict the operating conditions for the next scheduling period, construct the feature vector of the current operating condition, and conduct multi-dimensional similarity evaluation between the feature vector of the current operating condition and the feature vector of the typical operating condition. For highly similar operating conditions, directly call the optimal scheduling scheme, while for low-similar operating conditions, adopt a fast estimation method based on a local linear model. The pre-calculated optimal scheduling scheme corresponding to the typical operating condition closest to the current operating condition is used as the base solution. The sensitivity matrix of the typical operating condition is used for linear extrapolation to obtain candidate scheduling schemes. After verification and fine-tuning by the hydraulic model, the scheduling scheme that meets the constraints is output.
[0011] The final adopted scheduling scheme and its corresponding current operating condition data are used as new samples and asynchronously updated to the historical operating condition database, entering the offline optimization stage again to form a closed-loop mechanism, driving the system to continuously evolve, and the scheduling scheme is continuously optimized as data accumulates.
[0012] The offline optimization phase includes the following steps:
[0013] Step S1: Construct a historical operating condition database, wherein the historical operating condition data includes at least: total water consumption and water consumption in each area;
[0014] Step S2: Based on historical operating data, k typical operating conditions are obtained through K-means clustering. The cluster center vectors of the k typical operating conditions are calculated as the feature vectors of the k typical operating conditions. The optimal scheduling scheme is pre-calculated for each typical operating condition. The optimal scheduling scheme is completed by offline execution of an improved genetic algorithm coupled with hydraulic model for iterative calculation.
[0015] The online scheduling phase includes the following steps:
[0016] Step S3: Based on the collected real-time data, predict the operating condition data for the next scheduling period. The operating condition data includes at least: the predicted total water consumption and the predicted water consumption in each area. Construct a feature vector for the current operating condition and perform a multi-dimensional similarity evaluation between the feature vector of the current operating condition and the feature vectors of k typical operating conditions.
[0017] Step S4: If the overall similarity between the current working condition and a typical working condition is greater than or equal to the threshold β, then the optimal scheduling scheme corresponding to the typical working condition is used as the scheduling scheme for the current working condition. The threshold β ranges from 0.7 to 0.9. If β is too low (e.g., less than 0.7), the current working condition with low similarity will be incorrectly matched to the existing typical working condition, reducing scheduling accuracy. If β is too high (e.g., greater than 0.9), a large number of current working conditions cannot be matched, leading to excessive reliance on the local linear extrapolation in step S5 and increasing the online computational burden. Controlling the threshold β within the range of 0.7-0.9 achieves a reasonable balance between matching accuracy and computational efficiency.
[0018] Step S5: If the overall similarity between the current operating condition and all typical operating conditions is less than the threshold β, a fast estimation method based on a local linear model is adopted. The pre-calculated optimal scheduling scheme corresponding to the typical operating condition closest to the current operating condition is used as the base solution. The sensitivity matrix of the typical operating condition is used for linear extrapolation to obtain candidate scheduling schemes. After one verification by the hydraulic model, only the pressure of the water plant that violates the constraints is finely adjusted step by step until all constraints are met or the preset number of iterations is reached. The cumulative number of calls does not exceed the preset maximum number of iterations N, where N ranges from 3 to 5. If a scheduling scheme that meets the constraints is obtained within N iterations, the scheduling scheme is output. If there are still constraints that violate the constraints after the maximum number of iterations is reached, a safety fallback strategy is implemented: the pressure of each water plant is set to the upper limit of the safe operating pressure under historical operating conditions to ensure the safe operation of the pipeline network.
[0019] Step S6: The final adopted scheduling scheme and its corresponding operating condition data are used as new samples and asynchronously updated to the historical operating condition database, thus re-entering the offline optimization stage and forming a closed-loop mechanism. Through this closed-loop mechanism, offline pre-calculation and online scheduling evolve together, and the historical operating condition database and its added typical operating conditions are continuously optimized and refined as the system runs.
[0020] After the system is put into operation, the operations in the offline phase described above continue to evolve: when the number of new samples in the historical working condition database exceeds the preset threshold T, the K-means clustering and pre-calculation in step S2 are re-executed during system idle periods. This adaptively increases the number of typical working conditions k and refines the granularity of the working condition space division corresponding to each typical working condition. As the system's running time increases, the online matching success rate of the feature vectors of the current working condition and the feature vectors of typical working conditions, as well as the generation speed of the corresponding optimal scheduling scheme, continuously improve, achieving an evolutionary effect that becomes faster and more accurate with use. The preset threshold T ranges from 5 to 30. Its setting is based on the following: if T < 5, triggering is too frequent, system idle resources are over-occupied, and the re-clustering effect is poor when the number of new samples is insufficient; if T > 30, the response is sluggish and it is impossible to track changes in working conditions in a timely manner. Controlling the preset threshold T between 5 and 30 achieves a balance between evolutionary efficiency and response speed.
[0021] Furthermore, the improved genetic algorithm coupled with the hydraulic model in step S2 includes the following steps: after the genetic algorithm generates individuals, it calls the hydraulic model to perform hydraulic simulation of the pipeline network and obtains the pressure distribution of each monitoring point. The individuals are vectors composed of the set pressure values of each water plant's outlet. If there is a situation where the pressure of a certain monitoring point is lower than the minimum service pressure or higher than the maximum allowable pressure, it calculates an adjustment strategy based on the pressure response sensitivity matrix obtained in advance through hydraulic model perturbation analysis, guiding the individual to adjust in a direction that satisfies all pressure constraints. The above process is repeated until the convergence condition is met, and the optimal scheduling scheme is output.
[0022] The overall goal of this step is to accelerate the convergence speed of the algorithm and shorten the offline pre-computation time. To achieve the above goal, the improved genetic algorithm has been accelerated and optimized in the following four aspects, as follows:
[0023] S21: Hybrid Strategy Population Initialization
[0024] In the initialization phase of the genetic algorithm, an initial population is generated by a proportional mixing strategy of three types of individuals: high-quality solutions, diverse solutions, and random solutions. The proportions range from 20% to 60% for high-quality solutions, 20% to 40% for diverse solutions, and 20% to 40% for random solutions, with the sum of the three being 100%. High-quality solutions are selected from historical best scheduling schemes. Diverse solutions are generated using Latin hypercube sampling, covering the entire decision space. Random solutions are uniformly and randomly generated within the feasible region.
[0025] S22: Adaptive mutation probability
[0026] The probability of variation is dynamically adjusted based on the number of points in the individual network that exceed hydraulic constraints:
[0027]
[0028] in: Let be the mutation probability of individual a. Let a be the number of points where individual a violates hydraulic constraints. The maximum number of violations in the current population. Based on the probability of mutation, The maximum mutation probability;
[0029] S23: Oriented adjustment mechanism based on hydraulic model results
[0030] By utilizing constraint violation information output from the hydraulic model and combining it with the offline pre-calculated pressure response sensitivity matrix, the adjustment direction and step size of the pressure for each water plant are directly calculated, enabling infeasible offspring individuals to quickly move closer to the feasible domain. For monitoring points with excessively low pressure, the pressure of the water plant most sensitive to it is increased; for monitoring points with excessively high pressure, the pressure of the water plant most sensitive to it is decreased. The adjustment magnitude is proportional to the degree of violation and the magnitude of the pressure response sensitivity.
[0031] Pressure adjustment amount for each water plant The calculation formula is:
[0032]
[0033] Where V is the set of monitoring points that violate the constraints; To determine the degree of violation at monitoring point y, when the pressure at monitoring point y is too low, , This represents the minimum allowable pressure at monitoring point y. The pressure value at monitoring point y is calculated using a hydraulic model; when the pressure at monitoring point y is too high, , This indicates the maximum allowable pressure at monitoring point y; Let be the pressure response sensitivity coefficient of water plant i to monitoring point y, representing the pressure change at monitoring point y per unit pressure change in water plant i. Pre-calculation is performed by applying a unit disturbance to the pressure of the i-th water plant. The hydraulic model is used to calculate the pressure change at each monitoring point y. ,but ; The step size coefficient is used to control the overall adjustment range; the numerator of this formula... The denominator determines the direction and magnitude of the adjustment. It serves a normalization function, avoiding imbalances in adjustment calculations due to differences in the magnitude of pressure response sensitivity values among various water plants;
[0034] S24: Hydraulic Model Caching Mechanism
[0035] Each water plant uses a specific set of pressure values as a unique identifier to cache the corresponding monitoring point pressure, water plant flow rate, and actual water plant pressure results, thus avoiding repeated calls to the hydraulic model for the same individual.
[0036] Furthermore, the optimization objective of the improved genetic algorithm in step S2 is to minimize the energy consumption cost of pipeline network operation. The objective function expression for minimizing the energy consumption cost of pipeline network operation is as follows:
[0037]
[0038] Where m represents the number of water plants; This indicates the water supply volume of water plant i; This represents the unit water production cost of water plant i; α represents the water supply pressure of water plant i; e represents the electricity cost; α represents the conversion factor, which converts the product of pressure and flow rate into an approximate value of electricity consumption.
[0039] The decision variable is the outlet pressure vector of each water plant. An individual in the genetic algorithm corresponds to a complete set of decision variable values, representing a feasible outlet pressure scheduling scheme. The genetic algorithm optimizes this decision variable to search for the optimal outlet pressure setpoint that minimizes the objective function, while satisfying the following constraints.
[0040] The constraints specifically include:
[0041] (1) Water supply capacity constraints: The total daily water supply of each water plant should be between the minimum and maximum daily water supply of each plant. ,in, This represents the daily water supply of the i-th water plant. This represents the minimum daily water supply of the i-th water plant. This represents the maximum daily water supply of the i-th water plant.
[0042] (2) Water supply pressure constraint: The pressure at the outlet of each water plant should be between the minimum and maximum pressure at the outlet of each water plant. ,in, This represents the outlet pressure of the i-th water plant. This represents the minimum pressure at the outlet of the i-th water plant. This represents the maximum pressure at the outlet of the i-th water plant.
[0043] (3) Pressure constraints at monitoring points: The calculated pressure at each monitoring point in the pipeline network should be between the minimum and maximum pressure at each monitoring point, as expressed below: ,in, This represents the pressure at the y-th monitoring point calculated using the hydraulic model. This represents the minimum pressure at the y-th monitoring point. This represents the maximum pressure at the y-th monitoring point.
[0044] (4) Satisfies hydraulic balance constraints:
[0045] Node flow balancing: The total flow into any node in the pipeline network is equal to the total flow out of that node;
[0046] Loop energy balance: The pressure distribution of all nodes in the pipeline network must satisfy the basic equations of the hydraulic model, that is, along any water supply path from the water plant to the node, the difference between the outlet pressure of the water plant and the pressure of the node is equal to the algebraic sum of the head losses of each pipe segment along the path; for pipeline areas with closed loops, it is also necessary to satisfy that the algebraic sum of the head losses on any closed loop is zero.
[0047] Furthermore, the multi-dimensional similarity assessment in step S3 includes total water consumption similarity and regional water distribution similarity, and the comprehensive similarity is the weighted sum of the two; the total water consumption similarity is calculated using relative error, and the regional water distribution similarity is calculated using cosine similarity.
[0048] Furthermore, in step S5, the candidate scheduling scheme is obtained by linear extrapolation using the sensitivity matrix of this typical operating condition. The linear extrapolation formula is as follows:
[0049]
[0050] in, This represents the pressure vector of each water plant in the initial scheduling scheme. The pre-calculated optimal pressure vector corresponds to the typical working condition closest to the current working condition; This is the feature vector for the current operating conditions, including the predicted total water consumption and the predicted water consumption for each region; Let J be the eigenvector of this typical operating condition; J is the sensitivity matrix of this typical operating condition, whose elements... The sensitivity matrix of the typical operating condition is obtained by offline perturbation calculation when the characteristic of the qth operating condition changes by one unit. Specifically, it is obtained by applying a unit perturbation to each characteristic of the operating condition at the cluster center of the typical operating condition, calling the hydraulic model to calculate the corresponding change in pressure of each water plant, and then the elements of the sensitivity matrix of the typical operating condition are equal to the change in water plant pressure. By traversing all operating condition characteristics, the sensitivity matrix J of the typical operating condition is obtained.
[0051] Furthermore, the asynchronous update in step S6 refers to: adding the current working condition and its corresponding scheduling scheme does not immediately trigger full-database re-clustering, but is stored in a buffer; when the number of newly added samples in the buffer reaches a preset threshold T, the preset threshold T ranges from 5 to 30, triggering clustering update.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] (1) Balancing real-time performance and optimality: Existing online optimization methods have high computational load and slow response, while offline methods cannot adapt to changes in operating conditions. This invention places the computationally intensive genetic algorithm and hydraulic model iterative optimization in the offline stage, while only performing lightweight calculations in the online stage, forming a closed-loop architecture of "offline pre-calculation and online matching". This can meet the response speed requirements of real-time scheduling of large-scale pipeline networks, while ensuring that the scheduling scheme is close to the global optimum.
[0054] (2) Improved optimization efficiency: To address the problems of slow convergence speed and easy generation of infeasible solutions in traditional genetic algorithms, this invention introduces hybrid strategy initialization, adaptive mutation probability, directional mutation based on pressure response sensitivity, and hydraulic model caching mechanism, which significantly reduces the number of invalid calls to the hydraulic model and improves search efficiency. On this basis, this invention can support the requirements of scheduling scheme generation speed in fine-grained management scenarios such as hourly-level regulation.
[0055] (3) The system has self-evolution capability: The traditional offline system has a fixed operating condition database, which cannot adapt to long-term changes in water use patterns. This invention introduces an asynchronous update mechanism, which enables the system to continuously accumulate new operating conditions and refine the operating condition classification. The online matching success rate automatically increases with running time, achieving a self-evolution effect that becomes more accurate and faster with use. Attached Figure Description
[0056] Figure 1 This is a flowchart of the algorithm in an embodiment of the present invention. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0058] A collaborative method for online scheduling and offline optimization for large-scale multi-water plant water supply networks, comprising an offline optimization phase and an online scheduling phase;
[0059] Offline optimization phase: Construct a historical operating condition database, obtain typical operating conditions through clustering based on historical operating condition data in the database, and calculate the cluster center vector of each typical operating condition as the feature vector of the typical operating condition; pre-calculate the optimal scheduling scheme for each typical operating condition by coupling an improved genetic algorithm with the hydraulic model offline.
[0060] Online scheduling phase: Based on real-time data, predict the operating conditions for the next scheduling period, construct the feature vector of the current operating condition, and conduct multi-dimensional similarity evaluation between the feature vector of the current operating condition and the feature vector of the typical operating condition. For highly similar operating conditions, directly call the optimal scheduling scheme, and for low similar operating conditions, adopt a fast estimation method based on a local linear model. The pre-calculated optimal scheduling scheme corresponding to the typical operating condition closest to the current operating condition is used as the base solution. The sensitivity matrix of the typical operating condition is used to perform linear extrapolation to obtain candidate scheduling schemes. After verification and fine-tuning by the hydraulic model, the scheduling scheme that meets the constraints is output.
[0061] The final adopted scheduling scheme and its corresponding current operating condition data are used as new samples and asynchronously updated to the historical operating condition database, entering the offline optimization stage again, forming a closed-loop mechanism to drive the system's continuous evolution. The scheduling scheme is continuously optimized as data accumulates. This invention places time-consuming coupled iterative calculations offline, requiring only lightweight calculations online, balancing global optimization and real-time response, and enabling continuous self-evolution.
[0062] like Figure 1 As shown in the figure, an online scheduling and offline optimization collaborative method for large-scale multi-water plant water supply networks in this embodiment includes the following steps:
[0063] Taking a large water supply network in a city, comprising three water plants and four areas, as an example, the designed water supply capacities of water plants A, B, and C are 300,000 tons / day, 250,000 tons / day, and 200,000 tons / day, respectively, with outlet pressure ranges of 0.35MPa-0.55MPa, 0.30MPa-0.50MPa, and 0.32MPa-0.52MPa, respectively. Fifteen monitoring points are set up in the network, with an allowable pressure range of 0.25MPa-0.45MPa.
[0064] Offline optimization phase:
[0065] Step S1: Construct a historical operating condition database, collect historical operating condition data of the water supply area over the past year, including total water consumption and water consumption of each zone, and clean this historical operating condition data.
[0066] Step S2: Cluster the cleaned historical operating data using K-means clustering, constructing feature vectors based on total water consumption and water consumption in each sub-region, ultimately determining the number of typical operating conditions k=20. For each typical operating condition, an improved genetic algorithm coupled with a hydraulic model is used for iterative pre-calculation of the optimal scheduling scheme.
[0067] In this embodiment, the optimization objective of the improved genetic algorithm is to minimize the energy consumption cost of pipeline network operation, and the objective function expression is as follows:
[0068]
[0069] Where m represents the number of water plants; This indicates the water supply volume of water plant i; This represents the unit water production cost of water plant i (including basic operating costs such as chemical costs and labor costs). e represents the water supply pressure of water plant i; e represents the electricity cost. This represents the conversion factor.
[0070] The constraints are as follows:
[0071] Water supply capacity constraints: Plant A: 150,000-300,000 tons / day; Plant B: 150,000-250,000 tons / day; Plant C: 100,000-200,000 tons / day.
[0072] Water supply pressure constraints: Plant A 0.35-0.55MPa, Plant B 0.30-0.50MPa, Plant C 0.32-0.52MPa;
[0073] Monitoring point constraints: The pressure at each monitoring point is between 0.25 and 0.45 MPa;
[0074] Hydraulic balance constraints: nodal flow balance and loop energy balance.
[0075] Node flow balancing: The total flow into any node in the pipeline network is equal to the total flow out of that node.
[0076] Loop energy balance: The pressure distribution of all nodes in the pipeline network must satisfy the basic equations of the hydraulic model, that is, along any water supply path from the water plant to the node, the difference between the outlet pressure of the water plant and the pressure of the node is equal to the algebraic sum of the head losses of each pipe segment along the path; for pipeline areas with closed loops, it is also necessary to satisfy that the algebraic sum of the head losses on any closed loop is zero.
[0077] The specific execution flow of the improved genetic algorithm is as follows:
[0078] (1) Population initialization: A mixed strategy is used to generate the initial population: 30% high-quality solutions, 40% diverse solutions, and 30% random solutions. In addition, the proportions of the three types of individuals can be adjusted according to actual needs. For example, when there are few initial feasible solutions, a lower proportion of high-quality solutions can be used: 20% high-quality solutions, 40% diverse solutions, and 40% random solutions, to enhance population diversity; when there are many initial feasible solutions, a higher proportion of high-quality solutions can be used: 60% high-quality solutions, 20% diverse solutions, and 20% random solutions, to make better use of historical high-quality information.
[0079] (2) Hydraulic model verification and fitness assessment: For each individual, the hydraulic model is called to perform hydraulic simulation calculation of the pipeline network to obtain the pressure distribution of each monitoring point. The individual is a vector composed of the setpoints of the outlet pressure of each water plant. If there is no constraint violation, the energy consumption cost is calculated as the fitness value; if there is a violation, the set of monitoring points that violate the constraint and the degree of violation are recorded, and the fitness of the individual is penalized.
[0080] (3) Selection and crossover: Using a tournament selection strategy, crossover operations are performed on the individuals selected in step (2).
[0081] (4) Mutation Operation: The mutation probability is dynamically adjusted based on the number of monitoring points that violate the constraints for an individual. As follows:
[0082]
[0083] in: Let be the mutation probability of individual a. Let a be the number of points where individual a violates hydraulic constraints. The maximum number of violations in the current population. Based on the probability of mutation, This represents the maximum mutation probability.
[0084] If an individual violates the constraints, the set of monitoring points for constraint violations recorded in step (2), combined with the pre-calculated pressure response sensitivity matrix, is used to calculate the pressure adjustment for each water plant using the following formula, generating offspring after directional mutation:
[0085]
[0086] Where V is the set of monitoring points that violate the constraints. To determine the degree of violation at monitoring point y, when the pressure at monitoring point y is too low, , This represents the minimum allowable pressure at monitoring point y. The pressure value at monitoring point y is calculated using a hydraulic model; when the pressure at monitoring point y is too high, , This indicates the maximum allowable pressure at monitoring point y; Let be the pressure response sensitivity coefficient of water plant i to monitoring point y. This is the step size coefficient, used to control the overall adjustment range.
[0087] (5) Caching mechanism: Use a set of specific values of the pressure of each water plant as a unique identifier to cache the output results of the hydraulic model and avoid repeated calls to the same individual.
[0088] (6) Iterative evolution: Repeat steps (2)-(5) until the preset maximum number of iterations is reached. In this case, the maximum number of iterations is set to 50, and the optimal scheduling scheme corresponding to each typical working condition is finally obtained.
[0089] Online scheduling phase:
[0090] Step S3: Based on the collected real-time data, the XGBoost algorithm is used to predict the total water consumption and the water consumption in each area, and a feature vector of the current operating condition is constructed. The feature vector of the current working condition is compared with the feature vector of the typical working condition in a multi-dimensional similarity evaluation: the similarity of total water consumption is calculated using relative error, the similarity of regional water distribution is calculated using cosine similarity, and the comprehensive similarity is the weighted sum of the two. In this embodiment, the weights are 0.5 and 0.5 respectively.
[0091] Step S4: High similarity matching:
[0092] If the overall similarity between the current working condition and a typical working condition is greater than or equal to a set threshold β, then the optimal scheduling scheme corresponding to that typical working condition is used as the scheduling scheme for the current working condition. The threshold β ranges from 0.7 to 0.9. If β is too low (e.g., less than 0.7), working conditions with low similarity will be incorrectly matched to existing typical working conditions, reducing scheduling accuracy. If β is too high (e.g., greater than 0.9), a large number of working conditions cannot be matched, leading to excessive reliance on the local linear extrapolation in step S5 and increasing the online computational burden. Controlling β within the range of 0.7 to 0.9 achieves a reasonable balance between matching accuracy and computational efficiency. In this embodiment, β = 0.85 is used.
[0093] Step S5: If the overall similarity between the current operating condition and all typical operating conditions is less than the set threshold β, then a fast estimation method based on a local linear model is adopted. The pre-calculated optimal scheduling scheme corresponding to the typical operating condition closest to the current operating condition is used as the base solution. The sensitivity matrix of this typical operating condition is then used for linear extrapolation to obtain candidate scheduling schemes. The linear extrapolation formula is:
[0094]
[0095] in, This represents the pressure vector of each water plant in the candidate scheduling scheme; The pre-calculated optimal pressure vector corresponds to the typical working condition closest to the current working condition; This is the feature vector for the current operating conditions, including the predicted total water consumption and the predicted water consumption for each region; is the eigenvector of this typical working condition; J is the sensitivity matrix of this typical working condition.
[0096] The candidate scheduling schemes obtained by linear extrapolation are input into the hydraulic model for verification. If a constraint violation exists, the pressure of the water plant violating the constraint is finely adjusted step by step, and the cumulative number of calls to the hydraulic model does not exceed the preset maximum number of iterations N (N=5 in this embodiment). If a scheduling scheme that satisfies the constraints is obtained within N iterations, the scheduling scheme is output; if a constraint violation still exists after reaching the maximum number of iterations, a safety fallback strategy is implemented: the pressure of each water plant is set to the upper limit of the safe operating pressure under historical operating conditions to ensure the safe operation of the pipeline network.
[0097] Step S6: The final adopted scheduling scheme and its corresponding operating condition data are used as new samples and asynchronously updated to the historical operating condition database. The new operating conditions and the final adopted scheduling scheme are first stored in a buffer. When the number of samples in the buffer reaches a preset threshold T (e.g., 10), clustering update is triggered to achieve closed-loop evolution of the system.
[0098] This invention focuses on integrating hydraulic models and intelligent optimization technologies into a smart water management platform, promoting the transformation of traditional water supply management from passive response to proactive prevention, and from experience-driven to data-driven approaches. The core of this invention lies in constructing a scheduling system for large-scale, multi-plant water supply networks. By mining historical operational data patterns and combining advanced optimization algorithms with hydraulic simulation models, it achieves intelligent generation and dynamic optimization of water supply scheduling schemes, effectively improving the operational efficiency and emergency response capabilities of large-scale water supply systems, and providing intelligent support for urban water supply security and energy conservation.
[0099] In the offline optimization phase, this invention obtains typical operating conditions through clustering and pre-calculates the optimal scheduling scheme using an improved genetic algorithm coupled with a hydraulic model. The genetic algorithm incorporates hybrid strategy initialization, adaptive mutation probability, directional mutation based on pressure response sensitivity, and a hydraulic model caching mechanism to accelerate convergence and ensure feasibility. In the online scheduling phase, multi-dimensional similarity evaluation directly calls the optimal scheduling scheme for highly similar operating conditions, while for low-similarity operating conditions, candidate scheduling schemes are quickly generated through linear extrapolation based on the sensitivity matrix of typical operating conditions and output after verification by the hydraulic model. New operating condition data is asynchronously updated to the historical database, driving continuous system evolution and enabling the scheduling scheme to be continuously optimized with data accumulation. This invention places time-consuming iterative calculations offline, requiring only lightweight calculations online, balancing global optimization and real-time response, and achieving continuous self-evolution.
[0100] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A collaborative method for online scheduling and offline optimization of large-scale multi-water plant water supply networks, characterized in that: It includes an offline optimization phase and an online scheduling phase; Offline optimization phase: Construct a historical operating condition database, obtain typical operating conditions through clustering based on historical operating condition data in the database, and calculate the cluster center vector of each typical operating condition as the feature vector of the typical operating condition; pre-calculate the optimal scheduling scheme for each typical operating condition by coupling an improved genetic algorithm with the hydraulic model offline. The specific steps are as follows: Step S1: Construct a historical operating condition database, wherein the historical operating condition data includes at least: total water consumption and water consumption in each area; Step S2: Based on historical operating data, k typical operating conditions are obtained through K-means clustering. The cluster center vectors of the k typical operating conditions are calculated as the feature vectors of the k typical operating conditions. The optimal scheduling scheme is pre-calculated for each typical operating condition. The optimal scheduling scheme is completed by offline execution of an improved genetic algorithm coupled with hydraulic model for iterative calculation. Online scheduling phase: Based on real-time data, predict the operating conditions for the next scheduling period, construct the feature vector of the current operating condition, and conduct multi-dimensional similarity evaluation between the feature vector of the current operating condition and the feature vector of the typical operating condition. For highly similar operating conditions, directly call the optimal scheduling scheme, and for low similar operating conditions, adopt a fast estimation method based on a local linear model. The pre-calculated optimal scheduling scheme corresponding to the typical operating condition closest to the current operating condition is used as the base solution. The sensitivity matrix of the typical operating condition is used to perform linear extrapolation to obtain candidate scheduling schemes. After verification and fine-tuning by the hydraulic model, the scheduling scheme that meets the constraints is output. The specific steps are as follows: Step S3: Based on the collected real-time data, predict the operating conditions data for the next scheduling period, and construct the feature vector of the current operating conditions. The operating conditions data for the next scheduling period shall include at least: the predicted total water consumption and the predicted water consumption of each region; perform a multi-dimensional similarity evaluation between the feature vector of the current operating conditions and the feature vectors of k typical operating conditions. Step S4: If the overall similarity between the current working condition and a typical working condition is greater than or equal to the threshold β, then the optimal scheduling scheme corresponding to the typical working condition is taken as the scheduling scheme for the current working condition. The threshold β ranges from 0.7 to 0.
9. Step S5: If the overall similarity between the current operating condition and all typical operating conditions is less than the threshold β, a fast estimation method based on a local linear model is adopted. The pre-calculated optimal scheduling scheme corresponding to the typical operating condition closest to the current operating condition is used as the base solution. The sensitivity matrix of the typical operating condition is used for linear extrapolation to obtain candidate scheduling schemes. After one verification by the hydraulic model, only the pressure of the water plant that violates the constraints is finely adjusted step by step until all constraints are met or the preset number of iterations is reached. The cumulative number of calls does not exceed the preset maximum number of iterations N, where N ranges from 3 to 5. If a scheduling scheme that meets the constraints is obtained within N iterations, the scheduling scheme is output. If there are still constraints that violate the constraints after the maximum number of iterations is reached, a safety fallback strategy is implemented: the pressure of each water plant is set to the upper limit of the safe operating pressure under historical operating conditions to ensure the safe operation of the pipeline network. Step S6: The final adopted scheduling scheme and its corresponding operating condition data are used as new samples and asynchronously updated to the historical operating condition database, and then the offline optimization stage is entered again to form a closed-loop mechanism. The asynchronous update refers to the following: adding the current working condition and its corresponding scheduling scheme does not immediately trigger full-database re-clustering, but is stored in a buffer; when the number of new samples added to the buffer reaches a preset threshold T, the preset threshold T ranges from 5 to 30, clustering update is triggered.
2. The online scheduling and offline optimization collaborative method for large-scale multi-water plant water supply networks according to claim 1, characterized in that... The improved genetic algorithm in step S2, coupled with the hydraulic model, has been accelerated and optimized in the following four aspects, as follows: S21: Hybrid Strategy Population Initialization In the initialization phase of the genetic algorithm, an initial population is generated by a proportional mixing strategy of three types of individuals: high-quality solutions, diverse solutions, and random solutions. The proportions range from 20% to 60% for high-quality solutions, 20% to 40% for diverse solutions, and 20% to 40% for random solutions, with the sum of the three being 100%. High-quality solutions are selected from historical best scheduling schemes. Diverse solutions are generated using Latin hypercube sampling, covering the entire decision space. Random solutions are uniformly and randomly generated within the feasible region. S22: Adaptive mutation probability The probability of variation is dynamically adjusted based on the number of points in the individual network that exceed hydraulic constraints: ; in: Let be the mutation probability of individual a. Let a be the number of points where individual a violates hydraulic constraints. The maximum number of violations in the current population. Based on the probability of mutation, The maximum mutation probability; S23: Oriented adjustment mechanism based on hydraulic model results Using constraint violation information output from the hydraulic model, combined with the offline pre-calculated pressure response sensitivity matrix, the adjustment direction and step size of the pressure for each water plant are directly calculated, enabling infeasible offspring to quickly move closer to the feasible region. For monitoring points with excessively low pressure, the pressure of the most sensitive water plant is increased; for monitoring points with excessively high pressure, the pressure of the most sensitive water plant is decreased. The adjustment magnitude is proportional to the degree of violation and the magnitude of the pressure response sensitivity. The pressure adjustment amount for each water plant i is... The calculation formula is: ; Where V is the set of monitoring points that violate the constraints; To determine the degree of violation at monitoring point y, when the pressure at monitoring point y is too low, , This represents the minimum allowable pressure at monitoring point y. The pressure value at monitoring point y is calculated using a hydraulic model; when the pressure at monitoring point y is too high, , This indicates the maximum allowable pressure at monitoring point y; Let be the pressure response sensitivity coefficient of water plant i to monitoring point y, representing the pressure change at monitoring point y per unit pressure change in water plant i. Pre-calculation is performed by applying a unit disturbance to the pressure of the i-th water plant. The hydraulic model is used to calculate the pressure change at each monitoring point y. ,but ; The step size coefficient is used to control the overall adjustment range; the numerator of this formula... The denominator determines the direction and magnitude of the adjustment. It serves a normalization function, avoiding imbalances in adjustment calculations due to differences in the magnitude of pressure response sensitivity values among various water plants; S24: Hydraulic Model Caching Mechanism Each water plant uses a specific set of pressure values as a unique identifier to cache the corresponding monitoring point pressure, water plant flow rate, and actual water plant pressure results.
3. The online scheduling and offline optimization collaborative method for large-scale multi-water plant water supply networks according to claim 2, characterized in that... The optimization objective of the improved genetic algorithm in step S2 is to minimize the energy consumption cost of pipeline network operation. The objective function expression for minimizing the energy consumption cost of pipeline network operation is as follows: ; Where m represents the number of water plants; This indicates the water supply volume of water plant i; This represents the unit water production cost of water plant i; α represents the water supply pressure of water plant i; e represents the electricity cost; α represents the conversion factor, which converts the product of pressure and flow rate into an approximate value of electricity consumption.
4. The online scheduling and offline optimization collaborative method for large-scale multi-water plant water supply networks according to claim 2, characterized in that: The constraints specifically include: (1) Water supply capacity constraints: The total daily water supply of each water plant should be between the minimum and maximum daily water supply of each plant. ,in, This represents the daily water supply of the i-th water plant. This represents the minimum daily water supply of the i-th water plant. This represents the maximum daily water supply of the i-th water plant; (2) Water supply pressure constraint: The pressure at the outlet of each water plant should be between the minimum and maximum pressure at the outlet of each water plant. ,in, This represents the outlet pressure of the i-th water plant. This represents the minimum pressure at the outlet of the i-th water plant. This represents the maximum pressure at the outlet of the i-th water plant; (3) Pressure constraints at monitoring points: The calculated pressure at each monitoring point in the pipeline network should be between the minimum and maximum pressure at each monitoring point, as expressed below: ,in, This represents the pressure at the y-th monitoring point calculated using the hydraulic model. This represents the minimum pressure at the y-th monitoring point. This represents the maximum pressure at the y-th monitoring point; (4) Satisfies hydraulic balance constraints: Node flow balancing: The total flow into any node in the pipeline network is equal to the total flow out of that node; Loop energy balance: The pressure distribution of all nodes in the pipeline network must satisfy the basic equations of the hydraulic model, that is, along any water supply path from the water plant to the node, the difference between the outlet pressure of the water plant and the pressure of the node is equal to the algebraic sum of the head losses of each pipe segment along the path; for pipeline areas with closed loops, it is also necessary to satisfy that the algebraic sum of the head losses on any closed loop is zero.
5. A collaborative method for online scheduling and offline optimization of a large-scale multi-water plant water supply network according to claim 2 or 3, characterized in that: The multi-dimensional similarity assessment in step S3 includes total water consumption similarity and regional water distribution similarity, and the comprehensive similarity is the weighted sum of the two; the total water consumption similarity is calculated using relative error, and the regional water distribution similarity is calculated using cosine similarity.
6. A collaborative method for online scheduling and offline optimization of a large-scale multi-water plant water supply network according to claim 2 or 3, characterized in that... In step S5, the candidate scheduling scheme is obtained by linear extrapolation using the sensitivity matrix of the typical operating condition, wherein the linear extrapolation formula is: ; in, This represents the pressure vector of each water plant in the candidate scheduling scheme; The pre-calculated optimal pressure vector corresponds to the typical working condition closest to the current working condition; This is the feature vector for the current operating conditions, including the predicted total water consumption and the predicted water consumption for each region; Let J be the feature vector of the typical working condition; J is the sensitivity matrix of the typical working condition, which is obtained by offline perturbation calculation. Specifically, a unit perturbation is applied to each working condition feature at the cluster center of the typical working condition, and the hydraulic model is called to calculate the corresponding pressure change of each water plant. Then the elements of the sensitivity matrix of the typical working condition are equal to the pressure change of the water plant. By traversing all working condition features, the sensitivity matrix J of the typical working condition is obtained.
Citation Information
Patent Citations
A method, device and electronic equipment for intelligent water supply scheduling based on data mining
CN116542495B
Self-adaptive scheduling method based on hydraulic model and AI algorithm and related device
CN119539447A
Heat supply system optimization scheduling control method based on operation benchmark library and working condition matching
CN121329031A