Price strategy generation method based on federal causal graph network and counterfactual learning

By employing federated causal graph networks and counterfactual learning, the problems of unclear causal relationships and data silos in the electricity market are solved, generating reasonable and practical electricity pricing strategies, and enabling multi-stakeholder collaborative decision-making under the guidance of causal logic with privacy protection.

CN122335337APending Publication Date: 2026-07-03国网河北省电力有限公司营销服务中心 +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
国网河北省电力有限公司营销服务中心
Filing Date
2026-04-02
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In the existing electricity market, the power grid cannot accurately know the real driving force of user load changes when setting time-of-use pricing, resulting in insufficient rationality. The inability to directly aggregate data from various parties leads to distortion. Strategies that solely aim at load smoothing or renewable energy consumption may violate user production patterns or market fairness, resulting in insufficient implementation of the strategies.

Method used

This paper adopts a method based on federated causal graph networks and counterfactual learning to determine causal relationships through electricity market participant data and prior constraints in the electricity sector. Counterfactual simulation and multi-agent optimization are then performed to generate electricity pricing strategies. Under privacy protection, an interpretable electricity pricing strategy is generated through collaborative training of a causal consistency discriminator and a multi-agent optimization model.

Benefits of technology

By identifying global causal structures under privacy protection, the rationality and feasibility of electricity pricing strategies can be improved, misjudgments and data distortion can be avoided, and dynamic, balanced and sustainable electricity pricing solutions can be output to ensure that electricity pricing strategies conform to causal logic and the interests of all parties.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122335337A_ABST
    Figure CN122335337A_ABST
Patent Text Reader

Abstract

This invention relates to the field of electricity pricing strategy formulation technology, and provides a method for generating electricity pricing strategies based on federated causal graph networks and counterfactual learning. The method includes: determining a federated causal graph network based on electricity market participant data and prior constraints in the electricity sector to determine the causal relationship between electricity price, load, and renewable energy output; performing counterfactual simulations locally on the participants based on the federated causal graph network to determine the simulation results, wherein the simulation results are verified by a causal consistency discriminant determined based on causal relationships; inputting the simulation results into a multi-agent optimization model to obtain a game result, wherein the causal regularization term of the multi-agent optimization model is determined based on the activation probability of negative causal paths in the federated causal graph network; and generating an electricity pricing strategy based on the game result. This addresses the problem in related technologies where formulating electricity pricing strategies for new electricity markets is difficult to balance high rationality, fidelity, and feasibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electricity pricing strategy formulation technology, and in particular to a method for generating electricity pricing strategies based on federated causal graph networks and counterfactual learning. Background Technology

[0002] As the proportion of renewable energy connected to the power system increases, and in order to protect privacy and comply with confidentiality requirements, the formulation of electricity pricing strategies for the new electricity market has become an urgent practical application need.

[0003] The relevant electricity pricing strategy formulation methods face the following difficulties: First, when formulating time-of-use pricing, the power grid cannot know the true driving force behind changes in user load, and cannot distinguish whether the load decline is due to electricity price incentives or production plan adjustments, leading to misjudgments and insufficient rationality; Second, data from all parties (power grid, users, and renewable energy) cannot be directly aggregated, and can only be used for data-level collaborative training, which is prone to distortion; Third, if the strategy is formulated or optimized solely with load smoothing or renewable energy consumption as the goal, it may give rise to electricity pricing strategies that violate user production patterns or market fairness, resulting in insufficient practical engineering implementation of the strategy.

[0004] There is currently no effective solution to the problem that it is difficult to balance high rationality, fidelity, and feasibility in formulating electricity pricing strategies for new electricity markets in related technologies. Summary of the Invention

[0005] The present invention provides a method for generating electricity pricing strategies based on federated causal graph networks and counterfactual learning, which at least solves the problem in related technologies that it is difficult to balance high rationality, fidelity and feasibility when formulating electricity pricing strategies for new electricity markets.

[0006] This invention provides a method for generating electricity pricing strategies based on federated causal graph networks and counterfactual learning, comprising: determining a federated causal graph network based on electricity market participant data and prior constraints in the electricity sector, wherein the federated causal graph network is used to determine the causal relationship between electricity price, load, and renewable energy output; performing counterfactual simulations locally on the participants based on the federated causal graph network, and determining the simulation results, wherein the simulation results are obtained by a causal consistency discriminator, which is determined based on causal relationships; inputting the simulation results into a multi-agent optimization model to obtain game results, wherein the number of agents in the multi-agent optimization model corresponds to the type of participant, and the causal regularization term of the multi-agent optimization model is determined based on the activation probability of negative causal paths in the federated causal graph network; and generating an electricity pricing strategy based on the game results.

[0007] Preferably, the prior constraints in the power sector are two-layer constraints of a directed acyclic graph (DAG). Before determining the federated causal graph network based on power market participant data and prior constraints in the power sector, and before using the federated causal graph network to determine the causal relationship between electricity price, load, and renewable energy output, the method further includes: determining hard mask constraints based on temporal causal constraints, physical causal constraints, and market rule constraints; determining soft penalty constraints based on the native loss function, DAG constraint terms, and prior bias penalty coefficients, wherein the native loss function is the loss function of the core algorithm for causal discovery based on continuous optimization; and determining prior constraints in the power sector based on hard mask constraints and soft penalty constraints.

[0008] Preferably, the federated causal graph network is determined based on participant data in the electricity market and prior constraints in the electricity sector, including: determining the local causal graphs of each participant based on participant data and prior constraints in the electricity sector, wherein the adjacency matrix and causal edge strength coefficients of the local causal graphs are supplemented with Laplace noise; solving for the global causal graph by minimizing the structural Hamming distance between the global causal graph and the local causal graphs as the optimization objective; and determining the federated causal graph network based on the local causal graphs and the global causal graph.

[0009] Preferably, the above method further includes: under the condition of satisfying the preset update conditions, using the global causal graph as the initial adjacency matrix to iteratively update the local causal graph to obtain a new local causal graph; and determining a new global causal graph based on the optimization objective and the new local causal graph.

[0010] Preferably, the counterfactual simulation based on the federated causal graph network is performed locally by the participants to determine the simulation results, including: extracting causal subgraphs from the federated causal graph network based on a preset simulation objective; performing counterfactual simulation locally by the participants based on the causal subgraphs, a temporal conditional variational autoencoder, and a decoder to obtain a first counterfactual sequence, wherein the temporal conditional variational autoencoder is pre-trained locally by the participants based on historical time-series data, and the first counterfactual sequence includes at least one of the following: a counterfactual load sequence and a counterfactual output sequence; judging the first counterfactual sequence based on a causal consistency discriminator to obtain a causal consistency score; applying gradient penalty processing to the first counterfactual sequence based on the causal consistency score to obtain a second counterfactual sequence; and determining the simulation results based on the statistical characteristics of the second counterfactual sequence.

[0011] Preferably, the causal consistency score is obtained by judging the first counterfactual sequence based on the causal consistency discriminator, including: inputting the adjacency matrix of the first counterfactual sequence and the causal subgraph into the causal consistency discriminator to obtain the causal consistency score, wherein the causal consistency score is in the range of 0-1, and the loss function of the causal consistency discriminator is... for: ; In the formula, Indicates the causal consistency penalty coefficient, subscript Indicates the parent node subscript Represents child nodes , Represents a causal subgraph. Represents the parent node in the causal subgraph Point to child node The causal edge strength, Represents child nodes The generated value, Indicates the parent node The generated value, This represents the causal transitivity fitting function.

[0012] Preferably, determining the simulation results based on the statistical characteristics of the second counterfactual sequence includes: aggregating the statistical characteristics of the second counterfactual sequence based on the weight coefficients of each participant to obtain a simulation curve, wherein the simulation curve includes at least a global counterfactual load curve and a renewable energy absorption curve; calculating the peak shaving and valley filling rate, renewable energy absorption rate, and user electricity cost change rate based on the statistical characteristics of the second counterfactual sequence; and determining the simulation results based on the simulation curve, peak shaving and valley filling rate, renewable energy absorption rate, and user electricity cost change rate.

[0013] Preferably, before inputting the simulation results into the multi-agent optimization model to obtain the game result, the above method further includes: determining the initial model of the multi-agent optimization model based on the agent set, global state space, action space, local observation space and reward function of each agent, state transition function and discount factor, wherein the agent set includes at least a power grid dispatch agent, a user group federated agent, and a new energy power station agent, and each agent is configured to only observe the local observation space; adding a causal regularization term to the reward function of each agent in the initial model to obtain the model to be trained; training the model to be trained based on a collaborative training algorithm to obtain the multi-agent optimization model.

[0014] Preferably, the formula for the causal regularization term is expressed as: ; ; In the formula, Indicates the causal regularity term. Indicates the total number of negative causal paths. Indicates the first A negative causal path, Indicates the first The activation probability of a negative causal path. Indicates the first The total causal strength of the negative causal path Indicates the first The strength coefficient of the causal edge on a negative causal path. This represents the normalized value of the agent's action corresponding to the starting node of the path.

[0015] Preferably, before determining the federated causal graph network based on electricity market participant data and prior constraints in the electricity sector, the above method further includes: based on 3 The criteria involve removing outliers from the initial participant data to obtain the first processed data; then, using linear interpolation combined with temporal forward imputation, missing values ​​are filled into the first processed data to obtain the second processed data; finally, the second processed data is standardized based on the Z-score to obtain the participant data.

[0016] This invention provides a method for generating electricity pricing strategies based on federated causal graph networks and counterfactual learning. The method determines a federated causal graph network based on data from electricity market participants and prior constraints in the electricity sector to establish causal relationships between electricity prices, load, and renewable energy output. Counterfactual simulations are performed locally on the participants using the federated causal graph network to determine the simulation results. These results are verified by a causal consistency discriminator, which is determined based on causal relationships. The simulation results are then input into a multi-agent optimization model to obtain game results. The causal regularization term of the multi-agent optimization model is determined based on the activation probability of negative causal paths in the federated causal graph network. Finally, an electricity pricing strategy is generated based on the game results.

[0017] Without sharing raw data, a unified and interpretable global causal graph is jointly learned from scattered data on the power grid, users, and renewable energy sources. This breaks down the causal black box caused by data silos and provides a reliable basis for accurate decision-making. Counterfactual inference is moved from statistical simulation to causal simulation. The global causal graph is introduced as a strong constraint into the generation process of the variational autoencoder, and a causal consistency discriminator is designed to improve the fidelity of simulation results. Multi-agent fair game theory guided by causal rules is conducted, transforming path information in the causal graph into regularized penalty terms in the multi-agent reward function, which helps improve the rationality and feasibility of electricity pricing strategies. This addresses the challenge in related technologies where formulating electricity pricing strategies for new electricity markets struggles to balance high rationality, fidelity, and feasibility. Attached Figure Description

[0018] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other embodiments based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the steps of a method for generating electricity pricing strategies based on federated causal graph networks and counterfactual learning, as described in an embodiment of the present invention.

[0020] Figure 2 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0021] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.

[0022] As the proportion of renewable energy connected to the power system increases, and in order to protect privacy and comply with confidentiality requirements, the formulation of electricity pricing strategies for the new electricity market has become an urgent practical application need.

[0023] The relevant electricity pricing strategy formulation methods face the following difficulties: First, when formulating time-of-use pricing, the power grid cannot know the true driving force behind changes in user load, and cannot distinguish whether the load decline is due to electricity price incentives or production plan adjustments, leading to misjudgments and insufficient rationality; Second, data from all parties (power grid, users, and renewable energy) cannot be directly aggregated, and can only be used for data-level collaborative training, which is prone to distortion; Third, if the strategy is formulated or optimized solely with load smoothing or renewable energy consumption as the goal, it may give rise to electricity pricing strategies that violate user production patterns or market fairness, resulting in insufficient practical engineering implementation of the strategy.

[0024] Therefore, please refer to Figure 1 As shown, this invention provides a method for generating electricity pricing strategies based on federated causal graph networks and counterfactual learning, including steps S101 to S104. This method addresses the problem in related technologies where formulating electricity pricing strategies for new electricity markets struggles to balance high rationality, fidelity, and feasibility. It is suitable for collaborative formulation of electricity pricing strategies involving multiple stakeholders and high privacy requirements under conditions of high-proportion renewable energy access.

[0025] Step S101: Based on the data of participants in the electricity market and prior constraints in the electricity sector, a federated causal graph network is determined. The federated causal graph network is used to determine the causal relationship between electricity price, load and renewable energy output.

[0026] Step S102: Perform counterfactual simulation locally on the participating parties based on the federated causal graph network to determine the simulation results. The simulation results are obtained by a causal consistency discriminator, which is determined based on causal relationships.

[0027] Step S103: Input the simulation results into the multi-agent optimization model to obtain the game result. The number of agents in the multi-agent optimization model corresponds to the type of participants, and the causal regularization term of the multi-agent optimization model is determined based on the activation probability of negative causal paths in the federated causal graph network.

[0028] Step S104: Generate an electricity pricing strategy based on the game results.

[0029] The participants in the electricity market include grid-side clients, industrial and commercial park / user clients, and renewable energy power plant clients. These three types of clients correspond one-to-one with the grid dispatching intelligent agent, the user group federated intelligent agent, and the renewable energy power plant intelligent agent, respectively. When adding different types of participants or further subdividing the above types of participants, the number of intelligent agents needs to be increased accordingly to ensure consistency between the types of participants and the number of intelligent agents. This embodiment will subsequently use the above three types of clients as participants for detailed explanation.

[0030] The data from the participants includes local time-series data with a time granularity of 1 hour. The data dimensions include real-time electricity price, hourly electricity consumption / new energy output, user production line utilization rate, ambient temperature, and weekday / holiday type. The data coverage period is no less than 12 months.

[0031] Step S101 is set up to enable all participants to learn a global causal graph covering the entire electricity market scenario without leaving the local source of the raw data. This will clarify the causal relationships, transmission paths, and strengths between electricity price, load, and renewable energy, providing an interpretable causal constraint basis for subsequent simulations and decision-making.

[0032] In this embodiment, the local causal graph with embedded power domain prior constraints is learned locally. Each client uses the NOTEARS algorithm based on gradient optimization to learn the local causal graph in combination with power domain prior constraints, and outputs the adjacency matrix and causal edge strength coefficients of the local causal graph without any original data information.

[0033] In this embodiment, global causal graph aggregation and dynamic optimization under differential privacy protection are performed. Each client adds Laplace noise to the adjacency matrix and causal edge strength coefficients of its local causal graph to achieve local differential privacy (LDP) protection before uploading them to the central scheduling server. Details will be provided later.

[0034] Step S102 is set up to complete the counterfactual simulation of electricity price intervention based on the global causal graph under the premise of privacy protection, quantify the implementation effect of the electricity price strategy, and provide simulation support for subsequent multi-agent decision-making.

[0035] Step S103 is set up to transform the constraints of the global causal graph into regularization terms for multi-agent decision-making, complete multi-agent collaborative game optimization under federated privacy constraints, and thus output a Nash equilibrium electricity price strategy that takes into account the interests of all parties.

[0036] The method provided in this embodiment identifies the global causal structure from scattered data under privacy protection, providing interpretable causal priors for subsequent modules; it uses causal graphs to guide the selection and generation of counterfactual factors, improving the fidelity and rationality of the simulation implementation effect; and it conducts multi-party game under the guidance of causal knowledge to output a dynamic, balanced, and sustainable electricity pricing strategy.

[0037] The method provided in this embodiment can identify the true causal effect between peak-hour electricity pricing and reducing peak loads of industrial users, overcoming the frequent failures or unpredictable side effects of human intervention, and avoiding harm to users with rigid production needs. Causal inference usually requires centralized data, which conflicts with the privacy and confidentiality requirements of user electricity consumption data and new energy power generation data in the electricity market. However, the method provided in this embodiment can collaboratively determine the global causal structure from distributed heterogeneous data without data sharing.

[0038] Preferably, before step S101, which determines the federated causal graph network based on electricity market participant data and prior constraints in the electricity sector, the method further includes: based on 3 The criteria involve outlier removal from the initial participant data to obtain the first-processed data. Missing values ​​are then imputed using linear interpolation combined with temporal forward imputation to obtain the second-processed data. Finally, the second-processed data is standardized based on the Z-score to obtain the participant data.

[0039] Specifically, outliers exceeding the mean ± 3 standard deviations are removed.

[0040] When performing missing value filling, forward filling is used for missing values ​​in a single time period, and linear interpolation is used for missing values ​​in multiple consecutive time periods.

[0041] When performing data standardization, all features are normalized to a distribution with a mean of 0 and a variance of 1.

[0042] Each client performs data preprocessing according to unified rules locally, and the preprocessed data is stored locally throughout the process and is not transmitted externally.

[0043] Preferably, the prior constraints in the power sector are two-layer constraints of a directed acyclic graph (DAG).

[0044] The method, which determines a federated causal graph network based on electricity market participant data and prior constraints in the power sector, further includes: determining hard mask constraints based on temporal causal constraints, physical causal constraints, and market rule constraints; determining soft penalty constraints based on the native loss function, directed acyclic graph constraint terms, and prior bias penalty coefficients, where the native loss function is the loss function of the NOTEARS core algorithm for causal discovery based on continuous optimization; and determining prior constraints in the power sector based on hard mask constraints and soft penalty constraints.

[0045] Specifically, hard mask constraint: an adjacency matrix mask M is pre-constructed, and based on three types of prior rules, the positions corresponding to prohibited causal edges are set to 0. During the optimization process, the adjacency matrix W is multiplied element by element with the mask M to forcibly block invalid causal edges.

[0046] The three types of prior rules include: time causality constraints, where future data does not affect past data, and edges in the adjacency matrix that point to the current time period variable from subsequent time period variables are forcibly set to 0; physical causality constraints, where renewable energy output only affects the grid-connected electricity price and does not directly affect the user-side electricity load, and corresponding edges are forcibly set to 0; and market rule constraints, where the electricity price signal is the cause of the load response rather than the effect, and edges of the user load pointing to the electricity price are forcibly set to 0.

[0047] Soft penalty constraint: By adding a DAG constraint term and a prior bias penalty term to the native NOTEARS loss function, the loss function is obtained. : ; In the formula, This is preprocessed time-series data locally. It is an adjacency matrix. Let λ be the sample size and λ be the L1 regularization coefficient. These are the DAG constraint coefficients. (This is a DAG constraint term for NOTEARS, ensuring the graph structure is acyclic). This is the prior bias penalty coefficient. For element-wise multiplication, or as... By narrowing the solution space through double-layer constraints, the accuracy and convergence speed of causal graph learning are improved.

[0048] Preferably, step S101, determining the federated causal graph network based on participant data in the electricity market and prior constraints in the electricity sector, includes: determining the local causal graphs of each participant based on participant data and prior constraints in the electricity sector, wherein Laplace noise is added to the adjacency matrix and causal edge strength coefficients of the local causal graphs. The global causal graph is obtained by minimizing the structural Hamming distance between the global and local causal graphs as the optimization objective; the federated causal graph network is then determined based on the local and global causal graphs.

[0049] Specifically, the differential privacy parameter is set as follows: single-round upload privacy budget The system's cumulative global privacy budget After normalization to 0-1, the adjacency matrix and causality strength coefficients have a sensitivity Δ=1, and the Laplace noise scale b=Δ / The noise is directly superimposed onto the uploaded matrix elements.

[0050] The server uses a weighted average and consistency-optimized graph aggregation algorithm to aggregate the local causal graphs uploaded by each client. The specific rules are as follows: Dimension alignment: First, the adjacency matrix of each client is aligned with all feature dimensions to be unified to the full scene feature dimensions. Edges without corresponding features locally are set to 0.

[0051] Weighted average: weighting coefficient ,in Let i be the effective sample size for client i. For client i, the number of months the data covers. The total number of clients is represented by a weighted average of the elements of the normalized adjacency matrix and the causality strength coefficient.

[0052] Consistency optimization: The objective is to minimize the structural deviation between the global cause-effect graph and each local cause-effect graph. The objective function is: ; In the formula, The structural Hamming distance is used as a quantitative indicator of structural matching degree, and the optimal global adjacency matrix is ​​solved using the gradient descent method. .

[0053] After aggregation, a global causal graph covering the entire scenario is generated, clearly marking the direction and causal strength of core causal edges. For example, time-of-use electricity pricing signals. Interruptible load response, causality strength 0.75.

[0054] Simultaneously, based on the backdoor criterion and the d-separation criterion, confounding variables that simultaneously affect both the intervention variable and the target variable are identified, forming a structured, interpretable causal knowledge base. Confounding variables can be, but are not limited to, workday type, temperature, and production schedule.

[0055] The explainable causal knowledge base is stored in a graph database and contains full information on nodes, causal edges, strength coefficients, constraint rules, and mixed variable annotations.

[0056] Preferably, the method further includes: under the condition of satisfying a preset update, iteratively updating the local causal graph using the global causal graph as the initial adjacency matrix to obtain a new local causal graph. Based on the optimization objective and the new local causal graph, a new global causal graph is determined.

[0057] Specifically, the server distributes the aggregated global causal graph to each client. Each client uses the global causal graph as its initial adjacency matrix and adds a structural deviation penalty term from the global causal graph to its local NOTEARS-optimized loss function. Based on newly added local data, iterative updates to the local causal graph are performed. The fixed iteration cycle is one month, or iteration is triggered when the amount of newly added local data exceeds 10% of the total samples, repeating the above aggregation process to achieve dynamic optimization of the global causal graph.

[0058] Preferably, step S102, performing counterfactual simulations locally on the participating parties based on the federated causal graph network and determining the simulation results, includes: extracting causal subgraphs from the federated causal graph network based on preset simulation objectives.

[0059] Based on causal subgraphs, temporal conditional variational autoencoders and decoders, counterfactual simulations are performed locally on the participants to obtain the first counterfactual sequence. The temporal conditional variational autoencoder is pre-trained locally on the participants based on historical time-series data. The first counterfactual sequence includes at least one of the following: counterfactual load sequence and counterfactual output sequence.

[0060] The causal consistency score is obtained by judging the first counterfactual sequence based on the causal consistency discriminant.

[0061] The first counterfactual sequence is subjected to gradient penalty processing based on the causal consistency score to obtain the second counterfactual sequence.

[0062] The simulation results are determined based on the statistical characteristics of the second counterfactual sequence.

[0063] Specifically, each client pre-trains a Temporal Conditional Variational Autoencoder (TCVAE) locally, using local historical time-series data as training samples to learn the conditional distribution of local load / output sequences. The core configuration of TCVAE is as follows: both the encoder and decoder employ a bidirectional LSTM structure; the input sequence length is 168 hours (weekly time series); the conditional variables are electricity price, ambient temperature, and weekday / holiday type for the same period; the latent space dimension is set to 1 / 4 of the input feature dimension; model training uses the Adam optimizer with a learning rate of 1e-4, a batch size of 32, and a convergence criterion of the validation set reconstruction loss decreasing by less than 1e-5 for 10 consecutive rounds. After model convergence, the TCVAE encoder can map high-dimensional time-series data to a low-dimensional latent space, and the decoder can reconstruct a time-series sequence conforming to the local data distribution based on the latent space vectors.

[0064] Counterfactual intervention and constraint generation are based on causal subgraphs. When the server initiates a counterfactual simulation request for electricity price intervention, such as a request to increase the flat electricity price by 0.1 yuan / kWh, it simultaneously sends intervention instructions and causal subgraphs related to this intervention in the global causal graph to each client.

[0065] The causal subgraph is extracted based on the Markov blanket of the intervention variable, and the intervention variable (electricity price), target variable (load / output), intermediate variables, confounding variables and irrelevant variables in the direct / indirect causal path are clearly marked; each client adapts the global causal subgraph based on the local causal graph and removes nodes that do not have corresponding features locally.

[0066] Each client completes the pre-constraints for counterfactual generation based on the causal subgraph: locking the feature dimensions directly / indirectly affected by the intervention, freezing irrelevant feature dimensions to the historical average of the same period in the latent space input layer of the encoder, and freezing confounding variables to the true observation values ​​at the time of intervention, ensuring that counterfactual generation only takes place on the causal path of the intervention's impact, and avoiding interference from irrelevant variables.

[0067] In the latent space of TCVAE, each client performs causally guided latent variable intervention operations based on intervention instructions, and generates counterfactual load / output sequences through the decoder.

[0068] During the generation process, a causal consistency discriminator is added, and a causal consistency loss function is designed to penalize generation results that violate the transitive logic of the causal graph.

[0069] Preferably, the causal consistency score is obtained by judging the first counterfactual sequence based on the causal consistency discriminator, including: inputting the adjacency matrix of the first counterfactual sequence and the causal subgraph into the causal consistency discriminator to obtain the causal consistency score, wherein the causal consistency score is in the range of 0-1, and the loss function of the causal consistency discriminator is... for: ; In the formula, Indicates the causal consistency penalty coefficient, subscript Indicates the parent node subscript Represents child nodes , Represents a causal subgraph. Represents the parent node in the causal subgraph Point to child node The causal edge strength, Represents child nodes The generated value, Indicates the parent node The generated value, This represents the causal transitivity fitting function.

[0070] Specifically, the causal consistency discriminator uses a two-layer fully connected network.

[0071] For generated results that violate causal logic, such as electricity price increases leading to synchronous load growth throughout the day and intervention variables not directly affecting the target variable through causal paths, gradient penalties are applied through the aforementioned loss function to ensure that the generated counterfactual sequences strictly follow the causal relationship between electricity price, load, and renewable energy.

[0072] Preferably, determining the simulation results based on the statistical characteristics of the second counterfactual sequence includes: aggregating the statistical characteristics of the second counterfactual sequence based on the weight coefficients of each participant to obtain a simulation curve, wherein the simulation curve includes at least a global counterfactual load curve and a renewable energy absorption curve. Peak shaving and valley filling rate, renewable energy absorption rate, and user electricity cost change rate are calculated based on the statistical characteristics of the second counterfactual sequence. The simulation results are determined based on the simulation curve, peak shaving and valley filling rate, renewable energy absorption rate, and user electricity cost change rate.

[0073] Specifically, each client uploads the unified dimensional statistical features (without original time series data) of the generated local counterfactual sequence to the server. The statistical features include: hourly load / output mean, maximum, minimum, peak-valley difference, and cumulative electricity consumption / generation, totaling 5 core indicators.

[0074] The server aggregates statistical features based on the weight coefficients of each client, generating a global counterfactual load curve and a renewable energy consumption curve. The core effect of this electricity price intervention strategy is evaluated using the following quantitative formula.

[0075] Peak shaving and valley filling rate: In the formula, Peak-valley difference as the baseline scenario The peak-to-valley difference after intervention.

[0076] New energy consumption rate: In the formula, The actual amount of electricity consumed by new energy sources during the intervention period. This represents the total power output of new energy sources during the intervention period.

[0077] User electricity cost change rate: In the formula, The total electricity cost for the baseline scenario. The total electricity cost after intervention.

[0078] After completing the calculation of the above indicators, output a report predicting the implementation effect of this electricity price intervention strategy.

[0079] Preferably, in step S103, before inputting the simulation results into the multi-agent optimization model to obtain the game result, the method further includes: determining an initial model of the multi-agent optimization model based on the agent set, global state space, action space, local observation space, reward function, state transition function, and discount factor of each agent. The agent set includes at least a power grid dispatch agent, a user group federated agent, and a new energy power station agent, and each agent is configured to only observe its local observation space. A causal regularization term is added to the reward function of each agent in the initial model to obtain the model to be trained. The model to be trained is trained based on a collaborative training algorithm to obtain the multi-agent optimization model.

[0080] Specifically, the electricity price collaborative decision-making process is modeled as a discrete-time partially observable Markov game in a federal environment, where the game tuple is defined as follows: ,in, For a collection of intelligent agents, For the global state space, Let i be the action space of agent i. For agent i, the local observation space This is the state transition function. Let be the reward function for agent i. This is the discount factor. It is preset by those skilled in the art, for example, set to 0.95.

[0081] Defined partial observable boundaries: Each agent can only observe its local observation space. It is unable to obtain the local raw data and action information of other intelligent agents.

[0082] The training process for all agents is completed locally, with only model parameters uploaded and no raw training data uploaded.

[0083] The power grid dispatching intelligent agent corresponds to the power grid-side client. Its action space is the adjustment range of the three-stage time-of-use electricity price (peak, flat, and valley). The upper and lower limits of the electricity price are constrained to be ±30% of the benchmark electricity price, and the adjustment step size is 0.01 yuan / kWh. The observation space consists of power grid operation data and global counterfactual simulation results. The optimization objective is to achieve peak shaving and valley filling, and safe and stable operation of the power grid.

[0084] The user group federated intelligent agent corresponds to the industrial and commercial park / user client. Its action space is the adjustment ratio of interruptible load and transferable load for each hour, and the load adjustment range in a single time period shall not exceed ±50% of the maximum adjustable load. The observation space is real-time electricity price, local production plan and electricity cost. The optimization objective is to minimize electricity cost and stabilize production plan. The federated averaging algorithm is used to aggregate the local policy network parameters of the same type of users to solve the heterogeneity problem of multiple users.

[0085] The intelligent agent for new energy power plants corresponds to the client-side application of new energy power plants. Its action space is an hourly grid connection bidding strategy, with the upper and lower limits of the bid constrained by ±20% of the benchmark grid connection price. Its observation space includes electricity price signals, meteorological data, power output forecast results, and power output constraints. Its optimization objectives are to maximize the new energy absorption rate and optimize power generation revenue.

[0086] By adding a causal regularization term to the local reward function of each agent, the constraints of the global causal graph are transformed into computable quantifiable penalty terms, resulting in the final local reward function formula. for: ; In the formula, Basic reward items, For causal regularity, The penalty coefficient has a base value of 1.0 and a dynamic range of 0.5-2.0, and is positively correlated with the variance of the agent's base reward.

[0087] The basic reward items for each agent are designed based on its own optimization goals.

[0088] Basic reward items for power grid dispatching intelligent agents : ; In the formula, , For the weighting coefficients, satisfying .

[0089] Basic rewards for the user group's federated intelligent agent : ; The greater the decrease in electricity costs, the higher the basic reward for the user group's federated intelligent agent.

[0090] Basic reward items for intelligent systems in new energy power stations : ; In the formula, The rate of change in power generation revenue, , For the weighting coefficients, satisfying .

[0091] Preferably, the causal regularization term is calculated based on the global causal graph. Its core is to quantify the probability that the agent's current strategy will activate a negative causal path and to impose a gradient penalty on the behavior that activates the negative causal path.

[0092] The formula for the causal regularity term is expressed as: ; ; In the formula, Indicates the causal regularity term. Indicates the total number of negative causal paths. Indicates the first A negative causal path, Indicates the first The activation probability of a negative causal path. Indicates the first The total causal strength of the negative causal path Indicates the first The strength coefficient of the causal edge on a negative causal path. This represents the normalized value of the agent's action corresponding to the starting node of the path.

[0093] Specifically, negative causal paths refer to causal paths in the global causal graph that lead to the degradation of the system's core optimization objectives and violate the laws of electrical physics and market rules. These are pre-labeled based on domain rules and a causal strength threshold (≥0.3), such as excessively high electricity prices. Rigid users exiting the market, peak-valley electricity price inversion The difference between peak and valley loads has widened.

[0094] By using causal regularization terms, we can achieve full-process causal constraints on the agent's strategy and avoid inferior strategies that violate physical laws and market rules.

[0095] The multi-agent optimization model in this embodiment uses a federated multi-agent deep deterministic policy gradient algorithm to complete collaborative training, which can overcome the pain point of centralized training relying on global observation in related technologies.

[0096] Specifically, a federated adaptation architecture combining local commentators and globally aggregated commentators is designed, and the training process is as follows.

[0097] Initialization: Each agent initializes its policy network (Actor) and critic network (Critic) locally, and the server initializes the global critic network.

[0098] Local training: Each agent completes a single round of training of the policy network and the local critic network locally, based on local observations, local actions, global causal graphs, and counterfactual simulation results, without needing to obtain the raw data and actions of other agents.

[0099] Privacy-protected upload: After each round of training, each agent will upload the commentator network parameters with differential privacy protection to the central server. The differential privacy configuration is consistent with step S101.

[0100] Global aggregation and distribution: The server uses a federated averaging algorithm to weight and aggregate the commentator network parameters uploaded by each agent, generate a global commentator network, and distribute it to each agent.

[0101] Local Iterative Update: Each agent updates its local policy network based on the gradient information of the global commentator network, completing one round of iteration.

[0102] Convergence determination: If the change in the local reward function of all agents is less than 1e-3 and the change in the global objective function of the system is less than 1e-4 in 5 consecutive training rounds, for example, the change in peak shaving and valley filling rate and new energy consumption rate is less than 1e-4, the system is determined to have converged to Nash equilibrium.

[0103] Based on the aggregated global policy network parameters, the server verifies that no agent can increase its own reward by unilaterally changing the policy, thus completing the Nash equilibrium verification.

[0104] After training convergence, the server outputs the final balanced dynamic electricity price strategy, and simultaneously displays the predicted results of the implementation effect of the counterfactual simulation in step S102.

[0105] The method described in this embodiment overcomes the challenge of discovering causal mechanisms in the electricity market under privacy protection. It combines the NOTEARS causal discovery algorithm with the differential privacy graph aggregation protocol to jointly learn a unified and interpretable global causal graph from scattered grid, user, and new energy data without sharing the original data. This breaks down the causal black box caused by data silos and provides a reliable basis for accurate decision-making.

[0106] The method provided in this embodiment bridges the gap between statistical simulation and causal simulation in counterfactual reasoning. It introduces a global causal graph as a strong constraint into the generation process of the variational autoencoder and designs a causal consistency discriminator. This ensures that the generated counterfactual load curve is not only statistically realistic but also strictly follows the causal logic between electricity price and load. This significantly improves the credibility of the simulation results for "what if the electricity price changes like this," solving the simulation distortion problem of related methods.

[0107] The method described in this embodiment conducts a fair multi-agent game guided by causal rules, transforming path information in the causal graph into a regularized penalty term in the multi-agent reward function. This endows the game optimization process of electricity pricing strategies with causal common sense, automatically avoiding inferior strategies that violate economic and physical laws. The output results combine data optimality, causal rationality, and multi-party fairness, avoiding the incentive distortion problem caused by unconstrained games.

[0108] The method provided in this embodiment addresses the core pain points of data silos among multiple stakeholders in the electricity market, insufficient causality in electricity price decisions, and difficulty in converging equilibrium in multi-stakeholder game theory. It constructs a three-layer technical architecture that includes global causal structure discovery, causal constraint counterfactual simulation, and causal regularization multi-agent collaborative decision-making. The entire process is based on a federated learning framework to ensure that data is usable but not visible. Under the premise of protecting the data privacy of all participants, it outputs an equilibrium electricity price strategy that takes into account grid security, user costs, and renewable energy consumption.

[0109] The present invention also provides a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform a method according to an embodiment of the present invention.

[0110] The present invention also provides a computer program product, including a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform the method of the embodiments of the present invention.

[0111] This invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, which, when executed by the at least one processor, causes the electronic device to perform the method of this invention.

[0112] refer to Figure 2This is a structural block diagram of an electronic device, either a server or a client, according to an embodiment of the present invention. It is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0113] like Figure 2 As shown, the electronic device includes a computing unit 201, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 202 or a computer program loaded from a storage unit 208 into a random access memory (RAM) 203. The RAM 203 may also store various programs and data required for the operation of the electronic device. The computing unit 201, the ROM 202, and the RAM 203 are interconnected via a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.

[0114] Multiple components in the electronic device are connected to I / O interface 205, including: input unit 206, output unit 207, storage unit 208, and communication unit 209. Input unit 206 can be any type of device capable of inputting information into the electronic device. Input unit 206 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of the electronic device. Output unit 207 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 208 may include, but is not limited to, disks and optical discs. Communication unit 209 allows the electronic device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, and / or wireless communication transceivers, such as Bluetooth devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0115] The computing unit 201 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 201 include, but are not limited to, CPUs, graphics processing units (GPUs), various special-purpose artificial intelligence (AI) computing units, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 201 performs the various methods and processes described above. For example, in some embodiments, the method embodiments of the present invention can be implemented as computer programs tangibly contained in a machine-readable medium, such as storage unit 208. In some embodiments, part or all of the computer program can be loaded and / or installed on an electronic device via ROM 202 and / or communication unit 209. In some embodiments, the computing unit 201 can be configured to perform the methods described above by any other suitable means (e.g., by means of firmware).

[0116] Computer programs for implementing the methods of embodiments of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0117] In the context of embodiments of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, or infrared systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0118] It should be noted that the term "comprising" and its variations used in the embodiments of this invention are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "a plurality" mentioned in the embodiments of this invention are illustrative and not restrictive, and those skilled in the art should understand that unless explicitly indicated otherwise in the context, they should be understood as "one or more". The descriptions of terms such as "first", "second", etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of indicated technical features.

[0119] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this invention are all information and data authorized by the user or fully authorized by all parties.

[0120] The steps described in the method embodiments provided by the present invention can be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of protection of the present invention is not limited in this respect.

[0121] The term "embodiment" in this specification refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily imply the same embodiment, nor does it imply independence or alternativeity from other embodiments. The various embodiments in this specification are described in a related manner, with reference to each other for similar or identical parts. In particular, for apparatus, device, and system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, and relevant details are referred to in the description of the method embodiments.

[0122] The above-described embodiments are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.

Claims

1. A method for generating electricity pricing strategies based on federated causal graph networks and counterfactual learning, characterized in that, include: A federated causal graph network is determined based on data from electricity market participants and prior constraints in the electricity sector. This federated causal graph network is used to determine the causal relationship between electricity price, load, and renewable energy output. Based on the aforementioned federated causal graph network, counterfactual simulations are performed locally on the participating parties to determine the simulation results. The simulation results are obtained by a causal consistency discriminant, which is determined based on the causal relationship. The simulation results are input into a multi-agent optimization model to obtain the game result. The number of agents in the multi-agent optimization model corresponds to the types of participants, and the causal regularization term of the multi-agent optimization model is determined based on the activation probability of negative causal paths in the federated causal graph network. Electricity pricing strategies are generated based on the game results.

2. The method according to claim 1, characterized in that, The prior constraints in the power field are two-layer constraints of a directed acyclic graph; The method further includes determining a federated causal graph network based on electricity market participant data and prior constraints in the electricity sector. Prior to using this federated causal graph network to determine the causal relationship between electricity prices, load, and renewable energy output, the method also includes: Hard mask constraints are determined based on temporal causality constraints, physical causality constraints, and market rule constraints. The soft penalty constraint is determined based on the native loss function, the directed acyclic graph constraint term, and the prior bias penalty coefficient, wherein the native loss function is the loss function of the causal discovery core algorithm based on continuous optimization. The prior constraints in the power sector are determined based on the hard mask constraints and the soft penalty constraints.

3. The method according to claim 1, characterized in that, The federated causal graph network is determined based on electricity market participant data and prior constraints in the electricity sector, including: Based on the participant data and the prior constraints of the power sector, a local causal graph for each participant is determined, wherein the adjacency matrix and causal edge strength coefficient of the local causal graph are enriched with Laplace noise. The global causal graph is obtained by minimizing the structural Hamming distance between the global causal graph and the local causal graph. The federated causal graph network is determined based on the local causal graph and the global causal graph.

4. The method according to claim 3, characterized in that, The method further includes: Under the condition that the preset update conditions are met, the global causal graph is used as the initial adjacency matrix to iteratively update the local causal graph to obtain a new local causal graph; Based on the optimization objective and the new local causal graph, a new global causal graph is determined.

5. The method according to claim 1, characterized in that, Based on the aforementioned federated causal graph network, counterfactual simulations are performed locally at the participating parties to determine the simulation results, including: Based on the preset simulation objectives, extract causal subgraphs from the federated causal graph network; Based on the causal subgraph, temporal conditional variational autoencoder and decoder, counterfactual simulation is performed locally on the participant to obtain a first counterfactual sequence. The temporal conditional variational autoencoder is pre-trained locally on the participant based on historical time-series data. The first counterfactual sequence includes at least one of the following: counterfactual load sequence and counterfactual output sequence. The first counterfactual sequence is judged based on the causal consistency discriminator to obtain a causal consistency score; The first counterfactual sequence is subjected to gradient penalty processing based on the causal consistency score to obtain the second counterfactual sequence; The simulation results are determined based on the statistical characteristics of the second counterfactual sequence.

6. The method according to claim 5, characterized in that, The causal consistency discriminator is used to determine the first counterfactual sequence to obtain a causal consistency score, including: The adjacency matrix of the first counterfactual sequence and the causal subgraph is input into the causal consistency discriminator to obtain the causal consistency score, wherein the causal consistency score is in the range of 0-1, and the loss function of the causal consistency discriminator is... for: ; In the formula, Indicates the causal consistency penalty coefficient, subscript Indicates the parent node subscript Represents child nodes , Represents a causal subgraph. Represents the parent node in the causal subgraph Point to child node The causal edge strength, Represents child nodes The generated value, Indicates the parent node The generated value, This represents the causal transitivity fitting function.

7. The method according to claim 5, characterized in that, The simulation results are determined based on the statistical characteristics of the second counterfactual sequence, including: The statistical characteristics of the second counterfactual sequence are aggregated based on the weight coefficients of each participant to obtain a simulation curve, wherein the simulation curve includes at least a global counterfactual load curve and a new energy consumption curve. Calculate the peak shaving and valley filling rate, renewable energy consumption rate, and user electricity cost change rate based on the statistical characteristics of the second counterfactual sequence; The simulation results are determined based on the simulation curve, the peak shaving and valley filling rate, the renewable energy absorption rate, and the user electricity cost change rate.

8. The method according to claim 1, characterized in that, Before inputting the simulation results into the multi-agent optimization model to obtain the game result, the method further includes: The initial model of the multi-agent optimization model is determined based on the agent set, the global state space, the action space, local observation space and reward function of each agent, the state transition function and the discount factor. The agent set includes at least the power grid dispatch agent, the user group federated agent and the new energy power station agent. Each agent is configured to only observe the local observation space. By adding the causal regularization term to the reward function of each agent in the initial model, a model to be trained is obtained. The model to be trained is trained based on the collaborative training algorithm to obtain the multi-agent optimized model.

9. The method according to claim 1, characterized in that, The formula for the causal regularization term is expressed as follows: ; ; In the formula, Indicates the causal regularity term. Indicates the total number of negative causal paths. Indicates the first A negative causal path, Indicates the first The activation probability of a negative causal path. Indicates the first The total causal strength of the negative causal path Indicates the first The strength coefficient of the causal edge on a negative causal path. This represents the normalized value of the agent's action corresponding to the starting node of the path.

10. The method according to claim 1, characterized in that, Before determining the federated causal graph network based on electricity market participant data and prior constraints in the electricity sector, the method further includes: Based on 3 The criteria perform outlier removal on the initial data of the participating parties to obtain the first processed data; The first processed data is filled with missing values ​​by using linear interpolation combined with temporal forward padding to obtain the second processed data. The second processed data is standardized based on the Z-score to obtain the participant data.