Short-term power load prediction method based on intelligent electric meter
The method uses smart meters and a CNN-LSTM-Attention model to enhance short-term power load forecasting accuracy, addressing the challenges of existing models by capturing long-term dependencies and improving prediction reliability.
Patent Information
- Application Number
- CN202411240358.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-27
AI Technical Summary
Existing short-term load forecasting models for power systems lack accuracy and stability, especially in local power systems with rapid modernization and increasing power demands, leading to power shortages during peak periods.
A method utilizing smart meters to collect time series data, cluster it into training, validation, and test sets, and employ a CNN-LSTM-Attention model for power load forecasting, incorporating feature extraction, LSTM analysis for long-term dependencies, and an attention mechanism to enhance prediction accuracy.
Improves the accuracy of short-term power load forecasting, providing a reliable decision-making basis for power dispatching departments by enhancing the model's ability to capture key information and handle nonlinear relationships.
Smart Images

Figure CN119209484A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power systems, and in particular to a short-term power load forecasting method and system based on a smart meter. Background Art
[0002] In recent years, my country's smart grid construction has achieved remarkable results. The country has vigorously promoted energy conservation and emission reduction policies and encouraged residents to use high-efficiency and energy-saving electrical appliances. Against this background, the market demand for smart meters is growing. According to relevant data, the scale of my country's smart meter market has expanded year by year, and it is expected to maintain steady growth in the next few years. In order to meet market demand and improve the overall level of my country's smart grid, it is imperative to develop a smart meter with high performance and high reliability. Electricity is the basic energy to ensure the normal operation of society. With the continuous improvement of the speed of my country's modernization construction, various power loads are also increasing rapidly, and society has higher requirements for the quality and timeliness of electricity. Hot summer and cold winter are peak periods for electricity consumption, but due to the lack of reserve power and the unreasonable allocation of power, power shortages have occurred in some areas. In recent years, due to industrial upgrading, coupled with the influence of high temperatures in summer and severe cold in winter, the demand for electricity has continued to surge, causing a large power gap.
[0003] Since electric energy resources are difficult to store, reasonable dispatch of electric energy resources has become an important way to fully utilize electric energy resources and avoid waste of electric energy resources. Load forecasting is a key method to achieve reasonable dispatch of electric energy resources. Improving the accuracy and stability of load forecasting models can provide decision-making basis for power dispatching departments. For local power systems with short-term operation, it is very difficult to establish an accurate load forecasting model, so improving the accuracy of short-term load forecasting is an important issue that needs to be solved urgently.
[0004] Before the popularization of IoT technology, traditional electricity metering mainly relied on mechanical or electronic meters. These meters can usually only measure local electricity, and cannot realize remote meter reading and data transmission. Smart IoT voltmeters have high accuracy, strong anti-interference ability, strong scalability, easy integration, and can also upload data to the PC platform in real time to facilitate data management and decision-making. They have been widely used in intelligent measurement fields such as electronic and electrical measurement, industrial automation instruments, and automatic test systems. With the widespread application of smart IoT voltmeters, it is possible to use real-time electricity consumption data through smart IoT voltmeters to predict the short-term load of the power system. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a method for predicting short-term power load based on smart meter technology in view of the shortcomings of the prior art.
[0006] A short-term power load forecasting method based on smart meters comprises the following steps: 1) data collection: collecting time series data related to power load of target users through smart meters; 2) constructing power data sets of user meters: clustering the time series data collected in step 1) and dividing them into training set, validation set and test set; 3) constructing a power load forecasting model and training the power load forecasting model through the training set; 4) model performance evaluation: using the validation set to detect and evaluate the trained power load forecasting model and optimize it, and further verifying the optimized power load forecasting model through the test set until the difference between the prediction result of the power load forecasting model and the power consumption data in the test set is less than a specified threshold; 5) short-term power load forecasting: collecting time series data related to power load of target users in real time, and using the power load forecasting model to forecast short-term power load.
[0007] Preferably, the timing data includes active power, reactive power, phase A current, phase B current, phase C current, phase A voltage, phase B voltage, and phase C voltage, wherein the active power is an output parameter, and the reactive power, phase A current, phase B current, phase C current, phase A voltage, phase B voltage, and phase C voltage are input parameters.
[0008] Preferably, the power load prediction model is a CNN-LSTM-Attention prediction model.
[0009] Preferably, in step 2), the Kmeans algorithm is used to cluster the collected data.
[0010] Preferably, when the power load forecasting model is trained in step 3), first, the input data is subjected to feature extraction through a one-dimensional convolutional layer to identify key features in the time series; then, the data enters the LSTM layer, which is designed specifically for analyzing time series and can identify long-term dependencies and complex changes in the data; the model further introduces an attention mechanism, which weights the importance of the LSTM output so that the model focuses on key information in the sequence, thereby improving the accuracy of the prediction; then, the data passes through a fully connected layer and uses a ReLU activation function. In the final stage of the model, an additional dropout layer is added, and then the features are converted into prediction results through a fully connected layer.
[0011] Preferably, in step 4), when the prediction model is tested and evaluated using the validation set data, multiple performance indicators can be used for evaluation, including mean square error, root mean square error, and determination coefficient.
[0012] The present invention has the following beneficial effects: the short-term power load forecasting method detects the time series data related to the power load in real time through the smart meter, and constructs a power load forecasting model, and trains and evaluates the power load forecasting model with the real-time detected time series data, thereby improving the prediction accuracy of the power load forecasting model, thereby effectively improving the accuracy of short-term load forecasting, and better providing decision-making basis for the power dispatching department.
[0013] To further understand the features and technical contents of the present invention, please refer to the following detailed description and drawings of the present invention. However, the drawings provided are only for reference and description and are not intended to limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 is a flow chart of an embodiment of the present invention.
[0015] Figure 2 This is a result block diagram of a smart meter according to an embodiment of the present invention.
[0016] Figure 3 This is a structural diagram of the CNN-LSTM-Attention prediction model of an embodiment of the present invention.
[0017] Figure 4 This is a diagram of the internal unit structure of the LSTM model of an embodiment of the present invention.
[0018] Figure 5 This is a comparison chart of the prediction results of the test set of the embodiment of the present invention.
[0019] Figure 6 This is a diagram showing the effect prediction of the test set effect of an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The following is an explanation of the disclosed embodiments of the present invention through specific embodiments. Those skilled in the art can understand the advantages and effects of the present invention from the contents disclosed in this specification. The present invention can be implemented or applied through other different specific embodiments, and the details in this specification can also be modified and changed in various ways based on different viewpoints and applications without departing from the concept of the present invention. In addition, the drawings of the present invention are only simple schematic illustrations and are not depicted according to actual dimensions. It is stated in advance. The following embodiments will further explain the relevant technical contents of the present invention in detail, but the disclosed contents are not intended to limit the scope of protection of the present invention.
[0021] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various components or signals, these components or signals should not be limited by these terms. These terms are mainly used to distinguish one component from another component, or one signal from another signal. In addition, the term "or" used herein may include any one or more combinations of the associated listed items depending on the actual situation.
[0022] like Figure 1 As shown, the present invention discloses a short-term power load forecasting method based on a smart meter, which includes the following steps:
[0023] First, data collection is carried out. The time series data related to the target user and power load is collected through the smart meter. The structure of the smart meter is as follows: Figure 2 As shown in the figure, it mainly includes voltage sampling module 1, current sampling module 2, metering chip 3, power module 4, MCU controller 5, storage module 6, and LoRa communication module 7. The physical signals collected by the smart meter through voltage sampling and current sampling are converted into electrical signals and then transmitted to the computer through the communication module. The computer converts the electrical signals into numbers with physical units. The frequency and accuracy of the smart meter's acquisition of alternating current need to match the rate of the transmission signal of the communication module. The metering chip in the smart meter uses ATT7022E, which can collect power parameters such as power factor, power, voltage, and current.
[0024] In this patent, smart meters are used as data acquisition devices, and the method of connecting transformers to the main power supply line provides electric energy for smart meters. The installation location is determined at the main power supply entrance. If it is inconvenient to install at the main power supply entrance, find the branch main power supply switch for installation. Real-time sampling of time series data related to various power loads in the line is carried out, mainly including real-time three-phase current, active power, reactive power, and three-phase voltage in the circuit. The communication method between the smart meter and the collector adopts wireless communication. The communication method adopts LoRa communication technology. LoRa is a long-distance wireless transmission technology first adopted and promoted by Semtech in the United States. The LoRa network mainly consists of four parts: terminal (with built-in LoRa module), gateway (or base station), server and cloud, and application data can be transmitted bidirectionally.
[0025] When collecting data, the time series data related to the short-term power load of a user's meter in the power grid is used as the model training data set. The time series data related to the short-term power load includes active power, reactive power, phase A current, phase B current, phase C current, phase A voltage, phase B voltage, phase C voltage, among which the active power is the output parameter, and the reactive power, phase A current, phase B current, phase C current, phase A voltage, phase B voltage, phase C voltage are the input parameters. The data is collected every hour, totaling more than 10,000 items.
[0026] After data collection is completed, the user meter power data set is constructed: the time series data collected in the cluster is clustered and divided into training set, validation set and test set. The Kmeans algorithm is used to cluster the collected data, and the training set, validation set and test set are divided. The clustered data training can effectively improve the prediction accuracy of the model. The above-mentioned active power (Active Power) refers to the part that is actually consumed and converted into heat energy, light energy or mechanical energy in the AC circuit. It is the basis for calculating the electricity bill. Reactive power (Reactive Power) is related to the inductance and capacitance components in the circuit. Although it does not directly do work, it plays a key role in maintaining the stable operation of the circuit. Voltage (Voltage) is a physical quantity that measures the intensity of the electric field and determines the size of the current; current (Current) is the amount of charge passing through the conductor cross section per unit time, reflecting the speed of charge flow. Therefore, active power is the output of electricity; reactive power, three-phase voltage, and three-phase current data are input.
[0027] Then, a power load forecasting model is constructed, and the power load forecasting model is trained using a training set. The power load forecasting model in this patent adopts a CNN-LSTM-Attention forecasting model. During training, first, the input data is subjected to feature extraction through a one-dimensional convolutional layer to identify key features in the time series, such as periodicity, trends, and anomalies. This step provides optimized data input for the subsequent LSTM layer. Subsequently, the data enters the LSTM layer, which is designed for analyzing time series and can identify long-term dependencies and complex changes in data. In order to improve the generalization ability of the model, the dropout technology is used. The model further introduces an attention mechanism, which weights the importance of the LSTM output so that the model focuses on key information in the sequence, thereby improving the accuracy of the prediction. Next, the data passes through a fully connected layer and uses a ReLU activation function to enhance the model's ability to handle nonlinear relationships. In the final stage of the model, an additional dropout layer is added, and then the features are converted into prediction results through a fully connected layer. Finally, a fully connected layer is responsible for converting the learned information into specific predictions to support the decision-making process. The structure of the CNN-LSTM-Attention forecasting model is as follows: Figure 3 shown.
[0028] The Long Short-Term Memory (LSTM) network is an important improvement over the traditional Recurrent Neural Network (RNN), specifically designed to address the challenges faced by RNNs when processing long sequence data. The core feature of LSTM is its internal "gate" structure, including input gates, forget gates, and output gates, which control the inflow, retention, and outflow of information. Through this unique mechanism, LSTM is able to effectively avoid the vanishing gradient problem. The vanishing gradient problem is that in RNNs, as the sequence grows, the gradient used to train the network may become very small (vanishing gradient) or abnormally large (exploding gradient), thereby preventing the network from learning effective information from long sequences. This makes LSTM and similar improved RNN variants a better choice for prediction tasks that need to capture long-term dependencies. The key to LSTM is its cell structure, each of which contains four main parts: a cell state and three "gates" - forget gate, input gate, and output gate. The internal cell structure of the LSTM model is as follows: Figure 4 As shown. The role of the forget gate is to determine which information needs to be retained from the cell state and which needs to be forgotten through a sigmoid activation function. Specifically, the forget gate receives the hidden state of the previous moment (part of the memory cell) and the input of the current moment, and outputs a value between 0 and 1, indicating the degree of information retention at the corresponding position. 0 means complete forgetting, and 1 means complete retention. The mathematical expression of the forget gate is as follows:
[0029] f t =σ|W f ·[H t-1 , x t ]+b f |
[0030] Where: f t is the forget gate; σ represents the Sigmoid function; W f and b f are the forget gate weight and bias coefficient respectively; H t-1 is the unit output at time t-1; x t Information input at time t.
[0031] The input gate is a key component in LSTM. Its main function is to control the input of new information, that is, to decide which parts of the cell state are updated. The input gate allows the network to selectively update the cell state to adapt to the current input information. The mathematical expression of the input gate is as follows:
[0032] i t =σ|W t ·[H t-1 , x t ]+b t |
[0033]
[0034] Where: i t For the input gate, it determines how many new candidate values will be added to the cell state; is a new candidate value for the current time step, which may be added to the cell state; C t is the cell state at the current time step; w C is the weight matrix of candidate values; b C is the bias term of the candidate value; W t is the weight matrix of the input gate; b t is the bias term of the input gate; tanh is the hyperbolic tangent activation function, which compresses any real value to the interval [-1, 1].
[0035] The output gate is another key component in LSTM. Its main function is to determine which information in the current hidden state will be output to the next layer of the network or used for the final prediction. The output gate uses a sigmoid activation function to control which parts of the hidden state will be activated. The mathematical expression of the output gate is as follows.
[0036] O t =σ|W o ·|H t-1 , x t |+b O |
[0037] H t =O t ×tanh(C t )
[0038] Among them: t is the output of the output gate; W o is the weight matrix of the output gate; b o is the bias term of the output gate.
[0039] Attention can enhance the role of important time steps in LSTM, thereby further reducing the model prediction error. Attention is essentially the weighted average sum of the output vectors of the last layer of LSTM. The output vector of the LSTM hidden layer is used as the input of the attention layer, trained through a fully connected layer, and then the output of the fully connected layer is normalized using the softmax function to obtain the distribution weight of each hidden layer vector. The weight size indicates the importance of the hidden state of each time step to the prediction result. The weight training process is as follows:
[0040] S j =tanh(WH i +b j )
[0041] α i =softmax((S i )
[0042]
[0043] Where: α i is the weight obtained by applying the softmax function to the attention scores; H i is the output of the last LSTM hidden layer, S i The score for each hidden layer output; C i The value after weighted average summation; b i is the bias term.
[0044] After the model training is completed, the performance of the model needs to be evaluated. The trained power load forecasting model is tested and evaluated using the validation set, and then optimized. The optimized power load forecasting model is further verified using the test set until the difference between the prediction result of the power load forecasting model and the power consumption data in the test set is less than the specified threshold. Multiple performance indicators can be used for evaluation, including mean square error: MSE (Mean Squared Error), root mean square error: RMSE (Root Mean Squard Error), and determination coefficient: R2 (R-Square).
[0045] Mean relative error (MSE):
[0046]
[0047] Root Mean Square Error (RMSE):
[0048]
[0049] Coefficient of determination: R2(R-Square):
[0050]
[0051] After the evaluation is completed and the performance requirements of the model are met, short-term power load forecasting can be performed: real-time collection of time series data related to target users and power loads, and short-term power load forecasting using the power load forecasting model. Figure 5 , 6 As shown in Figure 2, the data of the test set is input into the optimized LSTM model, and the output label of the test set is predicted, thereby completing the prediction of the user's future power consumption data. The prediction results are shown in Figure 2. Figure 5 As shown, the test set effect is as follows Figure 6As shown in the figure. The experimental results show that the CN N-LSTM-Attention prediction model has very good prediction accuracy and can be used to predict users' short-term power consumption data. The short-term power load prediction method detects the time series data related to power load in real time through smart meters, builds a power load prediction model, trains and evaluates the power load prediction model with the real-time detected time series data, improves the prediction accuracy of the power load prediction model, and can effectively improve the accuracy of short-term load prediction, which can better provide decision-making basis for power dispatching departments.
[0052] The contents disclosed above are only preferred feasible embodiments of the present invention, and are not intended to limit the scope of the present invention. Therefore, all equivalent technical changes made using the contents of the present invention's specification and drawings are included in the scope of the present invention.
Claims
1. A short-term power load forecasting method based on smart meters, characterized in that: It includes the following steps: 1) Data collection: Collect time series data related to target users and power load through smart meters; 2) Constructing a user meter power data set: clustering the time series data collected in step 1) and dividing it into a training set, a validation set, and a test set; 3) Construct a power load forecasting model and train the power load forecasting model through a training set; 4) Model performance evaluation: Use the validation set to test and evaluate the trained power load forecasting model, and optimize it. Use the test set to further verify the optimized power load forecasting model until the difference between the prediction result of the power load forecasting model and the power consumption data in the test set is less than the specified threshold; 5) Short-term power load forecasting: Real-time collection of time series data related to power load of target users, and use the power load forecasting model to perform short-term power load forecasting.
2. According to claim 1, a short-term power load forecasting method based on smart meter is characterized in that: The timing data includes active power, reactive power, phase A current, phase B current, phase C current, phase A voltage, phase B voltage, and phase C voltage, wherein the active power is an output parameter, and the reactive power, phase A current, phase B current, phase C current, phase A voltage, phase B voltage, and phase C voltage are input parameters.
3. The method for short-term power load forecasting based on smart meters according to claim 1 is characterized in that: The power load prediction model is a CNN-LSTM-Attention prediction model.
4. The method for short-term power load forecasting based on smart meters according to claim 1 is characterized in that: In step 2), the Kmeans algorithm is used to cluster the collected data.
5. The method for short-term power load forecasting based on smart meters according to claim 1 is characterized in that: When training the power load forecasting model in step 3), first, the input data is subjected to feature extraction through a one-dimensional convolutional layer to identify key features in the time series; then, the data enters the LSTM layer, which is designed for analyzing time series and can identify long-term dependencies and complex changes in data; the model further introduces an attention mechanism, which weights the importance of the LSTM output so that the model focuses on key information in the sequence, thereby improving the accuracy of the prediction; then, the data passes through a fully connected layer and uses the ReLU activation function. In the final stage of the model, an additional dropout layer is added, and then the features are converted into prediction results through a fully connected layer.
6. The method for short-term power load forecasting based on smart meters according to claim 1 is characterized in that: In step 4), when the prediction model is tested and evaluated using the validation set data, multiple performance indicators can be used for evaluation, including mean square error, root mean square error, and determination coefficient.
Citation Information
Cited By
Intelligent electric meter data power load prediction method, device, equipment and medium
CN120596963A
User security feature recognition method based on behavior pattern analysis
CN120804894A
A user security feature recognition method based on behavior pattern analysis
CN120804894B
