A market operation simulation trading system for power trading
By employing inverse reinforcement learning and causal inference techniques, a power market simulation system is constructed to dynamically adapt to market changes. This addresses the shortcomings of existing systems in predicting and detecting anomalies in complex environments, thereby improving the accuracy of market forecasting and the effectiveness of emergency response.
Patent Information
- Application Number
- CN202411326796.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-09-23
AI Technical Summary
Existing power market simulation systems struggle to provide accurate predictions and optimization suggestions when faced with complex market environments and abnormal events, and their anomaly detection methods fail to identify underlying causes, leading to low market stability and efficiency.
A market operation simulation system based on inverse reinforcement learning and causal inference is adopted. Through data collection, feature extraction and fusion, a behavioral model of market entities is constructed to dynamically adapt to market changes. A feedback adjustment mechanism and causal graph structure are introduced for anomaly detection and emergency response.
It improves the accuracy of market behavior forecasting and the ability to respond to abnormal events, optimizes market operations, reduces risks, and enhances the confidence of market participants and overall stability.
Smart Images

Figure CN119693020B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of power trading, and particularly relates to a market operation simulation trading system for power trading. Background Technology
[0002] In modern electricity markets, with the diversification of energy structures and the increasing complexity of electricity trading mechanisms, the trading behavior among market participants (such as power generation companies, retailers, and consumers) has become increasingly difficult to predict. Traditional electricity market operation simulation systems mainly rely on rule-based models and static data. While these systems can simulate market behavior within a certain range, they often struggle to provide accurate predictions and optimization suggestions when faced with complex market environments and volatile market conditions. These rule-based models typically assume that the behavior of market participants is static and linear, neglecting dynamic interactions and strategy changes among participants. However, in actual electricity markets, complex game relationships exist among participants, and decision-making is influenced by various factors (such as price fluctuations, supply and demand changes, and policy changes). These factors make market behavior highly dynamic and nonlinear. Furthermore, frequent abnormal events in the market (such as price manipulation, sudden supply and demand imbalances, and equipment failures) are difficult for traditional static simulation systems to detect and respond to quickly and accurately.
[0003] Existing technologies have significant shortcomings in addressing the complexity of market behavior and detecting anomalies. On the one hand, traditional electricity market simulation systems have limited predictive accuracy, struggle to dynamically adapt to market changes, and cannot update market participants' strategies and preferences in real time, resulting in large errors in market forecasts and a lack of accurate insight into future market trends. On the other hand, existing anomaly detection methods are mainly based on rules or simple statistical models, often only detecting superficial anomalies without identifying the underlying causes, leading to weak targeting and effectiveness of emergency response measures. These technical deficiencies not only affect the stability and efficiency of the electricity market but also increase the risks and uncertainties for market participants. With the rapid development of artificial intelligence technology, especially the application of advanced algorithms such as reinforcement learning and causal inference, it is possible to fundamentally overcome these shortcomings of existing technologies and improve the intelligence level of electricity market simulation systems. Summary of the Invention
[0004] The purpose of this invention is to design a market operation simulation trading system for electricity trading. This novel electricity market simulation system significantly improves the accuracy of market behavior prediction and the ability to respond to abnormal events. This not only helps optimize market operations and reduce risks, but also enhances the confidence of market participants and the overall stability of the market.
[0005] To achieve the above objectives, the present invention provides a market operation simulation trading system for electricity trading, the system comprising the following subsystems:
[0006] The data acquisition subsystem is used to preprocess the data, and then extract and fuse features from the preprocessed data to obtain a feature dataset; the data acquisition subsystem performs the following steps:
[0007] Raw data is collected from multiple data sources in the electricity market and preprocessed to obtain multi-source data;
[0008] An attention-based data fusion method is used to extract and fuse features from multi-source data to obtain a fused feature matrix.
[0009] The fused feature matrix is partitioned into training and test sets using a time series segmentation method.
[0010] The market preference prediction subsystem is used to construct an inverse reinforcement learning model to infer the behavioral strategies and preferences of market participants based on the fused feature matrix; the market preference prediction subsystem performs the following steps:
[0011] The state space and action space of market entities are defined based on the fusion feature matrix;
[0012] Suppose that each market participant's strategy is determined by an unknown reward function R(s). t ,a t Driven by ) and then employing a policy estimation method based on soft Q learning to model the behavior of market participants, the reward function R(s) is inferred from historical data. t ,a t ), while utilizing actual behavior sequences in historical data (s t ,a t ) to perform inverse optimization, minimizing the difference between the actual observed behavior and the model's predicted behavior; where s t Indicates market status, a t Indicates market behavior;
[0013] Based on the inferred reward function R(s) t ,a t Recalculate the strategy π of market participants * And generate the subject behavior model π * (s t The behavioral model predicts the decision-making behavior of market participants under different states based on the optimal strategy. Then, the cross-validation method is used to test the generated behavioral model with training and test sets to evaluate the performance of the generated behavioral model on unseen data.
[0014] The market behavior prediction and simulation subsystem is used to predict and simulate the behavior of the main actors based on the π model. * (s t The market behavior prediction and simulation subsystem simulates the interactive behavior of market participants under different conditions to predict the overall evolution trend of the market. The subsystem performs the following steps:
[0015] Based on the subject behavior model π * (s t The initial market conditions are set using a fusion feature matrix to initialize the state space of market participants, and the optimal decision-making behavior of market participants is predicted based on the current market state.
[0016] In response to unforeseen events and unpredictable market behavior in the electricity market, a feedback adjustment mechanism is introduced during state transitions to reflect sudden changes in the market and dynamically adjust the market state.
[0017] A collaborative mechanism based on a generalized linear model is used to construct a subject-based behavior model π. * (s t The multi-agent simulation records the current market state and the optimal decision-making behavior of market players at each time step, while updating the state of each player to reflect interdependence and changes in the overall market.
[0018] An anomaly detection subsystem is used to detect abnormal events in the electricity market based on the market state at the next moment and the optimal decision-making behavior of market participants, employing a causal inference method. The anomaly detection subsystem performs the following steps:
[0019] Extract the characteristic variables needed for causal analysis from the market state in the next moment and the optimal decision-making behavior of market participants, and construct a causal graph;
[0020] By combining the cause-effect graph structure, the market state in the next moment, and the optimal decision-making behavior of market participants, intervention analysis is performed to detect anomalies in the market and obtain the anomaly source nodes.
[0021] Perform counterfactual analysis based on the anomaly source node to confirm the causal chain of the anomaly event;
[0022] The results of intervention analysis and counterfactual analysis are integrated to generate anomaly detection results and reports;
[0023] The emergency response subsystem is used to formulate emergency response strategies for the power market based on anomaly detection results; the emergency response subsystem performs the following steps:
[0024] Emergency response strategy variables are defined based on the anomaly detection results, where each strategy variable corresponds to a response measure for a specific anomaly event;
[0025] The optimization problem is constructed, and the optimal emergency strategy variable and Lagrange multiplier are obtained by introducing a Lagrange function to adjust the emergency strategy variable.
[0026] A multi-objective emergency strategy control method is constructed based on the optimal emergency strategy variables, and the optimal emergency strategy variables are dynamically adjusted to respond to real-time market changes.
[0027] The optimal emergency strategy variables are applied to the actual electricity market, and the implementation effect is monitored and evaluated in real time.
[0028] The system optimization subsystem is used to learn and optimize based on the execution feedback of the optimal emergency strategy variables.
[0029] Furthermore, the policy estimation method based on soft Q-learning is used to model the behavior of market participants, as follows:
[0030]
[0031] Among them, s t The state vector at the current time step t represents the characteristic variables of the electricity market; a t R(s) represents the action vector at the current time step t, indicating the possible decision-making behavior of market participants; t ,a t ) represents the reward function, indicating the state of a market participant in state s. t Take action a t The immediate reward obtained; γ represents the discount factor, which indicates the degree of decay of future rewards, and its value ranges from 0 to 1; Indicates the next state s t+1 The expected value, given that the current state is s. t Execute action a t ;P(·|s t ,a t ) represents the state transition probability, indicating that in state s t Next, execute action a t Then transition to the next state s t+1 The probability of V; π (s t+1 ) represents the state-value function, which expresses the state value function under policy π, starting from state s. t+1 The initial cumulative expected reward; γ is the discount factor, representing the degree of decay of future rewards, P(·|s t ,a t ) is the state transition probability, representing the probability of transitioning from state s to state s. t Next, execute action a t Then transition to the next state s t+1 The probability, V π (s t+1) is the state value function, expressed as follows:
[0032]
[0033] Among them, V π (s t+1 ) represents state s t+1 The value function; The action space represents the set of all possible actions; Q π (s t+1 ,a') represents state s under policy π. t+1 The value function of action a'; exp represents the natural exponential function, used to calculate soft maximization.
[0034] Furthermore, the use of actual behavioral sequences (s) from historical data t ,a t Inverse optimization is performed to minimize the difference between the actual observed behavior and the model's predicted behavior, as shown below:
[0035] Assuming the behaviors in the historical data are the optimal behavior sequence, the inverse optimization objective is to minimize the difference between the actual observed behavior and the model's predicted behavior, as follows:
[0036]
[0037] Wherein, R(s) t ,a t ) represents the reward function, indicating the state of a market participant in state s. t Take action a t The instant reward obtained; Q π (s t ,a t ) represents the state s under policy π. t With action a t The value function (Q) π (s t ,a t )-R(s t ,a t )) 2 The square of the error represents the difference between the value function and the reward function.
[0038] The solution is obtained using gradient descent, where the reward function R(s) is... t ,a t The gradient of is calculated by the following formula, expressed as follows:
[0039]
[0040] in, ∑s represents the gradient of the value function with respect to the reward function; 1 represents a constant term used to calculate the gradient; γ represents the discount factor; ∑s t+1 Represents all possible next states s t+1 Summation; P(s) t+1 |s t ,a t ) represents the state transition probability, indicating the probability of transitioning from state s. t Perform action a t Transition to state s t+1 The probability of; This represents the gradient of the state-value function with respect to the value function.
[0041] Furthermore, the initial market condition involves adding a volatility weight term to the market state vector to reflect the unpredictability of the initial market.
[0042] The introduction of a feedback adjustment mechanism in state transitions to reflect sudden changes in the market is expressed as follows:
[0043]
[0044] Where, Δs t+1 This represents the change in the state of emergency, and α represents the sensitivity parameter of the emergency event. This represents the average behavior of market participants. This represents the vector of abnormal market behavior output by the anomaly detection model.
[0045] Furthermore, the collaborative mechanism based on a generalized linear model is used to construct a subject behavior model π. * (s t The multi-agent simulation is represented as follows:
[0046]
[0047] Among them, w i Let b represent the weight vector of the interaction between the i-th subject and other subjects. i Represents the bias term, ∈ i Representing random noise, used to simulate uncertainty in agent decision-making; GLIM represents a cooperative mechanism based on a generalized linear model. Represents the set of optimal decision behaviors;
[0048] At the same time, a weighted market volatility risk index is introduced. and system failure probability To quantitatively assess market stability and potential risks, the following is presented:
[0049]
[0050]
[0051] Wherein, σ(p) t ) represents the standard deviation of market price fluctuations, max(d) t -s t () represents the largest difference between demand and supply. λ1 and λ2 represent the expected value of market operating costs, γ represents the risk weighting coefficients, γ represents the exponential decay parameter, and N represents the total duration.
[0052] Furthermore, the causal graph structure is: node set Representing market state characteristics and behavioral decision variables, the edge set ε represents the causal relationships between variables; each node A directed edge v between nodes represents a feature variable or behavioral variable. i ,v j )∈ε represents a causal relationship, i.e., v i It is v j The initial causal structure is inferred based on the statistical correlation of historical data and corrected by expert knowledge.
[0053] Furthermore, the intervention analysis, which combines the causal graph structure, the next-moment market state, and the optimal decision-making behavior of market participants, specifically includes:
[0054] Define intervention model This indicates that for node v i Apply intervention to make its value c, for each potential anomalous node v i Calculate the dependent variable v under the intervention condition. j The expected change is expressed as follows:
[0055]
[0056] in, The dependent variable v after intervention j Expected value This represents the expected value before intervention; if If the value exceeds the set threshold τ, then mark v. i This could be a potential source node for anomalies.
[0057] After identifying potential source nodes of anomalies, counterfactual analysis is performed to confirm the causal chain of the anomalous events:
[0058] Counterfactual analysis verifies the impact of anomalous source nodes on market conditions by simulating hypothetical scenarios, quantifies the strength of this impact, and defines counterfactual scenarios. The change in market state under a counterfactual condition is represented as follows:
[0059]
[0060] in, This indicates the market state under the given assumptions. This represents the expected value of the market state under a counterfactual scenario; the calculation result... Used to evaluate the abnormal source node v i The actual impact on market conditions, and identification of the abnormal causal chain v. i →v j .
[0061] Furthermore, in the emergency response subsystem, a target function is set. The objective function used to measure the effectiveness of emergency response strategies includes market stability, response costs, and risk control, and is expressed as follows:
[0062]
[0063] in, U represents the change in market state under the k-th abnormal event. k w represents the emergency response strategy variable. k c represents the weight parameter, reflecting the priority of the k-th event. k Represents the response cost coefficient, and represents the implementation strategy u. k The cost; K represents the total number of events;
[0064] objective function Minimization ensures that emergency response strategies can effectively control market anomalies while reducing execution costs.
[0065] Furthermore, the objective function The solution is obtained using the Lagrange multiplier method and constraints, which include physical constraints and market constraints, as follows:
[0066]
[0067] Where A represents the constraint matrix and b represents the constraint vector, ensuring that the emergency strategy variable u satisfies all physical and market constraints.
[0068] To solve this objective function Introducing the Lagrange function
[0069]
[0070] Through the Find the gradient Then, iterative calculations are performed to obtain the optimal emergency strategy variable u. * and Lagrange multipliers λ * ;
[0071] The method for constructing a multi-objective emergency strategy control based on optimal emergency strategy variables is based on the optimal emergency strategy variable u obtained through optimization. * A strategy control matrix M and a feedback correction vector f are introduced to make dynamic adjustments in response to real-time market changes.
[0072] Furthermore, in the system optimization subsystem, an evaluation function ε(u) for the policy execution effect is defined. t+1 ), which is represented as follows:
[0073]
[0074] Among them, ε(u t+1 ) represents the evaluation function for the strategy execution effect; w i This indicates the weight of each market status indicator, reflecting the importance of the indicator; r t+1,i and These represent the actual and projected market conditions, respectively.
[0075] By quantitatively evaluating the effectiveness of strategy implementation, strategies can be adjusted to respond to market changes, ensuring the effectiveness of emergency response and market stability.
[0076] The beneficial technical effects of the present invention are at least as follows:
[0077] This invention uses inverse reinforcement learning to infer the decision-making strategies and preferences of market participants (such as power generation companies, retailers, and consumers) from historical transaction data. Unlike traditional rule-based models, this method can dynamically adapt to changes in the market environment and update the behavioral models of market participants in real time. This innovation directly solves the problem that traditional systems cannot accurately simulate the dynamic behavior of market participants, making market predictions more accurate and the simulation system more insightful.
[0078] This invention uses inverse reinforcement learning to infer the decision-making strategies and preferences of market participants (such as power generation companies, retailers, and consumers) from historical transaction data. Unlike traditional rule-based models, this method can dynamically adapt to changes in the market environment and update the behavioral models of market participants in real time. This innovation directly solves the problem that traditional systems cannot accurately simulate the dynamic behavior of market participants, making market predictions more accurate and the simulation system more insightful.
[0079] This invention introduces causal inference technology and establishes an anomaly detection model based on a structural causal model, capable of identifying causal relationships in abnormal events in the market. Through counterfactual analysis of causal inference, the system can simulate the potential effects of different emergency measures and automatically generate the optimal emergency response strategy. This innovation overcomes the shortcomings of traditional anomaly detection methods, which can only identify surface anomalies and cannot reveal underlying causes, thus improving the accuracy and effectiveness of emergency response. Attached Figure Description
[0080] The present invention will be further described with reference to the accompanying drawings, but the embodiments in the drawings do not constitute any limitation on the present invention. For those skilled in the art, other drawings can be obtained based on the following drawings without creative effort.
[0081] Figure 1 This is a framework diagram of a market operation simulation trading system for electricity trading, according to an embodiment of the present invention. Detailed Implementation
[0082] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0083] In one or more embodiments, such as Figure 1 As shown, the present invention discloses a market operation simulation trading system for electricity trading, the system comprising the following subsystems:
[0084] The data acquisition subsystem 101 is used to preprocess the data, and then extract and fuse features from the preprocessed data to obtain a feature dataset; the data acquisition subsystem performs the following steps:
[0085] Raw data is collected from multiple data sources in the electricity market. This data includes:
[0086] Historical transaction data (e.g., hourly electricity price, electricity volume, identities of buyers and sellers, etc.).
[0087] Real-time market data (e.g., current market electricity demand and supply).
[0088] Weather data (e.g., temperature, humidity, wind speed, etc., external factors that affect electricity demand).
[0089] Economic indicators (e.g., GDP growth rate, industrial production index, etc., macroeconomic factors that affect overall electricity consumption).
[0090] During data acquisition, it is necessary to ensure the synchronization of each data source. A timestamp alignment method is used, employing the most recent timestamp to match all data sources to ensure data consistency. The generated original data matrix D = [d ij ], where i represents the time step and j represents the data type (such as electricity price, demand, temperature, etc.).
[0091] Furthermore, the following steps are performed on the collected data matrix D:
[0092] Denoising and Outlier Handling: This invention utilizes a custom multidimensional denoising algorithm to construct an optimization objective function to minimize the impact of noise on the data. Let the original data be x. ij The noise model is ∈ ij The objective function is defined as follows:
[0093]
[0094] Here, f(·) is a regularization function based on the distribution of historical data, ensuring that the denoised data still follows the historical pattern, and λ is a regularization parameter used to balance the denoising effect and data fidelity.
[0095] Furthermore, time series feature extraction extracts time series features reflecting the characteristics of the electricity market from the multidimensional data at each time step, such as periodicity (daily / weekly / seasonal fluctuations), trend (long-term trend changes), and sudden event features (abnormal peaks or declines). A sliding window method W is used. k The data at each time step is processed, and the feature extraction formula is defined as follows:
[0096]
[0097] in For extracting features of data type j at time t, μ j The mean of this data type, |W k | represents the window width.
[0098] Furthermore, an attention-based data fusion method is employed to address the features extracted from multi-source data. Let F be the feature matrix extracted from each data source. j (such as the historical transaction feature matrix F) H Weather feature matrix F W (etc.), introduce an adaptive fusion weight vector α j (Weights are assigned based on the importance of each feature):
[0099]
[0100] Here, the function g(·) is a feature selection model that determines the importance of each feature by analyzing its influence on the target. Finally, the output is the fused feature matrix F. fused This creates a complete structured dataset, suitable for the next step of model training.
[0101] Furthermore, the fused feature matrix F fused The dataset is partitioned into training and test sets using a time-series splitting method to ensure the temporal sequence of the data. Furthermore, each feature is normalized to ensure it has zero mean and unit variance, thus preventing differences in feature dimensions from affecting model training. The normalization formula is:
[0102]
[0103] Where, μ(F (j) ) and σ(F (j) ) are the mean and standard deviation of feature j, respectively.
[0104] Through the current subsystem, data is systematically collected, cleaned, feature-extracted, fused, partitioned, and normalized from multiple sources, generating a high-quality, structured feature dataset F. fused This dataset not only preserves the key characteristics of electricity market data but also eliminates noise and outliers, providing accurate and reliable input for the next step of inverse reinforcement learning modeling. This data preprocessing scheme is specifically designed for the complexity and diversity of electricity market data, ensuring data quality and laying the foundation for accurate predictions and anomaly detection in subsequent models.
[0105] The market preference prediction subsystem 102 is used to construct an inverse reinforcement learning model to infer the behavioral strategies and preferences of market participants based on the fused feature matrix; the market preference prediction subsystem performs the following steps:
[0106] Using the fusion feature matrix F obtained from the data acquisition subsystem fused First, we define the state space S and action space A of the market participants. The state space S is a multi-dimensional vector representation composed of different characteristic variables of the electricity market (such as electricity price, demand, supply, weather, etc.), denoted as s. t =[s t,1 ,s t,2 ,…,s t,n ], where t is the time step and n is the number of feature variables.
[0107] Action space A represents the possible decision-making behaviors of market participants under different states, such as buying electricity, selling electricity, and adjusting power generation. Assuming there are m different possible behaviors, the action vector is represented as a. t =[a t,1,a t,2 ,…,a t,m ].
[0108] Furthermore, within the framework of inverse reinforcement learning, this invention assumes that the strategy of each market participant is determined by an unknown reward function R(s). t ,a t This is driven by historical data. The goal of this invention is to infer this reward function using historical data.
[0109] This invention employs a policy estimation method based on soft Q-learning to model the behavior of market participants. It assumes that the market participant's policy π is to softly maximize a value function Q. π (s t ,a t The present invention defines the value function as follows:
[0110]
[0111] Among them, s t Let represent the state vector at the current time step t, and let represent the characteristic variables of the electricity market. t R(s) represents the action vector at the current time step t, indicating the possible decision-making behavior of market participants. t ,a t ) represents the reward function, indicating the state of a market participant in state s. t Take action a t The immediate reward received. γ represents the discount factor, indicating the degree of decay of future rewards, and its value ranges from 0 to 1. Indicates the next state s t+1 The expected value, given that the current state is s. t Execute action a t P(·|s t ,a t ) represents the state transition probability, indicating that in state s t Next, execute action a t Then transition to the next state s t+1 The probability of V. π (s t+1 ) represents the state-value function, which expresses the state value function under policy π, starting from state s. t+1 Initial cumulative expected reward.
[0112] Where γ is the discount factor, representing the degree of decay of future rewards, P(·|s t ,a t ) is the state transition probability, representing the probability of transitioning from state s to state s. t Next, execute action a t Then transition to the next state s t+1 The probability, V π(s t+1 ) is the state value function, defined as:
[0113]
[0114] Among them, V π (s t+1 ) represents state s t+1 The value function of . The action space represents the set of all possible actions. Q π (s t+1 ,a') represents state s under policy π. t+1 The value function of action a'. exp represents the natural exponential function, used to calculate soft maximization.
[0115] This strategy estimation method incorporates a soft value function to account for the randomness of the strategy, making the model more consistent with actual market conditions.
[0116] Furthermore, in order to infer the true reward function R(s) of market participants... t ,a t This invention utilizes actual behavior sequences (s) from historical data. t ,a t We will use this to perform inverse optimization. Assuming the behavior in the historical data represents the optimal behavior sequence, the objective of inverse optimization is to minimize the difference between the actual observed behavior and the model's predicted behavior.
[0117]
[0118] Wherein, R(s) t ,a t ) represents the reward function, indicating the state of a market participant in state s. t Take action a t The instant reward received. Q π (s t ,a t ) represents the state s under policy π. t With action a t The value function of . This represents the summation over all time steps t, used to accumulate error. (Q) π (s t ,a t )-R(s t ,a t )) 2 The square of the error represents the difference between the value function and the reward function.
[0119] This optimization problem can be solved using the gradient descent method, where the reward function R(s) t ,a tThe gradient of ) is calculated by the following formula:
[0120]
[0121] in, This represents the gradient of the value function with respect to the reward function. 1 represents a constant term used in calculating the gradient. γ represents the discount factor. Represents all possible next states s t+1 Summation. P(s) t+1 |s t ,a t ) represents the state transition probability, indicating the probability of transitioning from state s. t Perform action a t Transition to state s t+1 The probability of. This represents the gradient of the state-value function with respect to the value function.
[0122] By using the backpropagation algorithm, R(s) is gradually adjusted. t ,a t This allows it to closely approximate the decision-making preferences of actual market participants.
[0123] Furthermore, the optimized reward function R(s) is used. t ,a t ), recalculate the strategy π of market participants * It generates a behavioral model. This model predicts the decision-making behavior of market participants under different states based on optimal strategies.
[0124] Furthermore, to verify the accuracy of the behavioral model, this invention employs cross-validation, combining the dataset F... fused The model is divided into training and test sets to evaluate its performance on unseen data. The model's output is a sequence of predicted behaviors of market participants at future time steps. Right now:
[0125]
[0126] in, This indicates the optimal behavior predicted by the model. The action space represents the set of all possible actions. Represents the optimal policy π * Under state s t With action a t The value function. argmax represents the index for finding the maximum value, used to locate the action that maximizes the value function.
[0127] in, The optimal behavior predicted by the model. By comparing the predicted behavior with the actual observed behavior, the accuracy and robustness of the model can be evaluated.
[0128] Through the market preference prediction subsystem, the inverse reinforcement learning model can structure the feature dataset F. fused This study effectively infers the decision-making strategies and preferences of different stakeholders in the electricity market and constructs a dynamic behavioral model. This model provides a solid foundation for subsequent steps in market behavior prediction and anomaly detection, and ensures the model's dynamic adaptability and accuracy.
[0129] Market behavior prediction and simulation subsystem 103 is used to predict and simulate agent behavior based on the agent behavior model π. * (s t The market behavior prediction and simulation subsystem simulates the interactive behavior of market participants under different conditions to predict the overall evolution trend of the market. The subsystem performs the following steps:
[0130] The market participant behavior model π output from the market behavior prediction and simulation subsystem * (s t To begin, use F. fused Defined features, initialize the market state space Initial state vector s0=[s 0,1 ,s 0,2 ,…,s 0,n The simulation environment includes key characteristics of the electricity market at the initial time point (such as electricity prices, supply and demand balance, and weather conditions), and is set as a time series. Where N is the total number of time steps in the simulation.
[0131] Specifically, considering the high volatility of the electricity market, this invention introduces a market initialization condition setting with a penalty mechanism. A volatility weight term β is added to the state vector s0 to reflect the unpredictability of the initial market:
[0132]
[0133] in, Given the base market state, Vol(p0) is the initial market price volatility, and β is the volatility weight, reflecting the magnitude of market changes at the initial moment.
[0134] Furthermore, the behavior model-driven state transition uses the behavior model π output from the second step. * (s t Based on the current market situation t Predicting the optimal decision-making behavior of market participants
[0135]
[0136] Then, based on the predicted behavior The interaction between market entities and market participants, updating the market status at the next time step. t+1 The state transition formula is improved as follows, taking into account the supply-side response and demand-side elasticity in the electricity market:
[0137]
[0138] in, Here is the state transition matrix. It is a function that describes the demand-side response, representing the market participants' response to changes in electricity prices. η is a regulation parameter that controls the strength of the demand-side response.
[0139] Furthermore, to address unforeseen events and unpredictable market behavior in the electricity market, this invention introduces an innovative feedback adjustment mechanism during state transitions. This is achieved by introducing a nonlinear feedback term to reflect sudden market changes (such as equipment failures, large-scale power outages, etc.).
[0140]
[0141] Here, α is the sensitivity parameter for sudden events. It represents the average behavior of market participants. It is the market abnormal behavior vector output by the anomaly detection model.
[0142] The innovation of this formula lies in its ability to dynamically adjust market conditions through a feedback mechanism, making the simulation process more robust and realistic, and in particular, better reflecting the sudden characteristics of the electricity market.
[0143] Furthermore, multi-agent simulation based on behavioral models records the market state s at each time step. t and the behavior of market entities Simultaneously, the state of each entity is updated to reflect interdependencies and changes in the overall market. This invention employs a Generalized Linear Interaction Model (GLIM)-based collaborative mechanism to model interactions between entities:
[0144]
[0145] Among them, w i Let b represent the weight vector of the interaction between the i-th subject and other subjects. i It is a bias term, ∈ i It is a random noise term used to simulate the uncertainty in the agent's decision-making.
[0146] Furthermore, risk assessment of the electricity market is conducted through simulated market conditions and behavioral sequences. This invention introduces a weighted market volatility risk index. and system failure probability To quantitatively assess market stability and potential risks:
[0147]
[0148]
[0149] Wherein, σ(p) t ) represents the standard deviation of market price fluctuations, and max(d) t -s t () represents the largest difference between demand and supply. Let λ1 and λ2 be the expected value of market operating costs, λ1 and λ2 be the risk weight coefficients, and γ be the exponential decay parameter.
[0150] An anomaly detection subsystem 104 is used to detect abnormal events in the electricity market based on the market state at the next moment and the optimal decision-making behavior of market participants, using a causal inference method; the anomaly detection subsystem performs the following steps:
[0151] Based on the market state data output from the market behavior prediction and simulation subsystem t+1 and behavioral prediction Extract the feature variables required for causal analysis. Define the causal graph structure. The node set V represents market state characteristics (such as electricity price, demand, supply, weather conditions, etc.) and behavioral decision variables, while the edge set ε represents the causal relationships between variables.
[0152] Each node Representing a feature variable or behavioral variable, a directed edge (v) between nodes i ,v j )∈ε represents a causal relationship, i.e., v i It is v j The initial causal structure can be inferred based on the statistical correlation of historical data and refined using expert knowledge. Modeling causal relationships requires considering typical causal chains in the electricity market, such as weather affecting demand, demand affecting price, and price, in turn, affecting supply.
[0153] Furthermore, using a cause-effect graph structure and the market state s obtained from the third step t+1 and behavioral prediction Interventional analysis is performed to detect anomalies in the market. The goal of interventional analysis is to detect anomalies by introducing dummy intervention variables to evaluate the response of the dependent variable.
[0154] Define intervention model This indicates that for node vi Intervention is applied to make its value c. For each potential anomalous node v i Calculate the dependent variable v under the intervention condition. j Expected changes:
[0155]
[0156] in, For the dependent variable v after intervention j Expected value This represents the expected value before intervention. If... If the value exceeds the set threshold τ, then mark v. i This is a potential source node for anomalies.
[0157] Furthermore, after identifying potential anomaly source nodes, counterfactual analysis is performed to confirm the causal chain of the anomalous events. Counterfactual analysis verifies the impact of the anomaly source nodes on the market state and quantifies the strength of this impact by simulating hypothetical scenarios. Defining the counterfactual scenario involves... Calculate the change in market state under counterfactual conditions:
[0158]
[0159] in, This indicates the market state under the given assumptions. This represents the expected value of the market state under a counterfactual scenario. Calculation results. Used to evaluate the abnormal source node v i The actual impact on market conditions, and identification of the abnormal causal chain v. i →v j .
[0160] Furthermore, the results of intervention analysis and counterfactual analysis are integrated to generate anomaly detection reports, including the source node, causal chain, impact strength, and predicted potential consequences for each anomalous event. Based on these reports, emergency response strategies are optimized and adjusted. The anomaly detection results will be used to update market behavior prediction models, correct causal graph structures, and improve the accuracy and adaptability of market simulations.
[0161] Finally, the anomaly detection subsystem outputs a list of anomaly events. Each element Describe the cause, result, and intensity of an unusual event to provide data support for market decision-making.
[0162] Emergency response subsystem 105 is used to formulate emergency response strategies for the power market based on anomaly detection results; the emergency response subsystem performs the following steps:
[0163] Using the anomaly detection results from the anomaly detection subsystem, define emergency response strategy variables u, where each strategy variable u k This corresponds to response measures for specific abnormal events (such as load shedding, activation of backup power, price adjustments, etc.). Set the objective function. To measure the effectiveness of emergency response strategies, the objective function comprehensively considers market stability, response costs, and risk control.
[0164]
[0165] in, For the market state change under the k-th abnormal event, u k w is a variable for emergency response strategy. k The weight parameter, c, reflects the priority of the k-th event. k The response cost coefficient represents the implementation strategy u. k The cost. Objective function Minimization ensures that emergency response strategies can effectively control market anomalies while minimizing execution costs.
[0166] Furthermore, in order to generate the optimal emergency response strategy, an optimization problem is constructed, which minimizes the objective function by adjusting the emergency strategy variable u. Optimization problems can be solved using the Lagrange multiplier method and constraints. Constraints include physical constraints (such as load shedding not exceeding the system's allowable range) and market constraints (such as price adjustment limits).
[0167] The optimization problem takes the following form:
[0168]
[0169] Where A is the constraint matrix and b is the constraint vector, ensuring that the emergency strategy variable u satisfies all physical and market constraints.
[0170] To solve this optimization problem, the Lagrange function is introduced.
[0171]
[0172] Through the Find the gradient Then, iterative calculations are performed to obtain the optimal emergency strategy variable u. * and Lagrange multipliers λ * .
[0173] Furthermore, to address the diverse anomalies and uncertainties in the electricity market, a multi-objective emergency strategy control method is proposed. This method is based on the initial emergency strategy u obtained through optimization. *The strategy is dynamically adjusted to respond to real-time market changes. A strategy control matrix M and a feedback correction vector f are introduced to update the emergency strategy.
[0174] u t+1 =u t +M·f
[0175] Among them, u t+1 For the updated policy variable, u t M is the current strategy variable, M is the strategy adjustment matrix, which determines the direction and magnitude of strategy adjustment, and f is the feedback correction vector, which reflects the real-time market status and abnormal feedback.
[0176] The feedback correction vector f can be calculated using the following formula:
[0177]
[0178] Where γ is the adjustment parameter for market state deviation, s t+1 Based on the actual market conditions, The predicted market state is represented by β, which is the adjustment parameter for strategy bias, and u0 is the initial contingency strategy. This feedback mechanism enables the contingency response strategy to adaptively adjust in real-time market conditions, improving the effectiveness and robustness of the contingency response.
[0179] Furthermore, the generated optimal emergency strategy u * It is applied in the actual electricity market and its implementation effect is monitored and evaluated in real time. This is achieved through the analysis of market status data. t+1 Continuously track anomaly detection results, evaluate the effectiveness of emergency response strategies, calculate actual performance indicators (such as response time, cost-effectiveness ratio, changes in market stability, etc.), and optimize the next round of emergency strategies based on feedback information.
[0180] The formula for evaluating the effectiveness of an emergency response can be defined as follows:
[0181]
[0182] Where ε(u) is the emergency response effectiveness evaluation function, ω k Let φ be the weight of the k-th market state indicator. k Let the weight of the k-th emergency strategy variable be... and These are the k-th market state indicators, representing the actual and predicted values, respectively.
[0183] The system optimization subsystem 106 is used to learn and optimize based on the execution feedback of the optimal emergency strategy variables.
[0184] Optimal emergency strategy generated using the emergency response subsystem Implement corresponding control measures in the electricity market (such as adjusting power generation, activating backup power sources, and regulating electricity prices). After the strategy is implemented, the system monitors the market status in real time. t+1 Changes and collect feedback data r t+1 These data reflect the actual market situation, such as electricity demand, electricity price changes, and power generation costs.
[0185] Define feedback collection function Indicates the execution strategy u * The feedback data obtained afterwards:
[0186]
[0187] Where, r t+1 =[r t+1,1 ,r t+1,2 ,…,r t+1,n ] is the feedback vector, which contains data on all market conditions and the effects of strategy execution.
[0188] Furthermore, the feedback error is calculated to evaluate the effectiveness of the strategy. Error vector e t+1 Based on actual feedback r t+1 In line with expected market conditions The differences are defined as follows:
[0189]
[0190] Among them, e t+1 This indicates the deviation between the actual market condition and the predicted condition.
[0191] Based on feedback error e t+1 The emergency strategy is adjusted accordingly. A simple and effective strategy update formula is adopted, introducing the learning rate η and the feedback weight matrix W:
[0192] u t+1 =u t -η·W·e t+1
[0193] Among them, u t+1 This is the updated emergency response strategy. t This is the current strategy. η is the learning rate, which controls the step size for strategy adjustments. W is the feedback weight matrix, used to adjust the degree of influence of different feedback variables on the strategy. This formula implements strategy updates based on error feedback, ensuring that the strategy can quickly adapt to actual market changes.
[0194] Furthermore, after implementing the strategy, its effectiveness is evaluated and necessary adjustments are made. Feedback errors and actual market changes are used to dynamically optimize the contingency strategy. An evaluation function ε(u) for the strategy's effectiveness is defined. t+1 ):
[0195]
[0196] Among them, ε(u t+1 ) is the evaluation function for the strategy execution effect. i The weights assigned to each market status indicator reflect the importance of the indicator. t+1,i and These represent the actual and projected market conditions, respectively.
[0197] By quantitatively evaluating the effectiveness of strategy implementation, strategies can be further adjusted to respond to market changes, ensuring the effectiveness of emergency response and market stability.
[0198] These are merely some preferred embodiments of the present invention, and should not be construed as limiting the scope of the invention. Those skilled in the art will understand that implementing all or part of the processes of the above embodiments and making equivalent changes in accordance with the claims of the present invention are still within the scope of the invention.
Claims
1. A market operation simulation trading system for electricity trading, characterized in that, The system includes the following subsystems: The data acquisition subsystem is used to preprocess the data, and then extract and fuse features from the preprocessed data to obtain a feature dataset; the data acquisition subsystem performs the following steps: Raw data is collected from multiple data sources in the electricity market and preprocessed to obtain multi-source data; An attention-based data fusion method is used to extract and fuse features from multi-source data to obtain a fused feature matrix. The fused feature matrix is partitioned into training and test sets using a time series segmentation method. The market preference prediction subsystem is used to construct an inverse reinforcement learning model to infer the behavioral strategies and preferences of market participants based on the fused feature matrix; the market preference prediction subsystem performs the following steps: The state space and action space of market entities are defined based on the fusion feature matrix; Suppose that each market participant's strategy is determined by an unknown reward function R(s). t ,a t Driven by ) and then employing a policy estimation method based on soft Q learning to model the behavior of market participants, the reward function R(s) is inferred from historical data. t ,a t ), while utilizing actual behavior sequences in historical data (s t ,a t ) to perform inverse optimization, minimizing the difference between the actual observed behavior and the model's predicted behavior; where s t Indicates market status, a t Indicates market behavior; Based on the inferred reward function R(s) t ,a t Recalculate the strategy π of market participants * And generate the subject behavior model π * (s t The behavioral model predicts the decision-making behavior of market participants under different states based on the optimal strategy. Then, the cross-validation method is used to test the generated behavioral model with training and test sets to evaluate the performance of the generated behavioral model on unseen data. The market behavior prediction and simulation subsystem is used to predict and simulate the behavior of the main actors based on the π model. * (s t The market behavior prediction and simulation subsystem simulates the interactive behavior of market participants under different conditions to predict the overall evolution trend of the market. The subsystem performs the following steps: Based on the subject behavior model π * (s t The initial market conditions are set using a fusion feature matrix to initialize the state space of market participants, and the optimal decision-making behavior of market participants is predicted based on the current market state. In response to unforeseen events and unpredictable market behavior in the electricity market, a feedback adjustment mechanism is introduced during state transitions to reflect sudden changes in the market and dynamically adjust the market state. A collaborative mechanism based on a generalized linear model is used to construct a subject-based behavior model π. * (s t The multi-agent simulation records the current market state and the optimal decision-making behavior of market players at each time step, while updating the state of each player to reflect interdependence and changes in the overall market. An anomaly detection subsystem is used to detect abnormal events in the electricity market based on the market state at the next moment and the optimal decision-making behavior of market participants, employing a causal inference method. The anomaly detection subsystem performs the following steps: Extract the characteristic variables needed for causal analysis from the market state in the next moment and the optimal decision-making behavior of market participants, and construct a causal graph; By combining the cause-effect graph structure, the market state in the next moment, and the optimal decision-making behavior of market participants, intervention analysis is performed to detect anomalies in the market and obtain the anomaly source nodes. Perform counterfactual analysis based on the anomaly source node to confirm the causal chain of the anomaly event; The results of intervention analysis and counterfactual analysis are integrated to generate anomaly detection results and reports; The emergency response subsystem is used to formulate emergency response strategies for the power market based on anomaly detection results; the emergency response subsystem performs the following steps: Emergency response strategy variables are defined based on the anomaly detection results, where each strategy variable corresponds to a response measure for a specific anomaly event; The optimization problem is constructed, and the optimal emergency strategy variable and Lagrange multiplier are obtained by introducing a Lagrange function to adjust the emergency strategy variable. A multi-objective emergency strategy control method is constructed based on the optimal emergency strategy variables, and the optimal emergency strategy variables are dynamically adjusted to respond to real-time market changes. The optimal emergency strategy variables are applied to the actual electricity market, and the implementation effect is monitored and evaluated in real time. The system optimization subsystem is used to learn and optimize based on the execution feedback of the optimal emergency strategy variables.
2. The market operation simulation trading system for electricity trading according to claim 1, characterized in that, The policy estimation method based on soft Q learning is used to model the behavior of market participants, as shown below: Among them, s t Let a be the state vector at the current time step t, representing the characteristic variables of the electricity market; t Let R(s) be the action vector at the current time step t, representing the possible decision-making behavior of market participants; t ,a t Let be the reward function, representing the state of a market participant in state s. t Take action a t The immediate reward obtained; γ is a discount factor, representing the degree of decay of future rewards, with a value between 0 and 1; Indicates the next state s t+1 The expected value, given that the current state is s. t Execute action a t ;P(·|s t ,a t ) represents the state transition probability, indicating the state transition probability in state s. t Next, execute action a t Then transition to the next state s t+1 The probability of V; π (s t+1 Let be the state value function, representing the state value under policy π, starting from state s. t+1 The initial cumulative expected reward is represented as follows: Among them, V π (s t+1 ) represents state s t+1 The value function; The action space represents the set of all possible actions; Q π (s t+1 ,a') represents state s under policy π. t+1 The value function of action a'; exp() represents the natural exponential function, used to calculate the maximization of the soft value function.
3. The market operation simulation trading system for electricity trading according to claim 2, characterized in that, The use of historical data in actual behavior sequences (s) t ,a t Inverse optimization is performed to minimize the difference between the actual observed behavior and the model's predicted behavior, as shown below: Assuming the behaviors in the historical data are the optimal behavior sequence, the inverse optimization objective is to minimize the difference between the actual observed behavior and the model's predicted behavior, as follows: Wherein, R(s) t ,a t ) represents the reward function, indicating the state of a market participant in state s. t Take action a t The instant reward obtained; Q π (s t ,a t ) represents the state s under policy π. t With action a t The value function (Q) π (s t ,a t )-R(s t ,a t )) 2 The square of the error represents the difference between the value function and the reward function; The solution is obtained using gradient descent, where the reward function R(s) is... t ,a t The gradient of is calculated by the following formula, expressed as follows: in, γ represents the gradient of the value function with respect to the reward function; 1 represents a constant term used to calculate the gradient; γ represents the discount factor. Represents all possible next states s t+1 Summation; P(s) t+1 |s t ,a t ) represents the state transition probability, indicating the probability of transitioning from state s. t Perform action a t Transition to state s t+1 The probability of; This represents the gradient of the state-value function with respect to the value function.
4. A market operation simulation trading system for electricity trading according to claim 1, characterized in that, The initial market condition is to add a volatility weight term to the market state vector to reflect the unpredictability of the initial market. The introduction of a feedback adjustment mechanism in state transitions to reflect sudden market changes is expressed as follows: Where, Δs t+1 This represents the change in the state of emergency, and α represents the sensitivity parameter of the emergency event. This represents the average behavior of market participants. This represents the vector of abnormal market behavior output by the anomaly detection model.
5. A market operation simulation trading system for electricity trading according to claim 4, characterized in that, The aforementioned collaborative mechanism based on a generalized linear model is used to construct a subject behavior model π. * (s t The multi-agent simulation is represented as follows: Among them, w i Let b represent the weight vector of the interaction between the i-th subject and other subjects. i Represents the bias term, ∈ i Representing random noise, used to simulate uncertainty in agent decision-making; GLIM represents a cooperative mechanism based on a generalized linear model. Represents the set of optimal decision behaviors; At the same time, a weighted market volatility risk index is introduced. and system failure probability To quantitatively assess market stability and potential risks, the following is presented: Where, σ(p) t ) represents the standard deviation of market price fluctuations, max(d) t -s t () represents the largest difference between demand and supply. λ1 and λ2 represent the expected value of market operating costs, λ1 and λ2 represent risk weighting coefficients, Y represents the exponential decay parameter, and N represents the total duration.
6. A market operation simulation trading system for electricity trading according to claim 1, characterized in that, The cause-effect graph structure is: node set Representing market state characteristics and behavioral decision variables, the edge set ε represents the causal relationships between variables; each node Representing a feature variable or behavioral variable, a directed edge (v) between nodes i ,v j )∈ε represents a causal relationship, i.e., v i It is v j The initial causal structure is inferred based on the statistical correlation of historical data and corrected by expert knowledge.
7. A market operation simulation trading system for electricity trading according to claim 6, characterized in that, The intervention analysis, which combines causal graph structure, the next moment's market state, and the optimal decision-making behavior of market participants, specifically includes: Define intervention model This indicates that for node v i Apply intervention to make its value c, for each potential anomalous node v i Calculate the dependent variable v under the intervention condition. j The expected change is expressed as follows: in, The dependent variable v after intervention j Expected value This represents the expected value before intervention; if If the value exceeds the set threshold τ, then mark v. i This could be a potential source node for anomalies. After identifying potential source nodes of anomalies, counterfactual analysis is performed to confirm the causal chain of the anomalous events: Counterfactual analysis verifies the impact of anomalous source nodes on market conditions by simulating hypothetical scenarios, quantifies the strength of this impact, and defines counterfactual scenarios. The change in market state under a counterfactual condition is represented as follows: in, This indicates the market state under the given assumptions. This represents the expected value of the market state under a counterfactual scenario; the calculation result... Used to evaluate the abnormal source node v i The actual impact on market conditions, and identification of the abnormal causal chain v. i →v j .
8. A market operation simulation trading system for electricity trading according to claim 1, characterized in that, In the emergency response subsystem, a target function is set. The objective function used to measure the effectiveness of emergency response strategies includes market stability, response costs, and risk control, and is expressed as follows: in, U represents the change in market state under the k-th abnormal event. k w represents the emergency response strategy variable. k c represents the weight parameter, reflecting the priority of the k-th event. k Represents the response cost coefficient, and represents the implementation strategy u. k The cost; K represents the total number of events; objective function Minimization ensures that emergency response strategies can effectively control market anomalies while reducing execution costs.
9. A market operation simulation trading system for electricity trading according to claim 8, characterized in that, The objective function The solution is obtained using the Lagrange multiplier method and constraints, which include physical constraints and market constraints, as follows: Where A represents the constraint matrix and b represents the constraint vector, ensuring that the emergency strategy variable u satisfies all physical and market constraints; To solve this objective function Introducing the Lagrange function Through the Find the gradient Then, iterative calculations are performed to obtain the optimal emergency strategy variable u. * and Lagrange multipliers λ * ; The method for constructing a multi-objective emergency strategy control based on optimal emergency strategy variables is based on the optimal emergency strategy variable u obtained through optimization. * A strategy control matrix M and a feedback correction vector f are introduced to make dynamic adjustments in response to real-time market changes.
10. A market operation simulation trading system for electricity trading according to claim 1, characterized in that, In the system optimization subsystem, an evaluation function ε(u) for the strategy execution effect is defined. t+1 ), which is represented as follows: Among them, ε(u t+1 ) represents the evaluation function for the strategy's execution effect; w i This indicates the weight of each market status indicator, reflecting the importance of the indicator; r t+1,i and These represent the actual and projected market conditions, respectively. By quantitatively evaluating the effectiveness of strategy implementation, strategies can be adjusted to respond to market changes, ensuring the effectiveness of emergency response and market stability.
Citation Information
Patent Citations
Power transaction auxiliary decision-making system based on multi-data source fusion
CN117853238A
Electricity market analogue simulation system, method and equipment and storage medium
CN117875153A