A power system regulation method, device, apparatus and storage medium

By combining large and small language models, unstructured information is transformed into structured information, generating power system control strategies. This solves the adaptability problem of unknown scenarios in power system control and enables the safe and stable operation of complex power grids.

CN120257989BActive Publication Date: 2026-08-04CHINA SOUTHERN POWER GRID COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA SOUTHERN POWER GRID COMPANY
Filing Date
2025-03-03
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing graph retrieval-enhanced generation methods are insufficient to cover unknown scenarios when generating power system control strategies, lacking effectiveness, comprehensiveness, and adaptability. Traditional analysis and control techniques are unable to meet the requirements for safe and stable operation of complex power grids.

Method used

By utilizing a large language model for human-computer interaction, unstructured information input by users is transformed into structured information. Through collaboration with a pre-trained small model, optimization strategies that follow control constraints are generated. This includes constructing a power system control knowledge graph, community partitioning, constrained Markov decision processes, and fine-tuning based on expert control experience data, thereby generating control strategies for different power system operation scenarios.

Benefits of technology

It enables the full consideration of user experience in power system regulation, assists in the judgment of abnormal situations, and generates reliable optimization strategies that are fully adapted to different scenarios, thereby improving the comprehensiveness and adaptability of power grid regulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120257989B_ABST
    Figure CN120257989B_ABST
Patent Text Reader

Abstract

The application discloses a power system regulation method, device and equipment and a storage medium. The method comprises the following steps: obtaining real-time operation state information of a current power system and a user input regulation task demand based on a man-machine interaction interface of a large language model, and converting the real-time operation state information and the regulation task demand into regulation task structured information; decomposing the regulation task structured information into a plurality of regulation subtasks; and generating an optimized regulation strategy corresponding to each regulation subtask by a plurality of pre-trained small models. The small models are obtained by training based on prior regulation information and regulation constraint conditions of the power system. The application can fully consider the experience of the user in abnormal conditions of the power system during regulation of the power system, and can effectively generate reliable optimized regulation strategies for different regulation subtasks while complying with regulation constraint conditions through cooperation of the large language model and the pre-trained small models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system technology, and in particular to a power system control method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] With the continuous expansion of the power grid and the increasing integration of new energy sources and distributed power sources, the grid structure is becoming increasingly complex, and the difficulty of power system dispatch and control is also increasing, posing new challenges to grid operation safety. Traditional analysis and control technologies are no longer sufficient to meet the requirements for the safe and stable operation of the power grid. In existing technologies, graph retrieval-enhanced generation technology is commonly used to generate power system control strategies. This technology combines knowledge graphs and Large Language Models (LLMs). Its core process is as follows: after a user poses a question, the model identifies key entities and relationships, retrieving relevant entities and relationships from a pre-built knowledge graph; based on question keywords and graph hints, the retrieval tool selects relevant fragments from a document library; finally, the generator combines the retrieved fragments and the knowledge graph to generate an answer. However, existing graph retrieval-enhanced generation methods often only cover known contingency scenarios when generating power system control strategies, lacking effectiveness, comprehensiveness, and adaptability for uncovered scenarios. Summary of the Invention

[0003] This invention provides a power system control method, apparatus, device, and storage medium. By leveraging the advantages of large language models in text semantic understanding and knowledge extraction, it can transform unstructured information input by users representing control task requirements into structured information for control tasks. This allows for full consideration of users' experience in power system anomalies during power system control, aiding in the judgment of power system anomalies. Furthermore, through the collaborative operation of the large language model and pre-trained small models, reliable optimized control strategies can be effectively generated for different control sub-tasks while adhering to control constraints, demonstrating comprehensiveness and adaptability to control in different power system operating scenarios.

[0004] To address the aforementioned technical problems, a first aspect of this invention provides a power system control method, comprising:

[0005] Based on the human-computer interaction interface of the large language model, the system obtains the real-time operating status information of the current power system and the control task requirements input by the user, and transforms the real-time operating status information and control task requirements into structured control task information.

[0006] The structured information of the control task is decomposed into several control sub-tasks;

[0007] The optimized control strategies corresponding to each of the control sub-tasks are generated by several pre-trained small models; wherein the small models are obtained by training based on the prior control information and control constraints of the power system.

[0008] As a preferred embodiment, the method specifically obtains the small model through the following steps:

[0009] The preset power system dispatching procedure information is preprocessed, and the entities and relationships between the entities in the preprocessed power system dispatching procedure information are extracted; wherein, the power system dispatching procedure information includes dispatching specification text, dispatching operation plan and historical dispatching operation record;

[0010] Equipment information is extracted from the preprocessed power system dispatching procedure information, and the entities, the relationships between the entities, and the equipment information are fused together to construct a power system control knowledge graph.

[0011] The Leiden community detection algorithm was used to divide the power system regulation knowledge graph into communities to obtain regulation datasets under different power system operation scenarios.

[0012] The power system scheduling optimization problem is transformed into a restricted Markov decision process. Based on the real-time operating status information, the equipment scheduling plan information and energy forecast information at the next moment, the real-time equipment adjustability, the real-time equipment power adjustment amount, and the control constraints, the state space, action space, reward function, and penalty function of the restricted Markov decision process are established respectively to train and obtain a basic small model.

[0013] The basic small model is fine-tuned using the control datasets and expert control experience data under different power system operation scenarios to obtain several small models for different power system operation scenarios.

[0014] As a preferred embodiment, the preprocessing of the preset power system dispatching procedure information specifically includes:

[0015] The power system dispatching procedure information is parsed, and the valid text of power system dispatching is extracted;

[0016] The effective text of the power system dispatch is cleaned and regularized.

[0017] The effective text of power system scheduling after data cleaning and rule-based processing is mapped to a preset knowledge graph ontology model to establish entity relationship mapping rules corresponding to the effective text of power system scheduling after data cleaning and rule-based processing, thereby obtaining the preprocessed power system scheduling procedure information.

[0018] As a preferred embodiment, the step of using the Leiden community detection algorithm to divide the power system control knowledge graph into communities to obtain control datasets under different power system operation scenarios specifically includes the following steps S11 to S13:

[0019] Step S11: Using each entity as a node in the power system regulation knowledge graph, each node is considered as a community, and the modularity corresponding to each node moving to its adjacent community is calculated.

[0020] Step S12: When any node moves to an adjacent community and its modularity increases, the node is assigned to that adjacent community. This step is repeated until no node moves to an adjacent community and its modularity increases, resulting in several partitioned communities.

[0021] Step S13: Each of the divided communities is taken as a new node, and the step of calculating the modularity of each node moving to its neighboring community in step S11 is repeated until the modularity of the current community division result no longer increases. The current community division result is taken as the control dataset under different power system operation scenarios.

[0022] As a preferred embodiment, based on the real-time operating status information, the equipment scheduling plan information and energy prediction information for the next moment, the real-time equipment adjustability, the real-time equipment power adjustment amount, and the control constraints, the state space, action space, reward function, and penalty function of the restricted Markov decision process are established respectively to train and obtain a basic small model, specifically including:

[0023] The state space is established based on the real-time operating status information and the equipment scheduling plan information for the next moment; wherein, the real-time operating status information includes line load rate, bus voltage, power generation of thermal power units and charging and discharging power of energy storage units, and the equipment scheduling plan information includes day-ahead scheduling plan information of thermal power units, day-ahead scheduling plan information of energy storage units, ultra-short-term wind power forecast information, ultra-short-term photovoltaic power forecast information and ultra-short-term load forecast information;

[0024] Based on the real-time adjustable capability of the equipment, the real-time adjustable power range of the thermal power unit and the real-time adjustable power range of the energy storage unit are determined respectively, and the action space is established according to the real-time adjustable power range of the thermal power unit and the real-time adjustable power range of the energy storage unit.

[0025] The reward function is established based on the negative value of the sum of the real-time equipment power adjustment of the thermal power unit and the real-time equipment power adjustment of the energy storage unit.

[0026] Based on the aforementioned control constraints, the power balance constraints, branch power flow upper and lower limits constraints, and bus voltage upper and lower limits constraints of the power system are determined, and the penalty function is established based on the aforementioned power balance constraints, branch power flow upper and lower limits constraints, and bus voltage upper and lower limits constraints.

[0027] Based on the state space, the action space, the reward function, and the penalty function, a safety reinforcement learning agent is established;

[0028] The security reinforcement learning agent is trained using the primal dual optimization method to obtain the basic small model.

[0029] As a preferred embodiment, the basic small model is fine-tuned using the control datasets and expert control experience data under different power system operation scenarios to obtain several small models for different power system operation scenarios, specifically including:

[0030] The aforementioned regulatory dataset is fused with the expert regulatory experience data to obtain a priori dataset;

[0031] Several control decision trajectories are obtained from the prior dataset; wherein, the control decision trajectories include action trajectories composed of several actions;

[0032] With maximizing action information entropy as the selection objective, several target control decision trajectories are selected from the aforementioned control decision trajectories to serve as a teaching dataset; wherein, the action information entropy is calculated based on the frequency of occurrence of each action in the action trajectory among all action trajectories in the selected teaching dataset;

[0033] The loss function is determined by a weighted sum of preset generation balance regularization term, renewable energy curtailment rate regularization term, and line load rate regularization term; wherein, the generation balance regularization term is used to guide the basic small model to meet the balance between grid generation and load consumption, the renewable energy curtailment rate regularization term is used to guide the basic small model to maximize the absorption of renewable energy, and the line load rate regularization term is used to guide the basic small model to reduce the line load rate.

[0034] Based on the loss function, the basic mini-model is fine-tuned using the teaching dataset to obtain several mini-models.

[0035] As a preferred embodiment, the decomposition of the structured information of the regulation task into several regulation sub-tasks specifically includes:

[0036] The real-time operating status information and the prior control information are fused to obtain comprehensive input information;

[0037] According to a preset decision decomposition strategy, the structured information of the control task is decomposed to obtain several subtasks that constitute the structured information of the control task. The subtasks are further decomposed until a metatask is obtained, forming a control task decomposition tree. The metatask is a task that cannot be further decomposed, the structured information of the control task is the root node of the control task decomposition tree, the subtask is the child node of the control task decomposition tree, and the metatask is the leaf node of the control task decomposition tree.

[0038] Based on the aforementioned control task decomposition tree, a meta-task set is obtained;

[0039] Based on the meta-task set, several control sub-tasks are obtained, and the comprehensive input information is used as the decision information for the control sub-tasks.

[0040] A second aspect of the present invention provides a power system control device, comprising:

[0041] The human-computer interaction module is used to obtain the real-time operating status information of the current power system and the control task requirements input by the user based on the human-computer interaction interface of the large language model, and to transform the real-time operating status information and control task requirements into structured control task information.

[0042] The control task decomposition module is used to decompose the structured information of the control task into several control sub-tasks.

[0043] An optimized control strategy generation module is used to generate optimized control strategies corresponding to each of the control sub-tasks through several pre-trained small models; wherein, the small models are obtained by training based on the prior control information and control constraints of the power system.

[0044] A third aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the power system control method described in any of the first aspects.

[0045] A fourth aspect of the present invention provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the power system control method described in any of the first aspects.

[0046] Compared to existing technologies, the beneficial effects of this invention are that by leveraging the advantages of large language models in text semantic understanding and knowledge extraction, unstructured information input by users to represent the needs of control tasks can be transformed into structured information for control tasks. This allows for full consideration of users' experience in abnormal power system conditions during power system control, assisting in the judgment of abnormal power system conditions. Furthermore, through the collaborative cooperation between the large language model and pre-trained small models, reliable optimized control strategies can be effectively generated for different control sub-tasks while adhering to control constraints, demonstrating comprehensiveness and adaptability to control in different power system operation scenarios. Attached Figure Description

[0047] Figure 1 This is a flowchart illustrating the power system control method in an embodiment of the present invention;

[0048] Figure 2 This is a schematic diagram of the structure of the power system control device in an embodiment of the present invention. Detailed Implementation

[0049] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0050] Please see Figure 1 The first aspect of this invention provides a power system control method, comprising the following steps S1 to S3:

[0051] Step S1: Based on the human-computer interaction interface of the large language model, obtain the real-time operating status information of the current power system and the control task requirements input by the user, and transform the real-time operating status information and control task requirements into structured control task information.

[0052] Step S2: Decompose the structured information of the control task into several control sub-tasks;

[0053] Step S3: Generate optimized control strategies corresponding to each of the control sub-tasks using several pre-trained small models; wherein, the small models are obtained by training based on the prior control information and control constraints of the power system.

[0054] Specifically, given the advantages of large language models in text semantic understanding and knowledge extraction, and the expertise and intuition of expert users regarding various power system anomalies, and considering that human language is unstructured information and cannot be directly understood and used by computers, this embodiment utilizes the human-computer interaction interface of a large language model to obtain real-time operating status information of the current power system and user-inputted control task requirements. It is understood that the user-input control task requirements implicitly contain the user's judgment of current power system anomalies and their corresponding control opinions, thus assisting in the judgment of power system anomalies. Furthermore, the large language model is used to transform the real-time operating status information and control task requirements into structured control task information.

[0055] Furthermore, considering the complexity and numerous tasks in digital power grid control, in order to simplify the control process and improve the efficiency of power system control, this embodiment decomposes the structured information of control tasks into several control sub-tasks, such as load allocation tasks, power balance tasks, and equipment scheduling tasks.

[0056] Furthermore, this embodiment employs a power system control approach that combines a large language model with small models. The decomposed control sub-tasks are assigned to pre-trained small models for processing, generating corresponding optimized control strategies. In this process, the large language model handles complex reasoning and judgment, while the small models execute specific operational tasks, forming an efficient collaborative mechanism. It is worth noting that because the small models are trained based on prior control information and constraints of the power system, they can effectively complete control sub-tasks while adhering to control constraints in different power system operation scenarios. This capability extends beyond known pre-planned scenarios, demonstrating comprehensiveness and adaptability.

[0057] As a preferred embodiment, the method specifically obtains the small model through the following steps:

[0058] The preset power system dispatching procedure information is preprocessed, and the entities and relationships between the entities in the preprocessed power system dispatching procedure information are extracted; wherein, the power system dispatching procedure information includes dispatching specification text, dispatching operation plan and historical dispatching operation record;

[0059] Equipment information is extracted from the preprocessed power system dispatching procedure information, and the entities, the relationships between the entities, and the equipment information are fused together to construct a power system control knowledge graph.

[0060] The Leiden community detection algorithm was used to divide the power system regulation knowledge graph into communities to obtain regulation datasets under different power system operation scenarios.

[0061] The power system scheduling optimization problem is transformed into a restricted Markov decision process. Based on the real-time operating status information, the equipment scheduling plan information and energy forecast information at the next moment, the real-time equipment adjustability, the real-time equipment power adjustment amount, and the control constraints, the state space, action space, reward function, and penalty function of the restricted Markov decision process are established respectively to train and obtain a basic small model.

[0062] The basic small model is fine-tuned using the control datasets and expert control experience data under different power system operation scenarios to obtain several small models for different power system operation scenarios.

[0063] Specifically, considering that the power system dispatching procedure information includes dispatching specification texts, dispatching operation plans, and historical dispatching operation records, each with inconsistent formats and potential issues such as redundant characters and non-standardized terminology, this embodiment first preprocesses the preset power system dispatching procedure information and extracts the entities and relationships between them from the preprocessed information to facilitate the subsequent construction of a power system control knowledge graph. Specifically, based on the content characteristics of the power system dispatching procedure information, without affecting the semantic coherence of the text, the information is divided into blocks according to the maximum number of tokens to obtain power system dispatching procedure text blocks. For example, text blocks can be divided according to paragraphs or punctuation marks. Then, for each text block, a large language model is used to identify and extract entities and their relationships. This involves first extracting all entities in the document, including their names, types, and descriptions, and then identifying all relationships between entities, including source and target entities and descriptions of their relationships.

[0064] Furthermore, feature information is extracted from multi-source, heterogeneous prior control information, including historical dispatch logs, real-time monitoring data, sensor data, and expert experience records. Feature extraction techniques are used to identify key dispatch events, operating equipment, and time-series changes. Based on the mapping codes contained in the contingency plans, the correspondence between event names, operating equipment, and dispatch actions is clarified, and a knowledge graph ontology model is established. Then, equipment information is extracted from the preprocessed power system dispatching procedure information, for example, from the control operation contingency plans. The extracted entities and their relationships are then fused with the equipment information to construct a power system control knowledge graph, enabling entity linking of the dispatching plan data.

[0065] Furthermore, in order to enable the small model to have the adaptability to control for different power system operation scenarios during the training process, this embodiment uses the Leiden community detection algorithm to divide the power system control knowledge graph into communities, and obtain control datasets under different power system operation scenarios. This community detection algorithm can effectively recover the hierarchical community structure of the large graph. Each level of this hierarchical structure provides a community partition, which covers the nodes of the graph in a mutually exclusive and set exhaustive manner, thereby achieving a divide-and-conquer global summary.

[0066] Furthermore, in order to address the security constraints under complex power grid regulation tasks, this embodiment transforms the power system scheduling optimization problem into a restricted Markov decision process. Based on real-time operating status information, equipment scheduling plan information and energy forecast information at the next moment, real-time equipment adjustability, real-time equipment power adjustment amount and regulation constraints, the state space, action space, reward function and penalty function of the restricted Markov decision process are established respectively to train and obtain a basic small model.

[0067] Furthermore, this embodiment, based on the basic small model obtained through training, combines the control datasets for different power system operation scenarios obtained through community partitioning, integrates expert control experience data for typical operation scenarios, and fine-tunes the basic small model using a priori experience-guided fine-tuning method to form a set of small models for multiple power grid operation scenarios.

[0068] As a preferred embodiment, the preprocessing of the preset power system dispatching procedure information specifically includes:

[0069] The power system dispatching procedure information is parsed, and the valid text of power system dispatching is extracted;

[0070] The effective text of the power system dispatch is cleaned and regularized.

[0071] The effective text of power system scheduling after data cleaning and rule-based processing is mapped to a preset knowledge graph ontology model to establish entity relationship mapping rules corresponding to the effective text of power system scheduling after data cleaning and rule-based processing, thereby obtaining the preprocessed power system scheduling procedure information.

[0072] Specifically, this embodiment first parses the power system dispatching procedure information to extract useful information related to power system dispatching, which is the valid text of power system dispatching. Further, the valid text of power system dispatching is subjected to data cleaning and rule-based processing, including removing redundant characters, processing common punctuation and symbols, standardizing formatting, and standardizing professional terminology, to ensure the cleanliness and standardization of the text.

[0073] Furthermore, the aforementioned knowledge graph ontology model is established based on the correspondence between explicit event names, operating equipment, scheduling actions, etc. In order to ensure that the preprocessed power system scheduling procedure information can be uniformly modeled to facilitate the construction and query of the power system regulation knowledge graph, this embodiment maps the effective text of power system scheduling after data cleaning and rule-based processing to the knowledge graph ontology model to establish entity relationship mapping rules corresponding to the effective text of power system scheduling after data cleaning and rule-based processing.

[0074] As a preferred approach, the Leiden community detection algorithm is used to divide the power system regulation knowledge graph into communities to obtain regulation datasets under different power system operation scenarios, specifically including the following steps S11 to S13:

[0075] Step S11: Using each entity as a node in the power system regulation knowledge graph, each node is considered as a community, and the modularity corresponding to each node moving to its adjacent community is calculated.

[0076] Step S12: When any node moves to an adjacent community and its modularity increases, the node is assigned to that adjacent community. This step is repeated until no node moves to an adjacent community and its modularity increases, resulting in several partitioned communities.

[0077] Step S13: Each of the divided communities is taken as a new node, and the step of calculating the modularity of each node moving to its neighboring community in step S11 is repeated until the modularity of the current community division result no longer increases. The current community division result is taken as the control dataset under different power system operation scenarios.

[0078] Specifically, the Leiden community detection algorithm attempts to move each node to a neighboring community to find the maximum local modularity. For each node, the Leiden community detection algorithm checks whether moving the node to a neighboring community would increase the modularity. If so, the node is assigned to the new community. This process is repeated until no further node moves significantly improve the modularity. The modularity gain is shown in the following equation:

[0079]

[0080] Among them, A ij Let A be an adjacency matrix, and let node i and node j be connected by an edge. ij =1, otherwise A ij =0. k i and k jLet represent the degrees of node i and node j, respectively, which are the number of connections for each node. m is the total number of edges in the network. δ(c) represents the expected number of edges between nodes i and j in a random graph, which is an estimate of the edge distribution in a random network. i ,c j ) is the Kronecker delta function. If node i and node j belong to the same community, i.e., c i =c j Then δ(c) i ,c j ) = 1, otherwise, δ(c) = 1. i ,c j ) = 0.

[0081] Furthermore, based on the partitions obtained during the local movement phase, an aggregation network is created. The currently partitioned communities are used as new nodes to compress the original graph. Each new node represents a community, and the edges between nodes represent the connections between different communities in the original graph. By compressing the graph, the Leiden algorithm generates a new graph with a simpler structure, facilitating further modularity optimization.

[0082] Next, the Leiden algorithm introduces an "improved aggregation" step, focusing on correcting underoptimized areas within communities. Specifically, the algorithm examines the node connectivity within each community, identifying disconnected segments. For these disconnected groups of nodes, the algorithm attempts to move them to more suitable communities, thereby improving the accuracy and consistency of the overall partitioning. The goal of this stage is to ensure that the resulting community structure is more detailed and rational.

[0083] Finally, the algorithm enters an iterative process, repeatedly performing graph compression and refinement steps to optimize the community partitioning multiple times. In each iteration, the community structure gradually stabilizes until the modularity no longer improves or its improvement becomes negligible, at which point the Leiden algorithm stops, thus obtaining the final community partitioning result.

[0084] As a preferred embodiment, based on the real-time operating status information, the equipment scheduling plan information and energy prediction information for the next moment, the real-time equipment adjustability, the real-time equipment power adjustment amount, and the control constraints, the state space, action space, reward function, and penalty function of the restricted Markov decision process are established respectively to train and obtain a basic small model, specifically including:

[0085] The state space is established based on the real-time operating status information and the equipment scheduling plan information for the next moment; wherein, the real-time operating status information includes line load rate, bus voltage, power generation of thermal power units and charging and discharging power of energy storage units, and the equipment scheduling plan information includes day-ahead scheduling plan information of thermal power units, day-ahead scheduling plan information of energy storage units, ultra-short-term wind power forecast information, ultra-short-term photovoltaic power forecast information and ultra-short-term load forecast information;

[0086] Based on the real-time adjustable capability of the equipment, the real-time adjustable power range of the thermal power unit and the real-time adjustable power range of the energy storage unit are determined respectively, and the action space is established according to the real-time adjustable power range of the thermal power unit and the real-time adjustable power range of the energy storage unit.

[0087] The reward function is established based on the negative value of the sum of the real-time equipment power adjustment of the thermal power unit and the real-time equipment power adjustment of the energy storage unit.

[0088] Based on the aforementioned control constraints, the power balance constraints, branch power flow upper and lower limits constraints, and bus voltage upper and lower limits constraints of the power system are determined, and the penalty function is established based on the aforementioned power balance constraints, branch power flow upper and lower limits constraints, and bus voltage upper and lower limits constraints.

[0089] Based on the state space, the action space, the reward function, and the penalty function, a safety reinforcement learning agent is established;

[0090] The security reinforcement learning agent is trained using the primal dual optimization method to obtain the basic small model.

[0091] Specifically, a Restricted Markov Decision Process (RPM) is a mathematical model describing sequential decision-making, used to simulate stochastic policies and rewards that an agent can achieve in stochastic environments where states possess Markov properties. A RPM can be described by a six-tuple (S, A, P, r, c, γ), where S represents the state space, A represents the action space, and P(s, A, P, r, c, γ) represents the action space. t+1 |s t ,a t ) describes the current state s t ∈S and action a t The next state s of ∈A t+1 The probability that r ∈ S. t =r(s t+1 ,s t ,a t ) and c t =c(s) t+1 ,s t ,a tγ describes the immediate reward and cost of the agent. γ∈[0,1] is the discount factor for the trade-off between current and future rewards / costs. Within the theoretical framework of a restricted Markov decision process, the agent's goal is to maximize the long-term reward under the constraint of not exceeding a cost threshold, i.e.:

[0092]

[0093] Where π represents the agent's policy, and T represents the number of time steps in the restricted Markov decision process. The cost threshold.

[0094] The state space is defined as follows:

[0095] This includes real-time operating status information, namely the line load rate ρ. t Bus voltage v t Thermal power unit power generation and the charging and discharging power of energy storage units The equipment scheduling plan information for the next moment, i.e., the day-ahead scheduling plan information for thermal power units. Day-ahead dispatching plan information for energy storage units Wind power ultra-short-term forecast information Photovoltaic power ultra-short-term forecast information and ultra-short-term load forecast information

[0096] Action space is defined as: The intelligent agent generates the original scheduling instructions α for thermal power units and energy storage units. t ∈[-1,1], and then, based on the real-time adjustable capabilities of each controlled device, convert it into actual output:

[0097]

[0098] in, and p i,t These represent the upper and lower limits of the adjustable power range of the controlled device i at time t, respectively.

[0099] The reward function is defined as follows: In this embodiment, the power adjustment amount in the real-time stage is used as the objective function for optimizing the model. Since the training objective of reinforcement learning is to maximize long-term reward, the reward function is taken as the negative value of the adjustment amount, as shown in the following formula:

[0100]

[0101] Penalty function c t Defined as:

[0102] Control commands that violate the power balance constraints of the power system Branch flow upper and lower limits constraints upper and lower limits of bus voltage constraints In such cases, a response penalty should be imposed on the agent, as shown in the following formula:

[0103]

[0104] This embodiment verifies whether the power balance constraint is satisfied by evaluating whether the balancing machine exceeds the limit, as shown in the following formula:

[0105]

[0106] in, To balance the real-time output of the generator unit, To balance the upper and lower limits of the unit's allowable output.

[0107]

[0108] Where, N Line This represents the total number of power grid lines.

[0109]

[0110] Where, N Bus This represents the total number of power grid busbars.

[0111] Furthermore, a primal dual optimization method is employed to train the security reinforcement learning agent, enabling it to satisfy all constraints while optimizing the total reward, achieving a dynamic balance between policy and constraints. Specifically, to improve the security of power grid regulation, constraints can be introduced into the standard Markov decision framework, transforming the problem into a restricted Markov decision process. In this case, the agent's goal is to maximize the long-term reward while satisfying the long-term cost constraint. The modeling of the restricted Markov decision process is as follows:

[0112] The Restricted Markov Decision Process (RPM) adds constraints on long-term discount costs to the standard Markov decision framework. Specifically, it assumes there are a total of m cost functions C1,...,C m Each cost function This represents the mapping between state-action pairs and their costs. Similar to reward payoffs, the long-term discounted cost payoff under policy π is defined as:

[0113]

[0114] The corresponding constraint threshold value is d i .

[0115] The goal of a constrained Markov decision process is to satisfy long-term cost-benefit requirements. In the case of maximizing the reward R(π), that is:

[0116]

[0117] When the constraints are satisfied, there is usually a saturation point. When this point is reached, it is no longer meaningful to continue reducing the value of the cost function. The value of the cost function at this point is the threshold value of the constraint.

[0118] Current algorithms for solving Restricted Markov Decision Processes (RPMs) mainly fall into two categories: primal-dual optimization (PDO) and constraint policy optimization (CPO). PDO is based on Lagrangian relaxation techniques, alternately updating the parameters of the primal and dual domains. Specifically, the primal policy parameters are updated using policy gradient ascent, while the dual domain parameters are updated using dual gradient ascent. The difference between CPO and PDO lies in the way the dual domain is updated. In CPO, each iteration directly solves for the dual parameters by solving a carefully designed optimization problem, ensuring that the constraints are satisfied during training. CPO is an extension of TRPO to RPMs.

[0119] To solve Restricted Markov Decision Processes (RPMs), the Lagrange relaxation technique can be used to combine the primal and dual optimization problems. Lagrange multipliers are introduced as penalty terms for the constraints, integrating them into the loss function. The algorithm continuously adjusts the balance between decision-making and constraints by alternately updating the policy and dual parameters, employing both policy gradient ascent and dual gradient ascent methods respectively, thereby optimizing the power grid scheduling problem. The following is a detailed description of the primal-dual optimization algorithm:

[0120] The Lagrangian function for the aforementioned restricted Markov decision process problem is:

[0121]

[0122] Where λ i =(λ1,…,λ) m () is the Lagrange factor. The original constrained optimization problem can be transformed into the following unconstrained optimization problem:

[0123]

[0124] To solve this unconstrained minmax problem, the standard approach is to use an iterative primal-dual method, where the primal policy π and the dual variable λ are updated alternately in each iteration. The primal-dual update process in the k-th iteration is as follows:

[0125] 1. Fix λ = λ (k) Execution strategy gradient ascent:

[0126]

[0127] Where, α k This indicates the update step size. The policy gradient here can be either an on-policy likelihood ratio policy gradient (such as REINFORCE and TRPO) or an off-policy deterministic policy gradient (such as DDPG).

[0128] 2. Fix π = π k Perform dual update:

[0129] x (k+1) =f k (λ (k) ,π k );

[0130] The difference between different methods in the restricted Markov decision process lies in the dual update function f. k The choice of (·). For example, the PDO algorithm uses a simple dual gradient ascent λ. i (k+1) =[λ i (k) +β k (C i (π k )-d i )] + , where β k It's the step size, [x] + =max{0,x} is the projection over the dual space λ≥0. In contrast, the CPO algorithm further strengthens the constraints by constructing a new optimization problem in each iteration to solve the dual variables.

[0131] As a preferred embodiment, the basic small model is fine-tuned using the control datasets and expert control experience data under different power system operation scenarios to obtain several small models for different power system operation scenarios, specifically including:

[0132] The aforementioned regulatory dataset is fused with the expert regulatory experience data to obtain a priori dataset;

[0133] Several control decision trajectories are obtained from the prior dataset; wherein, the control decision trajectories include action trajectories composed of several actions;

[0134] With maximizing action information entropy as the selection objective, several target control decision trajectories are selected from the aforementioned control decision trajectories to serve as a teaching dataset; wherein, the action information entropy is calculated based on the frequency of occurrence of each action in the action trajectory among all action trajectories in the selected teaching dataset;

[0135] The loss function is determined by a weighted sum of preset generation balance regularization term, renewable energy curtailment rate regularization term, and line load rate regularization term; wherein, the generation balance regularization term is used to guide the basic small model to meet the balance between grid generation and load consumption, the renewable energy curtailment rate regularization term is used to guide the basic small model to maximize the absorption of renewable energy, and the line load rate regularization term is used to guide the basic small model to reduce the line load rate.

[0136] Based on the loss function, the basic mini-model is fine-tuned using the teaching dataset to obtain several mini-models.

[0137] Specifically, assume that the currently available prior dataset is Ω, which contains n real-time control decision trajectories, i.e., T. n =(S n A n ), movement trajectory The prior actions corresponding to each decision moment are stored. When D trajectories are selected from the prior dataset Ω to construct the teaching dataset Λ, the action information entropy corresponding to Λ is calculated as follows:

[0138]

[0139] Where, p i Let represent the frequency of the i-th action in the action set among all action trajectories in the teaching dataset Λ. The higher the action information entropy, the stronger the action diversity corresponding to the teaching dataset.

[0140] Ultimately, the teaching dataset Λ can be optimally selected from the prior dataset based on maximizing the action information entropy. * :

[0141] Λ * =arg max H(a|Λ);

[0142] Furthermore, based on the general scheduling requirements regarding safety, economy, and cleanliness defined in the scheduling procedures, these requirements will be explicitly expressed as scheduling knowledge regularization terms using algebraic equations. These include generation balance regularization terms, renewable energy curtailment rate regularization terms, and line load rate regularization terms, thereby improving the model's convergence and generalization capabilities and enhancing its adaptability to changing scenarios. Scheduling knowledge regularization terms (reg) i The detailed explanation is as follows:

[0143] reg1 represents the generation balance regularization term, which aims to guide the basic small model to satisfy the balance between grid generation and load consumption. Its expression is as follows:

[0144]

[0145] Where Ω∪W represents the set of thermal power units and the set of wind power units; This represents the difference in load d between time period t and time period t-1; This represents the adjustment amount of generator i's output during time period t and time period t-1.

[0146] reg2 represents the regularization term for renewable energy curtailment rate, which aims to guide the basic small model to maximize the absorption of renewable energy and reduce the wind curtailment rate. Its expression is as follows:

[0147]

[0148] in, This represents the output of the new energy generator i during time period t. This represents the adjustment amount of the output of the new energy generator i during the time period t and t-1. This represents the predicted maximum output value of the new energy generating unit.

[0149] reg3 represents the line load rate regularization term, which aims to guide the basic small model to reduce the line load rate and prevent the line from exceeding limits. Its expression is as follows:

[0150]

[0151] Among them, PTDF k,i This indicates the sensitivity of generator i's power change to line k's power flow change. a represents the transmission capacity of line k. k This represents the expected threshold for the line load rate k. The line load rate is calculated based on AC power flow calculation results and Taylor's first-order formula, which significantly simplifies the explicit relationship between the line active power load rate and the agent's actions (unit active power change value), but at the same time introduces a certain amount of error.

[0152] The terms of the scheduling knowledge regularization terms mentioned above have different dimensions. By assigning different weights to each scheduling knowledge regularization term, the terms are made to be of similar magnitude before being summed. The loss function L2 is defined as follows:

[0153]

[0154] Among them, w i The weight of the scheduling knowledge regularization term, reg i (·) indicates the action a on the output. t Regularization is applied to guide the agent to limit its optimization direction to the feasible domain of the power system.

[0155] In summary, during the initial training phase, the agent learns from historical scheduling experience to establish a mapping relationship between inputs and outputs, thus avoiding blind exploration. As training progresses, the agent enters a transition period where it no longer delves deeply into the relationships between outputs. Therefore, it needs to reduce its reliance on historical outputs and instead introduce explicit scheduling knowledge for guidance. In the later stages of training, guided by scheduling knowledge, the agent prioritizes load allocation to renewable energy sources and ensures that the optimization search remains within the feasible range of the power system, thereby improving the model's generalization ability.

[0156] As a preferred embodiment, the decomposition of the structured information of the regulation task into several regulation sub-tasks specifically includes:

[0157] The real-time operating status information and the prior control information are fused to obtain comprehensive input information;

[0158] According to a preset decision decomposition strategy, the structured information of the control task is decomposed to obtain several subtasks that constitute the structured information of the control task. The subtasks are further decomposed until a metatask is obtained, forming a control task decomposition tree. The metatask is a task that cannot be further decomposed, the structured information of the control task is the root node of the control task decomposition tree, the subtask is the child node of the control task decomposition tree, and the metatask is the leaf node of the control task decomposition tree.

[0159] Based on the aforementioned control task decomposition tree, a meta-task set is obtained;

[0160] Based on the meta-task set, several control sub-tasks are obtained, and the comprehensive input information is used as the decision information for the control sub-tasks.

[0161] Specifically, to address the issues of complex processes, numerous tasks, and low efficiency in submodule invocation during digital power grid control, this embodiment employs a decision decomposition method based on information fusion and task trees. This method utilizes logic gates to construct a qualitative causal model, clarifying the logical relationships between events, and establishes mathematical expressions for the task tree through structure functions, enabling qualitative analysis and quantitative calculation of tasks. The introduction of a minimum cut set-based decomposition mechanism allows for the autonomous breakdown of objectives according to task requirements, refining complex decision-making tasks into single tasks, which are then processed separately by smaller models, thereby simplifying the control process and improving efficiency.

[0162] Information fusion and task tree-based decision decomposition methods are used to break down complex power grid control tasks into a series of smaller tasks, facilitating separate decision optimization. Information fusion refers to integrating various data from different sources or at different times into a comprehensive input information to make more accurate decisions. In power grid control, information fusion can include the following aspects:

[0163] Data fusion: combining information from different sensors, monitoring systems, historical data, etc., to form a comprehensive understanding of the power grid status.

[0164] Knowledge fusion: Combining expert knowledge with machine learning models and data analysis results to improve decision-making effectiveness.

[0165] Suppose there are multiple sets of data x1, x2, ..., x from different sources. n Information fusion can be performed using methods such as weighted averaging, weighted summation, or Bayesian inference.

[0166]

[0167] Where, ω i x represents the weights of each data source. i Let be the information from the i-th data source. By adjusting the weights, the influence of different information sources on the final decision can be controlled.

[0168] Task trees are hierarchical structures that decompose complex tasks into multiple subtasks, each of which is a relatively simple decision problem that can be handled by a small model. This method effectively reduces computational complexity, enabling each subtask to make decisions quickly and efficiently.

[0169] The task tree structure includes a root node (representing the entire complex task, i.e., the overall goal of power grid regulation), child nodes (decomposing the root node task into multiple sub-tasks, typically further refined into smaller tasks based on their nature), and leaf nodes (the smallest unit tasks, capable of independent decision optimization). By recursively decomposing tasks, the task tree ensures that each smaller task can be processed using a relatively simplified model. For example, tasks in power grid regulation might include load allocation, power balancing, and equipment scheduling.

[0170] The principles of decision decomposition include:

[0171] Hierarchical approach: Decompose large tasks into multiple levels, with each level addressing different sub-tasks.

[0172] Prioritization: Make decisions based on task priority, solving the most important tasks first, and then dealing with other smaller tasks.

[0173] Solvability: Each subtask should be simple enough to be solved independently using local optimization methods.

[0174] Based on the above decision decomposition principles, the decision decomposition strategy can be set as follows: task decomposition is performed based on a preset task hierarchy structure, which includes the decomposition relationships between different overall control tasks, sub-tasks and meta-tasks.

[0175] In the decision decomposition process, there is an overall decision problem D, which is decomposed into multiple subtasks T1, T2, ..., T n Each subtask has a separate decision variable u. i The overall decision can be expressed as:

[0176]

[0177] Among them, f i (u i ) is the loss function or objective function of the i-th subtask.

[0178] The power system regulation method provided in this invention leverages the advantages of large language models in text semantic understanding and knowledge extraction. It transforms unstructured information input by users representing regulation task requirements into structured information for the regulation task. This allows for full consideration of users' experience in power system anomalies during regulation, aiding in the judgment of such anomalies. Furthermore, through the collaborative operation of the large language model and pre-trained small models, reliable optimized regulation strategies can be effectively generated for different regulation sub-tasks while adhering to regulation constraints. This demonstrates comprehensiveness and adaptability to regulation in various power system operation scenarios.

[0179] Please see Figure 2A second aspect of the present invention provides a power system control device, comprising:

[0180] The human-computer interaction module 101 is used to obtain the real-time operating status information of the current power system and the control task requirements input by the user based on the human-computer interaction interface of the large language model, and to convert the real-time operating status information and control task requirements into structured control task information.

[0181] The control task decomposition module 102 is used to decompose the structured information of the control task into several control sub-tasks.

[0182] The optimized control strategy generation module 103 is used to generate optimized control strategies corresponding to each of the control sub-tasks through several pre-trained small models; wherein, the small models are obtained by training based on the prior control information and control constraints of the power system.

[0183] As a preferred embodiment, the method apparatus further includes a small model training module, used for:

[0184] The preset power system dispatching procedure information is preprocessed, and the entities and relationships between the entities in the preprocessed power system dispatching procedure information are extracted; wherein, the power system dispatching procedure information includes dispatching specification text, dispatching operation plan and historical dispatching operation record;

[0185] Equipment information is extracted from the preprocessed power system dispatching procedure information, and the entities, the relationships between the entities, and the equipment information are fused together to construct a power system control knowledge graph.

[0186] The Leiden community detection algorithm was used to divide the power system regulation knowledge graph into communities to obtain regulation datasets under different power system operation scenarios.

[0187] The power system scheduling optimization problem is transformed into a restricted Markov decision process. Based on the real-time operating status information, the equipment scheduling plan information and energy forecast information at the next moment, the real-time equipment adjustability, the real-time equipment power adjustment amount, and the control constraints, the state space, action space, reward function, and penalty function of the restricted Markov decision process are established respectively to train and obtain a basic small model.

[0188] The basic small model is fine-tuned using the control datasets and expert control experience data under different power system operation scenarios to obtain several small models for different power system operation scenarios.

[0189] As a preferred embodiment, the small model training module is used to preprocess the preset power system dispatching procedure information, specifically including:

[0190] The power system dispatching procedure information is parsed, and the valid text of power system dispatching is extracted;

[0191] The effective text of the power system dispatch is cleaned and regularized.

[0192] The effective text of power system scheduling after data cleaning and rule-based processing is mapped to a preset knowledge graph ontology model to establish entity relationship mapping rules corresponding to the effective text of power system scheduling after data cleaning and rule-based processing, thereby obtaining the preprocessed power system scheduling procedure information.

[0193] As a preferred embodiment, the small model training module is used to perform community partitioning on the power system regulation knowledge graph using the Leiden community detection algorithm to obtain regulation datasets under different power system operation scenarios, specifically including the following steps S11 to S13:

[0194] Step S11: Using each entity as a node in the power system regulation knowledge graph, each node is considered as a community, and the modularity corresponding to each node moving to its adjacent community is calculated.

[0195] Step S12: When any node moves to an adjacent community and its modularity increases, the node is assigned to that adjacent community. This step is repeated until no node moves to an adjacent community and its modularity increases, resulting in several partitioned communities.

[0196] Step S13: Each of the divided communities is taken as a new node, and the step of calculating the modularity of each node moving to its neighboring community in step S11 is repeated until the modularity of the current community division result no longer increases. The current community division result is taken as the control dataset under different power system operation scenarios.

[0197] As a preferred embodiment, the small model training module is used to establish the state space, action space, reward function, and penalty function of the restricted Markov decision process based on the real-time operating status information, the equipment scheduling plan information and energy prediction information at the next moment, the real-time equipment adjustability, the real-time equipment power adjustment amount, and the control constraints, respectively, in order to train and obtain a basic small model, specifically including:

[0198] The state space is established based on the real-time operating status information and the equipment scheduling plan information for the next moment; wherein, the real-time operating status information includes line load rate, bus voltage, power generation of thermal power units and charging and discharging power of energy storage units, and the equipment scheduling plan information includes day-ahead scheduling plan information of thermal power units, day-ahead scheduling plan information of energy storage units, ultra-short-term wind power forecast information, ultra-short-term photovoltaic power forecast information and ultra-short-term load forecast information;

[0199] Based on the real-time adjustable capability of the equipment, the real-time adjustable power range of the thermal power unit and the real-time adjustable power range of the energy storage unit are determined respectively, and the action space is established according to the real-time adjustable power range of the thermal power unit and the real-time adjustable power range of the energy storage unit.

[0200] The reward function is established based on the negative value of the sum of the real-time equipment power adjustment of the thermal power unit and the real-time equipment power adjustment of the energy storage unit.

[0201] Based on the aforementioned control constraints, the power balance constraints, branch power flow upper and lower limits constraints, and bus voltage upper and lower limits constraints of the power system are determined, and the penalty function is established based on the aforementioned power balance constraints, branch power flow upper and lower limits constraints, and bus voltage upper and lower limits constraints.

[0202] Based on the state space, the action space, the reward function, and the penalty function, a safety reinforcement learning agent is established;

[0203] The security reinforcement learning agent is trained using the primal dual optimization method to obtain the basic small model.

[0204] As a preferred embodiment, the small model training module is used to fine-tune the basic small model using the control dataset and expert control experience data under different power system operation scenarios, to obtain several small models for different power system operation scenarios, specifically including:

[0205] The aforementioned regulatory dataset is fused with the expert regulatory experience data to obtain a priori dataset;

[0206] Several control decision trajectories are obtained from the prior dataset; wherein, the control decision trajectories include action trajectories composed of several actions;

[0207] With maximizing action information entropy as the selection objective, several target control decision trajectories are selected from the aforementioned control decision trajectories to serve as a teaching dataset; wherein, the action information entropy is calculated based on the frequency of occurrence of each action in the action trajectory among all action trajectories in the selected teaching dataset;

[0208] The loss function is determined by a weighted sum of preset generation balance regularization term, renewable energy curtailment rate regularization term, and line load rate regularization term; wherein, the generation balance regularization term is used to guide the basic small model to meet the balance between grid generation and load consumption, the renewable energy curtailment rate regularization term is used to guide the basic small model to maximize the absorption of renewable energy, and the line load rate regularization term is used to guide the basic small model to reduce the line load rate.

[0209] Based on the loss function, the basic mini-model is fine-tuned using the teaching dataset to obtain several mini-models.

[0210] As a preferred embodiment, the control task decomposition module 102 is used to decompose the structured information of the control task into several control sub-tasks, specifically including:

[0211] The real-time operating status information and the prior control information are fused to obtain comprehensive input information;

[0212] According to a preset decision decomposition strategy, the structured information of the control task is decomposed to obtain several subtasks that constitute the structured information of the control task. The subtasks are further decomposed until a metatask is obtained, forming a control task decomposition tree. The metatask is a task that cannot be further decomposed, the structured information of the control task is the root node of the control task decomposition tree, the subtask is the child node of the control task decomposition tree, and the metatask is the leaf node of the control task decomposition tree.

[0213] Based on the aforementioned control task decomposition tree, a meta-task set is obtained;

[0214] Based on the meta-task set, several control sub-tasks are obtained, and the comprehensive input information is used as the decision information for the control sub-tasks.

[0215] The power system control device provided in this invention leverages the advantages of large language models in text semantic understanding and knowledge extraction to transform unstructured information input by users representing control task requirements into structured information for control tasks. This allows the device to fully consider users' experience in power system anomalies during power system control, aiding in the judgment of such anomalies. Furthermore, through the collaborative operation of the large language model and pre-trained small models, reliable optimized control strategies can be effectively generated for different control sub-tasks while adhering to control constraints, demonstrating comprehensiveness and adaptability to control in different power system operating scenarios.

[0216] A third aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the power system control method described in any embodiment of the first aspect.

[0217] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.

[0218] The electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that the schematic diagram is merely an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.

[0219] The processor can 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. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the electronic device, connecting all parts of the electronic device via various interfaces and lines.

[0220] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0221] A fourth aspect of the present invention provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the power system control method described in any embodiment of the first aspect.

[0222] Wherein, if the modules / units integrated in the electronic device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0223] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A power system control method, characterized in that, include: Based on the human-computer interaction interface of the large language model, the system obtains the real-time operating status information of the current power system and the control task requirements input by the user, and transforms the real-time operating status information and control task requirements into structured control task information. The structured information of the control task is decomposed into several control sub-tasks; The optimized control strategies corresponding to each of the control sub-tasks are generated by several pre-trained small models; wherein, the small models are obtained by training based on the prior control information and control constraints of the power system. The method specifically obtains the small model through the following steps: The preset power system dispatching procedure information is preprocessed, and the entities and relationships between the entities in the preprocessed power system dispatching procedure information are extracted; wherein, the power system dispatching procedure information includes dispatching specification text, dispatching operation plan and historical dispatching operation record; Equipment information is extracted from the preprocessed power system dispatching procedure information, and the entities, the relationships between the entities, and the equipment information are fused together to construct a power system control knowledge graph. The Leiden community detection algorithm was used to divide the power system regulation knowledge graph into communities to obtain regulation datasets under different power system operation scenarios. The power system scheduling optimization problem is transformed into a restricted Markov decision process. Based on the real-time operating status information, the equipment scheduling plan information and energy forecast information at the next moment, the real-time equipment adjustability, the real-time equipment power adjustment amount, and the control constraints, the state space, action space, reward function, and penalty function of the restricted Markov decision process are established respectively to train and obtain a basic small model. The basic small model is fine-tuned using the control datasets and expert control experience data under different power system operation scenarios to obtain several small models for different power system operation scenarios.

2. The power system control method as described in claim 1, characterized in that, The preprocessing of the preset power system dispatching procedure information specifically includes: The power system dispatching procedure information is parsed, and the valid text of power system dispatching is extracted; The effective text of the power system dispatch is cleaned and regularized. The effective text of power system scheduling after data cleaning and rule-based processing is mapped to a preset knowledge graph ontology model to establish entity relationship mapping rules corresponding to the effective text of power system scheduling after data cleaning and rule-based processing, thereby obtaining the preprocessed power system scheduling procedure information.

3. The power system control method as described in claim 1, characterized in that, The step of using the Leiden community detection algorithm to divide the power system control knowledge graph into communities to obtain control datasets under different power system operation scenarios specifically includes the following steps S11 to S13: Step S11: Using each entity as a node in the power system regulation knowledge graph, each node is considered as a community, and the modularity corresponding to each node moving to its adjacent community is calculated. Step S12: When any node moves to an adjacent community and its modularity increases, the node is assigned to that adjacent community. This step is repeated until no node moves to an adjacent community and its modularity increases, resulting in several partitioned communities. Step S13: Each of the divided communities is taken as a new node, and the step of calculating the modularity of each node moving to its neighboring community in step S11 is repeated until the modularity of the current community division result no longer increases. The current community division result is taken as the control dataset under different power system operation scenarios.

4. The power system control method as described in claim 1, characterized in that, Based on the real-time operating status information, the equipment scheduling plan information and energy prediction information for the next moment, the real-time equipment adjustability, the real-time equipment power adjustment amount, and the control constraints, the state space, action space, reward function, and penalty function of the restricted Markov decision process are established respectively to train and obtain a basic small model, specifically including: The state space is established based on the real-time operating status information and the equipment scheduling plan information for the next moment; wherein, the real-time operating status information includes line load rate, bus voltage, power generation of thermal power units and charging and discharging power of energy storage units, and the equipment scheduling plan information includes day-ahead scheduling plan information of thermal power units, day-ahead scheduling plan information of energy storage units, ultra-short-term wind power forecast information, ultra-short-term photovoltaic power forecast information and ultra-short-term load forecast information; Based on the real-time adjustable capability of the equipment, the real-time adjustable power range of the thermal power unit and the real-time adjustable power range of the energy storage unit are determined respectively, and the action space is established according to the real-time adjustable power range of the thermal power unit and the real-time adjustable power range of the energy storage unit. The reward function is established based on the negative value of the sum of the real-time equipment power adjustment of the thermal power unit and the real-time equipment power adjustment of the energy storage unit. Based on the aforementioned control constraints, the power balance constraints, branch power flow upper and lower limits constraints, and bus voltage upper and lower limits constraints of the power system are determined, and the penalty function is established based on the aforementioned power balance constraints, branch power flow upper and lower limits constraints, and bus voltage upper and lower limits constraints. Based on the state space, the action space, the reward function, and the penalty function, a safety reinforcement learning agent is established; The security reinforcement learning agent is trained using the primal dual optimization method to obtain the basic small model.

5. The power system control method as described in claim 1, characterized in that, The basic small model is fine-tuned using the control datasets and expert control experience data under different power system operation scenarios to obtain several small models for different power system operation scenarios, specifically including: The aforementioned regulatory dataset is fused with the expert regulatory experience data to obtain a priori dataset; Several control decision trajectories are obtained from the prior dataset; wherein, the control decision trajectories include action trajectories composed of several actions; With maximizing action information entropy as the selection objective, several target control decision trajectories are selected from the aforementioned control decision trajectories to serve as a teaching dataset; wherein, the action information entropy is calculated based on the frequency of occurrence of each action in the action trajectory among all action trajectories in the selected teaching dataset; The loss function is determined by a weighted sum of preset generation balance regularization term, renewable energy curtailment rate regularization term, and line load rate regularization term; wherein, the generation balance regularization term is used to guide the basic small model to meet the balance between grid generation and load consumption, the renewable energy curtailment rate regularization term is used to guide the basic small model to maximize the absorption of renewable energy, and the line load rate regularization term is used to guide the basic small model to reduce the line load rate. Based on the loss function, the basic mini-model is fine-tuned using the teaching dataset to obtain several mini-models.

6. The power system control method as described in claim 1, characterized in that, The step of decomposing the structured information of the regulation task into several regulation sub-tasks specifically includes: The real-time operating status information and the prior control information are fused to obtain comprehensive input information; According to a preset decision decomposition strategy, the structured information of the control task is decomposed to obtain several subtasks that constitute the structured information of the control task. The subtasks are further decomposed until a metatask is obtained, forming a control task decomposition tree. The metatask is a task that cannot be further decomposed, the structured information of the control task is the root node of the control task decomposition tree, the subtask is the child node of the control task decomposition tree, and the metatask is the leaf node of the control task decomposition tree. Based on the aforementioned control task decomposition tree, a meta-task set is obtained; Based on the meta-task set, several control sub-tasks are obtained, and the comprehensive input information is used as the decision information for the control sub-tasks.

7. A power system control device, characterized in that, include: The human-computer interaction module is used to obtain the real-time operating status information of the current power system and the control task requirements input by the user based on the human-computer interaction interface of the large language model, and to transform the real-time operating status information and control task requirements into structured control task information. The control task decomposition module is used to decompose the structured information of the control task into several control sub-tasks. An optimized control strategy generation module is used to generate optimized control strategies corresponding to each of the control sub-tasks through several pre-trained small models; wherein, the small models are obtained by training based on the prior control information and control constraints of the power system; The device also includes a small model training module for: The preset power system dispatching procedure information is preprocessed, and the entities and relationships between the entities in the preprocessed power system dispatching procedure information are extracted; wherein, the power system dispatching procedure information includes dispatching specification text, dispatching operation plan and historical dispatching operation record; Equipment information is extracted from the preprocessed power system dispatching procedure information, and the entities, the relationships between the entities, and the equipment information are fused together to construct a power system control knowledge graph. The Leiden community detection algorithm was used to divide the power system regulation knowledge graph into communities to obtain regulation datasets under different power system operation scenarios. The power system scheduling optimization problem is transformed into a restricted Markov decision process. Based on the real-time operating status information, the equipment scheduling plan information and energy forecast information at the next moment, the real-time equipment adjustability, the real-time equipment power adjustment amount, and the control constraints, the state space, action space, reward function, and penalty function of the restricted Markov decision process are established respectively to train and obtain a basic small model. The basic small model is fine-tuned using the control datasets and expert control experience data under different power system operation scenarios to obtain several small models for different power system operation scenarios.

8. An electronic device, characterized in that, The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the power system control method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform the power system control method according to any one of claims 1 to 6.