Method for optimizing electricity purchasing and selling strategy of retailer by considering bilateral transaction
Through real-time data collection and deep learning models, and combining multi-market collaborative optimization and dynamic hedging strategies, the problems of retailers in risk management and resource allocation in complex market environments are solved, and more efficient resource utilization and user response are achieved. Improved operational efficiency.
Patent Information
- Application Number
- CN202411282850.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-01-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Retailers are difficult to effectively manage risks, optimize resource utilization and predict demand in a complex power market environment, resulting in limited ability to obtain stable profits.
Use the Internet of Things and big data technology to collect data in real time, use deep learning models to combine multi-task learning to predict power demand, establish a multi-market collaborative optimization model, use dynamic hedging strategies and Monte Carlo simulation to optimize power purchase and sales strategies, and realize automated decision-making and models optimization.
Significantly reduce market volatility risks, improve resource utilization efficiency, enhance personalized response capabilities to user needs, and improve operational efficiency and market competitiveness.
Smart Images

Figure CN119250418A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power market and economic technology, and in particular to a method for optimizing a retailer's power purchase and sales strategy taking bilateral transactions into consideration. Background Art
[0002] With the deepening of power market reform, retailers are facing a complex market environment in their power purchase and sales strategies in bilateral transactions. The interrelationships among the power market, natural gas market and carbon trading market and the unpredictability of market fluctuations have caused defects in the practical application of traditional power purchase and sales strategies. The limitations of existing technologies in risk management, resource utilization optimization and demand forecasting restrict retailers' ability to obtain stable profits in a complex market environment.
[0003] First, the limitation of risk hedging strategies lies in the fact that existing hedging methods mostly rely on static or semi-dynamic models and cannot cope with volatile market fluctuations in real time. Traditional hedging strategies cannot respond quickly to extreme market changes, resulting in the inability to effectively control risk exposure. Retailers are prone to losses under extreme market conditions.
[0004] Secondly, the accuracy and diversity of demand forecasting are defects of existing technologies. Traditional electricity demand forecasting models usually rely on historical data for single-dimensional forecasting, ignoring the impact of multi-dimensional factors such as user behavior, weather conditions, and economic factors, resulting in low forecasting accuracy. In addition, the model lacks accurate capture of user personalized needs and cannot provide personalized responses based on user price sensitivity, reducing the flexibility of electricity sales strategies.
[0005] Finally, the lack of multi-market linkage and collaborative optimization makes it impossible for retailers to effectively allocate resources in multi-market transactions. When dealing with collaborative transactions in electricity, natural gas and carbon trading markets, existing technologies lack an optimization mechanism for multi-market linkage and are unable to balance the resource utilization efficiency and transaction profits of each market, resulting in low resource utilization efficiency and increased operating costs.
[0006] Therefore, those skilled in the art provide an optimization method for a retailer's electricity purchase and sales strategy taking into account bilateral transactions to solve the problems raised in the above background technology. Summary of the invention
[0007] In view of the deficiencies of the prior art, the present invention provides a method for optimizing a retailer's electricity purchasing and selling strategy taking into account bilateral transactions, so as to solve the problems raised in the above background technology.
[0008] To achieve the above objectives, the present invention is implemented through the following technical solutions: A method for optimizing a retailer's electricity purchase and sales strategy considering bilateral transactions, comprising the following steps: Step 1, data collection and processing:
[0009] Through the Internet of Things and big data technologies, multi-source data is collected in real time, and the original data is cleaned and denoised, and feature engineering technology is used to extract key features related to electricity demand and price fluctuations;
[0010] Step 2: Demand forecasting and response analysis:
[0011] Use deep learning models combined with multi-task learning to predict electricity demand for different user groups and time periods. Based on demand forecasting and combined with demand response mechanisms, analyze users' responses to changes in electricity prices to simulate users' behavioral economics models, predict load adjustment potential under different incentive mechanisms, and integrate them into power sales strategies.
[0012] Step 3: Cross-market collaborative optimization:
[0013] Establish a multi-objective collaborative optimization model for the electricity market, natural gas market, and carbon trading market, and use a distributed optimization algorithm to collaboratively optimize trading strategies across different markets;
[0014] Step 4: Dynamic risk hedging strategy:
[0015] Real-time monitoring of price fluctuations and demand changes in the electricity market through a big data platform, and the use of dynamic hedging strategies, combined with traditional financial instruments and innovative hedging tools, automatically triggers adjustments to hedging strategies in the event of extreme market fluctuations;
[0016] Step 5: Strategy simulation and evaluation:
[0017] Use Monte Carlo simulation to conduct scenario analysis on power purchase and sales strategies, test the performance of strategies under different market conditions, and evaluate the return and risk performance of strategies in extreme situations such as drastic market price fluctuations, demand changes, and supply chain disruptions, so as to adjust model parameters and strategies based on the results of sensitivity analysis;
[0018] Step 6: Optimize strategy implementation and dynamic adjustment:
[0019] Formulate specific power purchase and sales plans based on the results of demand forecasting, market collaborative optimization and risk hedging strategies, and implement power purchase and sales decisions through an automated system. When real-time market conditions change, the system automatically adjusts the power purchase and sales plans and hedging strategies, and regularly updates demand forecasting models and risk hedging models, optimizing model performance based on historical data feedback;
[0020] Step 7: Feedback and Optimization:
[0021] By analyzing historical trading data, evaluating the effectiveness of actual trading strategies, and feeding the results back into the model, we continuously optimize the forecast accuracy and hedging effect, and regularly upgrade and optimize multi-market linkage optimization models and algorithms in combination with market changes and technological development.
[0022] Preferably, in step 1, the goal of data cleaning is to remove noise and fill missing values. Local weighted regression is a non-parametric regression method used to process noise and nonlinear trends in data. The local weighted regression formula is:
[0023] Among them, y i is the data value after local regression, w j (x i ) is the weight coefficient of the jth data point at the ith position, and the weight is determined by the weight function, the Gaussian kernel function:
[0024]
[0025] Among them, θ is a smoothing parameter that determines the weight window width of local regression;
[0026] In step 1, feature engineering extracts key features from high-dimensional data through principal component analysis. The basic step of principal component analysis is to project the data into a low-dimensional space by solving the eigenvalues and eigenvectors of the covariance matrix;
[0027] Given the original data matrix X, its covariance matrix is:
[0028] The eigenvalues λ1, λ2, ..., λ of the covariance matrix are obtained by eigendecomposition. n and its corresponding eigenvectors v1, v2, ..., v n ;
[0029] The eigenvectors corresponding to the first k largest eigenvalues constitute a new low-dimensional feature space;
[0030] The new low-dimensional feature matrix Z is: Z = X·V k ,
[0031] Among them, V k is the matrix consisting of the first k eigenvectors.
[0032] Preferably, in step 1, the method for processing time series data is a sliding window and an autoregressive model;
[0033] Sliding window: In power demand forecasting, sliding windows are used to extract short-term trend features from time series data;
[0034] Given time series data The sliding window formula is:
[0035]
[0036] Where k is the window size, y tis the smoothed value after sliding the window;
[0037] Autoregressive model: used to predict future changes in electricity demand. The autoregressive model formula is:
[0038]
[0039] Among them, x t is the demand data at the moment, c is a constant term, φ i is the autoregressive coefficient, p is the lag order, ∈ t is the error term,
[0040] In step 1, in order to further optimize the data feature selection process, LASSO regression is used to determine the features that are strongly correlated with power demand fluctuations. The optimization problem formula of LASSO is:
[0041]
[0042] Among them, y i is the target variable, x i is the input feature vector, β is the regression coefficient, and λ is the regularization parameter used to control the sparsity of the model.
[0043] Preferably, in step 2, an electricity price-demand elasticity model is used, based on a variational inference framework, to capture the complex relationship between electricity demand and electricity price changes. The model algorithm formula is as follows:
[0044] Demand response is defined as a latent variable model, in which the user's electricity demand D(t) is determined by the latent variable z and the electricity price P(t):
[0045] D(t)=f(P(t),z)+∈, where z is a latent variable describing the user behavior pattern, which conforms to a certain prior distribution P(z), and ∈ is a noise term, which follows a normal distribution.
[0046] The variational inference process is to calculate the posterior distribution of the latent variable z, that is, to approximate the true posterior distribution by fitting the variational distribution q(z), and the optimization goal is to minimize the variational free energy:
[0047]
[0048] where KL(q(z)||p(z)) is the KL divergence between the variational distribution q(z) and the prior distribution p(z), and [logp(D|P,z)] is the log-likelihood under the variational distribution.
[0049] Preferably, the step 2 is based on a combinatorially optimized electricity price incentive mechanism. In the demand response process, the incentive mechanism is a factor that affects the user's load adjustment, so as to propose an incentive mechanism design model based on combinatorial optimization, aiming to maximize the user's load response through electricity price incentives. The utility function modeling formula of the user response is:
[0050] Define the user's utility function to describe the impact of electricity price incentive P(t) on load adjustment D(t):
[0051] U(D(t))=α·log(D(t))-β·P(t)-γ·C(t),
[0052] Among them, α, β and γ are parameters in the utility function, C(t) is the load adjustment cost of the user at time t;
[0053] Combination optimization problem of incentive mechanism,In order to maximize the total utility of user load adjustment, a combination optimization problem is proposed, the goal is to design the optimal electricity price incentive scheme for different time periods to maximize the total load response:
[0054] The constraints include:
[0055] Electricity price fluctuation limit: Electricity prices cannot fluctuate excessively to ensure market stability:
[0056] |P(t+1)-P(t)|≤ΔP max ,
[0057] Load adjustment restrictions: User load adjustment cannot exceed a reasonable range:
[0058] |P(t+1)-P(t)|≤ΔP max ,
[0059] Combinatorial optimization problems are solved by dynamic programming or genetic algorithms to maximize utility.
[0060] Preferably, in step 3, a dynamic multi-objective optimization method is introduced, and distributed computing is combined with a time-dependent decision model to perform coordinated optimization of the electricity, natural gas and carbon markets.
[0061] Definition of multi-objective optimization problem: Define the optimization objective function to optimize the total benefit of each market at time t:
[0062] Among them, f1(x(t)) is the revenue function in the electricity market, x(t) is the transaction volume in the electricity market, f2(y(t)) is the cost function in the natural gas market, y(t) is the transaction volume in the natural gas market, f3(z(t)) is the carbon emission trading benefit in the carbon trading market, z(t) is the transaction volume in the carbon market;
[0063] Collaboration constraints: In cross-market collaborative optimization, it is necessary to consider the resource linkage and constraints between markets;
[0064] Energy coupling constraints: the linkage between natural gas and electricity markets, and the conversion of natural gas to electricity through gas-fired power generation: P gas (t) = η conv G(t),
[0065] Among them, P gas (t) is the amount of electricity generated by gas-fired power generation, G(t) is the natural gas consumption, η conv is the conversion efficiency;
[0066] Carbon emission limits: Transactions in electricity and gas markets need to comply with carbon emission limits:
[0067] C elec (t)+C gas (t)≤C max ,
[0068] Among them, C elec (t) and C gas (t) is the carbon emissions from electricity and natural gas markets, C max It is the upper limit of total carbon emissions;
[0069] Innovative target balancing mechanism: When there are conflicts in the target functions of different markets, a dynamic weight adjustment mechanism is introduced to balance the weights of different target functions:
[0070]
[0071] Among them, λ i (t) is the objective function f i The dynamic weight at time t is adjusted by the following formula:
[0072] This formula adjusts the weight of each target through gradient ascent, and α is the step size parameter to ensure that the weight is adjusted dynamically.
[0073] Preferably, in step 3, in order to cope with the complexity of the multi-market collaborative optimization problem, a distributed optimization algorithm is introduced, and the alternating direction multiplier method is used to achieve independent decision-making for each market and maintain global coordination;
[0074] The multi-market optimization problem is decomposed through ADMM, each market optimizes its profit function independently, and then the solutions of each market are coordinated through global updates;
[0075] Define the local optimization objective function for the distributed problem:
[0076] Local issues in the electricity market:
[0077] Among them, z1(t) is the globally updated shared variable, and ρ is the penalty parameter;
[0078] Local issues in the natural gas market:
[0079] Local issues in the carbon market:
[0080] The solutions of each local market are coordinated with each other through the ADMM method, and the global variable z(t) is updated at each time step as follows: i (t+1)=z i (t)+ρ·(x(t)+y(t)+z(t)),
[0081] Through the updating steps, the independent solutions of the electricity, natural gas, and carbon markets are coordinated at each time step, so that the global objective function is gradually optimized.
[0082] Preferably, in step 4, in order to hedge the risk in the volatility of the electricity, natural gas and carbon trading markets, a multi-market adaptive dynamic hedging model is proposed, which dynamically adjusts the hedging strategy by combining the real-time market data through machine learning methods;
[0083] Adaptive risk measurement formula: Define the dynamic risk exposure of the market as E(t), which is a function of the volatility of the value of assets held in the electricity market, natural gas market, and carbon market. The specific form is:
[0084]
[0085] Among them, σ elec (t),σ gas (t),σ carbon (t) represents the volatility of the electricity, natural gas, and carbon markets at time t, β1, β2, and β3 are the risk sensitivities of the electricity, natural gas, and carbon markets;
[0086] Risk exposure E(t) is used to measure the risk exposure of total assets to current market volatility. Unlike static hedging, risk sensitivity β is dynamically adjusted and changes over time according to market volatility.
[0087] The hedging strategy minimizes risk exposure through a suitable combination of financial instruments. Assuming that futures, options and carbon credit contracts are used in the market, the optimization objective of the hedging instrument combination is defined as:
[0088]
[0089] Among them, w f 、w o 、w cis the hedging weight of futures, options and carbon credit contracts, Δ f (t), Δ o (t), Δ c (t) represents the hedging effect of futures, options and carbon credit contracts;
[0090] The purpose of this optimization objective is to minimize the market risk exposure E(t) by adjusting the weights of hedging instruments. Different from the traditional static hedging strategy, a dynamic weight adjustment mechanism of hedging instruments is introduced;
[0091] The dynamic adjustment formula of the hedging tool is to ensure that the hedging strategy is adjusted in real time with market changes. The hedging weight w f (t), w o (t) and w c (t) The following update formula is used:
[0092]
[0093] Among them, α f , α o , α c is the learning rate parameter, It is the total loss function, which reflects the matching degree between risk exposure and hedging instrument combination.
[0094] Preferably, in step 5, a reinforcement learning method is introduced to perform adaptive evaluation and optimization of the strategy. Through reinforcement learning, the strategy can be adjusted in real time according to the simulation results, and the optimal power purchase and sales strategy can be adaptively learned according to different market scenarios;
[0095] The reinforcement learning framework for policy evaluation defines the policy evaluation problem as a Markov decision process, where the state s t Including market status, action a t is the current electricity purchase and sales strategy, and the return is r t The goal of strategy evaluation is to learn the optimal strategy to maximize the long-term cumulative benefits:
[0096]
[0097] Where γ is the discount factor;
[0098] The strategy update of reinforcement learning adopts the proximal strategy optimization algorithm to update the strategy, and the optimization goal is:
[0099]
[0100] Among them, r t (θ) is the ratio of the new and old strategies, A t is the advantage function.
[0101] Preferably, in step 6, in the process of dynamically adjusting the strategy, the linkage relationship between the electricity market, the natural gas market and the carbon market needs to be considered, and for this purpose, a dynamic adjustment mechanism of multi-market collaborative optimization is introduced;
[0102] Lagrange multiplier method for collaborative optimization. The collaborative optimization problem of multiple markets is solved by Lagrange multiplier method, and the objective function of each market is defined as f elec (x), f gas (y) and f carbon (z), and considering the coupling constraint between markets g(x,y,z)≤0, the Lagrangian function is:
[0103]
[0104] Where λ is the Lagrange multiplier;
[0105] Real-time coupling adjustment is to dynamically adjust the synergy between markets. The update of Lagrange multipliers adopts the following formula:
[0106] λ t+1 =λ t +α·g(x t ,y t ,z t ),
[0107] Among them, α is the step size parameter.
[0108] The present invention provides an optimization method for a retailer's electricity purchase and sales strategy taking into account bilateral transactions. It has the following beneficial effects:
[0109] 1. The present invention introduces a dynamic hedging strategy, combines traditional financial instruments with innovative hedging tools, can monitor market fluctuations in real time and automatically adjust hedging positions, and retailers can respond quickly under extreme market conditions, reduce market volatility risks, and significantly reduce overall risk exposure in cross-market transactions in the electricity, natural gas, and carbon markets, thereby protecting retailers' profits and improving their ability to resist risks in a volatile market environment.
[0110] 2. Through the collaborative optimization model of multi-market linkage, the present invention enables retailers to simultaneously optimize the resource allocation of electricity, natural gas and carbon trading markets, improve the resource utilization efficiency of each market, and reduce carbon emission costs under a collaborative trading strategy, ensuring that retailers obtain maximum profits in multiple markets while complying with environmental and sustainable development requirements.
[0111] 3. The present invention significantly improves the accuracy of demand forecasting through deep learning and multi-task learning combined with multi-source data. Retailers can make personalized response adjustments based on the price sensitivity of different users. The model can improve the prediction accuracy and optimize user load with a dynamic incentive mechanism, helping retailers to flexibly adjust electricity sales strategies at different time points to better meet user needs and improve overall operational efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0112] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0113] In order to make the technical personnel in the technical field understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in combination with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a partial embodiment of the present invention, not a complete embodiment. Based on the embodiment of the present invention, other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present invention.
[0114] The present invention is described in detail below in conjunction with the accompanying drawings:
[0115] Example:
[0116] Please see attached Figure 1 The embodiment of the present invention provides a method for optimizing a retailer's electricity purchase and sales strategy considering bilateral transactions, including the following steps: Step 1, data collection and processing:
[0117] Through the Internet of Things and big data technologies, multi-source data is collected in real time, and the original data is cleaned and denoised, and feature engineering technology is used to extract key features related to electricity demand and price fluctuations;
[0118] Step 2: Demand forecasting and response analysis:
[0119] Use deep learning models combined with multi-task learning to predict electricity demand for different user groups and time periods. Based on demand forecasting and combined with demand response mechanisms, analyze users’ responses to changes in electricity prices to simulate users’ behavioral economics models, predict load adjustment potential under different incentive mechanisms, and integrate them into electricity sales strategies.
[0120] Step 3: Cross-market collaborative optimization:
[0121] Establish a multi-objective collaborative optimization model for the electricity market, natural gas market, and carbon trading market, and use a distributed optimization algorithm to collaboratively optimize trading strategies across different markets;
[0122] Step 4: Dynamic risk hedging strategy:
[0123] Real-time monitoring of price fluctuations and demand changes in the electricity market through a big data platform, and the use of dynamic hedging strategies, combined with traditional financial instruments and innovative hedging tools, automatically triggers adjustments to hedging strategies in the event of extreme market fluctuations;
[0124] Step 5: Strategy simulation and evaluation:
[0125] Use Monte Carlo simulation to conduct scenario analysis on power purchase and sales strategies, test the performance of strategies under different market conditions, and evaluate the return and risk performance of strategies in extreme situations such as drastic market price fluctuations, demand changes, and supply chain disruptions, so as to adjust model parameters and strategies based on the results of sensitivity analysis;
[0126] Step 6: Optimize strategy implementation and dynamic adjustment:
[0127] Formulate specific power purchase and sales plans based on the results of demand forecasting, market collaborative optimization and risk hedging strategies, and implement power purchase and sales decisions through an automated system. When real-time market conditions change, the system automatically adjusts the power purchase and sales plans and hedging strategies, and regularly updates demand forecasting models and risk hedging models, optimizing model performance based on historical data feedback;
[0128] Step 7: Feedback and Optimization:
[0129] By analyzing historical trading data, evaluating the effectiveness of actual trading strategies, and feeding the results back into the model, we continuously optimize the forecast accuracy and hedging effect, and regularly upgrade and optimize multi-market linkage optimization models and algorithms in combination with market changes and technological development.
[0130] Benefits of data collection and processing: Ensure the timeliness and coverage of data, improve the accuracy and reliability of data, and improve the prediction ability and decision-making quality of the model; Benefits of demand forecasting and response analysis: Predict overall demand, distinguish the demand characteristics of different user groups and time periods, thereby improving prediction accuracy, achieving more accurate power distribution, and flexibly adjusting power sales strategies to improve operational efficiency; Benefits of cross-market collaborative optimization: Achieve the optimal balance among multiple markets, improve resource utilization efficiency in each market, reduce resource waste, reduce transaction costs, reduce carbon costs, comply with environmental protection policies, and enhance market competitiveness; Benefits of dynamic risk hedging strategy: Reduce risk exposure, protect retailers' profits, and the system can automatically trigger hedging adjustments to ensure effective risk management under adverse market conditions and enhance the breadth and depth of risk management; Benefits of strategy simulation and evaluation: Evaluate the performance of strategies under extreme conditions in advance to ensure the robustness of strategies; Benefits of optimized strategy implementation and dynamic adjustment: Reduce delays and errors in human intervention, and ensure rapid response and efficient execution of strategy implementation; Benefits of feedback and optimization: Enhance the adaptability and robustness of the system, maintain the forward-looking and competitiveness of the system, improve the execution effect of strategies, and provide retailers with continuous optimization decision support.
[0131] In step 1, the goal of data cleaning is to remove noise and fill missing values. Local weighted regression is a nonparametric regression method used to deal with noise and nonlinear trends in data. The local weighted regression formula is:
[0132] Among them, y i is the data value after local regression, w j (x i ) is the weight coefficient of the jth data point at the ith position, and the weight is determined by the weight function, the Gaussian kernel function:
[0133]
[0134] Among them, θ is a smoothing parameter that determines the weight window width of local regression;
[0135] In step 1, feature engineering extracts key features from high-dimensional data through principal component analysis. The basic step of principal component analysis is to project the data into a low-dimensional space by solving the eigenvalues and eigenvectors of the covariance matrix;
[0136] Given the original data matrix X, its covariance matrix is:
[0137] The eigenvalues λ1, λ2, ..., λ of the covariance matrix are obtained by eigendecomposition. n and its corresponding eigenvectors v1, v2, ..., v n ;
[0138] The eigenvectors corresponding to the first k largest eigenvalues constitute a new low-dimensional feature space;
[0139] The new low-dimensional feature matrix Z is: Z = X·V k ,
[0140] Among them, V k is the matrix consisting of the first k eigenvectors.
[0141] Local weighted regression achieves local smoothing of data by assigning different weights to each data point. It can effectively remove noise and capture nonlinear trends in the data. It is particularly effective for time series data with complex fluctuations and can provide more accurate predictions and analysis in local data areas.
[0142] Principal component analysis reduces dimensionality through feature decomposition, extracts the most important principal components in the data, reduces the dimensional complexity of the data, reduces noise, and retains some valid information. It is especially important for high-dimensional data, improves the efficiency of data processing, and significantly enhances the interpretability and computing performance of the model.
[0143] In step 1, the method for processing time series data is sliding window and autoregressive model;
[0144] Sliding window: In power demand forecasting, sliding windows are used to extract short-term trend features from time series data;
[0145] Given time series data The sliding window formula is:
[0146]
[0147] Where k is the window size, y t is the smoothed value after sliding the window;
[0148] Autoregressive model: used to predict future changes in electricity demand. The autoregressive model formula is:
[0149]
[0150] Among them, x t is the demand data at the moment, c is a constant term, φ i is the autoregressive coefficient, p is the lag order, ∈ t is the error term,
[0151] In step 1, in order to further optimize the data feature selection process, LASSO regression is used to determine the features that are strongly correlated with power demand fluctuations. The optimization problem formula of LASSO is:
[0152]
[0153] Among them, y i is the target variable, x i is the input feature vector, β is the regression coefficient, and λ is the regularization parameter used to control the sparsity of the model.
[0154] The sliding window method is used to smooth time series data, remove short-term noise, capture short-term trends, enhance the prediction stability of the model, and make the time series in power demand forecasting more predictable;
[0155] The autoregressive model can achieve short-term trend forecasting of electricity demand by capturing the impact of historical data on the moment. It is used for demand data with autocorrelation, so that the model can more accurately capture seasonal or cyclical changes in demand.
[0156] LASS0 regression effectively screens out features related to electricity demand fluctuations through sparsification and feature selection, avoids model overfitting, and improves the accuracy, simplicity, and interpretability of the prediction model.
[0157] In step 2, the electricity price-demand elasticity model is used based on the variational inference framework to capture the complex relationship between electricity demand and electricity price changes. The model algorithm formula is as follows:
[0158] Demand response is defined as a latent variable model, in which the user's electricity demand D(t) is determined by the latent variable z and the electricity price P(t):
[0159] D(t) = f(P(t), z) + ∈, where z is a latent variable describing the user behavior pattern, which conforms to a certain prior distribution P(z), and ∈ is a noise term, which follows a normal distribution.
[0160] The variational inference process is to calculate the posterior distribution of the latent variable z, that is, to approximate the true posterior distribution by fitting the variational distribution q(z), and the optimization goal is to minimize the variational free energy:
[0161]
[0162] where KL(q(z)||p(z)) is the KL divergence between the variational distribution q(z) and the prior distribution p(z), and [logp(D|P,z)] is the log-likelihood under the variational distribution.
[0163] The electricity price-demand elasticity model effectively combines the latent variable z of electricity price and user behavior pattern, captures the complex nonlinear relationship between electricity demand and electricity price changes, and takes into account the noise in the market, making the demand forecasting model closer to the actual market situation. The model can better explain the user's response to electricity price changes and provide more accurate electricity demand forecasts;
[0164] The variational inference framework optimizes the posterior distribution of the latent variable z by minimizing the variational free energy, avoiding the complexity of directly solving the posterior distribution. Variational inference has high computational efficiency when processing high-dimensional complex models, and can optimize the distribution of latent variables through KL divergence and log-likelihood. Ultimately, this method improves the model's inference ability and computational efficiency, allowing the model to quickly adapt to market changes and perform real-time predictions and adjustments.
[0165] Step 2: The electricity price incentive mechanism based on combinatorial optimization. In the process of demand response, the incentive mechanism is a factor that affects the user's load adjustment. In this paper, an incentive mechanism design model based on combinatorial optimization is proposed, which aims to maximize the user's load response through electricity price incentives. The utility function modeling formula of the user response is:
[0166] Define the user's utility function to describe the impact of electricity price incentive P(t) on load adjustment D(t):
[0167] U(D(t))=α·log(D(t))-β·P(t)-Y·C(t),
[0168] Among them, α, β and γ are parameters in the utility function, C(t) is the load adjustment cost of the user at time t;
[0169] Combination optimization problem of incentive mechanism,In order to maximize the total utility of user load adjustment, a combination optimization problem is proposed, the goal is to design the optimal electricity price incentive scheme for different time periods to maximize the total load response:
[0170] The constraints include:
[0171] Electricity price fluctuation limit: Electricity prices cannot fluctuate excessively to ensure market stability:
[0172] |P(t+1)-P(t)|≤ΔP max ,
[0173] Load adjustment restrictions: User load adjustment cannot exceed a reasonable range:
[0174] |P(t+1)-P(t)|≤ΔP max ,
[0175] Combinatorial optimization problems are solved by dynamic programming or genetic algorithms to maximize utility.
[0176] The user utility function helps understand the impact of electricity price incentives on user load response by modeling the relationship between electricity price, load adjustment and cost, and provides a basis for electricity price design;
[0177] The combinatorial optimization problem aims to maximize the total utility of user load adjustment through electricity price incentives, optimize the balance of electricity supply and demand, and improve system efficiency and profitability;
[0178] Constraints ensure smooth changes in electricity price incentives and a reasonable range of load adjustment, avoid market instability or damage to user experience, and ensure the sustainability of the electricity market;
[0179] Optimization solution methods such as dynamic programming and genetic algorithms help electricity retailers design flexible incentive schemes that meet actual needs and maximize user utility through efficient search and optimization methods.
[0180] In step 3, a dynamic multi-objective optimization method is introduced, combining distributed computing with a time-dependent decision model to coordinate the optimization of electricity, natural gas, and carbon markets.
[0181] Definition of multi-objective optimization problem: Define the optimization objective function to optimize the total benefit of each market at time t:
[0182] Among them, f1(x(t)) is the revenue function in the electricity market, x(t) is the transaction volume in the electricity market, f2(y(t)) is the cost function in the natural gas market, y(t) is the transaction volume in the natural gas market, f3(z(t)) is the carbon emission trading benefit in the carbon trading market, z(t) is the transaction volume in the carbon market;
[0183] Collaboration constraints: In cross-market collaborative optimization, it is necessary to consider the resource linkage and constraints between markets;
[0184] Energy coupling constraint: The linkage between the natural gas and electricity markets, the conversion of natural gas to electricity through gas-fired power generation: Pgas(t) = ηηconv·G(t),
[0185] Among them, P gas (t) is the amount of electricity generated by gas-fired power generation, G(t) is the natural gas consumption, η conv is the conversion efficiency;
[0186] Carbon emission limits: Transactions in electricity and gas markets need to comply with carbon emission limits:
[0187] C elec (t)+C gas (t)≤C max ,
[0188] Among them, C elec (t) and C gas (t) is the carbon emissions from electricity and natural gas markets, C max It is the upper limit of total carbon emissions;
[0189] Innovative target balancing mechanism: When there are conflicts in the target functions of different markets, a dynamic weight adjustment mechanism is introduced to balance the weights of different target functions:
[0190]
[0191] Among them, λ i (t) is the objective function f i The dynamic weight at time t is adjusted by the following formula:
[0192]
[0193] This formula adjusts the weight of each target through gradient ascent, and α is the step size parameter to ensure that the weight is adjusted dynamically.
[0194] The multi-objective optimization formula provides a unified framework to optimize the revenue, cost and benefit of each market in different markets at the same time. Through this method, the model can balance multiple objectives and achieve the global optimal benefit;
[0195] The collaborative constraints ensure the resource linkage and restriction conditions between the markets, which are energy coupling constraints and carbon emission restrictions, ensuring that the optimization plan is not only economically reasonable, but also meets the actual resource conversion efficiency and environmental protection requirements;
[0196] The dynamic weight adjustment mechanism resolves the conflicts between the objective functions of each market and ensures the dynamic adjustment of the global optimal solution by adaptively adjusting the weights of different objectives. This mechanism enhances the flexibility of the model and enables the model to dynamically respond to changes in market conditions.
[0197] In step 3, in order to cope with the complexity of the multi-market collaborative optimization problem, a distributed optimization algorithm is introduced, the alternating direction multiplier method to achieve independent decision-making in each market and maintain global coordination;
[0198] The multi-market optimization problem is decomposed through ADMM, each market optimizes its profit function independently, and then the solutions of each market are coordinated through global updates;
[0199] Define the local optimization objective function for the distributed problem:
[0200] Local issues in the electricity market:
[0201] Among them, z1(t) is the globally updated shared variable, and ρ is the penalty parameter;
[0202] Local issues in the natural gas market:
[0203] Local issues in the carbon market:
[0204] The solutions of each local market are coordinated with each other through the ADMM method, and the global variable z(t) is updated at each time step as follows: i (t+1)=z i (t)+ρ·(x(t)+y(t)+z(t)),
[0205] Through the updating steps, the independent solutions of the electricity, natural gas, and carbon markets are coordinated at each time step, so that the global objective function is gradually optimized.
[0206] The local optimization problem allows each market to optimize independently, reducing the complexity of multi-market collaborative optimization. Each market can focus on its own optimization goal and consider the constraints of other markets during each optimization. By introducing penalty terms, the local solution of each market is kept consistent with the global solution, ensuring that each market can independently solve its own optimal solution.
[0207] The independent solutions of each local market are coordinated through ADMM to ensure that at each time step, the local solution gradually converges to the global optimal solution. After each iteration, through the global variable update step, the solutions of the electricity, natural gas and carbon markets are collaboratively optimized to ensure that the system gradually tends to the optimal at the global level;
[0208] In multi-market collaborative optimization, the alternating direction multiplier method decomposes the complex multi-objective optimization problem into multiple local problems that need to be solved independently through distributed computing. Finally, the solutions of each market are coordinated through the global variable update step to achieve the global optimal solution. Through the global variable update step, the solutions between each market remain consistent, ensuring the final global collaborative optimal solution.
[0209] In step 4, in order to hedge the volatility of electricity, natural gas and carbon trading markets, a multi-market adaptive dynamic hedging model is proposed. This model uses machine learning methods and real-time market data to dynamically adjust the hedging strategy;
[0210] Adaptive risk measurement formula: Define the dynamic risk exposure of the market as E(t), which is a function of the volatility of the value of assets held in the electricity market, natural gas market, and carbon market. The specific form is:
[0211]
[0212] Among them, σ elec (t),σ gas (t),σ carbon (t) represents the volatility of the electricity, natural gas, and carbon markets at time t, β1, β2, and β3 are the risk sensitivities of the electricity, natural gas, and carbon markets;
[0213] Risk exposure E(t) is used to measure the risk exposure of total assets to current market volatility. Unlike static hedging, risk sensitivity β is dynamically adjusted and changes over time according to market volatility.
[0214] The hedging strategy minimizes risk exposure through a suitable combination of financial instruments. Assuming that futures, options and carbon credit contracts are used in the market, the optimization objective of the hedging instrument combination is defined as:
[0215]
[0216] Among them, w f 、w o 、w c is the hedging weight of futures, options and carbon credit contracts, Δ f (t), Δ o (t), Δ c (t) represents the hedging effect of futures, options and carbon credit contracts;
[0217] The purpose of this optimization objective is to minimize the market risk exposure E(t) by adjusting the weights of hedging instruments. Different from the traditional static hedging strategy, a dynamic weight adjustment mechanism of hedging instruments is introduced;
[0218] The dynamic adjustment formula of the hedging tool is to ensure that the hedging strategy is adjusted in real time with market changes. The hedging weight w f (t), w o (t) and w c (t) The following update formula is used:
[0219]
[0220] Among them, α f , α o , α c is the learning rate parameter, It is the total loss function, which reflects the matching degree between risk exposure and hedging instrument combination.
[0221] The adaptive risk measurement formula is used to measure the impact of asset volatility on total risk in the power, natural gas and carbon markets. Unlike static hedging, it can dynamically adjust the risk sensitivity β of each market and update risk exposure in real time according to market conditions, ensuring more flexible and effective risk management.
[0222] The hedging tool portfolio optimization objective formula minimizes the market risk exposure E(t) by combining different financial instruments and achieves comprehensive management of market risks by optimizing weights;
[0223] The dynamic adjustment formula of hedging tools ensures that the weights of hedging tools are adjusted in real time with market fluctuations and changes in risk exposure. Through learning rate and gradient ascent optimization, the system can automatically learn and optimize hedging strategies to ensure that the hedging tool portfolio maintains the best configuration in a dynamic market environment.
[0224] In step 5, the reinforcement learning method is introduced to perform adaptive evaluation and optimization of the strategy. Through reinforcement learning, the strategy can be adjusted in real time according to the simulation results, and the optimal power purchase and sales strategy can be adaptively learned according to different market scenarios;
[0225] The reinforcement learning framework for policy evaluation defines the policy evaluation problem as a Markov decision process, where the state s t Including market status, action a t is the current electricity purchase and sales strategy, and the return is r t The goal of strategy evaluation is to learn the optimal strategy to maximize the long-term cumulative benefits:
[0226]
[0227] Where γ is the discount factor;
[0228] The strategy update of reinforcement learning adopts the proximal strategy optimization algorithm to update the strategy, and the optimization goal is:
[0229]
[0230] Among them, r t (θ) is the ratio of the new and old strategies, A t is the advantage function.
[0231] The Markov decision process provides a structured framework for strategy evaluation by capturing the relationship between market states, actions, and returns. Markov decision can help the model optimize long-term returns and provide dynamic adaptability for the optimization of power purchase and sales strategies when market fluctuations and long-term impacts are taken into account;
[0232] The proximal strategy optimization algorithm provides a stable strategy update method, limits the range of strategy updates, ensures that the model can converge smoothly during the optimization process, and avoids excessive fluctuations. At the same time, through the strategy ratio and advantage function, the proximal strategy optimization can effectively evaluate the quality of the strategy and gradually improve the strategy, so that the model can cope with complex and changing market scenarios;
[0233] The key formulas and advantage functions in strategy updating ensure the balanced update between the old and new strategies, and guide the strategy to improve in the optimal direction through advantage evaluation. The combination of the two helps the reinforcement learning model to gradually optimize decisions, increase profits and reduce risks in the evaluation of power purchase and sales strategies.
[0234] In step 6, in the process of dynamic adjustment strategy, it is necessary to consider the linkage between the electricity market, natural gas market and carbon market. To this end, a dynamic adjustment mechanism of multi-market collaborative optimization is introduced;
[0235] Lagrange multiplier method for collaborative optimization. The collaborative optimization problem of multiple markets is solved by Lagrange multiplier method, and the objective function of each market is defined as f elec (x), f gas (y) and f carbon (z), and considering the coupling constraint between markets g(x,y,z)≤0, the Lagrangian function is:
[0236]
[0237] Where λ is the Lagrange multiplier;
[0238] Real-time coupling adjustment is to dynamically adjust the synergy between markets. The update of Lagrange multipliers adopts the following formula:
[0239] λ t+1 =λ t +α·g(xt ,y t ,z t ),
[0240] Among them, α is the step size parameter.
[0241] The Lagrangian function combines the independent optimization objective functions of multiple markets with the coupling constraints between markets by introducing Lagrangian multipliers, so that the coordinated optimization problems of electricity, natural gas and carbon markets can be solved in a unified way. This method simplifies the originally complex multi-objective optimization problem and ensures resource coordination and market linkage in the optimization process.
[0242] The real-time update formula of the Lagrange multiplier ensures that the collaborative relationship between markets can be dynamically adjusted as market conditions change. This formula controls the collaborative constraints between market objectives by gradually updating the Lagrange multiplier, allowing different markets to adjust their strategies at each time step and ultimately achieve the global optimal solution.
[0243] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for optimizing a retailer's electricity purchase and sales strategy considering bilateral transactions, characterized in that: The process includes the following steps: Step 1: Data collection and processing: Through the Internet of Things and big data technologies, multi-source data is collected in real time, and the original data is cleaned and denoised, and feature engineering technology is used to extract key features related to electricity demand and price fluctuations; Step 2: Demand forecasting and response analysis: Use deep learning models combined with multi-task learning to predict electricity demand for different user groups and time periods. Based on demand forecasting and combined with demand response mechanisms, analyze users’ responses to changes in electricity prices to simulate users’ behavioral economics models, predict load adjustment potential under different incentive mechanisms, and integrate them into electricity sales strategies. Step 3: Cross-market collaborative optimization: Establish a multi-objective collaborative optimization model for the electricity market, natural gas market, and carbon trading market, and use a distributed optimization algorithm to collaboratively optimize trading strategies across different markets; Step 4: Dynamic risk hedging strategy: Real-time monitoring of price fluctuations and demand changes in the electricity market through a big data platform, and the use of dynamic hedging strategies, combined with traditional financial instruments and innovative hedging tools, automatically triggers adjustments to hedging strategies in the event of extreme market fluctuations; Step 5: Strategy simulation and evaluation: Use Monte Carlo simulation to conduct scenario analysis on power purchase and sales strategies, test the performance of strategies under different market conditions, and evaluate the return and risk performance of strategies in extreme situations such as drastic market price fluctuations, demand changes, and supply chain disruptions, so as to adjust model parameters and strategies based on the results of sensitivity analysis; Step 6: Optimize strategy implementation and dynamic adjustment: Formulate specific power purchase and sales plans based on the results of demand forecasting, market collaborative optimization and risk hedging strategies, and implement power purchase and sales decisions through an automated system. When real-time market conditions change, the system automatically adjusts the power purchase and sales plans and hedging strategies, and regularly updates demand forecasting models and risk hedging models, optimizing model performance based on historical data feedback; Step 7: Feedback and Optimization: By analyzing historical trading data, evaluating the effectiveness of actual trading strategies, and feeding the results back into the model, we continuously optimize the forecast accuracy and hedging effect, and regularly upgrade and optimize multi-market linkage optimization models and algorithms in combination with market changes and technological development.
2. The optimization method of a retailer's electricity purchase and sales strategy considering bilateral transactions according to claim 1 is characterized in that: In step 1, the goal of data cleaning is to remove noise and fill missing values. Local weighted regression is a non-parametric regression method used to deal with noise and nonlinear trends in data. The local weighted regression formula is: Among them, y i is the data value after local regression, wj(x i ) is the weight coefficient of the jth data point at the ith position, and the weight is determined by the weight function, the Gaussian kernel function: Among them, θ is a smoothing parameter that determines the weight window width of local regression; In step 1, feature engineering extracts key features from high-dimensional data through principal component analysis. The basic step of principal component analysis is to project the data into a low-dimensional space by solving the eigenvalues and eigenvectors of the covariance matrix; Given the original data matrix X, its covariance matrix is: The eigenvalues λ1, λ2, ..., λ of the covariance matrix are obtained by eigendecomposition. n and its corresponding eigenvectors v1, v2, ..., v n ; The eigenvectors corresponding to the first k largest eigenvalues constitute a new low-dimensional feature space; The new low-dimensional feature matrix Z is: Z = X·V k , Among them, V k is the matrix consisting of the first k eigenvectors.
3. The optimization method of a retailer's electricity purchase and sales strategy considering bilateral transactions according to claim 1 is characterized in that: In step 1, the method for processing time series data is sliding window and autoregressive model; Sliding window: In power demand forecasting, sliding windows are used to extract short-term trend features from time series data; Given time series data The sliding window formula is: Among them, k is the window size, and yt is the smoothed value after sliding the window; Autoregressive model: used to predict future changes in electricity demand. The autoregressive model formula is: Among them, x t is the demand data at the moment, c is a constant term, φ i is the autoregressive coefficient, p is the lag order, ∈ t is the error term, In step 1, in order to further optimize the data feature selection process, LASS0 regression is used to determine the features that are strongly correlated with power demand fluctuations. The optimization problem formula of LASS0 is: Among them, y i is the target variable, x i is the input feature vector, β is the regression coefficient, and λ is the regularization parameter used to control the sparsity of the model.
4. The optimization method of a retailer's electricity purchase and sales strategy considering bilateral transactions according to claim 1 is characterized in that: In step 2, the electricity price-demand elasticity model is adopted based on the variational inference framework to capture the complex relationship between electricity demand and electricity price changes. The model algorithm formula is as follows: Demand response is defined as a latent variable model, in which the user's electricity demand D(t) is determined by the latent variable z and the electricity price P(t): D(t) = f(P(t), z) + ∈, where z is a latent variable describing the user behavior pattern, which conforms to a certain prior distribution P(z), and ∈ is a noise term, which follows a normal distribution. The variational inference process is to calculate the posterior distribution of the latent variable z, that is, to approximate the true posterior distribution by fitting the variational distribution q(z), and the optimization goal is to minimize the variational free energy: where KL(q(z)||p(z)) is the KL divergence between the variational distribution q(z) and the prior distribution p(z), and [logp(D|P,z)] is the log-likelihood under the variational distribution.
5. The optimization method of a retailer's electricity purchase and sales strategy considering bilateral transactions according to claim 1 is characterized in that: The step 2 is based on the electricity price incentive mechanism of combinatorial optimization. In the process of demand response, the incentive mechanism is a factor that affects the user's load adjustment. In order to propose an incentive mechanism design model based on combinatorial optimization, it aims to maximize the user's load response through electricity price incentives. The utility function modeling formula of the user response is: Define the user's utility function to describe the impact of electricity price incentive P(t) on load adjustment D(t): U(D(t))=α·log(D(t))-β·P(t)-γ·C(t), Among them, α, β and γ are parameters in the utility function, C(t) is the load adjustment cost of the user at time t; Combination optimization problem of incentive mechanism,In order to maximize the total utility of user load adjustment, a combination optimization problem is proposed, the goal is to design the optimal electricity price incentive scheme for different time periods to maximize the total load response: The constraints include: Electricity price fluctuation limit: Electricity prices cannot fluctuate excessively to ensure market stability: |P(t+1)-P(t)|≤ΔP max , Load adjustment restrictions: User load adjustment cannot exceed a reasonable range: |P(t+1)-P(t)|≤ΔP max , Combinatorial optimization problems are solved by dynamic programming or genetic algorithms to maximize utility.
6. The optimization method of a retailer's electricity purchase and sales strategy considering bilateral transactions according to claim 1 is characterized in that: In step 3, a dynamic multi-objective optimization method is introduced, and distributed computing is combined with a time-dependent decision model to perform coordinated optimization of the electricity, natural gas and carbon markets. Definition of multi-objective optimization problem: Define the optimization objective function to optimize the total benefit of each market at time t: Among them, f1(x(t)) is the revenue function in the electricity market, x(t) is the transaction volume in the electricity market, f2(y(t)) is the cost function in the natural gas market, y(t) is the transaction volume in the natural gas market, f3(z(t)) is the carbon emission trading benefit in the carbon trading market, z(t) is the transaction volume in the carbon market; Collaboration constraints: In cross-market collaborative optimization, it is necessary to consider the resource linkage and constraints between markets; Energy coupling constraints: the linkage between natural gas and electricity markets, and the conversion of natural gas to electricity through gas-fired power generation: P gas (t) = η conv G(t), Among them, P gas (t) is the amount of electricity generated by gas-fired power generation, G(t) is the natural gas consumption, η conv is the conversion efficiency; Carbon emission limits: Transactions in electricity and gas markets need to comply with carbon emission limits: C elec (t)+C gas (t)≤C max , Among them, C elec (t) and C gas (t) is the carbon emissions from electricity and natural gas markets, C max It is the upper limit of total carbon emissions; Innovative target balancing mechanism: When there are conflicts in the target functions of different markets, a dynamic weight adjustment mechanism is introduced to balance the weights of different target functions: Among them, λ i (t) is the objective function f i The dynamic weight at time t is adjusted by the following formula: This formula adjusts the weight of each target through gradient ascent, and α is the step size parameter to ensure that the weight is adjusted dynamically.
7. The optimization method of a retailer's electricity purchase and sales strategy considering bilateral transactions according to claim 1 is characterized in that: In step 3, in order to cope with the complexity of the multi-market collaborative optimization problem, a distributed optimization algorithm is introduced, and the alternating direction multiplier method is used to achieve independent decision-making in each market and maintain global coordination; The multi-market optimization problem is decomposed through ADMM, each market optimizes its profit function independently, and then the solutions of each market are coordinated through global updates; Define the local optimization objective function for the distributed problem: Local issues in the electricity market: Among them, z1(t) is the globally updated shared variable, and ρ is the penalty parameter; Local issues in the natural gas market: Local issues in the carbon market: The solutions of each local market are coordinated with each other through the ADMM method, and the global variable z(t) is updated at each time step as follows: i (t+1)=z i (t)+ρ·(x(t)+y(t)+z(t)), Through the updating steps, the independent solutions of the electricity, natural gas, and carbon markets are coordinated at each time step, so that the global objective function is gradually optimized.
8. The optimization method of a retailer's electricity purchase and sales strategy considering bilateral transactions according to claim 1 is characterized in that: In step 4, in order to hedge the risk in the volatility of electricity, natural gas and carbon trading markets, a multi-market adaptive dynamic hedging model is proposed. The model dynamically adjusts the hedging strategy by combining real-time market data through machine learning methods; Adaptive risk measurement formula: Define the dynamic risk exposure of the market as E(t), which is a function of the volatility of the value of assets held in the electricity market, natural gas market, and carbon market. The specific form is: Among them, σ elec (t),σ gas (t),σ carbon (t) represents the volatility of the electricity, natural gas, and carbon markets at time t, β1, β2, and β3 are the risk sensitivities of the electricity, natural gas, and carbon markets; Risk exposure E(t) is used to measure the risk exposure of total assets to current market volatility. Unlike static hedging, risk sensitivity β is dynamically adjusted and changes over time according to market volatility. The hedging strategy minimizes risk exposure through a suitable combination of financial instruments. Assuming that futures, options and carbon credit contracts are used in the market, the optimization objective of the hedging instrument combination is defined as: Among them, w f 、w o 、w c is the hedging weight of futures, options and carbon credit contracts, Δ f (t), Δ o (t), Δ c (t) represents the hedging effect of futures, options and carbon credit contracts; The purpose of this optimization objective is to minimize the market risk exposure E(t) by adjusting the weights of hedging instruments. Different from the traditional static hedging strategy, a dynamic weight adjustment mechanism of hedging instruments is introduced; The dynamic adjustment formula of the hedging tool is to ensure that the hedging strategy is adjusted in real time with market changes. The hedging weight w f (t), w o (t) and w c (t) The following update formula is used: Among them, α f , α o , α c is the learning rate parameter, It is the total loss function, which reflects the matching degree between risk exposure and hedging instrument combination.
9. The optimization method of a retailer's electricity purchase and sales strategy considering bilateral transactions according to claim 1, characterized in that: In step 5, a reinforcement learning method is introduced to perform adaptive evaluation and optimization of the strategy. Through reinforcement learning, the strategy can be adjusted in real time according to the simulation results, and the optimal power purchase and sales strategy can be adaptively learned according to different market scenarios; The reinforcement learning framework for policy evaluation defines the policy evaluation problem as a Markov decision process, where the state s t Including market status, action a t is the current electricity purchase and sales strategy, and the return is r t The goal of strategy evaluation is to learn the optimal strategy to maximize the long-term cumulative benefits: Where γ is the discount factor; The strategy update of reinforcement learning adopts the proximal strategy optimization algorithm to update the strategy, and the optimization goal is: Among them, r t (θ) is the ratio of the new and old strategies, A t is the advantage function.
10. The optimization method of a retailer's electricity purchase and sales strategy considering bilateral transactions according to claim 1, characterized in that: In step 6, in the process of dynamic adjustment strategy, it is necessary to consider the linkage relationship between the electricity market, the natural gas market and the carbon market. To this end, a dynamic adjustment mechanism of multi-market collaborative optimization is introduced; Lagrange multiplier method for collaborative optimization. The collaborative optimization problem of multiple markets is solved by Lagrange multiplier method, and the objective function of each market is defined as f elec (x), f gas (y) and f carbon (z), and considering the coupling constraint between markets g(x, y, z)≤0, the Lagrangian function is: Where λ is the Lagrange multiplier; Real-time coupling adjustment To dynamically adjust the synergy between markets, the Lagrange multiplier is updated using the following formula: t+1 =λ t +α·g(x t ,y t , z t ), where α is the step size parameter.
