A light-weight power load forecasting method based on time-frequency collaborative modeling
By employing a learnable time-frequency modeling and logarithmic domain adaptive fusion method for power load forecasting, the problems of insufficient multi-scale feature extraction and high model complexity in power load forecasting are solved. This method achieves stable and adaptive feature fusion and lightweight deployment, thereby improving forecast accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HENAN UNIV OF SCI & TECH
- Filing Date
- 2026-04-13
- Publication Date
- 2026-07-10
Smart Images

Figure CN122371092A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power load forecasting technology, and specifically to a lightweight power load forecasting method based on time-frequency collaborative modeling. Background Technology
[0002] With the rapid development of new power systems and the increasing penetration of renewable energy, power load signals exhibit significant non-stationarity and multi-scale characteristics. Their time-varying periodicity, trends, and sudden disturbances are intertwined, significantly increasing the complexity of load forecasting. Power load forecasting, as a crucial foundation for power system operation optimization, dispatching decisions, and demand response, directly impacts the safe and economical operation of the power system. In recent years, with the widespread adoption of smart grids and the Internet of Things (IoT), the acquisition of large-scale, high-frequency sampled load data has led to more complex nonlinearities and abrupt changes in the time-series characteristics of load signals, making it difficult for traditional modeling methods to effectively characterize their multi-scale dynamic features.
[0003] Existing power load forecasting methods mainly include time-domain modeling-based methods, frequency-domain analysis-based methods, and time-frequency joint modeling methods. Time-domain modeling-based methods (such as recurrent neural networks, LSTM, and Transformer) can effectively capture long-term dependencies and trend changes, but their ability to characterize the periodicity and spectral structure of load signals is limited. Frequency-domain modeling-based methods (such as Fourier transform, wavelet transform, and empirical mode decomposition) can reveal periodic characteristics and energy distribution, but often at the cost of time locality, making it difficult to reflect the dynamic changes in load signals. To balance time and frequency domain characteristics, various time-frequency joint analysis methods have been proposed in recent years, achieving feature complementarity by mapping time series to time-frequency space. However, existing time-frequency joint models generally suffer from the following problems: First, the time-frequency feature fusion methods are mostly serial superposition or fixed weights, lacking an adaptive mechanism, resulting in limited feature interaction at different time scales; second, the frequency resolution is usually fixed, making it impossible to automatically adjust the spectral analysis scale according to changes in load signals; third, most models have complex structures, large numbers of parameters, and high computational and storage overhead, making them difficult to deploy on edge devices or in real-time scenarios.
[0004] Furthermore, due to the significant differences in energy distribution and the wide range of spectral amplitudes in power load signals, traditional time-frequency fusion methods are prone to numerical instability and training non-convergence when feature superposition, leading to large prediction errors and insufficient generalization ability. Simultaneously, existing methods lack constraints on the consistency between the time and frequency domain learning processes, resulting in inconsistent learning outcomes between the two domains and affecting the overall stability of predictions. Recent research has attempted to introduce multi-agent reinforcement learning, gated attention mechanisms, and lightweight network structures to improve model real-time performance and deployability while maintaining prediction accuracy; however, these approaches still fall short in terms of feature fusion stability and cross-domain consistency constraints. Summary of the Invention
[0005] The purpose of this invention is to provide a lightweight power load forecasting method based on time-frequency co-modeling, so as to overcome the significant differences between time-domain features and frequency-domain features in terms of numerical scale and statistical distribution, achieve stable and adaptive fusion of cross-domain features, and at the same time take into account the extraction efficiency of multi-scale periodic features and the requirements of lightweight model, and avoid problems such as gradient imbalance, training non-convergence and loss of spectrum physical laws caused by traditional linear fusion methods.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A lightweight power load forecasting method based on time-frequency co-modeling includes the following steps: S1. Construct a learnable time-frequency modeling branch to extract the frequency domain periodicity and energy distribution characteristics of the load sequence, thereby obtaining time-frequency features. Among them, the load sequence is transformed to the time-frequency domain using short-time Fourier transform. This short-time Fourier transform contains a learnable scaling factor, which is adaptively updated through the backpropagation algorithm to achieve dynamic adjustment of time-frequency resolution. S2. Construct a time-domain trend-fluctuation modeling branch to extract the long-term trend and short-term fluctuation characteristics of the load sequence, and obtain the time-domain characteristics; S3. Based on the logarithmic steady-state time-frequency assumption, the time-frequency features and the time-domain features are adaptively fused in the logarithmic domain to obtain fused features; wherein, the time-frequency features and the time-domain features are first subjected to logarithmic transformation and geometric mean respectively to achieve preliminary alignment, and then weighted fusion is performed by dynamically calculating the fusion weight through a learnable gating unit. S4. During the model training phase, a time-frequency consistency constraint is introduced, and a total loss function is constructed that includes time-domain prediction loss and time-frequency feature consistency loss, so as to jointly optimize the consistency between time-domain prediction error and the time-frequency features. S5. The fused features are mapped to the final power load prediction value through a lightweight network structure.
[0007] Furthermore, S1 specifically includes: S1.1, Input power load time series Perform a learnable short-time Fourier transform to obtain the complex spectrum. The window function of the transformation Includes learnable scaling factors During model initialization, the scaling factor is set. Assign a preset scale value; during training, As trainable parameters of the network, they are adaptively updated via the backpropagation algorithm; S1.2 Calculate the complex spectrum amplitude spectrum and retain the previous One low-frequency component is used to reduce high-frequency noise and decrease computational complexity; S1.3. Perform depthwise separable convolution and pointwise convolution operations sequentially on the low-frequency amplitude spectrum to obtain the convolution features. ; S1.4, in the convolution features A local attention mechanism is introduced to obtain the final time-frequency features by calculating the linear projection and weighted sum of the query, key, and value. .
[0008] Furthermore, S2 specifically includes: S2.1, For the input power load time series Perform moving average decomposition to obtain the trend components. and seasonal fluctuation components ,in ; S2.2, Regarding the seasonal fluctuation components A gating mechanism is introduced to calculate the time weight matrix using learnable parameters. and to By applying weights, we obtain the weighted volatility characteristics. ; S2.3, the trend components With weighted fluctuation characteristics The features are concatenated and then nonlinearly mapped through at least one fully connected layer to obtain the final temporal features. .
[0009] Furthermore, S3 specifically includes: S3.1, Time-frequency characteristics With time domain characteristics Perform logarithmic transformations on each part and calculate their geometric mean in the logarithmic domain to obtain the preliminary alignment features. : in, It is the numerical stability constant; S3.2, Dynamically calculate the fusion weights of time-domain and time-frequency features using learnable gating units. The time-domain features and time-frequency features are then weighted and fused to obtain preliminary fused features. : in, The weight matrix is a learnable matrix. Indicates feature splicing, For learnable bias terms, For the Sigmoid function, This indicates element-wise multiplication; S3.3, Regarding the preliminary fusion features Exponential smoothing and layer normalization are performed to obtain stable and smooth final fusion features. , used for subsequent predictions.
[0010] Furthermore, S4 specifically includes: Define the total loss function For time-domain prediction loss Consistency loss with time-frequency features Weighted sum: in, For balance coefficient, The power load forecast sequence output by the model. For the actual power load sequence Time-frequency feature consistency loss Electricity load forecasting sequence The mean square error between the short-time Fourier transform time-frequency features and the time-frequency features extracted by the learnable time-frequency modeling branch: in, The time-frequency features extracted for the learnable time-frequency modeling branch.
[0011] Furthermore, in the learnable short-time Fourier transform, multiple transform branches are set, each branch corresponding to a different learnable scaling factor. During model initialization, each branch... Assign a preset set of scales; during training, The trainable parameters of the network are adaptively updated via backpropagation to dynamically adjust the window width of each branch.
[0012] Furthermore, the depthwise separable convolution includes two independent operations: channel-wise convolution and pointwise convolution. Channel-wise convolution is used to extract local frequency features independently by frequency band, while pointwise convolution is used to realize feature interaction between frequency bands.
[0013] Furthermore, the gating mechanism employs a two-layer fully connected structure. The first layer is used for feature mapping and uses the ReLU activation function, while the second layer generates a range of [value missing] using the Sigmoid function. The time weighting matrix is used to control the seasonal fluctuation components. Adaptive weighting.
[0014] Furthermore, the gating unit adopts a two-layer fully connected structure: the first layer is a feature mapping layer, and the second layer is a weight generation layer, which generates weights within a range using the Sigmoid function. The fusion weights are used to adaptively balance the contributions of time-domain features and time-frequency features in the fusion process.
[0015] Furthermore, the lightweight network structure includes: employing depthwise separable convolutions in the learnable time-frequency modeling branch, employing a gating mechanism and lightweight fully connected layers in the time-domain trend-fluctuation modeling branch, and employing lightweight gating units in the logarithmic domain adaptive fusion module.
[0016] The beneficial effects of the above scheme are as follows: First, this invention significantly improves the model's ability to capture the multi-scale dynamic characteristics of power load. The invention designs the window scale factor of the short-time Fourier transform as a trainable parameter, enabling the model to automatically adjust the width of the analysis window during training based on the actual fluctuation characteristics of the load data. When load changes are gradual, the model tends to use a larger window scale, thereby enhancing its ability to distinguish low-frequency trends and long-period frequency components; when the load fluctuates drastically, the model automatically switches to a smaller window scale to accurately locate high-frequency disturbances and instantaneous change characteristics. This adaptability allows the same model to effectively capture both the global trend and local details of the load sequence simultaneously, overcoming the inherent shortcomings of traditional fixed-window methods in modeling non-stationary, multi-scale signals.
[0017] Second, this invention solves the technical challenge of numerical instability during the fusion of time-domain and frequency-domain features. The invention innovatively proposes a logarithmic domain adaptive fusion module. First, it performs logarithmic transformations on both types of features and calculates their geometric mean in the logarithmic domain, mapping the multiplicative feature space with significant amplitude differences to an additive steady-state space, effectively compressing the dynamic range of the features. Then, a lightweight gating unit is introduced to dynamically calculate the optimal fusion weights for the time-domain and frequency-domain features, enabling the model to intelligently adjust the contribution of features from different domains based on the characteristics of the input signal. This fusion strategy significantly improves the stability and convergence efficiency of model training, maintaining excellent predictive performance even under strong noise or sudden load changes.
[0018] Third, this invention enables the model not only to learn the mapping relationship of load values, but also to grasp the inherent physical laws of load changes. Based on traditional time-domain prediction loss, this invention introduces a time-frequency consistency constraint loss, forcing the spectral characteristics of the predicted sequence output by the model, after short-time Fourier transform, to maintain a high degree of consistency with the feature spectrum extracted by the time-frequency branch. This constraint guides the model not only to predict accurately at specific time points, but also to simulate the overall rhythm, periodic structure, and energy distribution pattern of load fluctuations. Therefore, when facing unseen data distributions or extreme situations, the model's prediction results can still maintain physical characteristics consistent with the real system, significantly improving the robustness and generalization ability of the prediction.
[0019] Fourth, this invention achieves a lightweight model design while maintaining prediction accuracy, effectively reducing computational resource requirements. Through a series of systematic lightweight measures, such as using depthwise separable convolutions in the time-frequency branch, employing gating mechanisms and lightweight fully connected layers in the time-domain branch, and using lightweight gating units in the fusion module, the number of floating-point operations, parameter count, and memory usage of this invention are significantly lower than those of Transformer variant models and linear models. This lightweight characteristic enables this invention to be efficiently deployed in edge devices or real-time prediction scenarios, providing a feasible technical solution for edge applications of power load forecasting. Attached Figure Description
[0020] Figure 1 This is a flowchart of the learnable time-frequency modeling branch in an embodiment of the present invention; Figure 2 This is a flowchart of the time-domain trend-fluctuation modeling branch in an embodiment of the present invention; Figure 3 This is a flowchart illustrating the feature fusion process of the learnable time-frequency modeling branch and the time-domain trend-fluctuation modeling branch in an embodiment of the present invention. Figure 4 This is a schematic diagram comparing the model complexity and number of parameters of different methods on the ETTh1 dataset in the embodiments of the present invention; Detailed Implementation
[0021] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0022] It should be noted that, unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0023] This invention provides a lightweight power load forecasting method based on time-frequency co-modeling. Addressing the non-stationarity, multi-scale characteristics, and cross-domain numerical differences of power load sequences, this method employs a combined design of a dual-branch parallel structure, logarithmic domain adaptive fusion, and time-frequency consistency constraints. This approach effectively extracts multi-scale features while ensuring the stability of numerical fusion and maintaining a lightweight model. Figure 1 , Figure 2 , Figure 3 As shown in the flowchart, this method mainly includes five parts: constructing a learnable time-frequency modeling branch, a time-domain trend-fluctuation modeling branch, a logarithmic domain adaptive fusion module, a time-frequency consistency constraint mechanism, and lightweight prediction output.
[0024] In this embodiment, the input data is the historical power load time series of a certain regional power grid, with a sampling interval of 1 hour. First, the original load series is cleaned by using linear interpolation to fill in missing values and correct outliers. Then, Z-score standardization is performed.
[0025] S1. Construct a learnable time-frequency modeling branch.
[0026] In the implementation of this invention, in order to fully exploit the periodicity and energy distribution characteristics of power load signals, a learnable time-frequency analysis branch is first constructed. This learnable time-frequency modeling branch is used to extract the periodicity and energy distribution characteristics of the load sequence from a frequency domain perspective. See the detailed process below. Figure 1 .
[0027] S1.1 Learnable Short-Time Fourier Transform This branch uses the standardized load time series As input, adaptive adjustment of time-frequency resolution is achieved by introducing a learnable short-time Fourier transform (STFT) window.
[0028] Unlike traditional STFT fixed-window, this invention introduces learnable parameters. This parameter automatically adjusts the width of the analysis window during training. Specifically, multiple transformation branches are set, each corresponding to a different learnable scaling factor. During model initialization, the branches are... Assign a preset set of scales (e.g.) During model training, The trainable parameters of the network are adaptively updated using the backpropagation algorithm. This is achieved by dynamically adjusting the window width of each branch: with a larger... To form a wide window to capture the low-frequency trend features of the sequence, with a smaller A narrow window is formed to extract short-term high-frequency fluctuations.
[0029] S1.2 Amplitude Spectrum Calculation and Low-Frequency Preservation The expression for spectrum calculation is: , in, For parameterized windowing functions, A learnable scaling factor. For frequency indexing.
[0030] The obtained complex spectrum Containing both amplitude and phase information, this invention uses the amplitude spectrum as the primary feature in order to highlight energy characteristics and suppress phase noise. Furthermore, normalization and threshold screening are employed in the energy distribution to reduce high-frequency noise and computational complexity, retaining the previous... In this embodiment, K=64 is used to cover the main energy frequency band.
[0031] S1.3, Depthwise Separable Convolution The low-frequency amplitude spectrum is subjected to depthwise separable convolution and pointwise convolution operations sequentially. The depthwise separable convolution consists of two steps: the first step is channel-wise convolution, extracting local frequency features independently by frequency band; the second step is pointwise convolution, using a 1×1 convolution kernel to achieve feature interaction between frequency bands. This design significantly reduces parameters and computational cost while maintaining feature expressiveness. The convolutional features are denoted as... .
[0032] The convolution output is represented as: in, This represents channel-wise convolution. This indicates a pointwise convolution operation.
[0033] S1.4, Local Attention Mechanism In convolutional features A local attention mechanism is introduced to obtain the final time-frequency features by calculating the linear projection and weighted sum of the query, key, and value. .
[0034] , , in, Linear projections of the query, key, and value, respectively. The key vector dimension is used. This attention mechanism assigns dynamic weights to different frequency bands based on energy concentration, enabling the model to automatically highlight the frequency bands most sensitive to load periodicity during the learning process.
[0035] S2. Construct a time-domain trend-fluctuation modeling branch.
[0036] Besides frequency domain characteristics, electricity load sequences also exhibit distinct long-term trends and short-term fluctuations over time. Therefore, this invention constructs a time-domain trend-fluctuation modeling branch to characterize the dynamic patterns of load evolution from a time perspective. The specific process can be found [link to process details]. Figure 2 .
[0037] S2.1 Moving Average Decomposition For the input power load time series Perform a moving average decomposition to divide it into trend components. and fluctuation components The trend component is calculated using a moving average. in, The window length can be set according to the task's time granularity (such as hourly or daily forecasting). This process extracts the long-term evolution trend from the load signal, effectively smoothing out short-term noise.
[0038] Then, the residual component is defined as the short-term volatility component: This fluctuation term mainly reflects the high-frequency components caused by disturbances, sudden load changes, holidays, weather, and other factors in the power system during local time periods.
[0039] S2.2, Gated Weighted To improve the model's response to these sudden fluctuations, this invention introduces a time-domain gating mechanism. The gating network inputs the fluctuation term. Output weight vector : in, This is the Sigmoid function, used to limit the output to the interval [0,1]. The weighted fluctuation term is represented as follows: The gating mechanism employs a two-layer fully connected structure. The first layer is used for feature mapping and uses the ReLU activation function. The second layer generates a value within the range specified by the Sigmoid function. The time weighting matrix. This mechanism allows the model to automatically amplify the importance of corresponding signals when encountering drastic load changes, thereby improving the sensitivity of short-term forecasts.
[0040] S2.3, splicing and nonlinear mapping Finally, the trend components Weighted volatility characteristics The features are concatenated and then nonlinearly mapped through at least one fully connected layer to obtain the final temporal features. .
[0041] This structure maintains the smoothness of long-term trends while exhibiting high responsiveness to local disturbances, thus balancing stability and sensitivity.
[0042] S3, Logarithmic Domain Adaptive Fusion Module Due to time domain characteristics With time-frequency characteristics Significant differences exist in numerical scale and statistical distribution; direct concatenation would lead to unstable model training. This invention introduces a logarithmic domain adaptive fusion module between the two to achieve robust multi-domain feature fusion. For example... Figure 3 As shown, the specific implementation steps of this module are as follows.
[0043] S3.1 Logarithmic Transformation and Geometric Mean First, before performing the fusion operation, the two types of features are dimensionally aligned. Specifically, a linear mapping layer is used to align the temporal features. and time-frequency characteristics Dimensional alignment is performed to map both features to the same feature space. Subsequently, to compress the dynamic range of feature magnitudes, this invention performs logarithmic transformations on both types of features and calculates the geometric mean in the logarithmic domain to achieve initial alignment. in, To prevent the small constant from taking a zero value when taking the logarithm, the range of values is 1. More preferably Pick By introducing this stability constant, numerical overflow or gradient instability issues can be effectively avoided during logarithmic operations, thereby improving the stability of model training.
[0044] This operation transforms multiplicative noise into additive noise, making the two types of features closer in numerical scale, thereby alleviating the problems of gradient explosion and training non-convergence.
[0045] S3.2, Learnable Gated Fusion Introducing learnable gating units to dynamically calculate the fusion weights of time-domain and time-frequency features : in, The weight matrix is a learnable matrix. Indicates feature splicing, For learnable bias terms, This is the Sigmoid function.
[0046] In this embodiment, the gating unit adopts a two-layer fully connected structure. The first layer is a feature mapping layer, which uses the ReLU activation function; the second layer is a weight generation layer, which generates the range using the Sigmoid function. The fusion weight.
[0047] Adaptive weighted fusion of the two types of features based on gating weights: in, These are the preliminary fusion features obtained after weighted fusion. The fusion weights output by the gating unit. The time-frequency features extracted for the learnable time-frequency modeling branch. The time-domain features extracted for the time-domain trend-fluctuation modeling branch. This indicates element-wise multiplication.
[0048] This design allows the model to automatically adjust the proportion of time-frequency features under different conditions. For example, when the load fluctuates drastically, the model relies more on frequency domain features; when the system is in a stable operating phase, it makes more use of time-domain trend features.
[0049] S3.3, Exponential Smoothing and Layer Normalization To ensure the smoothness of the fused features over time, this invention incorporates exponential sliding smoothing and normalization operations at the output: in, Let be the eigenvector after exponential smoothing at time step t. These are the initial fusion features at the current time step t. For the smoothing features of the previous time step t-1, This is the smoothing coefficient.
[0050] The features after exponential smoothing are then subjected to layer normalization: in, The representation layer normalization operation outputs the final fused features. , used for subsequent predictions.
[0051] This operation effectively eliminates feature mutations and enhances the continuity and robustness of fusion features.
[0052] S4, Time-Frequency Consistency Constraint Mechanism Based on multi-domain fusion, this invention further proposes a time-frequency consistency constraint to ensure that the model output remains consistent with the actual load signal in both the time and frequency domains.
[0053] Total loss function For time-domain prediction loss Consistency loss with time-frequency features Weighted sum: in, For balance coefficient, The power load forecast sequence output by the model. For the actual power load sequence The time-domain prediction loss is expressed in the form of mean squared error (MSE): This item is used to ensure that the predicted values are close to the true values over time.
[0054] Time-frequency feature consistency loss Electricity load forecasting sequence The mean square error between the short-time Fourier transform time-frequency features and the time-frequency features extracted by the learnable time-frequency modeling branch: in, The time-frequency features extracted for the learnable time-frequency modeling branch have a window length of 64, a stride of 16, 128 FFT points, and a Hanning window function. By minimizing the total loss function, the model learns the correspondence between the temporal structure and the frequency structure simultaneously during training, thereby enhancing prediction robustness and cross-domain consistency.
[0055] This means that the model must not only fit the time-domain trend, but also maintain the similarity of the spectral energy distribution, so as to avoid the loss of periodic structure in the output or the generation of pseudo-high-frequency noise.
[0056] By gradually improving during training By choosing the appropriate value, the model can gradually enhance spectral consistency while maintaining time accuracy, achieving a joint optimization effect in the time and frequency domains.
[0057] S5, Predictive Output and Lightweight Deployment After the fusion feature learning and consistency constraint optimization are completed, the final fusion features will be... The input is fed into a linear mapping layer or a feedforward network to obtain the predicted power load values for future time periods: in, The power load forecast value output by the model. The learnable weight matrix of the linear mapping layer. For the final fusion feature, This refers to the learnable bias term of the linear mapping layer.
[0058] In this embodiment, the prediction head is a single-layer fully connected network, and the output dimension corresponds to the prediction step size (e.g., 6 hours or 24 hours). The entire model system achieves efficient inference through a systematic lightweight design. The specific implementation of the lightweight network structure in this embodiment is as follows: In the learnable time-frequency modeling branch, depthwise separable convolution consists of two independent operations cascaded together: the first step is channel-wise convolution, using a 3×1 kernel size, a stride of 1, and the number of channels equal to the number of input feature channels, used to independently extract local frequency features by frequency band; the second step is pointwise convolution, using a 1×1 kernel size and a stride of 1, used to achieve feature interaction between frequency bands. By decomposing standard convolution into depthwise separable convolution, the number of parameters and computational cost are significantly reduced.
[0059] In the temporal trend-fluctuation modeling branch, the gating mechanism adopts a two-layer fully connected structure: the first layer maps the input features from the original dimension to an intermediate dimension (64 in this embodiment) using the ReLU activation function; the second layer maps the intermediate features back to the original dimension and generates a time weight matrix in the [0,1] interval using the Sigmoid function. The lightweight fully connected layer refers to a single-layer linear mapping that does not use a multi-head self-attention mechanism.
[0060] In the logarithmic domain adaptive fusion module, the lightweight gating unit also adopts a two-layer fully connected structure: the first layer is a feature mapping layer, which uses the ReLU activation function; the second layer is a weight generation layer, which outputs a fusion weight vector through the Sigmoid function. In this embodiment, the first layer maps the concatenated dual-domain features (dimension 256) to 128 dimensions, and the second layer outputs a 128-dimensional fusion weight vector.
[0061] The above lightweight network structure design significantly reduces the number of floating-point operations, the number of parameters, and the memory usage of the model, enabling it to be deployed on edge computing devices.
[0062] Model training and experimental validation This embodiment trains and tests the proposed method on the ETTh1 public dataset. The dataset is divided into training, validation, and test sets in an 8:1:1 ratio. The model uses the Adam optimizer with an initial learning rate of 0.001, a batch size of 32, and 50 training epochs. An early stopping mechanism is employed to prevent overfitting.
[0063] The benchmark models for comparison cover the current mainstream time series prediction methods and are divided into two categories: (1) Transformer variants (such as Autoformer, Informer, PatchTST): This type of model captures long-range dependencies through self-attention mechanism and has strong sequence modeling capabilities, but has high computational complexity, slow inference speed, and is difficult to deploy on edge devices; (2) Linear models (such as DLinear): This type of model has a simple structure and fast inference speed, and achieves efficient prediction through seasonal-trend decomposition, but it is difficult to capture complex nonlinear fluctuations and frequency domain features.
[0064] Figure 4 The model complexity and parameter count of different methods on the ETTh1 dataset are compared. The results show that the proposed method (TimeFreqMixer) maintains high-precision prediction while keeping the computational cost and parameter count at a lightweight level, which is significantly better than mainstream deep models such as Informer, Autoformer, and PatchTST. Although the computational cost is higher than that of the minimal linear model DLinear, the prediction accuracy is much better than that of DLinear. It achieves the optimal balance between prediction accuracy and inference efficiency, meeting the requirements of real-time scheduling and edge deployment of power systems.
[0065] As shown in Table 1, with prediction lengths of 96, 192, 336, and 720 hours, the MSE and MAE of the method proposed in this invention (Ours) are significantly better than those of mainstream models such as PatchTST, DLinear, Informer, and Autoformer. Taking a prediction length of 96 hours as an example, the mean squared error of this invention is 0.372, and the mean absolute error is 0.397, while the best-performing model among the other models, PatchTST, achieves 0.460 and 0.447, respectively. Even with the longest prediction length of 720 hours, this invention maintains a mean squared error of 0.457 and a mean absolute error of 0.465, while the mean squared error of Informer has increased to 1.181, fully demonstrating the high accuracy and strong stability of this invention in multi-step prediction tasks.
[0066] Table 1. Prediction results of different methods on the ETTh1 dataset. This invention systematically solves the technical problems of insufficient feature extraction, unstable cross-domain fusion, and high model complexity in power load forecasting through the synergistic effect of learnable time-frequency analysis, robust logarithmic domain fusion, and time-frequency consistency constraints. It has significant technical progress and practical value.
[0067] Finally, it should be noted that any parts of this invention not described in detail are prior art. Those skilled in the art will understand that the above descriptions are merely preferred embodiments of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, those skilled in the art can still modify the technical solutions described in the foregoing examples or make equivalent substitutions for some of the technical features. All modifications and equivalent substitutions made within the spirit and principles of the invention should be included within the scope of protection of the invention.
Claims
1. A lightweight power load forecasting method based on time-frequency collaborative modeling, characterized in that, Includes the following steps: S1. Construct a learnable time-frequency modeling branch to extract the frequency domain periodicity and energy distribution characteristics of the load sequence, thereby obtaining time-frequency features. Among them, the load sequence is transformed to the time-frequency domain using short-time Fourier transform. This short-time Fourier transform contains a learnable scaling factor, which is adaptively updated through the backpropagation algorithm to achieve dynamic adjustment of time-frequency resolution. S2. Construct a time-domain trend-fluctuation modeling branch to extract the long-term trend and short-term fluctuation characteristics of the load sequence, and obtain the time-domain characteristics; S3. Based on the logarithmic steady-state time-frequency assumption, the time-frequency features and the time-domain features are adaptively fused in the logarithmic domain to obtain fused features; wherein, the time-frequency features and the time-domain features are first subjected to logarithmic transformation and geometric mean respectively to achieve preliminary alignment, and then weighted fusion is performed by dynamically calculating the fusion weight through a learnable gating unit. S4. During the model training phase, a time-frequency consistency constraint is introduced, and a total loss function is constructed that includes time-domain prediction loss and time-frequency feature consistency loss, so as to jointly optimize the consistency between time-domain prediction error and the time-frequency features. S5. The fused features are mapped to the final power load prediction value through a lightweight network structure.
2. The lightweight power load forecasting method based on time-frequency collaborative modeling according to claim 1, characterized in that, S1 specifically includes: S1.1, Input power load time series Perform a learnable short-time Fourier transform to obtain the complex spectrum. The window function of the transformation Includes learnable scaling factors During model initialization, the scaling factor is set. Assign a preset scale value; during training, As trainable parameters of the network, they are adaptively updated via the backpropagation algorithm; S1.2 Calculate the complex spectrum amplitude spectrum and retain the previous One low-frequency component is used to reduce high-frequency noise and decrease computational complexity; S1.
3. Perform depthwise separable convolution and pointwise convolution operations sequentially on the low-frequency amplitude spectrum to obtain the convolution features. ; S1.4, in the convolution features A local attention mechanism is introduced to obtain the final time-frequency features by calculating the linear projection and weighted sum of the query, key, and value. .
3. A lightweight power load forecasting method based on time-frequency collaborative modeling according to claim 2, characterized in that, S2 specifically includes: S2.1, For the input power load time series Perform moving average decomposition to obtain trend components. and seasonal fluctuation components ,in ; S2.2, Regarding the seasonal fluctuation components A gating mechanism is introduced to calculate the time weight matrix using learnable parameters. and to By applying weights, we obtain the weighted volatility characteristics. ; S2.3, the trend components With weighted fluctuation characteristics The features are concatenated and then nonlinearly mapped through at least one fully connected layer to obtain the final temporal features. .
4. A lightweight power load forecasting method based on time-frequency co-modeling according to claim 3, characterized in that, S3 specifically includes: S3.1, Time-frequency characteristics With time domain characteristics Perform logarithmic transformations on each part and calculate their geometric mean in the logarithmic domain to obtain the preliminary alignment features. : in, It is the numerical stability constant; S3.2, Dynamically calculate the fusion weights of time-domain and time-frequency features using learnable gating units. The time-domain features and time-frequency features are then weighted and fused to obtain preliminary fused features. : in, The weight matrix is a learnable matrix. Indicates feature splicing, For learnable bias terms, For the Sigmoid function, This indicates element-wise multiplication; S3.3, Regarding the preliminary fusion features Exponential smoothing and layer normalization are performed to obtain stable and smooth final fusion features. , used for subsequent predictions.
5. A lightweight power load forecasting method based on time-frequency collaborative modeling according to claim 1, characterized in that, S4 specifically includes: Define the total loss function For time-domain prediction loss Consistency loss with time-frequency features Weighted sum: in, For balance coefficient, The power load forecast sequence output by the model. For the actual power load sequence Time-frequency feature consistency loss Electricity load forecasting sequence The mean square error between the short-time Fourier transform time-frequency features and the time-frequency features extracted by the learnable time-frequency modeling branch: in, The time-frequency features extracted for the learnable time-frequency modeling branch. This represents the short-time Fourier transform.
6. A lightweight power load forecasting method based on time-frequency co-modeling according to claim 2, characterized in that, In the learnable short-time Fourier transform, multiple transform branches are set, each corresponding to a different learnable scaling factor. During model initialization, each branch... Assign a preset set of scales; During the training process, The trainable parameters of the network are adaptively updated via backpropagation to dynamically adjust the window width of each branch.
7. A lightweight power load forecasting method based on time-frequency co-modeling according to claim 2, characterized in that, The depthwise separable convolution includes two independent operations: channel-wise convolution and point-wise convolution. Channel-wise convolution is used to extract local frequency features independently by frequency band, while point-wise convolution is used to realize feature interaction between frequency bands.
8. A lightweight power load forecasting method based on time-frequency collaborative modeling according to claim 3, characterized in that, The gating mechanism employs a two-layer fully connected structure. The first layer is used for feature mapping and utilizes the ReLU activation function. The second layer generates a value within the range specified by the Sigmoid function. The time weighting matrix is used to control the seasonal fluctuation components. Adaptive weighting.
9. A lightweight power load forecasting method based on time-frequency co-modeling according to claim 4, characterized in that, The gating unit adopts a two-layer fully connected structure. The first layer is a feature mapping layer, and the second layer is a weight generation layer, which generates weights within a range using the Sigmoid function. The fusion weights are used to adaptively balance the contributions of time-domain features and time-frequency features in the fusion process.
10. A lightweight power load forecasting method based on time-frequency collaborative modeling according to claim 1, characterized in that, The lightweight network structure includes: using depthwise separable convolution in the learnable time-frequency modeling branch, using a gating mechanism and lightweight fully connected layers in the time-domain trend-fluctuation modeling branch, and using lightweight gating units in the logarithmic domain adaptive fusion module.