A method and system for global water supply scheduling

By constructing the static topology and dynamic timing data of the water supply pipeline network, using the cross attention mechanism and near-end strategy optimization method, the problem of global collaborative optimization in the whole-region water supply scheduling is solved, and the stability and safety of the water supply system optimization and scheduling strategy from a global perspective is realized.

CN120317634BActive Publication Date: 2025-08-29SHANDONG KEYUAN WATER SUPPLY & DRAINAGE EQUIP ENG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510786683.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-08-29
Estimated Expiration
2045-06-13

AI Technical Summary

Technical Problem

The existing water supply scheduling methods are difficult to achieve global collaborative optimization of complex pipelines across the region, and the manual scheduling capabilities are limited. Automatic scheduling lacks modeling of global topological relationships and inter-partition hydraulic coupling effects, which makes it difficult for scheduling strategies to adapt to complex scenarios.

Method used

By obtaining the static topological data and dynamic timing data of the water supply network, building training samples and dividing scheduling partitions, using the cross attention mechanism and near-end strategy optimization method, combining weight coefficients and topological relationships for feature fusion and weighting calculations, output scheduling control instructions, and dynamically adjusting the cropping range of policy updates to enhance the security and stability of the model.

Benefits of technology

It realizes measuring the impact of the pipeline system from a global perspective, enhances the security and stability of the scheduling strategy in the real world, maintains a high consistency between the simulation environment and the actual pipeline network, and improves the optimization effect of water supply scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120317634B_ABST
    Figure CN120317634B_ABST
Patent Text Reader

Abstract

The present invention provides a global water supply scheduling method and system, which obtain static topology data and dynamic time series data of the global water supply network and construct training samples; set a weight coefficient for each scheduling partition; perform feature extraction on the dynamic time series data to obtain a hidden state vector; perform feature fusion based on the correlation weight between the hidden state vector and the static topology to obtain the state characteristics of the current state of the network; when calculating the advantage estimation function, use the weight coefficient and the topological relationship between the scheduling partitions to perform weighted calculation on the states in different scheduling partitions to obtain the weighted advantage estimate of the partition; when updating the policy network of the proximal policy optimization method, calculate the expected scheduling cost corresponding to the scheduling action, and adjust the clipping range of the probability ratio used in the policy update according to the deviation rate between the actual cost and the expected cost of the previous N schedulings; input the static topology data and the dynamic time series data obtained in real time into the trained model to obtain the scheduling control instruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of water supply scheduling, and in particular to a global water supply scheduling method and system. Background Art

[0002] With the acceleration of urbanization and the continuous expansion of population, the scale and complexity of urban water supply systems are increasing. Modern urban water supply networks typically cover a wide area, have numerous nodes, and are complex in structure. They include trunk pipelines, branch pipelines, pumps, valves, and other equipment, and address diverse water demand types, such as residential, industrial, and public services. Water supply scheduling has also become increasingly complex. Water supply scheduling aims to optimize the economic and safety of the entire system while meeting user service requirements for water quantity, pressure, and quality. Traditionally, water supply scheduling relied primarily on the judgment of dispatchers. Dispatchers manually adjusted control devices such as pump station start-up and shutdown and valve opening based on historical data and real-time monitoring information. This manual approach was feasible for supplying water to a small area, but when it comes to regional water supply scheduling, manual processing capabilities are limited, making comprehensive analysis impossible. Without a precise understanding of the overall network status, it is easy to optimize some areas while others fail to meet requirements, making it difficult to achieve global coordinated optimization. Current automated scheduling is primarily based on control theory and often focuses solely on a single zone or local area. It lacks modeling of global topological relationships and the hydraulic coupling effects between zones, making scheduling strategies difficult to adapt to complex global scenarios. However, the water supply network is a highly interconnected entity, and any local scheduling operation can significantly impact other areas through hydraulic conduction. Existing approaches struggle to address complex topological dependencies and the interactions between zones. Summary of the Invention

[0003] To address the problem of inaccurate overall understanding in current water supply scheduling, this application proposes a global water supply scheduling method, including:

[0004] Obtain static topological data and dynamic time series data of the global water supply network and construct training samples; divide the network into multiple scheduling zones according to function or geographical location, and set a weight coefficient for each scheduling zone;

[0005] Feature extraction is performed on the dynamic time series data to obtain a hidden state vector; the correlation weight between the hidden state vector and the static topology is calculated through a cross-attention mechanism, and feature fusion is performed based on the correlation weight to obtain the state characteristics of the current state of the pipeline network; a proximal policy optimization method is used to output a scheduling action based on the state characteristics, and when calculating the advantage estimation function, the weight coefficient and the topological relationship between the scheduling partitions are used to perform weighted calculation on the states in different scheduling partitions to obtain a partition weighted advantage estimate; when updating the policy network of the proximal policy optimization method, the expected scheduling cost corresponding to the scheduling action is calculated, and the clipping range of the probability ratio used in the policy update is adjusted according to the deviation rate between the actual cost and the expected cost of the previous N scheduling times;

[0006] The static topology data and the real-time dynamic time series data are input into the trained model to obtain the scheduling control instructions.

[0007] Optionally, extracting features from the dynamic time series data to obtain a hidden state vector includes:

[0008] The forward gated recurrent unit processes the dynamic time series data sequence from the starting moment to the current moment in forward time order, and the backward gated recurrent unit processes the dynamic time series data sequence from the current moment to the starting moment in reverse time order, and the two hidden states output by the forward and backward gated recurrent units at the current moment are vector-spliced ​​to obtain the hidden state vector.

[0009] Optionally, the cross-attention mechanism is used to calculate the correlation weight between the hidden state vector and the static topology code, and feature fusion is performed based on the correlation weight to obtain the state feature of the current state of the pipeline network, including:

[0010] The hidden state vector is used as a query, and the encoded static topology data is used as a key and a value, and the correlation weight is obtained by calculating the dot product of the query and the key, and performing a scaling dot product and a Softmax normalization process;

[0011] Performing weighted summation on the correlation weight and the value to obtain an adjusted static topological feature;

[0012] The static topological features are concatenated with the hidden state vector and the dimension is reduced through a fully connected layer to obtain the state features of the current state of the pipeline network.

[0013] Optionally, performing weighted calculation on states in different scheduling partitions using the weight coefficients and the topological relationship between the scheduling partitions to obtain a weighted partition advantage estimate includes:

[0014] Based on the connection relationship of the pipe network nodes and the direction of water flow, an N×N topological influence matrix is ​​constructed. N is the number of scheduling partitions. The value of the element (i, j) in the matrix represents the degree of influence of partition j on partition i.

[0015] Using the topological influence matrix of partition i and the state value function V(s) of all other partitions j ), calculate the comprehensive affected value of partition i;

[0016] The state value function V(s i ) is linearly combined with the comprehensive affected value to obtain the state value of the fusion topological relationship;

[0017] The state value of the fusion topology relationship is multiplied by the weight coefficient of the partition to obtain the weighted state value V w (s i );

[0018] Using the weighted state value V w (s) Compute the advantage estimation function.

[0019] Optionally, the topological influence matrix of partition i and the state value function V(s j ), calculate the comprehensive impact value of partition i, including:

[0020] Extracting a row vector of the i-th row corresponding to partition i in the topological influence matrix, wherein the row vector is composed of N influence coefficient values, wherein the j-th influence coefficient value represents the hydraulic influence degree of partition j on partition i;

[0021] Get the N-dimensional vector consisting of the current state values ​​of all scheduling partitions, where the j-th element is the state value V(s) of partition j. j );

[0022] Perform a dot product operation on the i-th row vector and the N-dimensional state value vector;

[0023] Subtract the impact term of partition i from the dot product operation result to obtain the comprehensive impact value of partition i.

[0024] Optionally, the calculating the expected scheduling cost corresponding to the scheduling action includes:

[0025] Input the dispatching action into the hydraulic model for simulation to obtain the pipe network flow and pressure data;

[0026] The deviation between the simulated pressure values ​​of multiple preset pressure monitoring points in the pipeline network and the preset upper and lower limits of the pressure target is calculated, and the square values ​​of the deviations of all monitoring points are accumulated to obtain the penalty term for pressure stability, which is used as the expected scheduling cost.

[0027] Optionally, the clipping range of the probability ratio used in adjusting the strategy update based on the deviation rate between the actual cost and the expected cost of the previous N schedulings includes:

[0028] Record the expected dispatch cost of each period in the last N dispatch periods and the actual dispatch cost measured in the actual pipeline network;

[0029] Calculate the absolute value of the cost deviation for each cycle and divide it by the corresponding expected scheduling cost to obtain the cost deviation rate for a single cycle;

[0030] Take the arithmetic mean of all cost deviation rates in the last N cycles to obtain the average deviation rate D;

[0031] Based on the preset basic cropping range ε ​​and adjustment coefficient k, the formula ε n =ε×exp(-k×D) to calculate the new cropping range for this strategy update.

[0032] This application also provides a global water supply scheduling system, including:

[0033] A partitioning module is used to obtain static topological data and dynamic time series data of the global water supply network and construct training samples; divide the network into multiple scheduling partitions according to function or geographical location, and set a weight coefficient for each scheduling partition;

[0034] A training module is configured to extract features from the dynamic time series data to obtain a hidden state vector; calculate the correlation weight between the hidden state vector and the static topology through a cross-attention mechanism, and perform feature fusion based on the correlation weight to obtain the state characteristics of the current state of the pipeline network; adopt a proximal policy optimization method to output a scheduling action based on the state characteristics, and when calculating the advantage estimation function, use the weight coefficient and the topological relationship between the scheduling partitions to perform weighted calculations on the states within different scheduling partitions to obtain a partition-weighted advantage estimate; when updating the policy network of the proximal policy optimization method, calculate the expected scheduling cost corresponding to the scheduling action, and adjust the clipping range of the probability ratio used in the policy update according to the deviation rate between the actual cost and the expected cost of the previous N schedulings;

[0035] The scheduling module is used to input static topology data and real-time dynamic time series data into the trained model to obtain scheduling control instructions.

[0036] Optionally, extracting features from the dynamic time series data to obtain a hidden state vector includes:

[0037] The forward gated recurrent unit processes the dynamic time series data sequence from the starting moment to the current moment in forward time order, and the backward gated recurrent unit processes the dynamic time series data sequence from the current moment to the starting moment in reverse time order, and the two hidden states output by the forward and backward gated recurrent units at the current moment are vector-spliced ​​to obtain the hidden state vector.

[0038] Optionally, the cross-attention mechanism is used to calculate the correlation weight between the hidden state vector and the static topology code, and feature fusion is performed based on the correlation weight to obtain the state feature of the current state of the pipeline network, including:

[0039] The hidden state vector is used as a query, and the encoded static topology data is used as a key and a value, and the correlation weight is obtained by calculating the dot product of the query and the key, and performing a scaling dot product and a Softmax normalization process;

[0040] Performing weighted summation on the correlation weight and the value to obtain an adjusted static topological feature;

[0041] The static topological features are concatenated with the hidden state vector and the dimension is reduced through a fully connected layer to obtain the state features of the current state of the pipeline network.

[0042] Optionally, performing weighted calculation on states in different scheduling partitions using the weight coefficients and the topological relationship between the scheduling partitions to obtain a weighted partition advantage estimate includes:

[0043] Based on the connection relationship of the pipe network nodes and the direction of water flow, an N×N topological influence matrix is ​​constructed. N is the number of scheduling partitions. The value of the element (i, j) in the matrix represents the degree of influence of partition j on partition i.

[0044] Using the topological influence matrix of partition i and the state value function V(s) of all other partitions j ), calculate the comprehensive affected value of partition i;

[0045] The state value function V(s i ) is linearly combined with the comprehensive affected value to obtain the state value of the fusion topological relationship;

[0046] The state value of the fusion topology relationship is multiplied by the weight coefficient of the partition to obtain the weighted state value V w (s i );

[0047] Using the weighted state value V w (s) Compute the advantage estimation function.

[0048] Optionally, the topological influence matrix of partition i and the state value function V(s j ), calculate the comprehensive impact value of partition i, including:

[0049] Extracting a row vector of the i-th row corresponding to partition i in the topological influence matrix, wherein the row vector is composed of N influence coefficient values, wherein the j-th influence coefficient value represents the hydraulic influence degree of partition j on partition i;

[0050] Get the N-dimensional vector consisting of the current state values ​​of all scheduling partitions, where the j-th element is the state value V(s) of partition j. j );

[0051] Perform a dot product operation on the i-th row vector and the N-dimensional state value vector;

[0052] Subtract the impact term of partition i from the dot product operation result to obtain the comprehensive impact value of partition i.

[0053] Optionally, the calculating the expected scheduling cost corresponding to the scheduling action includes:

[0054] Input the dispatching action into the hydraulic model for simulation to obtain the pipe network flow and pressure data;

[0055] The deviation between the simulated pressure values ​​of multiple preset pressure monitoring points in the pipeline network and the preset upper and lower limits of the pressure target is calculated, and the square values ​​of the deviations of all monitoring points are accumulated to obtain the penalty term for pressure stability, which is used as the expected scheduling cost.

[0056] Optionally, the clipping range of the probability ratio used in adjusting the strategy update based on the deviation rate between the actual cost and the expected cost of the previous N schedulings includes:

[0057] Record the expected dispatch cost of each period in the last N dispatch periods and the actual dispatch cost measured in the actual pipeline network;

[0058] Calculate the absolute value of the cost deviation for each cycle and divide it by the corresponding expected scheduling cost to obtain the cost deviation rate for a single cycle;

[0059] Take the arithmetic mean of all cost deviation rates in the last N cycles to obtain the average deviation rate D;

[0060] Based on the preset basic cropping range ε ​​and adjustment coefficient k, the formula ε n =ε×exp(-k×D) to calculate the new cropping range for this strategy update.

[0061] This application constructs a topological influence matrix between scheduling partitions and incorporates the partition importance weights into the advantage estimation function, which can measure the impact on the entire pipeline system from a global perspective. Secondly, by continuously comparing the expected cost of scheduling actions in the simulation environment with the measured cost in the actual pipeline network, the degree of deviation of the current simulation model is quantified, and the deviation rate is used to dynamically adjust the clipping range during strategy updates. When the gap between the model and reality is large, a more conservative learning attitude is automatically adopted to prevent strategy degradation and unstable behavior caused by inaccurate models, thereby enhancing the security of scheduling strategies deployed in the real world. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 This is a flow chart of Example 1;

[0063] Figure 2 It is a schematic diagram of the water supply network structure;

[0064] Figure 3 Schematic diagram of the correlation weight between the hidden state vector and the static topology;

[0065] Figure 4 A schematic diagram of the cost. DETAILED DESCRIPTION

[0066] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.

[0067] Specific embodiments, such as Figure 1 As shown, this application proposes a global water supply scheduling method, including:

[0068] S1, obtain static topological data and dynamic time series data of the global water supply network and construct training samples; divide the network into multiple scheduling zones according to function or geographical location, and set a weight coefficient for each scheduling zone;

[0069] Data is regularly pulled from the water supply company's central control system, for example, every five minutes. Dynamic time-series data includes, but is not limited to, the outflow rate and pressure of each pumping station, as well as water demand and ambient temperature at key user nodes. Static topology data is imported by parsing engineering drawings from the pipeline network's Geographic Information System (GIS) and stored using graph database technology. Pipelines are represented as edges, and pumps, valves, and user nodes are represented as nodes. Edge attributes include, but are not limited to, length, diameter, and material, while node attributes include elevation, device model, and other information. Training samples are generated using historical static topology data and dynamic time-series data, labeled with control instructions. Dispatching zones are delineated on an electronic map based on the nature of the network's service area, such as hospitals, core business districts, and residential areas. Using the analytic hierarchy process, the importance of different zones is compared pairwise, a judgment matrix is ​​constructed, and the specific weight coefficient for each zone in the global dispatch is calculated, for example, 0.4 for core business districts, 0.3 for hospitals, and 0.2 for residential areas. The division of the scheduling area can be fine-grained or coarse-grained. Preferably, the division is performed in a fine-grained manner.

[0070] S2, extracting features from the dynamic time series data to obtain a hidden state vector; calculating the correlation weight between the hidden state vector and the static topology through a cross-attention mechanism, and performing feature fusion based on the correlation weight to obtain the state characteristics of the current state of the pipeline network; using a proximal policy optimization method to output a scheduling action based on the state characteristics, and when calculating the advantage estimation function, using the weight coefficient and the topological relationship between the scheduling partitions to perform weighted calculations on the states in different scheduling partitions to obtain a partition-weighted advantage estimate; when updating the policy network of the proximal policy optimization method, calculating the expected scheduling cost corresponding to the scheduling action, and adjusting the clipping range of the probability ratio used in the policy update according to the deviation rate between the actual cost and the expected cost of the previous N schedulings;

[0071] For dynamic time series data, it is preferred to use recurrent neural networks such as long short-term memory networks (LSTM) or gated recurrent units (GRU) to extract features from historical pressure, flow, temperature and other time series data to obtain the hidden state vector for each time step. The hidden state contains information about the dynamic change trend of the pipeline network operation. In order to combine static topology information with dynamic features, the static topology data is encoded into a structured vector, which interacts with the dynamic hidden state. The correlation between the two is calculated through cross-attention weights to achieve information fusion, allowing the model to consider both the structural characteristics of the pipeline network and the real-time operating status when making decisions. Among them, cross-attention is calculated between two different sequences, allowing the query sequence, that is, the hidden state vector, to focus on different static topology nodes.

[0072] During the decision-making output phase, the proximal policy optimization (PPO) algorithm is used as the core reinforcement learning method. PPO improves the performance of the scheduling strategy while ensuring the stability of policy updates. The model outputs scheduling actions based on the fused state features. During the calculation of the advantage estimation function, the state of each partition is weighted, combining partition weights and the topological relationships between partitions. This allows the model to focus on key areas during optimization. During policy network updates, the deviation between the actual cost of the previous N dispatches and the expected cost predicted by the model is calculated. Based on this deviation, the clipping range of the probability ratio in PPO is dynamically adjusted to control the policy update step.

[0073] S3, input the static topology data and the real-time dynamic time series data into the trained model to obtain the scheduling control instructions.

[0074] In the application, dynamic time-series data from the pipeline network is collected in real time and combined with static topology data. This data is then fed into a trained scheduling model. The model analyzes the current operational status of the pipeline network and, based on historical experience and structural characteristics, outputs optimal scheduling control instructions. These instructions include, but are not limited to, valve opening adjustment, pump start / stop, and tank water level regulation.

[0075] In an optional embodiment, extracting features from the dynamic time series data to obtain a hidden state vector includes:

[0076] The forward gated recurrent unit processes the dynamic time series data sequence from the starting moment to the current moment in forward time order, and the backward gated recurrent unit processes the dynamic time series data sequence from the current moment to the starting moment in reverse time order, and the two hidden states output by the forward and backward gated recurrent units at the current moment are vector-spliced ​​to obtain the hidden state vector.

[0077] Specifically, a neural network consisting of two directional processing units is used to generate the hidden state vector. The first unit, the forward gated recurrent unit, analyzes data according to the natural order of time, for example, from 6:00 AM to 12:00 PM, identifying trends in the data, such as a gradual increase in water consumption. The second unit, the backward gated recurrent unit, analyzes the data for the same time period in reverse, from 12:00 PM to 6:00 AM. This better captures how the current state is determined by recent events. At the current moment, the two vectors of the two units are concatenated side by side to generate the hidden state vector. For example, consider a set of minute-by-minute water consumption data from 8:00 AM to 9:00 AM. The forward unit sequentially reads the data from 8:00 AM, 8:01 AM, and finally 9:00 AM, identifying this as a morning peak and indicating a continuous increase in water consumption. It generates a vector at 9:00 AM representing the upward trend. Simultaneously, the backward unit, starting from the 9:00 AM data and working backwards to 8:00 AM, notes that the 9:00 AM peak is the result of a series of previous increases and generates a vector that provides a reverse understanding of this trend. The vector representing historical trends generated by the forward unit and the vector representing reverse tracking generated by the backward unit are concatenated to form a state description for 9 o'clock that contains both historical development information and current information. When there are multiple dynamic time series data sequences, these dynamic time series data sequences are treated as a multidimensional feature vector and then input into the forward gated recurrent unit. The backward gated recurrent unit is similarly processed and will not be further explained here.

[0078] In an optional embodiment, the cross-attention mechanism is used to calculate the correlation weight between the hidden state vector and the static topology code, and feature fusion is performed based on the correlation weight to obtain the state feature of the current state of the pipeline network, including:

[0079] The hidden state vector is used as a query, and the encoded static topology data is used as a key and a value, and the correlation weight is obtained by calculating the dot product of the query and the key, and performing a scaling dot product and a Softmax normalization process;

[0080] Performing weighted summation on the correlation weight and the value to obtain an adjusted static topological feature;

[0081] The static topological features are concatenated with the hidden state vector and the dimension is reduced through a fully connected layer to obtain the state features of the current state of the pipeline network.

[0082] The entire water supply network is abstracted into a graph structure, where the intersections of the network, water pumps and water tanks are the nodes of the graph, and the pipes connecting them are the edges of the graph, such as Figure 2As shown. Each node has its own attributes such as elevation, and each edge has attributes such as pipe diameter and length. These attributes together constitute the characteristics of the graph. Through multi-layer calculations, the graph convolutional network can allow the information of each node to propagate along the pipeline and aggregate with the information of adjacent nodes. When performing graph convolution, the attributes of the edge, such as length and pipe diameter, are digitized to obtain an adjacency matrix. After processing by the graph convolutional network, each node generates a new feature vector. This vector not only contains its own physical information, but also incorporates information about its position and connection relationship in the entire pipeline network topology. In one embodiment, a set of GCN node embedding vectors is used as Key and Value. For example, if there are four nodes and the feature vector of each node is 5, then the Key and Value are both 4×5 in size.

[0083] The hidden state vector generated by the dynamic data is used as the query, and the encoded static topology data is used as both the key and the corresponding value to be retrieved. The query vector queries the static topology data to find out which physical parts of the network are most critical under the current water demand pattern. By calculating the similarity between the query vector and all key vectors, the relevance weights are obtained. This set of weights indicates the importance of different parts of the network. For example, the relevance weights are [0.08, 0.80, 0.03, 0.09], as shown in the following example: Figure 3 This set of weights is then used to perform a weighted summation of all value vectors, generating a new topological feature adjusted for dynamic information: (0.08*node1)+(0.80*node2)+(0.03*node3)+(0.09*node4). This new topological feature is concatenated with the original hidden state vector and compressed through a fully connected neural network layer, resulting in a state feature that fully characterizes the current state of the network.

[0084] For example, at 2:00 PM, water consumption in the commercial district suddenly surges. The extracted dynamic information, reflecting the surge, serves as a query. The cross-attention mechanism compares this query with nodes throughout the city's pipe network. Calculations reveal that Pipeline 1 and Pump 3, supplying the commercial district, have the highest correlation weight with the dynamic information about the current surge in water consumption, while Pipeline 2 and Pump 5, supplying the residential areas west of the city, have a very low correlation weight. Based on these weights, a temporarily adjusted physical feature of the pipe network is generated, highlighting the parameters of Pipeline 1 and Pump 3. This highlighted physical feature is then combined with the dynamic information about the 2:00 PM water consumption surge and refined into a final state feature. This final feature conveys to the decision-making system that not only is water consumption in the east city currently high, but Pipeline 1 and Pump 3 are key nodes in resolving this problem. This allows the system to make the most appropriate scheduling decisions, such as increasing the speed of Pump 3 instead of blindly starting all pumps.

[0085] In an optional embodiment, performing weighted calculation on states in different scheduling partitions using the weight coefficients and the topological relationship between the scheduling partitions to obtain a weighted partition advantage estimate includes:

[0086] Based on the connection relationship of the pipe network nodes and the direction of water flow, an N×N topological influence matrix is ​​constructed. N is the number of scheduling partitions. The value of the element (i, j) in the matrix represents the degree of influence of partition j on partition i.

[0087] Using the topological influence matrix of partition i and the state value function V(s) of all other partitions j ), calculate the comprehensive affected value of partition i;

[0088] The state value function V(s i ) is linearly combined with the comprehensive affected value to obtain the state value of the fusion topological relationship;

[0089] The state value of the fusion topology relationship is multiplied by the weight coefficient of the partition to obtain the weighted state value V w (s i );

[0090] Using the weighted state value V w (s) Compute the advantage estimation function.

[0091] Specifically, assume that a city's water supply network is divided into three scheduling zones: the upstream industrial zone A, the midstream core business zone B, and the downstream residential zone C. First, based on the physical connection of the network and the direction of water flow, a three-by-three topological influence matrix is ​​constructed. For example, since industrial zone A is upstream, its water use behavior will have a significant impact on the midstream and downstream, so the influence value of B on A in the matrix is ​​set to 0.8, and the influence value of C on A is set to 0.7. The downstream residential zone C has almost no reverse hydraulic impact on the upstream, so the influence value of A on C is only 0.1. At the same time, an importance weight coefficient is set for each zone. The water supply guarantee of the core business zone B is the most critical, and its weight coefficient is set to 1.5. The industrial zone A is second and is set to 1.0, and the residential zone C is 0.9. In another embodiment, through hydraulic model simulation, while keeping other areas unchanged, a unit flow or pressure change is imposed on zone j, and the influence coefficient of the influence matrix is ​​obtained according to the flow or pressure changes in other zones.

[0092] When making decisions, the current state value of each partition is evaluated. Taking the core business district B as an example, the comprehensive impact value it is subject to is calculated first. This value is the state value of industrial district A multiplied by the impact coefficient of A on B, 0.8, plus the state value of residential district C multiplied by the impact coefficient of C on B, such as 0.2. The comprehensive impact value will be linearly combined with the state value of business district B itself, such as weighted summation, to obtain a new state value that incorporates the topological relationship. This new value is then multiplied by the preset maximum weight coefficient of 1.5 for business district B to obtain the final weighted state value. When the proximal strategy optimization algorithm evaluates a scheduling action, such as the pros and cons of increasing the speed of a water pump, it will use this final weighted state value to calculate the advantage estimate, so that the decision is more inclined to protect the interests of the core business district and fully consider the actual physical impact of upstream water use on it.

[0093] In an optional embodiment, the topological influence matrix of partition i and the state value function V(s j ), calculate the comprehensive impact value of partition i, including:

[0094] Extracting a row vector of the i-th row corresponding to partition i in the topological influence matrix, wherein the row vector is composed of N influence coefficient values, wherein the j-th influence coefficient value represents the hydraulic influence degree of partition j on partition i;

[0095] Get the N-dimensional vector consisting of the current state values ​​of all scheduling partitions, where the j-th element is the state value V(s) of partition j. j );

[0096] Perform a dot product operation on the i-th row vector and the N-dimensional state value vector;

[0097] Subtract the impact term of partition i from the dot product operation result to obtain the comprehensive impact value of partition i.

[0098] Specifically, to quantify the mutual hydraulic impact between regions, a topological influence matrix was pre-constructed. The data for this matrix was derived from the hydraulic model analysis of the pipe network. Now, we need to calculate the comprehensive impact value of downtown commercial district A. First, extract the row representing commercial district A from the topological influence matrix. Assume that the resulting row vectors are 1.0, 0.8, and 0.1. These three numbers represent the impact of A on itself as 1.0, the impact of upstream B on A as 0.8, and the impact of downstream C on A as 0.1. At the same time, an evaluation value, or state value function V, is assigned to the operating status of each zone at the current moment. Assume that the state value vectors for all zones are 50, 80, and 30. This means that the current state value of commercial district A is 50, that of water source district B is 80, and that of residential district C is 30.

[0099] Taking the dot product of the impact row vectors (1.0, 0.8, 0.1) of Commercial District A and the state value vectors (50, 80, 30) of all zones yields 117. This total of 117 includes the impact of Commercial District A on itself. To determine the impact solely due to other zones, the self-influence term must be subtracted. Commercial District A's self-influence term is 50. Subtracting this from the total of 117 yields 67, which is the current comprehensive impact of Commercial District A.

[0100] In an optional embodiment, the calculating the expected scheduling cost corresponding to the scheduling action includes:

[0101] Input the dispatching action into the hydraulic model for simulation to obtain the pipe network flow and pressure data;

[0102] The deviation between the simulated pressure values ​​of multiple preset pressure monitoring points in the pipeline network and the preset upper and lower limits of the pressure target is calculated, and the square values ​​of the deviations of all monitoring points are accumulated to obtain the penalty term for pressure stability, which is used as the expected scheduling cost.

[0103] Specifically, suppose a specific scheduling action is to increase the speed of water pump number one to 3,000 revolutions per minute. To predict the effectiveness of this action, this instruction is input into a pre-established hydraulic simulation model. In one embodiment, the hydraulic simulation model is a digital mirror of the actual pipeline network, such as one derived from a digital twin. Two key pressure monitoring points are also set: one at the hospital, where the pressure must be maintained between 3.0 and 3.5; the other at the industrial park, where the pressure must be maintained between 4.0 and 5.0. After running the hydraulic model, it outputs a prediction: the pressure at the hospital will drop to 2.8, while the pressure at the industrial park will increase to 5.2. For the hospital, the predicted pressure is 2.8, which is below the lower limit of 3.0, resulting in a negative deviation of 0.2. For the industrial park, the predicted pressure is 5.2, which is above the upper limit of 5.0, resulting in a positive deviation of 0.2. The square values ​​of these two deviations are calculated, and the square values ​​of the deviations of all monitoring points are accumulated to obtain 0.08, which is the pressure stability penalty term, as the expected scheduling cost of this scheduling action.

[0104] In an optional embodiment, the clipping range of the probability ratio used in adjusting the strategy update based on the deviation rate between the actual cost and the expected cost of the previous N schedulings includes:

[0105] Record the expected dispatch cost of each period in the last N dispatch periods and the actual dispatch cost measured in the actual pipeline network;

[0106] Calculate the absolute value of the cost deviation for each cycle and divide it by the corresponding expected scheduling cost to obtain the cost deviation rate for a single cycle;

[0107] Take the arithmetic mean of all cost deviation rates in the last N cycles to obtain the average deviation rate D;

[0108] Based on the preset basic cropping range ε ​​and adjustment coefficient k, the formula ε n =ε×exp(-k×D) to calculate the new cropping range for this strategy update.

[0109] Specifically, if the base clipping range is 0.2 and the adjustment coefficient is 5, in the past three hours, in the first hour, the scheduling cost predicted by the model was 10, while the actual cost measured during operation was 11. In the second hour, the expected cost was 8, and the actual cost was 8.4. In the third hour, the expected cost was 12, and the actual cost was 15. Calculate the cost deviation rate for each hour and average the cost deviation rates for these three hours. The average value represents the average inaccuracy of the recent model predictions, as shown in the following example: Figure 4 As shown in the figure, using the exponential decay formula above to calculate the new clipping range, we get approximately 0.103, which is smaller than the preset baseline value of 0.2. Because the model's recent prediction deviates from the actual situation, the policy update step size is automatically tightened, making the model more conservative and cautious during the next learning cycle. This prevents overly aggressive decisions based on inaccurate cost estimates, which could lead to system instability.

[0110] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, it should be understood by those skilled in the art that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. In addition, the various different implementations of the embodiments of the present invention can also be arbitrarily combined, as long as they do not violate the ideas of the embodiments of the present invention, and they should also be regarded as the contents disclosed in the embodiments of the present invention.

Claims

1. A method for global water supply scheduling, characterized in that: include: Obtain static topological data and dynamic time series data of the global water supply network and construct training samples; Dividing the pipeline network into multiple scheduling zones according to function or geographical location, and setting a weight coefficient for each scheduling zone; Feature extraction is performed on the dynamic time series data to obtain a hidden state vector; the correlation weight between the hidden state vector and the static topology is calculated through a cross-attention mechanism, and feature fusion is performed based on the correlation weight to obtain the state characteristics of the current state of the pipeline network; a proximal policy optimization method is used to output a scheduling action based on the state characteristics, and when calculating the advantage estimation function, the weight coefficient and the topological relationship between the scheduling partitions are used to perform weighted calculation on the states in different scheduling partitions to obtain a partition weighted advantage estimate; when updating the policy network of the proximal policy optimization method, the expected scheduling cost corresponding to the scheduling action is calculated, and the clipping range of the probability ratio used in the policy update is adjusted according to the deviation rate between the actual cost and the expected cost of the previous N scheduling times; Input static topology data and real-time dynamic time series data into the trained model to obtain scheduling control instructions; The step of performing weighted calculation on states in different scheduling partitions using the weight coefficients and the topological relationship between the scheduling partitions to obtain a weighted advantage estimate of the partitions includes: Based on the connection relationship of the pipe network nodes and the direction of water flow, an N×N topological influence matrix is ​​constructed. N is the number of scheduling partitions. The value of the element (i, j) in the matrix represents the degree of influence of partition j on partition i. Using the topological influence matrix of partition i and the state value function V(s) of all other partitions j ), calculate the comprehensive affected value of partition i; The state value function V(s i ) is linearly combined with the comprehensive affected value to obtain the state value of the fusion topological relationship; The state value of the fusion topology relationship is multiplied by the weight coefficient of the partition to obtain the weighted state value V w (s i ); Using the weighted state value V w (s) Calculate the advantage estimation function; Wherein, the topological influence matrix of the partition i and the state value function V(s j ), calculate the comprehensive impact value of partition i, including: Extracting a row vector of the i-th row corresponding to partition i in the topological influence matrix, wherein the row vector is composed of N influence coefficient values, wherein the j-th influence coefficient value represents the hydraulic influence degree of partition j on partition i; Get the N-dimensional vector consisting of the current state values ​​of all scheduling partitions, where the j-th element is the state value V(s) of partition j. j ); Perform a dot product operation on the i-th row vector and the N-dimensional state value vector; Subtract the influence of partition i from the dot product operation result to obtain the comprehensive influence value of partition i; The clipping range of the probability ratio used when adjusting the strategy update based on the deviation rate between the actual cost and the expected cost of the previous N schedulings includes: Record the expected dispatch cost of each period in the last N dispatch periods and the actual dispatch cost measured in the actual pipeline network; Calculate the absolute value of the cost deviation for each cycle and divide it by the corresponding expected scheduling cost to obtain the cost deviation rate for a single cycle; Take the arithmetic mean of all cost deviation rates in the last N cycles to obtain the average deviation rate D; Based on the preset basic cropping range ε ​​and adjustment coefficient k, the formula ε n =ε×exp(-k×D) to calculate the new cropping range for this strategy update.

2. The method according to claim 1, characterized in that The step of extracting features from the dynamic time series data to obtain a hidden state vector includes: The forward gated recurrent unit processes the dynamic time series data sequence from the starting moment to the current moment in forward time order, and the backward gated recurrent unit processes the dynamic time series data sequence from the current moment to the starting moment in reverse time order, and the two hidden states output by the forward and backward gated recurrent units at the current moment are vector-spliced ​​to obtain the hidden state vector.

3. The method according to claim 1, characterized in that The cross-attention mechanism is used to calculate the correlation weight between the hidden state vector and the static topology code, and feature fusion is performed based on the correlation weight to obtain the state feature of the current state of the pipeline network, including: The hidden state vector is used as a query, and the encoded static topology data is used as a key and a value, and the correlation weight is obtained by calculating the dot product of the query and the key, and performing a scaling dot product and a Softmax normalization process; Performing weighted summation on the correlation weight and the value to obtain an adjusted static topological feature; The static topological features are concatenated with the hidden state vector and the dimension is reduced through a fully connected layer to obtain the state features of the current state of the pipeline network.

4. The method according to claim 1, wherein The calculating the expected scheduling cost corresponding to the scheduling action includes: Input the dispatching action into the hydraulic model for simulation to obtain the pipe network flow and pressure data; The deviation between the simulated pressure values ​​of multiple preset pressure monitoring points in the pipeline network and the preset upper and lower limits of the pressure target is calculated, and the square values ​​of the deviations of all monitoring points are accumulated to obtain the penalty term for pressure stability, which is used as the expected scheduling cost.

5. A global water supply scheduling system, characterized in that: include: The partitioning module is used to obtain static topological data and dynamic time series data of the global water supply network and construct training samples; Dividing the pipeline network into multiple scheduling zones according to function or geographical location, and setting a weight coefficient for each scheduling zone; A training module is configured to extract features from the dynamic time series data to obtain a hidden state vector; calculate the correlation weight between the hidden state vector and the static topology through a cross-attention mechanism, and perform feature fusion based on the correlation weight to obtain the state characteristics of the current state of the pipeline network; adopt a proximal policy optimization method to output a scheduling action based on the state characteristics, and when calculating the advantage estimation function, use the weight coefficient and the topological relationship between the scheduling partitions to perform weighted calculations on the states within different scheduling partitions to obtain a partition-weighted advantage estimate; when updating the policy network of the proximal policy optimization method, calculate the expected scheduling cost corresponding to the scheduling action, and adjust the clipping range of the probability ratio used in the policy update according to the deviation rate between the actual cost and the expected cost of the previous N schedulings; The scheduling module is used to input static topology data and real-time dynamic time series data into the trained model to obtain scheduling control instructions; The step of performing weighted calculation on states in different scheduling partitions using the weight coefficients and the topological relationship between the scheduling partitions to obtain a weighted advantage estimate of the partitions includes: Based on the connection relationship of the pipe network nodes and the direction of water flow, an N×N topological influence matrix is ​​constructed. N is the number of scheduling partitions. The value of the element (i, j) in the matrix represents the degree of influence of partition j on partition i. Using the topological influence matrix of partition i and the state value function V(s) of all other partitions j ), calculate the comprehensive affected value of partition i; The state value function V(s i ) is linearly combined with the comprehensive affected value to obtain the state value of the fusion topological relationship; The state value of the fusion topology relationship is multiplied by the weight coefficient of the partition to obtain the weighted state value V w (s i ); Using the weighted state value V w (s) Calculate the advantage estimation function; Wherein, the topological influence matrix of the partition i and the state value function V(s j ), calculate the comprehensive impact value of partition i, including: Extracting a row vector of the i-th row corresponding to partition i in the topological influence matrix, wherein the row vector is composed of N influence coefficient values, wherein the j-th influence coefficient value represents the hydraulic influence degree of partition j on partition i; Get the N-dimensional vector consisting of the current state values ​​of all scheduling partitions, where the j-th element is the state value V(s) of partition j. j ); Perform a dot product operation on the i-th row vector and the N-dimensional state value vector; Subtract the influence of partition i from the dot product operation result to obtain the comprehensive influence value of partition i; The clipping range of the probability ratio used when adjusting the strategy update based on the deviation rate between the actual cost and the expected cost of the previous N schedulings includes: Record the expected dispatch cost of each period in the last N dispatch periods and the actual dispatch cost measured in the actual pipeline network; Calculate the absolute value of the cost deviation for each cycle and divide it by the corresponding expected scheduling cost to obtain the cost deviation rate for a single cycle; Take the arithmetic mean of all cost deviation rates in the last N cycles to obtain the average deviation rate D; Based on the preset basic cropping range ε ​​and adjustment coefficient k, the formula ε n =ε×exp(-k×D) to calculate the new cropping range for this strategy update.

6. The system according to claim 5, characterized in that The step of extracting features from the dynamic time series data to obtain a hidden state vector includes: The forward gated recurrent unit processes the dynamic time series data sequence from the starting moment to the current moment in forward time order, and the backward gated recurrent unit processes the dynamic time series data sequence from the current moment to the starting moment in reverse time order, and the two hidden states output by the forward and backward gated recurrent units at the current moment are vector-spliced ​​to obtain the hidden state vector.

7. The system according to claim 5, characterized in that The cross-attention mechanism is used to calculate the correlation weight between the hidden state vector and the static topology code, and feature fusion is performed based on the correlation weight to obtain the state feature of the current state of the pipeline network, including: The hidden state vector is used as a query, and the encoded static topology data is used as a key and a value, and the correlation weight is obtained by calculating the dot product of the query and the key, and performing a scaling dot product and a Softmax normalization process; Performing weighted summation on the correlation weight and the value to obtain an adjusted static topological feature; The static topological features are concatenated with the hidden state vector and the dimension is reduced through a fully connected layer to obtain the state features of the current state of the pipeline network.