Multi-scale power load forecasting method, device, equipment and storage medium

Through variational modal decomposition and fast Fourier transform extraction significant periods, combined with Transformer model, multi-scale power load prediction is solved, and the problem of fixed patch size cannot capture short-term and long-term characteristics is achieved, achieving higher prediction accuracy.

CN119066491BActive Publication Date: 2025-08-15XIAN UNIV OF SCI & TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411106409.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2025-08-15
Estimated Expiration
2044-08-13

AI Technical Summary

Technical Problem

When the real-world power load sequences show changes and fluctuations on different time scales, fixed-size patches cannot capture both short-term and long-term multi-scale features, resulting in insufficient accuracy of existing load prediction methods.

Method used

Variational modal decomposition technology is used to extract significant periods in combination with fast Fourier transform, multi-scale segmentation of time series is performed through significant periods, and prediction processing is performed based on the Transformer model, and finally, features of different scales are fused through weighting summing.

Benefits of technology

It significantly improves the accuracy of power load prediction, can capture both short-term and long-term multi-scale features, and improves the accuracy of prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066491B_ABST
    Figure CN119066491B_ABST
Patent Text Reader

Abstract

The multi-scale power load forecasting method, device, equipment and storage medium provided by this application specifically relate to the field of power load forecasting technology. This method uses variational mode decomposition technology combined with fast Fourier transform to extract significant cycles, ensuring that key periodic features in the data are captured. The detected significant cycles are used as patch lengths to segment the input time series into different patch scales to simultaneously process short-term and long-term load changes. The time series of different scales are predicted and processed based on the Transformer model, making full use of the contextual information in the time series. Finally, the features of multiple scales are fused through weighted summation to obtain the final power load forecast result. This solves the problem that a fixed-size patch may not be able to simultaneously capture short-term and long-term multi-scale features when the real-world power load series shows changes and fluctuations at different time scales, thereby significantly improving the accuracy of power load forecasting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power load forecasting, and in particular to a multi-scale power load forecasting method, apparatus, device and storage medium. Background Art

[0002] In recent years, with the acceleration of economic development and urbanization, electricity demand has fluctuated frequently. Accurate forecasting can optimize grid operation, rationalize power generation planning, ensure reliable and economical power supply, and promote the integration of renewable energy and the operation of the electricity market. However, load forecasting is extremely challenging due to the non-stationary and nonlinear characteristics of power load series.

[0003] Existing deep learning-based load forecasting methods, represented by the Transformer model, have been widely used. Their self-attention mechanism can capture long-term dependencies in time series and automatically learn the relationships between elements in the sequence. They have excellent processing capabilities for nonlinear data and high prediction accuracy. However, the information revealed by a single time step is limited, and standard dot-product attention may ignore local patterns and mistakenly emphasize similarities between different time steps. PatchTST introduces the concept of patches (blocks) in image processing to time series forecasting. By presetting the patch length, the time series is divided into multiple blocks, each containing information from multiple time steps. This method can effectively capture local time series features while inheriting the advantages of the Transformer model. However, real-world power load series exhibit changes and fluctuations at different time scales, and fixed-size patches may not be able to simultaneously capture short-term and long-term multi-scale features.

[0004] In summary, when real-world power load series show changes and fluctuations at different time scales, fixed-size patches may not be able to capture both short-term and long-term multi-scale characteristics, which is a problem that this application needs to solve. Summary of the Invention

[0005] The main purpose of the present invention is to provide a multi-scale power load forecasting method, device, equipment and storage medium to solve the problem that when the real-world power load series shows changes and fluctuations on different time scales, a fixed-size patch may not be able to simultaneously capture the short-term and long-term multi-scale characteristics, thereby achieving the effect that when the real-world power load series shows changes and fluctuations on different time scales, multiple groups of patches of different sizes can simultaneously capture the short-term and long-term multi-scale characteristics.

[0006] In order to achieve the above objectives, the present invention provides a multi-scale power load forecasting method, thereby significantly improving the accuracy of power load forecasting.

[0007] In a first aspect, the present invention provides a multi-scale power load forecasting method, which is applied to a power load forecasting system. The method comprises:

[0008] Using variational mode decomposition, the original power load data is decomposed into K eigenmode component sequences, where K>1;

[0009] Extracting the main frequency of each of the intrinsic mode component sequences using fast Fourier transform, calculating the corresponding period based on the main frequency, and screening out significant periods;

[0010] Using the significant period as the patch length, the input time series is segmented by the patch length to obtain time series of different scales;

[0011] The time series of different scales are predicted based on the Transformer model, and the obtained results are weighted and summed to obtain the final prediction result.

[0012] Optionally, the method of using variational mode decomposition to decompose the original power load data into K eigenmode component sequences includes the following steps:

[0013] Step A101: Initialize the center frequency, mode function, Lagrange multiplier and maximum number of iterations;

[0014] Step A102: Decomposing the time series of different scales into k modal functions by Lagrangian function, so that each modal function has a minimum frequency bandwidth;

[0015] Step A103: solving the optimization problem by using the alternating direction multiplier method, and updating the modal function and the center frequency;

[0016] Step A104: updating the Lagrange multiplier so that the optimization problem gradually approaches the optimal solution;

[0017] Step A105: Repeat the updating process in steps A103 and A104 until a preset convergence condition or the maximum number of iterations is reached, and then output the final intrinsic mode component sequence.

[0018] Optionally, extracting the main frequency of each of the intrinsic mode component sequences by using fast Fourier transform, calculating the corresponding period according to the main frequency, and screening out significant periods includes:

[0019] Performing fast Fourier transform on the K intrinsic mode component sequences to obtain frequency domain signals;

[0020] Calculate the frequency components corresponding to the frequency domain signal and find the index of the frequency component with the largest amplitude in the spectrum;

[0021] The period can be obtained by calculating the length of each eigenmode component sequence and dividing it by the index, and the values whose periods are greater than the length of the eigenmode component sequence or less than 2 are removed to obtain the significant period.

[0022] Optionally, using the significant period as the patch length and segmenting the input time series by the patch length to obtain time series of different scales includes:

[0023] Split the input time series into interleaved patches of length P, and separate the isolated regions of continuous patches with length S;

[0024] The last load value of the time series is copied S times and appended to the end of the time series, and divided into N patches, thereby forming the time series of different scales.

[0025] Optionally, the predicting process of the time series of different scales based on the Transformer model and weighted summing the obtained results to obtain a final prediction result includes:

[0026] Build a Transformer model consisting of an encoder block and a linear prediction head decoder block;

[0027] Independently inputting the feature vector sequences corresponding to the time series of different scales into the encoding block for feature encoding, and outputting the hidden state features of the encoder block;

[0028] Inputting the hidden state features into the linear prediction head decoder block for feature decoding, and outputting prediction results of different scales;

[0029] The prediction results of different scales are weighted and summed to obtain the final prediction result.

[0030] Optionally, the step of independently inputting the feature vector sequences corresponding to the time series at different scales into an encoding block for feature encoding, and outputting the hidden state features of the encoder block, comprises:

[0031] Performing position encoding on the input time series of different scales to obtain position encoding features;

[0032] The position encoding feature is processed to obtain the hidden state feature.

[0033] Optionally, performing weighted summation on the prediction results of different scales to obtain a final prediction result includes:

[0034] Determining the number of the significant periods as the number of weights, and determining each weight according to the length of the significant period;

[0035] The number of the significant cycles is determined as the number of prediction results of the different scales, and the final prediction result is obtained according to the weight corresponding to each prediction result of the different scales.

[0036] In a second aspect, the present invention provides a multi-scale power load forecasting device, which is applied to a power load forecasting system, and the device includes:

[0037] A processing module, configured to decompose the original power load data into K intrinsic mode component sequences using variational mode decomposition, where K>1;

[0038] a screening module, configured to extract the main frequency of each of the intrinsic mode component sequences using a fast Fourier transform, calculate the corresponding period based on the main frequency, and screen out significant periods;

[0039] The processing module is further configured to use the significant period as a patch length to segment the input time series by the patch length to obtain time series of different scales;

[0040] The prediction module is used to perform prediction processing on the time series of different scales based on the Transformer model, and perform weighted summation of the obtained results to obtain the final prediction result.

[0041] Optionally, the device further includes: an updating module.

[0042] The processing module is specifically used for step A101: initializing the center frequency, mode function, Lagrange multiplier and maximum number of iterations; step A102: decomposing the time series of different scales into K mode functions by Lagrange function, so that each mode function has the minimum bandwidth;

[0043] The update module is used for step A103: solving the optimization problem by the alternating direction multiplier method and updating the modal function and the center frequency; step A104: updating the Lagrange multiplier so that the optimization problem gradually approaches the optimal solution; step A105: repeating the update process in steps A103 and A104 until the preset convergence condition or the maximum number of iterations is reached, and then outputting the final intrinsic mode component sequence.

[0044] Optionally, the processing module is specifically configured to perform fast Fourier transform on each of the K intrinsic mode component sequences to obtain a frequency domain signal; calculate the frequency components corresponding to the frequency domain signal, and find the index of the frequency component with the largest amplitude in the spectrum; and calculate the length of each intrinsic mode component sequence and divide it by the index to obtain the period;

[0045] The screening module is specifically used to remove the period that is greater than the length of the eigenmode component sequence or less than 2, to obtain a significant period.

[0046] Optionally, the processing module is specifically used to divide the input time series into patches of length P that are interlaced with each other, and the length of the isolated area separating continuous patches is S; copy the last load value of the time series S times and append it to the end of the time series, dividing it into N patches, thereby forming the time series of different scales.

[0047] Optionally, the processing module is specifically configured to construct a Transformer model including an encoder block and a linear prediction head decoder block; independently input the feature vector sequences corresponding to the time series of different scales into the encoding block for feature encoding, and output the hidden state features of the encoder block;

[0048] The prediction module is specifically used to input the hidden state features into the linear prediction head decoder block for feature decoding, and output prediction results of different scales; and perform weighted summation on the prediction results of different scales to obtain a final prediction result.

[0049] Optionally, the processing module is specifically configured to perform position encoding on the input time series of different scales to obtain position encoding features; and process the position encoding features to obtain the hidden state features.

[0050] Optionally, the processing module is specifically configured to determine the number of the significant periods as the number of weights, and determine each weight according to the length of the significant period;

[0051] The prediction module is specifically configured to determine the number of significant cycles as the number of prediction results at different scales, and obtain the final prediction result according to the weight corresponding to each prediction result at different scales.

[0052] In a third aspect, the present invention provides a multi-scale power load forecasting device, the device comprising:

[0053] Memory;

[0054] processor;

[0055] wherein the memory stores computer-executable instructions;

[0056] The processor executes the computer-executable instructions stored in the memory to implement the above first aspect and / or various possible implementations of the first aspect.

[0057] In a fourth aspect, the present application provides a computer storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the above first aspect and / or various possible implementations of the first aspect.

[0058] The multi-scale power load forecasting method, device, equipment and storage medium provided by the present application utilize variational mode decomposition technology combined with fast Fourier transform to extract significant cycles, ensure that key periodic features in the data are captured, use the detected significant cycles as the patch length, and segment the input time series into different patch scales to simultaneously process short-term and long-term load changes. Based on the Transformer model, the time series of different scales are predicted and processed, making full use of the contextual information in the time series. Finally, the features of multiple scales are fused by weighted summation to obtain the final power load forecasting result. This method solves the problem that when the real-world power load series shows changes and fluctuations at different time scales, a fixed-size patch may not be able to capture short-term and long-term multi-scale features at the same time, thereby significantly improving the accuracy of power load forecasting. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are intended to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:

[0060] Figure 1 Schematic diagram of the process of multi-scale power load forecasting method provided in this application Figure 1 ;

[0061] Figure 2 Schematic diagram of the process of multi-scale power load forecasting method provided in this application Figure 2 ;

[0062] Figure 3 Schematic diagram of the process of multi-scale power load forecasting method provided in this application Figure 3 ;

[0063] Figure 4 Schematic diagram of the process of multi-scale power load forecasting method provided in this application Figure 4 ;

[0064] Figure 5 A schematic diagram of the structure of the multi-scale power load forecasting device provided in this application;

[0065] Figure 6 This is a schematic diagram of the structure of the multi-scale power load forecasting device provided in this application.

[0066] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0067] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions in this application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0068] The terms "first," "second," "third," "fourth," and so forth (if any) in the description and claims of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in sequences other than those illustrated or described herein.

[0069] In the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0070] In recent years, with the acceleration of economic development and urbanization, electricity demand has fluctuated frequently. Accurate forecasting can optimize grid operation, rationally arrange power generation plans, ensure reliable and economical power supply, and promote the integration of renewable energy and the operation of the power market. Therefore, the main goal of power load forecasting is to accurately estimate the load demand of the power system within a certain time frame in the future. However, the non-stationary and nonlinear characteristics of power load series make load forecasting extremely challenging.

[0071] Most current power load forecasting architectures, such as recurrent neural networks and long short-term memory networks, are inadequate at capturing complex long-range dependencies and contextual information. Existing deep learning-based load forecasting methods, represented by the Transformer model, have been widely used. Their self-attention mechanism can capture long-term dependencies in time series and automatically learn relationships between elements within the sequence, offering excellent handling of nonlinear data and high prediction accuracy. However, a single time step reveals limited information, and standard dot-product attention can overlook local patterns and mistakenly emphasize similarities across time steps. PatchTST introduces the concept of patches from image processing to time series forecasting. By presetting the patch length, the time series is segmented into multiple patches, each containing information from multiple time steps. This approach effectively captures local time series features while inheriting the advantages of the Transformer model. However, real-world power load series exhibit variations and fluctuations at different time scales, and fixed-size patches may not be able to simultaneously capture multi-scale features, both short-term and long-term.

[0072] To address the above issues, when real-world power load sequences show changes and fluctuations at different time scales, fixed-size patches may not be able to simultaneously capture short-term and long-term multi-scale features, which is a problem that this application needs to solve.

[0073] The multi-scale power load forecasting method provided by this application uses variational mode decomposition technology combined with fast Fourier transform to extract significant cycles, ensuring that the key periodic features in the data are captured, using the detected significant cycles as the patch length, and segmenting the input time series into different patch scales to simultaneously process short-term and long-term load changes. Based on the Transformer model, time series of different scales are predicted and processed, making full use of the contextual information in the time series, and finally, the features of multiple scales are fused by weighted summation to obtain the final power load forecasting result. This method solves the problem that when the real-world power load series shows changes and fluctuations at different time scales, a fixed-size patch may not be able to capture short-term and long-term multi-scale features at the same time, thereby significantly improving the accuracy of power load forecasting.

[0074] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0075] Figure 1Schematic diagram of the process of multi-scale power load forecasting method provided in this application Figure 1 , the execution subject of this embodiment is the power load forecasting system, such as Figure 1 As shown, the multi-scale power load forecasting method provided by this embodiment includes:

[0076] S101: Using variational mode decomposition, decompose the original power load data into K intrinsic mode component sequences.

[0077] Among them, the decomposition process of variational mode decomposition is divided into the following six steps.

[0078] Step 1: Initialize the center frequency and each mode function u k , Lagrange multiplier λ and maximum number of iterations N;

[0079] Step 2: Construct a Lagrangian function to handle the constrained optimization problem. The goal is to decompose the time series f(t) of different scales into K modal functions, so that each modal function has the minimum bandwidth;

[0080] Step 3: Solve the optimization problem using the Alternating Direction Method of Multipliers (ADMM) and update the mode functions and center frequencies accordingly.

[0081] Step 4: Update the Lagrange multiplier λ to gradually approach the optimal solution;

[0082] Step 5: Repeat step 3 and each updating process in step 3 until the preset convergence condition or the maximum number of iterations N is reached; Step 6: Output the final eigenmode component sequence.

[0083] The purpose of this step is to use variational mode decomposition technology to prepare basic data for the next step of extracting significant cycles in combination with fast Fourier transform, where the basic data refers to K eigenmode component sequences.

[0084] S102: extracting the main frequency of each of the intrinsic mode component sequences by using fast Fourier transform, calculating the corresponding period according to the main frequency, and screening out significant periods.

[0085] Among them, the method of using fast Fourier transform to extract the main frequency of each of the intrinsic mode component sequences is: first, each of the intrinsic mode component sequences is subjected to fast Fourier transform to obtain a frequency domain signal, and then the corresponding frequency components are calculated, and the main frequency can be found by finding the index of the frequency component with the largest amplitude in the spectrum.

[0086] The method of screening out significant cycles is: first, the length of the intrinsic mode component sequence is calculated and divided by the index of the frequency to obtain the cycle, and the values of infinite or too small cycles are removed to obtain the significant cycles.

[0087] The purpose of this step is to ensure that the key periodic features in the original power load data are captured.

[0088] S103: Using the significant period as a patch length, the input time series is segmented into the patch length to obtain time series of different scales.

[0089] The step of dividing the input time series into the patch length and obtaining time series of different scales is:

[0090] Step 1: Split the input time series into interleaved patches, where the patch length is P and the length of the isolated region separating consecutive patches is S;

[0091] Step 2: Add S copies of the last value at the end of the time series to avoid missing data during segmentation, and segment to form N patches;

[0092] Step 3: Repeat steps 1 and 2 for each scale patch to form time series of different scales.

[0093] The purpose of this step is to simultaneously process short-term and long-term load changes by dividing the input time series into the patch length.

[0094] S104: Prediction processing is performed on the time series of different scales based on the Transformer model, and the obtained results are weighted and summed to obtain a final prediction result.

[0095] The step of performing prediction processing on the time series of different scales based on the Transformer model is:

[0096] Step 1: Build a Transformer model consisting of an encoder block and a linear prediction head decoder block;

[0097] Step 2: The feature vector sequences corresponding to the time series data segmented at different scales are independently input into the encoding block for feature encoding, and the hidden state features of the encoder block are output;

[0098] Step 3: Input the hidden state features of the encoder block into the linear prediction head decoder block for feature decoding, and output the prediction results of different scales;

[0099] Step 4: Perform weighted summation on the prediction results obtained by each decoder block to obtain the final prediction result.

[0100] This step finally performs forecasting processing on the time series of different scales based on the Transformer model, and performs weighted summation of the obtained results to obtain the final forecast result. This not only solves the shortcomings of traditional methods in period extraction and multi-scale analysis, but also significantly improves the accuracy of power load forecasting.

[0101] The multi-scale power load forecasting method provided in the embodiment of the present application utilizes variational mode decomposition technology combined with fast Fourier transform to extract significant cycles, ensuring that key periodic features in the data are captured, using the detected significant cycles as the patch length, and segmenting the input time series into different patch scales to simultaneously process short-term and long-term load changes. The time series of different scales are predicted and processed based on the Transformer model, making full use of the contextual information in the time series, and finally fusing the features of multiple scales through weighted summation to obtain the final power load forecasting result. This method solves the problem that when the real-world power load series shows changes and fluctuations at different time scales, a fixed-size patch may not be able to capture short-term and long-term multi-scale features at the same time, thereby significantly improving the accuracy of power load forecasting.

[0102] Figure 2 Schematic diagram of the process of multi-scale power load forecasting method provided in this application Figure 2 ,like Figure 2 As shown, this embodiment Figure 1 Based on the embodiment, the multi-scale power load forecasting method is described in detail. Figure 2 As shown, the multi-scale power load forecasting method provided by this embodiment includes:

[0103] S201: Initialize the center frequency, mode function, Lagrange multiplier and maximum number of iterations.

[0104] The center frequency is ω k Indicates that each modal function is represented by u k Denote the Lagrange multiplier with λ and the maximum number of iterations with N, and initialize ω k 、u k ,λ,N can use the initialization tool, or the initialization process can be completed by a computer program according to actual needs.

[0105] S202: Decomposing the time series of different scales into K modal functions by Lagrangian functions, so that each modal function has a minimum bandwidth.

[0106] The method of decomposing time series of different scales into K modal functions using Lagrangian functions is to construct a Lagrangian function to handle a constrained optimization problem. The goal is to decompose the time series of different scales f(t) into K modal functions such that each modal function has the minimum bandwidth. The optimization problem is expressed as the following formula:

[0107]

[0108] Where α is the smoothing parameter, represents the time derivative, j is the imaginary unit, δ(t) is the Dirac function, λ(t) is the Lagrange multiplier, ω k is the center frequency, u k is the mode function, λ is the Lagrange multiplier, N is the maximum number of iterations, and f(t) is the time series of different scales.

[0109] S203: Solve the optimization problem by using the alternating direction multiplier method, and update the modal function and center frequency.

[0110] The process of solving the optimization problem by the alternating direction multiplier method and updating the modal function and center frequency accordingly can be defined by the following formula:

[0111]

[0112]

[0113] Among them, ω k is the center frequency, u k is the mode function, λ is the Lagrange multiplier, and α is the smoothing parameter.

[0114] S204: Update the Lagrange multiplier so that the optimization problem gradually approaches the optimal solution.

[0115] The method of updating the Lagrange multiplier so that the optimization problem gradually approaches the optimal solution can be defined by the following formula:

[0116]

[0117] Where τ is the step size parameter, λ(t) is the Lagrange multiplier, f(t) is the signal, and u k is a modal function.

[0118] S205: Repeat the updating process in steps S203 and S204 until a preset convergence condition or a maximum number of iterations is reached, and then output the final intrinsic mode component sequence.

[0119] The condition until a preset convergence condition or a maximum number of iterations is reached can be expressed by the following formula:

[0120]

[0121] Among them, ε is the given judgment accuracy, u k is a modal function.

[0122] S206: Perform fast Fourier transform on the K intrinsic mode component sequences respectively to obtain frequency domain signals.

[0123] Among them, each eigenmode component sequence is fast Fourier transformed to obtain a frequency domain signal; its definition is as follows:

[0124] yf=fft(mode)

[0125] Where mode is the modal component of the input, fft is the fast Fourier transform function, and yf is the frequency domain signal.

[0126] S207: Calculate the frequency components corresponding to the frequency domain signal, and find the index of the frequency component with the largest amplitude in the spectrum.

[0127] The calculation of the frequency components corresponding to the frequency domain signal and finding the index of the frequency component with the largest amplitude in the spectrum can be expressed as:

[0128] xf=fftfreq(n)

[0129] Where fftfreq represents the function used to generate the frequency value in the fast Fourier transform result, n is the length of the data, and xf is the index of the largest frequency component.

[0130] It can be understood that the present invention can obtain the characteristics of the signal at different scales by analyzing the frequency spectra of different modal components through the function of fast Fourier transform.

[0131] S208: Calculate the length of each eigenmode component sequence and divide it by the index to obtain a period, remove values whose periods are greater than the length of the eigenmode component sequence or less than 2, and obtain a significant period.

[0132] The period can be obtained by dividing the length of each eigenmode component sequence by the index, which can be expressed as:

[0133]

[0134] Where n is the length of the sequence, idx is the index of the main frequency component, and period is the period.

[0135] The method of removing the period that is greater than the length of the eigenmode component sequence or less than 2 to obtain the significant period can be: using a computer program to determine whether the value of period meets the condition of being greater than the length of the eigenmode component sequence or less than 2, and marking the period that meets the above condition as a significant period.

[0136] S209: Using the significant period as the patch length, the input time series is segmented into the patch length to obtain time series of different scales.

[0137] S210: Predict time series of different scales based on the Transformer model, and perform weighted summation of the obtained results to obtain the final prediction result.

[0138] Among them, steps S209-S210 are similar to steps S103-S104, so they are not repeated here.

[0139] The multi-scale power load forecasting method provided by the embodiment of the present application uses Lagrangian functions to decompose time series of different scales into K modal functions, then solves the optimization problem by alternating direction multiplier method, and updates the modal function and center frequency, updates the Lagrangian multiplier so that the optimization problem gradually approaches the optimal solution to obtain the final K intrinsic mode component sequences, then extracts significant cycles by fast Fourier transform of the intrinsic mode component sequences respectively, ensures that the key periodic features in the data are captured, uses the detected significant cycles as the patch length, and divides the input time series into different patch scales to simultaneously process short-term and long-term load changes. Based on the Transformer model, the time series of different scales are predicted and processed, making full use of the context information in the time series, and finally the features of multiple scales are fused by weighted summation to obtain the final power load forecast result. Through this method, the problem that when the real-world power load series shows changes and fluctuations at different time scales, a fixed-size patch may not be able to capture the short-term and long-term multi-scale features at the same time is solved, thereby significantly improving the accuracy of power load forecasting.

[0140] Figure 3 Schematic diagram of the process of multi-scale power load forecasting method provided in this application Figure 3 ,like Figure 3 As shown, this embodiment Figure 1 Based on the embodiment, the multi-scale power load forecasting method is described in detail. Figure 3 As shown, the multi-scale power load forecasting method provided by this embodiment includes:

[0141] S301: Using variational mode decomposition, decompose the original power load data into K eigenmode component sequences.

[0142] S302: extracting the main frequency of each of the intrinsic mode component sequences by using fast Fourier transform, calculating the corresponding period according to the main frequency, and screening out significant periods.

[0143] Among them, steps S301-S302 are similar to steps S101-S102, so they are not repeated here.

[0144] S303: Split the input time series into interlaced patches of length P, and separate the isolated regions of continuous patches with a length of S.

[0145] The segmentation method may be to segment the input time series into interlaced patches according to the actual required length P through a computer program, and the length of the isolated region separating the continuous patches is S.

[0146] S304: The last load value of the time series is copied S times and appended to the end of the time series, and the result is divided into N patches, thereby forming time series of different scales.

[0147] The method of appending S copies of the last value at the end of the time series to avoid missing data during segmentation can be to copy the last load value through a computer program and splice the last load value at the end of the time series using a conventional splicing algorithm, thereby forming N patches. The number of patches is expressed as:

[0148]

[0149] Where L represents the length of the time series.

[0150] Repeat steps S303 and S304 for each scale patch to form time series of different scales.

[0151] It can be understood that by dividing the time series data into a set of multiple patches Each patch contains data within a period of time {p1,…,p N This approach helps capture local patterns in time series and reduces the computational complexity of the model to O(N 2 / S 2 The disadvantage of standard dot-product attention is that it may ignore local patterns and mistakenly emphasize similarities across different time steps. By patching the time series at different scales, it can effectively capture local patterns and extract short-term and long-term multi-scale features.

[0152] S305: Construct a Transformer model including an encoder block and a linear prediction head decoder block.

[0153] Among them, the method of constructing the Transformer model including the encoder block and the linear prediction head decoder block can be to input the output data of the encoder block into the linear prediction head decoder block for processing, and the processing method can be to use a computer system program. It can be understood that this step is a routine operation of technicians in this field, and there are many ways to choose from, so it will not be described in detail here.

[0154] S306: The feature vector sequences corresponding to the time series at different scales are independently input into the encoding block for feature encoding, and the hidden state features of the encoder block are output.

[0155] The method of independently inputting the feature vector sequences corresponding to time series of different scales into the encoding block for feature encoding and outputting the hidden state features of the encoder block is completed by the following steps:

[0156] Step 1: Position encode the input time series of different scales to obtain position encoding features;

[0157] Specifically, the present invention performs position encoding on the input X corresponding to time series of different scales with a length of l, which can be specifically expressed as:

[0158]

[0159]

[0160] Where pos is the position, i is the position index, d is the dimension of the position encoding vector, and PE is the position encoding.

[0161] The input time series X=[x1,x2,…,x l ] is added to the position code to form an input time series containing position information:

[0162] Z=X+PE

[0163] The input time series Z containing position information is projected by the projection matrix W proj Projecting into high-dimensional space, we get the projected sequence H:

[0164] H=ZW proj

[0165] Step 2: Input the position encoding feature H into the multi-head attention layer, splice the results of each attention head output, and pass it through the projection matrix W o As a linear mapping, it can be expressed as:

[0166] MultiHead(Q,K,V)=Concat(head1,…,head h )WO

[0167] Among them, MultiHead represents the output features of the multi-head attention layer, Concat is the concatenation function, h represents the number of attention heads, and the calculation of each attention head is as follows:

[0168]

[0169] Where Q = W Q Z, K = W K Z, V = W V Z, W Q , W K , W V is the projection matrix, d k is the dimension of the attention head.

[0170] Step 3: Input the output features of the multi-head attention layer into the first addition and normalization layer to obtain the output features of the first addition and normalization layer, which is expressed as:

[0171] H′=LayerNorm(H+A)

[0172] Where A is the output of the multi-head attention mechanism, H is the projected sequence, H′ is the output feature of the first addition and normalization layer, and LayerNorm represents layer normalization;

[0173] Step 4: Input the output features of the first addition and normalization layer into the feedforward network, which contains two fully connected layers. It can be expressed as:

[0174] FFN(H′)=ReLU(H′W1+b1)W2+b2

[0175] Among them, W1, W2, b1, b2 are the parameters of the feedforward network, ReLU is the activation function, FFN is the feedforward network, and H′ is the output feature of the first addition and normalization layer.

[0176] Step 5: Input the output features of the feedforward network layer into the second addition and normalization layer to obtain the output features of the second addition and normalization layer;

[0177] Step 6: Use M independent encoders to process sequences of different scales, and apply steps 1 to 5 to time series of different scales. Expressed as:

[0178]

[0179] Among them, Enconder represents the encoder, h m is the hidden state feature, is the time series segmented using the mth patch size, P mis the mth patch size. After the above steps, the hidden state features of the encoder block are finally output.

[0180] S307: Input the hidden state features into the linear prediction head decoder block for feature decoding, and output prediction results of different scales.

[0181] Among them, the inputting of hidden state features into the linear prediction head decoder block for feature decoding and outputting prediction results of different scales is a routine operation for those skilled in the art. The input and output process can be completed using the existing linear prediction head decoder block, so it is not described in detail here.

[0182] S308: Perform weighted summation on the prediction results of different scales to obtain the final prediction result.

[0183] The weighted summation of the prediction results at different scales is accomplished by the following steps:

[0184] Step 1: Each weight is calculated as p i The reciprocal of j = 1 to M is the reciprocal of all p j The sum of the reciprocals of is normalized to ensure that the sum of the weights is 1; the weight of each scale is expressed as:

[0185]

[0186] Step 2: Multiply the prediction result of each scale by the corresponding weight, and add the results linearly to obtain the final prediction result.

[0187] The multi-scale power load forecasting method provided in the embodiment of the present application utilizes variational mode decomposition technology combined with fast Fourier transform to extract significant cycles, ensuring that key periodic features in the data are captured. The detected significant cycles are used as patch lengths to segment the input time series into different patch scales to simultaneously process short-term and long-term load changes. The time series of different scales are predicted and processed based on the Transformer model, making full use of the context information in the time series. The feature vector sequences corresponding to the time series of different scales are independently input into the encoding block for feature encoding, and the hidden state features of the encoder block are output. The hidden state features are input into the linear prediction head decoder block for feature decoding, and the prediction results of different scales are output. Finally, the features of multiple scales are fused by weighted summation to obtain the final power load forecasting result. This method solves the problem that when the real-world power load series shows changes and fluctuations at different time scales, a fixed-size patch may not be able to capture the short-term and long-term multi-scale features at the same time, thereby significantly improving the accuracy of power load forecasting.

[0188] Figure 4 Schematic diagram of the process of multi-scale power load forecasting method provided in this application Figure 4 ,like Figure 4 As shown, this embodiment Figure 3 Based on the embodiment, the prediction processing of the time series of different scales based on the Transformer model and the weighted summation of the obtained results to obtain the final prediction result are described in detail, such as Figure 3 As shown, the multi-scale power load forecasting method provided by this embodiment includes:

[0189] S401: Construct a Transformer model including an encoder block and a linear prediction head decoder block.

[0190] Among them, the method of constructing the Transformer model including the encoder block and the linear prediction head decoder block can be to input the output data of the encoder block into the linear prediction head decoder block for processing, and the processing method can be to use a computer system program. It can be understood that this step is a routine operation of technicians in this field, and there are many ways to choose from, so it will not be described in detail here.

[0191] S402: Position encoding is performed on input time series of different scales to obtain position encoding features.

[0192] The specific method of performing position encoding on the input time series of different scales to obtain position encoding features is as follows:

[0193] Perform position encoding on the input X corresponding to time series of different scales with a length of l, which can be expressed as follows:

[0194]

[0195]

[0196] Where pos is the position, i is the position index, and d is the dimension of the position encoding vector.

[0197] The input sequence X=[x1,x2,…,x l ] is added to the position code to form an input sequence containing position information:

[0198] Z=X+PE

[0199] Among them, PE is the position code.

[0200] The input sequence Z containing position information is transformed into a projection matrix W. proj Projecting into high-dimensional space, we get the projected sequence H:

[0201] H=ZW proj

[0202] S403: Process the position encoding features to obtain hidden state features.

[0203] The method of processing the position coding feature to obtain the hidden state feature specifically includes the following steps.

[0204] Step 1: Input the position encoding feature H obtained in step S402 into the multi-head attention layer, and splice the output results of each attention head. The specific process can be expressed as follows: Input the position encoding feature H into the multi-head attention layer, splice the output results of each attention head, and pass the projection matrix W. o As a linear mapping, it can be expressed as:

[0205] MultiHead(Q,K,V)=Concat(head1,…,head h )W O

[0206] Among them, MultiHead represents the output features of the multi-head attention layer, h represents the number of attention heads, and the calculation of each attention head is as follows:

[0207]

[0208] Where Q = W Q Z, K = W K Z, V = W V Z, W Q , W K , W V is the projection matrix, d k is the dimension of the attention head;

[0209] Step 2: Input the output features of the multi-head attention layer into the first addition and normalization layer to obtain the output features of the first addition and normalization layer. The specific process can be expressed as:

[0210] H′=LayerNorm(H+A)

[0211] Among them, H is the position encoding feature, A is the output of the multi-head attention mechanism, and LayerNorm represents layer normalization;

[0212] Step 3: Input the output features of the first addition and normalization layer into the feedforward network layer to obtain the output features of the feedforward network layer. The specific process can be expressed as:

[0213] FFN(H′)=ReLU(H′W1+b1)W2+b2

[0214] Among them, W1, W2, b1, b2 are the parameters of the feedforward network, and ReLU is the activation function;

[0215] Step 4: Input the output features of the feedforward network layer into the second addition and normalization layer to obtain the output features of the second addition and normalization layer;

[0216] Step 5: Use M independent encoders to process sequences of different scales, and apply steps 1 to 5 to time series of different scales. It can be expressed as:

[0217]

[0218] Among them, Enconder represents the encoder, h m is the hidden state feature, is the time series segmented using the mth patch size, P m is the mth patch size. After the above steps, the hidden state features of the encoder block are finally output.

[0219] S404: Input the hidden state features into the linear prediction head decoder block for feature decoding, and output prediction results of different scales.

[0220] Among them, the inputting of hidden state features into the linear prediction head decoder block for feature decoding and outputting prediction results of different scales is a routine operation for those skilled in the art. The input and output process can be completed using the existing linear prediction head decoder block, so it is not described in detail here.

[0221] S405: Determine the number of significant periods as the number of weights, and determine each weight according to the length of the significant period.

[0222] where each weight is calculated as p i The reciprocal of j = 1 to M is the reciprocal of all p j The sum of the reciprocals of is normalized to ensure that the sum of the weights is 1; the weight of each scale is expressed as:

[0223]

[0224] S406: Determine the number of significant cycles as the number of prediction results at different scales, and obtain the final prediction result according to the weight corresponding to each prediction result at different scales.

[0225] The final prediction result is obtained by multiplying the prediction result of each scale obtained in step S405 by the corresponding weight, and linearly adding the results to obtain the final prediction result.

[0226] The multi-scale power load forecasting method provided in the embodiment of the present application utilizes variational mode decomposition technology combined with fast Fourier transform to extract significant cycles, ensuring that the key periodic features in the data are captured, using the detected significant cycles as the patch length, and segmenting the input time series into different patch scales to simultaneously process short-term and long-term load changes. Based on the Transformer model, the time series of different scales are predicted and processed, making full use of the contextual information in the time series. Finally, each weight is determined according to the length of the significant cycle, and the weights corresponding to the prediction results of each different scale are linearly added to obtain the final power load forecast result. This method solves the problem that when the real-world power load series shows changes and fluctuations at different time scales, a fixed-size patch may not be able to capture the short-term and long-term multi-scale features at the same time, thereby significantly improving the accuracy of power load forecasting.

[0227] Figure 5 This is a schematic diagram of the structure of the multi-scale power load forecasting device provided in this application, which is applied to the power load forecasting system, such as Figure 5 As shown, the multi-scale power load forecasting device 500 provided in this embodiment includes:

[0228] The processing module 501 is configured to decompose the original power load data into K intrinsic mode component sequences using variational mode decomposition, where K>1;

[0229] A screening module 502 is configured to extract the main frequency of each of the intrinsic mode component sequences using a fast Fourier transform, calculate the corresponding period based on the main frequency, and screen out significant periods;

[0230] The processing module 501 is further configured to use the significant period as a patch length to segment the input time series by the patch length to obtain time series of different scales;

[0231] The prediction module 503 is used to perform prediction processing on the time series of different scales based on the Transformer model, and perform weighted summation of the obtained results to obtain a final prediction result.

[0232] Optionally, the device further includes: an updating module.

[0233] The processing module 501 is specifically used for step A101: initializing the center frequency, mode function, Lagrange multiplier and maximum number of iterations; step A102: decomposing the time series of different scales into K mode functions by Lagrange function, so that each mode function has the minimum bandwidth;

[0234] The update module is used for step A103: solving the optimization problem by the alternating direction multiplier method and updating the modal function and the center frequency; step A104: updating the Lagrange multiplier so that the optimization problem gradually approaches the optimal solution; step A105: repeating the update process in steps A103 and A104 until the preset convergence condition or the maximum number of iterations is reached, and then outputting the final intrinsic mode component sequence.

[0235] Optionally, the processing module 501 is specifically configured to perform fast Fourier transform on each of the K intrinsic mode component sequences to obtain a frequency domain signal; calculate the frequency components corresponding to the frequency domain signal, and find the index of the frequency component with the largest amplitude in the spectrum; calculate the length of each intrinsic mode component sequence and divide it by the index to obtain the period;

[0236] The screening module 502 is specifically configured to remove the period that is greater than the length of the eigenmode component sequence or less than 2, to obtain a significant period.

[0237] Optionally, the processing module 501 is specifically used to divide the input time series into patches of length P that are interlaced with each other, and the length of the isolated area separating continuous patches is S; the last load value of the time series is copied S times and appended to the end of the time series, and divided into N patches, thereby forming the time series of different scales.

[0238] Optionally, the processing module 501 is specifically configured to construct a Transformer model including an encoder block and a linear prediction head decoder block; independently input the feature vector sequences corresponding to the time series at different scales into the encoding block for feature encoding, and output the hidden state features of the encoder block;

[0239] The prediction module 503 is specifically configured to input the hidden state features into the linear prediction head decoder block for feature decoding, and output prediction results of different scales; and perform weighted summation on the prediction results of different scales to obtain a final prediction result.

[0240] Optionally, the processing module 501 is specifically configured to perform position encoding on the input time series of different scales to obtain position encoding features; and process the position encoding features to obtain the hidden state features.

[0241] Optionally, the processing module 501 is specifically configured to determine the number of the significant periods as the number of weights, and determine each weight according to the length of the significant period;

[0242] The prediction module 503 is specifically configured to determine the number of significant cycles as the number of prediction results at different scales, and obtain the final prediction result according to the weight corresponding to each prediction result at different scales.

[0243] Figure 6 This is a schematic diagram of the structure of the multi-scale power load forecasting device provided in this application. Figure 6 As shown, the multi-scale power load forecasting device 600 provided by this application includes:

[0244] Memory 602;

[0245] Processor 601;

[0246] The memory 602 stores computer-executable instructions;

[0247] The processor 601 executes the computer-executable instructions stored in the memory to implement the multi-scale power load forecasting method as shown in the above embodiment.

[0248] The present application also provides a computer storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement the multi-scale power load forecasting method shown in the above embodiment.

[0249] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0250] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0251] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A multi-scale power load forecasting method, characterized in that: Applied to a power load forecasting system, the method includes: Using variational mode decomposition, the original power load data is decomposed into eigenmode component sequence, where >1; right Performing fast Fourier transform on each of the eigenmode component sequences to obtain frequency domain signals; Calculate the frequency components corresponding to the frequency domain signal and find the index of the frequency component with the largest amplitude in the spectrum; Calculate the length of each eigenmode component sequence and divide it by the index to obtain a period, and remove values whose periods are greater than the length of the eigenmode component sequence or less than 2 to obtain a significant period; Split the input time series into interleaved blocks of length The length of the isolated region separating the continuous patches is ; Copy the last load value of the time series times are appended to the end of the time series, and the segmentation is formed patches, thus forming time series of different scales; The time series of different scales are predicted based on the Transformer model, and the obtained results are weighted and summed to obtain the final prediction result.

2. The method according to claim 1, characterized in that The variational mode decomposition is used to decompose the original power load data into The eigenmode component sequence includes the following steps: Step A101: Initialize the center frequency, mode function, Lagrange multiplier and maximum number of iterations; Step A102: Decompose the time series of different scales into the mode functions so that each mode function has a minimum frequency bandwidth; Step A103: solving the optimization problem by using the alternating direction multiplier method, and updating the modal function and the center frequency; Step A104: updating the Lagrange multiplier so that the optimization problem gradually approaches the optimal solution; Step A105: Repeat the updating process in steps A103 and A104 until a preset convergence condition or the maximum number of iterations is reached, and then output the final intrinsic mode component sequence.

3. The method according to claim 1, characterized in that The prediction processing of the time series of different scales based on the Transformer model and weighted summing of the obtained results to obtain the final prediction result include: Build a Transformer model consisting of an encoder block and a linear prediction head decoder block; Independently inputting the feature vector sequences corresponding to the time series of different scales into the encoding block for feature encoding, and outputting the hidden state features of the encoder block; Inputting the hidden state features into the linear prediction head decoder block for feature decoding, and outputting prediction results of different scales; The prediction results of different scales are weighted and summed to obtain the final prediction result.

4. The method according to claim 3, characterized in that The step of independently inputting the feature vector sequences corresponding to the time series at different scales into the encoding block for feature encoding, and outputting the hidden state features of the encoder block, comprises: Performing position encoding on the input time series of different scales to obtain position encoding features; The position encoding feature is processed to obtain the hidden state feature.

5. The method according to claim 3, characterized in that The weighted summing of the prediction results of different scales to obtain the final prediction result includes: Determining the number of the significant periods as the number of weights, and determining each weight according to the length of the significant period; The number of the significant cycles is determined as the number of prediction results of the different scales, and the final prediction result is obtained according to the weight corresponding to each prediction result of the different scales.

6. A multi-scale power load forecasting device, characterized in that: The multi-scale power load forecasting method according to any one of claims 1 to 5, wherein the device comprises: The processing module is used to decompose the original power load data into eigenmode component sequence, where >1; a screening module, configured to extract the main frequency of each of the intrinsic mode component sequences using a fast Fourier transform, calculate the corresponding period based on the main frequency, and screen out significant periods; The processing module is further configured to use the significant period as a patch length to segment the input time series by the patch length to obtain time series of different scales; The prediction module is used to perform prediction processing on the time series of different scales based on the Transformer model, and perform weighted summation of the obtained results to obtain the final prediction result.

7. A multi-scale power load forecasting device, characterized in that: include: Memory; processor; wherein the memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the multi-scale power load forecasting method according to any one of claims 1 to 5.

8. A computer storage medium, characterized in that The computer storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the multi-scale power load forecasting method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Wind turbine wind speed prediction optimization method based on multi-scale analysis

    CN107203827A

  • Wind power station output ultra-short time prediction method based on least square support vector machine

    CN111222680A