New energy electric quantity demand prediction model construction method, prediction method and device
By smoothly processing the multivariable historical timing data in the new energy power demand forecast method, and using the destationary attention mechanism and Transformer model, the problem of low accuracy of new energy power demand forecast in the existing technology is solved, and the problem of high accuracy of new energy power demand forecasting has been improved. Prediction accuracy and stability.
Patent Information
- Application Number
- CN202411048839.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-11-12
AI Technical Summary
The existing new energy power demand forecasting methods fail to effectively consider multivariate factors, resulting in low prediction accuracy.
A multivariate historical timing data set is used for stationary processing, and a new energy power demand prediction model is constructed based on the destationary attention mechanism and Transformer, and the stationary data is used for training to improve prediction accuracy.
By comprehensively considering multivariate factors, the accuracy of new energy power demand forecasts and the model's processing ability of time series data are improved, ensuring the stability and accuracy of the prediction results.
Smart Images

Figure CN118940902A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of artificial intelligence technology, and in particular to a new energy electricity demand forecasting model construction method, forecasting method and device. Background Art
[0002] The forecast of new energy power demand is of great significance to the development of the green energy industry, the stable operation of the power market and environmental protection. Through the accurate forecast of new energy power demand, the planning and layout of green energy projects can be guided, such as the construction location, scale and grid connection strategy of renewable energy power stations such as wind power and solar power, so as to ensure that the supply and demand of green energy match. In addition, forecasting new energy power demand helps to optimize resource allocation and reduce resource waste. The power department can reasonably adjust the power generation plan according to the forecast results to ensure the stability and economy of power supply, avoid grid overload or insufficient power supply, and achieve supply and demand balance. Since the demand for new energy power is affected by many factors, such as seasons and holidays, it will show complex changing characteristics according to different factors. Therefore, it is difficult to accurately predict the demand for new energy power. The existing new energy power demand forecasting method does not consider the time series data of multivariate factors, but only predicts the power demand based on a single factor, resulting in a low prediction accuracy. Therefore, there is an urgent need for a new energy power demand forecasting method that can solve the problem of low accuracy of new energy power demand forecasting in the existing technology. Summary of the invention
[0003] In view of the above problems in the prior art, the purpose of the embodiments of this specification is to provide a new energy power demand forecasting model construction method, forecasting method and device to solve the problem of low accuracy of new energy power demand forecasting in the prior art.
[0004] In order to solve the above technical problems, the specific technical solutions of the embodiments of this specification are as follows:
[0005] On the one hand, an embodiment of this specification provides a method for constructing a new energy power demand prediction model, the method comprising:
[0006] Acquire a multivariate historical time series data set, wherein the multivariate historical time series data set includes weather data, multi-subject market transaction logic data, and user power demand historical data;
[0007] Performing a stationary process on the time series data in the multivariate historical time series data set to obtain a stationary multivariate historical time series data set;
[0008] Construct a new energy power demand prediction model based on the destabilizing attention mechanism and Transformer;
[0009] The new energy electricity demand forecasting model is trained using the stationary multivariate historical time series data set to obtain a trained new energy electricity demand forecasting model.
[0010] Furthermore, the weather data includes temperature, wind speed, sunshine, precipitation and cloud coverage;
[0011] The multi-subject market transaction logic data includes price data of different energy types, output data of different energy types, market share data, market transaction volume data, power commitment data in power purchase agreements, and transaction model classification variable data;
[0012] The user power demand historical data includes historical power consumption, power consumption time distribution data, new energy power preference rate and new energy power price sensitivity.
[0013] Furthermore, the time series data in the multivariate historical time series data set is stabilized using the following formula:
[0014]
[0015] Among them, x i ′ represents the historical time series data after stabilization processing, x i represents historical time series data, σ x Represents the variance of historical time series data, μ x Represents the mean of historical time series data, and ⊙ represents the multiplication of elements at corresponding positions in the matrix.
[0016] Furthermore, after the time series data in the multivariate historical time series data set is stabilized, the method further includes:
[0017] Detect whether there are missing values in the multivariate historical time series data, and if so, use a grey prediction model to predict the missing values in the multivariate historical time series data to obtain predicted values, and replace the missing values with the predicted values to obtain first processed data;
[0018] The first processed data is split into univariate time series data of the number of variables, and each univariate time series data is divided into a number of data blocks to obtain preprocessed multivariate historical time series data.
[0019] Furthermore, the new energy power demand prediction model includes: an embedding layer, an encoder, a decoder and a denormalization layer; wherein:
[0020] The embedding layer is used to convert the stationary multivariate historical time series data into a stationary vector of fixed dimension;
[0021] The encoder includes a de-stationary attention sublayer, a multi-head attention sublayer and a fully connected layer, which are used to capture the semantic information of the stationary vector and convert the semantic information into a feature representation, wherein the de-stationary attention sublayer is used to extract non-stationary features in the stationary vector, the multi-head attention sublayer is used to extract semantic space information of different dimensions from the non-stationary features, and the fully connected layer is used to convert the semantic space information into a feature representation;
[0022] The decoder comprises an encoding-decoding attention layer and a forward propagation layer, which is used to generate an output sequence according to the feature representation, wherein the encoding-decoding attention layer is used to obtain the encoding information in the feature representation, and the forward propagation layer is used to decode the encoding information to generate an output sequence;
[0023] The denormalization layer is used to transform the output sequence to obtain a final prediction result.
[0024] Furthermore, the de-stationary attention layer includes a de-stationary attention mechanism, and the de-stationary attention mechanism is expressed by the following formula:
[0025]
[0026] Where Attention(Q′,K′,V′,τ,Δ) represents the destabilization attention of the input multivariate time series data, τ represents the first destabilization factor, Δ represents the second destabilization factor, Q′ represents the query vector, K′ represents the key vector of each element or position, V′ represents the actual content of each element or position in the sequence, and d k Represents the feature dimension.
[0027] Furthermore, the step of training the new energy power demand prediction model using the stationary multivariate historical time series data set includes:
[0028] Initializing the weights and bias values of the embedding layer, encoder, decoder and denormalization layer in the new energy power demand prediction model;
[0029] Propagate the stationary multivariate historical time series data backward along the embedding layer, and use the de-stationary attention mechanism to assign attention weights to non-stationary parts of the stationary multivariate historical time series data;
[0030] generating a weighted representation according to the attention weight, inputting the weighted representation into a decoder, and obtaining a predicted value of the new energy power demand;
[0031] Comparing the predicted value of the new energy power demand with the actual value to obtain a comparison result, and calculating the loss value according to the comparison result and a preset loss function;
[0032] Back-propagating the loss value using a back-propagation algorithm, and updating the weights and bias values of the embedding layer, encoder, decoder, and denormalization layer according to the loss value;
[0033] Repeat the above steps until the preset iteration termination condition is met to obtain a trained new energy power demand prediction model.
[0034] Furthermore, the preset loss function includes a loss function expressed by the following formula:
[0035]
[0036] Among them, Loss represents the loss function, c represents the number of samples, and y c represents the observed value of the sample, p c represents the natural logarithm of the sample, α represents the regularization parameter, and w i Represents the weight parameter in the model.
[0037] On the other hand, some embodiments of this specification also provide a new energy power demand forecasting model construction device, the device comprising:
[0038] An acquisition module is used to acquire a multivariate historical time series data set, wherein the multivariate historical time series data set includes weather data, multi-subject market logic data and user power demand historical data;
[0039] A stabilization module, used for performing stabilization processing on the time series data in the multivariate historical time series data set to obtain a stable multivariate historical time series data set;
[0040] Building a module for building a new energy power demand forecasting model based on the destabilizing attention mechanism and Transformer;
[0041] The training module is used to train the new energy power demand forecasting model using the stationary multivariable historical time series data set to obtain a trained new energy power demand forecasting model.
[0042] Based on the same inventive concept, some embodiments of this specification also provide a new energy power demand forecasting method, the method comprising:
[0043] Receive multivariate historical time series data for a specified period;
[0044] The multivariate historical time series data of the specified time period is input into the new energy power demand prediction model trained by the method described in any of the aforementioned embodiments to obtain the new energy power demand prediction result.
[0045] On the other hand, some embodiments of this specification also provide a new energy power demand forecasting device, the device comprising:
[0046] A receiving module, used for receiving multivariate historical time series data of a specified period;
[0047] The prediction module is used to input the multivariate historical time series data of the specified time period into the new energy power demand prediction model trained by the method described in any of the aforementioned embodiments to obtain the new energy power demand prediction result.
[0048] On the other hand, an embodiment of the present specification further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein when the computer program is executed by the processor, the instructions of any one of the above methods are executed.
[0049] On the other hand, an embodiment of the present specification further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor of a computer device, the computer program executes instructions of any one of the above-described methods.
[0050] On the other hand, the embodiments of this specification further provide a computer program product, which, when executed by a processor of a computer device, executes instructions of any one of the above methods.
[0051] One or more technical solutions provided by some embodiments of this specification have at least the following technical effects:
[0052] The embodiments of this specification comprehensively consider that the demand for new energy electricity is affected by multiple variable factors, use historical time series data sets containing multiple variables as training samples, and perform smoothing processing on the multivariate historical time series data to obtain a smoothed time series data set, so as to reduce the non-stationarity of the multivariate time series data, and provide a subsequent new energy electricity demand prediction model with a stable distribution of training samples, thereby improving the model's prediction performance for multivariate time series data. Afterwards, a new energy electricity demand prediction model is constructed based on the de-steady attention mechanism and Transformer, and the electricity demand prediction model is trained using the smoothed multivariate time series data set. The de-steady attention mechanism can automatically pay attention to the non-stationary features in the smooth time series data, ensuring that the model can recognize and process fluctuations and anomalies in the data, thereby improving the accuracy of the model prediction.
[0053] The above description is only an overview of the technical solutions of some embodiments of this specification. In order to more clearly understand the technical means of some embodiments of this specification, they can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiments of this specification more obvious and easy to understand, the following specifically cites the preferred embodiments and describes them in detail in conjunction with the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0055] Figure 1 A schematic diagram showing a process of constructing a new energy power demand prediction model in some embodiments of this specification;
[0056] Figure 2 A schematic diagram of a process for preprocessing the time series data in the multivariate historical time series data set in some embodiments of the present specification is shown;
[0057] Figure 3 It shows a schematic diagram of the structure of a new energy power demand prediction model in some embodiments of this specification;
[0058] Figure 4 A schematic diagram of a process for training the new energy power demand prediction model using the stable multivariate historical time series data set in some embodiments of this specification is shown;
[0059] Figure 5 A schematic diagram showing a flow chart of a new energy power demand prediction method in some embodiments of this specification;
[0060] Figure 6 A schematic diagram of the module structure of a new energy power demand prediction model building device in some embodiments of this specification is shown;
[0061] Figure 7 A schematic diagram of the module structure of a new energy power demand prediction device in some embodiments of this specification is shown;
[0062] Figure 8 A schematic diagram of the structure of a computer device in this specification is shown.
[0063] Description of the accompanying symbols:
[0064] 601. Get module;
[0065] 602, stabilization module;
[0066] 603, building blocks;
[0067] 604, training module;
[0068] 701, receiving module;
[0069] 702. prediction module;
[0070] 802. Computer equipment;
[0071] 804, processor;
[0072] 806. Memory;
[0073] 808, driving mechanism;
[0074] 810, input / output module;
[0075] 812. Input device;
[0076] 814. Output device;
[0077] 816. Presentation equipment;
[0078] 818. Graphical user interface;
[0079] 820, network interface;
[0080] 822, communication link;
[0081] 824. Communication bus. DETAILED DESCRIPTION
[0082] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0083] In order to solve the above problems, the embodiments of this specification provide a method for constructing a new energy electricity demand prediction model. Figure 1 It is a flow chart of a method for building a new energy power demand forecasting model provided in an embodiment of this specification. This specification provides method operation steps as described in the embodiment or flow chart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the system or device product is executed in practice, it can be executed in the order of the method shown in the embodiment or the accompanying drawings or in parallel.
[0084] It should be noted that the terms "first", "second", etc. in this specification and claims and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this specification described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0085] Reference Figure 1 As shown, the embodiment of this specification provides a method for constructing a new energy power demand prediction model, the method comprising:
[0086] S101: Acquire a multivariate historical time series data set, wherein the multivariate historical time series data set includes weather data, multi-subject market transaction logic data, and user power demand historical data;
[0087] S102: performing a stabilization process on the time series data in the multivariate historical time series data set to obtain a stabilization multivariate historical time series data set;
[0088] S103: Construct a new energy power demand prediction model based on destabilizing attention mechanism and Transformer;
[0089] S104: Using the stationary multivariable historical time series data set to train the new energy power demand forecasting model to obtain a trained new energy power demand forecasting model.
[0090] The embodiments of this specification comprehensively consider that the demand for new energy electricity is affected by multiple variable factors, use historical time series data sets containing multiple variables as training samples, and perform smoothing processing on the multivariate historical time series data to obtain a smoothed time series data set, so as to reduce the non-stationarity of the multivariate time series data, and provide a subsequent new energy electricity demand prediction model with a stable distribution of training samples, thereby improving the model's prediction performance for multivariate time series data. Afterwards, a new energy electricity demand prediction model is constructed based on the de-steady attention mechanism and Transformer, and the electricity demand prediction model is trained using the smoothed multivariate time series data set. The de-steady attention mechanism can automatically pay attention to the non-stationary features in the smooth time series data, ensuring that the model can recognize and process fluctuations and anomalies in the data, thereby improving the accuracy of the model prediction.
[0091] In some embodiments, weather data includes temperature, wind force, light, precipitation and cloud coverage, wherein temperature refers to the temperature of a certain area at a specific time. The temperature directly affects people's comfort and the frequency of use of power equipment such as air conditioners and heaters, thereby affecting electricity consumption. Wind force refers to the size of wind speed. Wind force is a key factor in wind power generation. The greater the wind speed, the higher the wind power generation. Light refers to the intensity and duration of sunshine in a certain area. The sunshine duration is usually measured in hours, and the light intensity can be quantified by the radiation measurement data of the photovoltaic power station. Light has a direct impact on the efficiency and output of solar power generation. Precipitation refers to the amount of water that falls to the ground within a certain period of time. Precipitation has an impact on the production capacity of hydropower generation, especially in areas where hydropower generation accounts for a large proportion. Cloud coverage indicates the degree to which the sky is covered by clouds. This factor affects the efficiency of solar power generation. Cloud cover can be quantified by satellite images or ground observation data.
[0092] The multi-subject market transaction logic data includes price data of different energy types, output data of different energy types, market share data, market transaction volume data, power commitment data in power purchase agreements, and transaction model classification variable data. The price of different energy types refers to the sales price of electricity of different energy types (such as wind energy, solar energy, hydropower, etc.) in the market, usually in units of kilowatt-hour (¥ / kWh), reflecting the economic value and supply and demand relationship of electricity. Output refers to the amount of electricity produced by the power generation entity within a certain period of time, usually in units of megawatt-hours (MWh). The output data reflects the production capacity and market supply of the power generation entity. Market share refers to the proportion of a power generation enterprise or power user in the entire market. The market share can reflect the competitive position and influence of the power generation enterprise or power user in the market. The transaction volume refers to the total amount of power transactions completed within a certain period of time, usually in units of megawatt-hours (MWh). The transaction volume data reflects the market's activity and liquidity. Power purchase agreements can be represented in a quantitative way, for example, by converting the power commitments in long-term power purchase agreements into time series data. These data can be expressed as the expected power for each agreement during the forecast period, usually in megawatt-hours (MWh). In addition, data such as the start and end dates and price terms in the agreement can also be used as features to input into the prediction model. Trading patterns can be represented by categorical variables, for example, centralized bidding and bilateral negotiations as two different category labels. In the model input, these categories can be encoded as numerical data (such as 0 and 1) so that the model can recognize and process them. If the trading pattern is continuous or sequential in time, it can be represented as time series data, for example, recording daily or weekly trading patterns and using them as one of the input features of the model. This method can help the model learn how trading patterns change over time.
[0093] The historical data of user electricity demand includes historical electricity consumption, electricity consumption time distribution data, new energy power preference rate and new energy electricity price sensitivity. The historical electricity consumption refers to the total electricity consumption of users in the past period of time, usually in kilowatt-hours (kWh). The historical electricity consumption data helps to analyze the user's electricity consumption patterns and trends. The electricity consumption time distribution data describes the distribution of users' electricity consumption within 24 hours a day, which can usually be expressed by hourly electricity consumption. The new energy power preference rate refers to the user's preference for renewable energy power, which can be quantified by the frequency and proportion of users' selection of green electricity products. The new energy power price sensitivity refers to the user's response to changes in electricity prices, which can be evaluated by analyzing the changes in user electricity consumption before and after the electricity price changes.
[0094] By using the above-mentioned multivariate historical time series data containing multiple factors as a training data set, the new energy electricity demand forecasting model trained based on the data set can be made more scientific and accurate. Since each variable has a large distribution difference in the time dimension, the multivariate historical time series data has a strong non-stationarity, which makes the model trained by the training set have poor effect on the test set. Therefore, in order to reduce the distribution difference of multivariate historical time series data in different time dimensions, the embodiment of this specification stabilizes the multivariate historical time series data before inputting the multivariate historical time series data into the new energy electricity demand forecasting model. In some embodiments, the time series data in the multivariate historical time series data set is stabilized using the following formula:
[0095]
[0096] Among them, x i ′ represents the historical time series data after stabilization processing, x i represents historical time series data, σ x Represents the variance of historical time series data, μ x Represents the mean of historical time series data, and ⊙ represents the multiplication of elements at corresponding positions in the matrix.
[0097] In some embodiments, reference Figure 2 , after the time series data in the multivariate historical time series data set is stabilized, the method further includes:
[0098] S201: Detect whether there are missing values in the multivariate historical time series data, and if so, use a grey prediction model to predict the missing values in the multivariate historical time series data to obtain predicted values, and replace the missing values with the predicted values to obtain first processed data;
[0099] S202: Split the first processed data into single-variable time series data of the number of variables, and divide each single-variable time series data into a number of data blocks to obtain pre-processed multivariate historical time series data.
[0100] By using the gray prediction model to model the historical time series data, the missing values and excessive deviation values in the historical time series data are replaced, thereby providing high-quality data support for subsequent model training. In some embodiments, the multivariate time series data can be split into univariate time series data of the number of variables using the channel independence method, and then each univariate time series data can be divided into multiple shorter sequences (patches) using the Patching process. If the length of the original univariate sequence is H and the size of each short sequence is S, the original univariate sequence is divided into P (where P = H / S) patches. Channel independence and patching can better extract the local features of the time series data, while greatly reducing the amount of calculation of the subsequent model.
[0101] In order to automatically learn the time series dependencies in historical time series data, so as to realize the prediction of future electricity demand, the Transformer model is selected as the basic model for electricity demand prediction in the embodiment of this specification. Transformer can capture long-term time series dependencies from historical time series data through the self-attention mechanism, so as to realize sequence prediction. Although the above-mentioned stabilization of time series data enhances the predictability of non-stationary data, after the time-varying distribution of the original time series data is degraded into a stationary distribution that does not change with time, the personalized information in the original time series data is also lost. At this time, the prediction model cannot capture the key time series dependencies associated with non-stationarity, resulting in different time series data having the same attention. The prediction model is more likely to produce overly stable output, which is obviously inconsistent with the natural non-stationarity of the original sequence. In order to enable the Transformer model to learn the inherent non-stationarity in stationary time series data, the embodiment of this specification adds a de-stationary attention mechanism based on the Transformer model. This attention mechanism can automatically pay attention to the non-stationary part of the stationary time series data. As the non-stationary characteristics of the time series data change, it can adaptively adjust its attention weight distribution to ensure that the model can always pay attention to the most important information. By combining the original information and attention weights in the original time series data, the de-stationary attention mechanism can generate a weighted representation, thereby better reflecting the non-stationary characteristics of the time series data, thereby improving the accuracy of model predictions.
[0102] In some embodiments, reference Figure 3As shown, the new energy power demand prediction model includes: an embedding layer, an encoder, a decoder and a denormalization layer, wherein the embedding layer is used to convert each patche into a stationary vector of fixed dimension. The encoder includes a destationary attention sublayer, a multi-head attention sublayer and a fully connected layer, which are used to capture the semantic information of the stationary vector and convert the semantic information into a feature representation, wherein the destationary attention sublayer is used to extract non-stationary features in the stationary vector, the multi-head attention sublayer is used to extract semantic space information of different dimensions from the non-stationary features, and the fully connected layer is used to convert the semantic space information into a feature representation.
[0103] In some embodiments, the de-stationary attention layer includes a de-stationary attention mechanism, and the de-stationary attention mechanism is represented by the following formula:
[0104]
[0105] Among them, Attention(Q′,K′,V′,τ,Δ) represents the destabilization attention of the input multivariate time series data, τ represents the first destabilization factor, Δ represents the second destabilization factor, Q′ represents the query vector, which represents the attention of the currently processed element or position to other elements, K′ represents the key vector of each element or position, which is used to interact with the query vector to determine the attention score, V′ represents the actual content of each element or position in the sequence, which will be weighted and summed according to the calculated attention score, d k The representation refers to the size of the query, key, and value vectors, i.e. the dimensionality of the features.
[0106] As can be seen from the above formula, the destabilization attention mechanism adjusts the time series dependency weights through the destabilization factor τ,Δ, where the destabilization factor τ,Δ is learned by the multi-layer perceptron from multivariate time series data.
[0107] In some embodiments, the multi-head attention sublayer includes a multi-head attention mechanism, which can be expressed by the following formula:
[0108] MultiHead(Q′,K′,V′)=Concat(head1,head2,…head h )W 0 ;
[0109]
[0110] Among them, head i represents the self-attention corresponding to the i-th patch, MultiHead(Q′,K′,V′) represents the self-attention of the input sequence, and W 0 represents the transformation matrix, represents the transformed query matrix, represents the transformed key matrix, represents the transformed value matrix, τ represents the first destabilization factor, and Δ represents the second destabilization factor.
[0111] The decoder comprises an encoding-decoding attention layer and a forward propagation layer, which is used to generate an output sequence according to the feature representation, wherein the encoding-decoding attention layer is used to obtain the encoding information in the feature representation, and the forward propagation layer is used to decode the encoding information to generate an output sequence;
[0112] The denormalization layer is used to transform the output sequence to obtain the final prediction result. Specifically, the output sequence can be transformed using the following formula:
[0113] y′=H(x′);
[0114]
[0115] Where y′ represents the intermediate variable of the normalized processing sequence, x′ represents the input matrix, H(·) represents the transformation function, represents the output result, σ x Represents the variance of historical time series data, μ x Represents the mean of historical time series data, and ⊙ represents the multiplication of elements at corresponding positions in the matrix.
[0116] In some embodiments, reference Figure 4 , the step of training the new energy electricity demand prediction model using the stationary multivariate historical time series data set includes:
[0117] S401: Initializing the weights and bias values of the embedding layer, encoder, decoder and denormalization layer in the new energy power demand prediction model.
[0118] In this step, the parameters of each network layer in the model can be initialized by random initialization method.
[0119] S402: propagate the stationary multivariate historical time series data backward along the embedding layer, and use the de-stationary attention mechanism to assign attention weights to the non-stationary parts of the stationary multivariate historical time series data.
[0120] The stationary multivariate historical time series data passes through each layer in the prediction model, and the non-stationary parts of the time series data are given corresponding attention weights through the de-stationary attention mechanism and the multi-head self-attention mechanism, and higher weights are given to the key parts.
[0121] S403: Generate a weighted representation according to the attention weight, input the weighted representation into a decoder, and obtain a power demand prediction value.
[0122] The weighted representation is input into the decoder and forwarded along each network layer in the decoder. The feature information from the weighted representation in the encoder is extracted through the encoder-decoder attention layer, and then the feature information is decoded to generate an output sequence to obtain the prediction result.
[0123] S404: Compare the power demand prediction value with the actual value to obtain a comparison result, and calculate a loss value according to the comparison result and a preset loss function.
[0124] In some embodiments, the preset loss function includes a loss function expressed by the following formula:
[0125]
[0126] Among them, Loss represents the loss function, c represents the number of samples, and y c Represents the observed value of the sample, table p c represents the natural logarithm of the sample, α represents the regularization parameter, and w i Represents the weight parameter in the model.
[0127] S405: Back-propagating the loss value using a back-propagation algorithm, and updating the weights and bias values of the embedding layer, encoder, decoder, and denormalization layer according to the loss value.
[0128] During the back-propagation process, the Adam optimizer can be used to optimize the model parameters. Starting from the denormalization layer, the Adam optimizer is used to calculate the gradient layer by layer, thereby updating the network parameters of each layer so that the model can better fit the true value, thereby improving the prediction accuracy of the prediction model.
[0129] S406: Repeat the above steps until a preset iteration termination condition is met to obtain a trained new energy power demand prediction model.
[0130] Based on the same inventive concept, Figure 5 In some embodiments, the new energy power demand forecasting method may include:
[0131] S501: Receive multivariate historical time series data for a specified period;
[0132] S502: Input the multivariate historical time series data of the specified time period into a new energy power demand prediction model trained by the method described in any of the aforementioned embodiments to obtain a new energy power demand prediction result.
[0133] It can be understood that in some embodiments, when the new energy electricity demand value of a target area in the future period is needed, it is only necessary to obtain the multivariable historical time series data of the target area, and then input the data into the new energy electricity demand prediction model trained by the method described in any of the aforementioned embodiments, so as to obtain the new energy electricity demand prediction value of the target area in the future period with high prediction accuracy.
[0134] Based on the above-mentioned method for constructing a new energy power demand forecasting model, the embodiment of this specification also provides a new energy power demand forecasting model construction device. The device may include a system (including a distributed system), software (application), module, component, server, client, etc. using the method described in the embodiment of this specification and a device combined with necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiment of this specification is as described in the following embodiments. Since the implementation scheme and method of the device to solve the problem are similar, the implementation of the specific device in the embodiment of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0135] Specifically, Figure 6 This is a schematic diagram of the module structure of an embodiment of a new energy power demand prediction model construction device provided in the embodiment of this specification, referring to Figure 6 As shown, a new energy power demand prediction model building device provided in an embodiment of this specification includes:
[0136] An acquisition module 601 is used to acquire a multivariate historical time series data set, wherein the multivariate historical time series data set includes weather data, multi-agent market logic data, and user power demand historical data;
[0137] A stabilization module 602 is used to perform stabilization processing on the time series data in the multivariate historical time series data set to obtain a stable multivariate historical time series data set;
[0138] Building module 603, used to build a new energy power demand prediction model based on the destabilization attention mechanism and Transformer;
[0139] The training module 604 is used to train the new energy power demand prediction model using the stationary multivariate historical time series data set to obtain a trained new energy power demand prediction model.
[0140] The beneficial effects obtained by the device provided in the embodiments of this specification are consistent with the beneficial effects obtained by the above method and will not be repeated here.
[0141] Based on the same inventive concept, corresponding to the above-mentioned new energy power demand prediction method, some embodiments of this specification also provide a new energy power demand prediction device, referring to Figure 7 As shown, in some embodiments, the apparatus may include:
[0142] A receiving module 701 is used to receive multivariate historical time series data of a specified period;
[0143] The prediction module 702 is used to input the multivariate historical time series data of the specified time period into the new energy power demand prediction model trained by the method described in any of the above embodiments to obtain the new energy power demand prediction result.
[0144] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. And the acquisition, storage, use, and processing of data in the technical solutions described in the embodiments of this application are in compliance with relevant regulations.
[0145] The embodiment of this specification also provides a computer device 802. Figure 8 As shown, in some embodiments of the present specification, the computer device 802 may include one or more processors 804, such as one or more central processing units (CPUs), each of which may implement one or more hardware threads. The computer device 802 may also include any memory 806, which is used to store any kind of information such as code, settings, data, etc. Non-limiting, for example, the memory 806 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory may use any technology to store information. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent a fixed or removable component of the computer device 802. In one case, when the processor 804 executes an associated instruction stored in any memory or a combination of memories, the computer device 802 may perform any operation of the associated instruction. The computer device 802 also includes one or more drive mechanisms 808 for interacting with any memory, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.
[0146] The computer device 802 may also include an input / output module 810 (I / O) for receiving various inputs (via input devices 812) and for providing various outputs (via output devices 814). A specific output mechanism may include a presentation device 816 and an associated graphical user interface (GUI) 818. In other embodiments, the input / output module 810 (I / O), the input device 812, and the output device 814 may not be included, and the computer device 802 may be used as a computer device in a network. The computer device 802 may also include one or more network interfaces 820 for exchanging data with other devices via one or more communication links 822. One or more communication buses 824 couple the components described above together.
[0147] The communication link 822 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 822 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.
[0148] Corresponding to Figures 1 to 5 In addition to the method shown, an embodiment of the specification also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are executed.
[0149] The embodiment of the present specification also provides a computer-readable instruction, wherein when the processor executes the instruction, the program therein causes the processor to execute the following Figures 1 to 5 The method shown.
[0150] The embodiments of the present specification also provide a computer program product, including at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the following Figures 1 to 5 The method shown.
[0151] It should be understood that in the various embodiments of this specification, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this specification.
[0152] It should also be understood that in the embodiments of this specification, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this specification generally indicates that the associated objects before and after are in an "or" relationship.
[0153] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this specification can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this specification.
[0154] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0155] In the several embodiments provided in this specification, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.
[0156] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this specification.
[0157] In addition, each functional unit in each embodiment of this specification may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0158] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this specification is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0159] Specific embodiments are used in this specification to illustrate the principles and implementation methods of this specification. The description of the above embodiments is only used to help understand the methods and core ideas of this specification. At the same time, for those skilled in the art, according to the ideas of this specification, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on this specification.
Claims
1. A method for constructing a new energy power demand prediction model, characterized in that: The method comprises: Acquire a multivariate historical time series data set, wherein the multivariate historical time series data set includes weather data, multi-subject market transaction logic data, and user power demand historical data; Performing a stationary process on the time series data in the multivariate historical time series data set to obtain a stationary multivariate historical time series data set; Construct a new energy power demand prediction model based on the destabilizing attention mechanism and Transformer; The new energy electricity demand forecasting model is trained using the stationary multivariate historical time series data set to obtain a trained new energy electricity demand forecasting model.
2. The method according to claim 1, characterized in that The weather data includes temperature, wind speed, sunshine, precipitation and cloud coverage; The multi-subject market transaction logic data includes price data of different energy types, output data of different energy types, market share data, market transaction volume data, power commitment data in power purchase agreements, and transaction model classification variable data; The user power demand historical data includes historical power consumption, power consumption time distribution data, new energy power preference rate and new energy power price sensitivity.
3. The method according to claim 1, characterized in that: The time series data in the multivariate historical time series data set is stabilized using the following formula: Among them, x i ′ represents the historical time series data after stabilization processing, x i represents historical time series data, σ x Represents the variance of historical time series data, μ x Represents the mean of historical time series data, and ⊙ represents the multiplication of elements at corresponding positions in the matrix.
4. The method according to claim 1, characterized in that: After the time series data in the multivariate historical time series data set is stabilized, the method further includes: Detect whether there are missing values in the multivariate historical time series data, and if so, use a grey prediction model to predict the missing values in the multivariate historical time series data to obtain predicted values, and replace the missing values with the predicted values to obtain first processed data; The first processed data is split into univariate time series data of the number of variables, and each univariate time series data is divided into a number of data blocks to obtain preprocessed multivariate historical time series data.
5. The method according to claim 1, characterized in that The new energy power demand prediction model includes: an embedding layer, an encoder, a decoder and a denormalization layer; wherein The embedding layer is used to convert the stationary multivariate historical time series data into a stationary vector of fixed dimension; The encoder includes a de-stationary attention sublayer, a multi-head attention sublayer and a fully connected layer, which are used to capture the semantic information of the stationary vector and convert the semantic information into a feature representation, wherein the de-stationary attention sublayer is used to extract non-stationary features in the stationary vector, the multi-head attention sublayer is used to extract semantic space information of different dimensions from the non-stationary features, and the fully connected layer is used to convert the semantic space information into a feature representation; The decoder comprises an encoding-decoding attention layer and a forward propagation layer, which is used to generate an output sequence according to the feature representation, wherein the encoding-decoding attention layer is used to obtain the encoding information in the feature representation, and the forward propagation layer is used to decode the encoding information to generate an output sequence; The denormalization layer is used to transform the output sequence to obtain a final prediction result.
6. The method according to claim 5, characterized in that The destabilizing attention layer includes a destabilizing attention mechanism, which is expressed by the following formula: Where Attention(Q′,K′,V′,τ,Δ) represents the destabilization attention of the input multivariate time series data, τ represents the first destabilization factor, Δ represents the second destabilization factor, Q′ represents the query vector, K′ represents the key vector of each element or position, V′ represents the actual content of each element or position in the sequence, and d k Represents the feature dimension.
7. The method according to claim 1, characterized in that The step of training the new energy power demand prediction model by using the stable multivariate historical time series data set includes: Initializing the weights and bias values of the embedding layer, encoder, decoder and denormalization layer in the new energy power demand prediction model; Propagate the stationary multivariate historical time series data backward along the embedding layer, and use the de-stationary attention mechanism to assign attention weights to non-stationary parts of the stationary multivariate historical time series data; generating a weighted representation according to the attention weight, inputting the weighted representation into a decoder, and obtaining a predicted value of the new energy power demand; Comparing the predicted value of the new energy power demand with the actual value to obtain a comparison result, and calculating the loss value according to the comparison result and a preset loss function; Back-propagating the loss value using a back-propagation algorithm, and updating the weights and bias values of the embedding layer, encoder, decoder, and denormalization layer according to the loss value; Repeat the above steps until the preset iteration termination condition is met to obtain a trained new energy power demand prediction model.
8. The method according to claim 7, characterized in that The preset loss function includes a loss function expressed by the following formula: Among them, Loss represents the loss function, c represents the number of samples, and y c represents the observed value of the sample, p c represents the natural logarithm of the sample, α represents the regularization parameter, and w i Represents the weight parameter in the model.
9. A method for predicting new energy power demand, characterized in that: The method comprises: Receive multivariate historical time series data for a specified period; The multivariate historical time series data of the specified time period is input into the new energy electricity demand forecasting model trained by the method described in any one of claims 1-8 to obtain the new energy electricity demand forecasting result.
10. A device for constructing a new energy power demand prediction model, characterized in that: The device comprises: An acquisition module is used to acquire a multivariate historical time series data set, wherein the multivariate historical time series data set includes weather data, multi-subject market logic data and user power demand historical data; A stabilization module, used for performing stabilization processing on the time series data in the multivariate historical time series data set to obtain a stable multivariate historical time series data set; Building a module for building a new energy power demand forecasting model based on the destabilizing attention mechanism and Transformer; The training module is used to train the new energy power demand forecasting model using the stationary multivariable historical time series data set to obtain a trained new energy power demand forecasting model.
11. A new energy power demand forecasting device, characterized in that: The device comprises: A receiving module, used for receiving multivariate historical time series data of a specified period; A prediction module is used to input the multivariate historical time series data of the specified time period into the new energy power demand prediction model trained by the method described in any one of claims 1-8 to obtain the new energy power demand prediction result.
12. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
14. A computer program product, characterized in that The method comprises at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the method according to any one of claims 1 to 9.
Citation Information
Cited By
5G network green energy routing optimization method and system, and storage medium
CN119743812A
Intelligent energy management method, device and equipment and storage medium
CN120373522A
Energy intelligent management method, device and equipment, and storage medium
CN120373522B
