Energy consumption prediction method and device suitable for large-scale distributed users, and storage medium

By adopting multi-scale feature extraction and sparse self-attention mechanisms in power consumption prediction, the shortcomings of existing methods in extracting multi-scale features and responding to user behavior changes are solved, and more efficient and accurate power consumption prediction is achieved, supporting dispersion efficient transactions of users in the spot market.

CN119476619APending Publication Date: 2025-02-18MARKETING SERVICE CENT OF STATE GRID JILIN ELECTRIC POWER CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411626545.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing power consumption prediction methods are insufficient extraction, untimely response, low prediction accuracy, large computing resources when dealing with multi-scale features of distributed users, and lack in-depth analysis of user aggregation characteristics and market participation behavior.

Method used

Using a multi-scale feature extraction mechanism and a sparse self-attention mechanism, high-dimensional features and features of different time scales are extracted through the Transformer model and multi-scale convolution kernel, and combined with the ProbSparse self-attention mechanism and residual network, the computational efficiency of the model is optimized. and prediction accuracy.

Benefits of technology

It significantly improves the prediction accuracy of power consumption for decentralized users, improves the computing efficiency and adaptability of the model, can more accurately capture the multi-level dynamic characteristics in power consumption, and supports efficient trading decisions for decentralized users in the spot market.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476619A_ABST
    Figure CN119476619A_ABST
Patent Text Reader

Abstract

The invention discloses an energy consumption prediction method and device suitable for large-scale distributed users and a storage medium, and belongs to the technical field of power systems and information science. The method comprises the following steps: acquiring historical power consumption data; performing high-dimensional feature representation and position code addition on the historical power consumption data by adopting a Transform model embedding layer to obtain a first input embedding representation and a second input embedding representation; performing feature extraction on the historical power consumption data on different time scales to obtain multi-scale features; and inputting the first input embedded representation, the second input embedded representation and the multi-scale features into a pre-trained energy consumption prediction model based on a coding-decoding architecture, and outputting power consumption on three time resolutions of a future preset day, a future preset week and a future preset month. According to the method, through combination of multi-scale feature extraction and improved coding-decoding architecture, accurate prediction of the distributed users on power consumption behaviors is remarkably improved, and effective technical support is provided for spot market transaction clearing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an energy consumption prediction method, device and storage medium suitable for large-scale decentralized users, and belongs to the field of power system and information science and technology. Background Art

[0002] With the rapid development of power market reform and distributed energy, a large number of decentralized users are participating in the power spot market, making the power consumption pattern more complex and difficult to predict. The energy consumption characteristics of decentralized users are highly diverse, volatile in time and space, and have significant nonlinearity and randomness. These characteristics cause traditional power consumption forecasting methods such as ARIMA and LSTM to perform poorly when dealing with diverse user behaviors and long-term dependence characteristics. Traditional methods have limited ability to capture characteristics of different time scales, and have low computational efficiency for large-scale data processing. It is difficult to respond to dynamic changes in the market in real time, resulting in large prediction errors, which in turn affects the clearing decisions of the spot market and the stable operation of the system.

[0003] Existing models are prone to overfitting or underfitting when dealing with non-stationary, multi-scale and high-frequency power data, and are sensitive to data noise, and cannot effectively use the aggregated behavioral characteristics of users for accurate prediction. Especially when distributed users participate in the spot market on a large scale, the shortcomings of existing forecasting technology may lead to supply and demand imbalances and reduced market efficiency.

[0004] In summary, the main problems faced by the current power consumption forecasting field include: insufficient multi-scale feature extraction by the model, untimely response to changes in decentralized user behavior, low prediction accuracy, large consumption of computing resources, and lack of in-depth analysis of user aggregation characteristics and spot market participation behavior. Therefore, it is urgent to provide an advanced strategy that can accurately predict decentralized user power consumption and quickly adapt to changes in market demand to make up for the related defects faced by existing methods. Summary of the invention

[0005] The purpose of the present invention is to provide an energy consumption prediction method, device and storage medium suitable for large-scale decentralized users, aiming to significantly improve the prediction accuracy of decentralized users' electricity consumption through a sparse self-attention mechanism of a multi-scale feature extractor.

[0006] In order to solve the above technical problems, the present invention is implemented by adopting the following technical solutions: On the one hand, the present invention provides an energy consumption prediction method applicable to large-scale decentralized users, which comprises: Obtain historical electricity consumption data of decentralized users; Performing high-dimensional feature representation and position encoding on the historical power consumption data to obtain corresponding first input embedding representation and second input embedding representation respectively; Extracting features of the historical power consumption data at different time scales to obtain multi-scale features corresponding to different time resolutions; The first input embedding representation, the second input embedding representation and the multi-scale features are input into a pre-trained energy consumption prediction model based on an encoding-decoding architecture, and the power consumption at three preset time resolutions of day, week and month in the future is output.

[0007] Optionally, the energy consumption prediction method applicable to large-scale decentralized users further includes preprocessing the historical power consumption data, including at least: missing value smoothing filling processing and minimum-maximum normalization processing; Among them, the linear interpolation method is used to smoothly fill the missing values, and the calculation formula is as follows: ; In the formula, represents the feature data after smooth filling, Represents the value of the known feature data point corresponding to the missing value. Represents the value of the known feature data point corresponding to the missing value, The time points representing missing values, Indicates the timestamp of the known feature data point before the missing value. Indicates the timestamp of the known feature data point corresponding to the missing value.

[0008] Optionally, the process of determining the first input embedding representation includes: The embedding layer of the Transformer model is used to perform embedding matrix mapping processing on the historical power consumption data, and the corresponding high-dimensional embedding vector is converted, which is expressed as: ; In the formula, represents a high-dimensional embedding vector, represents the input sequence of historical electricity consumption data, represents a learnable embedding matrix; Position encoding is added to the high-dimensional embedding vector to obtain the first input embedding representation that retains the time order information, which is expressed as: ; In the formula, represents the final first input embedding representation containing temporal order information, Represents positional encoding.

[0009] Optionally, the calculation formula of the position code is as follows: ; ; ; In the formula, represents the even dimension of the positional encoding at a certain position in the sequence, represents the odd dimension of the positional encoding at a certain position in the sequence, The index time step represents the position in the sequence, and Represent the even and odd indices of the feature dimensions, respectively. Indicates the length of the input vector.

[0010] Optionally, a multi-scale convolution kernel is used to extract features of the historical power consumption data at different time scales to obtain multi-scale features corresponding to different time resolutions, which are expressed as: ; In the formula, Represents multi-scale features at different temporal resolutions, represents the number of convolution kernels, Indicates convolution kernels, Represents the preprocessed historical electricity consumption data.

[0011] Optionally, the multi-scale features with different time resolutions include: periodic historical power consumption data based on three time scales of day, week and month.

[0012] Optionally, the first input embedding representation, the second input embedding representation and the multi-scale features are input into a pre-trained energy consumption prediction model based on an encoding-decoding architecture, and the power consumption at three future preset time resolutions of day, week and month is output, including: Inputting the first input embedding representation into the encoder of the encoding-decoding architecture to calculate the attention weight, thereby obtaining a corresponding first feature map; Combining the first feature map with the multi-scale feature to obtain a corresponding connection feature map; Inputting the connection feature map and the second input embedding representation into the decoder of the encoding-decoding architecture to calculate the attention weight, thereby obtaining a corresponding second feature map; The second feature map is input into the fully connected layer to predict the power consumption of distributed users within the preset area at three time resolutions of preset day, week and month in the future.

[0013] Optionally, the encoder includes: a multi-layer multi-head sparse self-attention mechanism, each layer of the multi-head sparse self-attention mechanism calculates the attention weight through the ProbSparse self-attention mechanism, and the corresponding calculation formula is as follows: ; In the formula, Indicates query vector For key collections The attention weight, Indicates query vector, Represents the total number of keys, Indicates The transpose of the key vector, represents the dimension of the key / query vector, Represents the transpose operator.

[0014] Optionally, the decoder includes: a multi-head attention mechanism and a multi-head masked sparse attention mechanism, wherein the multi-head masked sparse attention mechanism processes the second input embedding representation to focus only on information at current and past moments.

[0015] Optionally, the power consumption of distributed users within a preset area at three time resolutions of preset days, weeks and months in the future is calculated by the following formula: ; In the formula, represents the power consumption value predicted by the model, represents the weight matrix of the fully connected layer, represents the second feature map output by the decoder, Represents the bias vector.

[0016] Optionally, the energy consumption prediction model adopts root mean square error and mean absolute error as loss functions to achieve optimization by minimizing the loss function.

[0017] Optionally, the calculation formulas of the root mean square error and the mean absolute error are respectively expressed as: ; ; In the formula, represents the root mean square error, represents the mean absolute error, represents the total number of data points, Represents the model The predicted value of the data point, Indicates The actual value corresponding to each data point.

[0018] In a second aspect, the present invention further provides an energy consumption prediction device suitable for large-scale decentralized users, comprising: A data acquisition module is configured to acquire historical power consumption data of decentralized users; An input embedding representation determination module is configured to perform high-dimensional feature representation and position encoding addition on the historical power consumption data to obtain a corresponding first input embedding representation and a second input embedding representation; A multi-scale feature extraction module is configured to extract features at different time scales from the historical power consumption data to obtain multi-scale features corresponding to different time resolutions; And, the energy consumption prediction module is configured to input the first input embedding representation, the second input embedding representation and the multi-scale features into a pre-trained energy consumption prediction model based on the encoding-decoding architecture, and output the power consumption corresponding to the three future preset time resolutions of day, week and month.

[0019] In a third aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the energy consumption prediction method applicable to large-scale decentralized users as described in the first aspect.

[0020] Compared with the prior art, the present invention has the following beneficial effects: Compared with the traditional single convolution kernel, which cannot process features on different time scales at the same time when extracting short-term fluctuations and long-term trends of time series data, and easily leads to information loss or overfitting problems, the present invention adopts a deep feature extraction mechanism across time scales to extract key features of power consumption from multiple time scales such as days, weeks, and months, so as to accurately capture the multi-level dynamic features in power consumption; secondly, in view of the fact that the traditional self-attention mechanism has a large amount of calculation and lacks real-time performance when facing long-term series data of power consumption, and it is difficult to meet the current situation of the spot market's demand for high frequency and low latency, the present invention also introduces a sparse selection strategy into the ProbSparse self-attention mechanism. The sparse selection strategy ensures that the model can accurately capture the core dynamic features of the input data while maintaining efficient calculation by giving priority to high-correlation pairs, thereby significantly improving the efficiency and prediction accuracy of long-term series data processing. The new energy consumption prediction strategy provided by the present invention not only provides efficient support for the trading decisions of large-scale decentralized users in the spot market, but also effectively helps the stable operation of the power system and the efficient clearing of the market to a certain extent, and has strong practicality. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A schematic diagram of a flow chart of an embodiment of an energy consumption prediction method applicable to large-scale decentralized users of the present invention; Figure 2It is a schematic diagram of the principle structure of the sparse self-attention mechanism in the energy consumption prediction method applicable to large-scale decentralized users of the present invention; Figure 3 It is a schematic diagram of the structure of a multi-scale convolution kernel in the energy consumption prediction method applicable to large-scale decentralized users of the present invention; Figure 4 The diagram is a structural diagram of a multi-scale residual network in the energy consumption prediction method applicable to large-scale decentralized users of the present invention. DETAILED DESCRIPTION

[0022] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations on the technical solution of the present invention. The embodiments of the present invention and the technical features in the embodiments may be combined with each other unless there is a conflict.

[0023] The term "and / or" is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " generally indicates that the associated objects are in an "or" relationship.

[0024] Example 1 refer to Figure 1 This embodiment introduces an energy consumption prediction method suitable for large-scale decentralized users, which includes: Obtain historical electricity consumption data of decentralized users; Performing high-dimensional feature representation and position encoding on the historical power consumption data to obtain corresponding first input embedding representation and second input embedding representation respectively; Extracting features of the historical power consumption data at different time scales to obtain multi-scale features corresponding to different time resolutions; The first input embedding representation, the second input embedding representation and the multi-scale features are input into a pre-trained energy consumption prediction model based on an encoding-decoding architecture, and the power consumption at three preset time resolutions of day, week and month in the future is output.

[0025] It is worth noting that the energy consumption prediction model based on the encoding-decoding architecture combines the ProbSparse self-attention mechanism and the multi-scale convolution kernel, which can not only accurately capture short-term fluctuations and long-term trends to effectively cope with complex and changeable load characteristics, but also greatly improve computing efficiency and reduce resource consumption. In actual application, distributed users can participate in market response more efficiently, tap their own flexibility resources, optimize benefits, and promote the efficient use of distributed energy through the power consumption prediction strategy provided by this embodiment; at the same time, accurate load forecasting also provides a solid technical guarantee for the dispatch optimization and operation risk reduction of the power system, and improves the overall stability and economic benefits of the power system, which helps power companies and users to better plan and manage power resources and improve energy efficiency.

[0026] Example 2 refer to Figures 2 to 4 Based on Example 1, this example achieves a significant improvement in the accuracy of power consumption prediction for distributed users through a systematic series of operation steps, thereby providing effective technical support for clearing spot market transactions. The specific implementation process is described as follows.

[0027] 1. Acquisition and preprocessing of historical power consumption data Firstly, the power consumption data (including time series data, basic information of users, etc.) collected from the power metering devices of distributed users are preprocessed, including outlier detection and processing, missing value processing and normalization processing.

[0028] For the detection and processing of outliers, the outliers can be identified by using statistical methods (such as z-score, IQR, etc.) or machine learning algorithms (such as isolation forests) to calculate the outlier factor of each data point; based on the outlier factor, cluster analysis is performed to separate normal data from abnormal data to determine the abnormal judgment threshold; and then the outliers are removed, corrected or marked according to the abnormal judgment threshold. Among them, obviously wrong outliers (such as negative values, extreme values, etc.) can be directly removed, while outliers that may be reasonable but deviate from the norm (such as high power consumption in extreme weather) can be marked or retained.

[0029] For the processing of missing values, this embodiment adopts a combination of regional averaging and linear interpolation to improve the integrity and consistency of the data. Among them, the regional averaging method refers to calculating the mean of adjacent data between users with similar geographical locations or power consumption characteristics, and then revealing a certain trend or feature within the region based on the mean. Specifically, when it is necessary to average the power consumption data of a certain area, first, collect the power consumption data of all users in the area; then, select a suitable averaging method (such as arithmetic mean or weighted average method) according to the distribution of the data; finally, calculate the average power consumption of the area. This result can serve as an important basis for evaluating the power consumption level of the region and formulating power management strategies.

[0030] The linear interpolation rule is to estimate the value of the missing data point by linear interpolation between the data points before and after the missing value, that is, drawing a straight line between the data points to smooth the data. This method not only fills the data gap, but also maintains the continuity of the data trend to a certain extent. The calculation formula of linear interpolation is as follows: ; In the formula, represents the feature data after smooth filling, Represents the value of the known feature data point corresponding to the missing value. Represents the value of the known feature data point corresponding to the missing value, The time points representing missing values, Indicates the timestamp of the known feature data point before the missing value. Indicates the timestamp of the known feature data point corresponding to the missing value.

[0031] The normalization process is to scale the original collected data to This process can eliminate the dimensional differences between different variables, reduce the scale differences between different features, reduce the impact of data fluctuations on model training, and thus improve the stability and accuracy of prediction. Through this normalization process, the data can be standardized. Among them, this embodiment specifically adopts the minimum-maximum normalization operation, and the relevant calculation formula is as follows: ; In the formula, represents the data obtained after normalization. Represents the original data, and They represent the corresponding minimum and maximum values ​​in the original data respectively.

[0032] 2. High-dimensional feature representation and position encoding based on historical power consumption data Furthermore, high-dimensional feature representation and position encoding are performed on the historical power consumption data to obtain corresponding first input embedding representation and second input embedding representation, respectively, wherein the determination process of the first input embedding representation includes: The embedding layer of the Transformer model is used to perform embedding matrix mapping processing on the input sequence of the preprocessed historical power consumption data, and the corresponding high-dimensional embedding vector is converted, which is expressed as: ; In the formula, represents a high-dimensional embedding vector, represents the input sequence of preprocessed historical electricity consumption data, represents a learnable embedding matrix; In order to preserve the time sequence information of the input data, positional encoding is added to the high-dimensional embedding vector, thereby obtaining the first input embedding representation that preserves the time sequence information, which is expressed as: ; ; ; ; In the formula, represents the final first input embedding representation containing temporal order information, represents the position code, represents the even dimension of the positional encoding at a certain position in the sequence, represents the odd dimension of the positional encoding at a certain position in the sequence, The index time step represents the position in the sequence, and Represent the even and odd indices of the feature dimensions, respectively. Represents the embedding dimension size of the model, that is, the length of the input vector.

[0033] In addition, the second input embedding representation is processed in the same manner as above, specifically based on The obtained ones will not be described here. Represents the input features of the sequence before the time point that needs to be predicted during the decoding process, Represents the start symbol, which is used to indicate the beginning of the decoding process and is usually initialized to a zero vector or some special identifier.

[0034] 3. Multi-scale features with different temporal resolutions The preprocessed data will be input into the multi-scale feature extraction module for the next step of processing. Specifically, the multi-scale convolution kernel (such as convolution kernels of different sizes such as 1, 7, 28, etc.) will decompose the data into features of different time resolutions to extract feature information of different time scales (such as hours, days, weeks, and months). This process effectively solves the technical problem that the traditional single convolution kernel cannot capture multi-time scale information by capturing short-term fluctuations and long-term trends, thereby significantly improving the ability to capture complex consumption patterns. Specifically, the multi-scale convolution kernel can process input data at different time resolutions. , to generate feature maps , its mathematical expression is as follows: ; In the formula, represents the number of convolution kernels, Indicates convolution kernels, Represents the electricity consumption data obtained after preprocessing. Each convolution kernel size is matched to its corresponding time scale so that the model can capture both short-term changes (such as daily fluctuations) and long-term trends (such as seasonal changes). The multi-scale features generated by the multi-scale convolution kernel contain key feature information at different time resolutions, such as short-term intraday fluctuations, periodic weekly patterns, and long-term monthly consumption characteristics.

[0035] It is also worth noting that, since traditional deep networks are prone to gradient vanishing or gradient exploding when faced with complex power consumption data, this situation will affect the training effect and performance of the model to a certain extent. In order to improve the stability and prediction accuracy of the model in the deep learning process, this embodiment innovatively integrates the residual network into the multi-scale convolutional architecture. Specifically, the corresponding residual connection introduces a direct signal channel so that the input signal can be transmitted losslessly to a higher layer, which not only allows the gradient to be directly transmitted from the previous layer to the next layer, thereby effectively alleviating the gradient vanishing problem, but also enables the network to more easily train deep networks to effectively solve the degradation problem.

[0036] Specifically, refer to Figure 3 and Figure 4 The core idea of ​​the residual network is to reconstruct complex input into a simplified form by learning residual mapping. The relevant calculation formula is as follows: ; in, Indicates the first The feature representation of the layer, Indicates The feature representation of the layer contains the linear combination of the current layer features and the residual features. Indicates that the feature is focused on by the sparse attention mechanism Nonlinear transformation. Represents the feature representation after linear transformation. Through residual mapping, the model can efficiently capture key features and maintain stability, ensuring efficient learning and accurate prediction under multi-scale convolution operations, thereby effectively improving the overall performance of the power consumption prediction model.

[0037] 4. Prediction of power consumption at three time resolutions: day, week and month First of all, it is worth explaining that this embodiment adopts a sparse self-attention encoding-decoding architecture combined with the ProbSparse self-attention mechanism to effectively improve the efficiency of long time series data processing. The encoder in the architecture is responsible for high-dimensional embedding of the multi-scale features of the input, while the decoder selectively focuses on the most relevant features through the sparse self-attention mechanism to reduce invalid calculations. In addition, the introduction of the residual network also ensures that the signal can be propagated losslessly in the deep network to a certain extent, so as to solve the common gradient disappearance problem in the deep network.

[0038] The encoding-decoding architecture is specifically designed to process long-term series power consumption data of decentralized users. Its core is the ProbSparse sparse self-attention mechanism, which significantly improves the efficiency of long-term data processing by optimizing attention calculation. When faced with long-term series data of power consumption, the traditional self-attention mechanism has a large amount of calculation and is not real-time, making it difficult to meet the spot market's demand for high frequency and low latency. The standard self-attention calculation formula is as follows: ; In the formula, represents the query matrix, represents the key matrix, represents the value matrix, Represents the dimension of the key / query vector. In previous practical applications, this formula needs to be calculated for all query and key pairs. When the amount of input data is large, the calculation burden is extremely heavy. Therefore, in order to optimize the above-mentioned calculation process, the ProbSparse self-attention mechanism in this embodiment introduces a sparse selection strategy to effectively improve the calculation efficiency.

[0039] Next, the specific implementation process of distributed user energy consumption prediction will be introduced. First, the first input mentioned in the above section is embedded into the encoder of the encoding-decoding architecture to calculate the attention weight and obtain the corresponding first feature map. Among them, the encoder is composed of a multi-layer multi-head sparse self-attention mechanism, and each layer calculates the attention weight through the ProbSparse self-attention mechanism. The first feature map can be calculated by the following formula: ; In the formula, Indicates query vector For key collections The attention weight, Indicates query vector, Represents the total number of keys, The key set consists of all key vectors and is used to measure the similarity between the query and the key. Indicates The transpose of the key vector, represents the dimension of the key / query vector, Represents the transpose operator (matrix transpose).

[0040] The sparse selection strategy gives priority to highly correlated pairs to avoid redundant calculations, ensuring that the model can accurately capture the core dynamic features of the input data while maintaining efficient calculations. This optimized design enables the model to quickly respond to changes in electricity consumption of decentralized users, providing timely and reliable data support for spot market trading decisions.

[0041] Furthermore, the first feature map is combined with the multi-scale features obtained above to obtain a corresponding connection feature map.

[0042] The extracted multi-scale features are fused with the global context feature map (i.e., the first feature map) generated by the encoder to obtain a connected feature map. This fusion combines the local dynamic features extracted by multi-scale convolution with the global correlation features captured by the encoder through the self-attention mechanism through feature splicing or weighted fusion to form a complete and rich feature representation. The fused feature map not only retains the local detail pattern of power consumption, but also reflects the global time dependency and periodic trend, providing a more comprehensive description of power consumption behavior for the model. Subsequently, this complete feature representation is passed to the decoder. The decoder further processes the input feature map through a multi-layer attention mechanism and nonlinear transformation, and generates a predicted value for future power consumption combined with the temporal features of the target time point. This design enables the model to comprehensively utilize the short-term changes, long-term trends, and temporal context information of historical power consumption data, thereby achieving accurate prediction of users' future power consumption behavior.

[0043] Furthermore, the connection feature map and the second input embedding representation are input into the decoder of the encoding-decoding architecture to calculate the attention weight, and obtain the corresponding second feature map. The encoder output connection feature map contains key information at multiple time scales. The decoder receives the connection feature map and the decoding input from the encoder, i.e., the second input embedding representation, and further performs sparse self-attention calculation.

[0044] It is worth mentioning that Figure 2 The masked sparse self-attention mechanism shown in processes the decoded input to ensure that it only focuses on the information of the current and past moments to effectively avoid data leakage in the future moments.

[0045] Furthermore, the second feature map is input into the fully connected layer to predict the power consumption of distributed users within the preset area at three time resolutions of preset days, weeks and months in the future. The calculation formula is as follows: ; In the formula, represents the power consumption value predicted by the model, represents the weight matrix of the fully connected layer, represents the second feature map output by the decoder, Represents the bias vector.

[0046] This prediction result directly supports the clearing decision of the spot market, provides high-precision power consumption data support, and ensures the supply and demand balance and response efficiency of the market. This architecture optimizes the entire process from input to output through the sparse self-attention mechanism, realizes the fast and accurate prediction of large-scale power data, and provides a technical foundation for decentralized users to participate in market transactions.

[0047] Furthermore, by comparing the model output results with the actual data, corresponding tuning and evaluation processes are performed. This embodiment specifically performs tuning and evaluation based on the root mean square error (RMSE) and the mean absolute error (MAE), and the corresponding calculation formulas are as follows: ; ; In the formula, represents the root mean square error, represents the mean absolute error, represents the total number of data points, Represents the model The predicted value of the data point, Indicates The actual value corresponding to each data point.

[0048] In addition, this embodiment also uses cross-validation and early stopping to prevent overfitting and underfitting. Cross-validation refers to dividing the data set into multiple subsets, and cyclically training and validating to ensure the robustness of the model on different data sets; the early stopping rule refers to stopping training when the model validation error has not decreased for multiple consecutive cycles, thereby avoiding overfitting.

[0049] It is also worth mentioning that in the model optimization stage, the prediction performance and adaptability of the model are improved by adjusting key parameters such as the input length of the encoder and decoder, the size of the convolution kernel, and the depth of the residual network. Specifically, in order to capture the details of short-term fluctuations and long-term trends, the encoder input length can be set to include data points at different time scales, such as daily, weekly, and monthly. In terms of the selection of the convolution kernel size, convolution kernels of various sizes such as 1, 7, and 28 are used to facilitate feature extraction at different time resolutions.

[0050] In actual application, the input of the target prediction model includes decentralized user power consumption data at multiple time scales. These input features are processed by subsequent multi-scale convolution kernels and self-attention mechanisms to accurately capture short-term fluctuations and long-term trends in user power consumption behavior, thus providing a solid foundation for prediction; the model outputs power consumption forecasts at different time scales, such as power consumption in the next day, week, or month. Through these specific forecast data at multiple time scales, the spot market can better analyze supply and demand balance and provide strong support for clearing decisions.

[0051] The prediction results of multiple time scales are applied to the transaction clearing process of the spot market as a key basis for supply and demand balance analysis and price prediction. In actual application, through real-time updated prediction data, the model can effectively guide decentralized users to participate in market response and optimize their trading strategies, thereby improving the overall operating efficiency of the spot market; at the same time, the prediction results of the model can also be used to evaluate the potential benefits of users participating in market response, further promoting the efficient use of user flexibility resources.

[0052] In addition, in order to further verify the effectiveness of the method proposed in the present invention, this embodiment also compares the performance of the existing method with the method proposed in the present invention. As shown in Table 1, on the three time scales of day, month, and year, the error of the MSIE model corresponding to this embodiment is the lowest, with a daily prediction RMSE of 0.2431 and a MAE of 0.1832, which is significantly better than ARIMA (RMSE 0.3234, MAE 0.2515) and LSTM (RMSE 0.2814, MAE 0.2101). As the time scale is extended, MSIE still maintains its lead. In the annual prediction, its RMSE is 0.2865 and MAE is 0.2344, which continues to be better than ARIMA and LSTM, showing its efficient prediction ability under complex power consumption data.

[0053] In summary, the use of a multi-scale deep learning model based on a sparse self-attention mechanism architecture for power load forecasting has the following advantages: high prediction accuracy: compared with traditional forecasting methods, the MSIE model can more accurately identify users' short-term fluctuations and long-term trends, greatly improving the accuracy of forecasts, and helping to make more reliable decisions in complex and changeable power consumption environments; high computational efficiency: the use of the ProbSparse self-attention mechanism greatly reduces unnecessary attention score calculations in model calculations, optimizes the processing efficiency of long time series data, and introduces multi-scale convolution kernels and residual network design. While retaining long-term dependent features, the model avoids the computational burden of deep networks, significantly improving the running speed and computing resource utilization; strong adaptability: through the multi-scale feature extraction mechanism, this embodiment can process data with different time resolutions and adapt to forecasting needs at multiple time scales such as days, weeks, and months.

[0054] In summary, the flexibility of the target prediction model enables it to be applied to diverse user groups and complex market environments, providing precise support for large-scale decentralized user participation in the spot market.

[0055]

[0056] Example 3 This embodiment provides an energy consumption prediction device suitable for large-scale decentralized users, which includes: A data acquisition module is configured to acquire historical power consumption data of decentralized users; An input embedding representation determination module is configured to perform high-dimensional feature representation and position encoding addition on the historical power consumption data to obtain a corresponding first input embedding representation and a second input embedding representation; A multi-scale feature extraction module is configured to extract features at different time scales from the historical power consumption data to obtain multi-scale features corresponding to different time resolutions; And, the energy consumption prediction module is configured to input the first input embedding representation, the second input embedding representation and the multi-scale features into a pre-trained energy consumption prediction model based on the encoding-decoding architecture, and output the power consumption corresponding to the three future preset time resolutions of day, week and month.

[0057] Combination Figures 1 to 4 The energy consumption prediction device applicable to large-scale decentralized users can execute the energy consumption prediction method applicable to large-scale decentralized users introduced in the above-mentioned embodiment 1 or 2, and the specific functional implementation of each functional module is not repeated here.

[0058] Example 4 This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the energy consumption prediction method applicable to large-scale decentralized users as described in Embodiment 1 or 2 are implemented.

[0059] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0060] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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 produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. 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.

[0061] 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.

[0062] 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.

[0063] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for predicting energy consumption for large-scale decentralized users, characterized in that: include: Obtain historical electricity consumption data of decentralized users; Performing high-dimensional feature representation and position encoding on the historical power consumption data to obtain corresponding first input embedding representation and second input embedding representation respectively; Extracting features of the historical power consumption data at different time scales to obtain multi-scale features corresponding to different time resolutions; The first input embedding representation, the second input embedding representation and the multi-scale features are input into a pre-trained energy consumption prediction model based on an encoding-decoding architecture, and the power consumption at three preset time resolutions of day, week and month in the future is output.

2. The energy consumption prediction method applicable to large-scale decentralized users according to claim 1 is characterized in that: It also includes preprocessing the historical power consumption data, including at least: missing value smoothing filling processing and minimum-maximum normalization processing; Among them, the linear interpolation method is used to smoothly fill the missing values, and the calculation formula is as follows: ; In the formula, represents the feature data after smooth filling, Represents the value of the known feature data point corresponding to the missing value. Represents the value of the known feature data point corresponding to the missing value, represents the time point of missing values, Indicates the timestamp of the known feature data point before the missing value. Indicates the timestamp of the known feature data point corresponding to the missing value.

3. The energy consumption prediction method applicable to large-scale decentralized users according to claim 1 or 2, characterized in that: The process of determining the first input embedding representation comprises: The embedding layer of the Transformer model is used to perform embedding matrix mapping processing on the historical power consumption data, and the corresponding high-dimensional embedding vector is converted, which is expressed as: ; In the formula, represents a high-dimensional embedding vector, represents the encoder input sequence corresponding to the preprocessed historical power consumption data, represents a learnable embedding matrix; Position encoding is added to the high-dimensional embedding vector to obtain the first input embedding representation that retains the time order information, which is expressed as: ; In the formula, represents the final first input embedding representation containing temporal order information, Represents positional encoding.

4. The energy consumption prediction method applicable to large-scale decentralized users according to claim 3 is characterized in that: The calculation formula of the position code is as follows: ; ; ; In the formula, represents the even dimension of the positional encoding at a certain position in the sequence, represents the odd dimension of the positional encoding at a certain position in the sequence, The index time step represents the position in the sequence, and Represent the even and odd indices of the feature dimensions, respectively. Indicates the length of the input vector.

5. The energy consumption prediction method applicable to large-scale decentralized users according to claim 3 or 4, characterized in that: A multi-scale convolution kernel is used to extract features of the historical power consumption data at different time scales to obtain multi-scale features corresponding to different time resolutions, which are expressed as: ; In the formula, Represents multi-scale features at different temporal resolutions, represents the number of convolution kernels, Indicates convolution kernels, represents the pre-processed historical power consumption data; The multi-scale features with different time resolutions include: periodic historical power consumption data based on three time scales: day, week and month.

6. The energy consumption prediction method applicable to large-scale decentralized users according to claim 5 is characterized in that: The first input embedding representation, the second input embedding representation and the multi-scale features are input into a pre-trained energy consumption prediction model based on an encoding-decoding architecture, and the power consumption at three time resolutions of preset days, weeks and months in the future is output, including: Inputting the first input embedding representation into the encoder of the encoding-decoding architecture to calculate the attention weight, thereby obtaining a corresponding first feature map; Combining the first feature map with the multi-scale feature to obtain a corresponding connection feature map; Inputting the connection feature map and the second input embedding representation into the decoder of the encoding-decoding architecture to calculate the attention weight, thereby obtaining a corresponding second feature map; The second feature map is input into the fully connected layer to predict the power consumption of distributed users within the preset area at three time resolutions of preset day, week and month in the future.

7. The energy consumption prediction method applicable to large-scale decentralized users according to claim 6 is characterized in that: The encoder includes: a multi-layer multi-head sparse self-attention mechanism, each layer of the multi-head sparse self-attention mechanism calculates the attention weight through the ProbSparse self-attention mechanism, and the corresponding calculation formula is as follows: ; In the formula, Indicates query vector For key collections The attention weight, Indicates query vector, Represents the total number of keys, Indicates The transpose of the key vector, represents the dimension of the key / query vector, represents the transpose operator; The decoder includes: a multi-head attention mechanism and a multi-head masked sparse attention mechanism, wherein the multi-head masked sparse attention mechanism processes the second input embedding representation to focus only on information at current and past moments; The power consumption of distributed users within the preset area at the preset day, week and month time resolutions in the future is calculated by the following formula: ; In the formula, represents the power consumption value predicted by the model, represents the weight matrix of the fully connected layer, represents the second feature map output by the decoder, Represents the bias vector.

8. The energy consumption prediction method applicable to large-scale decentralized users according to claim 7 is characterized in that: The energy consumption prediction model uses a root mean square error and a mean absolute error as a loss function, and is used to achieve optimization by minimizing the loss function; The calculation formulas of the root mean square error and the mean absolute error are respectively expressed as: ; ; In the formula, represents the root mean square error, represents the mean absolute error, represents the total number of data points, Represents the model The predicted value of the data point, Indicates The actual value corresponding to the data point.

9. An energy consumption prediction device suitable for large-scale decentralized users, characterized in that: include: A data acquisition module is configured to acquire historical power consumption data of decentralized users; An input embedding representation determination module is configured to perform high-dimensional feature representation and position encoding addition on the historical power consumption data to obtain a corresponding first input embedding representation and a second input embedding representation; A multi-scale feature extraction module is configured to extract features at different time scales from the historical power consumption data to obtain multi-scale features corresponding to different time resolutions; And, the energy consumption prediction module is configured to input the first input embedding representation, the second input embedding representation and the multi-scale features into a pre-trained energy consumption prediction model based on the encoding-decoding architecture, and output the power consumption corresponding to the three future preset time resolutions of day, week and month.

10. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the energy consumption prediction method applicable to large-scale decentralized users as described in any one of claims 1 to 8.