# Artificial Intelligence and Internet of Things-Based Leak Detection Method for the Water Supply Network

Authors: Lianxiu Li; Huifan Chen
Journal: International Transactions on Electrical Energy Systems
 (2023)

---

## Abstract

The good management and safe operation of the urban water supply network are of great significance to residents’ lives and industrial production. In view of the difficulties in supervision and leakage location of the urban water supply network, based on the technology of Internet of things and artificial intelligence algorithm, a leakage detection method of the urban water supply network is proposed. First of all, low-power, low-cost terminal detection equipment and gateway monitoring equipment are developed for remote data transmission through WiFi or cellular data networks. The data organization, storage, release and control are realized by using the data center software platform. Second, the leakage location model of the water supply network is established by using remote pressure monitoring data, and the accurate location of pipe network leakage is realized. Based on ALO and PSO optimization algorithms, the water supply network in an industrial area of a city in China is solved. Finally, the performance of the two optimization algorithms is compared and analyzed. The results show that the designed intelligent monitoring system of the water supply network can monitor the pipe network well. In addition, on the problem of leakage detection, the ALO algorithm is superior to the PSO algorithm in terms of optimization ability and search efficiency. The leakage monitoring method of water supply networks proposed in this study can provide a reference for the design and management of urban water supply networks.


---

## Body

## 1. Introduction

Leakage has always been a global problem faced by the water supply network, which not only wastes a lot of water resources but also affects the water quality of the pipe network and erodes the surrounding foundation. This will cause structural damage to roads and other public facilities. The scale of the water supply network in China is large, and the pressure of pipeline water supply is high, so it is difficult to monitor and manage. Part of the pipeline service time is long, there is serious aging, pipe quality is intermingled, and maintenance is not in place [1]. A variety of factors have led to serious leakage in China’s water supply network, with an average leakage rate of more than 15%, and the average leakage rate of the public water supply system has reached 21.5%, which does not exceed the national standard of 12% [2]. Take Shenzhen as an example: the average leakage rate of the water supply network in Shenzhen is about 13%, and the total amount of water supply in the city in 2014 was about 2 billion tons. Step-by-step water prices are implemented throughout the city. Calculated at an average price of 3¥ per ton of water, in 2014 alone, the leakage problem brought a direct economic loss of 780 million yuan to Shenzhen water supply enterprises [3].In contrast, developed countries have adopted more advanced leakage monitoring and control technology and put into use new types of pipes, making the leakage of pipe network has been effectively improved. According to the survey, the leakage rate of the water supply network in the United Kingdom is within 7%, and the United States and Japan are basically controlled within 8%. Compared with developed countries, China’s pipe network leakage control still has a large room for improvement. In recent years, China has gradually increased its attention and investment in underground pipeline networks [4].Some developed cities in China, such as Shanghai, Beijing, and Tianjin, have successively carried out the construction of SCADA systems for their water supply networks and put them into operation. However, the following problems are commonly found in various SCADA programs: First, the system cost is high. Monitoring points are commonly used with PLC (programmable logic controller) and RTU (remote terminal unit) equipment [5]. The hardware cost of a single monitoring point alone can be as high as five thousand dollars or more, and there is no cost of control cabinets and integrated wiring. The high cost of equipment, maintenance and installation, power supply, and wiring requirements make the system not convenient for large-scale monitoring of the pipe network system. It is usually limited to key areas such as water plants and pumping stations. And the limited monitoring cannot be informed of the full operational status of the pipe network. Second, the SCADA system is to control the main monitoring as a supplement [6]. For the pipe network system, except for water plants, pump stations, valve rooms, and other areas of the vast majority of areas only need to carry out monitoring tasks through real-time monitoring data to understand the operating status of the pipe network. Therefore, the SCADA system has functional redundancy and cannot be used for monitoring the pipe network.Meanwhile, the commercial pipeline network monitoring equipment currently on the market is usually a cut-down version of the SCADA system’s functionality. Each monitoring node relies on an RTU for remote data transmission. The monitoring points are completely independent from each other. Such a stand-alone architecture fails to utilize hardware resources intensively, resulting in a high cost of monitoring node equipment. Even if there are conditions for large-scale deployment of monitoring, because the monitoring nodes are independent of each other, it is not easy to ensure clock synchronization between the measurement points and to carry out unified settings and management. Zhejiang led to maintenance, management costs that are extremely high [7]. At the same time, remote transmission means high power consumption, in the sampling frequency of high occasions (such as real-time monitoring of water pressure in the pipe network), cannot use the battery to achieve long-term power supply. This will lead to additional power supply wiring costs or the cost of retrofitting other power supply equipment, which does not facilitate the flexible deployment of monitoring points. In addition, the current monitoring equipment is usually for a single monitoring application. Its scalability is poor; the monitoring frequency is more limited, unable to carry out high-frequency monitoring applications. The supporting software platform also lacks intelligence.In addition to the daily monitoring of the water supply network, rapid and accurate location of the incident and repair of the fault in case of leakage or burst pipe is also an important aspect to ensure the stability of water supply [8]. With the gradual popularization of water supply network monitoring, a huge amount of data is bound to be generated. A large amount of data is sometimes not reasonably utilized, causing a large amount of data information to lose its meaning. Therefore, it is crucial to dig deeper and use monitoring data effectively [9]. Data mining technology, as a new electronic information technology in the current era, has been widely used in various industries. The use of data mining technology to locate the leakage or burst pipe network is essential to stop the damage and ensure the stability of water supply.Based on the technology of the Internet of Things (IoT), many researchers have studied the important and difficult problems existing in urban water supply networks. Perez-Padillo et al. [10] have developed a set of intelligent pressure monitoring and alarm systems for water supply networks by using open source software and low-cost hardware. When the system detects the abnormal pressure in the pipe network, it will send an alarm by email in real time. In addition, the study also applied the system to the actual water supply network in Spain and achieved good results. Based on ultrasonic sensors and IoT devices, Drage and Kennedy [11] uploaded groundwater level data through WiFi and cellular connections and realized real-time monitoring of groundwater levels based on community input. By comparing the monitoring data with the drop measurement data, it is found that the absolute error of the two results is small. Friha et al. [12] reviewed the application of IoT technology in intelligent agriculture. First of all, they describe the application of UAV, wireless transmission technology, network function virtualization technology, software-defined network, open source IoT platform, and cloud computing platform in intelligent agriculture. Second, they classified the application of the IoT in intelligent agriculture. Finally, they discussed the future development direction of the IoT in agriculture. Selim et al. [13] analyzed and studied the network physical anomalies of the infrastructure of the IoT. This study classifies the abnormal events of the IoT in the water supply network based on the machine learning algorithm. Based on the training results, the accuracy of the algorithm for identifying various abnormal events, including hardware failures, network attacks, and equipment damage, is studied and tested. Simmhan et al. [14] proposed a service-oriented software architecture. The software architecture is mainly used to solve the management problems of intelligent public utilities such as urban water supply networks. Mishra et al. [15] based on the IoT technology and low-cost water meters, through the way of servers and databases, used research methods to identify household water use. By reducing the use of unrelated physical sensors, the purpose of reducing the construction cost of the IoT in the water supply network is achieved.The domestic research on intelligent monitoring of pipe networks is relatively few, and the related research is mainly focused on the SCADA project construction carried out by water supply enterprises. However, the research in this area is limited to the integration and application of commercial equipment, and the research depth is shallow. And the cost of the SCADA system is high, and the monitoring scope is limited, so the traditional way of manual on-site measurement, which is poor in real-time and has low efficiency, is still used for the main monitoring of the pipe network. Some scholars have carried out the development and research of the monitoring system for the pipe network; basically using a single GPRS to build the monitoring network, the monitoring points are independent and not suitable for large-scale deployment.With the gradual maturity of artificial intelligence algorithms, more and more attention has been paid to the prediction and location of leakage and burst accidents and water peak prediction of water supply networks based on machine learning or deep learning. Xu et al. [16] used the LSTM deep learning model to predict the highly complex nonlinear state of the water supply network based on the measured point pressure, water supply pressure, and flow rate. The prediction results show that the prediction accuracy of the LSTM model is better than that of traditional machine learning. Xu et al. [17] predicted the daily water demand of Zhuzhou city through the continuous depth confidence neural network model. On the basis of the prediction results, the prediction performance of the model is evaluated by the average absolute percentage error, normalized root mean square error, and correlation coefficient. By combining knowledge learning and deep reinforcement learning, Xu et al. [5] proposed a knowledge-aided near-end decision-making optimization algorithm and studied the pump scheduling optimization problem of an urban water supply network using this algorithm. Cody et al. [18] used a semisupervised learning algorithm to identify the leakage of an urban water distribution network through acoustic monitoring data. The results show that the algorithm proposed in the study has a high degree of identification for leakage in the water supply network. Li et al. [19] proposed a leakage location algorithm for a water supply network based on residual networks. The algorithm is based on the positioning idea of parallel classification and regression process. Through model training, the location accuracy of leakage can reach 0.91. Xu et al. [5] developed a continuous depth confidence echo state network model and successfully predicted the hourly water demand of the city through training.Our predecessors have made an in-depth study on the prediction of water demand and leakage identification of the water supply network by using artificial intelligence. However, for the water supply network, it is very important to find the leakage in time, estimate the amount of leakage, and locate it accurately. In terms of these difficult problems, previous studies are still insufficient.In view of the difficulties in supervision and leakage location of urban water supply networks, based on the technology of IoT and artificial intelligence algorithm, a leakage detection method for urban water supply networks is proposed. First, based on wireless ad hoc network technology, a research and development technology for terminal monitoring equipment and gateway monitoring equipment with low power consumption and low cost is proposed. This technology can carry out remote data transmission through WiFi or a cellular network. The data organization, storage, release, and control are realized by using the data center software platform. Second, the leakage location model of the water supply network is established by using remote pressure monitoring data, and the accurate location of pipe network leakage is realized. Based on the ant lion optimization algorithm (ALO) and particle swarm optimization algorithm (PSO) optimization algorithms, the water supply network in an industrial area of a city in China is solved. Finally, the performance of the two optimization algorithms is compared and analyzed.


## 2. Design of an IoT System for the Water Supply Network

### 2.1. System Organization Design

The organization and design of a wireless sensor network monitoring system for the water supply network is based on the current characteristics and monitoring requirements of the water supply network. Due to the large-scale, heavy monitoring task, long monitoring period, and typical linear assets of the water supply network system, the monitoring system should meet the following objectives:(1)
The low-cost measurement method should be adopted, and the hydraulic parameters should be monitored by pressure monitoring with convenient installation and maintenance and high precision instead of high-cost flow monitoring.(2)
Wireless data transmission should be used to avoid long-distance wiring and high installation flexibility. With the development and popularization of 5 G technology, the data loss rate of long-distance wireless signal transmission is very low. Moreover, since water pressure monitoring is a continuous process, accidental data loss will not have much impact.(3)
The monitoring equipment meets the requirements of low power consumption in order to use batteries for long-term power supply. In addition, for the pressure monitoring device, it should be waterproof to prevent damage to the equipment caused by long-term water impact.(4)
The hardware cost of monitoring equipment is low enough to meet the needs of a large number of monitoring sites(5)
A multilevel network monitoring scheme should be adopted to meet the present situation of a large scale of pipe network(6)
The data center software has a strong ability to organize basic data.For the above goals, the system organization includes low-power terminal equipment, which is responsible for data acquisition. Gateway equipment is responsible for data acquisition, protocol conversion, and remote data transmission. The multistage wireless transmission network unit is responsible for the data communication of the short-range ad hoc network, and the nodes work together. Remote communication unit is responsible for GPRS network registration and data center TCP connection. Among them, GPRS is a general wireless packet service, which is a wireless packet switching technology based on the GSM system which provides an end-to-end, wide-area wireless IP connection. TCP is a connection-oriented, reliable transport layer communication protocol based on a byte stream. Data center software platform is responsible for computer interaction, data storage, report generation, and so on. Each organizational unit is the key link of the system organization, which is functionally independent but intersects each other at the technical level to build a perfect system organizational structure.


### 2.2. System Architecture Design

The wireless sensor network monitoring system of the water supply network adopts the standard three-level structure of the IoT, namely, the perception layer, the network layer, and the application layer. The reason for choosing the standard three-layer structure of the Internet of Things is that the network structure can meet the networking requirements, and the equipment is easy to obtain and connect with each other. The perception layer is responsible for the perception and collection of pipe network parameters, including related sensors and data acquisition terminal equipment. The network layer is responsible for data transmission and is the link between the application layer and the perception layer. It mainly includes terminal equipment, gateway equipment, data center server, and routing organization algorithm. The application layer is responsible for the specific applications of water supply network monitoring, including data center application software and related application schemes. The architecture and operation diagram of the system are shown in Figure1. The terminal equipment carries the sensor to collect the pipe network data. A self-organizing network is established through short-distance and low-power wireless communication technology. The collected data are transmitted step-by-step to the gateway equipment by multihop relay. Mobile multihop relay (MMR) is a concept that relays user data and possible control information through one or more relay stations between a MMR base station and an IEEE standard 802.16. The licensed spectrum is used for relay. Authorized trunks are used to enhance coverage, range, and throughput, as well as the possible capacity of an MMR-BS, and to enable devices with very little energy to share in the network. Because the network is dynamic, the dotted path in the figure only represents a possible transmission path, not a fixed transmission path. The gateway device aggregates the uploaded data of all subordinate subdevices, converts the protocols of the two networks, and establishes a remote connection with the data center through the GPRS network. The control command issued by the data center can be realized through the reverse path.Figure 1
Schematic diagram of system architecture and operation.


### 2.3. Technical Design: Wireless Ad Hoc Network Strategy

The networked monitoring system is adapted to scale monitoring applications, and the wireless monitoring system for a water supply network uses the proximity, low power consumption, and high reliability ZigBee technology to build a self-organizing network at the sensing layer. ZigBee is a wireless network protocol with low speed and short-distance transmission. The bottom layer is the media access layer and physical layer based on the IEEE802.15.4 standard. The main features are low speed, low power consumption, low cost, support for a large number of network nodes, support for a variety of network topologies, low complexity, fast, reliable, and secure. A corresponding self-organizing network strategy design is carried out for this purpose. The monitoring devices in this monitoring system are divided into two categories, coordinators and subnodes, according to the network roles. The coordinator is responsible for the formation of the whole network, and only a unique coordinator exists for each network. It is embedded in the gateway device. The subnodes are hierarchically represented according to the depth of the network they are in. The first-level subnode is directly connected to the coordinator, and the second-level subnode is directly connected to the first-level subnode.First, the coordinator initializes and sends a beacon request to scan its surroundings for beacons to determine that it is the only coordinator in the network. Then, it turns on the beacon broadcast timer and continuously broadcasts its own beacons. Channel selection is based on the result of the energy detection ranking of the channel. Preference is given to channels with lower energy levels where there are no ZigBee devices or fewer ZigBee devices. After determining the channel, the coordinator will perform the setting of the network identifier for network segmentation. After that, it sets a 16-bit address for itself within the network, which is the network address. This address is used as a unique identifier for the devices in the self-assembled network. At this point, the coordinator completes the preparation of the network’s formation.After the first-level subnode completes its startup initialization, it starts to send beacon requests cyclically, scanning the surrounding coordinators. When a coordinator’s beacon is detected, it sends an association request to the coordinator. After receiving the association request from a subnode, the coordinator will determine whether to allow the subnode to join the network according to its resource allocation. If the resources of the subnode are not fully occupied, it sends an association response to the subnode and saves the information of the association response. After receiving the association response, the first-level subnode extracts the association information and saves it to the association table. This includes the information of the parent node and the assigned network address and sends a reply to the coordinator, thus successfully joining the network and broadcasting the beacon to the outside world as a node in the network. Subnodes at lower levels join the network gradually with a similar strategy. The subnodes scan the beacons of the joinable parents and save the information of each “prospective parent” into their own association table to determine the final join parent based on the link quality with them. The link quality information exists in the feedback data of the physical layer, and the hardware itself supports link quality monitoring. The connections with good link quality will be selected as the final connections, so that the network can be spontaneously formed.In addition, each node is identified by a 64-bit IEEE address at the beginning of the network formation, and to save communication resources, the coordinator assigns 16-bit network addresses to each subnode with the following algorithm:Let the network hierarchy be denoted byd, its maximum hierarchy is dm, and the maximum number of subnodes accommodated in each subnode hierarchy be Nm (Nm > 1). Then, the network address interval of each subnode in the same hierarchy in the network is as follows:(1)NSkipd=1−Nmdm−d1−Nm.Then, the first child network address of the parent node with hierarchyd is as follows:(2)Parentnodenetworkaddress+1.The network address of the second subnode is as follows:(3)Parentnodenetworkaddress+1+Nskipd.The network address of the third subnode is as follows:(4)Parentnodenetworkaddress+1+2×Nskipd,and so on can calculate the network address of all nodes.


## 2.1. System Organization Design

The organization and design of a wireless sensor network monitoring system for the water supply network is based on the current characteristics and monitoring requirements of the water supply network. Due to the large-scale, heavy monitoring task, long monitoring period, and typical linear assets of the water supply network system, the monitoring system should meet the following objectives:(1)
The low-cost measurement method should be adopted, and the hydraulic parameters should be monitored by pressure monitoring with convenient installation and maintenance and high precision instead of high-cost flow monitoring.(2)
Wireless data transmission should be used to avoid long-distance wiring and high installation flexibility. With the development and popularization of 5 G technology, the data loss rate of long-distance wireless signal transmission is very low. Moreover, since water pressure monitoring is a continuous process, accidental data loss will not have much impact.(3)
The monitoring equipment meets the requirements of low power consumption in order to use batteries for long-term power supply. In addition, for the pressure monitoring device, it should be waterproof to prevent damage to the equipment caused by long-term water impact.(4)
The hardware cost of monitoring equipment is low enough to meet the needs of a large number of monitoring sites(5)
A multilevel network monitoring scheme should be adopted to meet the present situation of a large scale of pipe network(6)
The data center software has a strong ability to organize basic data.For the above goals, the system organization includes low-power terminal equipment, which is responsible for data acquisition. Gateway equipment is responsible for data acquisition, protocol conversion, and remote data transmission. The multistage wireless transmission network unit is responsible for the data communication of the short-range ad hoc network, and the nodes work together. Remote communication unit is responsible for GPRS network registration and data center TCP connection. Among them, GPRS is a general wireless packet service, which is a wireless packet switching technology based on the GSM system which provides an end-to-end, wide-area wireless IP connection. TCP is a connection-oriented, reliable transport layer communication protocol based on a byte stream. Data center software platform is responsible for computer interaction, data storage, report generation, and so on. Each organizational unit is the key link of the system organization, which is functionally independent but intersects each other at the technical level to build a perfect system organizational structure.


## 2.2. System Architecture Design

The wireless sensor network monitoring system of the water supply network adopts the standard three-level structure of the IoT, namely, the perception layer, the network layer, and the application layer. The reason for choosing the standard three-layer structure of the Internet of Things is that the network structure can meet the networking requirements, and the equipment is easy to obtain and connect with each other. The perception layer is responsible for the perception and collection of pipe network parameters, including related sensors and data acquisition terminal equipment. The network layer is responsible for data transmission and is the link between the application layer and the perception layer. It mainly includes terminal equipment, gateway equipment, data center server, and routing organization algorithm. The application layer is responsible for the specific applications of water supply network monitoring, including data center application software and related application schemes. The architecture and operation diagram of the system are shown in Figure1. The terminal equipment carries the sensor to collect the pipe network data. A self-organizing network is established through short-distance and low-power wireless communication technology. The collected data are transmitted step-by-step to the gateway equipment by multihop relay. Mobile multihop relay (MMR) is a concept that relays user data and possible control information through one or more relay stations between a MMR base station and an IEEE standard 802.16. The licensed spectrum is used for relay. Authorized trunks are used to enhance coverage, range, and throughput, as well as the possible capacity of an MMR-BS, and to enable devices with very little energy to share in the network. Because the network is dynamic, the dotted path in the figure only represents a possible transmission path, not a fixed transmission path. The gateway device aggregates the uploaded data of all subordinate subdevices, converts the protocols of the two networks, and establishes a remote connection with the data center through the GPRS network. The control command issued by the data center can be realized through the reverse path.Figure 1
Schematic diagram of system architecture and operation.


## 2.3. Technical Design: Wireless Ad Hoc Network Strategy

The networked monitoring system is adapted to scale monitoring applications, and the wireless monitoring system for a water supply network uses the proximity, low power consumption, and high reliability ZigBee technology to build a self-organizing network at the sensing layer. ZigBee is a wireless network protocol with low speed and short-distance transmission. The bottom layer is the media access layer and physical layer based on the IEEE802.15.4 standard. The main features are low speed, low power consumption, low cost, support for a large number of network nodes, support for a variety of network topologies, low complexity, fast, reliable, and secure. A corresponding self-organizing network strategy design is carried out for this purpose. The monitoring devices in this monitoring system are divided into two categories, coordinators and subnodes, according to the network roles. The coordinator is responsible for the formation of the whole network, and only a unique coordinator exists for each network. It is embedded in the gateway device. The subnodes are hierarchically represented according to the depth of the network they are in. The first-level subnode is directly connected to the coordinator, and the second-level subnode is directly connected to the first-level subnode.First, the coordinator initializes and sends a beacon request to scan its surroundings for beacons to determine that it is the only coordinator in the network. Then, it turns on the beacon broadcast timer and continuously broadcasts its own beacons. Channel selection is based on the result of the energy detection ranking of the channel. Preference is given to channels with lower energy levels where there are no ZigBee devices or fewer ZigBee devices. After determining the channel, the coordinator will perform the setting of the network identifier for network segmentation. After that, it sets a 16-bit address for itself within the network, which is the network address. This address is used as a unique identifier for the devices in the self-assembled network. At this point, the coordinator completes the preparation of the network’s formation.After the first-level subnode completes its startup initialization, it starts to send beacon requests cyclically, scanning the surrounding coordinators. When a coordinator’s beacon is detected, it sends an association request to the coordinator. After receiving the association request from a subnode, the coordinator will determine whether to allow the subnode to join the network according to its resource allocation. If the resources of the subnode are not fully occupied, it sends an association response to the subnode and saves the information of the association response. After receiving the association response, the first-level subnode extracts the association information and saves it to the association table. This includes the information of the parent node and the assigned network address and sends a reply to the coordinator, thus successfully joining the network and broadcasting the beacon to the outside world as a node in the network. Subnodes at lower levels join the network gradually with a similar strategy. The subnodes scan the beacons of the joinable parents and save the information of each “prospective parent” into their own association table to determine the final join parent based on the link quality with them. The link quality information exists in the feedback data of the physical layer, and the hardware itself supports link quality monitoring. The connections with good link quality will be selected as the final connections, so that the network can be spontaneously formed.In addition, each node is identified by a 64-bit IEEE address at the beginning of the network formation, and to save communication resources, the coordinator assigns 16-bit network addresses to each subnode with the following algorithm:Let the network hierarchy be denoted byd, its maximum hierarchy is dm, and the maximum number of subnodes accommodated in each subnode hierarchy be Nm (Nm > 1). Then, the network address interval of each subnode in the same hierarchy in the network is as follows:(1)NSkipd=1−Nmdm−d1−Nm.Then, the first child network address of the parent node with hierarchyd is as follows:(2)Parentnodenetworkaddress+1.The network address of the second subnode is as follows:(3)Parentnodenetworkaddress+1+Nskipd.The network address of the third subnode is as follows:(4)Parentnodenetworkaddress+1+2×Nskipd,and so on can calculate the network address of all nodes.


## 3. Leakage Model Construction and Solution

Once the leakage occurs somewhere in the water supply network system, it can be observed from the node water pressure from the point of view of system monitoring. The significant degree of the impact is related to the degree of pipe network leakage. Therefore, in the subsequent calculation, the leakage in the pipe network is equivalent to the leakage of the nodes connected to the pipe segment. This study will simulate the actual official website leakage by changing the pipe network node number and the degree of leakage. EPANET software is used to calculate the leveling of the pipe network. EPANET is open-source software developed by the National Environmental Protection Agency (EPA). Through EPANET, the computer program for delay simulation of hydraulic and water quality characteristics of the pressure pipe network can be executed to simulate many indexes such as water head, water quality, water quantity, and so on. Because of its advantages of open source, having strong adaptability, and having fast calculation speeds, it is widely used in hydraulic calculations. Finally, by comparing the monitored pressure with the actual pressure, the fitting function determines the relationship between the pressure and the location and degree of leakage.


### 3.1. Leakage Model Construction

#### 3.1.1. Determination of Decision Variables

In the simulation software, the leakage of the pipe network in the industrial area can be represented by setting the injector coefficient. Equation (5) can represent the relationship between ejector coefficient and water flow rate:(5)Qit=KiPitn.From the above formula, it can be seen that there is a positive correlation between the node leakage coefficient and the injection flow of pipe network nodes. In the simulation software, each pipe network node has an ejector coefficient. When the coefficient is 0, it means that there is no leakage in the current pipe network. When the value is greater than 0, it means that the node is leaking at this time, and the degree of leakage is positively correlated with the numerical value.To sum up, the number of the pipe network node represents the location of the leakage in the pipe network. The corresponding ejector coefficient node represents the degree of leakage on the official website at this time.


#### 3.1.2. Objective Function

The objective function involved in this study is shown in formula (6). The objective function is the minimum value of the square difference between the software simulation value of the pipe network node and the IoT system(6)minfX=1n∑i=1npi−pi′2.


#### 3.1.3. Constraint Conditions

The constraints of the leakage localization model are shown in the following equations:(7)0⩽Ki⩽Kmax,1⩽i⩽N,(8)Pi>0,1⩽i⩽N,(9)∑±qij+Qi=0,(10)∑hij−∆Hk=0.


### 3.2. Solution

Intelligent population optimization algorithms are algorithms generated using programs that mimic the behavior of groups of organisms in nature. In recent years, various new optimization algorithms have emerged. Some scholars have compared various algorithms and applied them to various complex problems, but few algorithms have been used to solve the leakage localization problem.In this study, we use PSO and ALO to solve the leakage damage location model. The particle swarm algorithm has been relatively maturely applied to the leakage localization problem. The core of the algorithm is to simulate the predatory behavior of a flock of birds. The optimal solution is obtained by constantly updating the flight speed and the spatial location of the birds.The ALO algorithm simulates the predation behavior of ant lions in nature. In the solution set, the number of ants is the same as that of ant lions. Ants and ant lions correspond one by one. Each ant and ant lion has its own location and fitness. Ants move randomly in the search space in different ways. Ant lions use traps to catch moving ants. The ant lion with the highest fitness is the elite ant lion, and its trap is also the largest. In each iteration, the activity range of each ant is between the corresponding ant lion and the elite. The flowchart of the ALO is shown in Figure2.Figure 2
Flow of the ant lion optimization algorithm.


## 3.1. Leakage Model Construction

### 3.1.1. Determination of Decision Variables

In the simulation software, the leakage of the pipe network in the industrial area can be represented by setting the injector coefficient. Equation (5) can represent the relationship between ejector coefficient and water flow rate:(5)Qit=KiPitn.From the above formula, it can be seen that there is a positive correlation between the node leakage coefficient and the injection flow of pipe network nodes. In the simulation software, each pipe network node has an ejector coefficient. When the coefficient is 0, it means that there is no leakage in the current pipe network. When the value is greater than 0, it means that the node is leaking at this time, and the degree of leakage is positively correlated with the numerical value.To sum up, the number of the pipe network node represents the location of the leakage in the pipe network. The corresponding ejector coefficient node represents the degree of leakage on the official website at this time.


### 3.1.2. Objective Function

The objective function involved in this study is shown in formula (6). The objective function is the minimum value of the square difference between the software simulation value of the pipe network node and the IoT system(6)minfX=1n∑i=1npi−pi′2.


### 3.1.3. Constraint Conditions

The constraints of the leakage localization model are shown in the following equations:(7)0⩽Ki⩽Kmax,1⩽i⩽N,(8)Pi>0,1⩽i⩽N,(9)∑±qij+Qi=0,(10)∑hij−∆Hk=0.


## 3.1.1. Determination of Decision Variables

In the simulation software, the leakage of the pipe network in the industrial area can be represented by setting the injector coefficient. Equation (5) can represent the relationship between ejector coefficient and water flow rate:(5)Qit=KiPitn.From the above formula, it can be seen that there is a positive correlation between the node leakage coefficient and the injection flow of pipe network nodes. In the simulation software, each pipe network node has an ejector coefficient. When the coefficient is 0, it means that there is no leakage in the current pipe network. When the value is greater than 0, it means that the node is leaking at this time, and the degree of leakage is positively correlated with the numerical value.To sum up, the number of the pipe network node represents the location of the leakage in the pipe network. The corresponding ejector coefficient node represents the degree of leakage on the official website at this time.


## 3.1.2. Objective Function

The objective function involved in this study is shown in formula (6). The objective function is the minimum value of the square difference between the software simulation value of the pipe network node and the IoT system(6)minfX=1n∑i=1npi−pi′2.


## 3.1.3. Constraint Conditions

The constraints of the leakage localization model are shown in the following equations:(7)0⩽Ki⩽Kmax,1⩽i⩽N,(8)Pi>0,1⩽i⩽N,(9)∑±qij+Qi=0,(10)∑hij−∆Hk=0.


## 3.2. Solution

Intelligent population optimization algorithms are algorithms generated using programs that mimic the behavior of groups of organisms in nature. In recent years, various new optimization algorithms have emerged. Some scholars have compared various algorithms and applied them to various complex problems, but few algorithms have been used to solve the leakage localization problem.In this study, we use PSO and ALO to solve the leakage damage location model. The particle swarm algorithm has been relatively maturely applied to the leakage localization problem. The core of the algorithm is to simulate the predatory behavior of a flock of birds. The optimal solution is obtained by constantly updating the flight speed and the spatial location of the birds.The ALO algorithm simulates the predation behavior of ant lions in nature. In the solution set, the number of ants is the same as that of ant lions. Ants and ant lions correspond one by one. Each ant and ant lion has its own location and fitness. Ants move randomly in the search space in different ways. Ant lions use traps to catch moving ants. The ant lion with the highest fitness is the elite ant lion, and its trap is also the largest. In each iteration, the activity range of each ant is between the corresponding ant lion and the elite. The flowchart of the ALO is shown in Figure2.Figure 2
Flow of the ant lion optimization algorithm.


## 4. Case Study

In the process of model verification, this study takes the industrial area as the object to solve the location of pipe network leakage. The data needed by the positioning algorithm come from the IoT monitoring system. The pipe network of the industrial zone is modeled by simulation software. Figure3 is an example of this research.Figure 3
An example of a pipeline network pressure monitoring point arrangement scheme.


### 4.1. Pressure Monitoring Point Situation

As mentioned in the previous section, the pressure-sensitive matrix combined with the fuzzy clustering algorithm was used to arrange the pressure monitoring points for the example pipe network, and four pressure measurement points were selected according to the scale of the pipe network. The fuzzy clustering method, that is, the sample is roughly divided and then classified according to its optimal principle; after many iterations, until the classification is more reasonable, this method is also called the step-by-step clustering method. The nodes for leakage location select several representative areas in the pipe network. Among them, No. 2 Node 27 is connected to two nearby nodes and is easily affected by it. Node 18 is located near the end of the pipe network. Node 9 is a typical straight-line connection pipeline. Node 4 is on the square’s official website. These four nodes can basically summarize the characteristics of the nodes in the pipe network. The fuzzy criteria are shown in equation (11)(11)λ=0.9012.Then, the location of pressure measurement points obtained by fuzzy clustering analysis is shown in Figure3. The corresponding node numbers of the pressure measurement points are 27/18/4/9.


### 4.2. Leakage Location

If all the nodes are calculated, the amount of calculation will increase sharply, so that the optimization algorithm cannot find the optimal solution of the objective function. Therefore, the number of nodes to be solved is determined by the number of leakage nodes.The specific parameters of the ALO and PSO algorithms are set as follows: the initial population size of the ALO algorithm is set to 30 (the number of ants and ant lions is 30), the variable dimension is set to 1, and the boundary value of the algorithm is set to 0100. The learning factor of the PSO algorithm is set to 1.49445, the initial population size is set to 100, and the evolutionary algebra is set to 200. The two algorithms are calculated for one leaky node at a time. The ejector coefficient of each leakage node in the fixed pipe network is 0.3. Under different working conditions, the two algorithms locate 5 leakage nodes. The distribution of pipe network nodes and leakage nodes is shown in Figure3 (red triangle mark). The IoT monitoring pressure value of the pipe network is shown in Figure 4. The optimal results of the PSO and ALO algorithms for each leaky node are shown in Figure 5. The calculation result of leakage location is shown in Figure 6.Figure 4
The measured value of the pressure at the leakage measuring point.Figure 5
The pressure calculation value of the pressure measuring point under the optimal fitness. (a) Node 27. (b) Node 18. (c) Node 9. (d) Node 4.
(a)(b)(c)(d)Figure 6
Leak location results of the ant lion algorithm and particle swarm optimization algorithm.


### 4.3. Comparative Analysis of Optimization Results

Based on the analysis of the results in Figure6, when leakage occurs at different points, the two intelligent optimization algorithms can better find the leakage point in the pipe network. In 5 times of leakage location, the number of times that the two algorithms find the best is 4 or more. In the five times of leakage location, the average number of times for the two algorithms to find the best is 3 times. Although the algorithm occasionally locates that the node is not the target node, the location of the node is also adjacent to the target node, because the change of water demand of the adjacent node is compared with the target node, the impact on the water pressure of the pipe network is relatively small, so in reality, this situation is also possible, and locating the nearby node where the leakage occurs can also greatly reduce the scope of leakage search.Compared with the PSO and ALO algorithms, in 20 times of leak node location search, the PSO algorithm accurately locates the leak node 12 times (accuracy 60%). The ALO algorithm accurately locates the missing nodes 16 times with an accuracy of 80%. Figures7 and 8 show the iterative flow of the PSO algorithm and the ALO algorithm, respectively. As can be seen from Figures 7 and 8, the convergence of the ALO algorithm decreases in a straight line, while that of the PSO algorithm decreases step by step. The convergence speed of the ALO algorithm is much faster than that of PSO. At the same time, when the same precision is achieved, the number of iterations required by ALO is also less than that of PSO. The generation time of the ALO algorithm is shorter than that of the PSO algorithm and the convergence speed is faster. To sum up, in the process of leakage location calculation in a water supply network, the ALO algorithm has higher search efficiency and fewer parameters than the PSO algorithm, so it has a higher engineering application value.Figure 7
ALO algorithm iteration.Figure 8
PSO algorithm iteration.


## 4.1. Pressure Monitoring Point Situation

As mentioned in the previous section, the pressure-sensitive matrix combined with the fuzzy clustering algorithm was used to arrange the pressure monitoring points for the example pipe network, and four pressure measurement points were selected according to the scale of the pipe network. The fuzzy clustering method, that is, the sample is roughly divided and then classified according to its optimal principle; after many iterations, until the classification is more reasonable, this method is also called the step-by-step clustering method. The nodes for leakage location select several representative areas in the pipe network. Among them, No. 2 Node 27 is connected to two nearby nodes and is easily affected by it. Node 18 is located near the end of the pipe network. Node 9 is a typical straight-line connection pipeline. Node 4 is on the square’s official website. These four nodes can basically summarize the characteristics of the nodes in the pipe network. The fuzzy criteria are shown in equation (11)(11)λ=0.9012.Then, the location of pressure measurement points obtained by fuzzy clustering analysis is shown in Figure3. The corresponding node numbers of the pressure measurement points are 27/18/4/9.


## 4.2. Leakage Location

If all the nodes are calculated, the amount of calculation will increase sharply, so that the optimization algorithm cannot find the optimal solution of the objective function. Therefore, the number of nodes to be solved is determined by the number of leakage nodes.The specific parameters of the ALO and PSO algorithms are set as follows: the initial population size of the ALO algorithm is set to 30 (the number of ants and ant lions is 30), the variable dimension is set to 1, and the boundary value of the algorithm is set to 0100. The learning factor of the PSO algorithm is set to 1.49445, the initial population size is set to 100, and the evolutionary algebra is set to 200. The two algorithms are calculated for one leaky node at a time. The ejector coefficient of each leakage node in the fixed pipe network is 0.3. Under different working conditions, the two algorithms locate 5 leakage nodes. The distribution of pipe network nodes and leakage nodes is shown in Figure3 (red triangle mark). The IoT monitoring pressure value of the pipe network is shown in Figure 4. The optimal results of the PSO and ALO algorithms for each leaky node are shown in Figure 5. The calculation result of leakage location is shown in Figure 6.Figure 4
The measured value of the pressure at the leakage measuring point.Figure 5
The pressure calculation value of the pressure measuring point under the optimal fitness. (a) Node 27. (b) Node 18. (c) Node 9. (d) Node 4.
(a)(b)(c)(d)Figure 6
Leak location results of the ant lion algorithm and particle swarm optimization algorithm.


## 4.3. Comparative Analysis of Optimization Results

Based on the analysis of the results in Figure6, when leakage occurs at different points, the two intelligent optimization algorithms can better find the leakage point in the pipe network. In 5 times of leakage location, the number of times that the two algorithms find the best is 4 or more. In the five times of leakage location, the average number of times for the two algorithms to find the best is 3 times. Although the algorithm occasionally locates that the node is not the target node, the location of the node is also adjacent to the target node, because the change of water demand of the adjacent node is compared with the target node, the impact on the water pressure of the pipe network is relatively small, so in reality, this situation is also possible, and locating the nearby node where the leakage occurs can also greatly reduce the scope of leakage search.Compared with the PSO and ALO algorithms, in 20 times of leak node location search, the PSO algorithm accurately locates the leak node 12 times (accuracy 60%). The ALO algorithm accurately locates the missing nodes 16 times with an accuracy of 80%. Figures7 and 8 show the iterative flow of the PSO algorithm and the ALO algorithm, respectively. As can be seen from Figures 7 and 8, the convergence of the ALO algorithm decreases in a straight line, while that of the PSO algorithm decreases step by step. The convergence speed of the ALO algorithm is much faster than that of PSO. At the same time, when the same precision is achieved, the number of iterations required by ALO is also less than that of PSO. The generation time of the ALO algorithm is shorter than that of the PSO algorithm and the convergence speed is faster. To sum up, in the process of leakage location calculation in a water supply network, the ALO algorithm has higher search efficiency and fewer parameters than the PSO algorithm, so it has a higher engineering application value.Figure 7
ALO algorithm iteration.Figure 8
PSO algorithm iteration.


## 5. Conclusion

In this study, according to the monitoring demand of the urban water supply network and the serious leakage of the urban water supply network, an intelligent monitoring system of the water supply network based on the wireless sensor network is designed and constructed. The fuzzy clustering method combined with the pressure sensitivity coefficient matrix is used to study the optimal layout of pressure measuring points. On the basis of online pressure monitoring, the leakage simulation is carried out by setting the injector coefficient. Finally, through the verification of the actual pipe network, the following conclusions were obtained:(1)
The monitoring requirements of urban water supply networks and the reasons why the current SCADA system and commercial monitoring equipment cannot meet the application of pipe network monitoring are put forward and targeted to build a multilevel networked water supply monitoring system to achieve the monitoring network requirements of large-scale, low-cost, low-power consumption, and high reliability.(2)
In the calculation of pipe network leakage location, the positioning accuracy of ALO algorithm is 80%, and the ejector coefficient is closer to the real value. On this problem, ALO algorithm has higher accuracy, better stability, and faster solving speed than PSO algorithm.In this study, the dynamic monitoring of water supply network pressure is realized through artificial intelligence and Internet of Things technology, the leakage location model is established, and the location is successfully carried out by the ALO algorithm. However, there is still room for improvement in positioning accuracy. In the next step, we will try to further improve the location accuracy by optimizing the objective function and optimizing the algorithm. The research results of this study can provide some technical support for the design of an urban water supply network monitoring network and the development of a maintenance system.



---

*Source: 3443047-2023-02-23.xml*