Green power data anomaly detection method and system based on deep learning
Through deep learning-based methods, the problem of outlier detection in green electricity data is solved, the accurate identification and processing of green electricity data is achieved, and the stability of the energy system and energy utilization efficiency are improved.
Patent Information
- Application Number
- CN202411683974.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
The existing technology is difficult to effectively detect and process outliers in green electricity data, resulting in unstable operation of energy systems, delayed equipment maintenance and misleading energy policy formulation.
Using deep learning-based methods, outliers in green electricity data are identified and processed by acquiring green electricity data, preprocessing data, building deep learning models, feature extraction and dimensionality reduction, and using long and short-term memory networks to predict.
It realizes the accurate identification and processing of outliers in green electricity data, ensures the stability and reliability of the energy system, optimizes the scheduling and equipment maintenance of the energy system, and avoids energy waste and inefficient operation caused by data errors.
Smart Images

Figure CN119622572A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data processing, and in particular, relates to a green electricity data anomaly detection method and system based on deep learning. Background Art
[0002] With the increasing attention paid to environmental protection and sustainable development around the world, the development and utilization of green energy (green electricity) has developed rapidly. Green electricity mainly includes renewable energy power generation forms such as solar energy, wind energy, hydropower, and biomass energy. Its share in the energy field is increasing, which is of vital importance to promoting energy transformation, reducing carbon emissions, and achieving sustainable development goals.
[0003] However, green power systems face many challenges during operation, among which the accuracy and reliability of green power data is one of the key issues. Green power data comes from a variety of complex power generation equipment, monitoring sensors, and energy management systems. Different types of power generation equipment (such as solar photovoltaic panels, wind turbines, etc.) and monitoring systems generate different data formats, data types, and sampling frequencies. For example, solar power generation data may include multiple parameters such as light intensity, panel temperature, and power generation, while wind power generation data involves wind speed, wind direction, wind turbine speed, power generation, etc. These multi-source heterogeneous data need to be effectively integrated and processed before they can be used for subsequent analysis and decision-making.
[0004] Abnormal data may lead to misoperation of energy systems. For example, incorrect power generation forecasts may lead to imbalances in power supply and demand, affecting the stability and reliability of the power grid. In smart grids, abnormal data may interfere with trading decisions in the power market and affect the rational allocation and utilization efficiency of energy. Abnormal data may also cover up potential failures and performance problems of equipment, delay equipment maintenance and repair, and increase equipment failure rates and repair costs. For example, inaccurate temperature data may not be able to detect overheating problems of solar panels in a timely manner, thus affecting the life of the panels and power generation efficiency.
[0005] Traditional methods for detecting anomalies in green electricity data mainly include statistical methods and machine learning methods. For example, statistical indicators such as mean and standard deviation are used to detect outliers. This method has a certain effect on simple data distribution and obvious anomalies, but its detection ability is limited for complex data patterns and data with strong multivariate correlation. Moreover, statistical methods usually require the assumption that the data obeys a specific distribution, and green electricity data often does not meet these assumptions, resulting in inaccurate detection results. Methods such as decision trees and support vector machines can handle nonlinear data relationships to a certain extent, but for large-scale, high-dimensional green electricity data, they may face problems such as high model complexity, long training time, and overfitting. In addition, traditional machine learning methods are not capable of handling long-term dependencies in time series data, and it is difficult to fully mine the temporal feature information in green electricity data. Summary of the invention
[0006] In order to solve the deficiencies in the prior art, the present invention provides a green electricity data anomaly detection method and system based on deep learning.
[0007] The present invention adopts the following technical solution.
[0008] The present invention provides a green electricity data anomaly detection method based on deep learning, which is characterized by comprising:
[0009] Obtain green electricity data;
[0010] Perform data preprocessing on the acquired green electricity data;
[0011] Build a green electricity data anomaly detection model based on deep learning;
[0012] Use the green electricity data anomaly detection model to extract features and reduce the dimension of green electricity data;
[0013] The reduced-dimensional features are predicted based on the long short-term memory network to obtain the prediction results.
[0014] Preferably, the obtaining of green electricity data includes collecting voltage, current, power, power generation and timestamp information based on smart meters and power generation equipment sensors.
[0015] Preferably, the data preprocessing of the acquired green electricity data includes data cleaning and data normalization of the acquired green electricity data, and dividing the preprocessed green electricity data into a training set, a validation set and a test set by data segmentation.
[0016] Preferably, the construction of a green electricity data anomaly detection model based on deep learning includes constructing a green electricity data anomaly detection model based on a combination of a deep neural network and a convolutional neural network, wherein a 3X3 convolution kernel is used in the convolution layer, an activation function ReLu is added after each convolution kernel, and a pooling layer is added after the convolution layer; the output of the pooling layer is flattened into a one-dimensional vector through a fully connected layer and then input into a hidden layer of the deep neural network, and output is performed through a binary classification layer as an output layer.
[0017] Preferably, the green electricity data anomaly detection model is used to perform feature extraction and feature dimensionality reduction on the green electricity data, including extracting local features of the green electricity data through convolution operations, and introducing nonlinearity using the ReLu activation function; the extracted features are weighted summed and outputted through a fully connected layer to obtain a high-dimensional feature representation of the green electricity data.
[0018] Preferably, the use of the green electricity data anomaly detection model to extract features and reduce the dimension of green electricity data also includes performing eigenvalue decomposition on the high-dimensional feature representation through the covariance matrix to obtain the eigenvalues and corresponding eigenvectors of the green electricity data, and selecting the projection matrix through principal component analysis, and then optimizing the low-dimensional space by calculating the probability distribution in the high-dimensional space to achieve feature dimension reduction.
[0019] Preferably, the LSTM network is used to predict the reduced-dimensional features to obtain prediction results, including enhancing the expression ability of the LSTM network by stacking multiple LSTM layers, taking the last LSTM layer as the output and connecting it to the fully connected layer for predicting the features of the green electricity data, and outputting the probability distribution through the softmax layer.
[0020] The present invention also provides a green electricity data anomaly detection system based on deep learning, the system is a system used by the aforementioned green electricity data anomaly detection method based on deep learning, comprising:
[0021] The data acquisition module is configured to acquire green electricity data;
[0022] The preprocessing module is configured to perform data preprocessing on the acquired green power data;
[0023] The model building module is configured to build a green electricity data anomaly detection model based on deep learning;
[0024] The feature extraction module is configured to perform feature extraction and feature dimension reduction on the green electricity data using the green electricity data anomaly detection model;
[0025] The prediction module is configured to predict the reduced-dimensional features based on the long short-term memory network to obtain a prediction result.
[0026] The present invention also provides a computer-readable storage medium storing a plurality of instructions, characterized in that the instructions are suitable for being loaded and executed by a processor of a terminal device for the aforementioned green electricity data anomaly detection method based on deep learning.
[0027] The present invention also provides a terminal device, including a processor and a computer-readable storage medium, the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, characterized in that the instructions are suitable for being loaded by the processor and executing the aforementioned green electricity data anomaly detection method based on deep learning.
[0028] The beneficial effect of the present invention is that, compared with the prior art, the present invention can accurately identify abnormal values in green power data through the feature extraction and prediction capabilities of the deep learning model, avoiding misleading energy system operation, equipment maintenance and energy policy formulation due to abnormal data. In the smart grid, timely detection and processing of abnormal power generation data can ensure the balance of power supply and demand and improve the stability and reliability of the power grid.
[0029] Accurate green power data helps to optimize the scheduling of energy systems. By timely detecting and processing abnormal data, energy waste and inefficient operation caused by data errors can be avoided. For example, according to accurate power generation data and load demand, the output power of power generation equipment can be reasonably adjusted to improve energy utilization efficiency.
[0030] By monitoring and analyzing green power data, the operating parameters of the equipment can be optimized and the wear and tear of the equipment can be reduced. For example, the working angle and output power of the solar panel can be adjusted according to the temperature, power and other data to extend the life of the panel. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a schematic diagram of a green electricity data anomaly detection method based on deep learning according to Example 1 of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in this application are only part of the embodiments of the present invention, not all of them. Based on the spirit of the present invention, other embodiments obtained by ordinary technicians in this field without creative work are all within the scope of protection of the present invention.
[0033] Example 1
[0034] like Figure 1 As shown, this embodiment provides a green power data anomaly detection method based on deep learning, including:
[0035] Obtain green electricity data;
[0036] Perform data preprocessing on the acquired green electricity data;
[0037] Build a green electricity data anomaly detection model based on deep learning;
[0038] Use the green electricity data anomaly detection model to extract features and reduce the dimension of green electricity data;
[0039] The reduced-dimensional features are predicted based on the long short-term memory network to obtain the prediction results.
[0040] Specifically, the following steps are included:
[0041] S1. Obtain green electricity data
[0042] Among them, green electricity data is collected from various data sources, which may include smart meters, power generation equipment sensors, energy management systems, etc. The collected data may include information such as voltage, current, power, power generation, timestamp, etc.
[0043] S2. Preprocess the acquired green electricity data
[0044] S2.1. Data cleaning:
[0045] Remove duplicate data to ensure data uniqueness.
[0046] To handle missing values, you can use mean filling, median filling, or interpolation methods to fill in missing data points.
[0047] Identify and remove outliers. Statistical methods (such as the 3σ principle) or machine learning-based methods (such as isolation forests) can be used to detect outliers and process them.
[0048] S2.2, Data normalization:
[0049] Normalize the data so that data with different features have the same scale. Common normalization methods include minimum-maximum normalization and Z-score normalization. For example, minimum-maximum normalization can map data to the [0,1] interval, and the formula is: Where x is the original data, x min and x max are the minimum and maximum values in the data respectively.
[0050] S2.3, Data segmentation:
[0051] The preprocessed dataset is divided into training set, validation set and test set. 70% of the dataset is divided into training set, 20% of the dataset is divided into validation set, and 10% of the dataset is divided into test set.
[0052] S3. Build a green electricity data anomaly detection model based on deep learning
[0053] S3.1. Select a deep learning framework: Select a deep learning framework, such as TensorFlow, PyTorch, etc.
[0054] S3.2. Determine the model structure:
[0055] A hybrid model is constructed by combining deep neural network (DNN) and convolutional neural network (CNN).
[0056] S3.3. Define model parameters:
[0057] Determine the number of layers in the network, the number of neurons in each layer, the activation function, the optimizer, and the loss function parameters. Select ReLU as the activation function, Adam as the optimizer, and mean square error (MSE) as the loss function.
[0058] Among them, the structure of the convolutional neural network is designed. Multiple convolutional layers are selected, and each convolutional layer contains a certain number of convolutional kernels. The size and number of convolutional kernels can be adjusted according to the characteristics of the data and experimental results. Use 3x3 or 5x5 convolutional kernels, and the number of convolutional kernels ranges from dozens to hundreds. Each convolutional layer can be followed by an activation function, such as ReLU, to increase the nonlinear expression ability of the model.
[0059] After the convolutional layer, add a pooling layer to reduce the dimension of the data and the amount of computation. Common pooling methods include maximum pooling and average pooling. Select a 2x2 pooling window and perform a maximum pooling operation to retain the maximum eigenvalue of the local area.
[0060] The fully connected layer is used to connect the convolutional neural network part and the deep neural network part. The outputs of the convolutional layer and the pooling layer are flattened into a one-dimensional vector and then input into the fully connected layer. The fully connected layer consists of multiple hidden layers, each of which contains a certain number of neurons. The number of neurons is adjusted according to the complexity of the data and the performance requirements of the model. Among them, green electricity data contains information such as voltage, current, power, power generation, timestamp, etc. These data have certain local characteristic patterns in the time series, such as the fluctuation pattern of power, the change range of voltage, etc. From the perspective of spatial dimension (if the combination of multiple devices or sensor data can be regarded as a spatial dimension) and feature dimension, the data is relatively complex but also has certain regularity. In a series of experiments on anomaly detection of green electricity data, researchers tested green electricity data sets of different sizes (data set sizes ranged from 1000-10000 data samples, covering different power generation scenarios and equipment types). When the number of convolution kernels is set to 32, the model can capture some basic power and voltage change characteristics, but the detection accuracy for complex multi-device joint abnormal situations (such as power fluctuation abnormalities of multiple power generation equipment at the same time) is only about 70%. As the number of convolution kernels increases to 64, the model's detection accuracy for these complex situations increases to about 80%, and it can better extract joint features. When the number of convolution kernels reaches 256, although the accuracy on the training set increases to 90%, overfitting occurs on the test set, and the accuracy drops to about 75%.
[0061] Regarding the number of neurons, green power data is a multivariate time series data, and its complexity lies in the mutual correlation between variables (such as the relationship between power and current), and the change rules are different at different time scales. In the above experiment, when the number of neurons is 32, the detection effect of simple anomalies in green power data (such as outliers of a single variable) is acceptable, with an accuracy of about 75%, but the accuracy of complex associated anomalies (such as considering the simultaneous anomalies of power and current in the time series) is low, about 60%. When the number of neurons increases to 128, the detection accuracy of complex associated anomalies is increased to about 78%, which can better learn the association relationship in the data. When the number of neurons reaches 512, the model overfits during the training process, and the accuracy of complex associated anomalies detection on the test set drops to about 65%.
[0062] After the fully connected layer, continue to add the hidden layer of the deep neural network, which consists of neurons and activation functions. Choose different activation functions as needed, such as ReLU, Sigmoid or Tanh.
[0063] Finally, design the output layer of the model. For the problem of anomaly detection of green electricity data, the output layer is usually a binary classification layer to determine whether the data is abnormal.
[0064] The Sigmoid activation function is used to map the output value to the [0,1] interval, indicating the probability of data anomaly. If the output value is greater than the set threshold, the data is considered abnormal; otherwise, the data is considered normal. Specifically, in an experimental data set containing 1,000 green electricity data (of which 20% are abnormal data), by drawing the ROC curve and PR curve, it is found that when the threshold is 0.45, the precision rate can reach about 60% while ensuring a high recall rate (about 80%), which is suitable for anomaly detection of this data set.
[0065] S4. Use the green electricity data anomaly detection model to extract features and reduce the dimension of green electricity data.
[0066] The pre-processed green electricity data is input into the constructed deep learning model, and the hidden layer of the model automatically learns the feature representation of the data. These features can be high-dimensional and abstract, and can better reflect the essential characteristics of the data.
[0067] Among them, feature extraction
[0068] (1) Input data: The preprocessed green electricity data is input into the constructed model combining deep neural network (DNN) and convolutional neural network (CNN).
[0069] (2) Feature extraction of CNN: Convolution layer operation: When the data passes through the convolution layer, the convolution kernel performs convolution operation with the input data to extract local features. Assume that the input data is a three-dimensional tensor X with a shape of (batch s ize,height,width,channels), where batch_size is the batch size, height and width are the spatial dimensions of the data, and channels is the number of channels. The convolution kernel is a four-dimensional tensor W with a shape of (filters,kernel_height,kernel_width,input c hannels), where filters is the number of convolution kernels, kernel_height and kernel_width are the spatial dimensions of the convolution kernel, and input c hannels is the number of channels of the input data. When the data passes through the convolution layer, the convolution kernel performs convolution operation with the input data to extract local features. This process can be regarded as applying the weights of the convolution kernel to different local areas of the input data to obtain the feature representation of these local areas. For example, for an image data (which can be analogous to the spatial distribution of certain data in the green power data scenario), the convolution kernel will slide in different small areas of the image and calculate the convolution result, which can reflect the feature combination of the data in the small area.
[0070] Application of activation function: Apply the ReLU activation function to the result after convolution to introduce nonlinearity. Z = max(0, Y), where Z is the output after activation. The role of the ReLU function is to introduce nonlinearity. In deep learning models, the expressive power of linear models is limited, and nonlinear activation functions allow the model to learn more complex functional relationships. For the result after convolution, the ReLU activation function is used to set values less than , and values greater than remain unchanged. This can increase the nonlinear expressive power of the model and enable the model to better fit the complex features in the green power data, such as the nonlinear fluctuation of power, the nonlinear relationship between voltage and current, etc. After these two steps, the CNN part extracts representations with a certain degree of abstraction and local features from the green power data. These features will be further processed by the subsequent DNN part for the final anomaly detection task.
[0071] Feature extraction of DNN part:
[0072] The features extracted by CNN are flattened into a one-dimensional vector and then input into the fully connected layer of DNN. Each neuron in the fully connected layer performs a weighted summation with all elements of the input vector and obtains the output through the activation function. Assuming the input vector is x, the weight matrix of the fully connected layer is W, the bias vector is b, and the activation function is f, the output is y=f(Wx+b).
[0073] Feature Dimensionality Reduction
[0074] Principal component analysis (PCA) algorithm steps:
[0075] Calculate the covariance matrix: Assume that the feature matrix obtained after feature extraction is X, and its shape is (n s _samples,n_features,n_features), where (n_samples,n_features) is the number of samples, n f eatures is the number of features. First calculate the covariance matrix of the feature matrix
[0076] Calculate eigenvalues and eigenvectors: Perform eigenvalue decomposition on the covariance matrix C to obtain the eigenvalue λ i and the corresponding eigenvector v i. Among them, in practical applications, for a large-scale covariance matrix, when the number of features is large, solving the eigenvalues and eigenvectors through the characteristic equation may be very computationally intensive and unstable. At this time, numerical calculation methods are used. One of the commonly used methods is the QR decomposition method. The basic steps are as follows: First, perform QR decomposition on the covariance matrix C to obtain C = QR, where Q is an orthogonal matrix and R is an upper triangular matrix. Then, let C1 = RQ, it can be proved that C1 is similar to C, that is, they have the same eigenvalues. Repeat the above QR decomposition and construction of a new matrix, that is, perform QR decomposition on C1 to obtain C1 = Q1R1, and then let C2 = R1Q1, and so on. As this process is repeated, the matrix will gradually approach an upper triangular matrix, and the elements on its diagonal are the eigenvalues of the covariance matrix C. Once the eigenvalues are obtained, substitute the eigenvalues into the equation (C-λ i I)v i = 0 and solve the corresponding homogeneous linear equations (such as using Gaussian elimination method, etc.) to obtain the corresponding eigenvector v i .
[0077] Select principal components: Arrange the eigenvectors in descending order of eigenvalues, and select the first k eigenvectors to form the projection matrix P, where k is the feature dimension after dimensionality reduction, which is usually determined based on the retained variance ratio.
[0078] Projection data: Multiply the feature matrix by the projection matrix to obtain the reduced feature matrix.
[0079] Initialize low-dimensional space: Randomly initialize the data points yi in the low-dimensional space.
[0080] Calculate the probability distribution in low-dimensional space: In the low-dimensional space, calculate the distance between data points and calculate the probability distribution qij in the low-dimensional space based on the distance.
[0081] Optimize low-dimensional space: Optimize the position of data points in low-dimensional space by minimizing the difference between the probability distribution in high-dimensional space and low-dimensional space. Use gradient descent to update the position of data points in low-dimensional space so that the probability distribution in low-dimensional space is as close as possible to the probability distribution in high-dimensional space.
[0082] Repeat the optimization process: The optimization process is repeated until the convergence condition or the maximum number of iterations is reached.
[0083] S5. Predict the reduced-dimensional features based on the long short-term memory network to obtain the prediction results.
[0084] Use the training set to train the LSTM model. Input the reduced feature sequence into the LSTM model, and the model will predict the data at the next time point based on the input historical data.
[0085] Among them, the LSTM unit consists of an input gate, a forget gate, an output gate, and a cell state. The input gate determines which new information will be stored in the cell state, the forget gate determines which old information will be discarded, and the output gate determines which information will be output.
[0086] Specifically,
[0087] Define LSTM layer: Use deep learning libraries such as TensorFlow or PyTorch to build LSTM models. In TensorFlow, use tf.keras.layers.LSTM to define LSTM layers. To specify the number of units (i.e., the dimension of the hidden state) of the LSTM layer, LSTM(units=64), where 64 means the dimension of the hidden state is 64.
[0088] Add an output layer: After the LSTM layer, add a fully connected layer as the output layer. The number of neurons in the output layer is determined by the dimension of the prediction target. When predicting a univariate time series, the output layer can have only one neuron and use a linear activation function; when predicting multiple variables, the number of neurons in the output layer is equal to the number of variables.
[0089] Model Training
[0090] Data batch input: The feature sequence data after dimension reduction in the training set is input into the LSTM model batch by batch according to the set batch size (batchsize). Each time a batch of feature sequences containing 32 samples (batch size = 32) is input.
[0091] Forward propagation and back propagation: In each training batch, the data is forward propagated through the LSTM layer and the output layer to calculate the predicted value. Then, based on the difference (loss) between the predicted value and the true value, the back propagation algorithm is used to update the model weights. This process is repeated for multiple epochs on the entire training set until the model converges or reaches the preset training rounds.
[0092] Model validation and hyperparameter adjustment: After each training round, use the validation set to evaluate the performance of the model. Adjust the model's hyperparameters based on the loss and evaluation metrics on the validation set.
[0093] Prediction Phase
[0094] Input test data: After the model training is completed, input the dimension-reduced feature sequence data in the test set into the trained LSTM model. Note that the format and preprocessing method of the input data should be consistent with the training data.
[0095] Generate prediction results: The model generates a prediction for the next time point data based on the input feature sequence, through the input gate, forget gate and output gate to process the cell state. For time series prediction, the predicted data for the next time point can usually be stored, and then the new prediction data and the original test data are used as input to predict the next time step, and so on, to obtain the prediction result sequence corresponding to the entire test set.
[0096] Result evaluation: The prediction results are evaluated using the mean square error (MSE) evaluation indicator to measure the prediction accuracy and performance of the model. The mean square error calculation formula is: where y i is the true value, is the predicted value, and n is the number of samples. The optimal prediction model is determined by comparing the evaluation indicators under different models or different parameter settings.
[0097] Example 2
[0098] This embodiment provides a green electricity data anomaly detection system based on deep learning, including:
[0099] The data acquisition module is configured to acquire green electricity data;
[0100] The preprocessing module is configured to perform data preprocessing on the acquired green power data;
[0101] The model building module is configured to build a green electricity data anomaly detection model based on deep learning;
[0102] The feature extraction module is configured to perform feature extraction and feature dimension reduction on the green electricity data using the green electricity data anomaly detection model;
[0103] The prediction module is configured to predict the reduced-dimensional features based on the long short-term memory network to obtain a prediction result.
[0104] A computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, for example, a method for detecting anomalies in green electricity data based on deep learning.
[0105] A terminal device includes a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded and executed by the processor to implement a green electricity data anomaly detection method based on deep learning.
[0106] The beneficial effect of the present invention is that, compared with the prior art, the present invention can accurately identify abnormal values in green power data through the feature extraction and prediction capabilities of the deep learning model, avoiding misleading energy system operation, equipment maintenance and energy policy formulation due to abnormal data. In the smart grid, timely detection and processing of abnormal power generation data can ensure the balance of power supply and demand and improve the stability and reliability of the power grid.
[0107] Accurate green power data helps to optimize the scheduling of energy systems. By timely detecting and processing abnormal data, energy waste and inefficient operation caused by data errors can be avoided. For example, according to accurate power generation data and load demand, the output power of power generation equipment can be reasonably adjusted to improve energy utilization efficiency.
[0108] By monitoring and analyzing green power data, the operating parameters of the equipment can be optimized and the wear and tear of the equipment can be reduced. For example, the working angle and output power of the solar panel can be adjusted according to the temperature, power and other data to extend the life of the panel.
[0109] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0110] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0111] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0112] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A green power data anomaly detection method based on deep learning, characterized in that: include: Obtain green electricity data; Perform data preprocessing on the acquired green electricity data; Build a green electricity data anomaly detection model based on deep learning; Use the green electricity data anomaly detection model to extract features and reduce the dimension of green electricity data; The reduced-dimensional features are predicted based on the long short-term memory network to obtain the prediction results.
2. The method for detecting anomalies in green electricity data based on deep learning according to claim 1, characterized in that: The acquisition of green electricity data includes collecting voltage, current, power, power generation and timestamp information based on smart meters and power generation equipment sensors.
3. The method for detecting anomalies in green electricity data based on deep learning according to claim 2 is characterized in that: The data preprocessing of the acquired green electricity data includes data cleaning and data normalization of the acquired green electricity data, and dividing the preprocessed green electricity data into a training set, a verification set and a test set by data segmentation.
4. The method for detecting anomalies in green electricity data based on deep learning according to claim 3 is characterized in that: The green electricity data anomaly detection model based on deep learning is constructed, including constructing a green electricity data anomaly detection model based on a combination of a deep neural network and a convolutional neural network, wherein a 3X3 convolution kernel is used in the convolution layer, an activation function ReLu is added after each convolution kernel, and a pooling layer is added after the convolution layer; the output of the pooling layer is flattened into a one-dimensional vector through a fully connected layer and then input into a hidden layer of the deep neural network, and outputted through a binary classification layer as an output layer.
5. The method for detecting anomalies in green electricity data based on deep learning according to claim 4 is characterized in that: The green electricity data anomaly detection model is used to extract features and reduce the dimension of green electricity data, including extracting local features of green electricity data through convolution operations and introducing nonlinearity using ReLu activation functions; the extracted features are weighted summed and outputted through a fully connected layer to obtain a high-dimensional feature representation of the green electricity data.
6. The method for detecting anomalies in green electricity data based on deep learning according to claim 5, characterized in that: The method of using the green electricity data anomaly detection model to extract features and reduce the dimension of green electricity data also includes performing eigenvalue decomposition on the high-dimensional feature representation through the covariance matrix to obtain the eigenvalues and corresponding eigenvectors of the green electricity data, and selecting the projection matrix through principal component analysis, and then optimizing the low-dimensional space by calculating the probability distribution in the high-dimensional space to achieve feature dimension reduction.
7. The method for detecting anomalies in green electricity data based on deep learning according to claim 6, characterized in that: The method predicts the reduced-dimensional features based on the long short-term memory network to obtain a prediction result, including enhancing the expression ability of the long short-term memory network by stacking multiple LSTM layers, taking the last LSTM layer as the output and connecting it to the fully connected layer to predict the features of the green electricity data, and outputting the probability distribution through the softmax layer.
8. A green electricity data anomaly detection system based on deep learning, the system being a system used in a green electricity data anomaly detection method based on deep learning as claimed in any one of claims 1 to 7, characterized in that: include: The data acquisition module is configured to acquire green electricity data; The preprocessing module is configured to perform data preprocessing on the acquired green power data; The model building module is configured to build a green electricity data anomaly detection model based on deep learning; The feature extraction module is configured to perform feature extraction and feature dimension reduction on the green electricity data using the green electricity data anomaly detection model; The prediction module is configured to predict the reduced-dimensional features based on the long short-term memory network to obtain a prediction result.
9. A computer-readable storage medium storing a plurality of instructions, characterized in that: The instructions are suitable for being loaded by a processor of a terminal device and executing the method according to claims 1-7.
10. A terminal device, comprising a processor and a computer-readable storage medium, wherein the processor is used to implement each instruction; and the computer-readable storage medium is used to store multiple instructions, characterized in that: The instructions are suitable for being loaded by a processor and executing the method according to claims 1-7.