A power load prediction method based on dynamic convolution and causal multi-scale network and related equipment

The power load forecasting method using dynamic convolution and causal multi-scale networks solves the problem of the inability to predict peak times in existing technologies, achieving accurate prediction of power load values ​​and reliable early warning of peak periods, thus improving the grid dispatching capability.

CN123073701APending Publication Date: 2026-11-10GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611051822.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-15
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing technologies only predict power load values ​​and cannot effectively prevent power outages caused by peak hours.

Method used

A power load forecasting method based on dynamic convolution and causal multi-scale networks is adopted. By collecting the influence features of multi-source power load, automatic semantic clustering and dynamic convolution branching are performed. Combined with a causal multi-scale mixer, the power load value and peak occurrence probability prediction results are output.

Benefits of technology

It enables accurate prediction of power load values ​​and reliable early warning of peak periods, avoiding power outages and improving the grid's dispatching capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123073701A_ABST
    Figure CN123073701A_ABST
Patent Text Reader

Abstract

The application provides a power load prediction method based on dynamic convolution and causal multi-scale network and related equipment, belonging to the technical field of power system load prediction. The method comprises the following steps: collecting multi-source power load influence characteristics, organizing all input characteristics into an input tensor; automatically performing semantic clustering on each characteristic dimension in the input tensor, and dividing characteristics with statistical homogeneity into different characteristic groups; inputting each characteristic group into an independent dynamic convolution branch respectively to obtain the final output of each dynamic convolution branch; splicing the final outputs of all dynamic convolution branches to obtain spliced characteristics; inputting the spliced characteristics into a causal multi-scale mixer to construct a unified multi-scale representation vector; feeding the unified multi-scale representation vector into a regression prediction head and a classification warning head respectively to output power load numerical prediction results and peak occurrence probability prediction results in a future period. The application can realize accurate prediction of power load values.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power system load forecasting technology, and in particular to a power load forecasting method and related equipment based on dynamic convolution and causal multi-scale networks. Background Technology

[0002] In related technologies, simply predicting power load values ​​is sufficient. However, in smart grids, power companies also need to prevent "peak hours," which can lead to power outages and rationing.

[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention

[0004] The main objective of this application is to propose a power load prediction method and related equipment based on dynamic convolution and causal multi-scale networks, which can achieve accurate prediction of power load values.

[0005] To achieve the above objectives, one aspect of this application proposes a power load forecasting method based on dynamic convolution and causal multi-scale networks, the method comprising the following steps: Collect multi-source power load impact characteristics, including environmental factors, social events, and time series characteristics, and organize all input characteristics into input tensors; An optimized K-means algorithm is used to automatically perform semantic clustering on each feature dimension in the input tensor, dividing features with statistical homogeneity into different feature groups; Each of the aforementioned feature groups is input into an independent dynamic convolution branch. Each of the dynamic convolution branches adaptively selects the most matching convolution kernel from the candidate convolution kernel pool according to the state of the current time step, extracts state-adaptive local features for each of the aforementioned feature groups, and obtains the final output of each of the dynamic convolution branches. The final outputs of all the dynamic convolution branches are concatenated to obtain the concatenated features; The concatenated features are input into a causal multi-scale mixer, which processes sequences with different time spans through multiple parallel branches. The upper triangular linear transformation is used to make the output of each time step dependent on the historical input, and the multi-scale time dependencies are aggregated to construct a unified multi-scale representation vector. The unified multi-scale representation vector is fed into the regression prediction head and the classification early warning head respectively, and the numerical prediction results of power load and the prediction results of peak occurrence probability for future periods are output.

[0006] In some embodiments, the acquisition of multi-source power load impact characteristics includes environmental factors, social events, and time series characteristics. All input characteristics are organized into an input tensor, including: Collect environmental factor characteristics; the environmental factor characteristics include ambient temperature, cloud cover, solar radiation and precipitation data; Collect social event characteristics; these social event characteristics include holiday information and festival information. Collect time series features; the time series features include historical load data with hourly lag, daily lag, weekly lag, and annual lag; The collected environmental factor features, social event features, and time series features are aligned by time and organized into an input tensor.

[0007] In some embodiments, the step of using an optimized K-means algorithm to automatically semantically cluster each feature dimension in the input tensor, dividing features with statistical homogeneity into different feature groups, includes: The centroids of the K-means algorithm are initialized using a probabilistic distance mechanism. For each data point in the input tensor, the shortest Euclidean distance from the data point to the currently selected nearest centroid is calculated. Based on the proportion of the square of the shortest Euclidean distance to the sum of the squares of the shortest Euclidean distances of all data points, the next initial centroid is probabilistically selected, resulting in an initialized set of centroids. Perform distance calculation, feature allocation, and centroid update; the distance calculation is to calculate the Euclidean distance from each data point to the current centroid; the feature allocation is to assign each data point to the feature group represented by the centroid with the nearest Euclidean distance, and obtain the allocation result of the feature group to which each data point belongs; the centroid update is to use the mean of all data points in the same feature group as the updated centroid, and obtain the updated centroid. Using the updated centroid as the current centroid, return to the steps of performing distance calculation, feature allocation, and centroid update, and proceed to the next iteration; After iterating to the preset conditions, the elbow rule is used to determine the optimal number of clusters, complete the feature grouping, and obtain the final different feature groups.

[0008] In some embodiments, the step of inputting each of the feature groups into an independent dynamic convolution branch, and each dynamic convolution branch adaptively selecting the best-matching convolution kernel from the candidate convolution kernel pool according to the state of the current time step, extracting state-adaptive local features for each of the feature groups, and obtaining the final output of each dynamic convolution branch, includes: Each feature group is configured with an independent dynamic convolution branch, and a parameter pool containing multiple candidate convolution kernels is set within each dynamic convolution branch; Global average pooling is performed on the time series of each feature group, and each feature group is aggregated into a state feature vector along the time dimension. The state feature vector is mapped through a fully connected layer and used as a query vector. The matching score between the query vector and the key of each candidate convolutional kernel is calculated. At each time step, the candidate convolutional kernel with the highest matching score is selected as the matching convolutional kernel for that time step, and an index map is generated based on the selection results of each time step. The time series of each feature group are processed by all the candidate convolution kernels in the parameter pool to obtain the candidate output of each candidate convolution kernel; Slicing is performed on the candidate outputs according to the index graph, and the candidate outputs corresponding to the matching convolution kernels are extracted at each time step as the final outputs of each dynamic convolution branch.

[0009] In some embodiments, concatenating the final outputs of all the dynamic convolutional branches to obtain the concatenated features includes: Obtain the final output of each of the dynamic convolution branches, wherein the final output of each of the dynamic convolution branches contains local temporal feature information of its corresponding feature group; The final outputs of all the dynamic convolution branches are concatenated along the channel dimension, and the resulting feature tensor is used as the concatenated feature.

[0010] In some embodiments, the concatenated features are input into a causal multi-scale mixer, which processes sequences with different time spans through multiple parallel branches, and uses an upper triangular linear transformation to make the output of each time step dependent on the historical input, aggregating multi-scale time dependencies to construct a unified multi-scale representation vector, including: The concatenated features are used as input tensors and distributed to several parallel branches; In the first branch, the original length time series is used as the processing object to capture high-frequency short-term micro-local fluctuations that meet the preset conditions, thus obtaining the first-scale time features; In subsequent branches, non-overlapping downsampling of the time dimension is performed using strided one-dimensional convolution. The downsampling stride and convolution kernel size of each branch are equal, and the stride and convolution kernel size of each branch increase with the branch number, resulting in multiple downsampled feature maps with different resolutions. The first-scale time feature and each of the downsampled feature maps are respectively input into their respective causal time mixing blocks for processing. Each causal time mixing block uses an upper triangular linear transformation to make the output of each time step dependent on the historical input, thereby obtaining multiple causal time features with different resolutions. All the causal temporal features of different resolutions are flattened, and all the flattened causal temporal features are concatenated to construct a unified multi-scale representation vector.

[0011] In some embodiments, feeding the unified multi-scale representation vector into the regression prediction head and the classification early warning head respectively, and outputting the numerical prediction results of power load and the prediction results of peak occurrence probability for future periods, includes: The unified multi-scale representation vector is simultaneously fed into the branches of the regression prediction head and the classification warning head, respectively. In the regression prediction head, the unified multi-scale representation vector is mapped to the numerical prediction result of power load, and the smoothed L1 loss value is calculated using the smoothed L1 loss function; In the classification warning head, the unified multi-scale representation vector is activated by the Sigmoid function and mapped to a binary classification prediction result, outputting the probability of triggering extreme peak load in a specific future period, and the binary cross-entropy loss value is calculated using the binary cross-entropy loss function. When jointly training the regression prediction head and the classification early warning head, a homoscedastic uncertainty weighting strategy is used to dynamically balance the contribution weights of the two tasks to the total loss function. The weights of the smoothed L1 loss value and the binary cross-entropy loss value are adjusted by a learnable observation noise parameter. The weighted sum of the smoothed L1 loss value and the binary cross-entropy loss value is used as the total loss for joint optimization to obtain the numerical prediction results of power load and the prediction results of peak occurrence probability for future periods. The observation noise parameter is used to capture the inherent uncertainty of each task. The larger the noise parameter, the lower the weight of the corresponding task, and vice versa.

[0012] To achieve the above objectives, another aspect of this application proposes a power load forecasting system based on dynamic convolution and causal multi-scale networks, for implementing the method described above. The system includes: The data acquisition and encoding module is used to collect the characteristics of multi-source power load impact, including environmental factors, social events and time series features, and organize all input features into input tensors; The feature grouping module is used to automatically perform semantic clustering on each feature dimension in the input tensor using an optimized K-means algorithm, and to divide features with statistical homogeneity into different feature groups. The dynamic convolution processing module is used to input each of the feature groups into an independent dynamic convolution branch. Each dynamic convolution branch adaptively selects the most matching convolution kernel from the candidate convolution kernel pool according to the state of the current time step, extracts local features that are state-adaptive to each of the feature groups, and obtains the final output of each dynamic convolution branch. The feature concatenation module is used to concatenate the final outputs of all the dynamic convolution branches to obtain the concatenated features. The causal multi-scale mixing module is used to input the concatenated features into the causal multi-scale mixer, process sequences with different time spans through multiple parallel branches, and use the upper triangular linear transformation to make the output of each time step dependent on the historical input, aggregate the multi-scale time dependencies, and construct a unified multi-scale representation vector. The multi-task prediction module is used to feed the unified multi-scale representation vector into the regression prediction head and the classification early warning head respectively, and output the power load numerical prediction results and peak occurrence probability prediction results for future periods.

[0013] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above.

[0014] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.

[0015] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer program product, including a computer program that, when executed by a processor, implements the aforementioned method.

[0016] The embodiments of this application include at least the following beneficial effects: This application provides a power load forecasting method, system, electronic device, storage medium, and program product based on dynamic convolution and causal multi-scale networks. The method includes: collecting multi-source power load influence features and organizing all input features into an input tensor; performing automatic semantic clustering on each feature dimension in the input tensor, dividing features with statistical homogeneity into different feature groups; inputting each feature group into an independent dynamic convolution branch to obtain the final output of each dynamic convolution branch; concatenating the final outputs of all dynamic convolution branches to obtain concatenated features; inputting the concatenated features into a causal multi-scale mixer to construct a unified multi-scale representation vector; feeding the unified multi-scale representation vector into a regression prediction head and a classification early warning head respectively, and outputting the power load numerical prediction result and peak occurrence probability prediction result for future periods. This application can achieve accurate prediction of power load values. Attached Figure Description

[0017] Figure 1 This is a flowchart of the power load forecasting method based on dynamic convolution and causal multi-scale networks provided in the embodiments of this application; Figure 2 This is a schematic diagram of the overall architecture of the design model provided in the embodiments of this application; Figure 3This is a model diagram of dynamic convolution provided in the embodiments of this application; Figure 4 This is a schematic diagram of a multi-scale network provided in an embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.

[0019] Unless otherwise defined, 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 belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0020] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.

[0021] 1) Peak moment: The maximum instantaneous power demand experienced by the power grid or a certain power consumption area within a specific time period.

[0022] 2) Receptive field: In convolutional neural networks or temporal networks, the historical time window span that an output node of a certain layer of the network can "see" or associate with the input features.

[0023] 3) Look-ahead Bias: When building or backtesting a model, the model inadvertently uses "future information" that has not yet occurred at the current point in time (i.e., future information leakage), which causes the model to overperform in historical data but fail in reality.

[0024] 4) Homoscedasticity Uncertainty Weighting: An advanced loss function balancing strategy for multi-task learning. It treats the loss weights of different tasks (such as regression and classification tasks) as learnable parameters (representing the inherent uncertainty or difficulty of the task itself) and dynamically and adaptively adjusts them during training to prevent the gradient of one task from dominating the update of the entire network.

[0025] 5) Optimized K-means Algorithm: This is the core preprocessing method used in this invention for automatic semantic grouping of input features. Unlike the traditional K-means algorithm, this invention introduces the following key optimizations based on the standard K-means clustering process: First, a probabilistic distance mechanism is used to initialize centroids. For each data point in the input tensor, the shortest Euclidean distance from that data point to the currently selected nearest centroid is calculated. Based on the proportion of the square of this shortest Euclidean distance to the sum of the squares of the distances of all data points, the next initial centroid is probabilistically selected, ensuring that the initial centroids have good representativeness and avoiding the local optima problem caused by traditional random initialization. Second, distance calculation, feature assignment, and centroid update are executed alternately. Feature assignment assigns each data point to the feature group represented by the centroid with the closest Euclidean distance. Centroid update uses the mean of all data points within the same feature group as the updated centroid. Through iterative iteration, the grouping results gradually converge to the optimal value. Third, after iterating to meet preset conditions, the elbow rule is used to determine the optimal number of clusters, giving the number of groups an objective mathematical basis. Through this optimized clustering process, features with statistical homogeneity are automatically grouped into the same feature group, effectively avoiding mutual interference between features from different sources and reducing the learning pressure on the subsequent dynamic convolution module.

[0026] 6) Causal Multi-Scale Mixer: This is the core network module in this invention used to aggregate multi-scale temporal dependencies and strictly prevent future information leakage. This module uses the concatenated comprehensive local features as input tensors, distributing them to several parallel branches. Each branch processes sequences with different time spans: the first branch processes the original length time series, capturing high-frequency short-term microscopic local fluctuations; subsequent branches use strided one-dimensional convolutions to perform non-overlapping downsampling on the time dimension. The downsampling stride and convolution kernel size of each branch increase with the branch number, resulting in multiple downsampled feature maps with different resolutions. Each branch has a dedicated causal temporal mixing block, which consists of layer normalization, a first upper triangular linear transformation, a GELU activation function, a second upper triangular linear transformation, and residual connections, sequentially connected. The upper triangular linear transformation multiplies the weight matrix of the linear transformation with the upper triangular mask matrix, ensuring that the output of each time step depends only on the current and previous historical inputs, cutting off the information leakage channel from future time steps to historical time steps. Finally, the outputs of all branches are flattened and concatenated to construct a unified multi-scale representation vector.

[0027] 7) Regression Prediction Head: This is a dedicated branch network in this invention used to output specific numerical values ​​of power load. This branch receives a unified multi-scale representation vector from the causal multi-scale mixer as input, and transforms it into a specific numerical prediction result of power load through a learnable linear mapping layer. Its aim is to accurately depict the daily load baseline and smooth fluctuation trajectory. During model training, the regression prediction head uses a smooth L1 loss function to calculate the loss between its predicted value and the actual load value. This loss function is insensitive to outliers, effectively enhancing the model's robustness to extreme load data and preventing outliers at individual peak times from dominating the gradient update direction, thereby ensuring the stability and accuracy of daily load prediction.

[0028] 8) Classification Early Warning Head: This is a dedicated branch network in this invention used to output the probability of peak load occurrence. This branch also receives the unified multi-scale representation vector output by the causal multi-scale mixer as input, and after mapping by the Sigmoid activation function, produces a binary classification prediction result, outputting the probability value of triggering extreme peak loads in a specific future period. During the model training phase, the classification early warning head uses a binary cross-entropy loss function to calculate the loss between its predicted probability and the actual peak label. Through this classification early warning head, the model can accurately predict load values ​​while identifying risky periods where peak loads may occur, providing early warning information for power grid dispatchers to handle peak loads.

[0029] 9) Smoothing L1 loss function: The task loss function used in the regression prediction head of this invention is used to measure the difference between the numerical prediction result of power load and the actual value.

[0030] 10) Sigmoid function: The activation function at the end of the classification warning head in this invention is used to map the original output of the network to the probability space, specifically outputting the probability value of triggering extreme peak load in a specific period of the future.

[0031] 11) Binary cross-entropy loss function: The task-specific loss function used in the classification warning head of this invention is used to measure the difference between the predicted peak occurrence probability and the actual peak label.

[0032] 12) GELU activation function (Gaussian Error Linear Unit): The nonlinear activation function used in the causal-temporal hybrid block in this invention.

[0033] 13) MLP (Multilayer Perceptron): The core infrastructure of the causal multiscale mixer in this invention.

[0034] 14) TriU (Triangular Upper): The core network layer of the causal-temporal hybrid block in this invention, used to achieve temporal dimension mapping of features while ensuring temporal causality.

[0035] In related technologies, early statistical models relied on strict linear assumptions and the premise of data stationarity, making it difficult to fit the nonlinear characteristics of power load. Subsequently, shallow machine learning algorithms improved nonlinear fitting capabilities by introducing kernel functions and ensemble strategies, but their feature extraction efficiency is often limited when faced with massive amounts of time-series data with long-term dependencies.

[0036] In view of this, this application provides a power load forecasting method and related equipment based on dynamic convolution and causal multi-scale networks. This scheme uses an optimized K-means algorithm to automatically semantically group multi-source heterogeneous features to eliminate mutual interference between different features. Then, a grouped dynamic convolution module adaptively selects the most matching convolution kernel for each feature group to extract state-sensitive local temporal features. Subsequently, all branch features are concatenated and input into a causal multi-scale mixer based entirely on a multilayer perceptron. This mixer processes sequences with different time spans through multiple parallel branches and uses an upper triangular linear transformation matrix to strictly cut off data dependencies on future time steps to prevent information leakage, thereby safely aggregating multi-scale time dependencies. Finally, the learned unified multi-scale representation is simultaneously fed into a regression prediction head and a classification early warning head to achieve accurate prediction of power load values ​​and reliable early warning for peak periods.

[0037] Figure 1 This is an optional flowchart of the power load forecasting method based on dynamic convolution and causal multi-scale networks provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S101 to S106.

[0038] Step S101: Collect multi-source power load impact characteristics, including environmental factors, social events and time series characteristics, and organize all input characteristics into input tensors; Step S102: The optimized K-means algorithm is used to automatically perform semantic clustering on each feature dimension in the input tensor, and the features with statistical homogeneity are divided into different feature groups. Step S103: Input each feature group into an independent dynamic convolution branch. Each dynamic convolution branch adaptively selects the most matching convolution kernel from the candidate convolution kernel pool according to the state of the current time step, extracts the state-adaptive local features for each feature group, and obtains the final output of each dynamic convolution branch. Step S104: Concatenate the final outputs of all dynamic convolution branches to obtain the concatenated features; Step S105: Input the concatenated features into the causal multi-scale mixer, process sequences with different time spans through multiple parallel branches, and use the upper triangular linear transformation to make the output of each time step dependent on the historical input, aggregate the multi-scale time dependencies, and construct a unified multi-scale representation vector. Step S106: Feed the unified multi-scale representation vector into the regression prediction head and the classification early warning head respectively, and output the numerical prediction results of power load and the prediction results of peak occurrence probability for future periods.

[0039] Steps S101 to S106 of this embodiment provide a unified and complete input foundation for subsequent models by organizing multi-source heterogeneous features into input tensors. An optimized K-means algorithm is used to automatically semantically cluster features, grouping statistically homogeneous features into the same feature group, avoiding mutual interference between different source features and reducing the learning pressure on subsequent convolutional modules. Each feature group is dynamically selected by an independent convolutional branch based on the current market state, allowing the network to flexibly adjust its receptive field and processing mechanism to accurately extract state-sensitive local temporal features. The outputs of all branches are concatenated and fused to form a complete local feature representation. Multiple parallel branches of a causal multi-scale mixer capture the sequence patterns across different time spans, and upper triangular linear transformation is used to strictly cut off dependence on future information, eliminating data leakage problems. The pure MLP architecture keeps the model lightweight. A unified multi-scale representation is simultaneously fed into both regression and classification prediction heads, achieving the dual functions of accurate power load prediction and reliable early warning during peak periods, while improving the model's generalization ability through multi-task learning. Ultimately, the entire solution achieved the joint task of numerical prediction of power load and peak warning in a lightweight and highly accurate manner, while preventing future information leaks.

[0040] In some embodiments, step S101 may include, but is not limited to, steps S111 to S114: Step S111: Collect environmental factor characteristics; environmental factor characteristics include ambient temperature, cloud cover, solar radiation, and precipitation data; Step S112: Collect social event characteristics; social event characteristics include holiday information and festival information; Step S113: Collect time series features; the time series features include historical load data with hourly lag, daily lag, weekly lag, and annual lag. Step S114: Align the collected environmental factor features, social event features, and time series features according to time and organize them into an input tensor.

[0041] In steps S111 to S114 of some embodiments, environmental factors such as ambient temperature, cloud cover, solar radiation, and precipitation, social events such as holidays and festivals, and time series features with hourly, daily, weekly, and annual lags are collected. All multi-source heterogeneous features are aligned by time and organized into a unified input tensor. This embodiment integrates the originally scattered and varied factors affecting power load into a standardized data format that the model can process, providing a unified and complete input foundation for all subsequent calculation steps, avoiding information loss or processing deviations caused by inconsistent data formats. For example, the specific feature types collected are further defined (ambient temperature, cloud cover, solar radiation, precipitation, holidays, festivals, hourly, daily, weekly, and annual lags). These features comprehensively cover the main external factors and historical patterns affecting power load, ensuring the model has sufficient information sources from the outset and laying a data foundation for accurate prediction.

[0042] In some embodiments, step S102 may include, but is not limited to, steps S201 to S204: Step S201: Initialize the centroids of the K-means algorithm through a probabilistic distance mechanism. For each data point in the input tensor, calculate the shortest Euclidean distance from the data point to the currently selected nearest centroid, and probabilistically select the next initial centroid based on the proportion of the square of the shortest Euclidean distance to the sum of the squares of the shortest Euclidean distances of all data points, thus obtaining the initialized centroid set. Step S202: Perform distance calculation, feature assignment, and centroid update; distance calculation involves calculating the Euclidean distance from each data point to each current centroid; feature assignment involves assigning each data point to the feature group represented by the centroid with the closest Euclidean distance, thus obtaining the assignment result of the feature group to which each data point belongs; centroid update involves using the mean of all data points in the same feature group as the updated centroid, thus obtaining the updated centroid. Step S203: Using the updated centroid as the current centroid, return to the steps of distance calculation, feature allocation, and centroid update, and proceed to the next iteration; Step S204: After iterating to the preset conditions, the elbow rule is used to determine the optimal number of clusters, complete the feature grouping, and obtain the final different feature groups.

[0043] In steps S201 to S204 of some embodiments, an optimized K-means algorithm is used to initialize the centroid through a probabilistic distance mechanism. Distance calculation, feature allocation, and centroid updating are performed alternately until a preset condition is met. Then, the elbow rule is used to determine the optimal number of clusters, grouping statistically homogeneous features into the same feature group. This embodiment automatically groups features with similar statistical properties into one group, avoiding mutual interference between different source features such as environmental factors, social events, and time series. This makes the features within each group purer and more homogeneous, thereby reducing the learning pressure on the subsequent dynamic convolution module and improving the efficiency and stability of model training. For example, the specific clustering process is further defined by using a probabilistic distance mechanism to initialize the centroid, assigning features using the shortest Euclidean distance, and updating the centroid with the mean within the group. This process ensures the optimality and reproducibility of the grouping results, providing quality assurance for the subsequent processing of each feature group by a dedicated convolution branch. This makes the grouping operation no longer a black box, but a reliable process with clear mathematical basis.

[0044] In some embodiments, step S103 may include, but is not limited to, steps S301 to S306: Step S301: Configure an independent dynamic convolution branch for each feature group, and set a parameter pool containing multiple candidate convolution kernels within each dynamic convolution branch; Step S302: Perform global average pooling on the time series of each feature group, and aggregate each feature group into a state feature vector along the time dimension; Step S303: Map the state feature vector through a fully connected layer to use it as a query vector, and calculate the matching score between the query vector and the key of each candidate convolutional kernel. Step S304: At each time step, select the candidate convolutional kernel with the highest matching score as the matching convolutional kernel for that time step, and generate an index map based on the selection results at each time step. Step S305: Process the time series of each feature group through all the candidate convolution kernels in the parameter pool to obtain the candidate output of each candidate convolution kernel; Step S306: Perform a slicing operation on the candidate outputs according to the index map, and extract the candidate outputs corresponding to the matching convolution kernels at each time step as the final outputs of each dynamic convolution branch.

[0045] In steps S301 to S306 of some embodiments, an independent dynamic convolutional branch is configured for each feature group. Each branch sets a parameter pool containing multiple candidate convolutional kernels. The state feature vector is aggregated by global average pooling, mapped to a query vector through a fully connected layer, and then the matching score with each candidate convolutional kernel key is calculated. At each time step, the convolutional kernel with the highest score is selected and an index map is generated. Finally, the convolutional result of the matching kernel is extracted as the output based on the index map through slicing operations. In this embodiment, different feature groups have independent and learnable convolutional branches, avoiding parameter interference between feature groups. At the same time, each branch can dynamically select the most suitable convolutional kernel from the candidate kernel pool according to the market micro-state at the current time step, enabling the network to flexibly adjust the receptive field size and processing mechanism, extract state-sensitive local temporal features, and enhance the model's ability to characterize complex and variable local patterns in power load data. For example, the specific execution process is further defined, including global average pooling aggregation state, fully connected layer generating query vector, calculating matching score, generating index graph, and slicing operation to extract matching kernel output. This complete dynamic routing mechanism ensures that the optimal convolution kernel can be selected at each time step, making the feature extraction process highly adaptable to different states and improving the model's response sensitivity to local fluctuations in the load data.

[0046] In some embodiments, step S104 may include, but is not limited to, steps S401 to S402: Step S401: Obtain the final output of each dynamic convolution branch. The final output of each dynamic convolution branch contains the local temporal feature information of its corresponding feature group. Step S402: Concatenate the final outputs of all dynamic convolution branches along the channel dimension, and use the concatenated feature tensor as the concatenated feature.

[0047] In steps S401 to S402 of some embodiments, the final outputs of all dynamic convolution branches are concatenated along the channel dimension to form a unified and fused comprehensive local feature representation. In this embodiment, the local temporal features extracted from each feature group through dynamic convolution are combined, allowing local information from different sources and of different natures to be integrated and complementary, forming a more complete local feature expression. This provides input rich in multi-dimensional local information for subsequent causal multi-scale networks, avoiding premature loss or fragmentation of information after branch processing. For example, the specific operation of obtaining the final outputs containing local temporal feature information from each branch and concatenating them along the channel dimension is further defined. This concatenation method ensures the independence and integrity of the features of each branch, enabling the subsequent causal multi-scale mixer to simultaneously utilize the information of all feature groups for global dependency modeling, achieving lossless information transfer from local to global.

[0048] In some embodiments, step S105 may include, but is not limited to, steps S501 to S505: Step S501: The concatenated features are used as input tensors and distributed to several parallel branches; Step S502: In the first branch, the original length time series is used as the processing object to capture high-frequency short-term micro-local fluctuations that meet the preset conditions, and the first-scale time features are obtained. In step S503, in the subsequent multiple branches, non-overlapping downsampling of the time dimension is performed using strided one-dimensional convolution. The downsampling stride and convolution kernel size of each branch are equal, and the stride and convolution kernel size of each branch increase with the increase of the branch number, resulting in multiple downsampled feature maps with different resolutions. Step S504: Input the first-scale time features and each downsampled feature map into their respective causal time mixing blocks for processing. Each causal time mixing block uses an upper triangular linear transformation to make the output of each time step dependent on the historical input, thus obtaining multiple causal time features with different resolutions. Step S505: Flatten all causal temporal features of different resolutions, and then concatenate all flattened causal temporal features to construct a unified multi-scale representation vector.

[0049] In steps S501 to S505 of some embodiments, the concatenated features are assigned to several parallel branches. The first branch processes the original length sequence to capture high-frequency short-term micro-local fluctuations. Subsequent branches perform non-overlapping downsampling through strided one-dimensional convolution (the stride and kernel size increase with the branch number). Each branch is processed by a dedicated causal temporal mixing block (including layer normalization, two upper triangular linear transformations, GELU activation function, and residual connections). Finally, the outputs of all branches are flattened and concatenated into a unified multi-scale representation vector. In this embodiment, multiple parallel branches capture the sequence patterns at different time scales (from high-frequency short-term to low-frequency long-term), enabling the model to simultaneously perceive the micro-fluctuations and macro-trends of the load data. At the same time, the upper triangular linear transformation in each branch explicitly cuts off the dependence on future time steps through a mask matrix, structurally eliminating the data leakage problem and ensuring the reliability of the model in real-time prediction scenarios. In addition, the attention-free mechanism design based entirely on MLP results in a small number of model parameters and fast inference speed, making it suitable for real-time application requirements in actual deployment. For example, the specific processes include further defining the allocation of several parallel branches, the first branch capturing high-frequency short-term fluctuations, subsequent branches downsampling through stride convolution with increasing step size and kernel size, upper triangular linear transformation in the causal-temporal hybrid block to make the output of each time step dependent on historical input, and flattening and splicing to construct multi-scale representation vectors. This complete multi-scale causal architecture ensures that the model can prevent look-ahead bias and fully perceive the power load change patterns of different time spans, achieving accurate modeling of complex time dependencies while being lightweight.

[0050] In some embodiments, step S106 may include, but is not limited to, steps S601 to S604: Step S601: The unified multi-scale representation vector is simultaneously fed into the branches of the regression prediction head and the classification warning head, respectively. Step S602: In the regression prediction head, the unified multi-scale representation vector is mapped to the numerical prediction result of power load, and the smoothed L1 loss value is calculated using the smoothed L1 loss function. Step S603: In the classification warning head, the unified multi-scale representation vector is activated by the Sigmoid function and mapped to the binary classification prediction result. The probability of triggering extreme peak load in a specific period in the future is output, and the binary cross-entropy loss value is calculated using the binary cross-entropy loss function. In step S604, when jointly training the regression prediction head and the classification early warning head, a homoscedastic uncertainty weighting strategy is used to dynamically balance the contribution weights of the two tasks to the total loss function. The weights of the smoothed L1 loss value and the binary cross-entropy loss value are adjusted by a learnable observation noise parameter, and the weighted sum of the smoothed L1 loss value and the binary cross-entropy loss value is used as the total loss for joint optimization to obtain the numerical prediction results of the power load and the prediction results of the peak occurrence probability for future periods. The observation noise parameter is used to capture the inherent uncertainty of each task. The larger the noise parameter, the lower the weight of the corresponding task, and vice versa.

[0051] In steps S601 to S604 of some embodiments, a unified multi-scale representation vector is simultaneously fed into the regression prediction head and the classification early warning head. The regression branch uses a smoothed L1 loss function to output the numerical prediction result of power load, and the classification branch, after being activated by Sigmoid, uses a binary cross-entropy loss function to output the prediction result of peak occurrence probability. A homoscedastic uncertainty weighting strategy is introduced during joint training to dynamically balance the loss weights of the two tasks through learnable observation noise parameters. In this embodiment, a single model simultaneously completes both numerical regression and peak warning tasks, achieving multi-task joint learning. Generalization ability is improved by sharing underlying representations; the smoothed L1 loss is insensitive to outliers, enhancing the robustness of the regression task to extreme load data; the homoscedastic uncertainty weighting strategy allows the model to automatically adjust its contribution weights according to the inherent difficulty of each task during training, effectively preventing the gradient of one task from dominating the entire network update, achieving a stable balance in multi-task learning; ultimately, based on a lightweight model, accurate numerical predictions of power load and reliable peak period early warnings are simultaneously output, providing comprehensive decision support for power grid dispatching and peak response. For example, further specifying the implementation of the regression head using smooth L1 loss, the classification head using Sigmoid activation and binary cross-entropy loss, and the specific implementation of the homoscedastic uncertainty weighting strategy (adjusting the loss weights with observation noise parameters to ultimately obtain the load numerical prediction and peak probability prediction for future periods), this complete multi-task learning mechanism ensures the accuracy of numerical prediction and the reliability of peak warning, while achieving automatic balancing of the two tasks during training, improving the practical value and deployment efficiency of the model.

[0052] As an optional implementation method, refer to Figure 2The overall architecture of the design model mainly consists of three parts: grouped dynamic convolution, causal multi-scale network, and multi-task prediction. This application's embodiment is the overall architecture of grouped dynamic convolution and causal multi-scale network. The overall workflow of this invention mainly includes the following three steps: First, features are semantically grouped using an optimized K-means algorithm, and then each group is processed by parallel dynamic convolution branches to extract state-adaptive local features; the second step is to concatenate these features and input them into a causal multi-scale mixer to aggregate multi-scale temporal dependencies and strictly preserve temporal causality; finally, the high-level representation is projected onto the output heads of two specific tasks to produce prediction results.

[0053] The present invention will now be described in further detail with reference to specific embodiment figures.

[0054] Step 1: Grouped Dynamic Convolution. This includes the following steps: 1) Electricity load is affected by various factors, including but not limited to environmental factors (ambient temperature, cloud cover, solar radiation, precipitation), social events (holidays, festivals), and time series characteristics (hourly lag, daily lag, weekly lag, annual lag). These characteristics include highly heterogeneous multi-source features. To avoid interference between different features, this invention utilizes an optimized K-means algorithm to automatically cluster and group the input features. In specific implementation, the centroids are first initialized using a probabilistic distance mechanism to ensure good representativeness; subsequently, distance calculation, feature allocation, and centroid updates are performed alternately. The specific formula is:

[0055]

[0056]

[0057]

[0058] In the formula, It is each data point in the set. Let represent the j-th centroid in the currently selected set of centroids. Then, calculate the shortest Euclidean distance from j to the currently selected nearest centroid. Representing data points The shortest Euclidean distance to the nearest centroid in the currently selected set of centroids. This represents the total number of centroids that have been selected so far. Representing data points to the center of mass Euclidean distance (straight-line distance); Representing data points The probability of being selected as the next initial centroid. Indicates the next selected initial centroid. Representing data points The square of the shortest Euclidean distance to the nearest selected centroid. It represents the sum of the squares of the shortest Euclidean distances from all data points to their respective nearest selected centroids (normalized denominator). Indicates the total number of data points; This represents the centroid number (i.e., the data point) that minimizes the squared distance. (The feature group number to be assigned) The operator that takes the argument that minimizes the value of the expression. This represents the total number of the current feature groups (i.e., the total number of centroids). Representing data points To the Centroid The square of the Euclidean distance; Indicates the number of iteration steps (number of iterations); Indicates the first +1 iteration, the first The updated centroids of the feature groups; Indicates the first Each feature group (containing all data points assigned to that group); Indicates the first The number of data points within each feature group; Indicates the first The vector sum of all data points within a feature group (element-wise addition of each point); This represents the mean of all data points within a feature group (i.e., the updated centroid position). Finally, the elbow rule is used to determine the optimal number of clusters N. This optimized automatic grouping mechanism ensures statistical homogeneity of features within each semantic group, reducing the learning burden on subsequent convolutional modules.

[0059] 2) such as Figure 3 As shown, to address the heterogeneity of features in the data, we invented dynamic convolution to process them. Each feature group employs an independent dynamic convolution branch. Each dynamic convolution branch contains a parameter pool with K candidate convolution kernels, and its specific operation steps are as follows: The first step is to use global average pooling to aggregate the input sequence into a compact state feature vector along the time dimension; Step 2: Pass the above state features through a fully connected layer and use them as the query vector Q. Calculate its matching score with different candidate convolutional kernel keys K. An index graph is generated using the argmax function, with the specific formula as follows:

[0060]

[0061] in, This indicates the degree of matching between the k-th kernel and the state at time t. Indicates the first The first batch, the first At this time step, the first The matching score between each candidate convolutional kernel and the current state. This represents the batch index, indicating which sample batch is currently being processed. This represents the time step index, indicating which time point in the sequence is being processed. This represents the candidate convolution kernel index, indicating which candidate convolution kernel is in the parameter pool; The query vector is obtained by mapping the state feature vector through a fully connected layer. This represents the transpose of the key vector matrix, and the transpose of the matrix composed of the key vectors corresponding to each candidate convolution kernel; The query vector is multiplied by all key vectors to obtain the matching score of each candidate convolution kernel.

[0062] Indicates the first The optimal convolutional kernel index selected at each time step (i.e., the value of the index map at that time step). The operator that takes the parameter that maximizes the value of the expression; Indicates the candidate convolution kernel number; This represents the total number of candidate convolutional kernels (parameter pool size). Indicates the first The time step, the first The matching score of each candidate convolutional kernel.

[0063] Finally, to enforce a decisive system switch, we generate an index graph by selecting the kernel index with the highest score along the last dimension. This dynamically routes the data with the best-matching convolution kernel at each time step.

[0064] The third step involves stacking the input data and processing it through all candidate kernels. Then, a slicing operation is performed based on the index graph, extracting the computational result of the best-matching kernel at each time step as the final output. This design allows the model to adaptively adjust its receptive field and processing mechanism according to the current market micro-state.

[0065] Step 2, Causal Multiscale Network: like Figure 4The multi-scale causal network (multi-scale network) shown employs a strict upper triangular layer and a multi-scale architecture to prevent data leakage and enable the model to learn multi-dimensional features. To capture long-term global trends while preventing look-ahead bias (i.e., preventing future information from leaking into past representations), this invention abandons traditional attention mechanisms and standard multilayer perceptron (MLP) structures, constructing a causal multi-scale network entirely based on a multilayer perceptron. This invention designs an upper triangular linear transformation (TriU) layer. The specific formula is as follows:

[0066] In the formula, The output sequence has a length of The causal temporal mixed block output vector, where Indicates the first Output values ​​at each time step; The input sequence has a length of The concatenated feature tensor is expanded in the time dimension, where Indicates the first Input features at each time step; Represents the first in the upper triangular matrix Line number The learnable weight parameters of the column, where For row index, For column indexes; the lower triangular region of the matrix (all zeros) explicitly breaks the connection between the future and the past.

[0067] Unlike standard fully connected blocks, causal-temporal hybrid blocks explicitly sever connections to future time-step nodes using an upper triangular mask matrix. The output at time step t depends only on historical inputs. Figure 4 As shown at the bottom, the input tensor is distributed across L parallel branches. The first branch processes the original-length time series to capture high-frequency, short-term microscopic local fluctuations; subsequent branches utilize strided one-dimensional convolutions (i.e., both stride and kernel size are 2). k Non-overlapping downsampling is performed on the temporal dimension. Each downsampled feature map at a different scale is processed by a dedicated causal mixing block, which consists of two TriU layers, normalization (LayerNorm), an activation function (GELU), and residual connections, as shown in the following formula:

[0068] In the formula, The input features of the causal temporal hybrid block are the feature tensors input to this branch in the previous step (after concatenation); For layer normalization operation, for input Standardize the feature dimensions to make the mean 0 and the variance 1 to stabilize the training process; The normalized features after layer normalization are used as input for subsequent TriU layers; For the first upper triangular linear transformation, Mapping to intermediate features The transformation matrix is ​​an upper triangular matrix, ensuring that the output at each time step depends only on the historical input; Represents the Gaussian error linear unit activation function, for Apply nonlinear transformation element by element; This represents the nonlinear transformation characteristics after the GELU activation function; This represents the second upper triangular linear transformation, which will... Mapped to Similarly, an upper triangular matrix is ​​used to ensure causal relationships; The transformed output features after the second TriU layer have not yet been added with residual connections. The final output of the causal-temporal mixing block is obtained by residual connection. With the original input Add them together to get; This indicates a residual connection, which adds the features after the TriU-GELU-TriU transformation to the original input. The gradient can be directly propagated back to the input layer, ensuring stable gradient propagation in deep networks.

[0069] The above processing ensures stable gradient propagation in deep networks. Multiple temporal features at different resolutions are extracted. Finally, through flattening and concatenation operations, a unified multi-scale representation vector is constructed.

[0070] Step 3: Multi-task learning and output prediction: like Figure 2 As shown at the bottom, the features output from the causal multi-scale network in step two are input into two task-specific branches. The first branch generates a numerical regression prediction of electricity load, aiming to accurately depict the daily load baseline and smooth fluctuation trajectory. A smoothed L1 loss function is used to enhance robustness to outliers. The second branch is activated by a sigmoid function to generate a peak warning classification head for binary classification. This classification head outputs the probability of triggering extreme peak loads in a specific future period. A binary cross-entropy loss is used.

[0071] To balance multi-task training, this invention introduces a homoscedastic uncertainty weighting strategy during joint training, dynamically balancing the contribution weights of each task to the total loss function. The formula is as follows:

[0072] in and It is a learnable observation noise parameter (used to capture mission-related uncertainties). This is the total loss function, used as the final optimization objective for backpropagation optimization of model parameters during joint training. The loss value for the regression task (smoothing L1 loss) corresponds to the numerical forecasting task of power load. The loss value (binary cross-entropy loss) is used for the classification task, corresponding to the peak load warning classification task. By employing grouped dynamic convolution, multi-scale temporal modes, and multi-task supervision, the model of this invention achieves state-of-the-art performance in both power load numerical prediction and peak load warning classification, while maintaining its lightweight characteristics, making it suitable for real-time applications.

[0073] The key points and areas for which this application seeks protection are: 1. Grouped dynamic convolution design; 2. Causal multi-scale network design.

[0074] Compared with related technologies, the present invention has the following advantages: (1) Existing complex time series prediction models usually have the defect of large number of parameters, and when processing time series data, due to the lack of strict causal constraints, they are prone to the problem of "future information leakage", making the model less robust at trend turning points. The present invention innovatively proposes a causal multi-scale mixer based entirely on multilayer perceptron (MLP). By introducing the upper triangular linear transformation (TriU) matrix, the present invention explicitly cuts off the data connection of the model to future time steps in terms of structure, completely eliminating the leakage of future information; at the same time, the pure MLP design without attention mechanism makes the model lightweight and greatly improves the inference speed; (2) Most existing hybrid models adopt static strategies to handle feature differences and often can only make predictions on a single time scale. To address this problem, the present invention introduces an automatic feature grouping and dynamic convolution module optimized by K-means++, which enables the network to adaptively adjust the receptive field and processing mechanism to extract local features according to different current market conditions; and combines a parallel downsampling architecture of multi-scale time, integrating the high-frequency short-term fluctuation pattern and low-frequency long-term cycle pattern of agricultural futures.

[0075] This application also provides a power load forecasting system based on dynamic convolution and causal multi-scale networks to implement the method described above. The system includes: The data acquisition and encoding module is used to collect the characteristics of multi-source power load impact, including environmental factors, social events and time series features, and organize all input features into input tensors; The feature grouping module is used to automatically perform semantic clustering on each feature dimension in the input tensor using an optimized K-means algorithm, dividing features with statistical homogeneity into different feature groups; The dynamic convolution processing module is used to input each feature group into an independent dynamic convolution branch. Each dynamic convolution branch adaptively selects the best-matching convolution kernel from the candidate convolution kernel pool according to the state of the current time step, extracts local features that are adaptive to the state for each feature group, and obtains the final output of each dynamic convolution branch. The feature concatenation module is used to concatenate the final outputs of all dynamic convolution branches to obtain the concatenated features. The causal multi-scale mixing module is used to input the concatenated features into the causal multi-scale mixer, process sequences with different time spans through multiple parallel branches, and use the upper triangular linear transformation to make the output of each time step dependent on the historical input, aggregate the multi-scale time dependencies, and construct a unified multi-scale representation vector. The multi-task prediction module is used to feed a unified multi-scale representation vector into the regression prediction head and the classification early warning head respectively, and output the numerical prediction results of power load and the prediction results of peak occurrence probability for future periods.

[0076] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0077] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method.

[0078] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0079] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0080] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0081] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0082] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0083] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0084] This application provides a power load forecasting method, system, electronic device, storage medium, and program product based on dynamic convolution and causal multi-scale networks. It automatically semantically groups multi-source heterogeneous features using an optimized K-means algorithm to eliminate mutual interference between different features. Then, it adaptively selects the most matching convolution kernel for each feature group using a grouped dynamic convolution module to extract state-sensitive local temporal features. Subsequently, all branch features are concatenated and input into a causal multi-scale mixer based entirely on a multilayer perceptron. This mixer processes sequences with different time spans through multiple parallel branches and uses an upper triangular linear transformation matrix to strictly cut off data dependencies on future time steps to prevent information leakage, thereby safely aggregating multi-scale temporal dependencies. Finally, the learned unified multi-scale representation is simultaneously fed into a regression prediction head and a classification warning head, achieving accurate prediction of power load values ​​and reliable warnings for peak periods.

[0085] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0086] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0087] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0088] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0089] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0090] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0091] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0092] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0093] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0094] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0095] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A power load forecasting method based on dynamic convolution and causal multi-scale networks, characterized in that, The method includes the following steps: Collect multi-source power load impact characteristics, including environmental factors, social events, and time series characteristics, and organize all input characteristics into input tensors; An optimized K-means algorithm is used to automatically perform semantic clustering on each feature dimension in the input tensor, dividing features with statistical homogeneity into different feature groups; Each of the aforementioned feature groups is input into an independent dynamic convolution branch. Each of the dynamic convolution branches adaptively selects the most matching convolution kernel from the candidate convolution kernel pool according to the state of the current time step, extracts state-adaptive local features for each of the aforementioned feature groups, and obtains the final output of each of the dynamic convolution branches. The final outputs of all the dynamic convolution branches are concatenated to obtain the concatenated features; The concatenated features are input into a causal multi-scale mixer, which processes sequences with different time spans through multiple parallel branches. The upper triangular linear transformation is used to make the output of each time step dependent on the historical input, and the multi-scale time dependencies are aggregated to construct a unified multi-scale representation vector. The unified multi-scale representation vector is fed into the regression prediction head and the classification early warning head respectively, and the numerical prediction results of power load and the prediction results of peak occurrence probability for future periods are output.

2. The method according to claim 1, characterized in that, The collected multi-source power load impact characteristics include environmental factors, social events, and time series features. All input features are organized into input tensors, including: Collect environmental factor characteristics; the environmental factor characteristics include ambient temperature, cloud cover, solar radiation and precipitation data; Collect social event characteristics; these social event characteristics include holiday information and festival information. Collect time series features; the time series features include historical load data with hourly lag, daily lag, weekly lag, and annual lag; The collected environmental factor features, social event features, and time series features are aligned by time and organized into an input tensor.

3. The method according to claim 1, characterized in that, The optimized K-means algorithm is used to automatically perform semantic clustering on each feature dimension of the input tensor, dividing features with statistical homogeneity into different feature groups, including: The centroids of the K-means algorithm are initialized using a probabilistic distance mechanism. For each data point in the input tensor, the shortest Euclidean distance from the data point to the currently selected nearest centroid is calculated. Based on the proportion of the square of the shortest Euclidean distance to the sum of the squares of the shortest Euclidean distances of all data points, the next initial centroid is probabilistically selected, resulting in an initialized set of centroids. Perform distance calculation, feature allocation, and centroid update; the distance calculation is to calculate the Euclidean distance from each data point to the current centroid; the feature allocation is to assign each data point to the feature group represented by the centroid with the nearest Euclidean distance, and obtain the allocation result of the feature group to which each data point belongs; the centroid update is to use the mean of all data points in the same feature group as the updated centroid, and obtain the updated centroid. Using the updated centroid as the current centroid, return to the steps of performing distance calculation, feature allocation, and centroid update, and proceed to the next iteration; After iterating to the preset conditions, the elbow rule is used to determine the optimal number of clusters, complete the feature grouping, and obtain the final different feature groups.

4. The method according to claim 1, characterized in that, The process involves inputting each of the aforementioned feature groups into independent dynamic convolution branches. Each dynamic convolution branch adaptively selects the best-matching convolution kernel from the candidate convolution kernel pool based on the state of the current time step, extracts state-adaptive local features from each of the aforementioned feature groups, and obtains the final output of each of the dynamic convolution branches, including: Each feature group is configured with an independent dynamic convolution branch, and a parameter pool containing multiple candidate convolution kernels is set within each dynamic convolution branch; Global average pooling is performed on the time series of each feature group, and each feature group is aggregated into a state feature vector along the time dimension. The state feature vector is mapped through a fully connected layer and used as a query vector. The matching score between the query vector and the key of each candidate convolutional kernel is calculated. At each time step, the candidate convolutional kernel with the highest matching score is selected as the matching convolutional kernel for that time step, and an index map is generated based on the selection results of each time step. The time series of each feature group are processed by all the candidate convolution kernels in the parameter pool to obtain the candidate output of each candidate convolution kernel; Slicing is performed on the candidate outputs according to the index graph, and the candidate outputs corresponding to the matching convolution kernels are extracted at each time step as the final outputs of each dynamic convolution branch.

5. The method according to claim 1, characterized in that, The step of concatenating the final outputs of all the dynamic convolutional branches to obtain the concatenated features includes: Obtain the final output of each of the dynamic convolution branches, wherein the final output of each of the dynamic convolution branches contains local temporal feature information of its corresponding feature group; The final outputs of all the dynamic convolution branches are concatenated along the channel dimension, and the resulting feature tensor is used as the concatenated feature.

6. The method according to claim 1, characterized in that, The concatenated features are input into a causal multi-scale mixer, which processes sequences with different time spans through multiple parallel branches. An upper triangular linear transformation is used to make the output of each time step dependent on the historical input, aggregating multi-scale time dependencies to construct a unified multi-scale representation vector, including: The concatenated features are used as input tensors and distributed to several parallel branches; In the first branch, the original length time series is used as the processing object to capture high-frequency short-term micro-local fluctuations that meet the preset conditions, thus obtaining the first-scale time features; In subsequent branches, non-overlapping downsampling of the time dimension is performed using strided one-dimensional convolution. The downsampling stride and convolution kernel size of each branch are equal, and the stride and convolution kernel size of each branch increase with the branch number, resulting in multiple downsampled feature maps with different resolutions. The first-scale time feature and each of the downsampled feature maps are respectively input into their respective causal time mixing blocks for processing. Each causal time mixing block uses an upper triangular linear transformation to make the output of each time step dependent on the historical input, thereby obtaining multiple causal time features with different resolutions. All the causal temporal features of different resolutions are flattened, and all the flattened causal temporal features are concatenated to construct a unified multi-scale representation vector.

7. The method according to claim 1, characterized in that, The process of feeding the unified multi-scale representation vector into the regression prediction head and the classification early warning head respectively, and outputting the numerical prediction results of power load and the prediction results of peak occurrence probability for future periods, includes: The unified multi-scale representation vector is simultaneously fed into the branches of the regression prediction head and the classification warning head, respectively. In the regression prediction head, the unified multi-scale representation vector is mapped to the numerical prediction result of power load, and the smoothed L1 loss value is calculated using the smoothed L1 loss function; In the classification warning head, the unified multi-scale representation vector is activated by the Sigmoid function and mapped to a binary classification prediction result, outputting the probability of triggering extreme peak load in a specific future period, and the binary cross-entropy loss value is calculated using the binary cross-entropy loss function. When jointly training the regression prediction head and the classification early warning head, a homoscedastic uncertainty weighting strategy is used to dynamically balance the contribution weights of the two tasks to the total loss function. The weights of the smoothed L1 loss value and the binary cross-entropy loss value are adjusted by a learnable observation noise parameter. The weighted sum of the smoothed L1 loss value and the binary cross-entropy loss value is used as the total loss for joint optimization to obtain the numerical prediction results of power load and the prediction results of peak occurrence probability for future periods. The observation noise parameter is used to capture the inherent uncertainty of each task. The larger the noise parameter, the lower the weight of the corresponding task, and vice versa.

8. A power load forecasting system based on dynamic convolution and causal multi-scale networks, used to implement the method as described in any one of claims 1 to 7, characterized in that, The system includes: The data acquisition and encoding module is used to collect the characteristics of multi-source power load impact, including environmental factors, social events and time series features, and organize all input features into input tensors; The feature grouping module is used to automatically perform semantic clustering on each feature dimension in the input tensor using an optimized K-means algorithm, and to divide features with statistical homogeneity into different feature groups. The dynamic convolution processing module is used to input each of the feature groups into an independent dynamic convolution branch. Each dynamic convolution branch adaptively selects the most matching convolution kernel from the candidate convolution kernel pool according to the state of the current time step, extracts local features that are state-adaptive to each of the feature groups, and obtains the final output of each dynamic convolution branch. The feature concatenation module is used to concatenate the final outputs of all the dynamic convolution branches to obtain the concatenated features. The causal multi-scale mixing module is used to input the concatenated features into the causal multi-scale mixer, process sequences with different time spans through multiple parallel branches, and use the upper triangular linear transformation to make the output of each time step dependent on the historical input, aggregate the multi-scale time dependencies, and construct a unified multi-scale representation vector. The multi-task prediction module is used to feed the unified multi-scale representation vector into the regression prediction head and the classification early warning head respectively, and output the power load numerical prediction results and peak occurrence probability prediction results for future periods.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.