A water supply network leakage control method based on artificial intelligence
By generating a feature array set of the sensing data set of the water supply pipeline network, combining the water flow characteristics and numerical change characteristics, the problem of insufficient leakage detection accuracy and sensitivity in the existing technology is solved, and a higher leakage detection accuracy is achieved.
Patent Information
- Application Number
- CN202411816185.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-11
AI Technical Summary
The existing intelligent leakage detection technology is difficult to effectively capture the change rate of water flow parameters in the water supply pipeline network, resulting in limited accuracy and sensitivity of leakage detection.
By obtaining the water flow feature array and numerical change feature array of the sensing data set of the water supply pipeline network, combining the information and numerical change feature arrays under different feature particle sizes, a feature array set is generated, which is used to detect leakage loss on the sensing data set of the water supply pipeline network.
It improves the accuracy of leakage detection results, enhances the understanding of the status of the water supply pipeline network, and can more accurately capture abnormalities and potential leakage points in the water supply pipeline network.
Smart Images

Figure CN119272169B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a water supply network leakage control method based on artificial intelligence. Background Art
[0002] With the acceleration of urbanization and the increasing importance of water resource management, leakage detection and control of water supply networks have become a key link in ensuring the effective use of water resources and the safety of public water supply. As an important part of urban infrastructure, the real-time monitoring and precise management of the operating status of water supply networks are of great significance for reducing water resource waste and improving water supply efficiency.
[0003] Traditional water supply network leakage detection methods mainly rely on manual inspections and regular inspections. This method is not only inefficient, but also difficult to detect and locate leakage points in a timely manner, resulting in continuous waste of water resources and potential water supply safety risks. In recent years, with the rapid development of Internet of Things technology, big data analysis and artificial intelligence technology, intelligent leakage detection methods based on sensor monitoring and data analysis have gradually attracted attention.
[0004] However, the existing intelligent leakage detection technology still has many shortcomings. On the one hand, these methods often only focus on the macroscopic state of the water supply network, ignoring the differences and correlations between different areas and nodes in the network, resulting in limited accuracy and sensitivity of leakage detection. On the other hand, the existing technology lacks in-depth analysis and utilization of the speed of change of water flow parameters in the water supply network, and cannot effectively capture instantaneous leakage signs, thus delaying the timely discovery and treatment of leakage. Summary of the invention
[0005] In view of this, the embodiment of the present application at least provides a water supply network leakage control method based on artificial intelligence. The technical solution of the embodiment of the present application is implemented as follows:
[0006] A water supply network leakage control method based on artificial intelligence, the method comprising: obtaining a water flow feature array and a value change feature array of a water supply network sensor data set corresponding to a target water supply network, wherein the target water supply network comprises a plurality of sensor monitoring nodes; the water flow feature array comprises a network information feature array of the water supply network sensor data set at a first feature granularity and a network information feature array of the water supply network sensor data set at a second feature granularity; combining the water flow feature array and the value change feature array to obtain a feature array set of the water supply network sensor data set; the feature array set comprises the A network information feature array of a water supply network sensor data set at a first feature granularity and an optimized feature array of the water supply network sensor data set at k feature granularities, wherein the optimized feature array of the water supply network sensor data set at any feature granularity is obtained by combining the network information feature array of the water supply network sensor data set at a second feature granularity and the numerical change feature array, and k is a natural number greater than 0; in combination with the feature array set, leakage detection is performed on the water supply network sensor data set to obtain a leakage detection result of the water supply network sensor data set, so as to perform water flow control according to the leakage detection result.
[0007] The technical effects of the present application include: the present application obtains a water flow feature array and a numerical change feature array of a water supply network sensor data set, and obtains a feature array set of the water supply network sensor data set through the water flow feature array and the numerical change feature array, the feature array set includes an optimized feature array of the water supply network sensor data set at one or more feature granularities, the optimized feature array is obtained based on the numerical change feature array and the network information feature array in the water flow feature array, leakage detection is performed on the water supply network sensor data set through the feature array set, and a leakage detection result of the water supply network sensor data set is obtained, the present application uses the numerical change feature array of the water supply network sensor data set to enhance the network information feature array of the water supply network sensor data set, so that the change details of the water supply network sensor data set are strengthened, and the accuracy of the leakage detection result is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 A schematic diagram of the implementation flow of an artificial intelligence-based water supply network leakage control method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0009] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0010] The embodiment of the present application provides a water supply network leakage control method based on artificial intelligence, which can be executed by a processor of a computer system. The computer system can refer to a server, a laptop, a tablet computer, a desktop computer, a smart TV, a mobile device (such as a mobile phone, a portable video player, a personal digital assistant, a dedicated messaging device, a portable gaming device) and other devices with data processing capabilities.
[0011] Figure 1 A schematic diagram of the implementation flow of a water supply network leakage control method based on artificial intelligence provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0012] Step S110: Obtain a water flow feature array and a value change feature array of a water supply network sensor data set corresponding to a target water supply network, wherein the target water supply network includes multiple sensor monitoring nodes; the water flow feature array includes a network information feature array of the water supply network sensor data set at a first feature granularity and a network information feature array of the water supply network sensor data set at a second feature granularity.
[0013] In step S110, the target water supply network is a complex network, including multiple sensor monitoring nodes, which are distributed in different locations of the network and are used to monitor various parameters of water flow in real time, such as pressure, flow, temperature, etc. These monitoring data constitute the water supply network sensor data set, which is the basis for subsequent analysis and processing.
[0014] After acquiring the water supply network sensor data set, the water flow feature array is extracted. The water flow feature array is the key information to describe the state of the water supply network. It contains the information feature arrays of the network at different feature granularities. Feature granularity can be understood as the degree of refinement or scale of describing the feature. In step S110, the computer system extracts two network information feature arrays at different feature granularities: the network information feature array at the first feature granularity and the network information feature array at the second feature granularity. Taking the network information feature array at the first feature granularity as an example, this array may contain macro information such as the overall pressure distribution and flow distribution of the water supply network. For example, assume that the water supply network has 10 sensor monitoring nodes, and each node records the pressure value at the current moment. Then, the network information feature array at the first feature granularity may be a 10-dimensional vector, and each element corresponds to the pressure value of a sensor monitoring node. This vector can be expressed as: [P1, P2, P3, ..., P10], where Pi represents the pressure value of the i-th sensor monitoring node. Next, the computer system further extracts the pipeline network information feature array at the second feature granularity. Compared with the first feature granularity, the second feature granularity is finer and can capture more detailed information. For example, at the second feature granularity, the system may not only focus on the pressure value of each sensor monitoring node, but also on the pressure difference between adjacent nodes, the flow rate change trend, etc. Therefore, the pipeline network information feature array at the second feature granularity may be a more complex structure, such as a matrix or tensor containing multiple sub-arrays. Each sub-array corresponds to the information of a sensor monitoring node and its surrounding nodes, including multiple features such as pressure value, pressure difference, flow rate change rate, etc.
[0015] In addition to the water flow feature array, the computer system also needs to extract the numerical change feature array, that is, the feature array that characterizes the speed of numerical change. This array is used to reflect the change of water flow parameters in the water supply network over time, and is an important basis for identifying potential leakage points. The extraction of numerical change feature arrays usually involves time series analysis techniques, such as difference, sliding window average change rate algorithm, etc.
[0016] Taking the differential algorithm as an example, assume that the water supply network sensor data set contains the pressure value data of a sensor monitoring node at T consecutive time points: [P1, P2, P3, ..., PT]. The computer system can obtain the numerical change feature array of the node by calculating the pressure difference between adjacent time points. This array can be expressed as: [ΔP1, ΔP2, ΔP3, ..., ΔPT-1], where ΔPi=Pi+1-Pi represents the pressure difference between the i-th time point and the i+1-th time point. This numerical change feature array reflects the speed of change of the pressure value of the sensor monitoring node. If the pressure difference at a certain time point increases significantly, it may mean that there is a leakage at that location.
[0017] When extracting the numerical change feature array, the computer system can also consider the changes in other parameters, such as flow, temperature, etc. By comprehensively analyzing the change characteristics of multiple parameters, the system can more comprehensively understand the status of the water supply network and improve the accuracy of leakage detection.
[0018] In addition, in the process of extracting water flow feature arrays and numerical change feature arrays, the computer system can use machine learning models to enhance the effect of feature extraction. For example, for the extraction of water flow feature arrays, the system can use deep learning models such as convolutional neural networks (CNN) or recurrent neural networks (RNN) to process sensor monitoring data, automatically learn and extract features that are useful for leakage detection. For the extraction of numerical change feature arrays, the system can also use time series prediction models to predict parameter values at future time points and compare them with actual values to obtain more accurate numerical change features.
[0019] Step S120: combining the water flow feature array and the numerical change feature array to obtain a feature array set of the water supply network sensor data set; the feature array set includes a network information feature array of the water supply network sensor data set at a first feature granularity and an optimized feature array of the water supply network sensor data set at k feature granularities, the optimized feature array of the water supply network sensor data set at any feature granularity is obtained by combining the network information feature array and the numerical change feature array of the water supply network sensor data set at a second feature granularity, and k is a natural number greater than 0.
[0020] In step S120, the computer system combines the water flow feature array and the numerical change feature array obtained in step S110 to generate a more comprehensive and accurate feature array set, which will be used for subsequent leakage detection. This process not only involves the integration of information at different feature granularities, but also enhances the understanding of the state of the water supply network by introducing the numerical change feature array. The computer system aligns and integrates the water flow feature array and the numerical change feature array obtained in step S110. In step S110, the network information feature array (denoted as A1) at the first feature granularity and the network information feature array (denoted as A2) at the second feature granularity of the water supply network sensor data set, as well as the numerical change feature array (denoted as C) have been extracted. These arrays may be different in structure, so before combining, the system performs appropriate preprocessing to ensure that they can be compared and calculated at the same dimension and scale.
[0021] For example, suppose A1 is a 10-dimensional vector representing the pressure distribution of the water supply network at the macro level; A2 is a 10×10 matrix representing the detailed information of each sensor monitoring node and its adjacent nodes; and C is a 10-dimensional vector representing the rate of change of the pressure value of each sensor monitoring node. In order to effectively combine these arrays in subsequent calculations, the system may need to adjust A2 and C to the same dimension as A1, or map their information into a common feature space in some way.
[0022] One preprocessing method is to use feature mapping techniques, such as linear transformation, kernel method, etc., to map the features of A2 and C to a space with the same dimension as A1. For example, a linear transformation matrix W can be used to map each row of A2 to a 10-dimensional vector, thereby obtaining a 10×10 matrix B, where each row of B corresponds to the mapping result of a row in A2. Similarly, another linear transformation matrix V can be used to map C to a 10-dimensional vector D.
[0023] After preprocessing, the computer system begins to combine the water flow feature array and the numerical change feature array to generate an optimized feature array. This process involves splicing, combining and optimizing the pipeline information feature array (preprocessed B) at the second feature granularity with the numerical change feature array (preprocessed D). Specifically, the system can first splice B and D to obtain a new array E containing more information. For example, if B is a 10×10 matrix and D is a 10-dimensional vector, then E can be a 10×11 matrix, where the first 10 columns are the elements of B and the last 1 column is the element of D. This splicing method retains all the information in the original data and provides richer input for subsequent optimization steps. Next, the system optimizes the spliced array E to generate an optimized feature array. The goal of the optimization process is to extract the most useful features for leakage detection from E and reduce redundant information. This can be achieved through a variety of methods, such as principal component analysis (PCA), linear discriminant analysis (LDA), neural networks, etc.
[0024] Taking neural networks as an example, the system can build a multi-layer perceptron (MLP) or convolutional neural network (CNN) to process E. This neural network will receive E as input and perform feature extraction and transformation through a series of hidden layers. In the hidden layers, activation functions (such as ReLU, sigmoid, etc.) can be used to introduce nonlinear factors and enhance the expressive power of the network. Finally, the output layer of the network will generate an optimized feature array F, which contains the most useful features extracted from E.
[0025] This process can be repeated multiple times to generate optimized feature arrays at different feature granularities. For example, the system can define k different feature granularities (k>0) and train a neural network for each feature granularity to generate the corresponding optimized feature array. These optimized feature arrays will form part of the feature array set and will be used together with the pipe network information feature array A1 at the first feature granularity for subsequent leakage detection.
[0026] The optimized feature arrays generated at different feature granularities may have different structures and dimensions. For example, at a coarser feature granularity, the optimized feature array may contain only a few key indicators; while at a finer feature granularity, the optimized feature array may contain more detailed parameters and relationships. Therefore, when constructing a feature array set, the system ensures that these optimized feature arrays can be integrated in a compatible and comparable way.
[0027] One method is to use feature fusion techniques, such as weighted averaging, maximum pooling, and attention mechanisms, to integrate optimized feature arrays at different feature granularities into a unified feature space. For example, an attention mechanism can be used to assign a weight to each optimized feature array, and then they are weighted and summed according to these weights to obtain a global optimized feature array. This global optimized feature array will form the final feature array set together with A1.
[0028] The final feature array set generated will contain the network information feature array A1 of the water supply network sensor data set at the first feature granularity and the optimized feature arrays at k feature granularities. These feature arrays together describe the state and change trend of the water supply network, providing comprehensive data support for subsequent leakage detection. By combining information and value change feature arrays at different feature granularities, the system can more accurately capture anomalies and potential leakage points in the water supply network, thereby improving the accuracy and efficiency of leakage detection.
[0029] Step S130: performing leakage detection on the water supply network sensor data set in combination with the feature array set to obtain leakage detection results of the water supply network sensor data set, so as to perform water flow control according to the leakage detection results.
[0030] In step S130, the computer system uses the feature array set generated in step S120 to perform leakage detection on the water supply network sensor data set. This process uses advanced machine learning models to identify potential leakage points in the water supply network based on the multi-scale and multi-dimensional information contained in the feature array set and generates corresponding leakage detection results.
[0031] First, the computer system integrates all feature arrays in the feature array set into a unified input format so that the subsequent machine learning model can process it. The feature array set contains the network information feature array (denoted as A1) of the water supply network sensor data set at the first feature granularity and the optimized feature arrays (denoted as F1, F2,..., Fk) at k feature granularities, where each optimized feature array is obtained by combining the network information feature array and the value change feature array at the second feature granularity. In order to integrate these feature arrays together, the computer system can use technologies such as feature splicing and feature fusion.
[0032] For example, the system can concatenate A1, F1, F2, ..., Fk along the feature dimension to form a larger feature vector or feature matrix. Assuming A1 is a 10-dimensional vector, and F1, F2, ..., Fk are each 20-dimensional vectors, then the concatenated feature matrix will be a (k+1)×20 matrix, where the first row is the elements of A1, and the next k rows are the elements of F1, F2, ..., Fk. This concatenation method retains the original information in each feature array and provides rich input for subsequent machine learning models.
[0033] Another way to integrate is feature fusion. Feature fusion technology can fuse multiple feature arrays into a single feature representation through weighted averaging, maximum pooling, attention mechanism, etc. For example, the system can use the attention mechanism to assign a weight to each feature array, and then weight them according to these weights to obtain a fused feature vector. This method can automatically learn the importance relationship between different feature arrays and generate a more compact and effective feature representation. After completing the feature integration, the computer system begins to apply the machine learning model for leakage detection. The goal of the leakage detection model is to predict the leakage status of each sensor monitoring node in the water supply network based on the input feature array set. This is usually a binary classification problem, that is, the sensor monitoring nodes are divided into two categories: leakage and no leakage. To achieve this goal, the system can choose a variety of machine learning models, such as support vector machines (SVM), random forests, neural networks, etc.
[0034] Taking neural networks as an example, the system can build a multi-layer perceptron (MLP) or convolutional neural network (CNN) as a leakage detection model. This model will receive the integrated feature array as input and perform feature extraction and transformation through a series of hidden layers. In the hidden layer, the model can use activation functions (such as ReLU, sigmoid, etc.) to introduce nonlinear factors and enhance the expressiveness of the model. Ultimately, the output layer of the model will generate a vector with the same number of sensor monitoring nodes, where each element corresponds to the leakage prediction result of a node.
[0035] Specifically, assuming that there are 100 sensor monitoring nodes in the water supply network, the output of the leakage detection model will be a 100-dimensional vector, with each element value between 0 and 1, indicating the probability of leakage at the corresponding node. The system can set a threshold (such as 0.5) to determine elements greater than the threshold as leaking nodes and elements less than the threshold as non-leaking nodes. In this way, the system can obtain a leakage detection result that includes the leakage status of all sensor monitoring nodes.
[0036] The performance of the leakage detection model depends largely on its training process. During the training phase, the system uses a water supply network sensor dataset with known leakage status to train the model so that it can learn the mapping relationship from feature array to leakage status. During the training process, the system can use cross-validation, early stopping and other techniques to prevent overfitting, and use indicators such as accuracy, recall, and F1 score to evaluate the performance of the model.
[0037] After completing the leakage detection, the computer system will generate a detailed leakage detection result report, which contains the leakage status, leakage probability and other information of each sensor monitoring node. This information is crucial for subsequent water flow control, because the system can locate potential leakage points based on the leakage detection results and take corresponding measures for repair and maintenance. For example, for nodes with serious leakage, the system can immediately shut down the water supply of the node to prevent further waste of water resources; for nodes with less leakage, the system can arrange regular inspections and maintenance work to prevent further deterioration of the leakage.
[0038] In one implementation, step S120 combines the water flow feature array and the value change feature array to obtain a feature array set of the water supply network sensor data set, including:
[0039] Step S121: splicing the pipe network information feature array and the value change feature array of the water supply pipe network sensor data set at the second feature granularity to obtain an optimized value change feature array;
[0040] Step S122: combining the network information feature array of the water supply network sensor data set at the second feature granularity with the optimized value change feature array to obtain the optimized feature array of the water supply network sensor data set at the second feature granularity;
[0041] Step S123: combining the network information feature array of the water supply network sensor data set at the first feature granularity and the optimized feature array of the water supply network sensor data set at the second feature granularity to obtain a feature array set of the water supply network sensor data set.
[0042] In step S121, the goal of the computer system is to concatenate the network information feature array (denoted as B) and the value change feature array (denoted as C) of the water supply network sensor data set at the second feature granularity to generate an optimized value change feature array (denoted as E). The purpose of this step is to combine the spatial distribution information in the network information feature array with the time change information in the value change feature array, thereby providing a more comprehensive description of the water supply network status.
[0043] For example, suppose there are 10 sensor monitoring nodes in the water supply network, and each node records the pressure value. At the second feature granularity, the network information feature array B may be a 10×10 matrix, where each row represents a sensor monitoring node, each column represents other nodes adjacent to the node, and the elements in the matrix represent the pressure relationship between the nodes. The value change feature array C may be a 10-dimensional vector, where each element represents the rate of change of the pressure value of the corresponding sensor monitoring node.
[0044] In order to connect B and C, the computer system can expand C into a matrix with the same number of rows as B (i.e., a 10×1 matrix), and then use this expanded matrix as a new column of B to obtain a 10×11 matrix E. In this way, each row in E contains the pipe network information characteristics (the first 10 columns) and value change characteristics (the last column) of the corresponding sensor monitoring node.
[0045] If B represents the characteristic array of pipe network information and C represents the characteristic array of value change, then the splicing process can be expressed as: , where C' represents expanding C to a matrix with the same number of rows as B. In step S122, the computer system combines the optimized numerical variation feature array E generated in step S121 with the original pipe network information feature array B to generate an optimized feature array (denoted as F) of the water supply pipe network sensor data set at the second feature granularity. The purpose of this step is to further fuse the spatial distribution information and the time variation information to extract features that are more useful for leakage detection.
[0046] For example, continuing with the previous example, we now have a 10×11 matrix E, which contains the network information features and the numerical change features. In order to generate the optimized feature array F, the computer system can use a variety of methods, such as weighted averaging, feature fusion, etc.
[0047] One approach is to directly use E as F, that is, to assume that the concatenated features are sufficiently optimized. However, a more common approach is to further process E using a machine learning model to extract more useful features. For example, a multi-layer perceptron (MLP) or convolutional neural network (CNN) can be used to process E and output a feature array F whose dimension may be the same as or different from that of E.
[0048] Assume that MLP is chosen to process E and generate F. The input layer of MLP will have 11 neurons (corresponding to the 11 columns of E), the hidden layer can have any number of neurons, and the output layer will have neurons with the same expected dimension of F. The training process of MLP will involve using a water supply network sensor data set with known leakage status to optimize the model parameters so that the model can learn an effective mapping from E to F. In step S123, the computer system combines the optimized feature array F at the second feature granularity generated in step S122 with the network information feature array A1 at the first feature granularity to generate the final feature array set of the water supply network sensor data set (denoted as G). The purpose of this step is to integrate information at different feature granularities to provide comprehensive data support for subsequent leakage detection. For example, suppose A1 is a 10-dimensional vector representing the pressure distribution of the water supply network at the macro level; F is a 10×11 matrix representing the optimized features at the second feature granularity. In order to combine A1 and F together, the computer system can use methods such as feature splicing and feature fusion.
[0049] One approach is to directly concatenate A1 as a row or column of F, but this can lead to a mismatch in feature dimensions. A more common approach is to use feature fusion techniques, such as attention mechanisms, weighted averages, etc., to integrate the information in A1 and F into a unified feature space.
[0050] For example, an attention mechanism can be used to assign a weight to each element in A1 and F, and then they are weighted and summed according to these weights to obtain a fused feature vector or matrix. This fused feature vector or matrix will be part of the feature array set G.
[0051] Suppose you choose to use the attention mechanism to fuse A1 and F. First, you can define an attention function to calculate the weight of each element in A1 and F. This weight can be based on the value, position, or other relevant information of the element. Then, according to these weights, the elements in A1 and F are weighted and summed to obtain the fused features.
[0052] Specifically, assuming that A1 is a 10-dimensional vector and F is a 10×11 matrix, we can define an attention weight matrix W with a dimension of (10+11)x(10+11). Then, we calculate the product of the concatenated matrix of A1 and F (denoted as H, with a dimension of 11x11) and W to obtain an attention weight vector (denoted as α, with a dimension of 11). Finally, we weight the elements in H according to α and obtain the fused feature vector (denoted as G fused , with a dimension of 10). This process can be expressed as: .
[0053] Among them, A1' means expanding A1 into a matrix with the same number of rows as F (that is, a 1x11 matrix), the softmax function is used to normalize the weights to between 0 and 1, and α' means the transpose of α.
[0054] Finally, the feature array set G will contain A1 and all optimized feature arrays (such as F), which together describe the status and information of the water supply network at different feature granularities. These feature arrays will be used as inputs for subsequent leakage detection models to identify potential leakage points in the water supply network.
[0055] Through the above steps, the computer system can combine the water flow characteristic array and the numerical change characteristic array to generate a comprehensive and accurate characteristic array set, which provides strong data support for leakage detection and control of the water supply network.
[0056] In one implementation, the method further includes:
[0057] Step S1201: perform multiple feature extractions on the optimized feature array of the water supply network sensor data set at the second feature granularity through p feature learning networks to obtain the optimized feature array of the water supply network sensor data set at p feature granularities, where p is a natural number greater than 0.
[0058] Then, in step S123, the network information feature array of the water supply network sensor data set at the first feature granularity and the optimized feature array of the water supply network sensor data set at the second feature granularity are combined to obtain a feature array set of the water supply network sensor data set, including:
[0059] Step S1231: Arrange the network information feature array of the water supply network sensor data set at the first feature granularity, the optimized feature array of the water supply network sensor data set at the second feature granularity, and the optimized feature array of the water supply network sensor data set at p feature granularities to obtain a feature array set of the water supply network sensor data set.
[0060] In step S1201, the computer system uses p feature learning networks (p is a natural number greater than 0) to perform multiple feature extractions on the optimized feature array (denoted as F2) of the water supply network sensor data set at the second feature granularity. The purpose of this step is to further mine the useful information in F2 from different angles and scales, and generate optimized feature arrays at p different feature granularities (denoted as F2_1, F2_2, ..., F2_p).
[0061] For example, suppose F2 is a 10×11 matrix, which represents the optimized features of the water supply network at the second feature granularity. In order to extract more features, the computer system selects 3 feature learning networks (i.e., p=3), each with different structures and parameters.
[0062] The first feature learning network may be a convolutional neural network (CNN), which is good at capturing local features. CNN can perform a convolution operation on F2 to extract local patterns in space and generate a feature matrix F2_1 whose dimension may be different from F2.
[0063] The second feature learning network may be a recurrent neural network (RNN), which is good at processing sequence data. RNN can process the rows or columns of F2 sequentially, capture temporal or spatial dependencies, and generate a sequence feature vector F2_2.
[0064] The third feature learning network may be an autoencoder, which is good at learning low-dimensional representations of data. The autoencoder can encode and decode F2, extract a compressed representation of the data, and generate a feature vector F2_3 with a smaller dimension.
[0065] For each feature learning network, the computer system needs to be trained and optimized. The training process usually involves using a water supply network sensor data set with known leakage status to supervise the learning of the model, and adjusting the model parameters through the back propagation algorithm so that the model can accurately extract useful features from the input data. Taking CNN as an example, the training process may include the following steps:
[0066] 1. Data preprocessing: Standardize or normalize F2 and the corresponding label (i.e., leakage status) to ensure the consistency of the input data.
[0067] 2. Model construction: Define a CNN architecture that includes components such as convolutional layers, pooling layers, and fully connected layers.
[0068] 3. Forward propagation: Input F2 into CNN and generate feature maps through convolution, pooling and other operations.
[0069] 4. Loss calculation: Use cross entropy loss function or other loss function to calculate the difference between the predicted result and the true label.
[0070] 5. Back propagation: Update the parameters of CNN through the chain rule based on the gradient information of the loss function.
[0071] 6. Iterative training: Repeat the above steps until the performance of the model on the validation set no longer improves or reaches the predetermined number of iterations.
[0072] Through training, each feature learning network can learn an effective mapping from F2 to the corresponding optimized feature array. These optimized feature arrays will contain more information about the status of the water supply network, providing more comprehensive data support for subsequent leakage detection.
[0073] In step S1231, the computer system organizes the pipe network information feature array (denoted as A1) at the first feature granularity generated in step S120, the optimized feature array (denoted as F2) at the second feature granularity, and the optimized feature arrays (denoted as F2_1, F2_2, ..., F2_p) at the p feature granularities generated in step S1201 to generate a feature array set (denoted as G) of the water supply pipe network sensor data set. For example, continuing to use the previous example, there are now feature arrays such as A1 (10-dimensional vector), F2 (10×11 matrix), F2_1 (assuming a 10×8 matrix), F2_2 (assuming a 1-dimensional vector), and F2_3 (assuming a 5-dimensional vector). In order to integrate them together, the computer system can use methods such as feature splicing and feature fusion. One method is to directly splice all these feature arrays into a larger feature matrix or vector. For example, A1 can be expanded into a 10×1 matrix, and then F2, F2_1, F2_2 (expanded into a 10×1 matrix), and F2_3 (expanded into a 10×5 matrix) can be concatenated along the feature dimension to obtain a 10×(11+8+1+5) feature matrix G.
[0074] In other implementations, feature fusion techniques may be used to integrate these feature arrays. Feature fusion techniques may fuse multiple feature arrays into a single feature representation through weighted averaging, maximum pooling, attention mechanisms, and the like. Taking the attention mechanism as an example, a computer system may define an attention function to calculate the weights of the elements in each feature array, and then weighted sum them according to these weights to obtain a fused feature vector or matrix.
[0075] Specifically, assuming there is an attention weight matrix W (dimension is (10+(11+8+1+5))×(10+(11+8+1+5))), feature fusion can be performed as follows:
[0076] 1. Concatenate feature arrays: Concatenate A1, F2, F2_1, F2_2 (expanded to a 10×1 matrix), and F2_3 (expanded to a 10×5 matrix) along the feature dimension to obtain a 10×(11+8+1+5) feature matrix H.
[0077] 2. Calculate attention weights: Use the attention function to calculate the weight of each element in H. This usually involves multiplying H with W and normalizing the weights to between 0 and 1 through a softmax function.
[0078] 3. Weighted summation: According to the calculated weights, the elements in H are weighted and summed to obtain a fused eigenvector or matrix G fused .
[0079] This process can be expressed as: . Among them, A1' means expanding A1 into a matrix with the same number of rows as F2 (i.e., a 10×1 matrix), and F2_2' and F2_3' respectively mean expanding F2_2 and F2_3 into matrices with the same number of rows as F2. Ultimately, the feature array set G will contain A1, F2, and all optimized feature arrays extracted by the feature learning network (such as F2_1, F2_2, F2_3), which together describe the state and information of the water supply network at different feature granularities. These feature arrays will be used as inputs to the subsequent leakage detection model to identify potential leakage points in the water supply network.
[0080] Through the above steps, the computer system can make full use of the advantages of different feature learning networks, extract useful information from the water supply network sensor data set from different angles and scales, and generate a comprehensive and accurate feature array set, which provides strong data support for leakage detection and control of the water supply network.
[0081] In one implementation, step S121, the network information feature array and the value change feature array of the water supply network sensor data set at the second feature granularity are concatenated to obtain an optimized value change feature array, including:
[0082] Step S1211: using a node attention network to process the pipe network information feature array and the value change feature array of the water supply pipe network sensor data set at the second feature granularity to obtain a first focused feature array;
[0083] Step S1212: using a dimensional attention network to process the pipe network information feature array and the value change feature array of the water supply pipe network sensor data set at a second feature granularity to obtain a second focused feature array;
[0084] Step S1213: Process the integration result of the first focus feature array and the second focus feature array through a filtering and smoothing network to obtain an optimized numerical variation feature array.
[0085] In step S1211, the computer system processes B and C using a node attention network to generate a first focused feature array (denoted as F1). The node attention network is a neural network structure that can automatically learn and focus on important nodes in the data. It focuses on key information by assigning different attention weights to different nodes.
[0086] For example, suppose B is a 10×10 matrix, where each row represents a sensor monitoring node and each column represents the relationship between the node and other nodes (such as pressure difference, flow rate, etc.). C is a 10-dimensional vector representing the numerical change characteristics of each sensor monitoring node (such as pressure change rate).
[0087] The node attention network first embeds B and C, mapping them into a common feature space. Then, for each node in B, the network calculates its attention weight with all other nodes. These weights are determined based on the similarity or correlation between nodes, and nodes with higher similarity will receive higher weights.
[0088] Specifically, for the i-th row in B (i.e., the i-th sensor monitoring node), the node attention network can calculate an attention vector αi, where αij represents the attention weight of the i-th node to the j-th node. This weight can be calculated by a compatibility function (such as dot product, bilinear function, etc.) and may involve a learnable parameter matrix W and bias vector b.
[0089] The network then uses these attention weights to perform a weighted sum of the corresponding elements in B and C to generate the i-th row in F1. This process can be expressed as:
[0090] ;
[0091] Among them, B j and C j denotes the j-th column (or element) in B and C respectively, and F1 i represents the i-th row in F1.
[0092] In this way, the node attention network can automatically learn which nodes are more important in the water supply network and focus more attention on these nodes, thereby generating a feature array F1 that is more focused on key nodes.
[0093] In step S1212, the computer system processes B and C using the dimensional attention network to generate a second focused feature array (denoted as F2). Unlike the node attention network, the dimensional attention network focuses on different dimensions (or channels) in the feature array. It focuses on key features by assigning different attention weights to different dimensions.
[0094] For example, continuing with the previous example, assume that B and C have been embedded in a d-dimensional feature space (for example, through a fully connected layer or a convolutional layer). The dimensional attention network first calculates an attention weight for each dimension in this d-dimensional feature space.
[0095] These weights are also determined based on the similarity or correlation between features. For each dimension k in B and C, the dimensional attention network can calculate an attention weight βk, which can also be calculated through a compatibility function and may involve a learnable parameter matrix and bias vector.
[0096] The network then uses these attention weights to perform a weighted sum of the corresponding dimensions in B and C to generate F2. This process can be expressed as: ; where B[:,k] and C[:,k] represent the k-th column (or k-th dimension) in B and C respectively, and F2 is a matrix with the same number of rows as B and C.
[0097] In this way, the dimensional attention network can automatically learn which feature dimensions are more important in the water supply network data and focus more attention on these dimensions, thereby generating a feature array F2 that is more focused on key features.
[0098] In step S1213, the computer system integrates F1 and F2 generated in steps S1211 and S1212 using a filtering and smoothing network to generate an optimized numerical variation feature array E. A filtering and smoothing network is a neural network structure that can remove noise and smooth data. It generates a clearer and more stable output by filtering and smoothing the input data.
[0099] For example, before combining F1 and F2 together, the computer system may need to adjust them to the same dimension and scale. This can be achieved through linear transformation, interpolation, clipping, etc.
[0100] Assume that both F1 and F2 have been adjusted to an n-dimensional feature space (for example, through a fully connected layer or a convolutional layer). Then, the computer system can concatenate F1 and F2 along the feature dimension to obtain a 2n-dimensional feature array H.
[0101] Next, the filter smoothing network processes H. This network may contain multiple convolutional layers, pooling layers, fully connected layers and other components, which work together on H to remove noise and smooth data. Specifically, the convolutional layer can extract local features and suppress noise from H through the learned convolution kernel; the pooling layer can further reduce noise and redundant information through downsampling operations; and the fully connected layer can integrate and classify the extracted features.
[0102] Finally, the filter smoothing network will output an optimized feature array E, which contains useful information extracted from F1 and F2 and has undergone noise suppression and smoothing. This E will be used as input for subsequent steps to support leakage detection and control of water supply networks.
[0103] Through the above three steps, the computer system fully utilizes the advantages of node attention network and dimension attention network to extract useful information from water supply network sensor data set from different angles and scales, and removes noise through filtering and smoothing network to generate clearer and more stable optimized numerical change feature array. These features will provide strong data support for subsequent leakage detection.
[0104] In one implementation, step S122 combines the network information feature array of the water supply network sensor data set at the second feature granularity with the optimized value change feature array to obtain the optimized feature array of the water supply network sensor data set at the second feature granularity, including:
[0105] Step S1221: using a target filtering and smoothing unit to filter and smooth the optimized numerical value change feature array to obtain a filtering and smoothing result of the optimized numerical value change feature array;
[0106] Step S1222: sum the filtering smoothing result of the optimized numerical variation feature array and the network information feature array of the water supply network sensor data set at the second feature granularity based on array elements to obtain the optimized feature array of the water supply network sensor data set at the second feature granularity.
[0107] In step S122, the computer system combines the network information feature array (denoted as B) of the water supply network sensor data set at the second feature granularity with the optimized numerical change feature array (denoted as E, which is obtained by processing the node attention network, the dimension attention network and the filter smoothing network in step S121) to generate the optimized feature array (denoted as F) of the water supply network sensor data set at the second feature granularity. This process involves two key sub-steps: S1221 and S1222, which are responsible for filtering and smoothing E and combining the processing results with B. The following is a detailed explanation of these two sub-steps:
[0108] In step S1221, the computer system uses the target filtering and smoothing unit to filter and smooth the optimized numerical change feature array E. Filtering and smoothing is a signal processing technique that aims to remove noise and unnecessary fluctuations in the data while retaining or enhancing useful information. In the context of water supply network sensor data, filtering and smoothing can help improve the accuracy and reliability of the data and provide a more solid foundation for subsequent leakage detection. For example, assume that E is a 10×11 matrix, where each row represents the representation of a sensor monitoring node on the optimized numerical change feature, and each column represents a specific feature. The target filtering and smoothing unit can apply a filter to each element in E, which calculates the new value of each element according to preset smoothing parameters (such as window size, smoothing strength, etc.). The selection and design of the filter depends on the specific application scenario and data characteristics. In the processing of water supply network sensor data, commonly used filters include moving average filters, Gaussian filters, Savitzky-Golay filters, etc. These filters can smooth the data in different ways while retaining the original shape and characteristics of the data as much as possible.
[0109] Taking the moving average filter as an example, it can smooth the data by calculating the average value within a certain window around each element. Assuming that a moving average filter with a window size of 3 is selected, then for each element E[i,j] in E, its new value can be calculated by the following formula:
[0110] ;
[0111] Among them, E'[i,j] represents the filtered value, E[i-1,j], E[i,j] and E[i+1,j] represent the values of the current element in E and its first two and last two adjacent elements respectively (Note: In practical applications, it may be necessary to deal with boundary conditions, such as when i=1, E[i-1,j] may not exist).
[0112] The target filtering and smoothing unit can apply multiple such filters, or adopt more complex filtering strategies (such as adaptive filtering, wavelet transform, etc.) to achieve the best smoothing effect. The filtered result (denoted as E') will be used as the input of the subsequent steps.
[0113] In step S1222, the computer system combines the filtering and smoothing result E' obtained in step S1221 with the network information feature array B of the water supply network sensor data set at the second feature granularity. The combination is achieved by summing the array elements. This step aims to combine the optimized numerical change feature (after filtering and smoothing) with the original network information feature to generate an optimized feature array F containing more useful information.
[0114] For example, continuing with the previous example, assume that B is a 10×10 matrix, representing the network information characteristics of the water supply network at the second feature granularity (such as pressure difference, flow, etc.). Now, it is necessary to combine E' (a 10×11 matrix) with B (a 10×10 matrix).
[0115] Since E' and B have different numbers of columns, it is not feasible to perform the sum operation directly. Therefore, before the computer system performs the combination operation, it may be necessary to adjust E' or B so that they have the same number of columns. One method is to expand B into a 10×11 matrix (denoted as B'), where the newly added columns can be obtained by copying a column in B or filling it with zero values.
[0116] The computer system can then perform an element-wise sum operation on E' and B' to generate an optimized feature array F. This process can be expressed as:
[0117] ;
[0118] Among them, F[i,j] represents the element value in the i-th row and j-th column of F, and E'[i,j] and B'[i,j] represent the element values in the corresponding positions in E' and B' respectively.
[0119] Through the summation operation, the optimized numerical change characteristics (after filtering and smoothing) are effectively combined with the original pipe network information characteristics. This combination not only retains the spatial distribution information in B, but also incorporates the time change information and noise suppression effect in E', thereby generating a more comprehensive and accurate optimized feature array F.
[0120] F will serve as the input for subsequent steps (such as leakage detection) and provide strong data support for leakage control of the water supply network. By continuously optimizing the filtering and smoothing units and combination strategies, the computer system can further improve the processing efficiency and accuracy of the sensor data of the water supply network and contribute to the sustainable use of water resources.
[0121] In one embodiment, the method further comprises:
[0122] Step S210: splitting the feature array in the feature array set into component feature arrays of multiple value change speeds;
[0123] Step S220: optimizing the feature arrays in the feature array set by using component feature arrays of multiple value change rates to obtain an iterated feature array set.
[0124] In step S210, the computer system performs an in-depth analysis of the feature arrays in the feature array set, with the goal of splitting them into component feature arrays reflecting different numerical change rates. The motivation for this step is that water flow parameters (such as pressure, flow, etc.) in the water supply network often show a variety of change rates, including rapid changes and slow changes. Rapid changes may indicate potential leakage or emergencies, while slow changes may reflect the long-term operating trend of the network. By splitting out these components with different change rates, the computer system can more accurately identify features related to leakage.
[0125] For example, assume that the feature array set contains two main feature arrays: the pipe network information feature array A1 (10-dimensional vector) at the first feature granularity and the optimized feature array F (10×11 matrix) at the second feature granularity. In order to separate the component feature arrays with different numerical change speeds, the computer system can use Fourier transform, wavelet transform or other signal processing techniques.
[0126] Taking Fourier transform as an example, the computer system first performs Fourier transform on each row (or column, depending on the specific implementation) of A1 and F to convert it from the time domain to the frequency domain. In the frequency domain, high-frequency components correspond to fast changes, and low-frequency components correspond to slow changes. By setting a suitable frequency threshold, the computer system can split the frequency domain signal into high-frequency and low-frequency parts, and then perform inverse Fourier transforms respectively to convert the high-frequency and low-frequency parts back to the time domain, obtaining the fast-changing component feature array and the slow-changing component feature array.
[0127] Assume that after Fourier transform and splitting, A1 is split into fast-changing component feature array A1 fast (10-dimensional vector) and slowly varying component feature array A1 slow (10-dimensional vector), F is split into the fast-changing component feature array F fast (10×11 matrix) and the slowly varying component feature array F slow (10×11 matrix).
[0128] In step S220, the computer system uses the component feature arrays (such as A1 fast 、A1 slow 、F fast 、F slow ) Optimize the original feature array in the feature array set. The purpose of this step is to generate a more comprehensive and accurate feature representation by fusing information of different change speeds, thereby improving the accuracy of leakage detection.
[0129] For example, the optimization process may involve a variety of techniques, such as feature fusion, attention mechanism, neural network, etc. Taking feature fusion as an example, the computer system can concatenate or weighted sum the fast-changing component feature array and the slow-changing component feature array to generate a new fused feature array. These fused feature arrays can then be used as input to the subsequent leakage detection model.
[0130] Assume that the feature fusion is performed by splicing. First, the computer system converts A1 fast and A1 slow Splice into a new vector A1 fused (20-dimensional vector), F fast and F slow Splice into a new matrix F fused (10×22 matrix). Then, A1 fused and F fused It can be used as part of the optimized feature array set for subsequent leakage detection.
[0131] In addition to concatenation, computer systems can also adopt more complex fusion strategies, such as attention mechanisms. Attention mechanisms allow models to automatically learn the importance relationships between different feature arrays and perform weighted summations of features based on these relationships. For example, for A1 fast 、A1 slow 、F fast and F slow , a computer system can train an attention network that assigns a weight to each feature array and then sums them according to these weights to produce a fused feature representation.
[0132] In addition, neural networks can also be used for optimization processes. For example, a computer system can build a multi-layer perceptron (MLP) or a convolutional neural network (CNN), which takes the fast-changing component feature array and the slow-changing component feature array as input, extracts and transforms features through a series of hidden layers, and finally outputs an optimized feature representation. This feature representation will contain the useful information in the original feature array, and has been enhanced and optimized for components with different changing speeds.
[0133] Through the processing of steps S210 and S220, the computer system can generate a more comprehensive and accurate feature array set, which not only contains the information in the original feature array, but also incorporates the component characteristics of different numerical change speeds. These optimized feature arrays will provide more powerful data support for subsequent leakage detection, helping to improve the accuracy and efficiency of leakage detection.
[0134] In one implementation, step S210, splitting the feature array in the feature array set into component feature arrays of multiple value change rates, including:
[0135] Step S211: Perform Fourier transform on the pipe network information feature array of the water supply pipe network sensor data set at the first feature granularity and the optimized feature array of the water supply pipe network sensor data set at k feature granularities to obtain k+1 fast-changing component feature arrays and k+1 slowly changing component feature arrays;
[0136] Step S212: Use a bilinear pooling network to perform feature optimization on the k+1 fast-changing component feature arrays and the k+1 slowly-changing component feature arrays, respectively, to obtain k+1 optimized fast-changing component feature arrays and k+1 optimized slowly-changing component feature arrays.
[0137] In step S211, the computer system performs Fourier transform on the pipe network information feature array (denoted as A1) of the water supply pipe network sensor data set at the first feature granularity and the optimized feature array (denoted as F1, F2, ..., Fk) at k feature granularities. Fourier transform is a mathematical tool that converts signals from the time domain to the frequency domain, which can help the computer system identify different frequency components in the signal, namely fast-changing and slow-changing components.
[0138] For example, suppose A1 is a 10-dimensional vector representing the pressure distribution of the water supply network at the macro level; F1, F2, ..., Fk are optimized feature arrays at k different feature granularities, each of which may have different dimensions and structures, but for the sake of convenience, assume that they are all 10×11 matrices, representing the network information features at a finer granularity. The computer system first performs a Fourier transform on each feature array. For A1, this can be expressed as:
[0139] ;
[0140] in, represents the Fourier transform operation, is the representation of A1 in the frequency domain.
[0141] For F1, F2, ..., Fk, since they are matrices, Fourier transform usually needs to be performed on each dimension separately. But here, in order to simplify the explanation, it is assumed that a one-dimensional Fourier transform is performed on each row (or column) of the matrix. In this way, for each row Fi[i,:] (i=1,2,...,10) in F1, there is: ;in, represents the representation of the i-th row in Fi in the frequency domain. After Fourier transform, the computer system obtains the representation of A1 and F1, F2, ..., Fk in the frequency domain. Next, the computer system sets a frequency threshold to distinguish between fast-changing and slow-changing components. Frequency components above the threshold are considered fast-changing components, and those below the threshold are considered slow-changing components.
[0142] Assume that a frequency threshold ω is set thresh , then for A1 freq Each frequency component A1 freq [j] (j=1,2,...,10), if its frequency is higher than ω thresh , it is classified as a fast-changing component; otherwise, it is classified as a slow-changing component. freq ,F2 freq ,...,Fk freq The same classification is performed on each frequency component in .
[0143] Finally, the computer system obtains k+1 fast-changing component feature arrays (denoted as A1 fast ,F1 fast ,F2 fast ,...,Fk fast ) and k+1 slowly varying component feature arrays (denoted as A1 slow ,F1 slow ,F2 slow ,...,Fk slow ).
[0144] In step S212, the computer system uses a bilinear pooling network (or other types of neural networks such as a recurrent neural network, transformer, etc.) to optimize the fast-changing component feature array and the slowly-changing component feature array obtained in step S211. The bilinear pooling network is a neural network structure that can capture the interactive relationship between features. It generates a more expressive feature representation by performing bilinear transformation and pooling operations on the features.
[0145] For example, taking a bilinear pooling network as an example, the network may contain multiple components such as filter units, node attention units, and dimension attention units. First, the filter unit filters each component feature array to remove noise and redundant information. Then, the node attention unit and dimension attention unit focus on different nodes and dimensions in the feature array respectively, and enhance important features and suppress unimportant features by calculating attention weights.
[0146] Assume that A1 fast First, the filter unit will optimize the characteristics of A1 fastPerform filtering to generate a filtered feature array A1 _fast_filtered Then, the node attention unit calculates A1 _fast_filtered The attention weight of each node in A1 generates an attention weight vector α. Then, the dimensional attention unit calculates A1 _fast_filtered The attention weights for each dimension in generate another attention weight vector β.
[0147] Finally, the bilinear pooling network will transform A1 _fast_filtered , α and β perform bilinear transformation and pooling operations to generate the optimized fast-changing component feature array A1 _fast_optimized . This process can be expressed as: ;
[0148] Among them, Bilinear represents a bilinear transformation operation, and Pool represents a pooling operation.
[0149] Likewise, the computer system will also be F1 fast ,F2 fast ,...,Fk fast and A1 slow ,F1 slow ,F2 slow ,...,Fk slow Perform the same feature optimization process to generate an optimized fast-changing component feature array set (denoted as A1 _fast_optimized ,F1 _fast_optimized ,F2 _fast_optimized ,...,Fk _fast_optimized ) and the optimized slowly varying component feature array set (denoted as A1 _slow_optimized ,F1 _slow_optimized ,F2 _slow_optimized ,...,Fk _slow_optimized ).
[0150] Through the processing of steps S211 and S212, the computer system successfully splits the feature array in the feature array set into component feature arrays with multiple value change speeds, and optimizes the features of these component feature arrays. These optimized component feature arrays will provide more accurate and effective data support for subsequent leakage detection.
[0151] In one implementation, step S211, Fourier transform is performed on the pipe network information feature array of the water supply pipe network sensor data set at the first feature granularity, and the optimized feature array of the water supply pipe network sensor data set at k feature granularities, respectively, to obtain k+1 fast-changing component feature arrays and k+1 slowly changing component feature arrays, including:
[0152] Step S2111: filtering and smoothing the network information feature array of the water supply network sensor data set at the first feature granularity according to the first filter and the second filter, respectively, to obtain a fast-changing array and a slow-changing array of the water supply network sensor data set at the first feature granularity;
[0153] Step S2112: performing sparse extraction on the fast-changing array and the slow-changing array of the water supply network sensor data set at the first feature granularity to obtain a first fast-changing component feature array and a first slow-changing component feature array;
[0154] Step S2113: filtering and smoothing the optimized feature array of the water supply network sensor data set at the x+1th feature granularity according to the first filter and the second filter, respectively, to obtain a fast-changing array and a slowly-changing array of the water supply network sensor data set at the x+1th feature granularity, where x is a natural number greater than 0 and less than k;
[0155] Step S2114: perform sparse extraction on the fast-changing array and the slow-changing array of the water supply network sensor data set at the x+1th feature granularity to obtain the x+1th fast-changing component feature array and the x+1th slow-changing component feature array.
[0156] In step S2111, the computer system first focuses on the network information feature array (denoted as A1) of the water supply network sensor data set at the first feature granularity. A1 may be a vector or matrix containing data of multiple sensor monitoring nodes, and each element represents a specific parameter of a node (such as pressure, flow, etc.). In order to extract the fast-changing and slow-changing components from A1, the computer system first applies two filters: the first filter (denoted as H1) and the second filter (denoted as H2).
[0157] For example, assume that A1 is a 10-dimensional vector representing the pressure values of 10 sensor monitoring nodes. H1 and H2 can be two filter matrices with different parameters used to smooth A1. The selection and design of the filter depends on the specific application scenario and data characteristics. Here, assume that H1 is a low-pass filter used to retain low-frequency components (i.e., slowly changing components), while H2 is a high-pass filter used to retain high-frequency components (i.e., quickly changing components).
[0158] The computer system multiplies A1 with H1 and H2 respectively through matrix multiplication to obtain two filtered arrays: A1 slow =A1×H1;A1 fast =A1×H2; where A1 slow represents the slowly changing component in A1, A1 fastrepresents the fast-changing components in A1. These two arrays will be used in the subsequent sparse extraction steps.
[0159] In step S2112, the computer system processes the fast changing array (A1 fast ) and the slowly changing array (A1 slow ) for sparse extraction. Sparse extraction is a technique to reduce data redundancy and retain key information. Common methods include downsampling and sparse coding. Here, it is assumed that downsampling is used as the sparse extraction method.
[0160] For example, downsampling typically involves selecting evenly spaced sample points in the data series to reduce the number of data points. fast and A1 slow , the computer system can select a downsampling factor (such as 2, 3, etc.), and then take a value every one or more sample points to generate a sparsely extracted array.
[0161] Assuming the downsampling factor is 2, then for A1 fast Each element in A1 fast [i] (i=1,2,...,10), the sparsely extracted array will contain element A1 fast [1],A1 fast [3],A1 fast [5],...,A1 fast [9] (Assume array indexing starts at 1). Similarly, for A1 slow The same downsampling operation is also performed.
[0162] After sparse extraction, the computer system obtains the first fast-changing component feature array (denoted as A1 _fast_sparse ) and the first slowly varying component feature array (denoted as A1 _slow_sparse ). These two arrays will serve as input for subsequent leakage detection or feature optimization.
[0163] In step S2113, the computer system will focus on the optimized feature array (denoted as Fx+1) of the water supply network sensor data set at the x+1th feature granularity, where x is a natural number greater than 0 and less than k. Fx+1 may be a high-dimensional array (such as a matrix or tensor) containing more detailed network information. Similar to step S2111, the computer system will apply the same first filter H1 and second filter H2 to filter and smooth Fx+1.
[0164] For example, suppose Fx+1 is a 10×11 matrix, representing the optimized eigenvalues of 10 sensor monitoring nodes on 11 different feature dimensions. Similar to the processing of A1, the computer system multiplies Fx+1 with H1 and H2 respectively through matrix multiplication to obtain two filtered arrays: Fx+1 slow =Fx+1×H1; Fx+1 fast =Fx+1×H2.
[0165] Among them, Fx+1 slow represents the slowly changing component in Fx+1, Fx+1 fast represents the fast changing components in Fx+1. These two arrays will also be used in the subsequent sparse extraction step.
[0166] In step S2114, the computer system processes the fast changing array (Fx+1 fast ) and slowly changing arrays (Fx+1 slow ) to perform sparse extraction. Similar to step S2112, downsampling is also used as the sparse extraction method here.
[0167] For example, for Fx+1 fast and Fx+1 slow , the computer system selects a downsampling factor and performs downsampling operations on each feature dimension. Assuming the downsampling factor is still 2, then for Fx+1 fast Each element in Fx+1 fast [i,j] (i=1,2,...,10; j=1,2,...,11), the sparsely extracted array will contain the element Fx+1 fast [1,1],Fx+1 fast [1,3],...,Fx+1 fast [1,11],Fx+1 fast [3,1],Fx+1 fast [3,3],...,Fx+1 fast [9,11], etc. (assuming array indexing starts at 1). Similarly, for Fx+1 slow The same downsampling operation is also performed.
[0168] After sparse extraction, the computer system obtains the x+1th fast-changing component feature array (denoted as Fx+1 _fast_sparse ) and the x+1th slowly varying component feature array (denoted as Fx+1 _slow_sparse ). These two arrays will be combined with A1 obtained in step S2112 _fast_sparse and A1 _slow_sparse Together, they form the input feature set for subsequent steps.
[0169] Through the processing of steps S2111 to S2114, the computer system splits the pipe network information feature array at the first feature granularity and the optimized feature array at k feature granularities of the water supply pipe network sensor data set into fast-changing and slowly-changing component feature arrays. These component feature arrays not only retain the key information in the original data, but also reduce data redundancy and noise interference through filtering smoothing and sparse extraction technology. These optimized feature arrays will provide more accurate and effective data support for subsequent leakage detection or feature optimization.
[0170] In one implementation, the bilinear pooling network includes a filter unit, a node attention unit, and a dimension attention unit; step S212, using the bilinear pooling network to perform feature optimization on k+1 fast-changing component feature arrays and k+1 slowly-changing component feature arrays, respectively, to obtain k+1 optimized fast-changing component feature arrays and k+1 optimized slowly-changing component feature arrays, including:
[0171] Step S2121: Processing the yth fast-changing component feature array and the yth slowly-changing component feature array respectively through a filter unit to obtain a processing result of the yth fast-changing component feature array and a processing result of the yth slowly-changing component feature array, where y is a natural number greater than 0 and not greater than k+1;
[0172] Step S2122: using the dimensional attention unit to optimize the processing results of the yth fast-changing component feature array and the yth slowly-changing component feature array in terms of dimensional angle, respectively, to obtain the yth fast-changing temporary array and the yth slowly-changing temporary array;
[0173] Step S2123: Use the node attention unit to optimize the node angles of the yth fast-changing temporary array and the yth slowly-changing temporary array, respectively, to obtain the yth optimized fast-changing component feature array and the yth optimized slowly-changing component feature array.
[0174] In step S212, the computer system uses a bilinear pooling network to optimize the k+1 fast-changing component feature arrays and k+1 slowly changing component feature arrays obtained in step S211. This process is intended to further enhance the expressiveness of these feature arrays, making them more suitable for subsequent leakage detection or other analysis tasks. The bilinear pooling network contains three key components: filter units, node attention units, and dimension attention units, which are responsible for different processing tasks.
[0175] In step S2121, the computer system first uses the filter unit in the bilinear pooling network to filter the y-th fast-changing component feature array (denoted as F_fast_y ) and the yth slowly varying component feature array (denoted as F _slow_y ) for processing. Here y is a natural number greater than 0 and not greater than k+1, indicating the index of the feature array currently being processed.
[0176] For example, suppose F _fast_y is a 10-dimensional vector, representing the y-th fast-changing component feature array; F _slow_y It is also a 10-dimensional vector, representing the yth slowly varying component feature array. The filter unit may contain multiple learnable filters that can perform convolution, pooling, or other types of transformations on the input feature array to extract more useful features.
[0177] Specifically, the filter unit can be used to _fast_y and F _slow_y A series of filters are applied separately, each filter corresponds to a specific weight matrix and bias vector. Through matrix multiplication and non-linear activation functions (such as ReLU, sigmoid, etc.), the filter unit can generate a processed feature array.
[0178] Assume that the filter unit contains two filters, denoted as W fast and W slow , and the corresponding bias vector b fast and b slow Then, for F _fast_y and F _slow_y The processing can be expressed as:
[0179] F _fast_y_processed =ReLU(F _fast_y ×W fast +b fast ) ;
[0180] F _slow_y_processed =ReLU(F _slow_y ×W slow +b slow );
[0181] Among them, × represents matrix multiplication, and ReLU represents the ReLU activation function. The processed feature array F _fast_y_processed and F _slow_y_processed Will serve as input for subsequent steps.
[0182] In step S2122, the computer system uses the dimensional attention unit in the bilinear pooling network to process the processing result (i.e., F _fast_y_processed and F _slow_y_processed) to optimize the dimension. The dimensional attention unit can automatically learn the importance of different dimensions in the feature array and perform weighted summation of the features according to these importances, thereby generating a more compact and effective feature representation.
[0183] For example, the dimensional attention unit can calculate an attention weight vector for each feature array, where each element in the vector corresponds to a dimension in the feature array. The size of the weight indicates the importance of the corresponding dimension. The dimensional attention unit then performs a weighted summation of the feature arrays according to these weights to generate an optimized temporary array.
[0184] Assume that the dimension attention unit is F _fast_y_processed Calculate an attention weight vector α fast , is F _slow_y_processed Calculate an attention weight vector α slow Then, the optimization of the dimension angle can be expressed as:
[0185] F _fast_y_temp =F _fast_y_processed α fast ;
[0186] F _slow_y_temp =F _slow_y_processed α slow ;
[0187] Where · represents element-wise multiplication. The optimized temporary array F _fast_y_temp and F _slow_y_temp It will be used as input for subsequent steps. The attention weight vector α fast and α slow The weights are learned and may depend on the specific content of the input feature array and other contextual information. In practical applications, the dimensional attention unit can use more complex mechanisms to calculate these weights, such as using a multi-layer perceptron (MLP) or a recurrent neural network (RNN).
[0188] In step S2123, the computer system uses the node attention unit in the bilinear pooling network to perform an attention analysis on the temporary array (i.e., F _fast_y_temp and F _slow_y_temp ) to optimize the node angle. The node attention unit can automatically learn the importance of different nodes in the feature array, and perform weighted summation or other types of transformations on the features based on these importances to generate the final optimized feature array.
[0189] For example, suppose F _fast_y_temp and F _slow_y_tempare all 10-dimensional vectors, representing the yth fast-changing temporary array and the yth slowly changing temporary array, respectively. The node attention unit can calculate an attention weight vector for each vector, where each element in the vector corresponds to a node (or element) in the vector. The node attention unit then performs a weighted sum or other type of transformation on the vectors based on these weights to generate an optimized feature array.
[0190] Similar to the dimensional attention unit, the way the node attention unit calculates the attention weights may depend on the specific content of the input feature array and other contextual information. In practical applications, the node attention unit can use more complex mechanisms to calculate these weights, such as using graph neural networks (GNNs) or attention mechanisms.
[0191] Assume that the node attention unit is F _fast_y_temp Calculate an attention weight vector β fast , is F _slow_y_temp Calculate an attention weight vector β slow Then, the optimization of the node angle can be expressed as:
[0192] F _fast_y_optimized =F _fast_y_temp β fast ;
[0193] F _slow_y_optimized =F _slow_y_temp · βslow ;
[0194] Here, · also represents element-wise multiplication. The optimized feature array F _fast_y_optimized and F _slow_y_optimized It will be used as the output of subsequent steps for subsequent leakage detection or other analysis tasks.
[0195] Through the processing of steps S2121 to S2123, the computer system uses a bilinear pooling network to optimize the features of the fast-changing component feature array and the slowly-changing component feature array. The filter unit, the dimension attention unit, and the node attention unit are responsible for different processing tasks, and together improve the expressiveness of the feature array. The optimized feature array not only retains the key information in the original data, but also enhances the importance of important features through the attention mechanism, providing more accurate and effective data support for subsequent leakage detection.
[0196] In one implementation, the component feature arrays of multiple value change speeds include k+1 optimized fast-changing component feature arrays and k+1 optimized slowly changing component feature arrays; step S220, optimizing the feature arrays in the feature array set by using the component feature arrays of multiple value change speeds, and obtaining the iterated feature array set includes:
[0197] Step S221: fusing k+1 optimized fast-changing component feature arrays to obtain a fast-changing optimized feature array set, and fusing k+1 optimized slowly-changing component feature arrays to obtain a slowly-changing optimized feature array set;
[0198] Step S222: using a filtering and smoothing unit to splice the fast-changing optimized feature array set and the pipe network information feature array of the water supply pipe network sensor data set at the first feature granularity to obtain a first splicing result;
[0199] Step S223: using a filtering and smoothing unit to splice the slowly changing optimized feature array set with the optimized feature array of the water supply network sensor data set at the kth feature granularity to obtain a second splicing result.
[0200] In step S220, the computer system optimizes the feature arrays in the feature array set using the component feature arrays of multiple numerical change speeds obtained in step S212 (i.e., k+1 optimized fast-changing component feature arrays and k+1 optimized slow-changing component feature arrays). This process aims to generate a more expressive feature representation by fusing fast-changing and slow-changing information at different feature granularities to support subsequent leakage detection or other analysis tasks.
[0201] In step S221, the computer system first needs to optimize the k+1 fast-changing component feature arrays (denoted as F _fast_optimized _1,F _fast_optimized _2,...,F _fast_optimized_k+1 ) to generate a fast-changing optimized feature array set. Similarly, the system also needs to optimize the k+1 slowly changing component feature arrays (denoted as F _slow_optimized _1,F _slow_optimized _2,...,F _slow_optimized_k+1 ) are fused to generate a slowly varying optimized feature array set.
[0202] For example, assume that each optimized fast-changing component feature array and slow-changing component feature array is a 10-dimensional vector. In order to fuse these arrays, the computer system can use a variety of methods, such as weighted averaging, maximum pooling, attention mechanism, etc. Here, weighted averaging is used as an example for explanation.
[0203] For the fusion of fast-changing component feature arrays, the computer system can assign a weight to each array (these weights can be learned), and then perform a weighted summation of the arrays based on these weights. Assume that F _fast_optimized_y The weight assigned to (y=1,2,...,k+1) is w _fast_y, then the fast changing optimization feature array set (denoted as F _fast_fused ) can be calculated by the following formula:
[0204] ;
[0205] Here, ∑ represents the sum operation and · represents element-wise multiplication.
[0206] Similarly, for the fusion of slowly varying component feature arrays, the computer system can also assign a weight (denoted as w) to each array. _slow_y ), and obtain the slowly changing optimized feature array set (denoted as F) through weighted summation. _slow_fused ).
[0207] By fusing fast-changing and slow-changing information at different feature granularities, the computer system generates more expressive feature representations that will be used in subsequent steps.
[0208] In step S222, the computer system uses a filtering and smoothing unit to transform the fast-changing optimization feature array set (F _fast_fused ) is concatenated with the network information feature array (denoted as A1) of the water supply network sensor dataset at the first feature granularity. This step aims to combine the optimized fast-changing information with the original network information to generate a feature representation containing more useful information.
[0209] For example, suppose A1 is a 10-dimensional vector, representing the network information characteristics of the water supply network at the macro level. _fast_fused To splice, the computer system may need to expand or convert A1 to a _fast_fused arrays of the same dimension. If F _fast_fused If the dimension is 10, then this step may not require any operation; if the dimension is different, appropriate adjustments need to be made.
[0210] Here, assuming that A1 and F _fast_fused are all 10-dimensional vectors, then the concatenation operation can simply add them element-wise or concatenate them into a longer vector. However, in practical applications, in order to maintain the independence and interpretability of features, it is more common to concatenate them into a new matrix or vector, one part of which contains the elements of A1 and the other part contains the elements of F. _fast_fused elements.
[0211] Assume that the result after splicing is recorded as F _fast_combined, then it may be a 20-dimensional vector (if simply concatenated) or a 2×10 matrix (if concatenated by rows or columns). In order to maintain the smoothness of the data and reduce noise interference, the computer system can use a filtering and smoothing unit to further process the concatenated result. The filtering and smoothing unit can be a low-pass filter, a moving average filter, or other types of smoothing filters, which can smooth the data to reduce noise and fluctuations.
[0212] After filtering and smoothing, the computer system obtains the first splicing result (denoted as F _fast_smoothed ), which contains the fusion representation of the optimized fast-changing information and the original pipe network information.
[0213] In step S223, the computer system uses the same filtering and smoothing unit as in step S222 to transform the slowly changing optimized feature array set (F _slow_fused ) and the optimized feature array of the water supply network sensor dataset at the kth feature granularity (denoted as F_ k_optimized ) for splicing. This step is similar to step S222, and is intended to combine the optimized slowly changing information with finer-grained pipe network information.
[0214] For example, suppose F_ k_optimized is a 10×11 matrix, representing the optimized feature array at the kth feature granularity. Similar to step S222, the computer system may need to first _slow_fused (assuming it is a 10-dimensional vector) is expanded or converted to a vector with the same dimension as F_ k_optimized Arrays of compatible dimensions. They can then be concatenated into a new matrix or vector.
[0215] The splicing operation may involve F _slow_fused The elements of F_ are copied to k_optimized Each column (or row) of k_optimized Regardless of the method used, the concatenated result will contain a fusion representation of the slowly changing optimized feature array set and the finer-grained optimized feature array.
[0216] Similarly, in order to maintain the smoothness of the data and reduce noise interference, the computer system will use a filtering and smoothing unit to further process the spliced results. The processed result is recorded as F _slow_smoothed , which contains a fusion representation of optimized slowly changing information and finer-grained pipe network information.
[0217] Through the processing of step S220 and its sub-steps S221 to S223, the computer system successfully combines the component feature arrays of multiple numerical change speeds with the original pipe network information feature array and the more fine-grained optimized feature array, generating feature representations containing more useful information. These feature representations not only integrate information at different feature granularities, but also reduce noise and fluctuations through filtering and smoothing, providing more accurate and reliable data support for subsequent leakage detection or other analysis tasks.
[0218] In one implementation, step S221, k+1 optimized fast-changing component feature arrays are merged to obtain a fast-changing optimized feature array set, including:
[0219] Step S2211: using a fusion network to fuse the input of the tth round and the k-t+1th optimized fast-changing component feature array to obtain the tth fusion result, where t is a natural number greater than 0 and not greater than k;
[0220] If t is 1, the input of the tth round is the k+1th optimized fast-changing component feature array;
[0221] If t is less than k+1, the input of the tth round is the t-1th fusion result.
[0222] In step S2211, the computer system uses a fusion network to perform iterative fusion operations. This fusion network may be a multi-layer perceptron (MLP), a convolutional neural network (CNN), a recurrent neural network (RNN), or other types of neural networks, depending on the characteristics of the data and the requirements of the task. The goal of the fusion network is to fuse the input of the current round with the k-t+1th optimized fast-changing component feature array to generate the tth fusion result.
[0223] For example, suppose there are k+1 optimized fast-changing component feature arrays, denoted as F _fast_optimized _1,F _fast_optimized _2,...,F _fast_optimized _ k+1 These arrays may have different dimensions and structures, but for ease of explanation, assume that they are all 10-dimensional vectors. The goal is to generate a final set of fast-changing optimized feature arrays by iteratively fusing these arrays.
[0224] In the first round (t=1) of fusion, the computer system combines the k+1th optimized fast-changing component feature array (i.e., F _fast_optimized _ k+1) as input and fuse it with itself (in fact, in this round, the fusion operation may be simplified to directly output the input array, because there is no other array to fuse with it). The result after the fusion network is processed is the first fusion result, denoted as F _fast_fused _1.
[0225] Starting from the second round (t=2), the input of each round is the fusion result of the previous round. For example, in the second round of fusion, the computer system will take the first fusion result (F _fast_fused_1 ) as input, and the k-1th optimized fast-changing component feature array (i.e., F _fast_optimized_k ) for fusion. The result after fusion network processing is the second fusion result, denoted as F _fast_fused_2 .
[0226] This process continues until the k+1th round (in fact, since the value of t ranges from 1 to k, the last round is the kth round). In the kth round of fusion, the computer system will use the k-1th fusion result (i.e. F _fast_fused _ k+1 ) as input, and the first optimized fast-changing component feature array (i.e., F _fast_optimized_1 ) for fusion. The result after fusion network processing is the final fast-changing optimized feature array set, denoted as F _fast_fused_final .
[0227] The specific implementation of the fusion network depends on the characteristics of the data and the requirements of the task. Here, a simplified MLP is used as an example to illustrate the working principle of the fusion network. Assume that the fusion network is an MLP with two hidden layers, each hidden layer has 10 neurons, and the activation function is ReLU. For each round of fusion, the fusion network first concatenates the input array (the input of the current round and the k-t+1th optimized fast-changing component feature array) into a longer vector (if they have different dimensions, appropriate adjustments or expansions may be required). Then, this concatenated vector is input into the MLP, and through the nonlinear transformation of the two hidden layers, a fused vector is finally output.
[0228] Taking the second round of fusion as an example, assuming that F _fast_fused _1 and F _fast_optimized_k They are all 10-dimensional vectors, which are concatenated into a 20-dimensional vector as the input of the MLP. The first hidden layer of the MLP will perform linear transformation and nonlinear activation (ReLU) on the 20-dimensional input vector to generate a 10-dimensional hidden layer output. Then, this hidden layer output is input to the second hidden layer, and again undergoes linear transformation and nonlinear activation to generate the final fusion result F _fast_fused _2.
[0229] It should be noted that in practical applications, the structure and parameters of the fusion network may need to be determined through training. The training process usually involves using a water supply network sensor dataset with known leakage status to supervise the learning of the model, and adjusting the model parameters through the back-propagation algorithm so that the model can accurately extract useful features from the input array and perform effective fusion.
[0230] Through the iterative fusion operation of step S2211, the computer system can gradually accumulate and fuse the fast-changing information at different feature granularities to generate a more expressive fast-changing optimized feature array set. This feature array set will serve as input for subsequent steps to provide more powerful data support for leakage detection or other analysis tasks.
[0231] In one implementation, the fusion network includes a regionalized mapping unit; step S2211, using the fusion network to fuse the input of the tth round and the k-t+1th optimized fast-changing component feature array to obtain the tth fusion result, including:
[0232] Step S22111: using a regionalized mapping unit to synchronously adjust the input of the tth round with the data extraction result to obtain a synchronous adjustment result, where the data extraction result is obtained by sparsely extracting the k-t+1th optimized fast-changing feature array;
[0233] Step S22112: correcting the offset and the proportional parameter in combination with the synchronous adjustment result to obtain a corrected offset and a corrected proportional parameter;
[0234] Step S22113: determining the broadcast multiplication value of the k-t+1th optimized fast-changing feature array and the first interpolation result to obtain a temporary value, where the first interpolation result is obtained by linearly interpolating the corrected proportional parameter;
[0235] Step S22114: sum the temporary value and the second interpolation result according to the array elements to obtain the tth fusion result; the second interpolation result is obtained by linear interpolation of the corrected offset.
[0236] In step S2211, the computer system uses a fusion network to fuse the input of the tth round and the k-t+1th optimized fast-changing component feature array to generate the tth fusion result. In this process, the fusion network includes a key component, the regional mapping unit, which is responsible for synchronously adjusting the input array and the data extraction result, and correcting the offset and scale parameters based on these adjustment results, and finally generating the fusion result through interpolation and summation operations.
[0237] In step S22111, the computer system first uses the regionalization mapping unit to map the input of the tth round (denoted as X t) is adjusted synchronously with the data extraction result. The data extraction result is the optimized fast-changing feature array (denoted as F _fast_optimized _ k-t+1 ) is obtained by sparse extraction, which may contain F _fast_optimized _ k-t+1 Some key information or features in.
[0238] For example, suppose X t is a 10-dimensional vector representing the input features of the tth round; F _fast_optimized _ k-t+1 is also a 10-dimensional vector, representing the k-t+1th optimized fast-changing feature array. _fast_optimized _ k-t+1 To extract key information from a feature vector, a computer system may employ downsampling, sparse coding, or other sparse extraction techniques. For example, downsampling may involve selecting evenly spaced sample points in a feature vector to reduce the number of data points while retaining key information.
[0239] Assume that the result of sparse extraction is a 5-dimensional vector (denoted as F _sparse _ k-t+1 ), which contains F _fast_optimized _ k-t+1 Next, the regionalization mapping unit will map X t and F _sparse _ k-t+1 Make synchronous adjustments.
[0240] Synchronization adjustment may involve changing X t and F _sparse_k-t+1 Map the localized features into a common feature space so that they can be compared and fused at the same scale. This can be achieved through linear transformations, nonlinear activation functions, or other mapping techniques. For example, the regionalized mapping unit may contain two learnable linear transformation matrices (denoted as W x and W f ), respectively used for X t and F _sparse_k-t+1 Transform: X' t =X t ×W x +b x ;F' _sparse_k-t+1 =F _sparse_k-t+1 ×W f +b f ; Among them, X' t and F' _sparse_k-t+1 Respectively represent the transformed input features and data extraction results, b x and b f is the bias vector.
[0241] After synchronization adjustment, X' t and F' _sparse_k-t+1 They will be in the same feature space, providing a basis for subsequent fusion operations.
[0242] In step S22112, the computer system combines the synchronization adjustment result (ie, X' t and F' _sparse_k-t+1 ) to correct the offset and scale parameters. The offset and scale parameters are parameters used to adjust the scale and position of the feature vector. They can be obtained through learning and dynamically adjusted according to the changes in the input data. For example, suppose the initial offset and scale parameters are recorded as b and s respectively. During the correction process, the computer system can calculate X'_t and F' _sparse_k-t+1 Some metric between them (such as Euclidean distance, cosine similarity, etc.), and adjust b and s according to this metric.
[0243] For example, if Euclidean distance is used as the metric, the calculation formula may be as follows:
[0244] d=|X'_t-F' _sparse_k-t+1 |;
[0245] Where d represents X' t and F' _sparse_k-t+1 The computer system can then adjust b and s based on the value of d:
[0246] b' = b + Delta b·f(d);
[0247] s' = s·(1+Delta s·g(d));
[0248] Where b' and s' represent the corrected offset and proportional parameters, respectively; Delta b and Delta s are the adjustment steps; f(d) and g(d) are adjustment functions, which may dynamically adjust the offset and proportional parameters according to the value of d.
[0249] In step S22113, the computer system determines the k-t+1th optimized fast-changing feature array (F _fast_optimized_k-t+1 ) and the broadcast multiplication value of the first interpolation result to obtain a temporary value. The first interpolation result is obtained by linearly interpolating the modified scale parameter (s').
[0250] For example, broadcast multiplication is a mathematical operation that allows arrays to be multiplied by scalars or arrays of different shapes without explicitly expanding the shapes of the arrays. Here, the computer system might first linearly interpolate s' to produce an integer that is the same as F. _fast_optimized_k-t+1 The interpolation array of the same shape (denoted as s' _interp).
[0251] The calculation formula for linear interpolation may be as follows:
[0252] ;
[0253] Where i is the index of the interpolation array (i=0,1,...,n-1), and n is the number of F _fast_optimized_k-t+1 The number of elements, s'_max is a preset maximum scale parameter value.
[0254] The computer system then converts F _fast_optimized_k-t+1 With s' _interp Perform a broadcast multiplication operation to obtain a temporary value (denoted as temp_val):
[0255] temp_val=F _fast_optimized_k-t+1 ×s' _interp
[0256] In step S22114, the computer system sums the temporary value (temp_val) and the second interpolation result according to the array elements to obtain the tth fusion result. The second interpolation result is obtained by linearly interpolating the corrected offset (b').
[0257] For example, similar to step S22113, the computer system first performs linear interpolation on b' to generate an interpolation array (denoted as b') with the same shape as temp_val. _interp ). The calculation formula of linear interpolation is similar to the formula in step S22113, except that s' is replaced by b'.
[0258] The computer system then compares temp_val with b' _interp Perform element-wise summation to obtain the tth fusion result (denoted as F fused _t):
[0259] [F fused _t=temp_val+b' _interp ]
[0260] Through the processing of steps S22111 to S22114, the computer system successfully merges the input of the tth round with the k-t+1th optimized fast-changing feature array to generate the tth fusion result. This process involves multiple steps such as synchronous adjustment of regionalized mapping units, correction of offset and proportional parameters, interpolation operations, and summation operations. Through these steps, the computer system can gradually accumulate and fuse fast-changing information at different feature granularities, providing more powerful data support for subsequent leakage detection or other analysis tasks.
[0261] In one implementation, step S130, in combination with the feature array set, performs leakage detection on the water supply network sensor data set to obtain a leakage detection result of the water supply network sensor data set, including:
[0262] Step S131: performing leakage detection classification on the feature array set through a leakage detection classification unit to obtain leakage detection results of the water supply network sensor data set; wherein the leakage detection results include leakage detection results of each monitoring node in the water supply network sensor data set.
[0263] In step S130, the computer system performs leakage detection on the water supply network sensor data set in combination with the feature array set to generate a leakage detection result. The key sub-step S131 in this process involves leakage detection classification of the feature array set by a leakage detection classification unit.
[0264] In step S131, the computer system processes the feature array set using a specially designed leakage detection classification unit to identify potential leakage points in the water supply network. This classification unit may be a model based on machine learning, such as support vector machine (SVM), random forest, neural network, etc., which can extract useful information from the feature array set and classify each monitoring node to determine whether it has leakage. For example, assume that the feature array set contains multiple feature arrays, which cover information of the water supply network at different feature granularities, such as pressure distribution, flow change, temperature fluctuation, etc. Each array in the feature array set corresponds to one or more monitoring nodes in the water supply network and contains detailed data of these nodes.
[0265] The leakage detection classification unit will first preprocess the feature array set to ensure that the format and scale of the data are suitable for model processing. This may include steps such as data normalization, missing value processing, outlier detection and correction. The preprocessed data will be sent to the leakage detection classification unit for further analysis.
[0266] The core of the leakage detection classification unit is a classifier that classifies input data based on a trained model. This classifier may have been trained with a large amount of labeled data (i.e., a water supply network sensor dataset with known leakage status) and learned how to distinguish the characteristics of normal state and leakage state.
[0267] During the classification process, the classifier will score or estimate the probability of each feature array (or part of the array) in the feature array set to determine whether the corresponding monitoring node has leakage. These scores or probability estimates are based on the feature representation and decision boundary learned by the model.
[0268] For example, suppose a neural network is used as a leakage detection classification unit. The neural network contains multiple hidden layers, each of which consists of multiple neurons that are interconnected through weighted connections. The input layer receives the data of the feature array set, which is processed by the nonlinear transformation and activation function of the hidden layer, and finally the output layer gives the leakage probability of each monitoring node.
[0269] The output layer may contain the same number of neurons as the number of monitoring nodes in the water supply network, and each neuron corresponds to the leakage probability of a monitoring node. If the output value of a neuron exceeds the preset threshold (such as 0.5), the corresponding monitoring node is judged to have leakage; otherwise, it is judged to be in normal state.
[0270] In addition to neural networks, other types of machine learning models can also be used for leakage detection classification units. For example, support vector machines (SVMs) can distinguish between normal and leakage states by finding the best hyperplane; random forests can make the final classification decision by building multiple decision trees and voting.
[0271] Regardless of the model used, the ultimate goal of the leakage detection classification unit is to generate a clear leakage detection result for each monitoring node in the water supply network. This result is usually expressed in binary form (such as 0 for normal, 1 for leakage) and may contain additional information (such as leakage probability, confidence, etc.) to support further decision-making and analysis.
[0272] Through the processing of step S131, the computer system can provide a comprehensive and accurate leakage detection result for the water supply network manager. This result will help the manager quickly locate potential leakage points and take corresponding measures to repair and maintain them, thereby ensuring the normal operation of the water supply network and the effective use of water resources.
[0273] In one implementation, step S110, obtaining a water flow feature array and a value change feature array of a water supply network sensor data set corresponding to a target water supply network, includes:
[0274] Step S111: extracting features of the water supply network sensor data set through a first feature learning network to obtain a network information feature array of the water supply network sensor data set at a first feature granularity;
[0275] Step S112: extracting features of the pipe network information feature array of the water supply pipe network sensor data set at the first feature granularity through the second feature learning network to obtain the pipe network information feature array of the water supply pipe network sensor data set at the second feature granularity;
[0276] Step S113: taking the network information feature array of the water supply network sensor data set at the first feature granularity and the network information feature array of the water supply network sensor data set at the second feature granularity as the water flow feature array of the water supply network sensor data set;
[0277] Step S114: Perform time series analysis on the data sequence of each sensor monitoring node in the water supply network sensor data set, calculate the rate of change or amount of change of the data sequence of each sensor monitoring node over time, and obtain a feature array that characterizes the speed of numerical change; or, use a differential or sliding window average change rate algorithm to calculate the numerical change characteristics of the data sequence of the sensor monitoring node in the water supply network sensor data set to obtain a numerical change feature array, which is used to reflect the change rate of water flow parameters in the water supply network.
[0278] In step S111, the computer system uses the first feature learning network to extract features from the water supply network sensor data set to obtain a network information feature array at a first feature granularity. This feature granularity usually represents a relatively macroscopic observation scale, which is used to capture the overall status and trend of the water supply network.
[0279] For example, suppose that the water supply network sensor data set contains a series of pressure, flow, temperature and other parameter values collected by sensor monitoring nodes over a period of time. The first feature learning network may be a multi-layer perceptron (MLP), convolutional neural network (CNN) or recurrent neural network (RNN), which can automatically learn and extract useful features from these raw data.
[0280] Taking MLP as an example, the network may include an input layer, multiple hidden layers, and an output layer. The input layer receives the raw data of the sensor monitoring node as input, the hidden layer gradually extracts high-level features through nonlinear transformation and activation function, and the output layer generates the feature array of the pipe network information at the first feature granularity.
[0281] Assume that the input data is a two-dimensional array X containing N sensor monitoring nodes and T time points, where X[i][j] represents the data value of the i-th sensor monitoring node at the j-th time point. The output after processing by the first feature learning network may be an N-dimensional vector A1, where A1[i] represents the characteristic value of the pipe network information of the i-th sensor monitoring node at the first feature granularity.
[0282] In step S112, the computer system uses the second feature learning network to further extract features from the pipe network information feature array at the first feature granularity obtained in step S111 to obtain a pipe network information feature array at a second feature granularity. This feature granularity is usually finer than the first feature granularity and is used to capture more local and detailed information in the water supply pipe network.
[0283] For example, the structure of the second feature learning network may be similar to that of the first feature learning network, but their parameters and weights are trained independently to meet the needs of different feature granularities. Assuming that A1 is the N-dimensional vector obtained in step S111, the second feature learning network may take it as input and generate a more complex feature representation through a series of hidden layers.
[0284] This feature representation may be a structure containing multiple sub-arrays or higher-dimensional arrays, which is used to describe the correlation and differences between different areas or nodes of the water supply network. For example, the output may be an N×N matrix A2, where A2[i][j] represents the network information feature relationship between the i-th sensor monitoring node and the j-th sensor monitoring node at the second feature granularity.
[0285] In step S113, the computer system combines the two characteristic granularity information arrays of the pipe network obtained in steps S111 and S112 to form a water flow characteristic array of the water supply pipe network sensor data set. This array contains information of the water supply pipe network at different scales, providing comprehensive data support for subsequent leakage detection.
[0286] For example, suppose A1 is an N-dimensional vector, representing the pipe network information characteristics at the first feature granularity; A2 is an N×N matrix, representing the pipe network information characteristics at the second feature granularity. In step S113, the computer system may concatenate or merge A1 and A2 into a new array F, which contains both macroscopic overall information and local detailed information.
[0287] If directly spliced, F may be a (N+N 2 )-dimensional vector; if a more complex fusion strategy is adopted, F may be a high-dimensional array with a specific structure. In any case, F is used as a water flow feature array for subsequent leakage detection and analysis.
[0288] In step S114, the computer system performs time series analysis on the data sequence of each sensor monitoring node in the water supply network sensor data set to calculate the change rate or change amount of each node data sequence over time. These change rates or changes constitute a feature array that characterizes the speed of value change, which is used to reflect the change speed of water flow parameters in the water supply network.
[0289] For example, time series analysis is a statistical method used to study the patterns and trends of data over time. In the context of water supply network sensor data sets, time series analysis can help computer systems identify abnormal fluctuations and mutation points in the data series of sensor monitoring nodes, which may be related to leakage events.
[0290] A commonly used time series analysis method is the difference method, which estimates the rate of change by calculating the data difference between adjacent time points. Assuming that X[i][j] represents the data value of the i-th sensor monitoring node at the j-th time point, the difference method can be calculated as:
[0291] Delta X[i][j]=X[i][j+1]-X[i][j];
[0292] Among them, Delta X[i][j] represents the data change of the i-th sensor monitoring node between the j-th time point and the j+1-th time point.
[0293] Another method is the sliding window average change rate algorithm, which estimates the speed of change by calculating the average change rate of data within a fixed-size window. Assuming the window size is W, the sliding window average change rate can be calculated as:
[0294] ;
[0295] in, It represents the average change rate of the i-th sensor monitoring node around the j-th time point.
[0296] Regardless of the method used, the calculated numerical change feature array will serve as an important basis for subsequent leakage detection and analysis. This array may be a vector or matrix with the same number of sensor monitoring nodes, in which each element corresponds to the numerical change feature value of a node.
[0297] Through the processing of steps S111 to S114, the computer system successfully extracts the water flow feature array and the value change feature array from the water supply network sensor data set. These feature arrays not only contain the information of the water supply network at different feature granularities, but also reflect the change speed of the water flow parameters, providing strong data support for subsequent leakage detection.
[0298] An embodiment of the present application also provides a hardware entity diagram of a computer system for implementing the above method, and the hardware entity of the computer system includes: a processor and a memory, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the method of any of the above embodiments are implemented.
Claims
1. A water supply network leakage control method based on artificial intelligence, characterized in that: The method comprises: Acquire a water flow feature array and a value change feature array of a water supply network sensor data set corresponding to a target water supply network, wherein the target water supply network includes a plurality of sensor monitoring nodes; the water flow feature array includes a network information feature array of the water supply network sensor data set at a first feature granularity and a network information feature array of the water supply network sensor data set at a second feature granularity; wherein the value change feature array is a feature array that characterizes a value change speed; The feature array set of the water supply network sensor data set is obtained by combining the water flow feature array and the value change feature array; the feature array set includes the network information feature array of the water supply network sensor data set at a first feature granularity and the optimized feature array of the water supply network sensor data set at k feature granularities, and the optimized feature array of the water supply network sensor data set at any feature granularity is obtained by combining the network information feature array of the water supply network sensor data set at a second feature granularity and the value change feature array, and k is a natural number greater than 0; wherein the second feature granularity is finer than the first feature granularity; In combination with the feature array set, leakage detection is performed on the water supply network sensor data set to obtain a leakage detection result of the water supply network sensor data set, so as to perform water flow control according to the leakage detection result; The step of combining the water flow feature array and the value change feature array to obtain the feature array set of the water supply network sensor data set includes: splicing the pipe network information feature array of the water supply pipe network sensor data set at a second feature granularity and the value change feature array to obtain an optimized value change feature array; Combining the pipe network information feature array of the water supply pipe network sensor data set at a second feature granularity with the optimized value change feature array to obtain an optimized feature array of the water supply pipe network sensor data set at the second feature granularity; Combining the network information feature array of the water supply network sensor data set at the first feature granularity and the optimized feature array of the water supply network sensor data set at the second feature granularity, a feature array set of the water supply network sensor data set is obtained; Performing multiple feature extractions on the optimized feature array of the water supply network sensor data set at the second feature granularity through p feature learning networks to obtain the optimized feature array of the water supply network sensor data set at p feature granularities, where p is a natural number greater than 0; The feature array set of the water supply network sensor data set is obtained by combining the network information feature array of the water supply network sensor data set at the first feature granularity and the optimized feature array of the water supply network sensor data set at the second feature granularity, including: Arrange the network information feature array of the water supply network sensor data set at a first feature granularity, the optimized feature array of the water supply network sensor data set at a second feature granularity, and the optimized feature arrays of the water supply network sensor data set at p feature granularities to obtain a feature array set of the water supply network sensor data set; The step of splicing the pipe network information feature array of the water supply pipe network sensor data set at the second feature granularity and the value change feature array to obtain an optimized value change feature array includes: Using a node attention network to process the pipe network information feature array and the value change feature array of the water supply pipe network sensor data set at a second feature granularity to obtain a first focused feature array; Using a dimensional attention network to process the pipe network information feature array and the value change feature array of the water supply pipe network sensor data set at a second feature granularity to obtain a second focused feature array; Processing the integration result of the first focusing feature array and the second focusing feature array through a filtering and smoothing network to obtain an optimized numerical variation feature array; The step of combining the network information feature array of the water supply network sensor data set at the second feature granularity with the optimized value change feature array to obtain the optimized feature array of the water supply network sensor data set at the second feature granularity includes: Using a target filtering and smoothing unit to filter and smooth the optimized numerical value change feature array to obtain a filtering and smoothing result of the optimized numerical value change feature array; The filtered smoothing result of the optimized numerical variation feature array and the network information feature array of the water supply network sensor data set at the second feature granularity are summed according to array elements to obtain the optimized feature array of the water supply network sensor data set at the second feature granularity.
2. The method according to claim 1, characterized in that The method further comprises: Splitting the feature array in the feature array set into component feature arrays with multiple value change rates; The feature arrays in the feature array set are optimized through the component feature arrays of the multiple numerical change speeds to obtain an iterated feature array set.
3. The method according to claim 2, characterized in that The step of splitting the feature array in the feature array set into component feature arrays with multiple value change speeds includes: Performing Fourier transform on the pipe network information feature array of the water supply pipe network sensor data set at the first feature granularity and the optimized feature array of the water supply pipe network sensor data set at k feature granularities to obtain k+1 fast-changing component feature arrays and k+1 slowly changing component feature arrays; A bilinear pooling network is used to perform feature optimization on the k+1 fast-changing component feature arrays and the k+1 slowly-changing component feature arrays, to obtain k+1 optimized fast-changing component feature arrays and k+1 optimized slowly-changing component feature arrays.
4. The method according to claim 3, characterized in that The pipe network information feature array of the water supply pipe network sensor data set at the first feature granularity and the optimized feature array of the water supply pipe network sensor data set at k feature granularities are respectively subjected to Fourier transform to obtain k+1 fast-changing component feature arrays and k+1 slowly changing component feature arrays, including: filtering and smoothing the pipe network information feature array of the water supply pipe network sensor data set at a first feature granularity according to the first filter and the second filter respectively, to obtain a fast-changing array and a slow-changing array of the water supply pipe network sensor data set at the first feature granularity; Performing sparse extraction on the fast-changing array and the slow-changing array of the water supply network sensor data set at a first feature granularity to obtain a first fast-changing component feature array and a first slow-changing component feature array; filtering and smoothing the optimized feature array of the water supply network sensor data set at the x+1th feature granularity according to the first filter and the second filter respectively, to obtain a fast-changing array and a slowly-changing array of the water supply network sensor data set at the x+1th feature granularity, where x is a natural number greater than 0 and less than k; Performing sparse extraction on the fast-changing array and the slow-changing array of the water supply network sensor data set at the x+1th feature granularity to obtain the x+1th fast-changing component feature array and the x+1th slow-changing component feature array; The bilinear pooling network includes a filter unit, a node attention unit and a dimension attention unit; the bilinear pooling network is used to perform feature optimization on the k+1 fast-changing component feature arrays and the k+1 slowly-changing component feature arrays to obtain k+1 optimized fast-changing component feature arrays and k+1 optimized slowly-changing component feature arrays, including: The filter unit processes the yth fast-changing component feature array and the yth slowly-changing component feature array respectively to obtain a processing result of the yth fast-changing component feature array and a processing result of the yth slowly-changing component feature array, where y is a natural number greater than 0 and not greater than k+1; Using the dimensional attention unit to process the yth fast-changing component feature array and the yth slowly-changing component feature array, each of them is optimized in terms of dimensional angle, to obtain a yth fast-changing temporary array and a yth slowly-changing temporary array; The node attention unit is used to optimize the node angles of the yth fast-changing temporary array and the yth slowly-changing temporary array, respectively, to obtain the yth optimized fast-changing component feature array and the yth optimized slowly-changing component feature array.
5. The method according to claim 2, characterized in that: The component feature arrays of multiple numerical change speeds include k+1 optimized fast-changing component feature arrays and k+1 optimized slowly changing component feature arrays; the process of optimizing the feature arrays in the feature array set by using the component feature arrays of multiple numerical change speeds to obtain the iterated feature array set includes: The k+1 optimized fast-changing component feature arrays are merged to obtain a fast-changing optimized feature array set, and the k+1 optimized slowly-changing component feature arrays are merged to obtain a slowly-changing optimized feature array set; Using a filtering and smoothing unit to splice the fast-changing optimized feature array set and the pipe network information feature array of the water supply pipe network sensor data set at a first feature granularity to obtain a first splicing result; The filtering and smoothing unit is used to splice the slowly changing optimized feature array set with the optimized feature array of the water supply network sensor data set at the kth feature granularity to obtain a second splicing result.
6. The method according to claim 5, characterized in that The k+1 optimized fast-changing component feature arrays are fused to obtain a fast-changing optimized feature array set, including: The fusion network is used to fuse the input of the tth round and the k-t+1th optimized fast-changing component feature array to obtain the tth fusion result, where t is a natural number greater than 0 and not greater than k; If t is 1, the input of the tth round is the k+1th optimized fast-changing component feature array; if t is less than k+1, the input of the tth round is the t-1th fusion result.
7. The method according to claim 6, characterized in that The fusion network includes a regionalized mapping unit; the fusion network is used to fuse the input of the tth round and the k-t+1th optimized fast-changing component feature array to obtain the tth fusion result, including: The regionalized mapping unit is used to synchronously adjust the input of the tth round with the data extraction result to obtain a synchronous adjustment result, wherein the data extraction result is obtained by sparsely extracting the k-t+1th optimized fast-changing feature array; Correcting the offset and the proportional parameter in combination with the synchronous adjustment result to obtain a corrected offset and a corrected proportional parameter; Determine a broadcast multiplication value of the k-t+1th optimized fast-changing feature array and a first interpolation result to obtain a temporary value, wherein the first interpolation result is obtained by linearly interpolating the corrected proportional parameter; The temporary value and the second interpolation result are summed according to the array elements to obtain the tth fusion result; the second interpolation result is obtained by linearly interpolating the corrected offset.
8. The method according to claim 1, characterized in that The step of performing leakage detection on the water supply network sensor data set in combination with the feature array set to obtain a leakage detection result of the water supply network sensor data set includes: Performing leakage detection classification on the feature array set by a leakage detection classification unit to obtain a leakage detection result of the water supply network sensor data set; Wherein, the leakage detection result includes the leakage detection result of each monitoring node in the water supply network sensor data set; The step of obtaining a water flow characteristic array and a value change characteristic array of a water supply network sensor data set corresponding to the target water supply network includes: Performing feature extraction on a water supply network sensor data set through a first feature learning network to obtain a network information feature array of the water supply network sensor data set at a first feature granularity; Performing feature extraction on the pipe network information feature array of the water supply pipe network sensor data set at the first feature granularity through a second feature learning network to obtain the pipe network information feature array of the water supply pipe network sensor data set at the second feature granularity; Using the pipe network information feature array of the water supply pipe network sensor data set at the first feature granularity and the pipe network information feature array of the water supply pipe network sensor data set at the second feature granularity as the water flow feature array of the water supply pipe network sensor data set; Perform time series analysis on the data sequence of each sensor monitoring node in the water supply network sensor data set, calculate the rate of change or amount of change of the data sequence of each sensor monitoring node over time, and obtain a feature array that characterizes the speed of numerical change; or use a differential or sliding window average change rate algorithm to calculate the numerical change characteristics of the data sequence of the sensor monitoring node in the water supply network sensor data set to obtain the numerical change feature array, which is used to reflect the change rate of water flow parameters in the water supply network.
Citation Information
Patent Citations
Water pipe water leakage detecting method based on wavelet singularity analysis and ARMA model
CN104268649A
Water supply leakage position positioning method based on hydraulic model virtual nodes
CN114091217A