Urban user water consumption anomaly detection method and device based on graph convolutional neural network, equipment and medium
By constructing a user topology graph and combining it with graph convolution and long short-term memory neural network methods, the accuracy problem of water anomaly detection for users with irregular water use is solved, and more efficient water anomaly detection is achieved.
Patent Information
- Application Number
- CN202411736405.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-11-29
AI Technical Summary
Existing water anomaly detection methods have low accuracy in identifying users with irregular water usage and are prone to false alarms.
A method based on graph convolutional neural network is used to construct a user topology graph. Neighborhood features are obtained through graph convolution processing, and time series features are mined in combination with long short-term memory neural network. Neighborhood features and time series features are fused to predict water use anomalies.
The accuracy of water anomaly detection is improved, especially for users with irregular water usage, and the occurrence of false alarms is reduced.
Smart Images

Figure CN119671782B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to smart water technology, and in particular to a method, device, equipment and medium for detecting anomalies in urban user water use based on a graph convolutional neural network. Background Art
[0002] Smart water meters are now widely used in modern urban infrastructure. They automatically record water usage and generate detailed time-series data. This data is not only used for metering and billing but also provides a wealth of information for water resource management. Analysis of this data can enable more efficient water resource management, detect leaks, and identify unusual water usage patterns.
[0003] Most existing methods for identifying abnormal water use rely on analyzing users' historical water use data to determine the historical water use in the same period, and then compare the currently collected water use with the historical water use in the same period. If it exceeds the historical period, it is identified as abnormal water use.
[0004] The existing technology solution has a good recognition accuracy rate for some users who use water regularly, but for users who use water irregularly, the recognition accuracy rate is low and false warnings may occur. Summary of the Invention
[0005] The present invention provides a method, device, equipment and medium for detecting water anomalies among urban users based on a graph convolutional neural network, so as to solve the problem of false alarms in water anomaly detection for users with irregular water use and improve detection accuracy.
[0006] In a first aspect, the present invention provides a method for detecting anomalies in urban user water consumption based on a graph convolutional neural network, comprising:
[0007] Obtain water usage data for users in the same area, including the target user, during the current detection period;
[0008] Determine a K-neighborhood centered on the target user's node from a user topology graph, where the user topology graph is pre-constructed based on the building area differences of users in the same area, with users as nodes and building area differences as connecting lines;
[0009] Assign the water usage data of users in the current detection period to the corresponding nodes in the K neighborhood to obtain graph data, which includes a water usage data matrix composed of the water usage data of each node in the K neighborhood, and an area difference matrix composed of the difference in building area between the target node and K other nodes;
[0010] A graph convolutional neural network is used to perform graph convolution processing on the K-neighborhood graph data centered on the target user node in the user topology graph to obtain neighborhood features;
[0011] The water use anomaly detection result of the target user is predicted based on the neighborhood characteristics.
[0012] Optionally, determining a K-neighborhood centered on the target user's node from the user topology graph includes:
[0013] Arrange other users in the same area in ascending order according to the difference in building area between them and the target user to obtain a user sequence;
[0014] The first K users are determined from the user sequence as a K neighborhood centered on the node of the target user.
[0015] Optionally, the graph convolutional neural network includes M graph convolution layers, and the graph convolutional neural network is used to perform graph convolution processing on graph data of a K-neighborhood centered on a target user node in a user topology graph to obtain neighborhood features, including:
[0016] The first graph convolution layer receives the water use data matrix and the area difference matrix, performs a graph convolution operation on the water use data matrix, and uses the result of the graph convolution operation to update the water use data matrix as a first graph convolution feature;
[0017] The i-th graph convolution layer receives the i-1-th graph convolution feature and the area difference matrix, performs a graph convolution operation on the i-1-th graph convolution feature, and uses the result of the graph convolution operation to update the i-1-th graph convolution feature as the i-th graph convolution feature, where i is a positive integer greater than 1 and less than M;
[0018] The M-th graph convolution layer receives the M-1-th graph convolution feature and the area difference matrix, performs a graph convolution operation on the M-1-th graph convolution feature, and uses the result of the graph convolution operation to update the M-1-th graph convolution feature as a neighborhood feature.
[0019] Optionally, the urban user water usage anomaly detection method based on graph convolutional neural network also includes:
[0020] Obtain the target user's water consumption data for the last N cycles;
[0021] The long short-term memory neural network is used to process the water usage data of the target users in the last N cycles to obtain time series features.
[0022] Optionally, the long short-term memory neural network includes N transfer cells, and the long short-term memory neural network is used to process the water consumption data of the target user in the latest N cycles to obtain time series features, including:
[0023] The first transfer cell receives the water use data of the first cycle and performs calculation to obtain the hidden state and cell state output by the first transfer cell;
[0024] The j-th transfer cell receives the water usage data of the j-1-th cycle, and calculates the hidden state and cell state output by the j-th transfer cell, to obtain the hidden state and cell state output by the j-th transfer cell, where j is a positive integer greater than 1 and less than N;
[0025] The Nth transfer cell receives the water usage data of the N-1th cycle, and performs calculations based on the hidden state and cell state output by the N-1th transfer cell to obtain the cell state output by the Nth transfer cell as a time series feature.
[0026] Optionally, predicting the water usage anomaly detection result of the target user based on the neighborhood characteristics includes:
[0027] Fusing the neighborhood features and the time series features to obtain fused features;
[0028] Predict the water usage anomaly detection result of the target user based on the fusion features.
[0029] Optionally, predicting the water usage anomaly detection result of the target user based on the fusion feature includes:
[0030] Normalizing the fused features to obtain normalized features;
[0031] Mapping the normalized features to a category space for water use anomaly detection to obtain a logical value;
[0032] Inputting the logical value into a classification function for processing to obtain a probability distribution of categories for water use anomaly detection;
[0033] The water usage anomaly detection result of the target user is determined based on the probability distribution.
[0034] In a second aspect, the present invention further provides a device for detecting anomalies in urban user water consumption based on a graph convolutional neural network, comprising:
[0035] The data acquisition module is used to obtain water consumption data of users in the same area, including the target user, during the current detection period;
[0036] A K-neighborhood determination module is used to determine a K-neighborhood centered on the target user's node from a user topology map, wherein the user topology map is a topology map pre-constructed based on the building area differences of users in the same area, with users as nodes and building area differences as connecting lines;
[0037] A graph data determination module is used to assign the water usage data of users in the current detection period to the corresponding nodes in the K neighborhood to obtain graph data. The graph data includes a water usage data matrix composed of the water usage data of each node in the K neighborhood, and an area difference matrix composed of the difference in building area between the target node and K other nodes;
[0038] The graph convolution processing module is used to perform graph convolution processing on the graph data of the K neighborhood centered on the target user node in the user topology graph using a graph convolution neural network to obtain neighborhood features;
[0039] The abnormal result prediction module is used to predict the water consumption abnormality detection result of the target user based on the neighborhood characteristics.
[0040] In a third aspect, the present invention further provides an electronic device, comprising:
[0041] one or more processors;
[0042] a storage device for storing one or more programs;
[0043] When the one or more programs are executed by the one or more processors, the one or more processors implement the urban user water consumption anomaly detection method based on graph convolutional neural network as provided in the first aspect of the present invention.
[0044] In a third aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for detecting anomalies in urban user water use based on a graph convolutional neural network as provided in the first aspect of the present invention.
[0045] The present invention provides a method for detecting water consumption anomalies of urban users based on a graph convolutional neural network. The method obtains water consumption data of users in the same area, including a target user, within a current detection period, and determines a K neighborhood centered on the node of the target user from a user topology map. The user topology map is a topology map pre-constructed based on the building area differences of users in the same area, with users as nodes and building area differences as connecting lines. The water consumption data of users in the current detection period are assigned to corresponding nodes in the K neighborhood to obtain graph data. The graph data includes a water consumption data matrix composed of water consumption data of each node in the K neighborhood, and an area difference matrix composed of building area differences between the target node and K other nodes. A graph convolutional neural network is used to perform graph convolution processing on the graph data of the K neighborhood centered on the target user node in the user topology map to obtain neighborhood features. The water consumption anomaly detection result of the target user is predicted based on the neighborhood features. The relationship between the local features of the neighborhood centered on the target user node and the building area difference is fully mined through the graph convolutional neural network, which is conducive to improving the accuracy of water consumption anomaly detection for the target user.
[0046] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings described below only show some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0048] Figure 1 The flow chart of the city user water abnormality detection method based on the graph convolutional neural network provided by the present application;
[0049] Figure 2 The flow chart of another city user water abnormality detection method based on the graph convolutional neural network provided by the present application;
[0050] Figure 3 The principle diagram of the city user water abnormality detection based on the graph convolutional neural network provided by the present application;
[0051] Figure 4 The structural schematic diagram of the city user water abnormality detection device based on the graph convolutional neural network provided by the present application;
[0052] Figure 5 The structural schematic diagram of an electronic device provided by the present application.
[0053] The above-mentioned drawings have shown the specific embodiments of the present application, and the following will have more detailed description. These drawings and textual descriptions are not intended to limit the scope of the concept of the present application by any means, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0054] In order to make the person skilled in the art better understand the present application, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments only show some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.
[0055] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0056] Figure 1 This is a flow chart of a method for detecting abnormal water use in urban users based on a graph convolutional neural network provided by the present invention. This embodiment is applicable to the case of detecting abnormal water use in users with irregular water use. The method can be performed by an apparatus for detecting abnormal water use in urban users based on a graph convolutional neural network provided by an embodiment of the present invention. The apparatus can be implemented in software and / or hardware and is usually configured in an electronic device, such as Figure 1 As shown in the figure, the method for detecting anomalies in urban user water consumption based on graph convolutional neural network specifically includes the following steps:
[0057] S101. Obtain water usage data of users in the same area, including the target user, during the current detection period.
[0058] In this embodiment of the present invention, water usage data for users in the same area, including the target user, is obtained during the current detection period. For example, the detection period can be one day or a preset number of days, which is not limited in this embodiment of the present invention. The same area can include the same building, the same residential complex, etc., which is not limited in this embodiment of the present invention.
[0059] S102. Determine a K-neighborhood centered on the target user's node from a user topology map, wherein the user topology map is a topology map pre-constructed based on building area differences of users in the same area, with users as nodes and building area differences as connecting lines.
[0060] Based on practical experience, a user's water consumption is correlated with their building area. In this embodiment of the present invention, a topology map can be constructed by pre-configuring users in the same area as nodes and connecting them with the difference in building area. Then, a K-neighborhood is determined in the user topology map, centered around the target user's node. The K-neighborhood represents the K users with the smallest difference in building area from the target user.
[0061] S103. Assign the water usage data of users in the current detection period to the corresponding nodes in the K neighborhood to obtain graph data. The graph data includes a water usage data matrix composed of the water usage data of each node in the K neighborhood, and an area difference matrix composed of the building area differences between the target node and K other nodes.
[0062] In an embodiment of the present invention, the water usage data of users in the current detection period are assigned to the corresponding nodes in the K neighborhood to obtain graph data. The graph data includes a water usage data matrix composed of the water usage data of each node in the K neighborhood, and an area difference matrix composed of the building area difference between the target node and K other nodes.
[0063] S104: Use a graph convolution neural network to perform graph convolution processing on the graph data of the K neighborhood centered on the target user node in the user topology graph to obtain neighborhood features.
[0064] In this embodiment of the present invention, a graph convolutional neural network (GCNN) is used to perform graph convolution processing on the K-neighborhood graph centered on the target user node in the user topology graph to obtain neighborhood features. GCNN can fully exploit the relationship between the local features of the neighborhood centered on the target user node and the difference in building area, which helps improve the accuracy of water usage anomaly detection for target users.
[0065] S105: Predict the abnormal water usage detection result of the target user based on the neighborhood characteristics.
[0066] In an embodiment of the present invention, the neighborhood features may be input into a classifier for classification processing to obtain a water usage anomaly detection result for a target user.
[0067] The present invention provides a method for detecting water consumption anomalies of urban users based on a graph convolutional neural network. The method obtains water consumption data of users in the same area, including a target user, within a current detection period, and determines a K neighborhood centered on the node of the target user from a user topology map. The user topology map is a topology map pre-constructed based on the building area differences of users in the same area, with users as nodes and building area differences as connecting lines. The water consumption data of users in the current detection period are assigned to corresponding nodes in the K neighborhood to obtain graph data. The graph data includes a water consumption data matrix composed of water consumption data of each node in the K neighborhood, and an area difference matrix composed of building area differences between the target node and K other nodes. A graph convolutional neural network is used to perform graph convolution processing on the graph data of the K neighborhood centered on the target user node in the user topology map to obtain neighborhood features. The water consumption anomaly detection result of the target user is predicted based on the neighborhood features. The relationship between the local features of the neighborhood centered on the target user node and the building area difference is fully mined through the graph convolutional neural network, which is conducive to improving the accuracy of water consumption anomaly detection for the target user.
[0068] Figure 2 This is a flowchart of another method for detecting abnormal water consumption of urban users based on graph convolutional neural networks provided by the present invention. This embodiment further improves on the basis of the previous embodiment and illustrates the steps in the previous embodiment. Figure 2 As shown in the figure, the urban user water consumption anomaly detection method based on graph convolutional neural network includes:
[0069] S201. Obtain water usage data of users in the same area including the target user during the current detection period, as well as water usage data of the target user in the most recent N periods.
[0070] In this embodiment of the present invention, water usage data for users in the same area, including the target user, during the current detection period, as well as water usage data for the target user over the last N periods, are obtained. For example, the detection period can be one day or a preset number of days, which is not limited in this embodiment of the present invention. The same area can include the same building, the same residential complex, etc., which is not limited in this embodiment of the present invention.
[0071] S202. Determine a K-neighborhood centered on the node of the target user from a user topology map, wherein the user topology map is a topology map pre-constructed based on building area differences of users in the same area, with users as nodes and building area differences as connecting lines.
[0072] Based on practical experience, a user's water consumption is correlated with their building area. In this embodiment of the present invention, a topology map can be constructed by pre-configuring users in the same area as nodes and connecting them with the difference in building area. Then, a K-neighborhood is determined in the user topology map, centered around the target user's node. The K-neighborhood represents the K users with the smallest difference in building area from the target user.
[0073] For example, in some embodiments of the present invention, other users in the same area are sorted in ascending order according to the difference in building area with the target user to obtain a user sequence, and then the first K users in the user sequence are determined as the K neighborhood centered on the node of the target user.
[0074] S203. Assign the water usage data of users in the current detection period to the corresponding nodes in the K neighborhood to obtain graph data. The graph data includes a water usage data matrix composed of the water usage data of each node in the K neighborhood, and an area difference matrix composed of the building area difference between the target node and K other nodes.
[0075] In an embodiment of the present invention, the water usage data of users in the current detection period are assigned to the corresponding nodes in the K neighborhood to obtain graph data. The graph data includes a water usage data matrix E composed of the water usage data of each node in the K neighborhood, and an area difference matrix S composed of the building area difference between the target node and K other nodes.
[0076] S204: Use a graph convolution neural network to perform graph convolution processing on the graph data of the K neighborhood centered on the target user node in the user topology graph to obtain neighborhood features.
[0077] In this embodiment of the present invention, a graph convolutional neural network (GCNN) is used to perform graph convolution processing on the K-neighborhood graph centered on the target user node in the user topology graph to obtain neighborhood features. GCNN can fully exploit the relationship between the local features of the neighborhood centered on the target user node and the difference in building area, which helps improve the accuracy of water usage anomaly detection for target users.
[0078] Figure 3 The schematic diagram of the anomaly detection of urban user water consumption based on graph convolutional neural network provided by the present invention is illustrative. In some embodiments of the present invention, for example, Figure 3 As shown in the figure, the graph convolutional neural network GCN includes M graph convolutional layers GCL. The processing process of the graph convolutional neural network is as follows:
[0079] 1. The first graph convolution layer receives the water usage data matrix and the area difference matrix, performs a graph convolution operation on the water usage data matrix, and uses the result of the graph convolution operation to update the water usage data matrix as the first graph convolution feature.
[0080] For example, the area difference matrix S is regularized to obtain the regularized matrix Then the graph convolution is performed using the following formula:
[0081]
[0082] Among them, σ is the activation function, W1 is the graph convolution parameter of the first graph convolution layer, and E1 is the first graph convolution feature.
[0083] 2. The i-th graph convolution layer receives the i-1th graph convolution feature and the area difference matrix, performs a graph convolution operation on the i-1th graph convolution feature, and uses the result of the graph convolution operation to update the i-1th graph convolution feature as the i-th graph convolution feature, where i is a positive integer greater than 1 and less than M.
[0084] For example, the area difference matrix S is regularized to obtain the regularized matrix Then the graph convolution is performed using the following formula:
[0085]
[0086] Among them, σ is the activation function, W i-1 is the graph convolution parameter of the i-1th graph convolution layer, E i is the convolutional feature of the i-th graph.
[0087] 3. The M-th graph convolution layer receives the M-1-th graph convolution feature and the area difference matrix, performs a graph convolution operation on the M-1-th graph convolution feature, and uses the result of the graph convolution operation to update the M-1-th graph convolution feature as the neighborhood feature.
[0088] For example, the area difference matrix S is regularized to obtain the regularized matrix Then the graph convolution is performed using the following formula:
[0089]
[0090] Among them, σ is the activation function, W M-1 is the graph convolution parameter of the M-1th graph convolution layer, E M is the convolution feature of the Mth graph, also known as the neighborhood feature.
[0091] S205: Use a long short-term memory neural network to process the target user's water consumption data for the last N periods to obtain time series features.
[0092] Changes in user water consumption usually do not occur suddenly, but change slowly over several detection cycles. Therefore, in an embodiment of the present invention, a long short-term memory neural network (LSTM) is used to process the target user's water consumption data T for the last N cycles, and the relationship between the target user's water consumption data for the last N cycles is mined to obtain the time series feature T1.
[0093] For example, in some embodiments of the present invention, the long short-term memory neural network includes N transmission cells, and the processing process of the long short-term memory neural network is:
[0094] 1. The first transfer cell receives the water usage data of the first cycle and performs calculations to obtain the hidden state and cell state output by the first transfer cell.
[0095] Exemplarily, the first transmission cell receives the water usage data of the first cycle, and performs calculations in sequence through the forget gate, memory gate, and output gate inside the transmission cell to output the hidden state and cell state output by the first transmission cell.
[0096] 2. The j-th transfer cell receives the water usage data of the j-1-th cycle, and calculates the hidden state and cell state output by the j-th transfer cell, to obtain the hidden state and cell state output by the j-th transfer cell, where j is a positive integer greater than 1 and less than N.
[0097] Exemplarily, the j-th transmission cell receives the water usage data of the j-1-th cycle, the hidden state and cell state output by the j-1-th transmission cell, and performs calculations in sequence through the forget gate, memory gate and output gate inside the transmission cell to output the hidden state and cell state output by the j-th transmission cell.
[0098] 3. The Nth transfer cell receives the water usage data of the N-1th cycle, and calculates the hidden state and cell state output by the N-1th transfer cell to obtain the cell state output by the Nth transfer cell as the time series feature.
[0099] Exemplarily, the Nth transfer cell receives the water usage data of the N-1th cycle, the hidden state and cell state output by the N-1th transfer cell, and performs calculations in sequence through the forget gate, memory gate and output gate inside the transfer cell to output the hidden state and cell state output by the Nth transfer cell, and uses the cell state output by the Nth transfer cell as the time series feature T1.
[0100] S206: Fuse the neighborhood features and the time series features to obtain fused features.
[0101] For example, in some embodiments of the present invention, the neighborhood feature E M Concatenate the time series feature T1 with the feature dimension to obtain the fusion feature.
[0102] S207: Predict the abnormal water usage detection result of the target user based on the fused features.
[0103] In an embodiment of the present invention, the neighborhood features may be input into a classifier for classification processing to obtain a water usage anomaly detection result for a target user.
[0104] Exemplarily, the classifier includes a normalization layer (Norm), a fully connected layer (FCC), and a classification function layer (Sigmoid). The normalization layer normalizes the fused features to obtain normalized features. The fully connected layer maps the normalized features to the category space for water anomaly detection, obtaining a logical value. The classification function layer maps the logical value to a probability value between 0 and 1 and outputs it, obtaining a probability distribution of the categories for water anomaly detection. By setting an appropriate threshold, when the probability value output by the Sigmoid function is greater than the threshold, the anomaly detection result for the target user is considered to be yes, indicating that the target user's water usage in the current period is abnormal.
[0105] The graph convolutional neural network proposed in this paper fully exploits the relationship between the local characteristics of the neighborhood centered on the target user node and the difference in building area, which helps improve the accuracy of water anomaly detection for the target user. Furthermore, by fusing neighborhood features with time series features, it integrates the water usage characteristics of K users with similar building areas to the target user and the correlation between the target user's most recent N cycles, which helps improve the accuracy of water anomaly detection.
[0106] Figure 4 This is a schematic diagram of the structure of a device for detecting abnormal water use in urban users based on a graph convolutional neural network provided by the present invention. Figure 4 As shown in the figure, the urban user water consumption anomaly detection device based on graph convolutional neural network includes:
[0107] The data acquisition module 301 is used to obtain water consumption data of users in the same area, including the target user, during the current detection period;
[0108] A K-neighborhood determination module 302 is configured to determine a K-neighborhood centered on the target user's node from a user topology map, wherein the user topology map is a topology map pre-constructed based on the building area differences of users in the same area, with users as nodes and building area differences as connecting lines;
[0109] A graph data determination module 303 is configured to assign water usage data of users in the current detection period to corresponding nodes in a K-neighborhood to obtain graph data, wherein the graph data includes a water usage data matrix consisting of water usage data of each node in the K-neighborhood and an area difference matrix consisting of differences in building area between the target node and K other nodes;
[0110] A graph convolution processing module 304 is configured to perform graph convolution processing on graph data of a K-neighborhood centered on a target user node in a user topology graph using a graph convolution neural network to obtain neighborhood features;
[0111] The abnormal result prediction module 305 is used to predict the water consumption abnormality detection result of the target user based on the neighborhood characteristics.
[0112] In some embodiments of the present invention, the K-neighborhood determination module 302 includes:
[0113] A sorting submodule is used to sort other users in the same area in ascending order according to the difference in building area between them and the target user to obtain a user sequence;
[0114] The K-neighborhood determination submodule is used to determine the first K users from the user sequence as the K-neighborhood centered on the node of the target user.
[0115] In some embodiments of the present invention, the graph convolutional neural network includes M graph convolution layers, and the graph convolution processing module 304 includes:
[0116] a first graph convolution processing submodule, configured to receive the water consumption data matrix and the area difference matrix by the first graph convolution layer, perform graph convolution operation on the water consumption data matrix, and update the water consumption data matrix as a first graph convolution feature by using a result of the graph convolution operation;
[0117] a second graph convolution processing submodule, configured to receive an (i-1)th graph convolution feature and the area difference matrix by an ith graph convolution layer, perform graph convolution operation on the (i-1)th graph convolution feature, and update the (i-1)th graph convolution feature as an ith graph convolution feature by using a result of the graph convolution operation, where i is a positive integer greater than 1 and smaller than M;
[0118] a third graph convolution processing submodule, configured to receive an (M-1)th graph convolution feature and the area difference matrix by an Mth graph convolution layer, perform graph convolution operation on the (M-1)th graph convolution feature, and update the (M-1)th graph convolution feature as a neighborhood feature by using a result of the graph convolution operation.
[0119] In some embodiments of the present application, the graph convolution neural network-based urban user water consumption anomaly detection apparatus further comprises:
[0120] a period data acquisition module, configured to acquire water consumption data of N most recent periods of a target user;
[0121] a time series feature calculation module, configured to process the water consumption data of the N most recent periods of the target user by using a long short-term memory neural network to obtain a time series feature.
[0122] In some embodiments of the present application, the long short-term memory neural network comprises N transfer cells, and the time series feature calculation module comprises:
[0123] a first calculation submodule, configured to receive water consumption data of a first period by a first transfer cell to obtain a hidden state and a cell state output by the first transfer cell;
[0124] a second calculation submodule, configured to receive water consumption data of a (j-1)th period by a jth transfer cell, and combine a hidden state and a cell state output by the jth transfer cell to obtain a hidden state and a cell state output by the jth transfer cell, where j is a positive integer greater than 1 and smaller than N;
[0125] a third calculation submodule, configured to receive water consumption data of an (N-1)th period by an Nth transfer cell, and combine a hidden state and a cell state output by the (N-1)th transfer cell to obtain a cell state output by the Nth transfer cell as a time series feature.
[0126] In some embodiments of the present application, the anomaly result prediction module 305 comprises:
[0127] A feature fusion submodule, configured to fuse the neighborhood features and the time series features to obtain fused features;
[0128] A result prediction submodule is used to predict the water consumption anomaly detection result of the target user based on the fusion features.
[0129] In some embodiments of the present invention, the result prediction submodule includes:
[0130] A normalization processing unit, configured to perform normalization processing on the fused features to obtain normalized features;
[0131] a feature mapping unit, configured to map the normalized feature to a category space for water anomaly detection to obtain a logical value;
[0132] a probability distribution determination unit, configured to input the logic value into a classification function for processing to obtain a probability distribution of categories for water use anomaly detection;
[0133] An abnormality detection result determining unit is used to determine the water usage abnormality detection result of the target user based on the probability distribution.
[0134] The above-mentioned urban user water use anomaly detection device based on graph convolutional neural network can execute the urban user water use anomaly detection method based on graph convolutional neural network provided by the aforementioned embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the urban user water use anomaly detection method based on graph convolutional neural network.
[0135] Figure 5 A schematic diagram of the structure of an electronic device provided by the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0136] like Figure 5As shown, the electronic device includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0137] Multiple components in the electronic device are connected to the I / O interface 15, including an input unit 16, such as a keyboard, mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, optical disk, etc.; and a communication unit 19, such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0138] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any other suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the method for detecting anomalies in urban user water consumption based on a graph convolutional neural network.
[0139] In some embodiments, the urban user water use anomaly detection method based on a graph convolutional neural network can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on an electronic device via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the urban user water use anomaly detection method based on a graph convolutional neural network described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the urban user water use anomaly detection method based on a graph convolutional neural network by any other appropriate means (for example, by means of firmware).
[0140] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0141] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0142] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0143] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0144] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0145] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0146] An embodiment of the present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the urban user water use anomaly detection method based on graph convolutional neural network as provided in any embodiment of the present application.
[0147] The computer program code can also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce the computer implemented process such that the
[0148] It should be understood that the various forms of flow shown in the figures are illustrative examples of implementing the steps of the application. Several steps have been described as being performed by a single device. It will be understood that these steps can be performed by a single device or multiple devices. It will also be understood that the steps can be performed in a different order than that shown in the figures. It will also be understood that the steps can be performed concurrently or sequentially. It will also be understood that the steps can be performed by different entities. It will also be understood that the steps can be performed by a combination of devices and entities. It will also be understood that the steps can be performed by a combination of devices and entities.
[0149] The specific embodiments have been shown and described for the purposes of illustrating the physiological principles of the application. It will be understood that various modifications, combinations, sub-combinations, and alternatives can occur to one skilled in the art. Any modifications, equivalent substitutions, improvements, combinations or the like not described above are therefore contemplated to be within the scope of the application as defined by the following claims.
Claims
1. A method for detecting anomalies in urban water consumption based on graph convolutional neural networks, characterized in that: include: Obtain water usage data for users in the same area, including the target user, during the current detection period; Determine a K-neighborhood centered on the target user's node from a user topology graph, where the user topology graph is pre-constructed based on the building area differences of users in the same area, with users as nodes and building area differences as connecting lines; Assign the water usage data of users in the current detection period to the corresponding nodes in the K neighborhood to obtain graph data, which includes a water usage data matrix composed of the water usage data of each node in the K neighborhood, and an area difference matrix composed of the difference in building area between the target node and K other nodes; A graph convolutional neural network is used to perform graph convolution processing on the K-neighborhood graph data centered on the target user node in the user topology graph to obtain neighborhood features; Predicting a water use anomaly detection result of the target user based on the neighborhood characteristics; The graph convolutional neural network includes M graph convolution layers. The graph convolutional neural network is used to perform graph convolution processing on the graph data of the K neighborhood centered on the target user node in the user topology graph to obtain neighborhood features, including: The first graph convolution layer receives the water use data matrix and the area difference matrix, performs a graph convolution operation on the water use data matrix, and uses the result of the graph convolution operation to update the water use data matrix as a first graph convolution feature; The i-th graph convolution layer receives the i-1-th graph convolution feature and the area difference matrix, performs a graph convolution operation on the i-1-th graph convolution feature, and uses the result of the graph convolution operation to update the i-1-th graph convolution feature as the i-th graph convolution feature, where i is a positive integer greater than 1 and less than M; The M-th graph convolution layer receives the M-1-th graph convolution feature and the area difference matrix, performs a graph convolution operation on the M-1-th graph convolution feature, and uses the result of the graph convolution operation to update the M-1-th graph convolution feature as a neighborhood feature; The method further comprises: Obtain the target user's water consumption data for the last N cycles; The long short-term memory neural network is used to process the water consumption data of the target user in the last N cycles to obtain time series features; Predicting the water consumption anomaly detection result of the target user based on the neighborhood characteristics includes: Fusing the neighborhood features and the time series features to obtain fused features; Predicting a water use anomaly detection result of the target user based on the fusion feature; Predicting the water usage anomaly detection result of the target user based on the fusion feature includes: Normalizing the fused features to obtain normalized features; Mapping the normalized features to a category space for water use anomaly detection to obtain a logical value; Inputting the logical value into a classification function for processing to obtain a probability distribution of categories for water use anomaly detection; The water usage anomaly detection result of the target user is determined based on the probability distribution.
2. The method for detecting anomalies in urban water consumption based on graph convolutional neural networks according to claim 1 is characterized in that: Determine the K-neighborhood centered on the target user's node from the user topology graph, including: Arrange other users in the same area in ascending order according to the difference in building area between them and the target user to obtain a user sequence; The first K users are determined from the user sequence as a K neighborhood centered on the node of the target user.
3. The method for detecting anomalies in urban water consumption based on graph convolutional neural networks according to claim 1 is characterized in that: The long short-term memory neural network includes N transfer cells. The long short-term memory neural network is used to process the water consumption data of the target user in the last N cycles to obtain time series features, including: The first transfer cell receives the water use data of the first cycle and performs calculation to obtain the hidden state and cell state output by the first transfer cell; The j-th transfer cell receives the water usage data of the j-1-th cycle, and calculates the hidden state and cell state output by the j-th transfer cell, to obtain the hidden state and cell state output by the j-th transfer cell, where j is a positive integer greater than 1 and less than N; The Nth transfer cell receives the water usage data of the N-1th cycle, and performs calculations based on the hidden state and cell state output by the N-1th transfer cell to obtain the cell state output by the Nth transfer cell as a time series feature.
4. A device for detecting abnormal water usage of urban users based on graph convolutional neural network, characterized in that: The method for detecting anomalies in urban water consumption based on a graph convolutional neural network according to any one of claims 1 to 3 comprises: The data acquisition module is used to obtain water consumption data of users in the same area, including the target user, during the current detection period; A K-neighborhood determination module is used to determine a K-neighborhood centered on the target user's node from a user topology map, wherein the user topology map is a topology map pre-constructed based on the building area differences of users in the same area, with users as nodes and building area differences as connecting lines; A graph data determination module is used to assign the water usage data of users in the current detection period to the corresponding nodes in the K neighborhood to obtain graph data. The graph data includes a water usage data matrix composed of the water usage data of each node in the K neighborhood, and an area difference matrix composed of the difference in building area between the target node and K other nodes; The graph convolution processing module is used to perform graph convolution processing on the graph data of the K neighborhood centered on the target user node in the user topology graph using a graph convolution neural network to obtain neighborhood features; The abnormal result prediction module is used to predict the water consumption abnormality detection result of the target user based on the neighborhood characteristics.
5. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the urban user water consumption anomaly detection method based on graph convolutional neural network as described in any one of claims 1-3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for detecting anomalies in water use among urban users based on a graph convolutional neural network as described in any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Power grid broadband wireless sensor network topology control method and device and medium
CN117336899A