GNN-based Charging Pile Abnormal Power Consumption Behavior Recognition Method and System
By constructing an electrical graph based on GNN and combining a bidirectional long and short-term memory network, the problem of abnormal electricity use of charging piles is solved, and the accurate identification and management of the electricity use behavior of charging piles is achieved, and the level of power management is improved.
Patent Information
- Application Number
- CN202510337823.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-03-21
AI Technical Summary
The prior art is difficult to effectively identify the complex power consumption patterns of charging piles, resulting in waste of power resources and increased safety risks.
Using a GNN-based method, high-dimensional features are extracted by constructing an electrical graph, using a trained GNN model, and combining a bidirectional long and short-term memory network to detect the electricity consumption behavior of the charging pile to identify the abnormal behavior of the charging pile.
It realizes accurate identification of abnormal electricity use behaviors of charging piles, improves the level of power management, reduces waste of power resources and safety hazards, and ensures the stable operation of the power system.
Smart Images

Figure CN119848750B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of charging pile power consumption analysis, and particularly to a method and system for identifying abnormal charging pile power consumption behaviors based on GNN. Background Art
[0002] With the popularization of electric vehicles, the use of residential charging piles is increasing day by day, and the monitoring of the power consumption behavior of charging piles has become an important part of power management. In the existing technology for identifying abnormal power consumption behaviors, it is difficult to identify complex power consumption patterns, and the ability to identify complex power consumption patterns is insufficient, making it impossible to effectively distinguish normal and abnormal power consumption behaviors, resulting in a waste of power resources and an increase in potential safety hazards.
[0003] Therefore, there is an urgent need for a method that can effectively identify abnormal charging pile power consumption behaviors to solve the deficiencies of the existing technology and improve the level of power management. Summary of the Invention
[0004] The purpose of this application is to overcome the defects of the existing technology and provide a method and system for identifying abnormal charging pile power consumption behaviors based on GNN.
[0005] In the first aspect, this application provides a method for identifying abnormal charging pile power consumption behaviors based on GNN, including the following steps:
[0006] Obtain the historical power consumption data of the user's charging pile and user information;
[0007] Construct a power consumption graph based on the historical power consumption data of the charging pile and user information;
[0008] Use the trained GNN model to extract features from the power consumption graph to obtain high-dimensional features;
[0009] Obtain historical time series power consumption data based on the historical power consumption data of the charging pile or the power consumption graph;
[0010] Combine the high-dimensional features with the historical time series power consumption data to form a first input sequence, and train and optimize a bidirectional long short-term memory network based on the first input sequence;
[0011] Obtain the real-time power consumption data of the user's charging pile;
[0012] Obtain a second input sequence based on the real-time power consumption data of the charging pile;
[0013] Input the second input sequence into the trained and optimized bidirectional long short-term memory network to detect abnormal power consumption behaviors of the user's charging pile, so as to obtain the types of abnormal power consumption behaviors of the user's charging pile.
[0014] Optionally, the obtained historical charging pile power consumption data includes the historical charging pile power consumption data of multiple users, and the obtained user information includes the user information of multiple users corresponding to the charging piles; the constructing a power consumption graph based on the historical charging pile power consumption data includes:
[0015] Regarding each user as a node;
[0016] Obtaining the similarity between adjacent users;
[0017] Establishing edges between adjacent users with a similarity greater than a preset threshold to obtain an initial power consumption graph;
[0018] Normalizing the features of each node in the initial power consumption graph and sparsifying the edges to obtain the power consumption graph.
[0019] Optionally, the formula for obtaining the similarity between adjacent users is as follows:
[0020]
[0021] Wherein, is the power consumption of the charging pile of the first user at time t, is the power consumption of the charging pile of the second user adjacent to the first user at time t, and n is the total number of time periods.
[0022] Optionally, the using the trained GNN model to extract features from the power consumption graph to obtain high-dimensional features includes:
[0023] Providing a trained GNN model;
[0024] Based on the power consumption graph, obtaining the features of each node; inputting the features of the nodes into the trained GNN model for feature aggregation to obtain the high-dimensional features of all nodes.
[0025] Optionally, the combining the high-dimensional features with the historical time series power consumption data to form a first input sequence and training and optimizing a bidirectional long short-term memory network based on the first input sequence includes:
[0026] Combining the high-dimensional features with the historical time series power consumption data of the user to form the first input sequence;
[0027] Setting label data;
[0028] Constructing an initial bidirectional long short-term memory network;
[0029] Using the first input sequence to train the initial bidirectional long short-term memory network and optimizing the trained initial bidirectional long short-term memory network using a loss function;
[0030] Use an index evaluation model to evaluate the performance of the initial bidirectional long short-term memory network after training optimization;
[0031] Adjust the network parameters according to the evaluation results to obtain a bidirectional long short-term memory network.
[0032] Optionally, before training the initial bidirectional long short-term memory network using the first input sequence, it further includes constructing a data set, and the constructing of the data set includes: dividing the first input sequence into a training set, a test set, and a validation set.
[0033] Optionally, the constructing of the initial bidirectional long short-term memory network includes: adding a Dropout layer behind each layer of the basic bidirectional long short-term memory network.
[0034] Optionally, the inputting of the second input sequence into the trained and optimized bidirectional long short-term memory network to perform anomaly detection on the user's charging pile power consumption behavior to obtain the type of abnormal charging pile power consumption behavior of the user includes:
[0035] Input the second input sequence into the trained and optimized bidirectional long short-term memory network for anomaly detection to obtain a probability distribution value;
[0036] Compare the probability distribution value with a preset threshold to obtain the type of abnormal charging pile power consumption behavior of the user.
[0037] Optionally, the type of abnormal charging pile power consumption behavior of the user includes: no problem with the charging pile, multiple vehicles charging, the charging pile is changed to domestic electricity, the charging pile is changed to commercial electricity, and the charging pile is suspected of stealing electricity.
[0038] In a second aspect, the present application further provides a GNN-based charging pile power consumption abnormal behavior recognition system, including:
[0039] A data collection module, configured to obtain the historical power consumption data of the user's charging pile, user information, and the real-time power consumption data of the user's charging pile;
[0040] A preprocessing module, configured to construct a power consumption graph based on the historical power consumption data of the charging pile and user information;
[0041] A high-dimensional feature acquisition module, configured to perform feature extraction on the power consumption graph based on a GNN module to obtain high-dimensional features;
[0042] A training module, configured to obtain the historical time-series power consumption data of the user based on the historical power consumption data of the charging pile or the power consumption graph, combine the high-dimensional features with the historical time-series power consumption data to form a first input sequence, and train and optimize a bidirectional long short-term memory network based on the first input sequence;
[0043] An anomaly recognition module, configured to obtain a second input sequence based on the real-time power consumption data of the charging pile; input the second input sequence into the trained and optimized bidirectional long short-term memory network to perform anomaly detection on the user's charging pile power consumption behavior, so as to obtain the type of abnormal behavior of the user's charging pile power consumption.
[0044] The present application provides a method and system for identifying abnormal behavior of charging pile power consumption based on GNN. An electricity consumption graph is constructed through the historical power consumption data of the charging pile and user information, high-dimensional features are obtained through a GNN model, and a bidirectional long short-term memory network is trained and optimized to more comprehensively capture the temporal dependence relationship in time-series data. The second input sequence obtained based on the real-time power consumption data of the charging pile is input into the trained bidirectional long short-term memory network to perform anomaly detection on the user's charging pile power consumption behavior, realizing effective identification and classification of the types of abnormal behavior of the user's charging pile power consumption, being able to accurately identify abnormal behavior under complex power consumption patterns, effectively distinguish normal and abnormal power consumption situations, helping to improve the power management level, reduce power resource waste, reduce potential safety hazards, and ensure the stable operation of the power system.
[0045] To make the above features and advantages of the invention more obvious and understandable, specific embodiments are hereinafter given and described in detail in conjunction with the accompanying drawings as follows. Description of the Drawings
[0046] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0047] Figure 1 It is a flowchart of a method for identifying abnormal behavior of charging pile power consumption based on GNN provided in an embodiment of the present application.
[0048] Figure 2 It is a flowchart of step S50 in a method for identifying abnormal behavior of charging pile power consumption based on GNN provided in an embodiment of the present application.
[0049] Figure 3 It is a schematic structural diagram of a system for identifying abnormal behavior of charging pile power consumption based on GNN provided in another embodiment of the present application. Detailed Implementation Manner
[0050] To make the objectives and technical solutions of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this application. Obviously, the described embodiments are some, but not all, of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art based on the described embodiments of this application without creative efforts shall fall within the scope of protection of this application.
[0051] In one embodiment, refer to Figure 1 , this application provides a method for identifying abnormal charging pile power consumption behaviors based on a GNN (Graph Neural Network). The method for identifying abnormal charging pile power consumption behaviors based on a GNN may include the following steps: S10 to S80.
[0052] S10: Obtain the historical charging pile power consumption data of the user and the user information.
[0053] S20: Construct a power consumption graph based on the historical charging pile power consumption data and the user information.
[0054] S30: Use a pre-trained GNN model to extract features from the power consumption graph to obtain high-dimensional features.
[0055] S40: Obtain historical time series power consumption data based on the historical charging pile power consumption data or the power consumption graph.
[0056] S50: Combine the high-dimensional features with the historical time series power consumption data to form a first input sequence, and train and optimize a bidirectional long short-term memory network based on the first input sequence.
[0057] S60: Obtain the real-time charging pile power consumption data of the user.
[0058] S70: Obtain a second input sequence based on the real-time charging pile power consumption data.
[0059] S80: Input the second input sequence into the trained and optimized bidirectional long short-term memory network to detect abnormal charging pile power consumption behaviors of the user, so as to obtain the types of abnormal charging pile power consumption behaviors of the user.
[0060] In the method for identifying abnormal charging pile power consumption behavior based on GNN of the present application, a power consumption graph is constructed through the historical power consumption data and power consumption information of the charging pile; a GNN model is used to extract high-dimensional features and combined with historical time series data to train and optimize a bidirectional long short-term memory network; the second input sequence obtained based on the real-time power consumption data of the charging pile is input into the trained bidirectional long short-term memory model to detect abnormal charging pile power consumption behavior of users. The method of the present application can deeply mine the characteristics of power consumption data, accurately identify abnormal charging pile power consumption behavior, effectively distinguish normal and abnormal power consumption, and solve the problem of identifying complex power consumption patterns; it can improve the power management level, reduce power resource waste, reduce potential safety hazards, ensure the stable operation of the power system, enhance the control ability of the power management department over the power consumption of charging piles, discover and handle abnormal situations in a timely manner, improve the safety and rationality of power consumption, meet the development needs of refined power management, and help build an efficient and intelligent power management system.
[0061] In step S10, refer to Figure 1 step S10 in, and obtain the historical power consumption data of the user's charging pile and user information.
[0062] As an example, the historical power consumption data of the user's charging pile can be obtained from devices such as the database of the power company, the charging pile operation management platform, and the intelligent electricity meter of the charging pile.
[0063] As an example, the historical power consumption data of the user's charging pile may include 96-point load data, as well as power consumption data such as voltage, current, and function. Among them, the 96-point load data can reflect the power consumption per hour and the power consumption time.
[0064] As an example, the abnormal type can be further analyzed according to the 96-point curve of the electric energy indication. "96-point load" usually refers to dividing a day (24 hours) into 96 time points in the power system, and the power load data corresponding to each time point. The load data is collected every 15 minutes, so 96 data points will be obtained in a day, and these data reflect the power load conditions at different times of the day. The 96-point curve can more detailedly display the change law and fluctuation of the power load in a day. For example, by analyzing the 96-point curve, the peak and trough periods of power consumption in a day can be found.
[0065] The user information of the user can be obtained through the registration of the user who installs the charging pile. Of course, in other examples, other ways to obtain user information can also be used to obtain the user information corresponding to the charging pile; the user information may include at least one of: user ID, the number of other charging-powered vehicles of the user, the type of other charging-powered vehicles of the user, and the real estate information of the user (used to indicate whether the user owns a property and a shop, such as renting a house, renting a shop, having a property, having a shop, etc.).
[0066] As an example, assume that electricity consumption data for one month has been collected. The data table may include: user ID, electricity consumption time, electricity consumption amount, number of transportation vehicles, and property information. Among them, the user ID is used to uniquely identify each user; the electricity consumption time can record the specific time of electricity consumption (such as 2023-10-01 19:00); the electricity consumption amount represents the electricity consumption during this time period (such as 5 kWh); the number of transportation vehicles represents the number of other rechargeable transportation vehicles owned by the user and their family. These data help to more comprehensively understand the user's electricity consumption behavior, help to detect potential abnormal changes in advance, and are the cornerstone for subsequent construction of the graph structure, analysis of the user's electricity consumption behavior pattern, and training of the model.
[0067] In step S20, refer to Figure 1 step S20 in
[0068] As an example, step S20 may include the following steps: S201~S204.
[0069] S201: Take each user as a node.
[0070] S202: Obtain the similarity between adjacent users.
[0071] S203: Establish edges between adjacent users whose similarity is greater than the preset threshold to obtain an initial electricity consumption graph.
[0072] S204: Standardize the features of each node in the initial electricity consumption graph and sparsify the edges to obtain the electricity consumption graph.
[0073] As an example, in step S201, each user can be regarded as a node in the electricity consumption graph. The edges between the nodes represent the similarity between users. For example, the geographical location is close, the electricity consumption patterns are similar, etc. Each node can include the user's information and the user's historical electricity consumption data of the charging pile. For example, the user's historical electricity consumption data of the charging pile, the electricity consumption peak of the user's charging pile, and the user's property information, etc.; the user's historical electricity consumption data of the charging pile is a sequence of electricity consumption amounts in the past period of time; the electricity consumption peak is the maximum electricity consumption of the user's charging pile at a specific time; the property information is whether the user owns a property and a shop.
[0074] As an example, in step S202, methods such as Euclidean distance or cosine similarity can be used to calculate the similarity between users. For example, for the electricity consumption pattern of the charging pile of the first user A and the electricity consumption pattern of the charging pile of the adjacent second user B, the similarity of the electricity consumption amounts between the charging pile of the adjacent first user A and the charging pile of the second user B can be calculated using the following formula:
[0075]
[0076] Among them, is the electricity consumption of the charging pile of the first user A at time t, is the electricity consumption of the charging pile of the second user B at time t, and n is the total number of time periods.
[0077] As an example, in step S203, when the similarity between two nodes exceeds a preset threshold (for example, the threshold can be but not limited to 0.8), an edge is established between the two nodes to form an initial electricity consumption graph.
[0078] As an example, in step S204, the features of each node in the initial electricity consumption graph can be standardized so that its mean is 0 and its variance is 1. The standardization formula can be expressed as follows:
[0079]
[0080] Among them, is the original feature, is the mean of the original features, is the standard deviation of the original features, is the standardized feature.
[0081] As an example, the edges can be sparsified by removing the edges with smaller weights among all the edges to reduce the computational complexity and retain the important connection relationships, and finally the preprocessed electricity consumption graph data is obtained.
[0082] In an example, assume there are three users (the first user A, the second user B, and the third user C), and the electricity consumption data and user information of their charging piles are as follows:
[0083]
[0084] Among them, the first user A, the second user B, and the third user C are three nodes respectively. Then the electricity consumption sequence of the charging pile of the first user A is [5], and the electricity consumption sequence of the charging pile of the second user B is [4.5]. First, the similarity between nodes A and B can be calculated as 0.99, which is greater than the preset threshold (such as 0.8), so an edge is established between nodes A and B. The features of the first user A can be obtained from the historical electricity consumption data of the charging pile as [5, 3], that is, the historical electricity consumption of the charging pile of the first user A and the number of vehicles. The features of the second user B are [4.5, 2], and the features of the third user C are [6, 1]. Further standardize the features to obtain the standardized feature values. Combine the standardized feature values of all users with the sparsified edges to obtain the electricity consumption graph of the preprocessed user electricity consumption data.
[0085] In step S30, refer to Figure 1 step S30 in Figure 1 , and use the pre-trained GNN model to extract features from the electricity consumption map to obtain high-dimensional features.
[0086] As an example, step S30 may include the following steps: S301~S302.
[0087] S301: Provide a trained GNN model.
[0088] S302: Based on the electricity consumption map, obtain the features of each node; input the features of the nodes into the trained GNN model for feature aggregation to obtain the high-dimensional features of all nodes.
[0089] As an example, in step S301, the training method of the GNN model is known to those skilled in the art and will not be elaborated here.
[0090] As an example, in step S302, based on the electricity consumption map, the electricity consumption map may include nodes and the edges between the nodes, and the weight of the edge represents the similarity between users; the features of each node can be obtained based on the electricity consumption map. Input the feature vectors of the user nodes into the trained GNN model for feature aggregation to obtain the high-dimensional features of all nodes.
[0091] As an example, the feature vector of each user node may include information such as the historical electricity consumption of the user's charging pile, the real estate information of the user, and the electricity consumption peak of the user's charging pile. For example, the feature vector of the first user A may be:
[0092]
[0093] Among them, 5 represents the historical electricity consumption, 3 represents the number of vehicles, 1 represents the real estate information (such as renting a house), and 0 represents the electricity consumption peak.
[0094] As an example, the above feature vectors are input into the GNN model via the input layer.
[0095] As an example, aggregate the information of neighbor nodes through the graph convolutional layer of the GNN model. Suppose there are layers of graph convolution, and the output features of each layer can be obtained through the following formula:
[0096]
[0097] Among them, is the feature representation of node at the layer, is the feature representation of neighbor node at the k-1 layer, is the set of neighbor nodes of node is the normalization coefficient of the edge, is the weight matrix of the th layer, is the bias of the th layer, is the activation function.
[0098] As an example, the activation function can include Tanh (hyperbolic tangent function), ReLU (rectified linear unit), Leaky ReLU (leaky rectified linear unit), PReLU (parametric rectified linear unit), etc.
[0099] As an example, in each layer of graph convolution, the information of neighboring nodes is aggregated to enhance the feature representation of the nodes. Through multi-layer feature aggregation, the features of the nodes will gradually contain more context information. For example, the feature of the first user A can become: , which means that the feature of the first user A has fused the information of its neighboring nodes. After multi-layer graph convolution, a high-dimensional feature representation of the node corresponding to each user can be obtained.
[0100] In another example, assume there are three users (the first user A, the second user B, and the third user C). The feature vector of the first user A is , the feature vector of the second user B is , and the feature vector of the third user C is . In the first layer of graph convolution, assume the neighbors of the first user A are the second user B and the third user C. Then the aggregated feature of the first user A can be represented by the following formula:
[0101]
[0102] where, is the feature representation of node A (i.e., the node corresponding to the first user A) at the 1st layer, is the feature representation of node B (the node corresponding to the second user B) at the 0th layer, is the feature representation of node C (the node corresponding to the third user C) at the 0th layer, is the weight matrix of the 1st layer, is the bias of the 1st layer, is the activation function. In the second layer of graph convolution, continue to aggregate the updated features. Finally, the high-dimensional feature of the first user A can be:
[0103]
[0104] where, is the feature representation of node A at the 2nd layer, is a node u (which can be the node corresponding to the second customer B or the node corresponding to the third customer C), the feature representation at the first layer is the weight matrix of the second layer is the bias of the second layer is the activation function is the normalization coefficient of the edge between node A and node u All high-dimensional features of user nodes can be obtained with reference to the above steps. Through multi-layer graph convolution, the information of nodes and edges in the graph is effectively utilized, more global dependency information, local information, and high-dimensional features are extracted, which can more accurately reflect the characteristics of users' electricity consumption behavior, are more likely to discover detailed features, facilitate subsequent refined classification, and provide a powerful feature representation for classification.
[0105] In step S40, please refer to Figure 1 step S40 in, and obtain historical time series electricity consumption data based on the historical electricity consumption data of charging piles or the electricity consumption graph
[0106] In one example, methods such as depth-first search (DFS), breadth-first search (BFS), degree-based sorting, eigenvector centrality sorting, Node2Vec, DeepWalk, etc. can be used to convert the standardized electricity consumption graph into historical time series electricity consumption data
[0107] In one example, historical event sequence electricity consumption data can also be directly obtained based on the historical electricity consumption data of charging piles
[0108] In step S50, please refer to Figure 1 step S50 in, combine the high-dimensional features with the historical time series electricity consumption data to form a first input sequence, and train and optimize a bidirectional long short-term memory network based on the first input sequence
[0109] As an example, please refer to Figure 2 , step S50 may include the following steps: S501~S506
[0110] S501: Combine the high-dimensional features with the historical time series electricity consumption data to form a first input sequence
[0111] S502: Set the label data
[0112] S503: Construct an initial bidirectional long short-term memory network
[0113] S504: Use the first input sequence to train the initial bidirectional long short-term memory network, and optimize the trained initial bidirectional long short-term memory network using a loss function
[0114] S505: Evaluate the performance of the initially optimized bidirectional long short-term memory network using an indicator evaluation model.
[0115] S506: Adjust the network parameters according to the evaluation results to obtain a bidirectional long short-term memory network.
[0116] As an example, in step S501, assume that the high-dimensional features output by the GNN model are , and the historical time series electricity consumption data can be , where represents the electricity consumption at time . Concatenate the high-dimensional features output by the GNN model with the historical time series electricity consumption data to form the first input sequence .
[0117] As an example, in step S502, the label data can be the markings of abnormal electricity consumption of the user's charging pile, which can include: abnormal electricity consumption, changes in electricity consumption patterns, etc. The label data can correspond to the subsequent types of abnormal electricity consumption behaviors of the user's charging pile, and the label data can be expressed as .
[0118] As an example, in step S503, construct a basic bidirectional long short-term memory network. The input layer of the bidirectional long short-term memory network can receive the concatenated first input sequence, and the output layer maps the features to the label space of anomaly detection through a fully connected layer. The activation function of the output layer can be set to softmax, and the probability distribution of each category is output.
[0119] As an example, regularization techniques (such as Dropout) can be used to prevent overfitting and improve the generalization ability of the bidirectional long short-term memory network.
[0120] As an example, a Dropout layer can be added after each layer of the basic bidirectional long short-term memory network. By setting an appropriate dropout rate (such as 0.5), randomly discard the outputs of some neurons.
[0121] As an example, before step S504, it can also include the step of constructing a dataset. Constructing the dataset can include: dividing the first input sequence into a training set, a test set, and a validation set. The proportions of the training set, the test set, and the validation set in the constructed data can be set according to actual needs.
[0122] As an example, in step S504, the first input sequence , the marked training set is used to train the bidirectional long short-term memory network, and the network parameters are optimized to improve the accuracy of anomaly recognition. The structure of the bidirectional long short-term memory network allows the network to consider both past and future electricity consumption patterns simultaneously, thus capturing the temporal dependencies in time series data more comprehensively.
[0123] As an example, during the training process, the cross-entropy loss function can be used to evaluate the performance of the initial bidirectional long short-term memory network for optimizing the initial bidirectional long short-term memory network. The formula of the loss function is as follows:
[0124]
[0125] where, is the number of samples, is the number of classes, is the true label, is the probability predicted by the initial bidirectional long short-term memory network.
[0126] As an example, the Adam optimizer can be used for parameter update to accelerate convergence and improve the stability of the model.
[0127] As an example, in step S505, the initial bidirectional long short-term memory network is evaluated on the test set using a metric evaluation model. According to the evaluation results, the network parameters are adjusted or retrained to improve the performance.
[0128] As an example, the metric evaluation model can use accuracy, recall, F1-score, etc. The specific formulas are as follows:
[0129]
[0130]
[0131]
[0132] where, is the true positive, is the true negative, is the false positive, is the false negative, is the harmonic mean of accuracy and recall. Accuracy refers to the proportion of samples that truly belong to the core category among the samples predicted by the network as the core category; recall refers to the proportion of samples that actually belong to the core category and are correctly predicted by the network as the core category.
[0133] As an example, in step S506, according to the evaluation results, adjust the network parameters or retrain to improve the performance of the network. You can also select the best combination of hyperparameters through cross-validation, and finally obtain the optimal bidirectional long short-term memory network.
[0134] As an example, the early stopping method can be used to monitor the network performance on the validation set and stop training when the performance no longer improves to avoid overfitting.
[0135] In a specific example, assume that the high-dimensional features output by the GNN model of user A are , and the historical time series power consumption data of user A's charging pile is . Combine the high-dimensional features output by the GNN model of user A with the historical time series power consumption data to obtain the first input sequence . The label data can be set as , where 0 represents normal and 1 represents abnormal. Input into the basic bidirectional long short-term memory network for training, and use the cross-entropy loss function for optimization. During the training process, monitor the performance of the bidirectional long short-term memory network on the validation set, calculate the accuracy, recall rate, and F1-score to evaluate the effect of the network, and finally obtain the trained bidirectional long short-term memory network.
[0136] Through the above steps, the high-dimensional features extracted by the GNN model are successfully combined with the historical time series power consumption data, and the bidirectional long short-term memory network is trained and optimized, providing strong support for subsequent anomaly detection.
[0137] In step S60, refer to the S60 step in Figure 1 to obtain the real-time power consumption data of the user's charging pile.
[0138] As an example, the real-time power consumption data of the user's charging pile can be expressed as , where represents the latest power consumption at time . The specific method for obtaining the real-time power consumption data of the user's charging pile can refer to the specific method for obtaining the historical charging and discharging data of the user's charging pile in step S10, which will not be repeated here.
[0139] In step S70, refer to the S70 step in Figure 1 to obtain the second input sequence based on the real-time power consumption data of the charging pile.
[0140] As an example, combine the real-time power consumption data of the charging pile with the high-dimensional features output by the previous GNN model to obtain the second input sequence. Assume that the high-dimensional features output by the GNN model are , then the new second input sequence It can be expressed as:
[0141]
[0142] Wherein, is the real-time power consumption data of the charging pile.
[0143] In step S80, please refer to Figure 1 step S80 in
[0144] As an example, input the constructed new second input sequence into the trained bidirectional long short-term memory network to perform anomaly detection on the user's charging pile power consumption behavior, so as to obtain the type of abnormal charging pile power consumption behavior of the user. .
[0145] As an example, compare the probability distribution value with a preset threshold to obtain the type of abnormal charging pile power consumption behavior of the user; that is, after obtaining , the type of anomaly can be analyzed, the classification criteria for abnormal behaviors are preset, and by comparing with the preset threshold, abnormal behaviors can be automatically classified. Abnormal behaviors can include: no problem with the charging pile, multi-vehicle charging problem, conversion of the charging pile to domestic electricity, conversion of the charging pile to commercial electricity, and suspected electricity theft of the charging pile.
[0146] As an example, the specific method for comparing the probability distribution value with a preset threshold to obtain the type of abnormal charging pile power consumption behavior of the user is: when , it indicates that there is no problem with the charging pile. At this time, the power consumption is normal or the anomaly can be ignored, which belongs to the normal range; when , it indicates that there is a multi-vehicle charging problem. At this time, the power consumption exceeds the normal range, but the exceeded range conforms to the charging rules or characteristics of the vehicle. For example, from the rationality of data analysis, it can be considered that at this time, the power consumption pattern shows a multiple change or accumulation compared with the single-vehicle charging power consumption pattern; when , it indicates that the charging pile has been converted to domestic electricity. At this time, the power consumption exceeds the normal range, and the exceeded range does not conform to the charging rules or characteristics of the vehicle, and the power consumption time conforms to the rules or characteristics of domestic electricity. For example, the increase in power consumption appears at night or on weekends; when , it indicates that the charging pile has been converted to commercial electricity. At this time, the power consumption exceeds the normal range, and the exceeded range does not conform to the charging rules or characteristics of the vehicle, and the power consumption time conforms to the rules or characteristics of commercial electricity. For example, the increase in power consumption appears during the day; when , it indicates that the charging pile is suspected of electricity theft. At this time, the power consumption exceeds the normal range, and the exceeded range does not conform to the charging rules or characteristics of the vehicle, and the power consumption time has no obvious rules or characteristics.
[0147] As an example, after obtaining the abnormal behavior types of the user's charging pile electricity consumption through the above method, on-site verification can also be combined to further verify the abnormal behavior types of the charging pile electricity consumption, so as to ensure the accuracy of the judgment. For example, for charging piles converted to domestic electricity, on-site verification can find that such users privately supply the charging pile to their own residential electricity; for charging piles converted to commercial electricity, on-site verification can find that such users privately connect the post-meter line of the charging pile meter to the shop for electricity consumption; for suspected electricity theft types of charging piles, on-site verification can find that the post-meter outgoing line goes underground and its direction is unknown or the meter is privately used by the property; if there is no problem with the charging pile and on-site inspection finds no abnormal electricity consumption behavior, the electricity consumption behavior of such users' charging piles can be divided into two situations: one household installs multiple charging piles, and one charging pile is used for multiple vehicles to charge. Among them, although the situation of one household installing multiple charging piles does not belong to abnormal electricity consumption behavior, it can be used to investigate suspected group rentals. Although the situation of one charging pile being used for multiple vehicles to charge does not belong to abnormal electricity consumption behavior, it can be used to investigate suspected group rentals.
[0148] As an example, once an abnormal behavior is detected, warning information can also be automatically generated to notify relevant personnel for further investigation. The warning information should include: user ID, detected abnormal type of charging pile electricity consumption, time of abnormality occurrence, comparison between abnormal electricity consumption and normal electricity consumption. For example, if the electricity consumption of user A's charging pile suddenly increases to the level of daily domestic electricity consumption on a certain weekend and the charging time is extended, the following warning information will be generated:
[0149] User ID: A;
[0150] Abnormal type: Charging pile converted to domestic electricity;
[0151] Abnormal time: October 15, 2023;
[0152] Abnormal electricity consumption: 50 kWh;
[0153] Normal electricity consumption: 20 kWh.
[0154] In another specific example, assume that the high-dimensional features output by the GNN model of user A are , and the real-time electricity consumption data of the charging pile collected in real time is . Combine the high-dimensional features with the real-time electricity consumption data of the charging pile to form a new second input sequence . Input into the trained bidirectional long short-term memory network for anomaly detection. Assume that the probability output by the trained bidirectional long short-term memory network is (0 indicates normal and 1 indicates abnormal). According to the preset threshold of 0.5 for division, it is determined that there is an abnormal behavior of the charging pile of user A at this time, and it is identified as "changing to domestic electricity use from the charging pile", and a warning message is generated to notify relevant personnel to conduct an investigation. Thus, the real-time monitoring and abnormal detection of users' electricity consumption behaviors are realized, and potential electricity consumption abnormalities can be discovered and processed in a timely manner.
[0155] It should be understood that although the steps in the flowchart of the accompanying drawings are shown sequentially according to the indication of the arrows, these steps do not necessarily need to be executed sequentially according to the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages do not necessarily need to be executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages does not necessarily need to be sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0156] In the method for identifying abnormal electricity consumption behaviors of charging piles based on GNN in this application, by obtaining the historical electricity consumption data and user information of users, an electricity consumption graph structure with users as nodes and based on the similarity of electricity consumption data as edges is constructed and preprocessed, laying a foundation for subsequent analysis; high-dimensional features are extracted from the preprocessed graph through the GNN model, and its multi-layer graph convolution operation can effectively capture the complex relationships and electricity consumption pattern features among users, enriching the global features; then the high-dimensional features are combined with the historical time series electricity consumption data and input into a bidirectional long short-term memory network for training and optimization to obtain an accurate bidirectional long short-term memory network; the real-time electricity consumption data of the charging pile is obtained as the data to be detected and input into the network, and the probability distribution is output to determine whether the electricity consumption behavior of the charging pile is abnormal; finally, the abnormal type is further analyzed, automatically classified, and a warning message is generated. The method of this application can accurately identify the abnormal electricity consumption behaviors of charging piles, effectively distinguish normal and abnormal electricity consumption behaviors, avoid waste of electric power resources, improve the level of electric power management, discover and handle potential safety hazards in a timely manner, ensure the stable operation of the power system, and meet the requirements of the power management department for the efficient monitoring and accurate management of the electricity consumption behaviors of charging piles.
[0157] In another embodiment, please refer to Figure 3The present application also provides a charging pile power consumption abnormal behavior identification system based on GNN, which may include: a data collection module 10, a preprocessing module 20, a high-dimensional feature acquisition module 30, a training module 40 and an abnormality identification module 50. Among them, the data collection module 10 is used to obtain the user's charging pile historical power consumption data, user information and the user's charging pile real-time power consumption data; the preprocessing module 20 is used to construct a power consumption graph based on the charging pile historical power consumption data and user information; the high-dimensional feature acquisition module 30 is used to extract features from the power consumption graph based on the GNN module to obtain high-dimensional features; the training module 40 is used to obtain historical time series power consumption data based on the charging pile historical power consumption data or the power consumption graph, combine the high-dimensional features with the historical time series power consumption data to form a first input sequence, and train and optimize the bidirectional long short-term memory network based on the first input sequence; the abnormality identification module 50 is used to obtain a second input sequence based on the charging pile real-time power consumption data; the second input sequence is input into the trained and optimized bidirectional long short-term memory network to perform abnormal detection on the user's charging pile power consumption behavior to obtain the user's charging pile power consumption abnormal behavior type.
[0158] In the above-mentioned GNN-based charging pile power consumption abnormal behavior identification system, the user's charging pile historical power consumption data, user information and the user's charging pile real-time power consumption data are obtained through the data collection module 10; the power consumption graph is constructed and the graph data is processed through the preprocessing module 20, and the original power consumption data is converted into a graph format suitable for model processing; the high-dimensional feature acquisition module 30 obtains high-dimensional features and mines the potential patterns of the user's charging pile power consumption behavior; the training module 40 trains and optimizes the bidirectional long short-term memory network; the abnormal identification module 50 uses the bidirectional long short-term memory network to perform abnormal detection and obtain the type of abnormal power consumption behavior. The system of the present application realizes comprehensive and accurate identification of abnormal charging pile power consumption behavior, improves the accuracy of abnormal identification, effectively improves the level of power management, reduces resource waste and safety hazards, and ensures the stable operation of the power system.
[0159] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0160] Although the present application has been disclosed as above with the embodiments, it is not intended to limit the present application. Any person with ordinary knowledge in the technical field can make some changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be determined by the scope of the attached patent application.
Claims
1. A method for identifying abnormal charging behavior of charging piles based on GNN, characterized in that, Including the following steps: Obtain the historical charging data of the charging piles of the user and the user information; the historical charging data of the charging piles includes the historical charging data of the charging piles of multiple users, and the obtained user information includes multiple pieces of user information corresponding to the charging piles; the user information includes: user ID, the number of other charging means of transportation of the user, the type of other charging means of transportation of the user, and the real estate information of the user; Construct a power consumption graph based on the historical charging data of the charging piles and the user information, including: taking each user as a node; obtaining the similarity between adjacent users; establishing edges between adjacent users with a similarity greater than a preset threshold to obtain an initial power consumption graph; performing standardization processing on the features of each node in the initial power consumption graph, and performing sparsification processing on the edges to obtain the power consumption graph; Use the trained GNN model to extract features from the power consumption graph to obtain high-dimensional features; Obtain the historical time series power consumption data based on the power consumption graph; Combine the high-dimensional features with the historical time series power consumption data to form a first input sequence, and train and optimize a bidirectional long short-term memory network based on the first input sequence; Obtain the real-time charging data of the charging piles of the user; Obtain a second input sequence based on the real-time charging data of the charging piles; Input the second input sequence into the trained and optimized bidirectional long short-term memory network to perform anomaly detection on the charging behavior of the user's charging piles, so as to obtain the type of abnormal charging behavior of the user's charging piles, and the type of abnormal charging behavior of the user's charging piles includes: no problem with the charging pile, multiple vehicles charging, the charging pile is changed to domestic electricity, the charging pile is changed to commercial electricity, and the charging pile is suspected of stealing electricity.
2. The method for identifying abnormal power consumption behavior of charging piles based on GNN according to claim 1, characterized in that, The formula for obtaining the similarity between adjacent users is as follows: Among them, is the electricity consumption of the charging pile of the first user at time t, is the electricity consumption of the charging pile of the second user adjacent to the first user at time t, and n is the total number of time periods.
3. The method for identifying abnormal power consumption behavior of charging piles based on GNN according to claim 1, wherein The use of the trained GNN model to extract features from the power consumption graph to obtain high-dimensional features includes: Provide a trained GNN model; Based on the power consumption graph, obtain the features of each node; input the features of the nodes into the trained GNN model for feature aggregation to obtain the high-dimensional features of all nodes.
4. The method for identifying abnormal electricity consumption behavior of charging piles based on GNN according to claim 1, characterized in that The combination of the high-dimensional features with the historical time series power consumption data to form a first input sequence, and the training and optimization of the bidirectional long short-term memory network based on the first input sequence includes: Combine the high-dimensional features with the historical time series power consumption data to form the first input sequence; Set label data; Construct an initial bidirectional long short-term memory network; Use the first input sequence to train the initial bidirectional long short-term memory network, and use a loss function to optimize the trained initial bidirectional long short-term memory network; Use an index evaluation model to evaluate the performance of the trained and optimized initial bidirectional long short-term memory network; Adjust the network parameters according to the evaluation results to obtain a bidirectional long short-term memory network.
5. The method for identifying abnormal electricity consumption behavior of charging piles based on GNN according to claim 4, wherein Before using the first input sequence to train the initial bidirectional long short-term memory network, it also includes constructing a data set, and the construction of the data set includes: dividing the first input sequence into a training set, a test set, and a validation set.
6. The method for identifying abnormal power consumption behaviors of charging piles based on GNN according to claim 4, wherein The construction of the initial bidirectional long short-term memory network includes: adding a Dropout layer after each layer of the basic bidirectional long short-term memory network.
7. The method for identifying abnormal electricity consumption behavior of charging piles based on GNN according to claim 1, wherein The step of inputting the second input sequence into the trained and optimized bidirectional long short-term memory network to perform anomaly detection on the user's charging pile power consumption behavior to obtain the type of abnormal charging pile power consumption behavior of the user includes: Inputting the second input sequence into the trained and optimized bidirectional long short-term memory network for anomaly detection to obtain a probability distribution value; Comparing the probability distribution value with a preset threshold to obtain the type of abnormal charging pile power consumption behavior of the user.
8. An abnormal electricity consumption behavior recognition system for charging piles based on GNN, characterized in that, For implementing the GNN-based charging pile power consumption abnormal behavior recognition method according to any one of claims 1 to 7; the GNN-based charging pile power consumption abnormal behavior recognition system includes: A data collection module for obtaining the historical charging data of the user's charging pile, user information, and the real-time charging data of the user's charging pile; A preprocessing module for constructing a power consumption graph based on the historical charging data of the charging pile and the user information; A high-dimensional feature acquisition module for extracting features from the power consumption graph based on the GNN module to obtain high-dimensional features; A training module for obtaining historical time series power consumption data based on the historical charging data of the charging pile or the power consumption graph, combining the high-dimensional features with the historical time series power consumption data to form a first input sequence, and training and optimizing a bidirectional long short-term memory network based on the first input sequence; An anomaly recognition module for obtaining a second input sequence based on the real-time charging data of the charging pile; inputting the second input sequence into the trained and optimized bidirectional long short-term memory network to perform anomaly detection on the user's charging pile power consumption behavior to obtain the type of abnormal charging pile power consumption behavior of the user.
Citation Information
Patent Citations
Charging pile fault diagnosis method, device, equipment and medium
CN116578873A
User abnormal electricity consumption identification method and system based on spatio-temporal joint modeling
CN119377836A