A simulation method for power spot market

By constructing a multi-agent system and using deep reinforcement learning algorithms, the bounded rationality problem in simulating the behavior of market participants in electricity spot trading simulation was solved. This enabled realistic simulation of market participant behavior and multi-timescale collaborative analysis, improving simulation computation efficiency and the economic and physical security of the results.

CN121543398BActive Publication Date: 2026-04-17BEIJING LIANSHAN NENGCE TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING LIANSHAN NENGCE TECHNOLOGY CO LTD
Filing Date
2025-11-06
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing electricity spot trading simulation technologies cannot realistically simulate the bounded rationality and dynamic learning behavior of market participants, cannot reflect the differentiated physical characteristics of market participants, have low computational efficiency, and lack multi-timescale collaborative analysis capabilities.

Method used

A multi-agent system is constructed. By acquiring static structural data and dynamic time series data, market participants are modeled differently. A deep reinforcement learning algorithm is used to update the bidding strategy. Rolling collaborative simulation is carried out on multiple time scales. By combining distributed agent decision-making and centralized optimization clearing, a market clearing model is constructed to maximize social welfare or minimize the total system cost.

Benefits of technology

It achieves realistic simulation of market participant behavior, ensures economic optimization of simulation results and physical safety of the power grid, provides detailed analysis at multiple time scales, improves calculation speed and system stability, and supports simulation of complex trading patterns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121543398B_ABST
    Figure CN121543398B_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to a kind of simulation method based on power spot trading, comprising: obtaining grid topology, unit parameter and other static structure data and dynamic time series data such as load, new energy prediction;Dynamic data is preprocessed and divided into multiple time scales;Based on the data processed, construct a multi-agent model with different characteristics;Each agent generates and reports energy block information such as time block, continuous block, curve block or variable block according to the perceived market environment;Based on all reports, construct a market clearing model considering system power balance, network power flow, unit operation and energy block characteristic constraints and solve, obtain clearing price and power;The results are fed back to the agent, and the strategy is updated by deep reinforcement learning;Rolling collaborative simulation is carried out between day-ahead and real-time market, wherein the day-ahead clearing result is used as the boundary condition of real-time market.The present application improves the authenticity, accuracy and practicality of market simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a simulation method based on electricity spot trading. Background Technology

[0002] Electricity spot trading is a core component of the electricity market system, and its simulation technology is crucial for market operation and rule design. With the large-scale integration of new energy sources, energy storage, and other new entities, the complexity of electricity trading has increased significantly, and traditional simulation methods are no longer sufficient to meet practical needs.

[0003] Existing simulation technologies have the following main shortcomings: First, game theory-based methods assume that participants are perfectly rational and have complete information, which cannot simulate bounded rationality and dynamic learning behavior in real markets. Second, the widely adopted time-sharing bidding model treats electricity as a homogeneous commodity, which cannot effectively reflect the differentiated physical characteristics and transaction needs of various market participants. Third, simulation platforms mostly adopt centralized computing architectures, which suffer from poor flexibility and low computational efficiency. Fourth, existing methods mostly focus on single time scale analysis and lack detailed simulation of the coordinated operation of markets across multiple time scales, such as day-ahead, intraday, and real-time.

[0004] Therefore, there is an urgent need to develop a new simulation method for electricity spot trading that can realistically simulate the strategic behavior of market participants, support complex trading models, and achieve multi-scale collaborative analysis. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies by providing a simulation method and system based on electricity spot trading, thereby solving the problems existing in the prior art.

[0006] To achieve the above objectives, the present invention provides a simulation method based on electricity spot trading, the method comprising:

[0007] Acquire static structural data and dynamic time series data; the static structural data is obtained based on the power grid model file and the unit list.

[0008] The dynamic time series data is preprocessed and divided into multiple time scales to obtain preprocessed dynamic time series data with multiple time scales.

[0009] Based on the static structural data and the dynamic time series data at multiple time scales, multiple intelligent agents of market participants are constructed; each intelligent agent is modeled differently according to its own physical characteristics, economic characteristics and behavioral characteristics.

[0010] Each of the aforementioned intelligent agents perceives the market environment based on its corresponding state vector, and generates and reports at least one type of energy block information; the energy block types include time-sharing blocks, continuous blocks, curve blocks, and variable blocks.

[0011] Based on the energy block information declared by all agents, a market clearing model is constructed with the goal of maximizing social welfare or minimizing total system cost. The market clearing model includes system power balance constraints, unit network power flow constraints, unit operation constraints, and characteristic constraints corresponding to each energy block type.

[0012] Solve the market clearing model to obtain the market clearing electricity price and the clearing electricity volume of each energy block;

[0013] The clearing results will be fed back to each agent;

[0014] Each agent updates its pricing strategy using deep reinforcement learning algorithms based on the feedback results;

[0015] At both the day-ahead market and the real-time market timescales, the process of the agent generating and reporting at least one type of energy information to update the bidding strategy based on the market environment is repeated, and rolling collaborative simulation is performed; wherein, the clearing result of the day-ahead market serves as the boundary condition for the clearing of the real-time market.

[0016] In one possible implementation, the static structural data includes grid topology and generator / resource parameters; the grid topology includes node, line, and transformer connection relationships and parameters; the generator / resource parameters include maximum / minimum output, ramp rate, minimum start-up / shutdown time, cost function, and energy storage capacity / efficiency.

[0017] The preprocessed dynamic time series data across multiple time scales includes historical market clearing data, system load data, renewable energy output data, and real-time operation data. The historical market clearing data includes historical LMP and cleared electricity volume. The system load data includes historical actual load values ​​and short-term / ultra-short-term forecast values. The renewable energy output data includes historical actual values ​​and short-term / ultra-short-term forecast values. The real-time operation data includes real-time unit output, line power flow, and frequency.

[0018] In one possible implementation, the method further includes the following preceding steps:

[0019] During the system initialization phase, based on the power grid topology, including node and branch parameters, physical parameters of all registered generating units, including maximum / minimum output, ramp rate, minimum start-up and shutdown time, cost function, historical load and renewable energy data, and historical market clearing data, a power grid model file and a list of generating unit / resource parameters are built in memory.

[0020] According to the configuration file, an agent is instantiated for each duration participant, and each agent includes an Actor network and a Critic network.

[0021] An experience replay buffer is set up in memory to store trajectory data of the agent's interaction with the market environment.

[0022] In one possible implementation, the preprocessing and multi-timescale partitioning of the dynamic time series data to obtain multi-timescale dynamic time series data specifically includes:

[0023] For high-frequency fluctuation data, a minute-level dataset is determined; the high-frequency fluctuation data includes real-time load, renewable energy power, frequency, and real-time market clearing price and electricity volume;

[0024] For short-term trend data, an hourly dataset is determined; the short-term trend data includes hourly average load, unit output, day-ahead market clearing price, and aggregated reporting data;

[0025] For long-term statistical and trend data, daily datasets are determined; the long-term statistical and trend data include daily maximum / minimum / average load, daily total electricity consumption, daily average electricity price, daily unit utilization hours, and market rule information;

[0026] The obtained multi-timescale datasets are stored in a time-series database.

[0027] In one possible implementation, the intelligent agents, based on their corresponding state vectors, perceive the market environment and generate and declare at least one type of energy block information, specifically including:

[0028] Define a state vector; the state vector includes public state and private state; the public state includes historical electricity price sequence, system load data, renewable energy output data, network congestion information, current time period and market stage; the historical electricity price sequence includes preprocessed day-ahead / real-time electricity prices at multiple time scales; the network congestion information and current time period and market stage; the private state includes the agent's own physical state, its own economic state, and its own historical performance; the agent's own physical state includes current output, continuous operating time, and current state of charge; the agent's own economic state is obtained from static structure data, including cost function and start-up / shutdown costs; the agent's own historical performance is obtained from the previous market structure, including whether it won a bid in the previous time period;

[0029] The agent's Actor neural network receives a state vector and outputs a raw action vector; each dimension of the raw action vector corresponds to a first parameter of the energy block; the first parameter includes power and price.

[0030] The physical boundary is obtained from the static structural data, and the original action vector output by the Actor neural network is mapped to the numerical range defined by the physical boundary to obtain the mapped parameters.

[0031] The mapped parameters are encapsulated according to a preset energy block data structure to generate energy blocks; the energy blocks include any one of time-division blocks, continuous blocks, curve blocks, and variable blocks;

[0032] Calculate the final reward of the encapsulated energy block based on the cost function in the static structure data and the clearing result of the previous time step;

[0033] Store the current state vector, action vector, reward, and the state vector for the next moment in the memory bank;

[0034] Periodically sample from the memory bank to update the Actor neural network.

[0035] In one possible implementation, the construction of a market clearing model based on the energy block information declared by all agents, with the objective of maximizing social welfare or minimizing total system cost, specifically includes:

[0036] Acquire grid topology, unit / resource parameters, system load data, renewable energy output data, and energy blocks declared by intelligent agents;

[0037] Create an empty optimization model using the optimization library;

[0038] The system acquires grid topology, generator / resource parameters, system load data, renewable energy output data, and energy blocks declared by intelligent agents to construct the variables and constraints of the optimization model. Specifically, the variables and objective function of the optimization model are defined using energy block data, power balance constraints are constructed using predicted data from load data and renewable energy output data, network power flow constraints are constructed using data from the grid topology, and operation and characteristic constraints are constructed using generator / resource parameters and energy block data.

[0039] The optimization model is solved to obtain key results, including cleared electricity volume and nodal marginal electricity price.

[0040] By applying the simulation method based on electricity spot trading provided in this invention, and through multi-agent systems with learning capabilities, the bounded rationality, strategic interactions, and dynamic evolution of market participants are realistically simulated, solving the distortion problem caused by the "assumption of perfect rationality" in traditional models. Energy blocks are used as the trading instrument, and their characteristic constraints are deeply integrated into the clearing model to ensure that the results simultaneously satisfy economic optimization and grid physical security, eliminating infeasible solutions. A multi-timescale collaborative simulation framework is constructed to achieve rolling connections between day-ahead and real-time markets, enabling detailed analysis of market dynamics and cross-time period impacts, resulting in more coherent time sequences. The combination of distributed agent decision-making and centralized optimization clearing, utilizing mature commercial solvers, ensures the computational speed and system stability of large-scale complex market simulations. Three-dimensional visualization and multi-dimensional evaluation transform complex data into intuitive insights, serving as a powerful trader training platform and market rule sandbox, providing in-depth support for strategy formulation and policy design. Attached Figure Description

[0041] Figure 1 The initialization flowchart is shown before the simulation method based on electricity spot trading provided by this invention.

[0042] Figure 2 This is one of the flowcharts for the simulation method based on electricity spot trading provided by the present invention;

[0043] Figure 3 for Figure 2 Flowchart for step 240;

[0044] Figure 4 for Figure 2 Flowchart for step 250;

[0045] Figure 5 A simulation system diagram for electricity spot trading;

[0046] Figure 6 The second flowchart of the simulation method based on electricity spot trading provided by the present invention;

[0047] Figure 7 Solve MILP flowcharts for commercial solvers;

[0048] Figure 8 This is an architecture diagram of the simulation method based on electricity spot trading provided in an embodiment of the present invention;

[0049] Figure 9(a) shows the time-power energy block characteristic curve of the time-division block;

[0050] Figure 9(b) shows the time-power energy block characteristic curve of the continuous block;

[0051] Figure 9(c) shows the time-power energy block characteristic curve of the curve block;

[0052] Figure 9(d) shows the time-power energy block characteristic curve of the variable block;

[0053] Figure 10 A flowchart for multi-timescale co-simulation;

[0054] Figure 11 A flowchart of a market clearing algorithm based on energy blocks;

[0055] Figure 12 A multi-dimensional display of the simulation results;

[0056] Figure 13(a) Time-MAPE curve of the unified day-ahead price;

[0057] Figure 13(b) Time-MAPE curve of unified real-time price. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0059] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0060] This application includes an initialization phase before implementing the simulation method based on electricity spot trading. The initialization phase will be described below. Figure 1 As shown, the initialization phase includes:

[0061] Step 110: During the system initialization phase, based on the power grid topology, including node and branch parameters, physical parameters of all registered generating units, including maximum / minimum output, ramp rate, minimum start-up and shutdown time, cost function, historical load and renewable energy data, and historical market clearing data, a power grid model file and a list of generating unit / resource parameters are constructed in memory.

[0062] The power grid model file can also be stored in the form of a topology diagram or a list, and this application does not limit this.

[0063] Step 120: Based on the configuration file, instantiate an agent for each duration participant. Each agent includes an Actor network and a Critic network.

[0064] Specifically, according to the configuration file, an agent is instantiated for each market participant, such as thermal power units, wind farms, and energy storage power stations. Each agent includes an Actor network and a Critic network. The Actor and Critic networks consist of several layers of fully connected neural networks, and their weights are initialized randomly or using Xavier initialization. See Table 1 for a list of agents.

[0065]

[0066] Table 1

[0067] Step 130: Set up an experience replay buffer in memory to store trajectory data of the agent's interaction with the market environment.

[0068] Specifically, the experience replay pool is initialized by allocating an experience replay buffer in memory to store trajectory data of the agent's interaction with the environment, in the format of (state s, action a, reward r, next state s').

[0069] These data are preprocessed, including handling missing values ​​through interpolation, smoothing or removing outliers, unifying all time series data onto the same time index, and obtaining minute, hourly, and daily data through resampling, thus obtaining dynamic time series data at multiple time scales.

[0070] Figure 2 The flowchart of the simulation method based on electricity spot trading provided in the embodiments of the present invention is as follows: Figure 2 As shown, this application includes the following steps:

[0071] Step 210: Obtain static structural data and dynamic time series data; the static structural data is obtained based on the power grid model file and the unit list;

[0072] Specifically, the static structural data includes power grid topology and generator / resource parameters; the power grid topology includes node, line, and transformer connection relationships and parameters; the generator / resource parameters include maximum / minimum output, ramp rate, minimum start-up / shutdown time, cost function, and energy storage capacity / efficiency.

[0073] Data can be collected from various data sources through multiple interfaces and technical protocols. For example, historical transaction data can come from the power trading center's database, data warehouse, or provided API interfaces. The content includes: Day-ahead market: marginal price (LMP) and cleared electricity volume for each node at 96 points (every 15 minutes) each day. Real-time market: marginal price, cleared electricity volume for each node, and ancillary service clearing results for each node every 5-15 minutes. In technical implementation, scheduled tasks or database connectors can be used to periodically extract historical data in batches from the trading center's database.

[0074] Real-time operational data originates from the real-time database of the power grid dispatch center (such as an EMS / SCADA system). This data includes: system load, real-time output of each generating unit, real-time power of wind / solar power plants, network topology, line power flow, transmission limits, and system frequency. Technically, streaming data processing technologies, such as Apache Kafka or the MQTT protocol, are used as the data bus to receive second-level or minute-level data pushed by the dispatch system in real time.

[0075] Market participant data sources: The power trading platform's submission system. Content includes energy block information submitted by various power generators, electricity retailers, and users, including type, price, quantity, time period, and operational constraints. Technically, the data is acquired in batches or received in real-time after the submission deadline via the trading platform's RESTful API or WebSocket interface.

[0076] Step 220: Preprocess and divide the dynamic time series data into multiple time scales to obtain preprocessed dynamic time series data with multiple time scales;

[0077] Specifically, the preprocessed multi-timescale dynamic time series data includes historical market clearing data, system load data, renewable energy output data, and real-time operation data; the historical market clearing data includes historical LMP and cleared electricity; the system load data includes historical actual load values ​​and short-term / ultra-short-term forecast values; the renewable energy output data includes historical actual values ​​and short-term / ultra-short-term forecast values; and the real-time operation data includes real-time unit output, line power flow, and frequency.

[0078] For high-frequency fluctuation data, a minute-level dataset is determined; the high-frequency fluctuation data includes real-time load, renewable energy power, frequency, and real-time market clearing price and electricity volume; for short-term trend data, an hour-level dataset is determined; the short-term trend data includes hourly average load, unit output, day-ahead market clearing price, and aggregated reporting data; for long-term statistical and trend data, a daily-level dataset is determined; the long-term statistical and trend data includes daily maximum / minimum / average load, daily total electricity consumption, daily average electricity price, daily unit utilization hours, and market rule information; the obtained multi-timescale datasets are stored in a time-series database.

[0079] The resampling methods include: for state variables, such as topology and limits, forward padding is used; for cumulative variables, such as electricity consumption, summation followed by averaging is used; and for instantaneous variables, such as power and electricity price, linear interpolation or retaining the latest value is used.

[0080] Multi-timescale partitioning aims to provide appropriate datasets for simulations at different time scales. The partitioning rules include minute-level datasets.

[0081] Granularity: 1 minute, 5 minutes, or 15 minutes. Data content: High-frequency fluctuating data, such as real-time load, renewable energy power, frequency, and real-time market clearing prices and electricity volumes. Applications: Primarily used for real-time market simulation and ultra-short-term strategy evaluation.

[0082] Hourly Dataset: Granularity: 1 hour; Data Content: Short-term trend data, such as hourly average load, generator output, day-ahead market clearing price, and aggregated reporting data. Purpose: Primarily used for intraday and day-ahead market simulation, and for short- to medium-term strategy learning by intelligent agents.

[0083] Daily-level dataset: Granularity: 1 day. Data content: Long-term statistical and trend data, such as daily maximum / minimum / average load, total daily electricity consumption, average daily electricity price, daily unit utilization hours, and market rule information. Purpose: Primarily used for long-term trend analysis, assessment of the impact of market rules, and modeling of long-term risk preferences of intelligent agents.

[0084] Step 230: Based on the static structural data and the multi-timescale dynamic time series data, construct multiple intelligent agents for market participants; each intelligent agent is modeled differently based on its own physical characteristics, economic characteristics, and behavioral features;

[0085] This approach models market participants such as generators, users, and energy storage providers as intelligent agents with learning capabilities. Each agent autonomously generates and submits a trading strategy based on its own characteristics and market forecasts, using energy blocks as the underlying asset. Physical characteristics include generator ramp-up rate and minimum start-up / shutdown time. Economic characteristics include cost function and risk preference, while behavioral characteristics include learning ability and strategy interaction.

[0086] Subsequently, based on this data, the intelligent agent modeling module will be provided with: historical price sequences, load curves, and network congestion information as its state space and training data. The market clearing simulation module will be provided with: real-time system load, network topology, line limits, unit parameters, and energy block data submitted by participants as input parameters for the clearing model. Intelligent agents will adopt differentiated behavioral models based on their type, such as traditional thermal power, wind power, photovoltaic, energy storage, and users. For example, thermal power generators will find a balance between ensuring the recovery of start-up costs and striving for more power generation, learning to bid high prices during peak hours and bid for volume during off-peak hours. New energy power generators will minimize assessment costs caused by prediction errors or collaborate with other flexible resources, such as energy storage, in joint bidding to smooth out fluctuations. Energy storage will learn arbitrage strategies of buying low and selling high, accurately predicting peak-valley price differences, and considering equipment losses during charging and discharging.

[0087] Step 240: Each of the intelligent agents perceives the market environment according to its corresponding state vector, and generates and reports at least one type of energy block information; the energy block types include time-sharing blocks, continuous blocks, curve blocks, and variable blocks;

[0088] Among them, the time-of-use block targets the electricity and price for social security during specific time periods and is applicable to traditional time-of-use pricing. The continuous block requires constant power operation within a continuous time period and is suitable for units with high start-up and shutdown costs and a need for stable operation. The curve block requires submitting a power curve that varies over time and is suitable for renewable energy sources with accurately predictable output or units with specific operating curves. The variable block allows for flexible power adjustment within a certain range during different time periods under total electricity constraints and is suitable for flexible resources such as energy storage.

[0089] As shown in the figure, step 240 includes the following:

[0090] Step 2401, define the state vector;

[0091] The state vector includes public and private states. The public state includes historical electricity price sequences, system load data, renewable energy output data, network congestion information, and the current time period and market stage. The historical electricity price sequence includes pre-processed day-ahead / real-time electricity prices across multiple time scales. The network congestion information and the current time period and market stage are also included. The private state includes the agent's physical state, economic state, and historical performance. The physical state includes current output, continuous operating time, and current state of charge. The economic state is obtained from static structure data, including cost functions and start-up / shutdown costs. The historical performance is obtained from the previous market structure, including whether the agent won a bid in the previous period.

[0092] Based on the public and private states, generate state vectors, encapsulate these state vectors into a vector or tensor, and pass them to each agent.

[0093] The agent generates actions, or energy block application strategies, by inputting its observed state vector *s* into its Actor network. After forward propagation, the Actor network outputs an action vector *a*. This vector defines the parameters of the energy block to be applied for. For example, for an energy storage agent applying for a variable block, its action output might be a multi-dimensional vector containing its planned charging and discharging power and corresponding bids for multiple future time periods. In the early stages of training, random noise, such as Ornstein-Uhlenbeck process noise, is added to the actions to encourage exploration; as training progresses, the noise gradually decreases, tending to utilize the learned strategy.

[0094] Step 2402: The agent's Actor neural network receives the state vector and outputs the original action vector; each dimension of the original action vector corresponds to each first parameter of the energy block; the first parameter includes power and price;

[0095] In this process, all the information perceived by the agent is organized into a fixed-length vector, which serves as the input to the neural network.

[0096] For example, the state vector of a thermal power agent at time t might be: s_t = [current time period, predicted load_t, predicted wind power_t, historical electricity price_{t-1}, historical electricity price_{t-2}, ..., my current output, my marginal cost, network congestion flag]; each dimension of this vector comes from preprocessed multi-scale data.

[0097] The action, or the energy block it requests, is the output action of the agent, which is the energy block parameter it requests.

[0098] For example, the action space of an energy storage agent that applies for a "variable block" can be defined as: a_t = [charging / discharging power of future time period 1, bid price of future time period 1, charging / discharging power of future time period 2, bid price of future time period 2, ...]

[0099] Action boundaries: These action values, such as the output power range, must be limited to the range of physical characteristics injected in the first step, such as maximum charging power and maximum discharging power. This is typically achieved by using a tanh activation function in the output layer of the neural network and then scaling the mapping to the actual range.

[0100] Step 2403: Obtain the physical boundary from the static structure data, and map the original action vector output by the Actor neural network to the numerical range defined by the physical boundary to obtain the mapped parameters;

[0101] The unit list can serve as the boundary of the agent's internal state and action space. For example, the state space of a thermal power agent may include its current output and unit status, such as start-up / shutdown. Changes in these states must follow the ramp rate and minimum start-up / shutdown time specified in the unit list.

[0102] Its operational space, i.e., the declared power output, is limited to the range of [minimum technical output, rated capacity]. When the agent outputs an action, it must ensure, through a scaling layer or pruning operation, that the declared power output is within the physical capacity of its unit.

[0103] For thermal / hydropower intelligent entities, the physical boundaries that their declared power output (actions) must meet are: minimum technical output of the unit ≤ declared power output ≤ rated capacity of the unit. These two boundary values ​​are directly read from the unit list.

[0104] Energy storage intelligent agents: Their charging and discharging power (actions) must meet the following physical boundaries: maximum charging power ≤ declared power ≤ maximum discharging power. Simultaneously, their declared total capacity is constrained by the energy storage capacity and the current State of Charge (SOC). These parameters are all derived from preprocessed data.

[0105] The physical boundary that a new energy intelligent agent must meet is that its declared power output usually cannot exceed the pre-processed predicted power output curve.

[0106] Actor Network (Policy Network): Input: State vector s_t. Output: Action vector a_t (i.e., energy block declaration parameters). Responsible for executing the policy and making decisions based on the current state.

[0107] Critic Network (Value Network): Input: state vector s_t + action vector a_t, output: a scalar value Q(s,a), which evaluates the long-term expected reward of performing action a in state s. Responsibility: responsible for evaluating policies and guiding the update direction of the Actor Network.

[0108] The output of the neural network needs to be mapped to actual values ​​that conform to physical and economic laws. Static structured data plays a decisive role here.

[0109] For example, an energy storage agent may apply for a "variable block", with the action vector defined as: a_t = [target time period 1 power, target time period 1 price, target time period 2 power, target time period 2 price, ..., total power];

[0110] The mapping process involves obtaining the physical boundary from the static structural data and mapping the neural network output (-1 to 1) to the actual physical range.

[0111] Step 2404: The mapped parameters are encapsulated according to a preset energy block data structure to generate an energy block; the energy block includes any one of time-division block, continuous block, curve block and variable block;

[0112] Specifically, all mapped parameters (actual power value, actual price, time period, etc.) are encapsulated according to a preset energy block data structure. For example, a persistent block is generated.

[0113] Step 2405: Calculate the final reward of the encapsulated energy block based on the cost function in the static structural data and the clearing result of the previous time step.

[0114] Step 2406: Store the current state vector, action vector, reward, and the state vector of the next moment in the memory bank;

[0115] Step 2407: Periodically sample from the memory bank to update the Actor neural network.

[0116] Specifically, the agent is not static; it learns through reward signals. The calculation of the reward function is highly dependent on static structured data and market clearing results. The generation cost included in the reward function is typically calculated based on a cost function, such as a quadratic function, from the unit list. Thus, in agent modeling, the unit list parameter ensures that the agent's decisions are "compliant," preventing it from submitting an operational plan that its own units cannot achieve, thereby improving the realism of the simulation.

[0117] The agent stores (state s_t, action a_t, reward r_t, next state s_{t+1}) in a memory bank. It periodically samples from this memory bank, using this data to update its Actor neural network and Critic neural network. The Critic neural network learns to evaluate the merits of taking action a_t in state s_t. Based on the guidance of the Critic neural network, the Actor neural network adjusts its network weights so that in future states similar to s_t, it can output actions a_t' that yield higher rewards, i.e., higher profits.

[0118] Step 250: Based on the energy block information declared by all agents, construct a market clearing model with the goal of maximizing social welfare or minimizing total system cost; the market clearing model includes system power balance constraints, unit network power flow constraints, unit operation constraints, and characteristic constraints corresponding to each energy block type;

[0119] Specifically, after day-ahead market clearing, what we obtain is not only electricity price and volume, but more importantly, the unit start-up and shutdown schedule. This schedule is calculated based on parameters in the unit list (such as minimum start-up and shutdown times). As the simulation progresses from the day-ahead scale to the real-time scale, this unit start-up and shutdown schedule, along with the cleared continuous block / curve block states, are passed to the real-time market model as rigid boundary conditions. The real-time market clearing model must respect these physical states already determined in the day-ahead market (for example, a coal-fired power unit scheduled to start in the day-ahead market cannot be arbitrarily shut down in the real-time market because it is constrained by the minimum shutdown time), and these constraints all originate from the initial unit list.

[0120] The market clearing simulation module constructs a mathematical optimization model with the objective function of maximizing social welfare or minimizing the total system cost. Its inputs are the bid prices of each energy block and the clearing power. Under the constraints, it minimizes the bid price of each energy block multiplied by the clearing power to obtain the optimal bidding strategy.

[0121] Objective function (minimize total cost): Minimize∑(price of each energy block * clearing power).

[0122] The constraints include:

[0123] System power balance constraint: During each operating period (typically 15 minutes or 1 hour), the total grid-connected power of all power generation entities (including conventional units, new energy sources, energy storage, etc.) must equal the total power consumption of all loads (user consumption, network losses, etc.). Its mathematical expression is as follows:

[0124] ∑(Power Generation) + ∑(Input Power) - ∑(Output Power) - ∑(Load Power) - ∑(Network Loss) = 0

[0125] Energy block characteristic constraints: This is the focus of this invention. It ensures that the clearing results meet the specific requirements of various energy blocks, such as the continuous operation constraints of persistent blocks and the total energy constraints of variable blocks. In multi-scale simulations, the power network model and unit list ensure the physical consistency and coherence of simulation results across different market phases (day-ahead, real-time).

[0126] As shown in the figure, step 250 includes the following:

[0127] Step 2501: Obtain the power grid topology, unit / resource parameters, system load data, new energy output data, and energy blocks declared by the intelligent agent;

[0128] The power grid topology is used to construct the PTDF matrix, which is the core for calculating line power flow and simulating congestion. The power grid topology defines the node location of each device, such as generators and loads. Unit technical parameters define the decision variable boundaries for each unit, such as upper and lower output limits, used to construct unit operating constraints, such as ramp rate and minimum start-up / shutdown time. System load and renewable energy forecasts serve as constant terms on the right-hand side of the system power balance constraints. That is, the sum of all generated electricity must equal this forecast value. This is the core driving force for solving the optimization model. The set of energy blocks declared by the agent defines the decision variables, and the cleared electricity of each energy block is the variable to be solved.

[0129] Step 2502: Create an empty optimization model using the optimization library;

[0130] Step 2503: Obtain the power grid topology, unit / resource parameters, system load data, new energy output data, and energy blocks declared by the intelligent agent, and construct the variables and constraints of the optimization model;

[0131] Specifically, the variables and objective function of the optimization model are defined using energy block data, power balance constraints are constructed using predicted data from load data and renewable energy output data, network power flow constraints are constructed using data from the power grid topology, and operation and characteristic constraints are constructed using unit / resource parameters and energy block data.

[0132] Constructing energy block characteristic constraints: Transforming the application parameters into mathematical constraints. Defining decision variables, with the core variable being the clearing current of each energy block in each time period, and the auxiliary variable being the unit start-up and shutdown status. The defined objective function is, for example, MinΣ(energy block bid × clearing current).

[0133] The constructed system power balance constraint is: total power generation + predicted power from new energy sources = predicted total system load.

[0134] Energy block characteristic constraints include continuous block constraints and variable block constraints. Continuous block constraints mean that the power is constant during the continuous period, while variable block constraints mean that the total amount of electricity is related to the power range.

[0135] Network power flow constraints dictate that the actual power flow of all transmission congestion components in a power grid, such as lines and transformers, must be less than their maximum allowable transmission capacity (thermal stability limits, transient stability limits, etc.). A DC power flow model is typically used for approximation. This model transforms complex nonlinear AC power flow problems into linear problems through a series of assumptions (ignoring line resistance and ground conductance), significantly improving computational speed. Inputs: grid topology (node ​​and branch connections), branch reactance parameters, net active power injection at nodes (generation power minus load power), slack node settings; Outputs: voltage phase angles of all nodes, active power flow of all branches. It ignores reactive power and voltage amplitude variations, simplifying power flow calculations into a linear problem, making it highly suitable for large-scale optimization calculations. The DC power flow model allows calculation of the linear relationship between power flow on each line and node injection power (Power Transfer Distribution Factor, PTDF). Calculating net node injection power: Generation-Load, using the PTDF matrix to calculate line power flow.

[0136] Unit operation constraints include upper and lower limits of unit output, ramp rate constraints, minimum start-up and shutdown time constraints, start-up and shutdown costs, and no-load costs. The upper and lower limits of unit output are determined only when the unit is running, by finding the sum of the cleared power of all energy blocks belonging to that unit in time period t, and the ramp rate constraint. Energy block characteristic constraints are shown in Table 2.

[0137]

[0138] Table 2

[0139] Step 2504: Solve the optimization model to obtain key results; the key results include cleared electricity volume and nodal marginal electricity price.

[0140] Specifically, it calculates time constraints and optimality gap tolerance, and outputs a solution log. Upon successful solution, it extracts key results from the model object.

[0141] The clearing engine extracts the cleared electricity quantity and the node marginal electricity price. Finally, it packages the results into a standardized data structure for use by subsequent modules. The standardized data structure includes a cleared electricity quantity dictionary, a node electricity price dictionary, clearing time, solution status, and total social cost.

[0142] Step 260: Solve the market clearing model to obtain the market clearing electricity price and the clearing electricity volume of each energy block;

[0143] Step 270: Feed back the clearing results to each agent;

[0144] Specifically, the clearing results are sent to each agent.

[0145] Step 280: Each agent updates its bidding strategy based on the feedback results using a deep reinforcement learning algorithm.

[0146] Specifically, the agent updates its pricing strategy based on the cleared electricity volume and node boundary price in the feedback results, using a pre-set deep reinforcement learning algorithm.

[0147] Step 290: On both the day-ahead market and the real-time market timescales, the process of the agent generating and reporting at least one type of energy information to update the bidding strategy based on the market environment is repeated, and rolling collaborative simulation is performed; wherein, the clearing result of the day-ahead market is the boundary condition for the clearing of the real-time market.

[0148] The market is clearing out based on forecasted daily load and renewable energy output to determine generation plans and node prices for each time period of the following day.

[0149] Intraday / Real-Time Market: Based on the deviation between ultra-short-term forecasts and actual operating conditions, energy blocks with stronger adjustment capabilities (such as variable blocks) are rolled over for balancing and clearing. The results of the long-term network layer serve as initial or boundary conditions for the simulation of the medium-term and short-term network layers, achieving synergy.

[0150] The core market indicators are shown in Table 3:

[0151]

[0152] Table 3

[0153] Specifically, the market simulation starts at a specific time each trading day, with input data consisting of predicted data from daily and hourly load data and renewable energy output data. The clearing feature is that the smart agent needs to declare energy blocks that require advance planning, including continuous blocks and curve blocks. The output is the unit start-up and shutdown plan, node electricity price, and binding status of each energy block for 96 time periods the next day.

[0154] The real-time market simulation is triggered on the day of operation and is executed on a rolling basis at a minute-level frequency. The input data consists of ultra-short-term forecast data and actual measurement data based on minute-level data. The boundary conditions for clearing characteristics are that the continuous blocks and curve blocks of the day-ahead clearing have become fixed quantities that must be executed, serving as the clearing boundary. The output consists of power adjustment instructions and real-time node electricity prices for multiple future time periods.

[0155] Rolling collaborative simulation includes: running an evaluation script, reading clearing data for the entire simulation cycle, and calculating core market indicators; the core market indicators include total social welfare and the HHI index; the total social welfare is equal to the sum of consumer surplus and producer surplus, and the HHI index is equal to the square of each firm's market share; using the power grid geographic wiring diagram as the base map, mapping node electricity prices or line congestion to different identifiers, and generating a geographic heat map; generating time-series curves for load, electricity price, and output.

[0156] Figures 13(a) and 13(b) illustrate the evaluation of the forecasting models for partial date unified pre-dated price (clearing) and unified real-time price (clearing), using the mean absolute percentage error (MAPE) to evaluate the models. The formula for calculating MAPE is as follows:

[0157]

[0158] Where y i It is the actual value. i Here, n is the predicted value, n is the sample size, and the result is expressed as a percentage. The prediction accuracy is 1-MAPE. Therefore, the average accuracy of the day-ahead price (clearing) is 82.98%, and the average accuracy of the real-time price (clearing) is 81.91%.

[0159] By applying the simulation method based on electricity spot trading provided in this invention, and through multi-agent systems with learning capabilities, the bounded rationality, strategic interactions, and dynamic evolution of market participants are realistically simulated, solving the distortion problem caused by the "assumption of perfect rationality" in traditional models. Energy blocks are used as the trading instrument, and their characteristic constraints are deeply integrated into the clearing model to ensure that the results simultaneously satisfy economic optimization and grid physical security, eliminating infeasible solutions. A multi-timescale collaborative simulation framework is constructed to achieve rolling connections between day-ahead and real-time markets, enabling detailed analysis of market dynamics and cross-time period impacts, resulting in more coherent time sequences. The combination of distributed agent decision-making and centralized optimization clearing, utilizing mature commercial solvers, ensures the computational speed and system stability of large-scale complex market simulations. Three-dimensional visualization and multi-dimensional evaluation transform complex data into intuitive insights, serving as a powerful trader training platform and market rule sandbox, providing in-depth support for strategy formulation and policy design.

[0160] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0161] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0162] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A simulation method based on power spot trading, characterized by, The method includes: Acquire static structural data and dynamic time series data; the static structural data is obtained based on the power grid model file and the unit list. The dynamic time series data is preprocessed and divided into multiple time scales to obtain preprocessed dynamic time series data with multiple time scales. Based on the static structural data and the dynamic time series data at multiple time scales, multiple intelligent agents of market participants are constructed; each intelligent agent is modeled differently according to its own physical characteristics, economic characteristics and behavioral characteristics. Each of the aforementioned intelligent agents perceives the market environment based on its corresponding state vector, and generates and reports at least one type of energy block information; the energy block types include time-sharing blocks, continuous blocks, curve blocks, and variable blocks. Based on the energy block information declared by all agents, a market clearing model is constructed with the goal of maximizing social welfare or minimizing total system cost. The market clearing model includes system power balance constraints, unit network power flow constraints, unit operation constraints, and characteristic constraints corresponding to each energy block type. Solve the market clearing model to obtain the market clearing electricity price and the clearing electricity volume of each energy block; The clearing results will be fed back to each agent; Each agent updates its pricing strategy using deep reinforcement learning algorithms based on the feedback results; At both the day-ahead market and the real-time market timescales, the process of the agent generating and reporting at least one type of energy information to update the bidding strategy based on the market environment is repeated, and rolling collaborative simulation is performed; wherein, the clearing result of the day-ahead market serves as the boundary condition for the clearing of the real-time market. Specifically, each of the aforementioned intelligent agents, based on its corresponding state vector, perceives the market environment and generates and submits at least one type of energy block information, including: Define a state vector; the state vector includes public state and private state; the public state includes historical electricity price sequence, system load data, renewable energy output data, network congestion information, current time period and market stage; the historical electricity price sequence includes preprocessed day-ahead / real-time electricity prices at multiple time scales; the network congestion information and current time period and market stage; the private state includes the agent's own physical state, its own economic state, and its own historical performance; the agent's own physical state includes current output, continuous operating time, and current state of charge; the agent's own economic state is obtained from static structure data, including cost function and start-up / shutdown costs; the agent's own historical performance is obtained from the previous market structure, including whether it won a bid in the previous time period; The agent's Actor neural network receives a state vector and outputs a raw action vector; each dimension of the raw action vector corresponds to a first parameter of the energy block; the first parameter includes power and price. The physical boundary is obtained from the static structural data, and the original action vector output by the Actor neural network is mapped to the numerical range defined by the physical boundary to obtain the mapped parameters. The mapped parameters are encapsulated according to a preset energy block data structure to generate energy blocks; the energy blocks include any one of time-division blocks, continuous blocks, curve blocks, and variable blocks; Calculate the final reward of the encapsulated energy block based on the cost function in the static structure data and the clearing result of the previous time step; Store the current state vector, action vector, reward, and the state vector for the next moment in the memory bank; Periodically sample from the memory bank to update the Actor neural network.

2. The method of claim 1, wherein, The static structural data includes power grid topology and generator / resource parameters; the power grid topology includes node, line, and transformer connection relationships and parameters; the generator / resource parameters include maximum / minimum output, ramp rate, minimum start-up / shutdown time, cost function, and energy storage capacity / efficiency; The preprocessed dynamic time series data across multiple time scales includes historical market clearing data, system load data, renewable energy output data, and real-time operation data. The historical market clearing data includes historical LMP and cleared electricity volume. The system load data includes historical actual load values ​​and short-term / ultra-short-term forecast values. The renewable energy output data includes historical actual values ​​and short-term / ultra-short-term forecast values. The real-time operation data includes real-time unit output, line power flow, and frequency.

3. The method of claim 1, wherein, The method is preceded by: During the system initialization phase, based on the power grid topology, including node and branch parameters, physical parameters of all registered generating units, including maximum / minimum output, ramp rate, minimum start-up and shutdown time, cost function, historical load and renewable energy data, and historical market clearing data, a power grid model file and a list of generating unit / resource parameters are built in memory. According to the configuration file, an agent is instantiated for each duration participant, and each agent includes an Actor network and a Critic network. An experience replay buffer is set up in memory to store trajectory data of the agent's interaction with the market environment.

4. The method of claim 1, wherein, The preprocessing and multi-timescale partitioning of the dynamic time series data to obtain multi-timescale dynamic time series data specifically includes: For high-frequency fluctuation data, a minute-level dataset is determined; the high-frequency fluctuation data includes real-time load, renewable energy power, frequency, and real-time market clearing price and electricity volume; For short-term trend data, an hourly dataset is determined; the short-term trend data includes hourly average load, unit output, day-ahead market clearing price, and aggregated reporting data; For long-term statistical and trend data, daily datasets are determined; the long-term statistical and trend data include daily maximum / minimum / average load, daily total electricity consumption, daily average electricity price, daily unit utilization hours, and market rule information; The obtained multi-timescale datasets are stored in a time-series database.

5. The method of claim 1, wherein, The construction of a market clearing model based on the energy block information declared by all agents, with the objective of maximizing social welfare or minimizing total system cost, specifically includes: Acquire grid topology, unit / resource parameters, system load data, renewable energy output data, and energy blocks declared by intelligent agents; Create an empty optimization model using the optimization library; The system acquires grid topology, generator / resource parameters, system load data, renewable energy output data, and energy blocks declared by intelligent agents to construct the variables and constraints of the optimization model. Specifically, the variables and objective function of the optimization model are defined using energy block data, power balance constraints are constructed using predicted data from load data and renewable energy output data, network power flow constraints are constructed using data from the grid topology, and operation and characteristic constraints are constructed using generator / resource parameters and energy block data. The optimization model is solved to obtain key results, including cleared electricity volume and nodal marginal electricity price.

6. The method of claim 5, wherein, The objective function is the product of the bid price and cleared electricity for each energy block, or the sum of consumer surplus and producer surplus. The power balance constraint is the difference between the power generation and the load power in each time period; Energy block characteristic constraints include continuous block constraints and variable block constraints. Continuous block constraints mean that the power is constant during the continuous period, while variable block constraints mean the total amount of electricity and the power range. Network power flow constraints, calculate the net power injection at nodes: generation-load, and use the PTDF matrix to calculate line power flow; Unit operation constraints, output upper and lower limit constraints, only when the unit is started, find the sum of the cleared power of all energy blocks belonging to the unit in time period t and the ramp rate constraints.

7. The method of claim 1, wherein, The step of repeatedly executing the process of the agent generating and reporting at least one type of energy information to update the bidding strategy based on the market environment at both the day-to-day market and real-time market timescales, and performing rolling collaborative simulation, specifically includes: The market simulation is actually based on the simulation time being pushed to a specified time for each trading day. The input data is the predicted data based on daily and hourly load data and new energy output data. The clearing feature is that the intelligent agent needs to declare energy blocks that need to be planned in advance, including continuous blocks and curve blocks. The output is the unit start-up and shutdown plan, node electricity price and binding status of each energy block for 96 time periods of the next day. The real-time market simulation is triggered on the day of operation and is executed on a rolling basis at a minute-level frequency. The input data consists of ultra-short-term forecast data and actual measurement data based on minute-level data. The boundary conditions for clearing characteristics are that the continuous blocks and curve blocks of the day-ahead clearing have become fixed quantities that must be executed, serving as the clearing boundary. The output consists of power adjustment instructions and real-time node electricity prices for multiple future time periods.

8. The method according to claim 1, characterized in that, The method further includes: Run the evaluation script, read the clearing data for the entire simulation cycle, and calculate the core market indicators; the core market indicators include total social welfare and the HHI index; the total social welfare is equal to the sum of consumer surplus and producer surplus, and the HHI index is equal to the square of each firm's market share; Using the power grid geographic wiring diagram as the base map, node electricity prices or line congestion are mapped to different identifiers to generate a geographic heat map; Generate time-series curves for load, electricity price, and power output.

9. The method according to claim 8, characterized in that, The method further includes: The time-series curves of the load, electricity price, and output are displayed using a three-dimensional model.

Citation Information

Patent Citations

  • Multi-subject bidding simulation method, system and simulation platform based on energy block transaction

    CN119168738A

  • Power system transaction simulation method based on multi-agent proxy

    CN119962389A