Method for dividing independent metering areas of water supply network
Through the combination of SOM and Leiden algorithms, combined with multi-objective genetic algorithm, the flowmeter layout is optimized, which solves the problem of insufficient partition accuracy and pressure uniformity in the water supply pipeline partition, and achieves a more efficient DMA partition and flowmeter layout.
Patent Information
- Application Number
- CN202410230040.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-29
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-02-29
AI Technical Summary
The existing independent metering area division method of water supply pipeline networks has shortcomings in terms of partition accuracy and pressure uniformity, especially in large and complex pipeline networks. It is difficult for traditional methods to fully understand the operating conditions of the pipeline network, resulting in strong subjective and inconsistent zoning results. Connectivity issues.
Using a combination of self-organized mapping neural network (SOM) and Leiden algorithm, a feature matrix is constructed by obtaining the topological structure, node water demand, elevation and pressure parameters of the water supply pipeline network, data dimensionality reduction and node division, and super node undirected graph is generated , using multi-objective genetic algorithm to optimize the flowmeter and valve layout scheme to realize DMA partitioning.
It improves the accuracy and pressure uniformity of DMA partitions, eliminates the incident of node disconnection within DMA, realizes more reasonable node similarity evaluation and flowmeter arrangement, and improves the partitioning effect of large water supply pipelines.
Smart Images

Figure CN118114413B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of urban water supply pipe network design, and in particular to a method for dividing independent metering areas of a water supply pipe network. Background Art
[0002] District Metering Area (DMA) management is one of the effective methods to control water loss in urban water supply systems. The principle is to install flow meters at specific locations in the water supply network, ensure that each area has one or more metering devices (that is, one or more water inlets), and divide the water supply network into several independent water supply areas with permanent boundaries to monitor and measure the flow in fixed areas, and identify the occurrence of leakage in a timely manner to achieve the purpose of leakage control. After more than ten years of research and practice around the world, DMA zoning management technology has been proven to be an effective means of controlling leakage.
[0003] DMA partitioning has been developed so far. According to its development process, it can be divided into two categories: empirical partitioning method and automatic partitioning by partitioning algorithm. The specific introduction is as follows: the empirical partitioning method is that managers perform manual partitioning based on their familiarity with the water supply network. According to whether the hydraulic model is used, the empirical partitioning method can be divided into direct and indirect partitioning methods; the objects of the empirical partitioning method are mostly simple small water supply networks and the partitioning results have more subjective components. However, for large-scale ring networks with complex structures, it is impossible to fully understand the operating conditions of all pipe networks based on experience, so the empirical partitioning method can no longer meet the needs of large-scale water supply partitioning. In recent years, domestic and foreign researchers have tried to introduce various algorithms into DMA partitioning. Researchers have developed various algorithms and methods to determine the best DMA partitioning scheme. These methods may involve network topology analysis, water flow simulation, data mining and other technologies. Algorithm automatic partitioning can be divided into the following categories: water supply demarcation line method, community structure method, single-objective or multi-objective optimization algorithm partitioning, graph theory-based methods, etc. The research and practice of DMA partitioning of water supply networks has received widespread attention in the field of water management.
[0004] In the related art, a patent application document with publication number CN116542001A discloses a method for independent metering zoning of a water supply network based on improved spectral clustering and genetic algorithm. The characteristic matrix constructed in this method consists of the adjacency relationship, elevation, and coordinates of the nodes, but does not consider the number of associated edges, and cannot measure the similarity between nodes from multiple angles, and cannot deeply explore the correlation between nodes; secondly, when dividing the nodes in the water supply network, based on the topological structure information and operating status information of the water supply network, the DMA division of the water supply network is realized by using the improved spectral clustering method, and there may be a problem of disconnected nodes in the same DMA; in the layout of the boundary pipelines, by pre-setting the number of flow meters arranged in the boundary pipe section set, with maximizing the dissipated power of the water supply network nodes as the objective function, a single-objective genetic algorithm is used to search for the optimal layout of valves and flow meters on the boundary pipe section set, and there is a subjective problem of manually setting the number of flow meters. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a method and system for dividing a water supply network into independent metering areas, so that the water supply network after DMA partitioning can have significant improvements in indicators such as partition accuracy and pressure uniformity.
[0006] The present invention solves the above technical problems by the following technical means:
[0007] A method for dividing independent metering areas of a water supply network is proposed, the method comprising:
[0008] Acquiring water supply network operation data, wherein the water supply network operation data includes topological structure, node water demand, elevation and pressure parameters;
[0009] Constructing a feature matrix based on the water supply network operation data;
[0010] Inputting the feature matrix into a self-organizing map neural network (SOM) to obtain a cluster set;
[0011] Based on the cluster set, generating an undirected graph of super nodes;
[0012] Inputting the undirected graph into Leiden algorithm to obtain a set of boundary pipe segments between DMAs;
[0013] The multi-objective genetic algorithm (Non-dominated Sorting Genetic Algorithm III, NSGA-III) is used to determine the optimal layout of flow meters and valves in the boundary pipe section set between DMAs, and the DMA zoning result of the water supply network is obtained.
[0014] Furthermore, the obtaining of water supply network operation data includes:
[0015] Importing the topological relationship of the water supply network and the operating parameters of the pipe fittings into EPANET software to establish a micro-hydraulic model of the water supply network;
[0016] The EPANET toolbox is called to perform hydraulic analysis on the micro-hydraulic model of the water supply network to obtain the topological structure, node water demand, node elevation and pressure parameters of the water supply network.
[0017] Furthermore, the constructing of a characteristic matrix based on the water supply network operation data includes:
[0018] According to the topological structure of the water supply network, construct an adjacency matrix and a matrix of the number of common neighbors between nodes;
[0019] Calculating a topological similarity matrix based on the number of common neighbors between the nodes and the number of edges associated with each node;
[0020] Using node elevation and pressure parameters, a hydraulic similarity matrix is constructed;
[0021] The adjacency matrix, the topological similarity matrix and the hydraulic similarity matrix are added together to obtain the feature matrix.
[0022] Furthermore, the use of node elevation and pressure parameters to construct a hydraulic similarity matrix includes:
[0023] According to the node elevations, the elevation differences between the nodes are calculated to obtain an elevation difference matrix;
[0024] Based on the pressure parameter, the pressure difference between each node is calculated to obtain a pressure difference matrix;
[0025] Based on the elevation difference matrix and the pressure difference matrix, the hydraulic similarity between the nodes is calculated to obtain a hydraulic similarity matrix.
[0026] Furthermore, after constructing the characteristic matrix based on the water supply network operation data, the method further includes:
[0027] Performing zero-mean normalization on the feature matrix to obtain a normalized feature matrix;
[0028] Accordingly, the step of inputting the feature matrix into a self-organizing map neural network to obtain a cluster set further includes:
[0029] The standardized feature matrix is input into a self-organizing map neural network to obtain a cluster set.
[0030] Furthermore, the feature matrix is input into a self-organizing map neural network to obtain a cluster set, including:
[0031] All input samples divided by the feature matrix are used as inputs of the self-organizing map neural network, and for each input sample, the Euclidean distance between the input sample and each node of the output layer is calculated respectively;
[0032] The node on the output layer with the smallest Euclidean distance to the input sample is selected as the activation point, and the weight of the activation point is set to 1. For other nodes on the output layer except the activation point, the weights of other nodes are calculated using the Gaussian method according to the distance between other nodes and the activation point;
[0033] Based on the weights of the activation points and the weights of other nodes, a weight matrix of each node on the output layer is constructed;
[0034] According to the weight matrix of each node on the output layer, the node matrix of the output layer is updated;
[0035] Determine whether the first iteration number is satisfied, if not, increment the iteration number by 1, and re-input all input samples into the self-organizing map neural network;
[0036] If so, the Euclidean distance between the input sample and each node in the updated output layer node matrix is calculated, and the output layer node with the minimum Euclidean distance is taken as the label of the input sample, and the input samples with the same label are merged into one cluster to obtain several cluster sets.
[0037] Furthermore, generating an undirected graph of super nodes based on the cluster set includes:
[0038] Based on each of the cluster sets being defined as a super node, a set of super nodes is obtained, wherein the child nodes in the super nodes represent nodes in the water supply network node set;
[0039] According to the connection relationship between the sub-nodes inside the super node, a set of super node edges and a set of edge weights are obtained;
[0040] According to the set of super nodes, the set of super node edges and the set of edge weights, an undirected graph of super nodes is obtained.
[0041] Furthermore, the undirected graph is input into the Leiden algorithm to obtain a set of boundary pipe segments between DMAs, including:
[0042] Initialize a queue, add the set of super nodes in the undirected graph to the queue in a random order, label each super node in the queue with a different community label, and obtain a set of communities, wherein the super node set consists of water supply network nodes;
[0043] Take out the first super node from the queue, obtain several super nodes connected to the first super node according to the set of super node edges, and construct the adjacent node set of the first super node;
[0044] Calculate the modularity change value after the first super node moves to the community where each neighboring node in its neighboring node set is located, and obtain the modularity change set;
[0045] When there is a value greater than 0 in the modularity change set, the community label of the first super node is updated to the community label corresponding to the adjacent node with the largest modularity change value in the set;
[0046] Add the super nodes in the adjacent node set that do not belong to the community of the first super node and are not in the queue to the back of the queue, and determine whether the queue is empty. If not, recalculate the modularity change set;
[0047] If yes, then based on the updated set of community tags, the super nodes with the same community tag are divided into the same community, and the set of super nodes in each community is used as a sub-queue;
[0048] Recalculate the set of subcommunity labels corresponding to each subqueue, and merge super nodes with the same subcommunity labels into a large node, to obtain the set of large nodes in all communities and the set of community labels corresponding to each large node;
[0049] Determine whether the second iteration number is met, if not, replace the set of super nodes in the undirected graph with the set of large nodes of all communities, and re-execute the above steps;
[0050] If so, the optimal set of community labels is output, and the super nodes with the same community label are divided into the same community to obtain the set of boundary segments between DMAs.
[0051] Furthermore, the method of using a multi-objective genetic algorithm to determine the optimal arrangement of flow meters and valves in the boundary pipe section set between DMAs to obtain the DMA partition result of the water supply network includes:
[0052] All the boundary pipe sections in the DMA partition result of the water supply network are encoded in a binary encoding manner. If a flow meter is arranged in a boundary pipe section, the corresponding chromosome encoding is a binary number 1, and if a valve is arranged in the boundary pipe section, the corresponding chromosome encoding is a binary number 0;
[0053] Define a multi-objective function, wherein the multi-objective function includes minimizing the number of installed flow meters as an objective function f1, minimizing the pressure uniformity index as an objective function f2, maximizing the power dissipation of the water supply network node as an objective function f3, and maximizing the entropy index as an objective function f4;
[0054] Under the condition of satisfying the pressure constraints of the water supply network nodes, a multi-objective genetic algorithm is used to process the multi-objective function, search for the optimal layout of valves and flow meters on the boundary pipe section set, and determine the zoning planning result of the water supply network DMA.
[0055] Furthermore, under the condition of satisfying the water supply network node pressure constraint, the multi-objective genetic algorithm is used to process the multi-objective function, search for the optimal arrangement of valves and flow meters on the boundary pipe section set, and determine the zoning planning result of the water supply network DMA, including:
[0056] Initialize the population and randomly generate C binary chromosome sequences as the initial parent population;
[0057] Selecting parent individuals from the initial parent population and performing crossover and mutation to generate offspring individuals, and merging the parent individuals and offspring individuals to obtain an overall population;
[0058] Calculating the non-dominated ranking level of each individual in the overall population according to the multi-objective function, and adaptively standardizing the population according to a predefined reference point to obtain the individuals to be retained, thereby generating a new parent population;
[0059] Determine whether the third iteration number is met, if not, recalculate the overall population, if yes, output the optimal individual set consisting of the corresponding n optimal individuals;
[0060] The objective functions corresponding to each optimal individual are added together by averaging the weights to obtain the total objective function, and the optimal individual with the smallest total objective function value in the optimal individual set is selected as the optimal solution;
[0061] Based on the optimal arrangement of flow meters and valves in the boundary pipe section set corresponding to the optimal solution, the DMA zoning planning result of the water supply network is obtained.
[0062] The advantages of the present invention are:
[0063] (1) The present invention constructs a feature matrix based on the operating data of the water supply network, and inputs the feature data into a self-organizing map neural network (SOM). The SOM algorithm can map high-dimensional data into a low-dimensional topological space and reduce the dimension of the data, so it can be applicable to the partitioning of large and complex pipe networks. The SOM algorithm mainly considers the hydraulic characteristics between nodes, and the Leiden algorithm mainly considers the topological characteristics between nodes. The Leiden algorithm introduces the concept of local optimization, so it can eliminate the occurrence of disconnected nodes in each DMA in the process of determining the DMA partition, thereby improving the accuracy of the partition. At the same time, the combination of SOM and Leiden can consider the similarities between nodes from multiple angles, making the final DMA design result more reasonable.
[0064] (2) The multi-objective genetic algorithm is an adaptive artificial intelligence technology that is mainly optimized based on objective functions and computational constraints, and is very suitable for discrete and nonlinear optimization problems. Since there are many possible combinations of DMA layouts for water supply networks when selecting pipes for inserting flow meters or valves to physically partition the water supply network, the present invention selects the optimal layout of flow meters and valves from the perspective of four objective functions, so that the water supply network after DMA partitioning of large water supply networks has greatly improved indicators such as partition accuracy and pressure uniformity.
[0065] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 It is a flow chart of a method for dividing water supply network independent metering areas proposed in one embodiment of the present invention;
[0067] Figure 2 It is a schematic diagram of the overall process of a method for dividing independent metering areas of a water supply network proposed in one embodiment of the present invention;
[0068] Figure 3 is a flow chart of the implementation of the SOM algorithm in one embodiment of the present invention;
[0069] Figure 4 is a flowchart of the implementation of the Leiden algorithm in one embodiment of the present invention;
[0070] Figure 5 is a flow chart of implementing a multi-objective genetic algorithm in one embodiment of the present invention;
[0071] Figure 6 is a pipe network model of an implementation case in one embodiment of the present invention;
[0072] Figure 7 is a diagram of a pipe network example in one embodiment of the present invention after the SOM algorithm is applied;
[0073] Figure 8 is a diagram of a pipe network example in one embodiment of the present invention after being processed by the Leiden algorithm;
[0074] Fig. 9 It is a DMA partition diagram of the example pipe network division in one embodiment of the present invention. DETAILED DESCRIPTION
[0075] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0076] like Figure 1 As shown, a method for dividing a water supply network into independent metering areas is disclosed in a first embodiment of the present invention, and the method comprises the following steps:
[0077] S10, obtaining water supply network operation data, wherein the water supply network operation data includes topological structure, node water demand, elevation and pressure parameters;
[0078] S20, constructing a feature matrix based on the water supply network operation data;
[0079] S30, inputting the feature matrix into a self-organizing map neural network to obtain a cluster set;
[0080] S40, generating an undirected graph of super nodes based on the cluster set;
[0081] S50, inputting the undirected graph into the Leiden algorithm to obtain a set of boundary pipe segments between DMAs;
[0082] S60. Determine the optimal arrangement of flow meters and valves in the set of boundary pipe sections between DMAs using a multi-objective genetic algorithm, and obtain the DMA zoning result of the water supply network.
[0083] It should be noted that, compared with traditional clustering algorithms, the SOM algorithm used in this embodiment can maintain the topological structure of the data in the input space during the training process, which helps to retain the local relationship of the data and can better understand the distribution of the data. The SOM algorithm can be used for dimensionality reduction of high-dimensional data, mapping the high-dimensional data to a two-dimensional (or three-dimensional) SOM grid, so that the high-dimensional data can be visualized, making it easier to understand and analyze; in addition, by adopting the Leiden algorithm, the connectivity of the generated community is also guaranteed on the basis of the existing community structure algorithm, and the algorithm runs faster.
[0084] In one embodiment, the step S10: obtaining water supply network operation data, wherein the water supply network operation data includes topological structure, node water demand, elevation and pressure parameters, comprises the following steps:
[0085] S11, importing the topological relationship of the water supply network and the pipe operation parameters into EPANET software to establish a micro hydraulic model of the water supply network;
[0086] Specifically, the topological relationship of the water supply network and the operating parameters of the pipe fittings are imported into the EPANET software to establish a micro-hydraulic model of the water supply network, where the set of all nodes in the water supply network is: V = {v 1 ,v 2 ...v i ...v j ...v N}(i,j=1,2...N), where i and j represent the i-th and j-th indexes of the water supply network node respectively, and N represents that there are N nodes in the water supply network; the set of all pipe sections is E={e 1 ,e 2 ...e oi ...e oj ...e M}(oi,oj=1,2...M), where oi and oj represent the oi-th and oj-th indexes of the water supply network pipes respectively, and M represents that there are M pipes in the water supply network.
[0087] S12. Calling the EPANET toolbox, performing hydraulic analysis on the micro-hydraulic model of the water supply network, and obtaining the topological structure, node water demand, node elevation and pressure parameters of the water supply network.
[0088] Specifically, by calling the EPANET toolbox, hydraulic analysis is performed to obtain the network topology information and operation status information, and the adjacency matrix of the water supply network topology, the matrix of the number of common neighbors between nodes, the number of edges associated with each node, the elevation and pressure parameters are obtained, among which:
[0089] The formula of the adjacency matrix is expressed as:
[0090]
[0091] The formula for the common neighbor number matrix between nodes is expressed as:
[0092]
[0093] The formula for the number of edges associated with each node is: K = [k 1 ,k 2 ...k i ...k j ...k N ](i,j=1,2...N)
[0094] The formula for elevation is: R = [r 1 ,r 2 ...r i ...r j ...r N](i,j=1,2...N)
[0095] The formula for pressure is: P = [p 1 ,p 2 ...p i ...p j ...p N ](i,j=1,2...N)
[0096] Where: A ij Indicates whether node i and node j are connected. If A ij =1, then they are connected, otherwise they are not connected; Γ ij represents the number of common neighbors of node i and node j; k i and k j Represents the number of edges associated with node i and node j respectively; r i and r j Represent the elevation of node i and node j respectively; p i and p j Represent the pressure at node i and node j respectively.
[0097] In one embodiment, if Figure 2 As shown, the step S20: constructing a feature matrix based on the water supply network operation data includes the following steps:
[0098] S21. Constructing an adjacency matrix and a matrix of the number of common neighbors between nodes according to the topological structure of the water supply network;
[0099] S22, calculating a topological similarity matrix based on the common neighbor number matrix between the nodes and the number of edges associated with each node;
[0100] Specifically, the common neighbor number matrix Γ and the number matrix K of the edges associated with each node are calculated by the formula Calculate and obtain the topological similarity TS between each node ij , and then get the topological similarity matrix:
[0101]
[0102] Among them, Γ ij is the number of common neighbors of nodes i and j, k i and k j are the degrees of nodes i and j respectively, TS ij is the topological similarity index between nodes i and j.
[0103] S23, constructing a hydraulic similarity matrix using node elevation and pressure parameters;
[0104] S24, adding the adjacency matrix, the topological similarity matrix and the hydraulic similarity matrix to obtain the feature matrix.
[0105] It should be noted that the feature matrix constructed in this embodiment is composed of the adjacency relationship of the nodes, the number of common neighbors, the number of associated edges, and the elevation and pressure. The constructed feature matrix can measure the similarity between nodes from multiple angles and deeply explore the correlation between nodes. It is not limited to location and basic hydraulic characteristics, and can effectively improve the correlation between nodes.
[0106] In one embodiment, the step S23: constructing a hydraulic similarity matrix using node elevations and pressure parameters, specifically includes the following steps:
[0107] S231, calculating the elevation difference between each node according to the node elevation, and obtaining an elevation difference matrix;
[0108] Specifically, the elevation R is given by the formula Get the elevation difference u between each node ij , and then get the elevation difference matrix
[0109]
[0110] Among them, r i and r j are the elevations of nodes i and j, respectively, r max is the maximum value in R, u ij is the elevation difference between node i and node j.
[0111] S232, based on the pressure parameter, calculating the pressure difference between each node to obtain a pressure difference matrix;
[0112] Specifically, the pressure P is given by the formula Get the pressure difference θ between each node ij , and then the pressure difference matrix is obtained:
[0113]
[0114] Among them, p i and p j are the pressures at nodes i and j, respectively, and p max is the maximum value in P, p max is the pressure difference between nodes i and j.
[0115] S233. Based on the elevation difference matrix and the pressure difference matrix, the hydraulic similarity between the nodes is calculated to obtain a hydraulic similarity matrix.
[0116] Specifically, the elevation difference matrix U and the pressure difference matrix θ are calculated by the following formula:
[0117]
[0118] Get the hydraulic similarity HS between each node ij , and then the hydraulic similarity matrix HS is obtained, and the formula is expressed as:
[0119]
[0120] Among them, u ij and θ ij is the elevation and pressure difference between nodes i and j, HS ij is the hydraulic similarity index of nodes i and j.
[0121] In one embodiment, the step S24: adding the adjacency matrix, the topological similarity matrix and the hydraulic similarity matrix to obtain the feature matrix is specifically:
[0122] The adjacency matrix, the topological similarity matrix and the hydraulic similarity matrix are added together by the formula X=A+TS+HS to obtain the final feature matrix:
[0123]
[0124] Where: x ij represents the similarity between node i and node j, A is the adjacency matrix, TS represents the topological similarity matrix, and HS represents the hydraulic similarity matrix.
[0125] This embodiment obtains a feature matrix by adding the adjacency matrix, the topological similarity matrix and the hydraulic similarity matrix, which integrates the attributes of the three nodes, considers the similar features of the nodes from different angles, and can better capture the correlation between the nodes.
[0126] In one embodiment, after the step S20 of constructing a feature matrix based on the water supply network operation data, the method further comprises the following steps:
[0127] The feature matrix is subjected to zero-mean normalization processing, so that the normalized feature matrix can better capture the correlation between nodes when used as an input of the self-organizing map neural network, thereby improving the segmentation result;
[0128] Accordingly, the step of inputting the feature matrix into a self-organizing map neural network to obtain a cluster set further includes:
[0129] The standardized feature matrix is input into a self-organizing map neural network to obtain a cluster set.
[0130] Specifically, the feature matrix where x ij=A ij +TS ij +HS ij ,Xcol j =[x 1j ,x 2j ,…,x Nj ] T ,
[0131] Where: A ij is the element value of the i-th row and j-th column in the adjacency matrix A, TS ij is the element value of the i-th row and j-th column in the node topology similarity matrix TS, HS ij is the element value of the i-th row and j-th column in the node hydraulic similarity matrix HS, Xcol j is the jth column of matrix X, Xcol j is the j-th column of the feature matrix.
[0132] The formula for each column of matrix X is The zero-mean normalization process is performed, and the normalized data of each column can be used to obtain the matrix XS after the entire matrix X is normalized by column, which is in the following form:
[0133]
[0134] Among them, XScol j =[xs 1j ,xs 2j ,…,xs Nj ] T ,XScol j is the jth column of the matrix XS, xs Nj Represents the Nth row and jth column of XS.
[0135] In one embodiment, the step S30: inputting the feature matrix into a self-organizing map neural network to obtain a cluster set comprises the following steps:
[0136] S31, taking all the input samples divided by the feature matrix as the input of the self-organizing map neural network, and for each input sample, respectively calculating the Euclidean distance between the input sample and each node of the output layer;
[0137] S32, selecting the node on the output layer with the smallest Euclidean distance to the input sample as the activation point, and setting the weight of the activation point to 1, and for other nodes on the output layer except the activation point, using the Gaussian method to calculate the weights of other nodes according to the distance between other nodes and the activation point;
[0138] S33, constructing a weight matrix of each node on the output layer based on the weight of the activation point and the weights of other nodes;
[0139] S34, updating the node matrix of the output layer according to the weight matrix of each node on the output layer;
[0140] S35, determine whether the first number of iterations is met, if not, proceed to step S36, if yes, proceed to step S37;
[0141] S36, after the number of iterations is increased by 1, all input samples are re-input into the self-organizing map neural network;
[0142] S37, calculating the Euclidean distance between the input sample and each node in the updated output layer node matrix, taking the output layer node with the minimum Euclidean distance as the label of the input sample, merging the input samples with the same label into one cluster, and obtaining a plurality of cluster sets.
[0143] In this embodiment, the feature matrix X or the feature matrix X is input into the SOM algorithm after being subjected to zero-mean normalization, and the water supply network is divided into L clusters. The corresponding nodes in the water supply network node set V are divided into L clusters. Som=[s 1 ,s 2 ...s g ...s h ...s L ](g,h=1,2...L).
[0144] Furthermore, the structure of the SOM neural network is divided into an input layer and an output layer. Before the input sample is input into the network, the SOM network structure is initialized. The input layer has a total of N input samples, that is, the standardized feature matrix XS = [XScol 1 ,XScol 2 ,...XScol j ,...,XScol N ], each sample XScol j is D-dimensional; the output layer has a total of Y rows × Y columns of nodes, where Y is The node matrix W of the output layer is obtained in the following form:
[0145]
[0146] Among them, w ti tj =[w ti tj 0 ,w ti tj 0 ,…w ti tj D ], each node is D-dimensional, and each node w in the output layer ti tj Random initialization.
[0147] Then initialize the output layer domain radius sigma, learning rate η, random seed seed1, and set the algorithm termination condition: the first iteration number SJ.
[0148] like Figure 3 As shown, the specific process of the SOM algorithm is as follows:
[0149] a1) Input sample XScol j , calculate the sample XScol respectively j With each node w in the output layer ti tj The Euclidean distance d j ti tj , the formula is as follows:
[0150]
[0151] Where: xs ij For the sample XScol j The i-th coordinate of ti tj i is the output layer node w ti tj The i-th coordinate of .
[0152] Select the output layer with the sample XScol j The node with the smallest Euclidean distance is the activation point (c x ,c y ), set its weight wg to 1, and for other nodes w in the output layer ti tj , using it and (c x ,c y ), and use the Gaussian method to calculate their weights wg(ti,tj), the formula is as follows:
[0153]
[0154] Where: c x and c y is the coordinate of the activation point, σ is the standard deviation, c ti and c tj is the output layer node w ti tj The coordinates of .
[0155] Then we get the weight matrix WG of each node in the output layer, which is as follows:
[0156]
[0157] b1) Update the output layer node matrix W according to the weight matrix WG. The formula is as follows:
[0158] w ti tj =w ti tj +η*wg ti tj *(XScol j -w ti tj )
[0159] Where: η is the learning rate, wg ti tj w ti tjThe weight of XScol j -w ti tj Indicates the currently updated output layer node and input sample XScol j distance.
[0160] c1) Determine whether the input of N input samples is completed. If not, jump to a1); if satisfied, jump to c. 1).
[0161] c1) Determine whether the first iteration number is satisfied: iteration number t = SJ, if satisfied, jump to d1), if not satisfied, jump to a1), set t = t + 1, and re-input all input samples into the SOM algorithm, and update η, the formula is as follows:
[0162]
[0163] Where: η 0 is the initial learning rate, t is the current number of iterations, and SJ is the maximum number of iterations.
[0164] d1) Get the final updated output layer node matrix W and calculate the sample XScol j The Euclidean distance with each node in W, the output layer node with the minimum Euclidean distance is XScol j The labels of each sample are obtained, and the samples with the same label are merged into one cluster, and finally L clusters are obtained. Sample set XS = [XScol 1 ,XScol 2 ,...XScol j ,...,XScol N ](j=1,2...N) corresponds to the water supply network node set V={v 1 ,v 2 ...v i ...v j ...v N}(i,j=1,2...N), so each node in V is divided into L clusters Som=[s 1 ,s 2 ...s g ...s h ...s L ](g,h=1,2...L).
[0165] This embodiment constructs a feature matrix based on the operating data of the water supply network, and inputs the feature data into a self-organizing map neural network (Self Organizing Maps, SOM). The SOM algorithm can map high-dimensional data to a low-dimensional topological space and reduce the dimensionality of the data, so it can be applied to the partitioning of large and complex pipe networks.
[0166] In one embodiment, the step S40: generating an undirected graph of super nodes based on the cluster set, comprises the following steps:
[0167] S41, based on each of the cluster sets being defined as a super node, a set of super nodes is obtained, wherein the child nodes in the super nodes represent nodes in the water supply network node set;
[0168] Specifically, in this embodiment, the water supply network node set V is divided into L clusters, and the L clusters are defined as super nodes. Each super node contains multiple child nodes (the child nodes are nodes in the water supply network node set V). Therefore, the set SV containing L super nodes is obtained. 1 ,sv 2 ,...sv g ...sv h ...sv L}(g,h=1,2...L), where sv g is the g-th super node, sv h is the hth super node.
[0169] S42, obtaining a set of super node edges and a set of edge weights according to the connection relationship between the sub-nodes within the super node;
[0170] S43. Obtain an undirected graph of super nodes according to the set of super nodes, the set of super node edges, and the set of edge weights.
[0171] Specifically, the set of supernode edges and the set of edge weights are obtained according to the connection relationship between the subnodes within the supernode. g Internal child node v i With super node sv h Internal child node v j are connected to each other, then sv g and sv h There is an edge between them. If there is no edge between internal child nodes, then there is no edge between super nodes. Then we get the edge set SE of om super nodes = {se 1 ,se 2 ...se og ...se oh ...se om}(og,oh=1,2...om). Super node sv g With super node sv h The weight of the edge is sv g Internal child nodes and sv h The number of edges between internal child nodes, and then the set of edge weights SW = {sw1 ,sw 2 ...sw og ...sw oh ...sw om}(og=1,2...om). An undirected graph SG(SV,SE,SW) of super nodes is constructed by SV, SE and SW.
[0172] In one embodiment, the step S50: inputting the undirected graph into the Leiden algorithm to obtain a set of boundary pipe segments between DMAs, specifically includes the following steps:
[0173] S51, initialize a queue, add the set of super nodes in the undirected graph to the queue in random order, label each super node in the queue with a different community label, and obtain a community set, wherein the super node set is composed of water supply network nodes;
[0174] S52, taking out the first super node from the queue, obtaining a number of super nodes interconnected with the first super node according to the set of super node edges, and constructing an adjacent node set of the first super node;
[0175] S53, respectively calculating the modularity change value after the first super node moves to the community where each neighboring node in its neighboring node set is located, to obtain a modularity change set;
[0176] S54, when there is a value greater than 0 in the modularity change set, updating the community label of the first super node to the community label corresponding to the adjacent node with the largest modularity change value in the set;
[0177] S55, adding the super nodes in the adjacent node set that do not belong to the community of the first super node and are not in the queue to the back of the queue, and determining whether the queue is empty, if not, re-execute step S53, if yes, execute step S56;
[0178] S56. Based on the updated set of community labels, super nodes with the same community label are divided into the same community, and the set of super nodes in each community is used as a sub-queue;
[0179] S57: recalculate the set of subcommunity labels corresponding to each subqueue, and merge super nodes with the same subcommunity labels into a large node, to obtain the set of large nodes of all communities and the set of community labels corresponding to each large node;
[0180] S58, determining whether the second iteration number is satisfied, if not, replacing the set of super nodes in the undirected graph with the set of large nodes of all communities, and re-execute the above steps S51 to S58, if yes, executing step S59;
[0181] S59: Output the optimal set of community labels, divide the super nodes with the same community label into the same community, and obtain the set of boundary segments between DMAs.
[0182] In this embodiment, the undirected graph SG of super nodes is input into the Leiden algorithm, and each node in the super node set SV is merged into K communities. Since SV is composed of nodes in V, the corresponding node set V of the water supply network is divided into K communities, and the corresponding water supply network will obtain K DMA areas and the set of boundary pipe sections between DMAs B = (b 1 ,b 2 ,...b Nec )(Nec: total number of boundary segments between DMAs, b: boundary segment index).
[0183] Specifically, Figure 4 As shown, the detailed implementation steps of the Leiden algorithm are as follows:
[0184] a2) Initialize the resolution parameter γ of the Leiden algorithm, the random number seed seed2, and the second iteration number LJ.
[0185] b2) Initialize a queue Queue, add the set SV of super nodes in the undirected graph SG to the queue in random order, and get the queue Queue = [queue 1 ,queue 2 ...queue L ], one element in the queue corresponds to one super node. Label each super node in the queue with a different community label to obtain the community set Label = {label 1 ,label 2 ...label L}, super nodes with the same community label are divided into the same community.
[0186] c2) Modularity optimization phase, take out the first super node queue from the front of the queue 1 , according to the set SE of super node edges, we get nl and queue 1 The set of interconnected super nodes (adjacent nodes) Nque={nque 1 ,nque 2 ...nque c ...nque nl}(c=1,2...nl), calculate queue respectively 1 The modularity change value after moving to the community of the adjacent node. The modularity change formula is as follows:
[0187]
[0188] Where: e 1 c For queue 1 Its adjacent node nque c The sum of the edge weights of all super nodes in the community, k 1 For queue 1 The weights of the edges connecting to other communities, K c Yes c The weight of the edge connecting the community to other communities and the sum of the weights of all edges within the community, and m is the sum of the weights of all edges of all super nodes.
[0189] Then get the queue 1 The modularity change set of the community moving to the adjacent node ΔQ = {ΔQ 1 ,ΔQ 2 ...ΔQ c ...ΔQ nl}(c=1,2...nl). If the values of ΔQ are all less than or equal to 0, the queue will not be changed. 1 Community label label 1 ; If there is a value greater than 0 in ΔQ, select the adjacent node nque corresponding to the largest ΔQ max Community label label max , queue 1 Community label label 1 Change to label max (i.e. queue 1 with nque max divided into the same community).
[0190] d2) queue 1 The adjacent node set Nque does not belong to queue 1 The super nodes that are not in the community of the queue are added to the back of the queue. Determine whether the queue is empty. If it is not empty, jump to c2); if it is empty, jump to e2).
[0191] e2) Get the updated community label set Label = {label 1 ,label 2 ...label L}, divide the super nodes with the same community label into the same community, and get the set of LK communities community1 = {com1 1 ,com1 2 ...com1 LK}.
[0192] f2) In the improvement phase, the supernode set in each community is taken as a subqueue, and a total of LK subqueues are obtained. Operations b, c, and d are repeated for each LK subqueue to obtain a set of LK subcommunity labels (i.e., each community is divided into multiple subcommunities). That is, each supernode corresponds to a community label and a subcommunity label, and supernodes with the same subcommunity labels also have the same community labels.
[0193] g2) Aggregation stage: merge the super nodes with the same subcommunity label into a large node (that is, each community has multiple large nodes, and each large node is composed of multiple super nodes), and obtain the set of NM large nodes of all communities BV = {bv 1 ,bv 2 ...bv NM} and the set of community labels corresponding to each large node BLabel = {blabel 1 ,blabel 2 ...blabel NM}. Determine whether the algorithm termination condition is met: the number of iterations t1 = LJ, if not, jump to b1) replace SV with BV, Label with BLabel, t1 = t1 + 1; if satisfied, jump to h2).
[0194] h2) Get the final updated community label set Label = {label 1 ,label 2 ...label L}, the super nodes with the same community label are divided into the same community, and K communities are obtained. Since the super node set SV is composed of the water supply network node set V, each node in V is divided into K communities, and the corresponding water supply network is divided into K DMA areas, and the boundary pipe section set B between DMAs = (b 1 ,b 2 ,...b Nec )(Nec: total number of boundary segments between DMAs, b: boundary segment index).
[0195] Compared with the existing community structure algorithm, the Leiden algorithm used in this embodiment introduces the concept of local optimization, adds local optimization steps in each iteration, and performs local optimization within each community, with the purpose of reducing the occurrence of disconnected events between nodes within each DMA. By adjusting the movement process of the community, the robustness of the algorithm is improved. Therefore, it can more robustly handle small and random structures. When dealing with a larger number of DMAs, the stability and good connectivity of the modularity will be better maintained.
[0196] In summary, when dividing the nodes in the water supply network, this embodiment adopts a two-step division method combining SOM and Leiden: first, the SOM algorithm is used to perform preliminary division according to the hydraulic characteristics of each node in the water supply network to obtain a corresponding cluster set; based on the cluster set, the Leiden algorithm is used to perform further division according to the topological structure between the nodes in the water supply network to obtain the final partition result. Therefore, this embodiment can effectively solve the problem of disconnected nodes in the same DMA that may occur when the water supply network is divided into DMAs, and improve the accuracy of DMA partitioning.
[0197] In one embodiment, the step S60: using a multi-objective genetic algorithm to determine the optimal arrangement of flow meters and valves in the boundary pipe section set between DMAs to obtain the DMA partition result of the water supply network specifically includes the following steps:
[0198] S61, encoding all boundary pipe sections in the DMA partition result of the water supply pipe network in a binary encoding manner, if a flow meter is arranged in a boundary pipe section, the corresponding chromosome encoding is a binary number 1, and if a valve is arranged in the boundary pipe section, the corresponding chromosome encoding is a binary number 0;
[0199] Specifically, in order to divide the complex water supply network into several independent areas to isolate the areas and measure the flow, it is necessary to divide the boundary pipe segment set B into (b 1 ,b 2 ,...b Nec ) is arranged on the boundary pipe segment. First, the length of the code is determined according to the total number of elements Nec in the boundary pipe segment set B. Specifically, for each pipe segment, if a flow meter is arranged on a boundary pipe segment, the corresponding chromosome code is a binary number 1; conversely, if a valve is arranged on the boundary pipe segment, the corresponding chromosome code is a binary number 0. Therefore, the definition of a set of binary chromosome sequences I in the multi-objective genetic algorithm is as follows:
[0200] I=(g 1 ,g 2 ,...g Nec )
[0201] in,
[0202] S62, defining a multi-objective function, wherein the multi-objective function includes minimizing the number of installed flow meters as an objective function f1, minimizing the pressure uniformity index as an objective function f2, maximizing the dissipated power of the water supply network node as an objective function f3, and maximizing the entropy index as an objective function f4;
[0203] Specifically, the first objective function is defined as minimizing the number of flow meters, and the formula is as follows:
[0204] f1=min(Nfm )
[0205] Where: N fm g in binary chromosome sequence I i The number of 0.
[0206] The second objective function is to minimize the pressure uniformity index, which is as follows:
[0207]
[0208] Where: PU is the pressure uniformity index, N represents the number of nodes in the water supply network, H i represents the pressure at node i, h * Indicates the minimum pressure required in the network, H mean Indicates the average pressure in the network
[0209] The third objective function is to maximize the dissipated power of the water supply network nodes, so the objective function f3 of the multi-objective genetic algorithm is defined as the inverse of the point dissipated power:
[0210]
[0211] Where: p is the power dissipated by the water supply network node, γ is the specific gravity of water, r i , H i , wd i They respectively represent the elevation, pressure and water demand data of the i-th node after valves and flow meters are arranged on the boundary pipe section set of the water supply network.
[0212] The fourth objective function is to minimize the entropy index, and the formula is as follows:
[0213]
[0214] Where: is the entropy index, Q j is the total flow into node j, Q 0 is the sum of the traffic of all nodes in the network, S j is the entropy index of node j, S j The formula is as follows:
[0215]
[0216] Where: is the set of adjacent nodes of node j, q ij is the traffic from node i to node j, Q j is the total flow into node j, al ij is the number of paths from node i to node j.
[0217] S63. Under the condition of satisfying the pressure constraints of the water supply network nodes, a multi-objective genetic algorithm is used to process the multi-objective function, search for the optimal layout of valves and flow meters on the boundary pipe segment set, and determine the zoning planning result of the water supply network DMA.
[0218] Specifically, the multi-objective genetic algorithm also needs to meet the node pressure constraints:
[0219] H min ≤H i
[0220] Where: H min is the minimum service water pressure at the node, H max is the maximum allowable water pressure at the node, H i It is the pressure data of each node obtained from the hydraulic operation of the water supply network under the valve and flowmeter arrangement scheme corresponding to the current solution.
[0221] It should be noted that when arranging the boundary pipeline, this embodiment does not pre-set the number of flow meters, but takes the number of flow meters as one of the objective functions, which effectively solves the problem of manually setting the number of flow meters. At the same time, the uniformity of pipe network pressure, node dissipated power, and entropy index are set as other objective functions, and the multi-objective genetic algorithm is used to optimize the installation scheme of valves and flow meters from four perspectives: economic cost, pressure uniformity, energy criterion, and reliability. It is possible to consider and effectively balance various indicators from multiple perspectives and select the optimal solution. The resulting layout scheme is not only low-cost, but also makes the pipe network pressure more uniform and improves the reliability of the pipe network. Therefore, while reducing costs and reducing the number of boundary pipe sections, the water supply network zoning accuracy, pressure uniformity and other indicators are greatly improved.
[0222] Specifically, Figure 5 As shown, the step S63: under the condition of satisfying the pressure constraint of the water supply network node, using the multi-objective genetic algorithm to process the multi-objective function, searching for the optimal arrangement of valves and flow meters on the boundary pipe segment set, and determining the zoning planning result of the water supply network DMA, specifically includes the following steps:
[0223] S631, initialize the population, and randomly generate C binary chromosome sequences as the initial parent population;
[0224] It should be noted that the initialization of the multi-objective genetic algorithm population size C, crossover probability P cro , mutation probability P het , and set the algorithm termination condition: the maximum genetic generation number J, initialize the population, randomly generate C binary chromosome sequences I, that is, generate C individuals as the initial parent population.
[0225] S632, selecting parent individuals from the initial parent population and performing crossover and mutation to generate offspring individuals, and merging the parent individuals and offspring individuals to obtain an overall population;
[0226] S633, calculating the non-dominated ranking level of each individual in the overall population according to the multi-objective function, and adaptively standardizing the population according to reference points evenly distributed in the unit hypercube to obtain individuals to be retained, and generating a new parent population;
[0227] It should be noted that the NSGA-III algorithm will automatically generate reference points according to the target dimension (i.e., the target number of the problem). A common generation strategy is to generate reference points uniformly within the unit hypercube.
[0228] S634, determining whether the third number of iterations is satisfied, if not, recalculating the overall population, if yes, outputting an optimal individual set consisting of the corresponding n optimal individuals;
[0229] It should be noted that, it is judged whether the algorithm termination condition is satisfied: the third iteration number t2=J, if not satisfied, then return to S631; if satisfied, then jump to S635.
[0230] S635, adding the objective functions corresponding to each optimal individual by averaging the weights to obtain a total objective function, and selecting the optimal individual with the smallest total objective function value in the optimal individual set as the optimal solution;
[0231] S636. Obtain the DMA zoning planning result of the water supply network based on the optimal arrangement of flow meters and valves in the boundary pipe section set corresponding to the optimal solution.
[0232] Specifically, the output corresponds to the n optimal individual set Z = (z 1 ,z 2 ,...,z n ), the four objective functions of each individual are added together by averaging the weights to obtain F=f1+f2+f3+f4, the individual with the smallest F value in the set Z is selected as the optimal solution, and the optimal layout of the flow meters and valves in the boundary pipe section set corresponding to the solution is obtained, and finally the DMA zoning planning of the large-scale water supply network is completed.
[0233] The multi-objective genetic algorithm of this embodiment is an adaptive artificial intelligence technology, which is mainly optimized based on objective functions and computational constraints, and is very suitable for discrete and nonlinear optimization problems. Since there are many possible combinations of DMA layouts of water supply networks when selecting pipes for inserting flow meters or valves to physically partition the water supply network, this embodiment selects the optimal arrangement of flow meters and valves from the perspective of four objective functions.
[0234] The following is a specific example. Figure 6 As shown in the figure, a hypothetical town L-Town is used as the experimental research object. The pipe network consists of 782 water demand nodes, 2 water supply reservoirs, 1 water storage tank and 905 connecting pipe sections. Figure 6 The largest number of dots in the figure represent water demand nodes, and the dark gray dots ( Figure 6 There is a ) in the middle that represents a reservoir, and a light gray dot ( Figure 6 There are two in the middle) indicate water supply reservoirs, and the medium gray dots ( Figure 6 There are three dots in the figure, which represent valves. The lines between the dots represent pipes. The total water demand is 106L / s, the minimum value of the water demand node elevation is 1.8712m, the maximum value is 76.1173m, and the minimum service water pressure of the pipe network is 20m. Steps to partition the water supply network DMA:
[0235] Step 1: Import the topological relationship and pipe operation parameters of the actual water supply network into EPANET software to establish a micro-hydraulic model of the actual water supply network, where the number of water demand nodes in the water supply network is N=782 and the number of pipe sections is M=905; call the EPANET toolbox to perform hydraulic analysis to obtain the network topological structure information and operation status information, including the adjacency matrix of the water supply network, the matrix of the number of common neighbors between each node, the number of edges associated with each node, elevation, and pressure data, as follows:
[0236] The adjacency matrix of the water supply network is in the form of:
[0237]
[0238] The matrix of the number of common neighbors between each node is:
[0239]
[0240] The EPANET toolbox is called to obtain the number of edges, elevation, and pressure data associated with each node in the water supply network. The data is displayed in a table as shown in Table 1:
[0241]
[0242] Step 2: Combine the water supply network topology structure and the network node parameter data to obtain the topological similarity matrix and hydraulic similarity matrix through calculation. The specific steps are as follows:
[0243] 2-1) The common neighbor number matrix Γ and the number matrix K of the edges associated with each node are transformed into The topological similarity matrix TS of the water supply network is calculated:
[0244]
[0245] 2-2) Substitute the elevation R and pressure P through the formula The elevation difference matrix U and pressure difference matrix θ of the water supply network are calculated:
[0246]
[0247] The elevation difference matrix U and the pressure difference matrix θ are transformed into The hydraulic similarity matrix HS of the water supply network is calculated:
[0248]
[0249] Step 3, add the node adjacency matrix A, the topological similarity matrix TS, and the hydraulic similarity matrix HS to obtain the feature matrix X. Then X is zero-mean normalized and input into the SOM algorithm to divide the water supply network into 144 clusters. The corresponding nodes in the water supply network node set V are divided into 144 clusters. The specific steps are as follows:
[0250] 3-1) Add A, TS, and HS to get the feature matrix X:
[0251]
[0252] 3-2) After zero-mean normalization of each column of the feature matrix X, we get the matrix XS:
[0253]
[0254] 3-3) The input layer of the SOM algorithm has input samples in each column of XS, the number of samples is 782, and the output layer matrix size is The output layer size X=Y=12 is calculated, with a total of 144 nodes, and the position of each node in the output layer is randomly initialized.
[0255] 3-4) Initialize the output layer domain radius sigma = 0.5, the learning rate η = 0.3, the random seed seed = 0, and set the algorithm termination condition: the maximum number of iterations SJ = 8000.
[0256] 3-5) The specific process of SOM algorithm is as follows:
[0257] 3-5-1) Input the sample and use the formula Calculate the Euclidean distance between the sample and each node in the output layer. Select the node on the output layer that is closest to the sample XScol j The node with the closest Euclidean distance is the activation point (c x ,c y ), set its weight wg to 1, and for other nodes w in the output layer ti tj , using it and (c x,c y ) is calculated by the formula Get the weight matrix WG of each node:
[0258]
[0259] 3-5-2) According to formula w ti tj =w ti tj +η*wg ti tj *(XScol j -w ti tj ) Update the position of each node in the output layer node matrix W. Determine whether the input of all samples is completed. If not, jump to 3-5-1); if satisfied, jump to 3-5-3).
[0260] 3-5-3) Determine whether the algorithm termination condition is met. If not, jump to 3-5-1) and re-enter all samples into the SOM algorithm and use the formula Update η.
[0261] 3-5-4) Get the final updated output layer node matrix W and calculate the sample XScol j The Euclidean distance with each node in W, the output layer node with the minimum Euclidean distance is XScol j The labels of each sample are obtained, and the samples with the same label are merged into one cluster, and finally 144 clusters are obtained. Sample set XS = [XScol 1 ,XScol 2 …XScol 782 ] corresponds to the water supply network node set V = {v 1 ,v 2 ...v 782}, so each node in V is divided into 144 clusters Som = [s 1 ,s 2 ...s 144 ], see Figure 7 As shown in the figure, the dots are water demand nodes, and dots of the same color are in the same partition. After the SOM algorithm is calculated, the water supply network is divided into 144 partitions. As can be seen from the figure, after the SOM algorithm is calculated, the 782 nodes are effectively divided into 144 clusters, and the nodes in the clusters are interconnected and have similar hydraulic properties.
[0262] Step 4: Define the 144 clusters as super nodes, and obtain a set SV containing 144 super nodes = {sv 1 ,sv 2 ...sv 144}, according to the connection relationship between the internal child nodes of the super node (the child nodes are the nodes in the water supply official website node set V), the set of super node edges SE and the set of edge weights SW are obtained. The undirected graph SG (SV, SE, SW) of the super node is constructed by SV, SE, and SW. The specific steps are as follows:
[0263] 4-1) 144 clusters are defined as super nodes, each of which contains multiple child nodes (child nodes are nodes in the water supply network node set V), so the set SV containing L super nodes is obtained. 1 ,sv 2 ...sv 144}.
[0264] 4-2) According to the connection relationship between the sub-nodes in the super node, the set of super node edges and the set of edge weights are obtained. Then the set of edges of 229 super nodes is obtained: SE = {se 1 ,se 2 ...se 229} and the set of edge weights SW = {sw 1 ,sw 2 ...sw 229}. The undirected graph SG(SV,SE,SW) of super nodes is constructed by SV, SE, and SW.
[0265] Step 5: Input the undirected graph SG of the supernodes into the Leiden algorithm, and merge the nodes in the supernode set SV into 14 communities. Since SV is composed of V, the corresponding node set V of the water supply network is divided into 14 communities. The corresponding water supply network will have 14 DMA areas and a set of 38 boundary pipe sections between DMAs, B = (b 1 ,b 2 ,...b 38 )The specific steps are as follows:
[0266] 5-1) Initialize the resolution parameter γ of the Leiden algorithm to 0.046, the random number seed seed to 51, and the algorithm termination condition: the maximum number of iterations LJ to 3, and the modularity of the entire undirected graph no longer changes.
[0267] 5-2) The specific process of Leiden algorithm is as follows:
[0268] 5-2-1) Initialize a queue, add the set SV of super nodes in the undirected graph SG to the queue in random order, and get the queue Queue = [queue 1 ,queue 2 ...queue 144], one element in the queue corresponds to one super node. Label each super node in the queue with a different community label to obtain the community set Label = {label 1 ,label 2 ...label 144}, super nodes with the same community label are divided into the same community.
[0269] 5-2-2) During the modularity optimization phase, delete the first super node queue from the front of the queue 1 , according to the formula Calculate queues separately 1 The modularity change value after moving to the community of the adjacent node. Then we get the queue 1 The modularity change set of the community moving to the adjacent node ΔQ = {ΔQ 1 ,ΔQ 2 ...ΔQ c ...ΔQ nl}(c=1,2...nl). 1 Community label label 1 Change to the adjacent node nque corresponding to the maximum ΔQ max Community label label max .
[0270] 5-2-3) Queue 1 The adjacent node set Nque does not belong to queue 1 The supernodes that are not in the community of the queue and are not in the queue are added to the back of the queue. Determine whether the queue is empty. If not, jump to 5-2-2); if empty, jump to 5-2-4).
[0271] 5-2-4) Get the updated community label set Label = {label 1 ,label 2 ...label 144}, divide the super nodes with the same community label into the same community, and get the set of LK communities community1 = {com1 1 ,com1 2 ...com1 LK}.
[0272] 5-2-5) Improvement stage, each super node set in each community is taken as a sub-queue, and a total of LK sub-queues are obtained. Repeat 5-2-2) and 5-2-3) for the LK sub-queues until the queue is empty; each sub-queue will get a set of sub-community labels, and a total of LK sub-community label sets (that is, each community is divided into multiple sub-communities).
[0273] 5-2-6) Aggregation stage: merge the super nodes with the same subcommunity label into a large node, and obtain a set of NM large nodes BV = {bv 1 ,bv 2 ...bv NM} and the set of community labels corresponding to each large node BLabel = {blabel 1 ,blabel 2 ...blabel NM}. Determine whether the algorithm termination condition is met. If not, jump to 5-2-1) Replace SV with BV and Label with BLabel; if satisfied, jump to 5-2-7).
[0274] 5-2-7) Get the final updated community label set Label = {label 1 ,label 2 ...label 144}, the super nodes with the same community label are divided into the same community, resulting in 14 communities. Therefore, each node in V is divided into 14 communities, and the corresponding water supply network is divided into 14 DMA areas, and the boundary pipe segment set B between DMAs = (b 1 ,b 2 ,...b 38 For details, please refer to Figure 8 As shown in the figure. The dots of the same color are divided into a community, and the dots of different colors are in different community locations. As can be seen from the figure, in the final partition determined by the Leiden algorithm, all nodes in each DMA are connected, there are no unconnected nodes inside, and the size of the divided area is uniform.
[0275] Step 6: Encode all boundary pipe sections of the water supply network in binary coding, with the objective function f1 being to minimize the number of installed flow meters, the objective function f2 being to minimize the pressure uniformity index, the objective function f3 being to maximize the dissipated power of the water supply network nodes, and the objective function f4 being to minimize the entropy index. Under the condition of satisfying the pressure constraints of the water supply network nodes, a multi-objective genetic algorithm is used to search for the optimal arrangement of valves and flow meters on the boundary pipe section set B, and finally complete the zoning planning of the large water supply network DMA. The specific steps are as follows:
[0276] 6-1) In the boundary segment set B = (b 1 ,b 2 ,...b 38 ) are arranged with valves or flowmeters, corresponding to binary codes 0 and 1 respectively. First, the length of the code is determined to be 38 according to the total number of elements in the boundary pipe segment set B, so a set of binary chromosome sequences I = (g 1 ,g 2 ,...g 38 ).
[0277] 6-2) Define the objective function, and define the minimization of the number of flow meters as the first objective function. The formula is as follows:
[0278] f1=min(N fm )
[0279] The second objective function is to minimize the pressure uniformity index, which is as follows:
[0280]
[0281] The third objective function is to maximize the dissipated power of the water supply network nodes, so the objective function f3 of the multi-objective genetic algorithm is defined as the inverse of the point dissipated power:
[0282]
[0283] The fourth objective function is to minimize the entropy index, and the formula is as follows:
[0284]
[0285] 6-3) Initialize the multi-objective genetic algorithm population size C = 50, crossover probability P cro =0.9, mutation probability P het =0.2, and set the algorithm termination condition: the maximum genetic generation J = 50. At the same time, the optimal solution output by the multi-objective genetic algorithm also needs to meet the node pressure constraint condition H i ≥H min =3.49m:
[0286] 6-4) The optimization process of flow meter and valve layout is as follows:
[0287] 6-4-1) Initialize the population and randomly generate C = 50 binary chromosome sequences as the initial parent population;
[0288] 6-4-2) Combine the parent individuals and the offspring individuals to obtain a new overall population.
[0289] 6-4-3) Calculate the four objective functions f1, f2, f3, and f4 of the total population C = 50 individuals in turn. Calculate the non-dominated ranking according to the values of the four objective functions of the individuals in the total population. And obtain the individuals that need to be retained.
[0290] 6-4-4) Determine whether the algorithm termination condition is met. If not, jump to 6-4-3); if satisfied, jump to 6-4-5).
[0291] 6-4-5) Output the corresponding 35 optimal individual sets Z = (z 1 ,z 2 ,...,z 35 ), add the four objective functions of each individual by averaging the weights to get F = f1 + f2 + f3 + f4, select the individual with the smallest F value in the set Z as the optimal solution, and get the optimal layout of the flow meter and valve in the boundary pipe section set corresponding to the solution, and finally complete the DMA zoning planning of the large water supply network. Please refer to Fig. 9 The final large-scale water supply network DMA layout is shown, where each color represents a DMA area, which is divided into 14 DMA areas, with a total of 38 boundary pipes, 13 boundary pipes with flow meters installed, and 25 boundary pipes with valves installed. Compared with the existing technology, the final partitioning result has a higher modularity and the node pressure within the same DMA is more uniform.
[0292] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0293] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0294] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for dividing independent metering areas of a water supply network. It is characterized in that The method comprises: Acquiring water supply network operation data, wherein the water supply network operation data includes topological structure, node water demand, elevation and pressure parameters; Constructing a feature matrix based on the water supply network operation data; Inputting the feature matrix into a self-organizing map neural network to obtain a cluster set; Based on the cluster set, generating an undirected graph of super nodes; Inputting the undirected graph into Leiden algorithm to obtain a set of boundary pipe segments between DMAs; The multi-objective genetic algorithm is used to determine the optimal layout of flow meters and valves in the boundary pipe sections between DMAs, and the DMA partition results of the water supply network are obtained. The undirected graph is input into the Leiden algorithm to obtain a set of boundary pipe segments between DMAs, including: Initialize a queue, add the set of super nodes in the undirected graph to the queue in a random order, label each super node in the queue with a different community label, and obtain a set of communities, wherein the super node set consists of water supply network nodes; Take out the first super node from the queue, obtain several super nodes connected to the first super node according to the set of super node edges, and construct the adjacent node set of the first super node; Calculate the modularity change value after the first super node moves to the community where each neighboring node in its neighboring node set is located, and obtain the modularity change set; When there is a value greater than 0 in the modularity change set, the community label of the first super node is updated to the community label corresponding to the adjacent node with the largest modularity change value in the set; Add the super nodes in the adjacent node set that do not belong to the community of the first super node and are not in the queue to the back of the queue, and determine whether the queue is empty. If not, recalculate the modularity change set; If yes, then based on the updated set of community tags, the super nodes with the same community tag are divided into the same community, and the set of super nodes in each community is used as a sub-queue; Recalculate the set of subcommunity labels corresponding to each subqueue, and merge super nodes with the same subcommunity labels into a large node, to obtain the set of large nodes in all communities and the set of community labels corresponding to each large node; Determine whether the second iteration number is met, if not, replace the set of super nodes in the undirected graph with the set of large nodes of all communities, and re-execute the above steps; If so, the optimal set of community labels is output, and the super nodes with the same community label are divided into the same community to obtain the set of boundary segments between DMAs.
2. The method for dividing the water supply network into independent metering areas according to claim 1, It is characterized in that The obtaining of water supply network operation data includes: Importing the topological relationship of the water supply network and the operating parameters of the pipe fittings into EPANET software to establish a micro-hydraulic model of the water supply network; The EPANET toolbox is called to perform hydraulic analysis on the micro-hydraulic model of the water supply network to obtain the topological structure, node water demand, node elevation and pressure parameters of the water supply network.
3. The method for dividing the water supply network into independent metering areas according to claim 1, It is characterized in that The constructing of a characteristic matrix based on the water supply network operation data comprises: According to the topological structure of the water supply network, construct an adjacency matrix and a matrix of the number of common neighbors between nodes; Calculating a topological similarity matrix based on the number of common neighbors between the nodes and the number of edges associated with each node; Using node elevation and pressure parameters, a hydraulic similarity matrix is constructed; The adjacency matrix, the topological similarity matrix and the hydraulic similarity matrix are added together to obtain the feature matrix.
4. The method for dividing the water supply network into independent metering areas according to claim 1, It is characterized in that Using node elevation and pressure parameters, a hydraulic similarity matrix is constructed, including: According to the node elevations, the elevation differences between the nodes are calculated to obtain an elevation difference matrix; Based on the pressure parameter, the pressure difference between each node is calculated to obtain a pressure difference matrix; Based on the elevation difference matrix and the pressure difference matrix, the hydraulic similarity between the nodes is calculated to obtain a hydraulic similarity matrix.
5. The method for dividing the water supply network into independent metering areas according to claim 1, It is characterized in that After constructing the characteristic matrix based on the water supply network operation data, the method further includes: Performing zero-mean normalization on the feature matrix to obtain a normalized feature matrix; Accordingly, the step of inputting the feature matrix into a self-organizing map neural network to obtain a cluster set further includes: The standardized feature matrix is input into a self-organizing map neural network to obtain a cluster set.
6. The method for dividing the water supply network into independent metering areas according to claim 1, It is characterized in that The feature matrix is input into a self-organizing map neural network to obtain a cluster set, including: All input samples divided by the feature matrix are used as inputs of the self-organizing map neural network, and for each input sample, the Euclidean distance between the input sample and each node of the output layer is calculated respectively; The node on the output layer with the smallest Euclidean distance to the input sample is selected as the activation point, and the weight of the activation point is set to 1. For other nodes on the output layer except the activation point, the weights of other nodes are calculated using the Gaussian method according to the distance between other nodes and the activation point; Based on the weights of the activation points and the weights of other nodes, a weight matrix of each node on the output layer is constructed; According to the weight matrix of each node on the output layer, the node matrix of the output layer is updated; Determine whether the first iteration number is satisfied, if not, increment the iteration number by 1, and re-input all input samples into the self-organizing map neural network; If so, the Euclidean distance between the input sample and each node in the updated output layer node matrix is calculated, and the output layer node with the minimum Euclidean distance is taken as the label of the input sample, and the input samples with the same label are merged into one cluster to obtain several cluster sets.
7. The method for dividing the water supply network into independent metering areas according to claim 1, It is characterized in that The step of generating an undirected graph of super nodes based on the cluster set includes: Based on each of the cluster sets being defined as a super node, a set of super nodes is obtained, wherein the child nodes in the super nodes represent nodes in the water supply network node set; According to the connection relationship between the sub-nodes inside the super node, a set of super node edges and a set of edge weights are obtained; According to the set of super nodes, the set of super node edges and the set of edge weights, an undirected graph of super nodes is obtained.
8. The method for dividing the water supply network into independent metering areas according to claim 1, It is characterized in that The method of using a multi-objective genetic algorithm to determine the optimal arrangement of flow meters and valves in the boundary pipe section set between DMAs, and obtaining the DMA partition result of the water supply network, includes: All the boundary pipe sections in the DMA partition result of the water supply network are encoded in a binary encoding manner. If a flow meter is arranged in a boundary pipe section, the corresponding chromosome encoding is a binary number 1, and if a valve is arranged in the boundary pipe section, the corresponding chromosome encoding is a binary number 0; Define a multi-objective function, wherein the multi-objective function includes minimizing the number of installed flow meters as an objective function f1, minimizing the pressure uniformity index as an objective function f2, maximizing the power dissipation of the water supply network node as an objective function f3, and maximizing the entropy index as an objective function f4; Under the condition of satisfying the pressure constraints of the water supply network nodes, a multi-objective genetic algorithm is used to process the multi-objective function, search for the optimal layout of valves and flow meters on the boundary pipe section set, and determine the zoning planning result of the water supply network DMA.
9. The method for dividing the water supply network into independent metering areas according to claim 8, It is characterized in that Under the condition of satisfying the water supply network node pressure constraint, the multi-objective genetic algorithm is used to process the multi-objective function, search for the optimal arrangement of valves and flow meters on the boundary pipe section set, and determine the zoning planning result of the water supply network DMA, including: Initialize the population and generate randomly C The binary chromosome sequences are used as the initial parent population; Selecting parent individuals from the initial parent population and performing crossover and mutation to generate offspring individuals, and merging the parent individuals and offspring individuals to obtain an overall population; Calculating the non-dominated ranking level of each individual in the overall population according to the multi-objective function, and adaptively standardizing the population according to a predefined reference point to obtain the individuals to be retained, thereby generating a new parent population; Determine whether the third iteration number is met, if not, recalculate the overall population, if yes, output the optimal individual set consisting of the corresponding n optimal individuals; The objective functions corresponding to each optimal individual are added together by averaging the weights to obtain the total objective function, and the optimal individual with the smallest total objective function value in the optimal individual set is selected as the optimal solution; Based on the optimal arrangement of flow meters and valves in the boundary pipe section set corresponding to the optimal solution, a DMA zoning planning result of the water supply network is obtained.
