Electric carbon emission time sequence prediction method based on multi-scale adaptive causal network

By employing a multi-scale adaptive causal network method, the problem of dynamic changes in carbon emission parameters of the power system was solved, enabling accurate prediction of the time series of carbon emissions from electricity, and improving prediction accuracy and robustness.

CN121563263APending Publication Date: 2026-02-24STATE GRID ANHUI ELECTRIC POWER CO LTD ELECTRIC POWER SCI RES INST +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511753073.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing technologies are ill-suited to adapting to the dynamic changes in carbon emission parameters of the power system and are unable to delve into the multi-scale causal relationships between power parameters and carbon emissions, resulting in insufficient prediction accuracy and robustness, and an inability to accurately predict the timing of carbon emissions from electricity.

Method used

A multi-scale adaptive causal network method is adopted, which uses sliding window partitioning, feature extraction and causal fusion, combined with dynamic causal weights and transfer entropy loss function, to achieve multi-scale and dynamic causal relationship prediction between power system parameters and carbon emissions.

Benefits of technology

It significantly improves the accuracy and robustness of carbon emission prediction for electricity, can adapt to carbon emission prediction scenarios in different regions and industries, and has good generalization ability and prediction traceability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121563263A_ABST
    Figure CN121563263A_ABST
Patent Text Reader

Abstract

The invention discloses an electric carbon emission time sequence prediction method based on a multi-scale adaptive causal network, and the method comprises the steps: collecting the operation carbon emission of an electric power system and the parameter data of the electric power system, and dividing the data into historical data and future data; performing multi-scale non-overlapping sliding window division on the historical data to obtain a multi-granularity fragment; through a feature extraction and causal reasoning module, dynamic causal weights are calculated, and carbon emission features are injected; performing same-scale processing on future exogenous variables, and completing causal injection through a causal Transform module in combination with a causal discovery result to obtain a carbon emission predicted value of each scale; and finally, carrying out weighted fusion on each scale prediction value through the adaptive fusion weight to obtain a final prediction result. The method can effectively capture the dynamic causal association between the power system and the carbon emission, inhibits the pseudo-correlation interference, improves the prediction precision and robustness, and is suitable for the carbon emission prediction in a complex power system environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of carbon emission time series prediction technology, and relates to a method for predicting carbon emissions from electricity based on multi-scale adaptive causal networks. Background Technology

[0002] The accuracy of carbon emission time-series forecasts directly impacts the scientific validity of energy structure optimization, carbon trading market regulation, and climate policy formulation. As one of the major sources of global carbon emissions, the power industry's emissions encompass the entire chain of power generation, transmission and distribution, and load consumption. The complex energy conversion and transmission processes make the accurate quantification and dynamic forecasting of carbon emissions a key bottleneck in the industry's low-carbon transformation.

[0003] With the continuous growth of new energy installed capacity, the operation mode of traditional fossil fuel units has shifted from long-term continuous operation to frequent start-stop and output regulation, resulting in significant time-varying and nonlinear characteristics in the carbon emission level of the power system. Existing prediction methods rely on the assumption of constant parameters in traditional mechanistic models, making it difficult to adapt to dynamic changes in parameters such as emission factors and grid losses. Data-driven methods, on the other hand, often focus on single-dimensional correlation learning, failing to deeply explore the unidirectional causal relationship between power parameters and carbon emissions. They are susceptible to spurious correlations caused by policy regulation and market fluctuations, resulting in insufficient predictive robustness and a lack of forward-looking forecasting capabilities for future periods.

[0004] Existing technologies, such as the user-side electricity carbon emission responsibility accounting method proposed in CN120806550A, only consider a single time scale, ignoring the multi-scale characteristics of the relationship between electricity carbon emissions and the power system. They cannot capture instantaneous changes and long-term trends caused by factors such as sudden load fluctuations and renewable energy fluctuations. Furthermore, the modeling assumptions in the literature "Power System Carbon Emission Prediction and Optimal Dispatch Based on Electricity Carbon Model" are overly idealistic and difficult to adapt to the dynamic operating state of the power system.

[0005] Therefore, there is an urgent need for a time-series prediction method for carbon emissions from electricity that can adapt to multi-scale and dynamic causal relationships in order to improve prediction accuracy and practicality. Summary of the Invention

[0006] The technical solution of this invention is used to solve the problem of how to accurately and effectively predict the timing of carbon emissions from electricity.

[0007] The present invention solves the above-mentioned technical problems through the following technical solutions: This invention provides a time-series prediction method for carbon emissions from electricity based on a multi-scale adaptive causal network, comprising the following steps: S1. Collect data on carbon emissions and power system parameters during power system operation, divide them into historical and future data, and perform preprocessing. S2. Divide the preprocessed historical power system parameters and historical carbon emissions in step S1 into non-overlapping sliding windows to obtain multi-granularity segments at multiple time scales. S3. Perform feature extraction and causal reasoning on multi-granularity segments at each scale to obtain power system parameter embedding features, carbon emission embedding features, and dynamic causal weights at each scale. S4. Perform causal fusion processing on the power system parameter embedding features, carbon emission embedding features, and dynamic causal weights to obtain carbon emission features injected with dynamic causal information. S5. Divide the preprocessed future power system parameters in step S1 into segments of the same scale as in step S2, and then perform feature extraction and causal inference in step S3 to obtain the embedded features and causal association results of future power system parameters at each scale. S6. The carbon emission features with injected dynamic causal information obtained in step S4 are causally fused with the future power system parameter embedding features and causal correlation results at each scale obtained in step S5 to obtain carbon emission prediction embedding features at each scale. After splicing the carbon emission prediction embedding features at each scale, they are mapped to carbon emission prediction values ​​through a linear projection layer. S7. Weighted summation of carbon emission predictions at each scale yields preliminary prediction results. Calculate the mean absolute error prediction loss between the preliminary prediction results and the actual values, the consistency loss between the carbon emission predictions at each scale and the fusion results, and the one-way transfer entropy loss from power parameters to carbon emissions. Weighted fusion of the mean absolute error prediction loss, consistency loss, and one-way transfer entropy loss yields the total loss function. Iteratively minimize the total loss function, update all training parameters, and obtain the prediction results after multi-scale fusion.

[0008] Furthermore, the formula for dividing the preprocessed historical power system parameters and historical carbon emissions into a non-overlapping sliding window in step S2 is as follows:

[0009]

[0010] in, The sliding step size is equal to the number of historical segments corresponding to the scale. This ensures that the fragments do not overlap and completely cover the historical sequence. This is a segment of historical power system parameters after being partitioned using a non-overlapping sliding window. The raw data for historical power system parameters. The historical carbon emission segments are divided into non-overlapping sliding window segments. The raw data for historical carbon emissions. The size of the time level to be set.

[0011] Furthermore, the methods for obtaining the power system parameter embedding features and carbon emission embedding features mentioned in step S3 are as follows: By using linear projection, the original fragment is mapped to high-dimensional embedded features, enhancing the ability to capture complex nonlinear associations. The formula is as follows:

[0012]

[0013] in, Let be the d×γ weight matrix of the power system parameter variables, where d represents the dimension of the high-dimensional embedded features and γ represents the granularity. Let be the weight matrix of the carbon emission variable d×γ. This is a high-dimensional feature matrix after feature embedding of power system parameter variables. This is the high-dimensional feature matrix after feature embedding of carbon emission variables. The position encoding matrix for multiple granularities γ.

[0014] Furthermore, the method for obtaining the dynamic causal weights in step S3 is as follows: Attention scores for each granularity segment are calculated using a cross-modal attention mechanism. The formula for calculating the attention score is as follows:

[0015] in, The attention score reflects the first... Scale No. The degree of correlation between each electrical parameter segment and the carbon emission segment. This is the scaling factor; The attention score is normalized into dynamic causal weights using the Softmax function, as shown in the formula:

[0016] in, For dynamic causal weights, and Ensure that the weights satisfy the probability distribution; The attention score reflects the first... Scale No. The degree of correlation between a segment of power system parameters and a segment of carbon emissions. To refer to the first A segment of power system parameters represents the quantity of carbon emission segments.

[0017] Furthermore, the formula for obtaining the carbon emission feature injected with dynamic causal information by performing causal fusion processing on the power system parameter embedding features, carbon emission embedding features, and dynamic causal weights in step S4 is as follows:

[0018]

[0019] in, The output is the attention score, and V is the eigenvalue matrix of the power system parameters. This is the high-dimensional feature matrix after feature embedding of carbon emission variables. To inject dynamic causal information into carbon emission features, the LayerNorm function is used to alleviate gradient vanishing, and the FeedForward function is a two-layer perceptron to achieve nonlinear transformation of features.

[0020] Furthermore, the method for obtaining the embedding features and causal correlation results of future power system parameters at various scales in step S5 is as follows: Set as a parameter for the future power system, denoted as The future power system parameters are processed using the same method as historical variables. The specific steps are as follows: (1) Perform multi-granularity segmentation, the formula is:

[0021] in, For the number of future segments, For the segmented future power system parameters, the sliding step size is equal to the granularity γ, ensuring that the segments do not overlap and completely cover the historical sequence; (2) The future power system parameter embedding features are obtained using a linear projection matrix and then location-encoded, as shown in the formula: ,in, A matrix for encoding the location of future power system parameter segments is used, employing sine-cosine location coding to inject timing information and distinguish segments at different locations. A high-dimensional feature matrix after feature embedding of future power system parameter variables; (3) Based on the reconfigurability of causal relationships, the correlation between power system parameters and carbon emissions is learned through standard Transformer blocks. Carbon emission characteristics are reconstructed through power system parameter features. The parameters that minimize the reconstruction error are the true causal correlation parameters, as shown in the formula:

[0022] in, For causal relationship parameters, This is a standard Transformer block, which does not include causal weight injection. It is the L2 norm. , For the attention trainable parameter matrix, This is a high-dimensional feature matrix after feature embedding of power system parameter variables. A high-dimensional feature matrix after feature embedding of carbon emission variables.

[0023] Furthermore, the method described in step S6 for obtaining carbon emission prediction embedding features at each scale, concatenating these features, and mapping them to predicted carbon emission values ​​through a linear projection layer is as follows: Using a causal Transformer block, the causal correlation parameters are... Carbon emission characteristics infused with dynamic causal information and future power system parameter embedding features The formula for causal fusion is as follows:

[0024] in, Embedded features for carbon emission prediction at various scales. , For causal Transformer blocks; After concatenating the predicted embedded features of each future segment, the data is mapped to the predicted carbon emissions value through a linear projection layer, as shown in the following formula:

[0025] in, For feature splicing operations, To output the projection layer, For the first Carbon emission forecasts at various scales correspond to short-term, medium-term, and long-term forecasting needs.

[0026] Furthermore, the formula for calculating the total loss function in step S7 is as follows:

[0027] in, For the total loss function, The loss is the prediction loss based on the mean absolute error. For consistency loss, For one-way propagation entropy loss, This is the balance coefficient.

[0028] The present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a program that supports the processor in executing the above-described time-series prediction method for electrical carbon emissions based on multi-scale adaptive causal networks, and the processor is configured to execute the program stored in the memory.

[0029] The present invention also provides a storage medium storing a computer program, which, when run by a processor, executes the steps of the above-described method for time-series prediction of electrical carbon emissions based on multi-scale adaptive causal networks.

[0030] The present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a program that supports the processor in executing the above-described time-series prediction method for electrical carbon emissions based on multi-scale adaptive causal networks, and the processor is configured to execute the program stored in the memory.

[0031] The present invention also provides a storage medium storing a computer program, which, when run by a processor, executes the steps of the above-described method for time-series prediction of electrical carbon emissions based on multi-scale adaptive causal networks.

[0032] The beneficial effects of this invention are as follows: This invention learns time-varying causal weights at different time granularities through a dynamic time channel causal module. Combined with a three-level multi-scale causal structure and an adaptive fusion strategy, it fully captures the dynamic causal relationship and multi-scale transmission law between the power system and carbon emissions, significantly improving prediction accuracy. By incorporating transmission entropy into the loss function, it accurately quantifies the unidirectional causal dependence from power parameters to carbon emissions based on information theory, effectively suppressing reverse pseudo-correlation interference. Combined with multi-objective collaborative optimization, it ensures the rigor of causal modeling and the robustness of prediction. The method closely aligns with the actual physical relationship between the power system and carbon emissions, and the prediction results are traceable and easy to understand. Through standardized preprocessing and adaptive parameter adjustment, it has good generalization ability and is applicable to carbon emission prediction scenarios in different regions and industries. Attached Figure Description

[0033] Figure 1 This is a flowchart of the time-series prediction method for carbon emissions from electricity based on multi-scale adaptive causal networks, according to an embodiment of the present invention. Figure 2 This paper compares the MSE and MAE indices of the time-series prediction method for carbon emissions from electricity based on multi-scale adaptive causal networks, as described in this invention, with other models at different prediction step sizes. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0035] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments: Example 1 like Figure 1 As shown, this invention proposes a time-series prediction method for carbon emissions from electricity based on a multi-scale adaptive causal network, comprising the following steps: Step 1: Data Collection and Preprocessing We collect carbon emissions and power system parameters from the power system operation over a certain period of time, divide them into historical and future data according to the proportion, select historical carbon emissions as endogenous variables, and historical and future power system parameters as exogenous variables, and obtain normalized and missing value preprocessed data.

[0036] Step 2: Multi-scale sliding window partitioning The preprocessed historical power system parameters and historical carbon emissions are divided into non-overlapping sliding windows to obtain multi-granularity segments at various scales.

[0037] Define a three-level time granularity set These correspond to fine-grained (capturing the instantaneous impact of hourly power parameter fluctuations on carbon emissions), medium-grained (capturing the daily cycle correlation between daily power generation structure adjustments and carbon emissions), and coarse-grained (capturing the long-term impact of weekly industrial production rhythms and new energy output cycles on carbon emissions). Fine-grained, medium-grained, and coarse-grained correspond to hourly, daily, and weekly time granularities, respectively.

[0038] The formula for dividing historical power system parameters and historical carbon emissions into a non-overlapping sliding window is as follows:

[0039]

[0040] in, The sliding step size is equal to the number of historical segments corresponding to the scale. This ensures that the fragments do not overlap and completely cover the historical sequence. This is a segment of historical power system parameters after being partitioned using a non-overlapping sliding window. The raw data for historical power system parameters. The historical carbon emission segments are divided into non-overlapping sliding window segments. The superscript 'p' indicates that the processed data can be directly used for deep learning. The raw data for historical carbon emissions. The size of the time level to be set.

[0041] Step 3: Feature Extraction and Causal Inference Feature extraction and causal reasoning are performed on multi-granularity segments at various scales to obtain embedded features of power system parameters, embedded features of carbon emissions, and dynamic causal weights at each scale.

[0042] The methods for obtaining the power system parameter embedding features and carbon emission embedding features are as follows: By using linear projection, the original fragment is mapped to high-dimensional embedded features, enhancing the ability to capture complex nonlinear associations. The formula is as follows:

[0043]

[0044] in, Let X be the d×γ weight matrix of the variable X (power system parameters), where d represents the dimension of the high-dimensional embedded features and γ represents the granularity. Let be the d×γ weight matrix of variable C (carbon emissions), and be a trainable linear projection matrix. The optimal mapping relationship is learned through backpropagation. The high-dimensional feature matrix after feature embedding of variable X (power system parameters) contains data at multiple granularities γ. The high-dimensional feature matrix after feature embedding of variable C (carbon emissions) contains data at multiple granularities γ, representing the high-dimensional features after embedding. The position encoding matrix for multiple granularities γ.

[0045] Sine-cosine position coding is used to inject timing information to distinguish segments at different positions.

[0046] The method for obtaining the dynamic causal weights is as follows: Attention scores for each granularity segment are calculated using a cross-modal attention mechanism. The formula for calculating the attention score is as follows:

[0047] in, The attention score reflects the first... Scale No. The degree of correlation between a segment of power system parameters and a segment of carbon emissions. This is a scaling factor that helps prevent the softmax gradient from vanishing due to excessively large scores.

[0048] The attention score is normalized into dynamic causal weights using the Softmax function, as shown in the formula:

[0049] in, For dynamic causal weights, and This ensures that the weights satisfy the probability distribution and can be directly used for weighted fusion. The attention score reflects the first... Scale No. The degree of correlation between a power system parameter segment and a carbon emission segment, including data at multiple granularities of γ, and the aforementioned The distinction is the same; only the numerator and denominator are used for illustration. To refer to the first A segment of power system parameters represents the quantity of carbon emission segments.

[0050] Step 4: Dynamic causal feature fusion By performing causal fusion processing on the embedded features of power system parameters, embedded features of carbon emissions, and dynamic causal weights, carbon emission features injected with dynamic causal information are obtained.

[0051] Based on the standard Transformer, dynamic causal weights are introduced to inject causal information through weighted attention.

[0052] The matrix is ,in For the attention trainable parameter matrix, For carbon emission feature query matrix, The characteristic key matrix of power system parameters. The power system parameter eigenvalue matrix consists of three elements, each with a size equal to the feature dimension of multiple granularities γ multiplied by the dimension d of the high-dimensional embedded feature.

[0053] Weighted attention score is ,in This is a dynamic causal weight matrix, with its diagonal elements being... The value of non-diagonal lines is 0. This is achieved by multiplying the attention score and causal weight element-wise, thus amplifying the influence of highly causal segments.

[0054] The formula for obtaining the carbon emission feature injected with dynamic causal information by performing causal fusion processing on the embedded features of power system parameters, embedded features of carbon emissions, and dynamic causal weights is as follows:

[0055]

[0056] in, Output the attention score. This completes the high-dimensional feature matrix after feature embedding for variable C (carbon emissions) in step 3. To inject dynamic causal information into carbon emission features, the LayerNorm function is used to alleviate gradient vanishing, and the FeedForward function is a two-layer perceptron to achieve nonlinear transformation of features.

[0057] Step 5: Processing future parameters The preprocessed future power system parameters in step 1 are divided into segments at the same scale as in step 2, and then feature extraction and causal inference are performed in step 3 to obtain the embedded features and causal association results of the future power system parameters at each scale.

[0058] Set as a parameter for the future power system, denoted as To ensure compatibility between future and historical information, steps 2 and 3, consistent with historical variables, are used to process future power system parameters. The specific steps are as follows: The formula for multi-granularity segmentation is as follows:

[0059] in, This represents the number of future segments at the corresponding scale. The sliding step size is equal to the granularity γ for the segmented future power system parameters, ensuring that the segments do not overlap and completely cover the historical sequence.

[0060] The formula for feature embedding and position encoding is as follows: ,in, A matrix for encoding the location of future power system parameter segments is used, employing sine-cosine location coding to inject timing information and distinguish segments at different locations. The high-dimensional feature matrix after feature embedding of variable Y (future power system parameters); using the same linear projection matrix as in step 3. By combining location coding rules, we can obtain the embedded features of future power system parameters and perform location coding, thereby ensuring the consistency of the feature space and avoiding information deviations caused by differences in processing methods.

[0061] Based on the reconfigurability of causal relationships, the correlation between power system parameters and carbon emissions is learned through standard Transformer blocks. Carbon emission characteristics are then reconstructed from the features of the power system parameters. The parameters that minimize the reconstruction error are the true causal correlation parameters, as shown in the formula:

[0062] in, For causal relationship parameters, This is a standard Transformer block, which does not include causal weight injection. It is the L2 norm. , The attention trainable parameter matrix in step 4, The high-dimensional feature matrix after feature embedding of variable X (power system parameters) in step 3. This completes the high-dimensional feature matrix after feature embedding for variable C (carbon emissions) in step 3.

[0063] By minimizing the reconstruction error through gradient descent, the true causal relationship between power system parameters and carbon emissions is learned, rather than superficial pseudo-correlation.

[0064] Step 6: Multi-scale carbon emission fusion prediction The carbon emission features with injected dynamic causal information obtained in step 4 are causally fused with the future power system parameter embedding features and causal correlation results at each scale obtained in step 5 to obtain carbon emission prediction embedding features at each scale. The carbon emission prediction embedding features at each scale are then concatenated and mapped to carbon emission prediction values ​​through a linear projection layer.

[0065] Using a causal Transformer block, the causal correlation parameters are... Carbon emission characteristics infused with dynamic causal information and future power system parameter embedding features The formula for causal fusion is as follows:

[0066] in, Embedded features for carbon emission prediction at various scales. , The structure and steps in step 5 The structure is the same, and the causal relationship parameters are... Instead of the original attention parameters, this ensures that the injected data represents the true causal relationship at that scale.

[0067] After concatenating the predicted embedded features of each future segment, the data is mapped to the predicted carbon emissions value through a linear projection layer, as shown in the following formula:

[0068] in, For feature splicing operations, This is the output projection layer, and its input dimension is... The output dimension is , The set time level size, For the first Carbon emission forecasts at various scales correspond to short-term, medium-term, and long-term forecasting needs.

[0069] Step 7: Loss Calculation and Parameter Optimization The preliminary prediction results are obtained by weighted summation of the carbon emission predictions at each scale. The mean absolute error prediction loss between the preliminary prediction results and the actual values, the consistency loss between the carbon emission predictions at each scale and the fusion results, and the one-way transfer entropy loss from power parameters to carbon emissions are calculated. The mean absolute error prediction loss, consistency loss, and one-way transfer entropy loss are weighted and fused to obtain the total loss function. By iteratively minimizing the total loss function, all training parameters are updated to obtain the prediction results after multi-scale fusion.

[0070] The formula for calculating the preliminary prediction result by weighted summation of the carbon emission prediction values ​​at various scales is as follows:

[0071] in, This is the preliminary prediction result after multi-scale fusion, where F is the set time level. Here are the weight matrices for each scale. and This satisfies the weight normalization.

[0072] The formula for calculating the mean absolute error prediction loss is as follows:

[0073] in, The loss is the prediction loss based on the mean absolute error. For the future Step carbon emission real value, For the future Preliminary prediction results for the step.

[0074] The consistency loss The calculation formula is as follows:

[0075] in, The ideal prediction value for the current training step. for The uppercase letters represent .

[0076] Consistency loss ensures that the predicted values ​​at each scale fluctuate around the fusion result, avoids excessive bias in single-scale predictions, and improves the stability of the fusion.

[0077] The one-way transfer entropy loss is based on information theory to quantify the one-way causal dependence of power system parameters on carbon emissions, thereby suppressing spurious correlations. The calculation method for the one-way transfer entropy loss is as follows:

[0078]

[0079]

[0080] Maximizing the forward transfer entropy from electricity parameters to carbon emissions, i.e., minimizing the reverse transfer entropy, is expressed by the following formula: ,in The first term is the reverse suppression coefficient. The second term suppresses the reverse spurious correlation, focusing only on the one-way causality from electricity parameters to carbon emissions.

[0081] in, For one-way propagation entropy loss, For the digamma function, For the sample size, for The number of k nearest neighbors of the i-th sample in the space. for The number of k nearest neighbors of the i-th sample in the joint space. Given conditional entropy, calculate... Under the conditions conditional entropy, For, calculate in the given , Under the conditions conditional entropy, To transfer entropy, we calculate the information contribution of variable X to the future state of Y. To transfer entropy, calculate the variables. right Information contribution, To transfer entropy, calculate the variables. right Information contribution, These are historical power system parameters.

[0082] The formula for the total loss function is: ,in This is the balance coefficient.

[0083] By iteratively optimizing and minimizing the total loss function, all training parameters are updated to ensure that the model has both accurate predictive ability and reliable causal modeling ability.

[0084] Model hyperparameter settings The Adam optimizer is used, with an initial learning rate of Batch size is The iteration count is 200 rounds, and the total loss function is calculated using backpropagation for all trainable parameters. The gradient is given by the formula: ,in For model parameters, For loss function pairs The gradient is iteratively updated until the loss converges or the maximum number of iterations is reached. A balanced coefficient is used to weight and fuse the three types of losses to obtain the total loss function. The model parameters are iteratively updated using the Adam optimizer, and gradient pruning and early stopping strategies are combined to ensure training stability, resulting in a trained multi-scale adaptive causal network model.

[0085] Experimental verification This experiment uses a time-series dataset of electricity carbon emissions. This dataset contains multi-dimensional time-series features, including temperature, pressure, flow, composition, performance, and carbon emission parameters. The sampling frequency is ten minutes, and the time span covers one year. In the experiment, the target predictor variable is the carbon emission intensity in the dataset, used to evaluate the model's predictive ability for electricity carbon emissions.

[0086] The experiment selected seven mainstream time series prediction models as baselines, covering traditional statistical methods, deep learning models, and Transformer variants. Specifically, these include: Amplifier: an MLP-based fusion model that enhances feature representation through scientific computing; DLinear: a linear decomposition model that improves long sequence prediction capabilities through sequence decomposition; DUET: a dual-expert hybrid model that combines temporal and static features; PatchTST: a patch-based temporal Transformer model that employs a self-attention mechanism; TimeKAN: a temporal model based on the Kolmogorov-Arnold network; TimeXer: a temporal cross-attention model; and xPatch: a temporal model based on extended patches.

[0087] The core hyperparameter configuration parameters are as follows: sequence length is uniformly set to 96, prediction step size is set to multiple sets of experiments, including 96, 192, 336, and 720, batch size ranges from 16 to 512, learning rate ranges from 1e-5 to 1e-3, number of iterations ranges from 10 to 100, early stopping patience value is 3 to 5, hidden layer dimension ranges from 32 to 512, number of attention heads is 1 to 16, and number of encoder layers is 1 to 3.

[0088] Figure 2 The MSE and MAE indices of each model under different prediction step sizes are shown, with the best model marked in red and the second-best model underlined in blue. It can be observed that the proposed model (MSACN) significantly outperforms the baseline model in short, medium, and long-term time series predictions. At 720 prediction steps, the MSE is reduced by 19% and the MAE by 10.9% compared to the second-best model, Amplifier. The model incorporating causal mechanisms is more robust in multivariate dependency scenarios, validating the effectiveness of causal relationship modeling in improving prediction accuracy.

[0089] The core idea of ​​this invention is as follows: Multi-scale feature extraction is achieved through a sliding window to uncover potential patterns in different frequency components; dynamic scale weights are designed, and weights for each scale and causal relationship are adaptively allocated based on an attention mechanism; transfer entropy is fused to enhance the quantification capability of causal relationships and improve the accuracy of identifying true causal associations. The innovations of this method are: 1) Overcoming the limitations of a single scale, achieving full-dimensional feature coverage of "high-frequency details - mid-frequency cycles - low-frequency trends," adapting to the heterogeneity of complex time-series data such as carbon emissions from electricity, and addressing the differences in feature requirements under different prediction scenarios. 2) Achieving dynamic weight optimization across multiple scales, solving the problems of information redundancy and key signal overload, enhancing the model's adaptability to complex scenarios, and improving prediction robustness. 3) For the first time, transfer entropy is introduced into the prediction of carbon emissions from electricity, achieving quantitative modeling of causal relationships, overcoming the limitations of traditional correlation learning, effectively filtering out false associations and noise interference, and improving the prediction accuracy and interpretability of the model in complex scenarios. Experimental verification shows that this invention can effectively improve the accuracy and stability of time series predictions containing exogenous variables.

[0090] Example 2 An electronic device includes a memory and a processor, the memory being used to store a program that supports the processor in executing the time-series prediction method for electrical carbon emissions based on a multi-scale adaptive causal network as described in Embodiment 1, the processor being configured to execute the program stored in the memory.

[0091] Example 3 A storage medium storing a computer program, which, when executed by a processor, performs the steps of the time-series prediction method for electrical carbon emissions based on a multi-scale adaptive causal network as described in Embodiment 1.

[0092] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A time-series prediction method for carbon emissions from electricity based on multi-scale adaptive causal networks, characterized in that, Includes the following steps: S1. Collect data on carbon emissions and power system parameters during power system operation, divide them into historical and future data, and perform preprocessing. S2. Divide the preprocessed historical power system parameters and historical carbon emissions in step S1 into non-overlapping sliding windows to obtain multi-granularity segments at multiple time scales. S3. Perform feature extraction and causal reasoning on multi-granularity segments at each scale to obtain power system parameter embedding features, carbon emission embedding features, and dynamic causal weights at each scale. S4. Perform causal fusion processing on the power system parameter embedding features, carbon emission embedding features, and dynamic causal weights to obtain carbon emission features injected with dynamic causal information. S5. Divide the preprocessed future power system parameters in step S1 into segments of the same scale as in step S2, and then perform feature extraction and causal inference in step S3 to obtain the embedded features and causal association results of future power system parameters at each scale. S6. The carbon emission features with injected dynamic causal information obtained in step S4 are causally fused with the future power system parameter embedding features and causal correlation results at each scale obtained in step S5 to obtain carbon emission prediction embedding features at each scale. After splicing the carbon emission prediction embedding features at each scale, they are mapped to carbon emission prediction values ​​through a linear projection layer. S7. Weighted summation of carbon emission predictions at each scale yields preliminary prediction results. Calculate the mean absolute error prediction loss between the preliminary prediction results and the actual values, the consistency loss between the carbon emission predictions at each scale and the fusion results, and the one-way transfer entropy loss from power parameters to carbon emissions. Weighted fusion of the mean absolute error prediction loss, consistency loss, and one-way transfer entropy loss yields the total loss function. Iteratively minimize the total loss function, update all training parameters, and obtain the prediction results after multi-scale fusion.

2. The time-series prediction method for carbon emissions from electricity based on multi-scale adaptive causal networks according to claim 1, characterized in that, The formula for dividing the preprocessed historical power system parameters and historical carbon emissions into a non-overlapping sliding window in step S2 is as follows: in, The sliding step size is equal to the number of historical segments corresponding to the scale. This ensures that the fragments do not overlap and completely cover the historical sequence. This is a segment of historical power system parameters after being partitioned using a non-overlapping sliding window. The raw data for historical power system parameters. The historical carbon emission segments are divided into non-overlapping sliding window segments. The raw data for historical carbon emissions. The size of the time level to be set.

3. The time-series prediction method for carbon emissions from electricity based on multi-scale adaptive causal networks according to claim 2, characterized in that, The methods for obtaining the power system parameter embedding features and carbon emission embedding features mentioned in step S3 are as follows: By using linear projection, the original fragments are mapped to high-dimensional embedded features, enhancing the ability to capture complex nonlinear associations. The formula is as follows: in, Let be the d×γ weight matrix of the power system parameter variables, where d represents the dimension of the high-dimensional embedded features and γ represents the granularity. Let be the weight matrix of the carbon emission variable d×γ. This is a high-dimensional feature matrix after feature embedding of power system parameter variables. This is the high-dimensional feature matrix after feature embedding of carbon emission variables. The position encoding matrix for multiple granularities γ.

4. The time-series prediction method for carbon emissions from electricity based on multi-scale adaptive causal networks according to claim 3, characterized in that, The method for obtaining the dynamic causal weights in step S3 is as follows: Attention scores for each granularity segment are calculated using a cross-modal attention mechanism. The formula for calculating the attention score is as follows: in, The attention score reflects the first... Scale No. The degree of correlation between each electrical parameter segment and the carbon emission segment. This is the scaling factor; The attention score is normalized into dynamic causal weights using the Softmax function, as shown in the formula: in, For dynamic causal weights, and Ensure that the weights satisfy the probability distribution; The attention score reflects the first... Scale No. The degree of correlation between a segment of power system parameters and a segment of carbon emissions. To refer to the first A segment of power system parameters represents the quantity of carbon emission segments.

5. The time-series prediction method for carbon emissions from electricity based on multi-scale adaptive causal networks according to claim 4, characterized in that, The formula for obtaining the carbon emission feature injected with dynamic causal information by performing causal fusion processing on the power system parameter embedding features, carbon emission embedding features, and dynamic causal weights in step S4 is as follows: in, The output is the attention score, and V is the eigenvalue matrix of the power system parameters. This is the high-dimensional feature matrix after feature embedding of carbon emission variables. To inject dynamic causal information into carbon emission features, the LayerNorm function is used to alleviate gradient vanishing, and the FeedForward function is a two-layer perceptron to achieve nonlinear transformation of features.

6. The time-series prediction method for carbon emissions from electricity based on multi-scale adaptive causal networks according to claim 5, characterized in that, The method for obtaining the embedding features and causal correlation results of future power system parameters at various scales in step S5 is as follows: Set as a parameter for the future power system, denoted as The future power system parameters are processed using the same method as historical variables. The specific steps are as follows: (1) Perform multi-granularity segmentation, the formula is: in, For the number of future segments, For the segmented future power system parameters, the sliding step size is equal to the granularity γ, ensuring that the segments do not overlap and completely cover the historical sequence; (2) The future power system parameter embedding features are obtained using a linear projection matrix and then location-encoded, as shown in the formula: ,in, A matrix for encoding the location of future power system parameter segments is used, employing sine-cosine location coding to inject timing information and distinguish segments at different locations. A high-dimensional feature matrix after feature embedding of future power system parameter variables; (3) Based on the reconfigurability of causal relationships, the correlation between power system parameters and carbon emissions is learned through standard Transformer blocks. Carbon emission characteristics are reconstructed through power system parameter features. The parameters that minimize the reconstruction error are the true causal correlation parameters, as shown in the formula: in, For causal relationship parameters, This is a standard Transformer block, which does not include causal weight injection. It is the L2 norm. , For the attention trainable parameter matrix, This is a high-dimensional feature matrix after feature embedding of power system parameter variables. A high-dimensional feature matrix after feature embedding of carbon emission variables.

7. The time-series prediction method for carbon emissions from electricity based on multi-scale adaptive causal networks according to claim 6, characterized in that, The method described in step S6 for obtaining carbon emission prediction embedding features at each scale, concatenating these features, and mapping them to predicted carbon emission values ​​through a linear projection layer is as follows: Using a causal Transformer block, the causal correlation parameters are... Carbon emission characteristics infused with dynamic causal information and future power system parameter embedding features The formula for causal fusion is as follows: in, Embedded features for carbon emission prediction at various scales. , For causal Transformer blocks; After concatenating the predicted embedded features of each future segment, the data is mapped to the predicted carbon emissions value through a linear projection layer, as shown in the following formula: in, For feature splicing operations, To output the projection layer, For the first Carbon emission forecasts at various scales correspond to short-term, medium-term, and long-term forecasting needs.

8. The time-series prediction method for carbon emissions from electricity based on multi-scale adaptive causal networks according to claim 7, characterized in that, The formula for calculating the total loss function in step S7 is as follows: in, For the total loss function, The loss is the prediction loss based on the mean absolute error. For consistency loss, For one-way propagation entropy loss, This is the balance coefficient.

9. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store a program that supports the processor in executing the time-series prediction method for electrical carbon emissions based on a multi-scale adaptive causal network as described in any one of claims 1 to 8, and the processor is configured to execute the program stored in the memory.

10. A storage medium storing a computer program, characterized in that, The computer program is executed by a processor to perform the steps of the time-series prediction method for electrical carbon emissions based on multi-scale adaptive causal networks as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • User side electricity utilization carbon emission responsibility accounting method based on power grid supply-demand relationship

    CN120806550A