Multi-time scale power market risk perception and load regulation system based on large language model

CN123032154APending Publication Date: 2026-11-03FUJIAN FUYAO UNIVERSITY OF SCIENCE & TECHNOLOGY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611161547.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-03
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

本发明实现了语义感知与物理调控的深度融合,有效解决了纯数据驱动方法的语义盲视、冷启动低效及安全风险失控等问题,为电力市场环境下的安全高效负荷调控提供了技术支撑

Benefits of technology

[0024]相比于现有技术,本发明及其优选方案实现了非结构化外生信息的有效利用与语义降维,解决了传统强化学习方法无法处理文本类高影响外生数据的语义盲视问题;通过先验条件化元学习机制显著提升了决策模型的收敛速度与非平稳环境适应能力,有效克服了冷启动难题;构建了多层次物理安全防护体系,将抽象的风险约束转化为可执行的物理调节指令,为大语言模型应用提供了刚性故障安全保障,避免了数学幻觉引发的电网运行风险;实现了多时间尺度交易决策与负荷调控的协同优化,在保障电网安全稳定运行的前提下提升了能源资源配置效率;系统采用模块化分层设计,各模块间通过标准化接口交互,具有良好的可扩展性与工程实用性,可广泛适配不同规模与类型的电力市场应用场景。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123032154A_ABST
    Figure CN123032154A_ABST
Patent Text Reader

Abstract

The application provides a multi-time scale power market risk perception and load regulation system based on a large language model, comprising: a semantic perception module for acquiring power market unstructured text data, extracting directional prior signals representing power supply and demand macro situation through a pre-trained large language model; a safe decision-making module for decoupling aggregated power load into a non-adjustable rigid production scale load and an adjustable flexible response scale load, initializing a multi-agent reinforcement learning strategy network through task embedding; under physical capacity constraints, solving a constraint optimization problem with physical safety boundaries through the strategy network, generating power transaction auxiliary decision-making and physical regulation instructions directly acting on the flexible response scale load; an execution and feedback module for executing the power transaction auxiliary decision-making and the physical regulation instructions, controlling the real-time deviation power of the aggregated load within the safety tolerance range allowed by the power grid dispatching by adjusting the power consumption of the flexible response scale load.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary technical fields of power market transaction optimization, artificial intelligence and power system safe operation, and specifically involves a multi-timescale power market risk perception and load control system based on a large language model. Background Technology

[0002] Against the backdrop of deregulation in the power sector and accelerated integration of renewable energy, the electricity market is undergoing a transformation into a highly dynamic, multi-timescale market. Market intermediaries such as electricity retailers and load aggregators play a crucial role in enhancing market liquidity and facilitating the absorption of intermittent renewable energy. To optimize their energy allocation, these intermediaries must operate within a complex sequential trading process, encompassing medium- to long-term contracts, intraday continuous trading, and day-to-day to real-time spot markets. Market decisions at different timescales are irreversibly coupled; the basic positions and costs determined during the medium- to long-term and intraday trading phases are directly transmitted to the spot market. Suboptimal early decisions can lead to significant unhedged exposures, forcing intermediaries to trade passively under unfavorable day-to-day or real-time prices. Traditional mathematical programming methods, such as stochastic programming and robust optimization, are plagued by the curse of dimensionality and computational latency, and are inherently unsuitable for the high-frequency, millisecond-level limit order execution required by intraday continuous bilateral auction mechanisms.

[0003] In the spot market, intermediaries face dual uncertainties from extreme price fluctuations and physical grid conditions such as actual load and renewable energy output. Sudden load spikes or forecasting errors can lead to severe price inversions, where real-time prices significantly exceed day-ahead prices. Traditional risk-neutral optimization models are extremely vulnerable to these nonlinear price jumps, often resulting in catastrophic grid frequency overruns and voltage quality degradation during tail-risk events. Existing methods typically rely on the static probability distribution of uncertain variables, failing to capture extreme nonstationarities caused by sudden weather anomalies or changes in market policies.

[0004] To overcome the computational bottlenecks of traditional solvers, deep reinforcement learning and multi-agent reinforcement learning have become the mainstream paradigms for dynamic pricing and bidding. However, these purely data-driven paradigms suffer from three key vulnerabilities. First, there is semantic blindness and feature overfitting. Reinforcement learning agents are inherently unable to handle unstructured, high-impact exogenous data such as text weather alerts or regulatory announcements. Directly embedding high-dimensional semantic data into reinforcement learning networks introduces nonlinear mappings with extremely low signal-to-noise ratios, causing the agent to either completely ignore key textual features or suffer from severe overfitting. Second, there is the vulnerability to tail risk and sparse events. Standard reinforcement learning agents optimize expected cumulative rewards without strict mathematical safety boundaries. During sudden long-tail anomalies, the lack of physical boundaries can lead to overly aggressive exploratory actions, triggering huge bias penalties. Furthermore, extreme events are inherently sparse, depriving reinforcement learning algorithms of the large number of trial-and-error samples needed to learn safe and effective responses. Finally, there is the issue of catastrophic forgetting and non-stationarity. Algorithms trained primarily on historical numerical data struggle to adapt to constantly evolving environments and cannot generalize across different seasonal variations or policy-driven market distributions, making them highly susceptible to market non-stationarity and performance degradation over time.

[0005] The emergence of large language models has introduced unprecedented capabilities to zero-shot reasoning and natural language processing, and has been explored for applications such as fault diagnosis and even autonomous trading agents in the energy sector. However, directly deploying large language models for market execution carries significant risks. While large language models excel at macroscopic semantic extraction, they are prone to mathematical illusions and fundamentally lack the mathematical rigor required for high-frequency continuous control. Large language models acting alone cannot strictly adhere to hard physical boundaries such as the exact capacity limits of response-scale loads, nor can they guarantee compliance with conditional value-at-risk thresholds to avoid catastrophic grid operation failures.

[0006] Current research largely focuses on improving single technical aspects: some studies only address the constraint guarantees of traditional mathematical programming but lack semantic adaptability; some studies only achieve high-frequency execution of pure data-driven reinforcement learning but lack safety boundaries and semantic awareness; and some studies only explore macroscopic reasoning of large language models but lack mathematical safety and micro-execution speed. There is a lack of a comprehensive collaborative optimization scheme that integrates semantic awareness, risk modeling, safety decision-making, and execution feedback across the entire process. In summary, existing technologies struggle to solve key problems in multi-timescale electricity market transactions, such as the lack of semantic awareness, inefficient cold start, uncontrolled safety risks, and poor non-stationar adaptation. Summary of the Invention

[0007] To address the shortcomings and deficiencies of existing technologies, this invention provides a multi-timescale power market risk perception and load control system based on a large language model. The system acquires unstructured textual data of the power market through a semantic perception module, extracting directional prior signals characterizing the macro-level power supply and demand situation. A security decision-making module decouples aggregated power loads into non-adjustable rigid production-scale loads and adjustable flexible response-scale loads. Based on conditional risk value, a physical safety boundary for grid operation is constructed. A meta-learning framework is used to integrate directional prior signals and historical operating trajectories to generate tasks and initialize a multi-agent reinforcement learning strategy network. Under physical capacity constraints, a constrained optimization problem with a safety boundary is solved, generating power trading auxiliary decisions and physical control commands that directly affect flexible response-scale loads. A Lagrange relaxation mechanism maps risk constraints to physical control boundaries. An execution and feedback module executes the commands and controls the real-time deviation of aggregated loads within the safety tolerance range allowed by grid dispatch. This invention achieves deep integration of semantic perception and physical control, effectively solving problems such as semantic blindness, inefficiency of cold starts, and uncontrolled safety risks inherent in purely data-driven methods, providing technical support for safe and efficient load control in the power market environment.

[0008] The specific technical solution adopted by this invention to solve its technical problem is as follows:

[0009] This invention provides a multi-timescale power market risk perception and load control system based on a large language model, aiming to solve the problems of missing semantic perception, uncontrolled security risks, slow cold start of decision-making models, and difficulty in adapting to non-stationary market environments in existing technologies. The system achieves closed-loop control from macro-level situation understanding to security physical control through the collaborative work of a semantic perception module, a security decision-making module, and an execution and feedback module.

[0010] The semantic perception module acquires unstructured text data such as weather warnings, regulatory announcements, and market news from the electricity market. It performs deep semantic parsing of the text using a pre-trained large language model to extract directional prior signals characterizing the macro-level power supply and demand situation. These directional prior signals quantitatively reflect the macro-level tendency for power supply to be tight or abundant in the short term, providing high-level trend guidance for subsequent decision-making. The key concept of this design is to allow the large language model to leverage its macro-level semantic reasoning advantages while avoiding the potential for illusions arising from precise numerical calculations. By injecting only low-dimensional, continuous directional signals into the decision loop, rather than having the large language model directly generate numerical control commands, the overfitting and misjudgment problems caused by directly embedding high-dimensional, unstructured text noise into the control loop are fundamentally avoided.

[0011] The safety decision-making module is the core of the system's decision-making process, responsible for generating optimal decisions within strict safety boundaries. This module first decouples aggregated power loads into two categories at the physical level: one is rigid, non-adjustable production-scale loads such as those required for basic industrial production; the other is flexible, adjustable-scale loads such as HVAC systems and partial energy storage, which can be temporarily increased or decreased. To further quantify extreme tail risks, the module constructs a physical safety boundary for grid operation based on conditional value-at-risk theory. This boundary defines the maximum deviation risk the system can withstand under extreme market conditions.

[0012] To effectively integrate macro-level semantic insights with micro-level market data, the module employs a meta-learning framework. First, the directional prior signals provided by the semantic perception module are deeply fused with the historical operating trajectory of the electricity market (including time-series data such as prices and loads) to generate a task embedding representation rich in current market task characteristics. Then, this task embedding is used to directly initialize a multi-agent reinforcement learning policy network. This allows the reinforcement learning agents to quickly adapt to the current market context without starting from scratch when entering new market conditions, significantly improving cold-start efficiency and effectively overcoming the catastrophic forgetting problem in non-stationary environments.

[0013] During decision generation, the policy network solves a constrained optimization problem with physical safety boundaries under physical capacity constraints. This problem aims to simultaneously optimize trading revenue and regulation costs, outputting two types of decision information: first, auxiliary decisions for electricity trading to guide electricity buying and selling in markets at various time scales; and second, physical regulation commands directly issued to load control terminals to adjust the power consumption of flexible loads. To ensure that no optimization action exceeds safety limits, this constrained optimization problem introduces a Lagrange relaxation mechanism. This mechanism cleverly maps the global, statistically significant conditional value-at-risk constraint to the specific physical regulation boundaries of each or each group of flexible response-scale loads at the current moment. It transforms the abstract financial risk limit into a hard physical range constraint that the policy network can directly understand and execute, thus ensuring a balance between safety and efficiency.

[0014] The execution and feedback module is responsible for implementing the instructions generated by the security decision-making module. It submits power trading auxiliary decisions to the power trading platform and simultaneously issues physical control instructions to each controllable load unit. By continuously and precisely adjusting the power consumption of flexibly responsive loads, the module's direct technical effect is to continuously and reliably control the deviation between the real-time total power consumption of the entire load aggregate and the traded power consumption within the safety tolerance range allowed by the power grid dispatching agency. The module also collects and transmits back market clearing results and actual load response data after instruction execution, forming a data feedback closed loop for updating the historical database and continuously optimizing model parameters.

[0015] In a more preferred embodiment, to further enhance the system's ability to discriminate and weigh heterogeneous information sources, the semantic perception module outputs a priori confidence score, representing the certainty level of the priori signal, simultaneously while outputting the directional prior signal. During the subsequent task embedding process generated via the meta-learning framework, the system dynamically adjusts the fusion weights of the directional prior signal based on this confidence score; the higher the confidence score, the greater the corresponding signal weight. This mechanism endows the system with the ability to discern semantic reliability in real-world scenarios with varying information quality or noise, effectively reducing the misleading influence of low-quality or ambiguous textual information on subsequent decisions, thereby significantly improving the robustness of decision-making.

[0016] In another, more preferred embodiment, to construct a security defense line at both the physical device and system access levels, the security decision module establishes a dual physical security boundary. The first boundary is the inherent upper and lower limit capacity constraint of the power regulation of each individual customer's adjustable and flexible response load; the second boundary is the constraint that the total power of the entire load aggregate (including all rigid and flexible loads) must not exceed the total power limit constraint of the physical transmission limit at the grid access point. Any physical control command output by the policy network must be verified under these two boundaries. Any adjustment action attempting to exceed the boundary range will be forcibly clipped to the boundary value, thereby eliminating any possible risk of exceeding the limit at the hardware command level and ensuring that the core security of grid operation is not interfered with by the exploratory actions of intelligent algorithms.

[0017] In another, more preferred embodiment, to achieve optimal integration of multi-source information under different levels of market volatility, the process of generating the task embedding by the security decision module is further refined. First, a cyclic historical encoder performs time-series processing on the historical operating trajectory of the electricity market to extract a potential physical context vector containing the dynamic evolution patterns and physical constraints of the market. Then, instead of simple concatenation, a gated multilayer perceptron adaptively cascades and fuses this potential physical context vector with directional prior signals. The core function of this gated network is that it can learn end-to-end and automatically adjust the fusion ratio of semantic and numerical information in the final task embedding based on the volatility of the current market data. When the market is relatively stable, the model tends to assign higher weights to historical data to maintain policy consistency; while when the market experiences structural changes or drastic fluctuations, the model automatically increases its dependence on directional prior signals to quickly capture turning points brought about by policy or weather changes, ensuring that the task embedding maintains high-quality representation under different market systems.

[0018] In another preferred embodiment, to effectively address the credit allocation challenge in multi-agent collaborative regulation scenarios, the multi-agent reinforcement learning policy network employs a dual-delay deep deterministic policy gradient architecture, with a multi-head self-attention module based on the Transformer architecture embedded within its critic network. This module is specifically designed to automatically analyze and allocate weights to the differentiated contributions of different client agents in collaborative load regulation, quantifying the specific impact of each agent's chosen regulatory action on the global common reward (e.g., minimizing total bias, maximizing total gain). By explicitly modeling the interactions and contribution differences among multiple agents, this mechanism significantly improves the learning efficiency and final regulatory fairness of the collaborative policy, avoiding the problem of individual clients with strong regulatory capabilities but large contributions being treated equally in credit allocation.

[0019] In another, more preferred embodiment, the Lagrange relaxation mechanism employed by the safety decision module is based on defining a dynamically updated Lagrange multiplier. This multiplier combines the conditional risk value constraint, representing tail risk, with the original economic reward function to construct an enhanced reward function. This Lagrange multiplier is not a fixed constant but a dynamic variable that responds to system risk in real time. It dynamically adjusts based on the deviation of the system's real-time deviation penalty from the physical safety boundary threshold. When the real-time deviation penalty increases and exceeds the safety threshold, it indicates that the system is approaching or has already entered a dangerous operating zone. At this point, the Lagrange multiplier automatically increases, significantly strengthening the penalty term in the enhanced reward function, forcibly shrinking the adjustment actions output by the policy network, which act on the flexible response scale load, back into the safe physical envelope. This mechanism achieves a dynamic balance effect: relaxing constraints to pursue efficiency when safety margins are ample, and tightening constraints to ensure safety when risks approach.

[0020] As a more sophisticated design, the Lagrange multiplier is further designed as a direct quantitative mapping index of the real-time supply and demand balance of the power grid. The magnitude of the multiplier is given a clear physical meaning: when the Lagrange multiplier increases, it physically indicates that the real-time supply and demand imbalance of the power grid is intensifying, and the security risk is increasing. Under this mapping relationship, driven by the enhanced reward function, the policy network will naturally tend to prioritize outputting physical control commands that reduce the load adjustment amplitude of flexible response scale, or even force the total power consumption of aggregated loads to be pushed back to their base load level. This design establishes a transparent and intuitive causal relationship between the abstract mathematical variables inside the algorithm and the actual physical security state of the power grid, making the conservative decisions of the agent clearly interpretable and avoiding the black-box decision-making risks common in complex models.

[0021] In another, more preferred embodiment, to obtain a stable and robust centralized policy, the multi-agent reinforcement learning policy network adopts a paradigm of centralized training and decentralized execution during the training phase. This paradigm sets up two structurally identical dual-centralized critic networks to provide more stable and accurate action value evaluation signals. To alleviate the problem of value overestimation that is prevalent in continuous action space, two key technologies are introduced into the training process: first, a target policy smoothing mechanism, which adds a truncated normal noise to the target action when calculating the target value to smooth the value estimation surface; second, a delayed update mechanism, which updates the parameters of the executor network at a preset step frequency much lower than that of the critic network. The combination of these two technologies can significantly suppress the solidification of suboptimal policies caused by value overestimation, greatly improving the stability of training and the generalization ability of the final policy.

[0022] In another, more preferred implementation, to accurately match the crucial characteristics of sequential trading and irreversible decisions in the multi-timescale electricity market, a progressive constraint mechanism is constructed within the security decision module. This mechanism simulates the actual operational logic of market participants: the base electricity positions locked in through medium- and long-term contracts constitute the hard boundaries that must be strictly adhered to when making continuous trading decisions within the month; the positions finally determined after the end of the month's trading further constitute the constraints that must be considered in the day-ahead spot market reporting strategy; and the electricity consumption plan curve formed after the day-ahead market clearing ultimately serves as a benchmark to strictly constrain load adjustment actions during the real-time operation phase. Decisions at different time scales form an irreversible coupled constraint chain in time through this progressive and sequential transmission, ensuring that every decision, from long-term planning to high-frequency instantaneous adjustments, is strictly embedded within the physical and financial commitments established in the previous stage. This fundamentally avoids the risk of subsequent stages being exposed to huge unhedged exposures due to errors in early decisions, and improves the consistency of risk management across all time scales.

[0023] Furthermore, this invention also provides a power market load regulation method based on semantic perception and secure multi-agent reinforcement learning. This method corresponds to the operation process of the aforementioned system and specifically includes the following steps: First, acquire unstructured text data of the power market, and extract directional prior signals representing the macro-level situation of power supply and demand through a pre-trained large language model. During this process, the large language model is strictly limited to providing only directional guidance of the macro-level situation and never directly generating any numerical control commands. Second, decouple the aggregated power load into non-adjustable rigid production-scale load and adjustable flexible response-scale load, and construct the physical safety boundary of power grid operation based on conditional value-at-risk theory. Then, adopt a meta-learning framework to integrate the aforementioned obtained data with the power market load. This method deeply integrates directional prior signals with historical operating trajectories of the electricity market to generate a task embedding, which is then used to initialize a multi-agent reinforcement learning policy network. Next, under physical capacity constraints, the initialized policy network solves a constrained optimization problem with a physical safety boundary. This safety boundary is dynamically mapped to a specific physical adjustment boundary for flexible-response-scale loads using a Lagrange relaxation mechanism, ultimately generating electricity trading auxiliary decisions and physical control instructions that directly affect the load. Finally, the generated decisions and instructions are executed, and by adjusting the power consumption of flexible-response-scale loads in real time, the real-time total deviation of aggregated loads is precisely controlled within the safety tolerance range allowed by grid dispatch. This method unifies macroscopic semantic understanding, tail risk modeling, multi-timescale coordinated optimization, and safety enforcement into an end-to-end automated process, providing a novel solution for electricity market regulation under high uncertainty that combines theoretical rigor with practical reliability.

[0024] Compared to existing technologies, this invention and its preferred solutions achieve effective utilization and semantic dimensionality reduction of unstructured exogenous information, solving the semantic blindness problem that traditional reinforcement learning methods cannot handle high-impact exogenous text data. Through a priori conditional meta-learning mechanism, the convergence speed and adaptability to non-stationary environments of the decision-making model are significantly improved, effectively overcoming the cold-start problem. A multi-layered physical security protection system is constructed, transforming abstract risk constraints into executable physical adjustment instructions, providing rigid fault safety guarantees for large language model applications and avoiding power grid operation risks caused by mathematical illusions. Collaborative optimization of multi-timescale trading decisions and load regulation is achieved, improving energy resource allocation efficiency while ensuring the safe and stable operation of the power grid. The system adopts a modular, layered design, with standardized interfaces between modules, exhibiting good scalability and engineering practicality, and can be widely adapted to different scales and types of power market application scenarios. Attached Figure Description

[0025] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:

[0026] Figure 1 This is a diagram illustrating the architecture of a multi-timescale power trading system according to an embodiment of the present invention.

[0027] Figure 2 The four-layer architecture diagram of the meta-security MATD3 enabled by LLM in this embodiment of the invention;

[0028] Figure 3 This is a diagram illustrating the semantic feature extraction mechanism in an embodiment of the present invention.

[0029] Figure 4 Execution framework diagram of the meta-safe MATD3 algorithm enabled by LLM in this embodiment of the invention;

[0030] Figure 5 This is a comparison chart of the training performance of the algorithms in the embodiments of the present invention;

[0031] Figure 6 This is a sensitivity analysis diagram of the conditional value at risk threshold in an embodiment of the present invention;

[0032] Figure 7 The diagram shows the safety test results for the illusion of the large language model in an embodiment of the present invention. In the diagram, (a) is the comparison curve of real-time transaction execution volume, (b) is the Lagrange multiplier change curve, and (c) is the comparison curve of cumulative deviation penalty.

[0033] Figure 8 The figure shows the system response effect under extreme fluctuations in an embodiment of the present invention. In the figure, (a) is the day-ahead and real-time price curve, (b) is the aggregated real-time deviation power curve, (c) is the cumulative deviation penalty and CVaR boundary comparison curve, and (d) is the daily arbitrage profit comparison curve. Detailed Implementation

[0034] To make the features and advantages of the present invention more apparent and understandable, specific embodiments are described below in detail:

[0035] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0036] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0037] This invention addresses the temporal coupling, execution risks, and tail risks arising from the transformation of the multi-timescale electricity market under the background of deregulation in the power industry and accelerated integration of renewable energy, as well as the technical bottlenecks of existing technologies such as semantic blindness, inefficient cold start, uncontrolled tail risks, and poor non-stationarity and adaptation. It combines large language model semantic extraction, meta-learning, and secure multi-agent reinforcement learning algorithms to construct a four-level core architecture: an unstructured exogenous data semantic perception module, a multi-timescale transaction and risk control modeling module, a large language model-enabled meta-secure multi-agent reinforcement learning decision-making module, and an execution and feedback closed-loop module. This forms a closed-loop management system covering the entire process from semantic perception to risk modeling, security decision-making, and execution feedback, achieving multi-timescale transaction collaborative optimization and grid security boundary coordination. It provides core technical support for intelligent, safe, and efficient energy management for power market intermediaries and can be widely applied to energy management systems of various power trading participants, such as regional power markets, virtual power plants, and load aggregators.

[0038] This solution first utilizes a large language model to extract low-dimensional, mathematically commensurable directional priors from unstructured exogenous text data, addressing the semantic blindness problem of pure multi-agent reinforcement learning while avoiding the mathematical illusions arising from the direct involvement of large language models in numerical control. Second, it constructs a multi-timescale trading and risk control mathematical model based on conditional value of risk, decoupling downstream demand into rigid production-scale load and flexible response-scale load, quantifying the physical safety boundary of grid operation. Third, it designs a priori conditional meta-learning framework, using directional priors to quickly locate optimal initial network parameters, enabling the decision model to overcome the cold-start problem and dynamically adapt to sudden changes in market distribution at different time scales. Finally, it proposes a secure multi-agent dual-delay deep deterministic policy gradient micro-execution engine, introducing conditional value of risk constraints through Lagrange relaxation, transforming the abstract mathematical risk boundary into physical adjustment commands for response-scale load, ensuring that aggregated real-time deviation power always meets grid dispatch tolerance requirements, and preventing grid frequency exceedances and voltage quality degradation caused by load control inaccuracies.

[0039] The overall architecture of this solution is as follows: Figure 1 As shown, the modules interact and transmit instructions through standardized data interfaces. The unstructured exogenous data semantic perception module collects and parses multi-dimensional text data and outputs directional priors; the multi-timescale trading and risk control modeling module constructs trading models and risk boundaries and transmits them to the decision-making module; the decision-making module generates trading decisions and load control instructions and transmits them to the execution unit; the execution unit issues instructions to the market trading end and the physical load control end, the feedback unit collects the execution results and evaluates the effectiveness, and finally feeds the data back to the power market big data platform to achieve closed-loop management.

[0040] The system architecture for multi-timescale power trading provided by this invention divides the market into two major trading phases: the medium- and long-term (annual, monthly, intra-month) market and the day-ahead and real-time spot market. The core processes of each phase include: in the medium- and long-term phase, the base electricity volume and price are locked in through annual and monthly declarations; in the intra-month phase, the position is dynamically adjusted through continuous bilateral auctions; in the day-ahead phase, the 96-point curve declaration and clearing are completed; and in the real-time phase, deviation hedging and final settlement are executed. Figure 1 The data granularity and core business actions at each stage reflect the time coupling characteristics of transactions across multiple time scales.

[0041] The specific implementation of the embodiments of the present invention is further described in detail below:

[0042] Figure 2 This invention demonstrates the four-layer architecture of the LLM-enabled meta-security MATD3 system provided by an embodiment of the present invention: The first layer is the exogenous data perception layer, which collects unstructured data such as weather warnings and policy texts and extracts directional priors; the second layer is the meta-learning engine layer, which processes historical transaction data through recurrent neural networks and generates task context by combining semantic priors; the third layer is the multi-timescale market layer, covering the entire transaction process at medium-to-long-term, intra-month, day-ahead, and real-time levels; the fourth layer is the physical power grid and load layer, which includes rigid production-scale loads and flexible response-scale loads, and is the final execution carrier of decision-making instructions. The four-layer architecture realizes a complete link from semantic perception to physical control from top to bottom.

[0043] 1. Semantic Awareness Module for Unstructured Exogenous Data

[0044] This module forms the cognitive foundation of the entire system. Deployed at the power market information monitoring terminal, it analyzes unstructured, high-impact exogenous data through a large language model, extracts macro-level directional priors, and provides semantic-level risk perception for subsequent decision-making.

[0045] 1.1 Data Collection Dimensions

[0046] The data collected by this module covers the following unstructured exogenous information:

[0047] 1. Weather warning texts: extreme weather warnings, meteorological disaster forecasts, and renewable energy output impact assessment reports;

[0048] 2. Regulatory policy announcements: adjustments to electricity market rules, changes in electricity pricing policies, updates to carbon trading policies, adjustments to renewable energy subsidies, etc.

[0049] 3. Market operation information: analysis of power supply and demand, generator maintenance plans, transmission line fault reports, and competitor activity reports;

[0050] 4. Economic data: release of macroeconomic data, industrial production index, energy consumption trend analysis, etc.

[0051] 1.2 Semantic Dimensionality Reduction and Directional Prior Extraction of Large Language Models

[0052] This module uses a pre-trained large language model to process the above unstructured text data and outputs continuous directional priors. The specific process is as follows:

[0053] 1. Text preprocessing: The original text is segmented, denoised, and formatted to generate a text sequence suitable for input to a large language model;

[0054] 2. Semantic encoding: The Transformer encoder of a large language model maps the text to a high-dimensional semantic representation space to extract deep semantic features;

[0055] 3. Directional inference: Based on semantic features, a lightweight regression head network is used to infer directional priors, where a value close to 1 indicates a power shortage signal, a value close to -1 indicates a power ample signal, and a value close to 0 indicates a neutral signal.

[0056] 4. Prior confidence assessment: The prior confidence score is output synchronously and used for weight adjustment in subsequent meta-learning modules. The weight of low-confidence priors is reduced.

[0057] This mechanism transforms complex market dynamics and unstructured information into mathematically tractable trading bias signals, avoiding the signal-to-noise ratio degradation caused by directly embedding high-dimensional semantic data into reinforcement learning networks. Furthermore, it avoids mathematical illusions by limiting the large language model to macro-level guidance rather than direct numerical control. The semantic feature extraction mechanism preferred in this module is as follows: Figure 3 As shown:

[0058] The entire process from inputting unstructured exogenous text data to outputting directional priors in this embodiment of the invention is as follows: The input is unstructured text such as weather warnings and market announcements (e.g., "A cold wave is coming, and the temperature will drop by 10°C" or "The regional power grid is experiencing supply shortages due to maintenance"); Chain-like semantic reasoning is performed through a large language model to gradually deduce the conclusion that "Residential heating load is surging → Power supply is tight → Spot prices are likely to rise"; Finally, a structured directional prior is output, including the trading deviation coefficient (in the range of [-1,1]), trading direction, and risk preference, providing macro-semantic guidance for subsequent decision-making.

[0059] 2 Multi-timescale trading and risk control modeling module

[0060] This module is the core analysis unit of the system. It establishes a rigorous mathematical model of electricity market transactions across multiple time scales, while capturing the physical constraints of downstream demand and the specific clearing mechanism of the electricity market, providing quantitative analysis basis for the decision-making module.

[0061] 2.1 Demand-side physical constraint modeling

[0062] Intermediary agencies aggregate the electricity demand of multiple client companies, denoted as set I. For each client, downstream demand is divided into two precise categories: production-scale load, which is rigid base load demand driven by strict manufacturing plans and specific process logic, and cannot be dynamically adjusted; and response-scale load, which is flexible resources such as energy storage and industrial HVAC, serving as the main elastic band for dynamic spot market supply and demand adjustment and proactive deviation hedging.

[0063] The formula for total customer power is:

[0064]

[0065] In the formula, Let i be the total power consumed by customer i at time t. For customer i, the rigid production scale load at time t, Provides flexible response to scaled loads for customer i at time t.

[0066] The single-customer flexible load capacity constraint is:

[0067]

[0068] In the formula, Minimum regulating power for flexible load response for customers. Maximum adjustable power for flexible load response for customers.

[0069] The upper limit constraint on polymerization power is:

[0070]

[0071] In the formula, I represents the set of clients aggregated by the intermediary agency. This represents the maximum aggregated transmission power allowed for a regional microgrid or distribution network.

[0072] The formula for actual energy consumption per customer is:

[0073]

[0074] In the formula, This represents the actual energy consumption of customer i within the transaction interval Δt, where Δt is the transaction interval, typically 15 minutes.

[0075] The formula for aggregated actual energy consumption is:

[0076]

[0077] In the formula, The total actual energy consumption of all clients aggregated by the intermediary at time t.

[0078] 2.2 Multi-timescale market mechanisms and trading models

[0079] The transaction process of intermediaries spans multiple timeframes, and the overall transaction process evolves sequentially along four coupled dimensions: timeframe, market mechanism, data granularity, and strategic actions.

[0080] 1. Medium to long term stage

[0081] Intermediary agencies participate in annual and monthly reporting, operating with low data granularity based on 24-hour hourly average curves. Their main strategic action is to lock in the base electricity volume and price for long-term energy allocation.

[0082] 2. Continuous bilateral auction phase within the month

[0083] 3. Energy blocks are dynamically traded within the month through a continuous bilateral auction mechanism. Market rules include one-way trading constraints, meaning that within a single trading session, intermediaries can only act as either buyers or sellers for a specific target, determined by the direction of their first completed transaction; and electricity and price boundary constraints, meaning that the declared electricity volume must be an integer multiple of the minimum trading unit, and the price must strictly fall within predefined market limits.

[0084] A trade is triggered when the highest pending buy price reaches or exceeds the lowest pending sell price. The trade price formula is:

[0085]

[0086] In the formula, This is the transaction price. The price at which the previous transaction was completed. This represents the highest unexecuted buy price submitted by the buyer. This is the lowest unsold selling price declared by the seller.

[0087] 3. Market application stage

[0088] Intermediary institutions formulate aggregated pricing strategies based on available information sets, including weather forecasts, historical prices, aggregated actual load data, and decomposed open positions, and submit 96-point day-ahead electricity curves.

[0089] 4. Real-time Market and Settlement Coordination Phase

[0090] Day-ahead market clearing generates day-ahead prices and generation plans. Real-time market continuously balances supply and demand, generating real-time prices. The formula for the total energy procurement cost for intermediaries across the entire multi-timescale market is:

[0091]

[0092] In the formula, The total procurement cost for the intermediary agency on one trading day. This is the settlement price for medium- to long-term contracts. This refers to the electricity volume locked in for medium- to long-term contracts at time t. This represents the market transaction price at time t within the month. This represents the market transaction volume at time t within the month. The market clearing price at time t is the price at which the market clears out before the current date. This refers to the electricity volume declared by the market at time t on the previous day. The clearing price of the real-time market at time t. Let be the real-time deviation charge at time t.

[0093] The formula for real-time deviation power is:

[0094]

[0095] The meanings of the parameters in the formula are the same as before. A positive value for the real-time deviation power indicates that the shortage needs to be purchased in real time, while a negative value indicates that the surplus needs to be sold back to the grid.

[0096] 2.3 Risk Control Model Based on Conditional Value at Risk

[0097] The regulatory framework strictly prohibits excessive deviations between planned total electricity consumption and actual real-time electricity consumption. The formula for penalizing deviations is:

[0098]

[0099] In the formula, The deviation penalty cost at time t, The unit penalty rate for deviation in electricity volume. This is the allowable load forecast deviation tolerance threshold ratio for power grid dispatching.

[0100] To mathematically constrain the residual tail risk, conditional risk value is introduced. The global risk constraint formula is:

[0101]

[0102] In the formula, Value at risk (VaR) with a confidence level of α measures the expected penalty under the worst-case 1-α probability scenario, where α is the CVaR confidence level. This is a pre-defined daily maximum permissible deviation penalty safety threshold. This statement ensures that the risk of grid operation under extreme scenarios remains within acceptable limits.

[0103] Meta-safe multi-agent reinforcement learning decision-making module powered by 3 major language models

[0104] This module is the core decision-making unit of the system and is key to solving the multi-timescale, multi-agent, and multi-constraint electricity market bidding problem. This module formulates the multi-agent electricity market trading problem as a constrained Markov decision process. Based on a secure multi-agent, dual-delay, deep deterministic policy gradient framework, and combining semantic priors from a large language model with a meta-learning fast adaptation mechanism, it designs a two-layer collaborative decision-making architecture of macro-level semantic guidance and micro-level numerical execution. The overall framework of this module is as follows: Figure 4 As shown.

[0105] Figure 4 In the middle, the left side represents the meta-learning framework, which achieves task-independent policy initialization through a meta-policy network, enabling rapid adaptation to different market conditions. The right side represents the safety reinforcement learning module with constraint enforcers, based on the Multi-Agent Dual-Delay Deep Deterministic Policy Gradient (MATD3) algorithm. It employs a dual-Critic network and a target network structure, dynamically adjusting and enforcing CVaR safety constraints through Lagrange multipliers. The two parts work together to achieve a balance between rapid adaptation and safe execution.

[0106] 3.1 Prior Conditions Element Learning Module

[0107] To bridge the gap between low-frequency macroscopic guidance and high-frequency numerical execution in large language models, directional priors are embedded into a context-driven meta-learning framework. This module comprises three sequential components:

[0108] 1. Historical Encoder: Deploy a cyclic historical encoder to process recent numerical trajectories of intermediaries and extract dense latent physical context vectors.

[0109] 2. Prior Fusion Layer: The extracted numerical context is mathematically concatenated with the directional prior derived from the large language model. To prevent the low-dimensional directional prior from being masked by the high-dimensional historical vector, a gated multilayer perceptron is used to map the concatenated features to a unified task-specific embedding.

[0110] 3. Proactive prediction network: A forward prediction network is adopted, which uses fused task embeddings to explicitly predict the upcoming joint actions of peer agents.

[0111] The task embedding and fusion formula is:

[0112]

[0113] In the formula, For task-specific embedding vectors that fuse semantic and numerical information, This is a gated multilayer perceptron used to balance the weights of semantic prior and numerical context. This refers to the latent context vector of recent numerical trajectories extracted by the historical encoder. Directional priors extracted for large language models This is a vector concatenation operation.

[0114] By conditionalizing the meta-learning process on directional priors, a prior-conditional adaptation mechanism is established. When the large language model emits a definite directional signal, the fused embedding enables the underlying safe multi-agent reinforcement learning algorithm to bypass the high-risk cold-start exploration phase and instantly locate the optimal policy parameters suitable for severe fluctuations.

[0115] 3.2 Safe Micro-numerical Execution Engine

[0116] The micro-execution layer is formulated as a constrained Markov decision process, defined by tuples, and solved using a secure multi-agent dual-delay deep deterministic policy gradient algorithm.

[0117] Definition of elements of a constrained Markov decision process:

[0118] State space: includes uncontrollable baseline production-scale load, response-scale load available capacity limits, historical price series, previously locked electricity, and fusion meta-task context derived from the priors of the large language model.

[0119] Action Space: The continuous action vector includes the day-ahead bidding curve of 96 nodes, the price and power targets of the monthly price-limited orders, and the real-time scheduling signals for the response-scale load. The fusion meta-task context contains coupled information of the semantic priors of the large language model and historical physical trajectories. Its physical meaning is as follows: when the directional prior indicates a supply shortage signal (value approaching +1), the driving Actor network, within the physical constraint envelope, preferentially issues instructions to reduce the net power of the response-scale load (such as discharging energy storage or reducing electricity consumption of interruptible loads), thereby reducing the net load of the grid and helping to alleviate the pressure of insufficient power generation; when the prior indicates a sufficient supply signal (value approaching -1), the driving network preferentially issues instructions to increase the net power of the response-scale load (such as charging energy storage), thereby increasing the net load of the grid and helping to absorb excess power generation capacity. This semantic-physical mapping ensures that the macroscopic cognition of the large language model is directly translated into microscopic load adjustment instructions that conform to grid security constraints.

[0120] Reward function: The negative value of the total energy procurement cost.

[0121] Constraint costs: Security costs are directly mapped to the penalty for deviations caused by real-time market imbalances.

[0122] By using the Lagrange relaxation method to handle constrained optimization, the reward function is dynamically reshaped into an unconstrained minimax objective:

[0123]

[0124] In the formula, To enhance learning strategies, These are Lagrange multipliers used to dynamically adjust the penalty intensity of risk constraints. This is a discount factor, which measures the weight of future rewards. This represents the original reward at time t; the meanings of the other parameters are the same as before.

[0125] This architecture serves as a rigid safety guarantee against potential semantic misjudgments. If the large language model generates incorrect or overly aggressive directional prior illusions, the safe multi-agent reinforcement learning layer intercepts the risk at the physical execution level. The boundaries of consecutive actions are strictly constrained by the envelope of physical capabilities under the response scale load, and dynamically updated Lagrange multipliers actively penalize any joint algorithmic actions that may violate the safety threshold.

[0126] To address the inherent multi-agent credit allocation problem in optimizing diversified customer portfolios, a Transformer-based multi-head self-attention module is used to replace the standard fully connected Critic.

[0127] The Lagrange multiplier is not an abstract mathematical auxiliary variable, but a quantitative mapping index of the real-time supply and demand balance of the power grid. When the actual deviation penalty exceeds the safety threshold, the increase of the Lagrange multiplier directly increases the sensitivity of the Actor network to the penalty of high-risk actions, forcing the agent to prioritize actions that redirect the response-scale load towards the base load direction. This reduces the net load fluctuation of the power grid at the physical level, reduces the regulation pressure on the automatic generation control system of the dispatch center, and avoids the grid frequency deviation exceeding the limit caused by sudden load changes.

[0128] 3.3 Algorithm Design and Execution

[0129] The execution logic adopts a centralized training and decentralized execution paradigm. To mitigate the severe overestimation bias inherent in continuous multi-agent domains, a dual-centralized Critic is employed, and target policy smoothing is introduced.

[0130] The formula for generating active TD target actions is:

[0131]

[0132] In the formula, For the target action in the next moment, For the target Actor network, The system state at the next moment. The target policy smooths out noise and follows a truncated normal distribution. Let be the noise variance, and c be the noise cutoff boundary.

[0133] The Lagrange enhancement reward formula is as follows:

[0134]

[0135] In the formula, To integrate risk-based penalties with enhanced rewards, this approach guides strategies that simultaneously optimize energy allocation efficiency and grid operation safety.

[0136] The formula for calculating the TD target value is:

[0137]

[0138] In the formula, The target value for time-series difference is... Let be the state-action value function of the Critic network for the j-th target. We take the minimum value of the two Critics to mitigate the overestimation bias.

[0139] The loss function of the Critic network is:

[0140]

[0141] In the formula, Let B be the mean squared error loss of the i-th Critic network, B be the batch sample of the empirical replay buffer, and |B| be the batch size.

[0142] The gradient update formula for the Actor network is:

[0143]

[0144] In the formula, Let be the policy gradient of the i-th agent (Actor) network. This represents the local observation state of the i-th agent.

[0145] The dynamic update formula for Lagrange multipliers is:

[0146]

[0147] In the formula, Let be the learning rate of the Lagrange multiplier. When the average bias penalty exceeds the safety threshold, increase the Lagrange multiplier to strengthen the risk penalty; otherwise, keep the Lagrange multiplier non-negative.

[0148] The target network soft update formula is:

[0149]

[0150]

[0151] In the formula, This represents the soft update coefficient for the target network, typically set to a value much less than 1. Soft updates are used to smooth out parameter updates in the target network, improving training stability.

[0152] The aforementioned conditional value-at-risk constraints are not merely abstract safety boundaries, but directly affect the physical control processes of the power system through the following mechanisms:

[0153] 1. The tolerance threshold ratio in the deviation penalty function directly corresponds to the upper limit of load forecast deviation allowed by the power grid dispatching regulations. This threshold is determined by the power grid dispatching agency based on the spinning reserve capacity and frequency regulation capability of the regional power grid.

[0154] 2. Conditional Value at Risk (VaR) constraints transform probabilistic tail risk metrics into deterministic real-time load adjustment commands through a Lagrange relaxation mechanism. When the expected penalty approaches the threshold, the Lagrange multiplier dynamically increases, directly increasing the penalty weight of the Actor network output action, forcibly reducing the adjustment magnitude of the response-scale load, and strictly suppressing the absolute value of the aggregated real-time deviation within the grid safety tolerance range;

[0155] 3. At the physical level, this mechanism is equivalent to providing virtual spinning reserve for grid dispatch. By actively reducing loads on the load side to replace traditional generation-side reserves, it reduces the depth of grid frequency drops and the amplitude of voltage fluctuations in extreme scenarios, thereby improving the transient safety margin of the grid.

[0156] 4. Execution and Feedback Closed-Loop Module

[0157] This module is the system's implementation unit, enabling the precise issuance of scheduling and decision-making instructions, execution monitoring, effect evaluation, and model feedback optimization, thus building a closed-loop management system for the entire process.

[0158] 4.1 Execution Unit

[0159] Based on the power market trading system and industrial IoT technology, the execution unit accurately distributes the scheduling instructions generated by the meta-safe multi-agent reinforcement learning decision-making module, which is empowered by a large language model, to each execution terminal:

[0160] 1. Execution of medium- and long-term contracts: Locking in basic electricity volume and price through the power trading platform;

[0161] 2. Continuous auction bidding within the month: Submit limit orders according to price-time priority and participate in rolling matching;

[0162] 3. Day-ahead market reporting: Submit the day-ahead electricity volume curve for 96 points;

[0163] 4. Real-time deviation hedging: Dynamically adjust the response scale load according to the real-time market conditions to perform supply and demand balance adjustment.

[0164] 4.2 Feedback Unit

[0165] The feedback unit collects transaction execution results, market clearing prices, actual load data, and deviation penalty data in real time, evaluates the execution effect of scheduling decisions, calculates operational efficiency indicators, and feeds the monitoring data back to the modeling and decision-making modules.

[0166] 1. Transaction Result Monitoring: Real-time monitoring of transaction volume, transaction price, real-time deviation volume, and deviation penalty amount for each market stage;

[0167] 2. Operational performance evaluation: Set multi-dimensional performance indicators, including economic indicators, risk indicators, safety indicators, and efficiency indicators;

[0168] 3. Model and strategy feedback optimization: The monitoring data and performance indicators are fed back to the upstream module to update the parameters of the conditional value at risk risk model online. Real-time trading experience is added to the experience replay buffer and the reinforcement learning network is trained online to optimize the scheduling strategy so that the strategy can adapt to the dynamic operating conditions of the power market.

[0169] 5 Test and Verification Examples

[0170] The following test example further demonstrates the implementation of the present invention. This embodiment constructs a power market test environment based on a multi-customer interactive microgrid framework. An intermediary manages an aggregated investment portfolio of 10 heterogeneous industrial and commercial customers, each with peak power demand ranging from 2MW to 15MW and daily energy consumption ranging from 30MWh to 250MWh.

[0171] 5.1 Basic Test Setup

[0172] 1. Load curve and physical parameters

[0173] Customers are categorized into three operating types: integrated data centers, characterized by rigid computing baseloads for continuous cloud services, as well as flexible batch processing workloads and advanced cooling systems, providing significant demand response elasticity; heavy industrial processing, primarily consisting of large-scale shift-based continuous motors and furnaces, with huge baseloads but limited adjustability; and research and commercial parks, simulating a 3,000-square-meter research building integrating a 1,000-square-meter rooftop photovoltaic system, with centralized air conditioning systems as the main flexible load.

[0174] Rigid production scale loads are generated using their respective daily baselines combined with random noise. Response scale loads account for approximately 20% to 35% of each customer's total capacity.

[0175] 2. Market Data and Risk Parameters

[0176] Market data is derived from real-world regional power grid datasets. The deviation penalty rate is set at 0.5 yuan / kWh, and the strict tolerance threshold is set at 5%. The global conditional value-at-risk safety margin is set at 2000 yuan / day, and the confidence level is set at 0.95.

[0177] 3. Algorithm Hyperparameters

[0178] A pre-trained large language model processes text-based weather and market alerts, outputting directional priors. In the meta-safe multi-agent dual-delay deep deterministic policy gradient framework, the discount factor is set to 0.99, and the target network's soft update rate is set to 0.005. The learning rates for the Actor and Transformer augmented Critic networks are 1×10^-4 and 3×10^-4, respectively. The experience replay buffer capacity is set to 10^6, and the batch size is set to 256.

[0179] 5.2 Baseline Comparison Algorithm

[0180] To evaluate the proposed architecture, it was benchmarked against four classic and state-of-the-art algorithms:

[0181] 1. Model predictive control: Utilizing traditional optimization methods in the rolling time domain, representing traditional mathematical solvers that strictly enforce constraints;

[0182] 2. Standard multi-agent proximal policy optimization: A widely used multi-agent reinforcement learning baseline that optimizes expected rewards without explicit safety constraints or meta-learning priors;

[0183] 3. Standard multi-agent dual-delay deep deterministic policy gradient: This is the backbone algorithm of our method, but it removes the semantic prior of the large language model and the Lagrange conditional risk-value boundary.

[0184] 4. Meta-multi-agent dual-delay deep deterministic policy gradient: An ablation version of this model, which includes a history encoder but lacks semantic input.

[0185] 5.3 Experimental Results and Analysis

[0186] 1. The Influence of Convergence and Semantic Prior

[0187] Within 3000 training rounds, the standard multi-agent dual-delay deep deterministic policy gradient and multi-agent proximal policy optimization suffered a long and highly volatile cold start phase. In the first 1000 rounds, it was forced to blindly sample the high-dimensional action space, triggering severe reward oscillations, and finally stalled at suboptimal joint rewards of approximately -1350 and -1250, respectively.

[0188] The gradient of the multi-agent dual-delay deep deterministic policy successfully reduces the variance band by inferring the dynamics of the hidden environment, but still requires a large trial-and-error period to infer the optimal adjustment direction, and finally converges to a medium reward of -1000.

[0189] The large language model-enabled meta-safe multi-agent dual-delay deep deterministic policy gradient of this invention, by utilizing directional prior immediate contextualized task embedding, explicitly bypasses the high-variance exploration phase and rapidly ascends to a stable convergence plateau, approximately 40% faster than the baseline without a large language model, achieving the highest global cumulative reward of -850. Quantitatively, it improves performance by 37.0% compared to multi-agent proximal policy optimization, 32.0% compared to standard multi-agent dual-delay deep deterministic policy gradient, and 15.0% compared to the architecture without a large language model. A comparison of the training performance of different algorithms is provided below. Figure 5 As shown.

[0190] Figure 5 Plotting the number of training rounds on the horizontal axis and cumulative reward on the vertical axis, the performance comparison of the LLM-Meta-Safe MATD3 algorithm of this invention with four baseline algorithms—standard MAPPO, standard MATD3, and meta-MATD3 (without LLM)—over 3000 training rounds is shown. The curves in the figure clearly indicate that standard MAPPO and standard MATD3 are in a highly volatile cold start phase in the first 1000 rounds, eventually converging to a lower reward level; meta-MATD3 (without LLM) shows improved convergence speed but still requires a large amount of trial and error; the algorithm of this invention, guided by semantic priors, bypasses the high-variance exploration phase, achieving a convergence speed approximately 40% faster than the baseline without LLM, and obtaining the highest global cumulative reward.

[0191] 2. Sensitivity Analysis

[0192] Sensitivity tests were conducted on the conditional value-at-risk threshold, varying from 500 yuan to 5000 yuan. As the threshold is relaxed, the Lagrange penalty weakens, allowing for more flexible adjustment strategies and resulting in higher energy allocation efficiency, but also facing higher tail risk. The actual deviation penalty closely tracks the theoretical boundary at all threshold levels, proving that the Lagrange relaxation is effective and accurate. Sensitivity analysis of the conditional value-at-risk threshold is as follows: Figure 6 As shown.

[0193] Figure 6 This paper presents the Pareto frontier relationship between expected daily arbitrage profit and actual cumulative deviation penalty under different CVaR safety thresholds. The horizontal axis represents the CVaR safety threshold, the left vertical axis represents expected profit, and the right vertical axis represents actual deviation penalty. The curves in the figure show a clear trade-off: as the safety threshold is relaxed, the expected profit gradually increases, while the actual deviation penalty also rises synchronously; moreover, the actual deviation penalty always closely tracks the theoretical safety boundary (the y=x curve), proving that the Lagrange relaxation mechanism of this invention can accurately control risk and achieve the optimal balance between operating efficiency and grid safety.

[0194] In robustness testing against large language model illusions, false priors were intentionally injected during actual grid surplus periods. Blindly following these priors without a safety layer leads to catastrophic operational accidents. In this invention, the Lagrange multiplier surges exponentially, decisively overwriting erroneous priors and forcibly reverting to the physical safety envelope. The fault safety test results for large language model illusions are as follows: Figure 7 As shown.

[0195] Figure 7 The system response timing diagram is shown when a false semantic prior (erroneous indication of power supply shortage) is injected, including three sub-graphs: (a) is a comparison curve of real-time transaction execution volume. The standard method without a security layer blindly follows the false prior, resulting in over-purchasing, far exceeding the physical security envelope, while the transaction execution volume of the method of this invention is always limited to the safe range; (b) is a curve of Lagrange multiplier change. After the false prior is injected, the Lagrange multiplier of this invention increases exponentially, triggering the security protection mechanism; (c) is a comparison curve of cumulative deviation penalty. The method without a security layer produces a catastrophic high penalty, while the cumulative deviation penalty of the method of this invention is always below the safety threshold.

[0196] 3. Implementation of adjustments and risk containment under extreme volatility

[0197] The over-reporting of standard multi-agent near-end strategy optimization in the market recently has led to a sharp increase in aggregate real-time deviations that exceed the grid's safety tolerance, equivalent to injecting an uncontrollable high-power surge load into the grid. This sudden load change exceeds the power transmission limits and frequency regulation capabilities of the distribution network, potentially causing physical safety incidents such as grid frequency drops exceeding transient stability limits and voltage deviations exceeding permissible ranges.

[0198] This invention dynamically adjusts the response-scale load within the physical envelope, utilizing portfolio aggregation to offset independent power fluctuations and control the aggregated load change rate within the grid dispatch tolerance range. When the expected penalty approaches the boundary, the dynamically updated Lagrange multiplier exponentially penalizes high-risk actions, forcibly reducing flexible loads to ensure that real-time deviation power is strongly suppressed within the grid safety tolerance, maintaining grid frequency stability and voltage quality. The cumulative deviation penalty is strictly maintained below the safety boundary, achieving a stable improvement in operating efficiency compared to the model predictive control baseline, while completing online inference in milliseconds.

[0199] The system response under extreme fluctuations in this embodiment is as follows: Figure 8 As shown.

[0200] Figure 8The system response to an extreme real-time price spike caused by a simulated typhoon is illustrated in four sub-graphs: (a) the day-ahead and real-time price curves, clearly showing the real-time price spike caused by the extreme event; (b) the aggregated real-time deviation power curve, where the standard MAPPO algorithm causes the deviation to drastically exceed the grid safety tolerance, while the method of this invention strictly controls the deviation within a safe range; (c) the cumulative deviation penalty and CVaR boundary comparison curve, where the standard algorithm's penalty exceeds the safety threshold, while the method of this invention always keeps it below the boundary; and (d) the daily arbitrage profit comparison curve, where the standard algorithm results in negative profits due to overly aggressive trading, while the method of this invention achieves stable profitability.

[0201] V. Conclusion

[0202] This invention solves the core technical problems of multi-timescale trading in the existing power market by constructing a full-process control system of semantic perception, risk modeling, security decision-making, and execution feedback, and combining semantic extraction from a large language model, meta-learning, and security multi-agent reinforcement learning algorithms, achieving multiple technical effects.

[0203] In terms of intelligence, the semantic dimensionality reduction mechanism of the large language model constructed in this invention achieves efficient extraction from unstructured exogenous text data to low-dimensional directional priors, solving the semantic blindness problem in pure multi-agent reinforcement learning. The designed prior-conditional meta-learning framework, through the immediate contextualized task embedding of directional priors, enables agents to explicitly bypass the high-variance cold-start exploration phase, significantly improving convergence speed. The constructed full-process closed-loop system realizes integrated parsing of unstructured data, online updating of risk models, and iterative optimization of strategies, significantly improving the system's dynamic adaptability and robustness.

[0204] Regarding the safe operation of the power grid, the proposed safe micro-execution engine transforms the abstract mathematical risk boundary into a physical adjustment boundary for the response-scale load through conditional risk value constraints under Lagrange relaxation. When extreme fluctuations occur in the real-time market, the exponential amplification of the dynamic Lagrange multipliers enables the Actor network to constrain actions within the physical envelope within milliseconds, ensuring that the aggregated real-time deviation does not exceed the safety tolerance allowed by the power grid dispatch. This prevents the power grid frequency drop depth caused by load mutations from exceeding the transient stability limit, ensuring that the power grid voltage quality remains within the range allowed by national standards. This physical boundary constraint mechanism provides rigid technical protection against extreme market fluctuations and the illusion of large language models.

[0205] In terms of system operating efficiency, this invention fully leverages the supply and demand adjustment potential at different market stages through a multi-timescale collaborative trading mechanism, achieving optimal allocation of energy resources and reducing system operating costs. By dynamically adjusting load scale and utilizing portfolio aggregation effects, independent power fluctuations among different customers partially offset each other, essentially smoothing the aggregation deviation curve. This reduces the grid dispatch center's demand for spinning reserves, decreases the pressure of frequent generator start-ups and shutdowns and deep peak shaving, extends unit lifespan, and reduces grid operating losses.

[0206] In terms of engineering applications, this invention adopts a modular design, with each module interacting through standardized data interfaces, facilitating the subsequent integration of new data sources or trading markets and demonstrating strong scalability. The semantic priors of the large language model and the quantitative indicators of the decision-making process enhance the system's interpretability, solving the black-box decision-making problem of traditional reinforcement learning. The system is developed based on a mature software framework, combined with an electricity market trading platform and a load aggregation system, resulting in low engineering implementation difficulty and rapid deployment.

[0207] Based on the same inventive concept, this invention also provides a computer device, comprising: one or more processors, and a memory for storing one or more computer programs; the programs include program instructions, and the processor executes the program instructions stored in the memory. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, used to implement one or more instructions, specifically for loading and executing one or more instructions stored in a computer storage medium to implement the above-described method.

[0208] It should be further explained that, based on the same inventive concept, the present invention also provides a computer storage medium storing a computer program, which, when executed by a processor, performs the above-described method. This storage medium can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0209] It should be noted that, unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0210] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A multi-timescale power market risk perception and load control system based on a large language model, characterized in that, include: The semantic awareness module is used to acquire unstructured text data of the electricity market and extract directional prior signals that characterize the macro-situation of electricity supply and demand through a pre-trained large language model. The safety decision module is used to decouple aggregated power loads into non-adjustable rigid production-scale loads and adjustable flexible response-scale loads, and to construct the physical safety boundary of power grid operation based on conditional risk value. A meta-learning framework is adopted to integrate directional prior signals and historical operating trajectories of the power market to generate task embeddings. The task embeddings are used to initialize a multi-agent reinforcement learning policy network. Under physical capacity constraints, the policy network solves a constrained optimization problem with physical safety boundaries, generating power trading auxiliary decisions and physical control instructions that directly affect the flexible response scale load. The constrained optimization problem maps the conditional risk value constraint to a physical adjustment boundary of flexible response scale load through the Lagrange relaxation mechanism. The execution and feedback module is used to execute power trading auxiliary decisions and physical control commands. By adjusting the power consumption of flexible response loads, it controls the real-time deviation of aggregated loads within the safe tolerance range allowed by grid dispatch.

2. The multi-timescale power market risk perception and load control system based on a large language model according to claim 1, characterized in that: The semantic awareness module is also used to synchronously output prior confidence scores and dynamically adjust the fusion weight of directional prior signals in the task embedding generation process based on the prior confidence scores; the confidence prior is positively correlated with the fusion weight.

3. The multi-timescale power market risk perception and load control system based on a large language model according to claim 1, characterized in that: The security decision module is constructed with dual physical security boundaries: the first boundary is the upper and lower limit constraints of the capacity of a single customer's flexible response to large-scale loads, and the second boundary is the upper limit constraint of the total power of aggregated power loads; physical control commands must simultaneously meet the requirements of both boundaries, and any actions that exceed the boundaries will be directly cut off.

4. The multi-timescale power market risk perception and load control system based on a large language model according to claim 1, characterized in that: When the security decision module generates the task embedding, it extracts the potential physical context vector by processing the historical operating trajectory of the power market through a cyclic historical encoder, and then adaptively cascades and fuses the potential physical context vector with the directional prior signal through a gated multilayer perceptron; the gated multilayer perceptron automatically adjusts the fusion ratio of semantic information and numerical information according to the degree of market fluctuation.

5. The multi-timescale power market risk perception and load control system based on a large language model according to claim 1, characterized in that: The multi-agent reinforcement learning policy network adopts a dual-delay deep deterministic policy gradient architecture, which includes a Transformer-based multi-head self-attention module. The multi-head self-attention module is used to weight and allocate the load adjustment contributions of different clients, quantify the degree of influence of each agent on the global reward, and solve the multi-agent credit allocation problem.

6. The multi-timescale power market risk perception and load control system based on a large language model according to claim 1, characterized in that: When the security decision module implements the Lagrange relaxation mechanism, it defines a dynamically updated Lagrange multiplier and combines the conditional risk value constraint term with the original reward function to construct an enhanced reward function. The Lagrange multiplier is dynamically adjusted according to the degree of deviation between the real-time deviation penalty and the threshold corresponding to the physical security boundary. When the real-time deviation penalty exceeds the threshold, the Lagrange multiplier is increased to forcibly limit the adjustment action of the flexible response scale load within the security envelope.

7. The multi-timescale power market risk perception and load control system based on a large language model according to claim 6, characterized in that: The Lagrange multiplier is a quantitative mapping index of the real-time supply and demand balance of the power grid. An increase in the Lagrange multiplier corresponds to an aggravation of the supply and demand imbalance of the power grid. At this time, the strategy network will prioritize outputting physical control commands to reduce the adjustment range of flexible response scale loads, and force the aggregated loads to be redirected towards the base load direction.

8. The multi-timescale power market risk perception and load control system based on a large language model according to claim 1, characterized in that: The multi-agent reinforcement learning policy network adopts a centralized training and decentralized execution paradigm, and sets up a dual centralized Critic network to evaluate the value of actions. A target policy smoothing mechanism is used to add truncated normal noise to the target action, and a delayed update mechanism is used to update the Actor network parameters once every preset number of steps to alleviate the overestimation bias in the continuous action space.

9. The multi-timescale power market risk perception and load control system based on a large language model according to claim 1, characterized in that: The security decision-making module constructs a progressive constraint mechanism for the multi-timescale electricity market: the base electricity volume locked in medium- and long-term contracts constrains intra-month trading decisions, the positions determined by intra-month trading constrain day-ahead market declarations, and the day-ahead declaration curve constrains real-time load adjustment; decisions at each time scale are passed on sequentially, forming an irreversible time-coupled constraint chain.

10. A method for multi-timescale power market risk perception and load regulation based on a large language model, characterized in that, Includes the following steps: Unstructured text data of the power market is acquired, and directional prior signals representing the macro-situation of power supply and demand are extracted through a pre-trained large language model. The large language model only provides directional guidance of the macro-situation and does not directly generate numerical control commands. The aggregated power load is decoupled into an unadjustable rigid production-scale load and an adjustable flexible response-scale load, and the physical safety boundary of the power grid operation is constructed based on conditional risk value. A meta-learning framework is adopted to integrate directional prior signals and historical operating trajectories of the electricity market to generate task embeddings, which are then used to initialize a multi-agent reinforcement learning policy network. Under physical capacity constraints, a policy network is used to solve a constrained optimization problem with physical safety boundaries, generating power trading auxiliary decisions and physical control commands that directly affect flexible response loads. The constrained optimization problem maps the conditional risk value constraint to a physical adjustment boundary of flexible response scale load through the Lagrange relaxation mechanism. It executes power trading auxiliary decision-making and physical control instructions, and controls the real-time deviation of aggregated load within the safe tolerance range allowed by grid dispatch by adjusting the power consumption of flexible response loads.