Method for reducing prediction error of electricity sale quantity

By combining convolutional neural networks, recurrent neural networks and multi-channel attention mechanisms, the problems of multi-source data fusion and feature extraction in power sales prediction are solved, and higher prediction accuracy and lower errors are achieved.

CN119599334APending Publication Date: 2025-03-11STATE GRID FUJIAN ELECTRIC POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411638639.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The prior art has complexity of multi-source data fusion and processing in power sales prediction, as well as the difficulty of feature extraction based on time series, resulting in low prediction accuracy.

Method used

Using a method that combines convolutional neural network (CNN), recurrent neural network (RNN) and multi-channel attention mechanism, the local pattern of data is captured through CNN, RNN captures long-term dependencies, and enhances the prediction ability of the model through multi-channel attention mechanism.

Benefits of technology

It improves the accuracy of power sales forecasting, reduces the average absolute percentage error (MAPE), and enhances the model's ability to identify important features and filters redundant information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119599334A_ABST
    Figure CN119599334A_ABST
Patent Text Reader

Abstract

The invention relates to a method for reducing an electricity sale quantity prediction error, and belongs to the field of electricity sale quantity prediction. According to the method, the recurrent neural network and the convolutional neural network are combined, and the gated recurrent unit (GRU) is used as a lightweight version of the LSTM, so that the calculation efficiency is higher. By combining the advantages of capturing a local mode, processing multi-dimensional data, capturing spatial correlation and the like of the convolutional neural network, the model is helped to better extract the characteristics of the data in the aspects of time and dimension, and the prediction precision is improved; besides, a multi-channel attention mechanism is introduced, and attention weights are distributed on different channels, so that the model can process complex time sequence data more flexibly, and time sequence fragments which are crucial to prediction can be identified more accurately. The improvement not only enhances the recognition capability of the model for important features, but also improves the filtering capability for redundant information, so that the model is more outstanding in prediction tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of electricity sales forecasting, and in particular relates to a method for reducing electricity sales forecasting errors. Background Art

[0002] Predicted electricity sales data is critical to power companies and their users because it helps them optimize the use of power generation resources, formulate reasonable electricity pricing strategies, respond to demand peaks, and better conduct financial and facility planning. In addition, through accurate demand forecasting, power companies can improve energy efficiency and reduce resource waste, while also helping to protect the environment and promote the use of renewable energy. Governments and planning agencies also rely on this data to formulate energy policies and development plans, ensure the stable and reliable operation of the power system, and respond to the needs of economic and environmental changes.

[0003] The current power industry has an urgent need for high-precision forecasting technology. The global power market is gradually transforming towards liberalization and competition, and this transformation has brought new challenges and opportunities. Grid companies must find new ways to optimize grid operation, reduce operating costs, and improve responsiveness to market changes. Faced with the increasing complexity and variability of power demand, traditional statistical forecasting methods are gradually becoming incapable of meeting their inherent processing power and adaptability limitations.

[0004] Traditional statistical models are relatively simple and require less computing resources, but they may not be able to capture the nonlinear relationships and complex dynamic characteristics of the power system, resulting in low prediction accuracy. The current research direction is mainly based on intelligent prediction technology based on artificial intelligence. Intelligent prediction mainly uses advanced machine learning technology, and machine learning technology shows great potential in improving the accuracy of STLF models. Deep learning technology can automatically learn complex associations in data, while reinforcement learning can learn to optimize actions based on environmental feedback. Traditional machine learning models mainly include models such as support vector machines (SVM), decision trees, random forests, and gradient boosting. Among deep learning models, multi-layer perceptrons (MLP), convolutional neural networks (CNN), and recurrent neural networks (RNN) are often used for prediction. Convolutional neural networks (CNN) make predictions by capturing spatial and temporal connections in electricity sales data. CNN has been successfully applied to power systems to predict electricity sales by weather conditions, occupancy, and time. Another key deep learning model is the recurrent neural network (RNN), which can capture the temporal dependencies in electricity sales data. RNN uses feedback connections to enable information to be passed from one time period to the next, allowing the model to capture the dynamics of electricity sales over time. The long short-term memory (LSTM) network is a typical RNN network, which is very suitable for STLF because it can capture both short-term and long-term dependencies in electricity sales data, making the prediction more accurate. However, support vector machines, decision trees, random forests, and gradient boosting models are static in nature and cannot directly handle dynamic changes in time series data. These models often rely on a lot of feature engineering to construct time-related features and are prone to overfitting or underfitting, especially when dealing with complex nonlinear relationships. In addition, although ensemble methods such as random forests and gradient boosting improve prediction accuracy, they have high computational overhead and poor model interpretability. For deep learning models, multi-layer perceptrons (MLPs) are also unable to naturally capture temporal dependencies, and convolutional neural networks (CNNs) can effectively handle local correlations, but they are insufficient in capturing long-term temporal dependencies. Although recurrent neural networks (RNNs) and long short-term memory networks (LSTMs) are good at capturing temporal dynamics and long-term and short-term dependencies in electricity sales data, they have problems such as long training time, high consumption of computing resources, and complex parameter adjustment, especially in long time series. They are prone to gradient vanishing or exploding problems.

[0005] The key technical issues in realizing high-precision electricity sales forecasting algorithms are:

[0006] (1) Multi-source data fusion and processing

[0007] Photovoltaic power generation forecasting requires the integration of multi-source high-dimensional input data, including meteorological data (temperature, humidity, etc.), historical power generation data, geographic location and environmental factors (population, price, etc.). These data have significant periodic and local characteristics, and there are complex correlations and nonlinear relationships between different data sources. How to efficiently integrate and process these data is one of the challenges we will face.

[0008] (2) Feature extraction of electricity sales cycles and trends in each channel based on time series

[0009] Electricity sales data usually has significant time series characteristics, including periodicity and trend. At the same time, there are inherent correlations between multiple dimensions of the data (such as different regions, user types, time periods, etc.), which makes it difficult to fully reflect the characteristics of electricity sales by simply relying on time series analysis. Therefore, how to accurately extract and make full use of these dimensional feature information is the key to improving prediction accuracy. Summary of the invention

[0010] The purpose of the present invention is to overcome the problems existing in the prior art and provide a method for reducing the error in electricity sales forecasting. The method combines convolutional neural networks, recurrent neural networks and multi-channel attention mechanisms to achieve electricity sales forecasting.

[0011] To achieve the above purpose, the technical solution of the present invention is: a method for reducing the error of electricity sales forecasting, combining the convolutional neural network CNN and the gated recurrent unit GRU, and introducing a multi-channel attention mechanism module, thereby realizing electricity sales forecasting.

[0012] In one embodiment of the present invention, the convolutional neural network CNN extracts features from the input data through several convolutional layers, captures local patterns in the data, and outputs high-order features of the data, reflecting the spatial correlation and local patterns of the data; the gated recurrent unit GRU can capture long-term dependencies in the input data. Through its gating mechanism, the GRU can effectively solve the gradient vanishing problem. The output of the GRU represents the dynamic characteristics of the time series data, helping the model understand the changing patterns of the data in the time dimension.

[0013] In one embodiment of the present invention, the calculation formula of the convolutional neural network CNN is as follows:

[0014] Z=f(W*X+b)

[0015] Among them, X represents the input data matrix, W represents the weight of the convolution kernel of the convolution layer, b is the bias term, and the convolution operation f slides the convolution kernel on the input data to generate the feature map Z by local weighted sum.

[0016] In one embodiment of the present invention, the calculation formula of the gated recurrent unit GRU is as follows:

[0017] r t =σ(W r ·[h t-1 ,x t ]+b r )

[0018]

[0019] z t =σ(W z ·[h t-1 ,x t ]+b z )

[0020] Among them, X t is the current input, h t-1 The hidden state at the previous moment, W r , W h , W Z is the weight matrix, b r , b h , b Z is the bias, tanh and σ are the activation functions.

[0021] In one embodiment of the present invention, the outputs of the convolutional neural network CNN and the gated recurrent unit GRU are combined through a splicing operation to form a more comprehensive feature representation h concat , the spatial and temporal features are integrated, which is specifically expressed as follows:

[0022] h concat =[h CNN ],h GRU ]

[0023] Among them, h CNN 、h GRU Represent the outputs of the convolutional neural network CNN and the gated recurrent unit GRU respectively.

[0024] In one embodiment of the present invention, the spliced ​​feature h concat Enter the multi-channel attention mechanism module. The attention mechanism highlights the information that is more important to the prediction task by assigning different weights to different features, thereby enhancing the prediction ability of the model. The details are as follows:

[0025]

[0026] Among them, Q represents query, which means that relevant information needs to be found; K represents key, which contains features used to match the query and help calculate similarity; V represents value, which contains actual information. Attention weight will be applied to Value to generate output; d kis the dimension of K, i.e. the number of features of the key, and its function is to scale the dot product of the query and the key; softmax is the activation function, which is used to convert the similarity score between Q and K into a weight distribution so that the sum of these weights is 1, so as to perform a weighted average on the input information and determine the information of the location where the model should focus;

[0027] Finally, after passing through a fully connected layer, the final output is obtained to generate a prediction result, that is, the electricity sales at a certain moment in the future or the total electricity sales over a period of time.

[0028] In one embodiment of the present invention, the input data is multi-dimensional time series data including historical electricity sales, weather data, and economic indicators.

[0029] In one embodiment of the present invention, the goal of the method is to make the accuracy of the predicted electricity sales data greater than 90%, and the mean absolute percentage error (MAPE) is used to evaluate the prediction accuracy:

[0030]

[0031] Among them, A t is the actual value, F t is the predicted value and n is the total number of data points.

[0032] In one embodiment of the present invention, the training method of the prediction model is as follows:

[0033] Assume that the electricity sales data consists of historical electricity sales per day, hour, or minute, and the electricity sales value at each moment is represented by a single variable:

[0034] S={v j |j=1,2,...,m}

[0035] Among them, S represents the electricity sales data series, that is, the electricity sales trajectory of the historical period, v j represents the value of electricity sales at time j, and m represents the number of time points;

[0036] The goal of predicting future electricity sales is to predict future electricity sales based on historical electricity sales data. Assume that the prediction model f is used, the input is historical electricity sales data, and the output is the future electricity sales forecast value; let the actual electricity sales data be V i The corresponding prediction data is The electricity sales forecasting problem can be expressed as:

[0037]

[0038] In addition to the historical electricity sales data, other external factors that affect electricity sales may need to be considered. Assuming that the historical data of these external factors are E, the electricity sales forecast problem is further expanded to:

[0039]

[0040] The electricity sales forecast also involves an observation time window and a prediction time range. Assume that the observation time window is τ o That is, the model is based on the past τ o time points for training, and the prediction time range is τ p That is, the model predicts the future τ p The electricity sales volume at a point in time is formalized as follows:

[0041]

[0042] The present invention also provides a computer-readable storage medium, on which computer program instructions that can be executed by a processor are stored. When the processor executes the computer program instructions, the method steps described above can be implemented.

[0043] Compared with the prior art, the present invention has the following beneficial effects:

[0044] (1) The present invention combines recurrent neural networks with convolutional neural networks, and uses gated recurrent units (GRU) as a lightweight version of LSTM, which has higher computational efficiency. Combined with the advantages of convolutional neural networks in capturing local patterns, processing multidimensional data, and capturing spatial correlation, the model can better extract the characteristics of data in terms of time and dimension, thereby improving prediction accuracy.

[0045] (2) The present invention introduces a multi-channel attention mechanism into the model. This improvement enables the model to analyze the input sequence from multiple different angles and levels, thereby capturing the important information in the sequence more comprehensively. The multi-channel attention mechanism allocates attention weights on different channels, allowing the model to process complex time series data more flexibly and more accurately identify time series segments that are critical to prediction. This improvement not only enhances the model's ability to identify important features, but also improves its ability to filter redundant information, thereby performing better in prediction tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 This is a network structure diagram of the present invention.

[0047] Figure 2 It is the trend between time, temperature, humidity, price and electricity sales.

[0048] Figure 3 is the Pearson correlation matrix.

[0049] Figure 4 The comparison result between the actual value and the predicted value. DETAILED DESCRIPTION

[0050] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings.

[0051] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0052] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0053] The present invention provides a method for reducing the error of electricity sales forecasting, which combines a convolutional neural network (CNN) and a gated recurrent unit (GRU), and introduces a multi-channel attention mechanism module to achieve electricity sales forecasting.

[0054] The following is the specific implementation process of the present invention.

[0055] The network structure of the present invention is as follows Figure 1 As shown in Figure 1, the model combines the advantages of convolutional neural networks (CNNs) and gated recurrent units (GRUs) to process complex time series data. The input data first enters the model, including multi-dimensional time series data such as historical electricity sales, weather data, and economic indicators. The upper part of the model is the convolutional neural network (CNN) module, which extracts features from the input data through several convolutional layers. The convolutional layers can capture local patterns in the data, such as periodicity, trends, and seasonal fluctuations. Through the convolution kernel, CNN can effectively identify short-term features, such as the impact of weather or economic changes on electricity sales. The output of the convolutional layer extracts high-order features of the data, reflecting spatial correlations and local patterns.

[0056] Z=f(W*X+b)

[0057] Among them, X represents the input data matrix, W represents the weight of the convolution kernel of the convolution layer, b is the bias term, and the convolution operation f slides the convolution kernel on the input data to generate the feature map Z by local weighted sum.

[0058] The lower part of the model is the Gated Recurrent Unit (GRU) module. GRU is an effective model for processing time series data and can capture long-term dependencies in input data. Through its gating mechanism, GRU can effectively solve the gradient vanishing problem in traditional recurrent neural networks (RNNs), thus performing well in processing time series data with long time spans. The output of GRU represents the dynamic characteristics of time series data, helping the model understand the changing patterns of data in the time dimension.

[0059] r t =σ(W r ·[h t-1 ,x t ]+b r )

[0060]

[0061] z t =σ(W z ·[h t-1 ,x t ]+b z )

[0062] Among them, X t is the current input, h t-1 The hidden state at the previous moment, W r , W h , W Z is the weight matrix, b r , b h , b Z is the bias, tanh and σ are the activation functions.

[0063] Next, the outputs from the CNN and GRU modules are combined through a concatenation operation to form a more comprehensive feature representation that fuses spatial and temporal features.

[0064] h concat =[h CNN ,h GRU ]

[0065] Among them, h CNN 、h GRU Represent the outputs of the convolutional neural network CNN and the gated recurrent unit GRU respectively.

[0066] Subsequently, these concatenated features enter the multi-channel attention mechanism module. The attention mechanism enhances the model's prediction ability by assigning different weights to different features to highlight the information that is more important to the prediction task. Finally, the model generates a prediction result through the output layer, which may be the electricity sales at a certain moment in the future or the total electricity sales over a period of time. By combining the local feature extraction capability of CNN and the time dependency capture capability of GRU, and strengthening the attention mechanism, the model can perform well in processing complex multi-dimensional time series data and improve prediction accuracy:

[0067]

[0068] Among them, Q represents query, which means that relevant information needs to be found; K represents key, which contains features used to match the query and help calculate similarity; V represents value, which contains actual information. Attention weight will be applied to Value to generate output; d k is the dimension of K, i.e. the number of features of the key, and its function is to scale the dot product of the query and the key; softmax is the activation function, which is used to convert the similarity score between Q and K into a weight distribution so that the sum of these weights is 1, so as to perform a weighted average on the input information and determine the information of the location where the model should focus;

[0069] Finally, after passing through a fully connected layer, the final output is obtained to generate a prediction result, that is, the electricity sales at a certain moment in the future or the total electricity sales over a period of time.

[0070] The goal of the method of the present invention is to make the prediction accuracy of electricity sales data greater than 90%, and the mean absolute percentage error (MAPE) is used to evaluate the prediction accuracy:

[0071]

[0072] Among them, A t is the actual value, F t is the predicted value and n is the total number of data points.

[0073] The training method of the model of the present invention is as follows:

[0074] 1. Data feature analysis

[0075] The input data needs to be well-representative, covering a variety of scenarios and situations, to ensure that the neural network can learn effective patterns during training. In addition, clean and properly preprocessed data can reduce noise and uncertainty, thereby improving the accuracy and generalization ability of the model.

[0076] (1) Impact of temperature on electricity sales:

[0077] from Figure 2 ,3 As can be seen from the data, the correlation between average temperature and electricity sales is extremely low, with a correlation coefficient close to 0 (-0.017). This indicates that in this dataset, changes in temperature do not have a significant direct impact on electricity sales. In general, the impact of temperature on electricity sales may be more pronounced during extreme weather. For example, in the case of high temperatures in the summer or low temperatures in the winter, cooling or heating demand can lead to a significant increase in electricity sales. However, the temperature fluctuations in this dataset are relatively small, which may be the reason for the low correlation.

[0078] (2) Impact of humidity on electricity sales:

[0079] Humidity is negatively correlated with electricity sales (correlation coefficient is -0.271). This indicates that when humidity increases, electricity sales may decrease. When humidity is high, the air in the environment contains more water, and the heat dissipation effect of the human body is relatively poor, which may reduce the demand for the use of cooling equipment such as air conditioners, thereby leading to a decrease in electricity sales. When humidity is low, the air is dry, and people are more inclined to use equipment such as air conditioners, which may lead to an increase in electricity sales.

[0080] (3) The impact of price on electricity sales:

[0081] The electricity price is positively correlated with the amount of electricity sold (correlation coefficient is 0.156), but the correlation is not strong. This means that when the price is higher, the amount of electricity sold may increase slightly. This may be related to the price mechanism of the electricity market. The price of electricity tends to rise during high demand periods, such as during peak hours, when people's demand for electricity increases and the price also rises. Therefore, the positive correlation between the electricity price and the amount of electricity sold reflects the supply and demand relationship in the market.

[0082] (4) The impact of time on electricity sales:

[0083] from Figure 2 As can be seen from the table, electricity sales have a clear cyclical variation. In general, electricity sales fluctuate with the time of day and night and weekdays / weekends. The demand for electricity during the day (such as lighting, air conditioning, office equipment) is usually higher than at night, so electricity sales will increase during the day. Correspondingly, the demand for electricity at night is lower and electricity sales will also decrease. Electricity sales on weekends and holidays may be lower than on weekdays because many businesses and industrial sectors have less electricity demand on weekends.

[0084] To obtain data from the dataset suitable for training the network, perform the following steps:

[0085] 1) Delete the values ​​of temperature and humidity that exceed the theoretical limits;

[0086] 2) Delete the data points whose location fields are damaged or do not have electricity sales value;

[0087] 3) Interpolate electricity sales data for time periods where information is missing;

[0088] 2. Problem description

[0089] The core of the trajectory prediction problem is to construct a mapping relationship between historical electricity sales characteristics and future electricity sales. The mapping between historical electricity sales characteristics and future electricity sales is a nonlinear mapping. If a traditional linear model is used to fit, the effect obtained is poor. In contrast, neural networks have excellent fitting capabilities in nonlinear fields, so there is a possibility of success in constructing a suitable neural network model to predict trajectories. The present invention proposes an end-to-end neural network for predicting electricity sales.

[0090] The electricity sales data can be represented as a series of discrete time series data within a given time range. Assuming that the electricity sales data consists of historical electricity sales per day, hour, or minute, the electricity sales value at each moment can be represented by a single variable:

[0091] S={v j |j=1,2,...,m}

[0092] Among them, S represents the electricity sales data series, that is, the electricity sales trajectory of the historical period, v j represents the value of electricity sales at time j, and m represents the number of time points;

[0093] The goal of predicting future electricity sales is to predict the electricity sales in the future period based on the historical electricity sales data (and possible external factors, such as weather, holidays, etc.). Assume that the prediction model f is used, the input is the historical electricity sales data, and the output is the predicted value of future electricity sales. Assume that the actual data of electricity sales is V i The corresponding prediction data is The electricity sales forecasting problem can be expressed as:

[0094]

[0095] In addition to the historical electricity sales data, other external factors that affect electricity sales (such as weather, holidays, economic conditions, etc.) may also need to be considered. Assuming that the historical data of these external factors is E, the electricity sales forecast problem is further expanded to:

[0096]

[0097] The electricity sales forecast also involves an observation time window and a prediction time range. Assume that the observation time window is τ o That is, the model is based on the past τ o time points for training, and the prediction time range is τ p That is, the model predicts the future τ pThe electricity sales volume at a point in time is formalized as follows:

[0098]

[0099] experiment

[0100] In order to verify the effectiveness of the technical solution proposed in the present invention, the present invention conducts comparative experiments on the traditional deep learning algorithms LSTM and GRU with this method to analyze the performance of the technical solution of the present invention. In this experiment, the batch size is set to 8, the learning rate is set to 0.001, the optimizer is Adam, the network input feature is 7, the input data is 10, the output feature is 1, and the output feature is 1. The shape of the network input data is (8,10,7), which is transformed into a shape suitable for convolution by transposition operation (8,7,10). After the convolution operation, (8,10,16) is obtained; the gated recurrent unit GRU has two hidden layers, each with 50 nodes, and the output shape is (8,10,50); the input of the multi-channel attention mechanism is the concatenation of the output of the convolution layer and the GRU layer, with a shape of (8,10,16+50), and finally through a fully connected layer, the output shape is (8,1), and the server used to test the deduction accuracy and deduction delay of the recognition model has a 24GB version of the RTX 4090 graphics card.

[0101] (1) Experimental results

[0102] like Figure 4 As shown, the predicted value of the present invention is basically consistent with the true value, demonstrating the accuracy of the method of the present invention in predicting electricity sales data.

[0103] (2) Comparative experimental results

[0104] Table 1 Experimental results compared with traditional prediction algorithms

[0105] Solution of the present invention LSTM GRU 0.01144596 0.01619403 0.01300154

[0106] As shown in Table 1, the present invention and the traditional method for predicting electricity sales based on deep learning were also compared. Under the same accuracy conditions, the MAPE error of the method of the present invention is reduced by 29% compared with the LSTM model and by 12% compared with the GRU model. In summary, the technical solution of the present invention can have higher accuracy in predicting electricity sales data.

[0107] The present invention also provides a computer-readable storage medium, on which computer program instructions that can be executed by a processor are stored. When the processor executes the computer program instructions, the method steps described above can be implemented.

[0108] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0109] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0110] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0112] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.

Claims

1. A method for reducing the prediction error of electricity sales, characterized in that: The convolutional neural network (CNN) and the gated recurrent unit (GRU) are combined, and a multi-channel attention mechanism module is introduced to achieve electricity sales prediction.

2. A method for reducing power sales forecast error according to claim 1, characterized in that: The convolutional neural network (CNN) extracts features from the input data through several convolutional layers, captures local patterns in the data, and outputs high-order features of the data, reflecting the spatial correlation and local patterns of the data. The gated recurrent unit (GRU) can capture long-term dependencies in the input data. Through its gating mechanism, GRU can effectively solve the gradient vanishing problem. The output of GRU represents the dynamic characteristics of time series data, helping the model understand the changing patterns of data in the time dimension.

3. A method for reducing power sales forecast error according to claim 2, characterized in that: The calculation formula of convolutional neural network CNN is as follows: Z=f(W*X+b) Among them, X represents the input data matrix, W represents the weight of the convolution kernel of the convolution layer, b is the bias term, and the convolution operation f slides the convolution kernel on the input data to generate the feature map Z by local weighted sum.

4. A method for reducing power sales forecast error according to claim 3, characterized in that: The calculation formula of the gated recurrent unit GRU is as follows: r t =σ(W r ·[h t-1 ,x t ]+b r ) z t =σ(W z ·[h t-1 ,x t ]+b z ) Among them, X t is the current input, h t-1 The hidden state at the previous moment, W r , W h , W Z is the weight matrix, b r , b h , b Z is the bias, tanh and σ are the activation functions.

5. A method for reducing power sales forecast error according to claim 4, characterized in that: The outputs of the convolutional neural network CNN and the gated recurrent unit GRU are combined through a splicing operation to form a more comprehensive feature representation h concat , the spatial and temporal features are integrated, which is specifically expressed as follows: h concat =[h CNN ,h GRU ] Among them, h CNN 、h GRU Represent the outputs of the convolutional neural network CNN and the gated recurrent unit GRU respectively.

6. A method for reducing power sales forecast error according to claim 5, characterized in that: The concatenated features h concat Enter the multi-channel attention mechanism module. The attention mechanism highlights the information that is more important to the prediction task by assigning different weights to different features, thereby enhancing the prediction ability of the model. The details are as follows: Among them, Q represents query, which means that relevant information needs to be found; K represents key, which contains features used to match the query and help calculate similarity; V represents value, which contains actual information. Attention weight will be applied to Value to generate output; d k is the dimension of K, i.e. the number of features of the key, and its function is to scale the dot product of the query and the key; softmax is the activation function, which is used to convert the similarity score between Q and K into a weight distribution so that the sum of these weights is 1, so as to perform a weighted average on the input information and determine the information of the location where the model should focus; Finally, after passing through a fully connected layer, the final output is obtained to generate a prediction result, that is, the electricity sales at a certain moment in the future or the total electricity sales over a period of time.

7. The method for reducing the prediction error of electricity sales according to claim 1, characterized in that: The input data is multi-dimensional time series data including historical electricity sales, weather data, and economic indicators.

8. The method for reducing the prediction error of electricity sales according to claim 1, characterized in that: The goal of this method is to make the prediction accuracy of electricity sales data greater than 90%, and the mean absolute percentage error (MAPE) is used to evaluate the prediction accuracy: Among them, A t is the actual value, F t is the predicted value and n is the total number of data points.

9. The method for reducing the prediction error of electricity sales according to claim 1, characterized in that: The training method of the prediction model of this method is as follows: Assume that the electricity sales data consists of historical electricity sales per day, hour, or minute, and the electricity sales value at each moment is represented by a single variable: S={v j |j=1,2,...,m} Among them, S represents the electricity sales data series, that is, the electricity sales trajectory of the historical period, v j represents the value of electricity sales at time j, and m represents the number of time points; The goal of predicting future electricity sales is to predict future electricity sales based on historical electricity sales data. Assume that the prediction model f is used, the input is historical electricity sales data, and the output is the future electricity sales forecast value; let the actual electricity sales data be V i The corresponding prediction data is The electricity sales forecasting problem can be expressed as: In addition to the historical electricity sales data, other external factors that affect electricity sales may also need to be considered. Assuming that the historical data of these external factors are E, the electricity sales forecast problem is further expanded to: The electricity sales forecast also involves an observation time window and a prediction time range. Assume that the observation time window is τ o That is, the model is based on the past τ o time points for training, and the prediction time range is τ p That is, the model predicts the future τ p The electricity sales volume at a point in time is formalized as follows:

10. A computer-readable storage medium having stored thereon computer program instructions that can be executed by a processor, and when the processor executes the computer program instructions, the method steps according to any one of claims 1 to 9 can be implemented.