Hydropower energy consumption data monitoring method and system based on edge computing

By clustering water meters and electricity meters and training an isolated forest model on edge nodes, the problem of misjudgment caused by the computing power limitations of edge nodes and differences in device modes is solved, and efficient and accurate monitoring and management of water and electricity energy consumption data is achieved.

CN120951019BActive Publication Date: 2026-01-02NINGBO WOSHIDUN TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511484391.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2026-01-02
Estimated Expiration
2045-10-17

AI Technical Summary

Technical Problem

The limited computing power of edge nodes hinders the deployment of complex models. At the same time, the isolated forest algorithm is prone to misjudgment in multi-device scenarios because it does not fully consider the differences in modes between devices, which affects the efficiency and accuracy of anomaly detection of water and electricity meters.

Method used

By clustering multiple water and electricity meters within an industrial area, an isolated forest model is trained on the edge nodes of each cluster, and the model weights are updated based on the latest energy consumption data to improve the model's adaptability to new data and the accuracy of anomaly detection.

Benefits of technology

It has achieved high efficiency and accuracy in monitoring hydropower energy consumption data, enhanced the model's generalization ability in multi-device scenarios, and ensured the real-time and reliability of energy consumption management in industrial areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120951019B_ABST
    Figure CN120951019B_ABST
Patent Text Reader

Abstract

The present application relates to the field of industrial energy consumption data monitoring, and more particularly to a water and electricity energy consumption data monitoring method and system based on edge computing, which comprises: preprocessing the historical data of water meters and electricity meters in the industrial area, performing cluster analysis to form water meter clusters and electricity meter clusters, and deploying an isolation forest model on each corresponding edge node of the clusters. The model is trained using the clustering results, and the model weights are updated according to new data to adapt to data changes. Real-time data is input into the updated model, and an anomaly score is calculated to evaluate whether the energy consumption data is abnormal, thereby achieving accurate water and electricity energy consumption monitoring. By training and deploying an isolation forest model on the edge node for different device clusters, and dynamically updating the model weights combined with the similarity of the new data set, the adaptability and accuracy of water and electricity energy consumption anomaly detection are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of industrial energy consumption data monitoring. In particular, it relates to a water and electricity energy consumption data monitoring method and system based on edge computing. BACKGROUND

[0002] With the application of smart water and electricity meters, water and electricity energy consumption data monitoring is crucial for energy management and fault warning. Smart water and electricity meters can collect and transmit water and electricity energy consumption data in real time, providing rich data support for energy management, and helping to achieve energy saving and emission reduction and resource optimization.

[0003] In water and electricity meter data detection, edge computing technology reduces the delay of data transmission to the cloud or data center by sinking data processing to edge nodes, improving the real-time performance and response speed of the system. Edge computing nodes can preliminarily process and analyze water and electricity energy consumption data locally, quickly identify abnormal situations and issue warnings, thereby improving the efficiency and reliability of energy management.

[0004] Although edge computing technology can effectively reduce the delay of data transmission, the computing power of existing edge nodes is limited, making it difficult to deploy complex models on edge nodes, which makes it difficult to balance the generality and accuracy of the model in actual application process, in addition, although the isolation forest algorithm is suitable for anomaly detection, in the multi-device scenario, due to not fully considering the mode difference between devices, it is easy to misjudge, which limits the efficiency and accuracy of water and electricity meter anomaly detection. SUMMARY

[0005] To solve the problem that the computing power limitation of edge nodes hinders the deployment of complex models, and at the same time, the isolation forest algorithm in the multi-device scenario is prone to misjudgment due to not fully considering the mode difference between devices, affecting the efficiency and accuracy of water and electricity meter anomaly detection, the present application provides solutions in the following aspects.

[0006] In a first aspect, the edge computing-based water and electricity energy consumption data monitoring method comprises: obtaining and preprocessing the historical data of a plurality of to-be-monitored water meters and to-be-monitored electricity meters in an industrial area respectively to obtain to-be-monitored water meter vectors and to-be-monitored electricity meter vectors; clustering all to-be-monitored water meter vectors and to-be-monitored electricity meter vectors in the area to obtain clustering results, wherein the clustering results include water meter clusters and electricity meter clusters, and each cluster corresponds to a deployed edge node; grouping the historical water energy consumption data of all water meters or the historical electricity energy consumption data of all electricity meters in a cluster into a training set of the corresponding cluster, training an isolated forest model, and deploying the trained isolated forest model to the edge node of the corresponding cluster; obtaining the similarity between the energy consumption data set of a preset time period before the current time and the sub-sample set corresponding to all trees in the isolated forest, and updating the weight of the corresponding isolated tree; inputting the real-time collected energy consumption data of the to-be-monitored water meters and to-be-monitored electricity meters into the updated isolated forest model of the corresponding edge node, calculating the overall anomaly score of the updated isolated forest model, and evaluating whether the energy consumption data of the to-be-monitored water meters and to-be-monitored electricity meters is abnormal.

[0007] By clustering and analyzing the historical data of a plurality of water meters and electricity meters in an industrial area, and deploying a trained isolated forest model on each cluster corresponding edge node, efficient monitoring of water and electricity energy consumption data is achieved. By updating the model weight to reflect the similarity between the latest energy consumption data set and the sub-sample set used during model training, not only the adaptability of the model to new data and the accuracy of anomaly detection are improved, but also the generalization ability of the model in a multi-device scenario is enhanced, thereby effectively improving the efficiency and precision of water and electricity energy consumption anomaly detection, and ensuring the real-time and reliability of industrial area energy consumption management.

[0008] Preferably, obtaining the clustering results comprises:

[0009] Using hierarchical clustering, each water meter is taken as an independent cluster, the distance between two clusters is calculated, the average connection method is used, the average value of the Euclidean distance between all samples in one cluster and all samples in another cluster is taken as the distance between the two clusters, the two clusters with the smallest distance are found and merged into a new cluster, and the clustering result corresponding to the water meters is obtained when the minimum distance between all clusters is greater than a preset distance threshold.

[0010] Each electricity meter is taken as an independent cluster, the distance between two clusters is calculated, the average connection method is used, the average value of the Euclidean distance between all samples in one cluster and all samples in another cluster is taken as the distance between the two clusters, the two clusters with the smallest distance are found and merged into a new cluster, and the clustering result corresponding to the electricity meters is obtained when the minimum distance between all clusters is greater than a preset distance threshold.

[0011] By using hierarchical clustering and average linkage method to cluster water meters and electricity meters, similar water meters and electricity meters can be effectively grouped according to the characteristics of energy consumption data, so as to form clusters with similar energy consumption patterns. By calculating the distance between clusters and merging the closest clusters until the minimum distance between clusters exceeds the preset threshold, the rationality and accuracy of the clustering results are ensured. The final clustering results are helpful to realize more refined energy consumption management and anomaly detection.

[0012] Preferably, the process of training the isolation forest model comprises:

[0013] Based on the clustering results, extract all historical water energy consumption time series data within a single water meter cluster and all historical electricity energy consumption time series data within a single electricity meter cluster to form corresponding training sets, respectively, wherein each sample represents multiple time point energy consumption data points of each water meter or electricity meter, and each sample is a single feature vector;

[0014] Calculate the local density of each sample in the training set, extract a preset number of samples from the training set without replacement by random sampling to generate a sub-sample set, and construct an isolation tree for the sub-sample set;

[0015] Combine each isolation tree into an isolation forest model, calculate the discrimination degree of each isolation tree to evaluate the separation ability of the isolation tree for sample patterns, and normalize the discrimination degree of each isolation tree as the initial weight of each isolation tree to complete the training of the isolation forest model.

[0016] By extracting historical data within a single cluster and forming a training set, it is ensured that the data for model training has high relevance and consistency. Calculating the local density and constructing the isolation tree helps to evaluate and quantify abnormal behavior in the data, and normalizing the discrimination degree as the initial weight of the tree enhances the recognition ability of the model for different cluster characteristics. It can effectively distinguish between normal energy consumption patterns and abnormal energy consumption patterns, thereby improving the accuracy and efficiency of water and electricity energy consumption anomaly detection.

[0017] Preferably, the calculation method of the local density comprises:

[0018] Select a preset number of neighbor samples for a target sample, calculate the average Euclidean distance from the target sample to each neighbor sample, and in response to the average Euclidean distance being greater than or equal to a preset minimum threshold, take the inverse of the average Euclidean distance as the local density of the target sample, and in response to the average Euclidean distance being less than the preset minimum threshold, take the preset minimum threshold as the average Euclidean distance and take the inverse as the local density of the target sample.

[0019] Preferably, the process of constructing an isolation tree for the sub-sample set comprises:

[0020] The local density of all samples in the statistical sub-sample set and the local density average are calculated, and the sample set is divided, a split feature value is selected from the feature value range of the divided sample set by a preset probability ratio, and the samples are divided into smaller subsets by recursive splitting until all leaf nodes have only one sample or a preset maximum depth is reached, the splitting is stopped, and the construction of the isolation tree is completed.

[0021] The step of dividing the sample set includes: in response to the local density being less than or equal to the local density average, the sample set is divided into a low-density sample set, otherwise the sample set is divided into a high-density sample set.

[0022] Preferably, the isolation degree of the isolation tree comprises:

[0023] Taking any isolation tree as a target isolation tree, the ratio of the sum of water energy consumption of all samples in the low-density sample set and the high-density sample set to the number of samples is calculated based on the target isolation tree, the feature mean of the low-density sample set and the feature mean of the high-density sample set are obtained, and the absolute value of the difference between the two feature means is taken as the isolation degree of the target isolation tree.

[0024] Preferably, the updating of the weight of the corresponding isolation tree comprises:

[0025] Taking any edge node as a target node, the energy consumption data set of all water meters or electricity meters in the target node within a preset time period is obtained, the average Euclidean distance between the energy consumption data set and each sub-sample set of any tree in the corresponding isolation forest is calculated, and the normalized result is normalized again as the updated weight of the isolation tree.

[0026] By dynamically adjusting the weight of each isolation tree in the isolation forest model, the similarity between the latest energy consumption data set of the water meter or electricity meter in the edge node and the sub-sample set used during model training is reflected. By calculating the average Euclidean distance between the energy consumption data set and the sub-sample set and normalizing it, an index representing the similarity can be obtained, and then the weight of the isolation tree is updated accordingly. It can adapt to changes in data distribution, improve the adaptability of the model to the current data pattern and the accuracy of anomaly detection, thereby enhancing the flexibility and robustness of the model in practical application, and ensuring that the anomaly detection result is more accurate and reliable.

[0027] Preferably, the overall anomaly score of the updated isolation forest model comprises:

[0028] Traverse each isolated tree in the isolated forest, obtain the path length of the real-time energy consumption data sample in the corresponding isolated tree and the average path length of all samples in each isolated tree, and calculate the anomaly score of the real-time energy consumption data sample in each isolated tree, sum the product of the anomaly scores of all isolated trees and the corresponding updated weights to obtain the overall anomaly score of the real-time energy consumption data.

[0029] Preferably, the obtaining method of the to-be-monitored water meter vector and the to-be-monitored electric meter vector comprises:

[0030] The historical data of the to-be-monitored water meter and the to-be-monitored electric meter are respectively subjected to data cleaning to eliminate repeated values and invalid values, fill in missing data, and align according to a time axis;

[0031] The processed historical data of the to-be-monitored water meter is extracted to obtain a feature vector: [daily average water consumption, daily water consumption standard deviation, maximum hourly water consumption]; the processed historical data of the to-be-monitored electric meter is extracted to obtain a feature vector: [daily average power consumption, daily power consumption standard deviation, maximum hourly power consumption]; and each feature vector is subjected to standardization processing; wherein one to-be-monitored water meter vector corresponds to one water meter, and one to-be-monitored electric meter vector corresponds to one electric meter.

[0032] In a second aspect, the water and electricity energy consumption data monitoring system based on edge computing comprises a processor and a memory, and the memory stores computer program instructions.

[0033] The present application has the following effects:

[0034] 1、The present application trains an isolated forest model in each water meter cluster and electric meter cluster, respectively, and deploys the model to the corresponding edge node according to the clustering result, so that the model can better adapt to the energy consumption mode of a specific device cluster, updates the weight of the isolated tree by calculating the similarity between the new data set and the sub-sample set, further improves the adaptability of the model to the current data mode, and thus improves the precision of water and electricity energy consumption data anomaly detection.

[0035] 2、The present application utilizes the advantages of edge computing, deploys and runs the isolated forest model on the edge node, reduces the delay of data transmission, and reduces the computing burden of the central server. BRIEF DESCRIPTION OF DRAWINGS

[0036] Figure 1 is a method flowchart of steps S1-S5 in the water and electricity energy consumption data monitoring method based on edge computing of the embodiments of the present application.

[0037] Figure 2 is a structural block diagram of an embodiment of the water and electricity energy consumption data monitoring system based on edge computing of the present application. DETAILED DESCRIPTION

[0038] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments of the present application.

[0039] Reference Figure 1 The water and electricity energy consumption data monitoring method based on edge computing includes steps S1-S5, and specifically as follows:

[0040] S1: Obtain the historical data of a plurality of to-be-monitored water meters and to-be-monitored electricity meters in an industrial area respectively and pre-process to obtain to-be-monitored water meter vectors and to-be-monitored electricity meter vectors.

[0041] For example, the collection frequency of the to-be-monitored water meters and the to-be-monitored electricity meters is 5 minutes / time, the unit of water energy consumption is cubic meters, the unit of electricity energy consumption is kilowatt hours, the historical data of the industrial area recorded in the cloud includes the data of the last 30 days, the historical data of the to-be-monitored water meters and the to-be-monitored electricity meters are data cleaned, and repeated values and invalid values are removed, the historical data of the to-be-monitored water meters after cleaning is extracted to obtain a three-dimensional feature vector [daily average water consumption, daily water consumption standard deviation, maximum hourly water consumption], wherein the daily average water consumption is the average value of the total water consumption per day in 30 days, the daily water consumption standard deviation is the standard deviation of the daily water consumption in 30 days, and the maximum hourly water consumption is the maximum water consumption in all 1-hour periods in 30 days; the cleaned electricity meter data is extracted to obtain a three-dimensional feature vector [daily average electricity consumption, daily electricity consumption standard deviation, maximum hourly electricity consumption], wherein the daily average electricity consumption is the average value of the total electricity consumption per day in 30 days, the daily electricity consumption standard deviation is the standard deviation of the daily electricity consumption in 30 days, and the maximum hourly electricity consumption is the maximum electricity consumption in all 1-hour periods in 30 days.

[0042] The three-dimensional feature vectors are standardized, and a Z-score (Z-Standard Score) standardization method is used to obtain standardized feature vectors, wherein one three-dimensional feature vector corresponds to one water meter or electricity meter.

[0043] S2: Cluster all to-be-monitored water meter vectors and to-be-monitored electricity meter vectors in the area to obtain clustering results, wherein the clustering results include water meter clusters and electricity meter clusters, and each cluster corresponds to a deployed edge node.

[0044] Using hierarchical clustering, each water meter is taken as an independent cluster, and the distance between clusters is calculated pairwise. The average linkage method is used, and the average of the Euclidean distances between all samples in one cluster and all samples in another cluster is taken as the distance between the two clusters. The two clusters with the smallest distance are found and merged into a new cluster. This process continues until the minimum distance between all clusters is greater than the preset distance threshold, and the clustering result corresponding to the water meter is obtained.

[0045] Each electricity meter is taken as an independent cluster, and the distance between clusters is calculated pairwise. The average linkage method is used, and the average of the Euclidean distances between all samples in one cluster and all samples in another cluster is taken as the distance between the two clusters. The two clusters with the smallest distance are found and merged into a new cluster. This process continues until the minimum distance between all clusters is greater than the preset distance threshold, and the clustering result corresponding to the electricity meter is obtained.

[0046] For example, the preset distance threshold is 0.3, which can be adjusted according to specific circumstances.

[0047] If the average Euclidean distance between the two water meter clusters calculated is reduced to 0.25 or below, the two clusters will be merged into one water meter cluster. The purpose of this process is to ensure that each cluster in the clustering result has a high degree of similarity between its members, so that the subsequent isolation forest model training can more accurately reflect the energy consumption patterns of a specific water meter cluster.

[0048] Specifically, the average Euclidean distance is a key indicator of the similarity between two clusters, which is obtained by calculating the average of the Euclidean distances between all samples in one cluster and all samples in another cluster. The Euclidean distance is a method of measuring the actual distance between two points in a multi-dimensional space, and its calculation formula is the square root of the sum of the squares of the differences in each dimension between the two points. In this invention, the preset distance threshold of 0.25 is an example value, which can be adjusted according to the actual application scenario and data characteristics.

[0049] When the average Euclidean distance between two water meter clusters is less than or equal to 0.25, it indicates that the two clusters are relatively close in feature space and have similar water usage patterns. At this time, merging the two clusters into one cluster can make the isolation forest model focus more on learning the energy consumption characteristics of this specific water usage pattern during training, thereby improving the detection accuracy of the model for abnormal water usage behavior.

[0050] In addition, by merging similar water meter clusters, the complexity of the model can be reduced, the generalization ability of the model can be improved, and overfitting can be avoided. This is particularly important for models deployed on edge nodes, as edge nodes have relatively limited computing resources and need to simplify the model structure as much as possible while ensuring model performance.

[0051] In summary, by merging water meter clusters with an average Euclidean distance of 0.25 or less during hierarchical clustering, the method described in the present application can generate more reasonable and accurate clustering results, providing a solid foundation for subsequent isolated forest model training and energy consumption data anomaly detection. Not only does it improve the accuracy and reliability of the model, but it also optimizes the use of edge computing resources.

[0052] S3: The historical water energy consumption data of all water meters or the historical electricity energy consumption data of all electricity meters in the cluster are respectively formed into a training set for the corresponding cluster, and an isolated forest model is trained. The trained isolated forest model is deployed to the edge node corresponding to the cluster.

[0053] The process of training an isolated forest model includes:

[0054] Based on the clustering results, all historical water energy consumption time series data in a single water meter cluster and all historical electricity energy consumption time series data in a single electricity meter cluster are extracted to form corresponding training sets, where each sample represents multiple time point energy consumption data points of each water meter or electricity meter, and each sample is a single feature vector.

[0055] The local density of each sample in the training set is calculated, and a predetermined number of samples are randomly sampled from the training set without replacement to generate a sub-sample set. An isolated tree is constructed for the sub-sample set.

[0056] The calculation method of local density includes:

[0057] Taking any sample as a target sample, a predetermined number of neighbor samples are selected, the average Euclidean distance between the target sample and each neighbor sample is calculated, and in response to the average Euclidean distance being greater than or equal to a predetermined minimum threshold, the reciprocal of the average Euclidean distance is taken as the local density of the target sample. In response to the average Euclidean distance being less than the predetermined minimum threshold, the predetermined minimum threshold is taken as the average Euclidean distance, and the reciprocal is taken as the local density of the target sample.

[0058] The calculation of local density is beneficial to the identification of abnormal points in the data set. In the isolated forest, abnormal points usually refer to those points with significantly different characteristics compared to most other data points. By calculating the local density, these abnormal points can be identified because they often have lower local density values; the adaptability and robustness of the model to different data distributions are enhanced, and the use of limited computing resources in the edge computing environment is optimized, so that the model can more efficiently process dynamically changing data.

[0059] For example, 8 neighbor samples are selected for analysis, which can be adjusted according to specific circumstances.

[0060] Specifically, the local density satisfies the following relationship:

[0061] ;

[0062] wherein, denotes the local density of the i-th sample, denotes the local density of the i-th sample, denotes the Euclidean distance from the i-th sample to the j-th nearest neighbor sample, denotes the total number of nearest neighbor samples, denotes the minimum threshold value, in the present embodiment, to ensure that when calculating the local density of the sample, both the high degree of aggregation of the same value sample and the effective avoidance of numerical calculation anomalies can be preserved. The local density and the average local density of all samples in the sub-sample set are calculated, and the sample set is divided. A split feature value is selected from the feature value range of the divided sample set according to a preset probability ratio. The samples are divided into smaller subsets by recursive splitting until all leaf nodes have only one sample or reach a preset maximum depth. The splitting is stopped, and the construction of the isolation tree is completed. The step of dividing the sample set includes: in response to the local density being less than or equal to the average local density, the sample set is divided into a low-density sample set; otherwise, the sample set is divided into a high-density sample set.

[0063] That is, according to the low-density sample set and the high-density sample set, when determining the split feature value, a value can be selected according to a preset probability distribution, for example, a value is randomly selected from the feature value range of the low-density sample set with a probability of 70%, and a value is selected from the feature value range of the high-density sample set with a probability of 30%.

[0064] By distinguishing between low-density and high-density sample sets, the distribution characteristics of the data can be more accurately reflected. Low-density regions usually contain abnormal points or sparse data regions, while high-density regions contain more normal data points. When constructing an isolation tree, selecting a split feature value is a key step. By selecting a split feature value according to the density distribution of the sample set, abnormal points can be more effectively isolated, and the abnormal detection capability of the model can be improved.

[0065] By preferentially selecting feature values in low-density regions as split points, abnormal points can be more quickly isolated from normal data, thereby improving the accuracy of abnormal detection; in the case of uneven data distribution, this method can reduce invalid splitting during model training, thereby improving training efficiency; by more accurately selecting split feature values, the misjudgment of normal data as abnormal and the failure to detect actual abnormalities or false negatives can be reduced.

[0066]

[0067] By preferentially selecting feature values in low-density regions as split points, abnormal points can be more quickly isolated from normal data, thereby improving the accuracy of abnormal detection; in the case of uneven data distribution, this method can reduce invalid splitting during model training, thereby improving training efficiency; by more accurately selecting split feature values, the misjudgment of normal data as abnormal and the failure to detect actual abnormalities or false negatives can be reduced.

[0068] ​​The isolated trees are combined into an isolated forest model. The discrimination of each isolated tree is calculated to evaluate its ability to separate sample patterns. The discrimination of each isolated tree is normalized and used as the initial weight of each isolated tree to complete the training of the isolated forest model.

[0069] Using any isolated tree as the target isolated tree, calculate the ratio of the total water energy consumption of all samples in the low-density sample set to the number of samples based on the target isolated tree. The feature mean of the low-density sample set and the feature mean of the high-density sample set are obtained. The absolute value of the difference between the two feature means is used as the discriminant of the target isolated tree.

[0070] Specifically, the discrimination index satisfies the following relationship:

[0071] ;

[0072] In the formula, The mean difference, or discriminant, of an isolated tree reflects its ability to separate high-density and low-density sample sets. This indicates the number of samples in a low-density sample set. Indicates the first in the low-density sample set Water energy consumption value for each sample This indicates the number of samples in a high-density sample set. Indicates the first high-density sample set Water energy consumption value for each sample and These refer to the feature means of the low-density sample set and the high-density sample set, respectively. Mean difference. The larger the value, the more significant the difference in features between the normal pattern (high density) and the potentially abnormal pattern (low density) in the tree, and the higher the tree's discriminative power.

[0073] S4: Obtain the similarity between the energy consumption dataset for the preset time period before the current moment and the corresponding subset of all trees in the isolated forest, and update the weight of the corresponding isolated tree.

[0074] Taking any edge node as the target node, obtain the energy consumption dataset of all water meters or electricity meters within the target node within a preset time period, calculate the average Euclidean distance between the energy consumption dataset and each subset of samples of any tree in the corresponding isolated forest, and perform normalization processing. Then, normalize the product between the normalized result and the initial weights again to use as the weights of the updated isolated tree.

[0075] For example, the preset time period is the three days prior to the current time, which can be adjusted according to specific circumstances.

[0076] Specifically, the weights of the updated isolated tree satisfy the following relationship:

[0077] ;

[0078] In the formula, Indicates the first The updated weights of the isolated trees Indicates the first The initial weights of the isolated trees, This represents the energy consumption dataset within a preset time period prior to the current moment. In the isolated forest Subset of trees The average Euclidean distance, This represents the energy consumption dataset within a preset time period prior to the current moment. With the first in the isolated forest The normalized similarity of subsets of trees. A smaller average Euclidean distance in the energy consumption dataset indicates a higher similarity, corresponding to higher weights for trained isolated trees, thus enhancing their influence on the current anomaly detection results. This represents the total number of isolated trees in an isolated forest. This represents the normalization function.

[0079] S5: Input the real-time energy consumption data of the water meters and electricity meters to be monitored into the updated isolated forest model of the corresponding edge nodes, calculate the overall anomaly score of the updated isolated forest model, and evaluate whether the energy consumption data of the water meters and electricity meters to be monitored are abnormal.

[0080] Traverse each isolated tree in the isolated forest, obtain the path length of the real-time energy consumption data sample in the corresponding isolated tree and the average path length of all samples in each isolated tree, calculate the anomaly score of the real-time energy consumption data sample in each isolated tree, and sum the products of the anomaly scores of all isolated trees and the corresponding updated weights to obtain the overall anomaly score of the real-time energy consumption data.

[0081] If the overall anomaly score is less than or equal to the preset anomaly threshold, the real-time energy consumption data is considered normal; otherwise, if it is greater than the preset anomaly threshold, the real-time energy consumption data is considered abnormal.

[0082] For example, the preset abnormal threshold is 0.6, which can be adjusted according to specific circumstances.

[0083] Specifically, the overall anomaly score satisfies the following relationship:

[0084] ;

[0085] In the formula, This represents the overall anomaly score of real-time energy consumption data. This represents the total number of isolated trees in an isolated forest. Indicates the first The updated weights of the isolated trees represents the path length of the sample in the i-th isolated tree, represents the average path length of all samples in the i-th isolated tree.

[0086] The real-time collected water meter and electricity meter energy consumption data are input into the updated isolated forest model on the corresponding edge node, so that the model can adapt to the specific type and mode of data at the edge node. By running the updated model on the edge node, the decision-making process of the model can be closely corresponding to the data characteristics of the edge node, thereby improving the accuracy and efficiency of anomaly detection. By taking advantage of edge computing, data transmission delay is reduced, and the model can quickly respond to new data input, realizing real-time monitoring and analysis of energy consumption data, and further optimizing energy management and improving the reliability of system operation.

[0087] The present application also provides an edge computing-based water and electricity energy consumption data monitoring system. As shown in Figure 2 The system includes a processor and a memory, and the memory stores computer program instructions that, when executed by the processor, implement the edge computing-based water and electricity energy consumption data monitoring method according to the first aspect of the present application. The system also includes a communication bus and a communication interface, as well as other components known to those skilled in the art, the settings and functions of which are known in the art, and therefore will not be described here.

[0088] It should be noted that, for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which are all within the scope of the present application. Therefore, the protection scope of the present application patent should be subject to the appended claims.​​

Claims

1. A method for monitoring water, electricity and energy consumption data based on edge computing, characterized in that, The method comprises the following steps: Respectively acquire and preprocess historical data of a plurality of to-be-monitored water meters and to-be-monitored electric meters in an industrial area to obtain to-be-monitored water meter vectors and to-be-monitored electric meter vectors; Cluster all to-be-monitored water meter vectors and to-be-monitored electric meter vectors in the area to obtain clustering results, wherein the clustering results comprise water meter clusters and electric meter clusters, and one edge node is deployed for each cluster; Respectively form training sets of the corresponding clusters by using historical water energy consumption data of all water meters in the clusters or historical electric energy consumption data of all electric meters in the clusters, train an isolated forest model, and deploy the trained isolated forest model to the edge node of the corresponding cluster; The calculation method of the local density in the process of training the isolated forest model comprises: Select a preset number of neighbor samples for a target sample, calculate the average Euclidean distance between the target sample and each neighbor sample, and in response to the average Euclidean distance being greater than or equal to a preset minimum threshold, take the inverse of the average Euclidean distance as the local density of the target sample, and in response to the average Euclidean distance being less than the preset minimum threshold, take the inverse of the preset minimum threshold as the local density of the target sample; Acquire the similarity between the energy consumption dataset of a preset time period before the current time and the sub-sample set corresponding to all trees in the isolated forest, and update the weight of the corresponding isolated tree; Input the real-time collected energy consumption data of the to-be-monitored water meters and to-be-monitored electric meters into the updated isolated forest model of the corresponding edge node, calculate the overall anomaly score of the updated isolated forest model, and evaluate whether the energy consumption data of the to-be-monitored water meters and to-be-monitored electric meters are abnormal. 2.The edge computing based water and electricity energy consumption data monitoring method according to claim 1, characterized in that, The acquisition of the clustering results comprises: Using hierarchical clustering, each water meter is taken as an independent cluster, the distance between two clusters is calculated, the average Euclidean distance between all samples in one cluster and all samples in another cluster is taken as the distance between the two clusters by using the average connection method, the two clusters with the smallest distance are found and merged into a new cluster, and the clustering result corresponding to the water meters is obtained until the minimum distance between all clusters is greater than a preset distance threshold; Each electric meter is taken as an independent cluster, the distance between two clusters is calculated, the average Euclidean distance between all samples in one cluster and all samples in another cluster is taken as the distance between the two clusters by using the average connection method, the two clusters with the smallest distance are found and merged into a new cluster, and the clustering result corresponding to the electric meters is obtained until the minimum distance between all clusters is greater than a preset distance threshold. 3.The method of claim 1, wherein, The process of training the isolated forest model comprises: Based on the clustering results, extract all historical water energy consumption time series data in a single water meter cluster and all historical electric energy consumption time series data in a single electric meter cluster to form corresponding training sets, wherein each sample represents a plurality of energy consumption data points of each water meter or electric meter at a plurality of time points, and each sample is a single feature vector; Calculate the local density of each sample in the training set, generate a sub-sample set by randomly sampling a preset number of samples from the training set without replacement, and construct an isolated tree for the sub-sample set; The isolated trees are combined into an isolated forest model, the discrimination degrees of the isolated trees are calculated respectively to evaluate the separation ability of the isolated trees on sample patterns, and the discrimination degrees of the isolated trees are normalized to serve as initial weights of the isolated trees to complete training of the isolated forest model. 4.The method of claim 3, wherein, The isolated tree is constructed for the sub-sample set, including: The local density and the local density average of all samples in the sub-sample set are counted, and the sample set is divided, a split feature value is selected from the feature value range of the divided sample set according to a preset probability ratio, the samples are divided into smaller subsets according to recursive splitting until all leaf nodes have only one sample or a preset maximum depth is reached, the splitting is stopped, and the construction of the isolated tree is completed. The step of dividing the sample set includes: in response to the local density being less than or equal to the local density average, the sample set is divided into a low-density sample set, otherwise, the sample set is divided into a high-density sample set. 5.The method of claim 3, wherein, The discrimination degree of the isolated tree includes: Taking any isolated tree as a target isolated tree, the ratio of the sum of water energy consumption of all samples in the low-density sample set and the high-density sample set to the number of samples is calculated based on the target isolated tree, the feature average of the low-density sample set and the feature average of the high-density sample set are obtained, and the absolute value of the difference between the two feature averages is taken as the discrimination degree of the target isolated tree. 6.The method of monitoring water and electricity energy consumption data based on edge computing according to claim 1, characterized in that, The weight of the corresponding isolated tree is updated, including: Taking any edge node as a target node, the energy consumption data set of all water meters or electricity meters in the target node within a preset time period is obtained, the average Euclidean distance between the energy consumption data set and each sub-sample set of any tree in the corresponding isolated forest is calculated, and the normalized result is multiplied by the initial weight to obtain the updated weight of the isolated tree. 7.The method of claim 1, wherein, The overall anomaly score of the updated isolated forest model includes: The path length of the real-time energy consumption data sample in the corresponding isolated tree and the average path length of all samples in each isolated tree are obtained by traversing each isolated tree in the isolated forest, and the anomaly score of the real-time energy consumption data sample in each isolated tree is calculated, the anomaly scores of all isolated trees are multiplied by the corresponding updated weights, and the sum is taken to obtain the overall anomaly score of the real-time energy consumption data. 8.The method of claim 1, wherein, The acquisition method of the to-be-monitored water meter vector and the to-be-monitored electricity meter vector includes: The historical data of the to-be-monitored water meter and the to-be-monitored electricity meter are respectively processed to remove duplicate values and invalid values, fill in missing data, and align according to the time axis; The feature vector of the processed historical data of the to-be-monitored water meter is extracted: [daily water consumption, daily water consumption standard deviation, maximum hourly water consumption]; the feature vector of the processed historical data of the to-be-monitored electricity meter is extracted: [daily electricity consumption, daily electricity consumption standard deviation, maximum hourly electricity consumption]; and each feature vector is standardized; one to-be-monitored water meter vector corresponds to one water meter, and one to-be-monitored electricity meter vector corresponds to one electricity meter.

9. The water and electricity energy consumption data monitoring system based on edge computing, characterized in that, It includes: A processor and a memory, the memory stores computer program instructions, when the computer program instructions are executed by the processor, the method for monitoring water and electricity energy consumption data based on edge computing according to any one of claims 1-8 is realized.

Citation Information

Patent Citations

  • Power grid data acquisition method, device and equipment based on digital twinning and medium

    CN116090614A

  • Electric charge abnormal data detection method and system, medium and equipment

    CN120671007A