Power grid dispatching method and device, electronic equipment and storage medium

By constructing a protagonist agent and an adversary agent, and based on a robust objective function and contrastive representation learning, the power grid dispatching strategy is optimized, which solves the problem of insufficient robustness of the power grid dispatching system under interference environment and improves the stability and security of the power grid.

CN121663473APending Publication Date: 2026-03-13YANGZHOU POWER SUPPLY BRANCH OF STATE GRID JIANGSU ELECTRIC POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-03
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

The existing power grid dispatching system is not robust enough in the face of interference such as natural disasters, human sabotage and physical network attacks, which makes the power grid dispatching unable to respond effectively. This may lead to local line overload and cascading failures, or even power outages of the entire power grid, resulting in economic losses.

Method used

The system constructs a protagonist intelligent agent and an adversary intelligent agent, builds a robust objective function through the expected reward function, determines the target sample features based on contrastive representation learning and positive and negative samples, and solves the target scheduling strategy using methods such as dynamic programming and greedy algorithms. The system also introduces robustness indicators to improve the stability of power grid scheduling.

Benefits of technology

It has improved the efficiency and accuracy of power grid dispatching, enhanced the stability of the power grid system, reduced the impact of faults, and ensured the safe and reliable operation of the power grid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121663473A_ABST
    Figure CN121663473A_ABST
Patent Text Reader

Abstract

The invention discloses a power grid dispatching method and device, electronic equipment and a storage medium, and the method is applied to the technical field of computer application, and comprises the steps: constructing a leading agent and an opponent agent based on a target power grid, constructing a robustness objective function according to the expected reward functions of the protagonist agent and the opponent agent; constructing positive and negative samples according to a power grid dispatching task of the target power grid, and determining target sample features associated with the main agent and the opponent agent based on comparative representation learning and the positive and negative samples; and determining a target scheduling strategy of the target power grid based on the target sample features and the robustness target function. The embodiment of the invention can pay attention to the robustness index in the power grid dispatching process, can improve the operation stability of the power grid, and reduces the fault influence of the power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer application technology, and more particularly to a power grid dispatching method, apparatus, electronic device, and storage medium. Background Technology

[0002] Grid dispatching is a key component of smart grids, responsible for controlling and managing the production, transmission, and distribution of electricity. It ensures the security, reliability, and economy of electricity supply by maintaining a balance between supply and demand and managing all components of the grid. Effective grid dispatching can balance supply and demand, optimize resource allocation, reduce energy waste, and respond quickly to emergencies such as equipment failures or extreme weather events, thereby guaranteeing the safe and reliable operation of the grid. Therefore, grid dispatching is the cornerstone for maintaining normal societal functioning and promoting sustainable energy development.

[0003] While power grid dispatch is crucial, its quality has faced numerous challenges in recent years. On one hand, power grid systems may encounter various disturbances, including natural disasters, human-caused damage, and physical network attacks that can occur in modern power systems. Dispatching systems must remain operational and effective even under these disruptive conditions. On the other hand, with the development of large-scale power grids and the integration of new energy sources such as wind and solar power, the structure of power grid dispatch has become increasingly complex, potentially leading to abnormal dispatch statuses and hindering the proper allocation of grid resources. These problems complicate power grid dispatch, potentially causing localized line overloads and cascading faults, and in severe cases, resulting in grid-wide blackouts and significant economic losses. Current power grid dispatching focuses primarily on optimization, improving efficiency and accuracy, while neglecting robustness. Summary of the Invention

[0004] This invention provides a power grid dispatching method, apparatus, electronic device, and storage medium, which can focus on robustness indicators during power grid dispatching, improve the stability of power grid operation, and reduce the impact of power grid faults.

[0005] According to one aspect of the present invention, an embodiment of the present invention provides a power grid dispatching method, wherein the method includes:

[0006] Based on the target power grid, construct a protagonist agent and an adversary agent, and construct a robust objective function according to the expected reward functions of the protagonist agent and the adversary agent;

[0007] Positive and negative samples are constructed based on the grid scheduling task of the target power grid, and the target sample features associated with the protagonist agent and the opponent agent are determined based on contrastive representation learning.

[0008] The target scheduling strategy for the target power grid is determined based on the target sample characteristics and the robust objective function.

[0009] According to another aspect of the present invention, embodiments of the present invention also provide a power grid dispatching device, wherein the device comprises:

[0010] The robust objective module is used to construct a protagonist agent and an adversary agent based on the target power grid, and to construct a robust objective function based on the expected reward functions of the protagonist agent and the adversary agent.

[0011] The data acquisition module is used to construct positive and negative samples based on the grid scheduling task of the target power grid, and determine the target sample features associated with the protagonist agent and the opponent agent based on contrastive representation learning.

[0012] The scheduling strategy module is used to determine the target scheduling strategy of the target power grid based on the target sample characteristics and the robust objective function.

[0013] According to another aspect of the present invention, embodiments of the present invention also provide an electronic device, wherein the electronic device includes:

[0014] At least one processor; and

[0015] A memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the power grid dispatching method described in any one of the embodiments of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the power grid dispatching method according to any embodiment of the present invention.

[0018] The technical solution of this invention involves constructing a protagonist agent and a rival agent for the target power grid, determining the expected reward functions for both agents, and then determining a robustness objective function based on these expected reward functions. Positive and negative samples are determined based on the power grid scheduling task of the target power grid. Target sample features associated with the protagonist agent and rival agent are determined using contrastive representation learning and the positive and negative samples. The robustness objective function is then solved according to these target sample features, thereby obtaining the target scheduling strategy for the target power grid. This invention can construct a robustness objective function through an adversarial approach between the protagonist agent and the rival agent, introducing robustness indicators into the power grid scheduling process. Quantifying these robustness indicators using sample features related to the power grid scheduling task can improve the efficiency and accuracy of the scheduling process, thus contributing to enhanced stability of the power grid system. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart of a power grid dispatching method provided in Embodiment 1 of the present invention;

[0021] Figure 2 This is a flowchart of another power grid dispatching method provided in Embodiment 2 of the present invention;

[0022] Figure 3 This is a flowchart of another power grid dispatching method provided in Embodiment 3 of the present invention;

[0023] Figure 4 This is a flowchart of another power grid dispatching method provided in Embodiment 4 of the present invention;

[0024] Figure 5 This is a flowchart of another power grid dispatching method provided in Embodiment 5 of the present invention;

[0025] Figure 6 This is an example diagram of another power grid dispatching method provided in Embodiment Six of the present invention;

[0026] Figure 7 This is a schematic diagram of the structure of a power grid dispatching device according to Embodiment Seven of the present invention;

[0027] Figure 8 This is a schematic diagram of the structure of an electronic device that implements the power grid dispatching method of this invention. Detailed Implementation

[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. 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 should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0030] Example 1

[0031] Figure 1 This is a flowchart of a power grid dispatching method provided in Embodiment 1 of the present invention. This embodiment is applicable to scenarios where the power grid dispatching process is optimized based on robustness indicators. The method can be executed by a power grid dispatching device, which can be implemented in hardware and / or software. This device can be configured in the power grid's host computer, which may include a server or control terminal. Figure 1 As shown, the method includes:

[0032] Step 110: Construct the protagonist agent and the adversary agent based on the target power grid, and construct a robust objective function based on the expected reward functions of the protagonist agent and the adversary agent.

[0033] The target power grid can be a power grid system to be optimized for scheduling, including but not limited to local power grids, regional power grids, and microgrids. The protagonist agent can be an agent or set of rules within the target power grid that performs power grid scheduling tasks, while the adversary agent can be a set of operational rules or agents within the target power grid that interfere with its robustness. The expected reward function can be a mapping function between the decisions made by the protagonist agent and the adversary agent and the reward points they receive. This expected reward function can be based on the actual operational settings of the target power grid. The robustness objective function can be a function describing the mapping relationship between the scheduling strategy and robustness indicators of the target power grid. This robustness objective function can be constructed based on the expected reward functions of the protagonist agent and the adversary agent; for example, the difference between their expected reward functions or the ratio of their expected reward functions can be used as the robustness objective function.

[0034] In this embodiment of the invention, the grid dispatch rules of the target power grid can be determined as the protagonist agent and the adversary agent. Expected reward functions can be set according to the degree of influence of the protagonist agent and the adversary agent on the robustness of grid dispatch. The expected reward functions of the protagonist agent and the adversary agent can be constructed as robust objective functions.

[0035] Step 120: Construct positive and negative samples based on the grid dispatching task of the target power grid, and determine the target sample features associated with the protagonist agent and the opponent agent based on contrastive representation learning and positive and negative samples.

[0036] Among them, the power grid dispatching task can be a task that dispatches the target power grid. The power grid dispatching task can be an existing dispatching task that has a positive or negative impact on the target power grid within a certain period of time. Positive and negative samples can be sample data generated based on the power grid dispatching task. Positive and negative samples can include positive samples and negative samples.

[0037] Specifically, grid scheduling tasks within the target grid can be extracted. These tasks can be categorized into positive and negative samples based on their positive and negative impacts on the target grid. Sample data can be generated from these positive and negative samples. The generated sample data can then be used as positive and negative samples. By comparing and learning the representations of the positive and negative samples, target sample features that are related to the protagonist and adversary agents within the positive and negative samples can be obtained.

[0038] Step 130: Determine the target scheduling strategy of the target power grid based on the target sample characteristics and the robust objective function.

[0039] In this embodiment of the invention, the target sample features can be substituted into the robustness objective function to obtain a scheduling strategy that maximizes the robustness of the robustness objective function. This scheduling strategy can be used as the target scheduling strategy. The methods for solving the robustness objective function based on the target sample features may include, but are not limited to, dynamic programming, greedy algorithms, linear programming, and near-end policy optimization algorithms.

[0040] This invention, in its embodiments, constructs a protagonist agent and a rival agent for a target power grid, determines the expected reward functions of the protagonist and rival agents, and determines a robustness objective function based on these expected reward functions. Positive and negative samples are determined based on the power grid scheduling task of the target power grid. Target sample features associated with the protagonist and rival agents are determined based on contrastive representation learning and the positive and negative samples. The robustness objective function is then solved according to these target sample features, thereby obtaining the target scheduling strategy for the target power grid. This invention can construct a robustness objective function through an adversarial approach between the protagonist and rival agents, introducing robustness indicators into the power grid scheduling process. These robustness indicators are quantified using sample features related to the power grid scheduling task, which can improve the efficiency and accuracy of the scheduling process and contribute to enhancing the stability of the power grid system.

[0041] Example 2

[0042] Figure 2 This is a flowchart of another power grid dispatching method provided in Embodiment 2 of the present invention. The embodiments of the present invention illustrate the construction process of the robustness objective function. See [link to documentation]. Figure 2 The method provided in this embodiment of the invention specifically includes the following steps:

[0043] Step 210: Set the power grid dispatching agent of the target power grid as the main agent and the interference factors of the target power grid as the adversary agent.

[0044] Among them, the power grid dispatching agent can be an agent that performs power grid dispatching within the target power grid, and the interference factors can be factors within the target power grid that affect the robustness of dispatching. Interference factors can include, but are not limited to, natural disasters, human-caused damage, physical network attacks, etc.

[0045] In this embodiment of the invention, the power grid scheduling agent and interference factors of the target power grid can be obtained. The power grid scheduling agent can be set as the main agent, and the rule set of the interference factors can be set as the adversary agent.

[0046] Step 220: Determine the state space, action space, transition probability, and expected reward function of the protagonist agent and the opponent agent respectively according to the power grid state of the target power grid.

[0047] Specifically, the power grid state of the target power grid can be collected. This power grid state can include the target power grid's operating state, control operations, and the transition relationships between different control operations. Based on the acquired operating state, control operations, and transition relationships between different control operations, the state space, action space, transition probabilities, and expected reward function of the protagonist agent and the opponent agent can be constructed. The state space includes various operating states of the target power grid, the action space can include various executable control actions within the target power grid, the transition probabilities can be the probabilities of the transition relationships between different operating states affected by various control actions, and the expected reward function can be the impact of the control action decisions made by the protagonist agent and the opponent agent on the incentives.

[0048] Step 230: Use the difference between the expected reward functions of the protagonist agent and the opponent agent as the first objective function.

[0049] Specifically, the difference between the expected reward function of the protagonist's intelligent agent and the expected reward function of the opponent's intelligent agent can be obtained, and this difference can be used as the first objective function.

[0050] Step 240: Obtain the scheduling objective function of the target power grid, and use the weighted sum of the scheduling objective function and the first objective function as the robustness objective function.

[0051] The scheduling objective function can be an existing objective function used to determine the grid scheduling strategy in the target grid. The scheduling objective function can be determined based on the existing grid scheduling strategy.

[0052] In this embodiment of the invention, the existing scheduling objective function of the target power grid can be obtained. The weighted sum of the scheduling objective function and the first objective function can be used as the robustness objective function. This scheduling objective function can reflect the determination process of the existing scheduling strategy of the target power grid, while the first objective function can reflect the mapping relationship between the robustness of the target power grid and the scheduling strategy. At a certain moment, the target power grid uses an intelligent agent.

[0053] Step 250: Construct positive and negative samples based on the grid dispatching task of the target power grid, and determine the target sample features associated with the protagonist agent and the opponent agent based on contrastive representation learning and positive and negative samples.

[0054] Specifically, grid scheduling tasks within the target grid can be extracted. These tasks can be categorized into positive and negative samples based on their positive and negative impacts on the target grid. Sample data can be generated from these positive and negative samples. The generated sample data can then be used as positive and negative samples. By comparing and learning the representations of the positive and negative samples, target sample features that are related to the protagonist and adversary agents within the positive and negative samples can be obtained.

[0055] Step 260: Determine the target scheduling strategy for the target power grid based on the target sample characteristics and the robust objective function.

[0056] In this embodiment of the invention, the target sample features can be substituted into the robustness objective function to obtain a scheduling strategy that maximizes the robustness of the robustness objective function. This scheduling strategy can be used as the target scheduling strategy. The methods for solving the robustness objective function based on the target sample features may include, but are not limited to, dynamic programming, greedy algorithms, linear programming, and near-end policy optimization algorithms.

[0057] In this embodiment of the invention, the grid dispatching agent of the target power grid is set as the protagonist agent, and the interference factors of the target power grid are set as adversary agents. The state space, action space, transition probability, and expected reward function of the protagonist agent and adversary agent are determined according to the grid state of the target power grid. The difference between the expected reward functions of the protagonist agent and adversary agent is used as the first objective function to obtain the scheduling objective function of the target power grid. The weighted sum of the scheduling objective function and the first objective function is used as the robustness objective function. Based on contrastive representation learning and positive and negative samples, the target sample features associated with the protagonist agent and adversary agent are determined. The robustness objective function is solved according to the target sample features to obtain the target scheduling strategy for the target power grid. This embodiment of the invention can construct a robustness objective function through an adversarial approach between the protagonist agent and adversary agent. Introducing robustness indicators into the power grid dispatching process and quantifying these indicators using sample features related to the power grid dispatching task can improve the efficiency and accuracy of the dispatching process, thus contributing to the improvement of the stability of the power grid system.

[0058] Furthermore, based on the above embodiments of the invention, the state space, action space, transition probability, and expected reward function of the protagonist agent and the opponent agent are determined according to the power grid state of the target power grid, including:

[0059] The state space is constructed based on the following parameters of the target power grid: active power of power plants, reactive power of power plants, active power of loads, reactive power of loads, topology, active power flow at the starting end of the power line, reactive power flow at the starting end of the power line, active power flow at the terminal end of the power line, active power flow and reactive power flow at the terminal end of the power line, thermal limit value of the power line, connection status, cooling time of the power line, cooling time of the substation, planned next maintenance time of the power line, and duration after current overflow. The action spaces of the protagonist agent and the adversary agent are constructed based on the topology control actions and rescheduling actions of the target power grid, respectively. The transition probability of each control action to another control action in the action spaces of the protagonist agent and the adversary agent is determined. The expected reward function for the execution of control actions by the protagonist agent and the adversary agent is determined.

[0060] In this embodiment of the invention, a six-tuple can be constructed for the protagonist agent and the adversary agent. This six-tuple can include... S represents the state space, and A represents the action space. This represents the action space of the main AI agent. Let P represent the action space of the adversary agent, P represent the transition probability, and R represent the reward function. This represents the reward for the main character's intelligent agent. The reward for the adversary agent is represented in the state space. This includes the active and reactive power of power plants, the active and reactive power of loads, the topology Ω, the active and reactive power flow at the start and end of power lines, the thermal limits of power lines, connection status, cooling time of power lines and substations, the planned next maintenance time of power lines, and the duration of current overflow. In this state space, the protagonist agent and the adversary agent observe the same state, but the protagonist agent is more concerned with potential power outages caused by sudden changes in the grid state, while the adversary focuses on weaknesses in the current grid environment to launch effective attacks; Action Space This includes topology control actions and rescheduling actions. Topology control actions consist of discrete actions. Assuming each substation contains two different buses, topology control allows each power line to be connected to a different bus, achieving effective network topology control by switching the power line's connection on the bus. Rescheduling actions are used to adjust the power setpoints of power plants in the grid and are continuous actions. This represents the action space of the main intelligent agent, which includes all topology control actions and rescheduling actions. This represents the action space of the adversary agent. To correspond to the limitations of adversary capabilities in a real power grid environment, the adversary agent can only perform certain topology operations; transition probabilities. : This represents the probability of performing a control action and transitioning to a new state in the current state, where... Represent the real number space; reward function : Used to generate reward signals that guide the actions of intelligent agents. This represents the reward for the main character's intelligent agent. This represents the reward for the opposing agent. Assume the current state is... First, the adversary agent initiates a disturbance to the environment. According to the state transition function This causes the state to transition At this point, the power grid environment is handled by the protagonist's intelligent agent, which then performs actions. This causes the state to transition. And provide immediate rewards to the main character's AI agent. The formula for instant rewards is as follows:

[0061]

[0062] Represent a constant. Let represent the cost of grid scheduling at time t. This reward function encourages the agent to minimize the operational cost of scheduling operations while ensuring uninterrupted grid operation. Under normal grid operation, the agent will receive a positive reward, i.e., The lower the scheduling cost, the greater the reward. Conversely, if an incorrect scheduling operation causes a power outage, the protagonist agent will receive a negative reward as punishment for the decision-making error. The competitor agent's optimization objective is opposite to that of the protagonist agent; therefore, the competitor's reward is set differently. The reward is negatively correlated with the protagonist's reward; the opponent's instant reward formula is as follows:

[0063]

[0064] This also represents a constant. During the interaction, the protagonist agent and the opponent agent jointly operate the power grid, but only one agent is allowed to control the power grid at each time t. Therefore, the expected cumulative team reward obtained by the protagonist agent and the opponent agent through interaction with the environment during the time period T of the interaction process can be expressed by the following formula:

[0065]

[0066] in It is a discount factor used to calculate the present value of rewards and prevent rewards from accumulating indefinitely. Let t be the reward function for the agent, i.e., the reward function for the protagonist agent or the opponent agent. At time t, the reward function is adopted according to which agent operates the power grid.

[0067] Example 3

[0068] Figure 3 This is a flowchart of another power grid dispatching method provided in Embodiment 3 of the present invention. The embodiments of the present invention illustrate the solution process of the robustness objective function. See [link to documentation]. Figure 3 The method provided in this embodiment of the invention specifically includes the following steps:

[0069] Step 310: Construct the protagonist agent and the opponent agent based on the target power grid, and construct a robust objective function according to the expected reward function of the protagonist agent and the opponent agent.

[0070] Step 320: Collect grid dispatching tasks of the target power grid as positive and negative samples.

[0071] Specifically, existing grid dispatching tasks within the target grid can be collected, and the positive or negative impact of the grid dispatching tasks on the target grid can be recorded as positive and negative samples. Data can be generated based on positive and negative samples using unsupervised neural networks, and the generated data can be used as positive and negative samples.

[0072] Step 330: Perform comparative representation learning on positive and negative samples to obtain the target sample features.

[0073] Specifically, a comparative standard can be learned from positive and negative samples, and the learning results can be used as features of the target samples.

[0074] For example, in power grid dispatching tasks, the agent's state features can be divided into two parts based on their relevance to the task: irrelevant features, which do not constitute a causal relationship for the correct execution of the task, and relevant features, which are key features determining the correct execution of the task. By using a contrastive learning method, the agent's original state representation is decoupled at the spatial level, providing the agent with a more stable and efficient representation of relevant features, thereby improving the robustness of power grid control. Contrastive learning constructs the positive and negative samples required for the contrastive loss through instance sample augmentation, assuming the samples... The positive and negative samples are respectively and Then the query distribution of vector similarity This can be expressed as the following formula:

[0075]

[0076] Since the number of negative samples is often much larger than the number of positive samples in general unsupervised tasks, the negative samples in the formula are in the form of a set, which is beneficial to make full use of the samples. This indicates that values ​​are taken from all positive and negative samples. Temperature is a hyperparameter used to control the discriminative power of the samples. Next, to improve the performance of representation learning, a contrastive loss function is constructed to maximize the similarity between positive samples and decrease the similarity between positive and negative samples. Assume that a training trajectory in representation learning is... One state { } constitute, use express state of time The corresponding representation module output is .for , It can be regarded as an augmented sample under the same instance, therefore and They are positive samples of each other; the inputs at other times are positive samples of each other. For different instances, therefore The inputs and corresponding outputs at other times are negative samples of each other. According to the query distribution formula above, The query distribution formula is as follows:

[0077]

[0078] in, yes Positive samples, and yes negative samples, It is the inner product function, i.e. , For the comment function model, It represents the number of nesting operations.

[0079] For two samples and The number of states is Calculate the query distribution for each query, and then calculate the contrastive loss, as shown in the following formula:

[0080]

[0081] By comparing representation learning, we can find features in the data that are related to power grid scheduling tasks and improve the stability of the solution.

[0082] Step 340: Based on the characteristics of the target sample, solve the robustness objective function according to the near-end strategy optimization algorithm to obtain the scheduling strategy that maximizes the robustness objective function, and use the scheduling strategy as the target scheduling strategy of the target power grid.

[0083] Specifically, the robustness objective function after substituting the target sample features can be solved using the Proximal Policy Optimization (PPO) algorithm. This can yield the scheduling strategy that maximizes the robustness objective function, which can then be set as the target scheduling strategy for the target power grid.

[0084] This invention, in its embodiments, acquires the protagonist agent and adversary agent of the target power grid, generates a robust objective function according to the expected reward functions of the protagonist and adversary agents, collects grid scheduling tasks of the target power grid as positive and negative samples, performs comparative representation learning on the positive and negative samples to obtain target sample features, and solves the robust objective function based on the target sample features using a near-end policy optimization algorithm to obtain the target scheduling strategy that maximizes the robust objective function. This invention can construct a robust objective function through adversarial interaction between the protagonist agent and adversary agent, introduce robustness indices into the grid scheduling process, and quantify robustness indices using sample features related to the grid scheduling tasks. This can improve the efficiency and accuracy of the scheduling process and contribute to enhancing the stability of the power grid system.

[0085] Example 4

[0086] Figure 4 This is a flowchart of another power grid dispatching method provided in Embodiment 4 of the present invention. The embodiments of the present invention also describe the detection process of faulty nodes within the target power grid. See [link to documentation]. Figure 4 The method provided in this embodiment of the invention specifically includes the following steps:

[0087] Step 410: Construct the protagonist agent and the opponent agent based on the target power grid, and construct a robust objective function according to the expected reward function of the protagonist agent and the opponent agent.

[0088] Step 420: Construct positive and negative samples based on the grid dispatching task of the target power grid, and determine the target sample features associated with the protagonist agent and the opponent agent based on contrastive representation learning and positive and negative samples.

[0089] Step 430: Determine the target scheduling strategy of the target power grid based on the target sample characteristics and the robust objective function.

[0090] Step 440: Determine the information entropy of each power grid component of the target power grid, and construct a power grid dispatch information diagram based on each information entropy.

[0091] In this context, grid components can be software and / or hardware that implement grid functions within the target grid. These components may include, but are not limited to, power generation-side components, transmission and distribution-side components, control and protection components, and user-side components. Information entropy measures the degree of uncertainty of a random event; it can be used to measure the information contained in a single random variable. A grid component can be considered a random variable, and its information entropy can be the degree of uncertainty of the random events contained within that random variable. A grid dispatch information diagram can represent the correlation of information entropy between different grid components.

[0092] In this embodiment of the invention, the state information of different power grid components within the target power grid can be obtained, the information entropy of the target power grid can be determined according to the change of the state information of each power grid component over time, and a power grid scheduling information diagram can be constructed according to the information entropy of each power grid component. This power grid scheduling information diagram can reflect the uncertainty of the information flow of scheduling information between different power grid components.

[0093] Step 450: Based on the power grid dispatch information map, statistically analyze the fault indicators of each power grid component, and determine the fault nodes within the power grid component according to the fault indicators.

[0094] Among them, the fault index can be the situation where the uncertainty of each power grid component leads to the fault, and the fault index can be determined by different statistical methods of the information entropy of the power grid component.

[0095] In this embodiment of the invention, the information entropy of each power grid component and the information entropy between different power grid components can be constructed according to the power grid dispatch information diagram. The information entropy of each power grid component can be statistically analyzed to generate fault indicators. By filtering the fault indicators, the corresponding power grid components can be identified as faulty nodes. The statistical methods for fault indicators may include the ratio of the in-degree information entropy to the out-degree information entropy of a node.

[0096] In this embodiment of the invention, by constructing a protagonist agent and a rival agent for the target power grid, determining the expected reward functions of the protagonist agent and the rival agent, and determining a robust objective function according to the expected reward functions, positive and negative samples are determined based on the power grid scheduling task of the target power grid, and target sample features associated with the protagonist agent and the rival agent are determined based on contrastive representation learning and positive and negative samples. The robust objective function is solved according to the target sample features to obtain the target scheduling strategy of the target power grid, determine the information entropy of the power grid components of the target power grid, construct a power grid scheduling information graph based on the information entropy, and analyze abnormal fault nodes using the power grid scheduling information to obtain the fault source of the power grid scheduling process, thereby ensuring the safe, reliable and efficient operation of the power grid scheduling.

[0097] In an exemplary implementation, the concept of information entropy is first defined. In information theory, entropy is used to measure the degree of uncertainty of random events. Information entropy can be used to measure the information contained in a single random variable. Components in power grid dispatch can be regarded as random variables. Therefore, the uncertainty of random events (characteristic time series data) contained in the random variable can be obtained through information entropy.

[0098] Assuming the time series of a single feature is Then time series The information entropy contained in it is :

[0099]

[0100] In the formula It is the value of each point in the time series. for exist The probability in Representing the characteristic time series middle All possible values ​​of .

[0101] The conditional probability information of any two time series can be measured using conditional entropy, which represents the uncertainty of one time series variable given the knowledge of another time series variable. Used to measure the performance of a given random variable Obtain random variables The amount of information contained:

[0102]

[0103] In the formula For the first part of the data collection A feature time series, No. A feature time series, and yes and The value of each point in the array, For joint probability distribution, For conditional probability, and Representing the feature time series respectively and middle and All possible values ​​of .

[0104] In information theory, mutual information is defined as a measure of the correlation between two random variables. Based on conditional entropy, mutual information entropy is derived, which represents the amount of shared information between time series variables. Time series can be measured numerically. and Relevance information content:

[0105]

[0106] In the formula For variables Information entropy For time series variables and The conditional entropy.

[0107] Based on mutual information entropy, we extend it to obtain transfer entropy, which is used to analyze the information flow between two time series under asymmetric conditions. Transfer entropy is introduced during the calculation process... The state information at any given moment helps in calculating the propagation entropy. For characteristic time series variables arrive The amount of interactive information:

[0108]

[0109] in, Representing the characteristic time series In time The state at any given moment, Representing the characteristic time series In time The state at any given moment, Representing the characteristic time series time The state at any given moment, through the previous The amount of information at any given moment is obtained by arrive The amount of interactive information.

[0110] Based on the above information entropy, a power grid dispatch information graph is constructed, where information values ​​can be abstracted as a graph network, the information value of a node is its information entropy, node links represent the information flow direction and degree of influence between two nodes, and the transfer entropy between two nodes represents the information link and information change between the two nodes.

[0111] Example 5

[0112] Figure 5 This is a flowchart of another power grid dispatching method provided in Embodiment 5 of the present invention. The embodiments of the present invention also describe the detection process of faulty nodes within the target power grid. See [link to documentation]. Figure 5 The method provided in this embodiment of the invention specifically includes the following steps:

[0113] Step 510: Construct the protagonist agent and the opponent agent based on the target power grid, and construct a robust objective function according to the expected reward function of the protagonist agent and the opponent agent.

[0114] Step 520: Construct positive and negative samples based on the grid dispatching task of the target power grid, and determine the target sample features associated with the protagonist agent and the opponent agent based on contrastive representation learning and positive and negative samples.

[0115] Step 530: Determine the target scheduling strategy for the target power grid based on the target sample characteristics and the robust objective function.

[0116] Step 540: Collect the normal state values ​​and abnormal state values ​​of each power grid component of the target power grid at different times, and determine the normal characteristic time series composed of the normal state values ​​and the abnormal characteristic time series composed of the abnormal state values ​​of each power grid component.

[0117] In this embodiment of the invention, normal and abnormal state values ​​of power grid components within the target power grid can be collected at different times. For each power grid component, the normal state values ​​are arranged in chronological order to form a normal characteristic time series, and the abnormal state values ​​are arranged in actual order to form an abnormal characteristic time series.

[0118] Step 550: Determine the information entropy of the normal characteristic time series and the abnormal characteristic time series for each power grid component, as well as the transfer entropy between any two power grid components.

[0119] Specifically, the information entropy of the normal characteristic time series and the characteristic entropy of the abnormal characteristic time series can be determined for each power grid component. Furthermore, the transfer entropy between two power grid components can be determined based on their information entropy under normal and abnormal states. This transfer entropy can be determined in the following way:

[0120] Information entropy is denoted as ,in, It is the value of each point in the time series. for exist The probability in Representing the characteristic time series middle All possible values ​​of .

[0121] The conditional probability information of any two time series can be measured by conditional entropy, which represents the uncertainty of one time series variable given the knowledge of another time series variable. Used to measure the performance of a given random variable Obtain random variables The amount of information contained:

[0122]

[0123] In the formula For the first part of the data collection A feature time series, No. A feature time series, and yes and The value of each point in the array, For joint probability distribution, For conditional probability, and Representing the feature time series respectively and middle and All possible values ​​of .

[0124] In information theory, mutual information is defined as a measure of the correlation between two random variables. Based on conditional entropy, mutual information entropy is derived, which represents the amount of shared information between time series variables. Time series can be measured numerically. and Relevance information content:

[0125]

[0126] In the formula For variables Information entropy For time series variables and The conditional entropy.

[0127] Based on mutual information entropy, we extend it to obtain transfer entropy, which is used to analyze the information flow between two time series under asymmetric conditions. Transfer entropy is introduced during the calculation process... The state information at any given moment helps in calculating the propagation entropy. For characteristic time series variables arrive The amount of interactive information:

[0128]

[0129] in, Representing the characteristic time series In time The state at any given moment, Representing the characteristic time series In time The state at any given moment, Representing the characteristic time series time The state at any given moment, through the previous The amount of information at any given moment is obtained by arrive The amount of interactive information.

[0130] Step 560: Construct a power grid scheduling information graph based on the information entropy of each power grid component and the transfer entropy between any two power grid components. The edge between two nodes in the power grid scheduling information graph is set by the transfer entropy between the corresponding two power grid components, and the node in the power grid scheduling information graph is set by the information entropy of the corresponding power grid component.

[0131] In this embodiment of the invention, a power grid scheduling information graph can be constructed based on the acquired information entropy and transmission entropy. Each node in the power grid scheduling information graph can be filled with the information entropy of its corresponding power grid component, and the connection edge between two nodes can be based on the transmission entropy between the power grid components corresponding to the two nodes respectively. It can be understood that the information entropy and transmission entropy can respectively include the information entropy and transmission entropy of the power grid component in normal state and abnormal state.

[0132] Step 570: Determine the normal relationship matrix and abnormal relationship matrix corresponding to each power grid component according to the power grid dispatch information diagram.

[0133] Specifically, normal relationship matrices and abnormal relationship matrices can be constructed according to the information entropy and transmission entropy of power grid components in abnormal and normal states in the power grid dispatch information diagram. The normal relationship matrix can include the information entropy of each power grid component in the normal state and the transmission entropy between each power grid component. Similarly, the abnormal relationship matrix can include the information entropy of each power grid component in the abnormal state and the transmission entropy between each power grid component.

[0134] Step 580: Determine the in-degree anomaly rate, out-degree anomaly rate, and causal anomaly rate of the power grid components based on the normal relation matrix and the abnormal relation matrix.

[0135] Among them, the in-degree anomaly rate can be the ratio of the in-degree of a power grid component in the abnormal relationship matrix to the in-degree in the normal relationship matrix; the out-degree anomaly rate can be the ratio of the out-degree of a power grid component in the abnormal relationship matrix to the out-degree in the normal relationship matrix; and the causal anomaly rate can be the ratio of the sum of the in-degree and out-degree of a power grid component in the normal relationship matrix to the sum of the in-degree and out-degree in the abnormal relationship matrix.

[0136] In this embodiment of the invention, the in-degree anomaly rate, out-degree anomaly rate, and causal anomaly rate of each power grid component can be determined using a normal relationship matrix and an abnormal relationship matrix. Specifically, the determination process can be as follows:

[0137] Based on the normal relationship matrix and anomaly relationship matrix Determine the in-degree anomaly rate, out-degree anomaly rate, and causal anomaly rate for each power grid component in the power grid dispatch information diagram, including:

[0138] (1) In-degree anomaly rate

[0139]

[0140] In-degree is determined by the number of nodes in the relation matrix. Search the column it belongs to The number of It is the in-degree anomaly rate of each node in the node set. It is a node In-degree in the anomaly relation matrix, It is a node In-degree in the normal relation matrix.

[0141] (2) Out-of-degree anomaly rate

[0142]

[0143] The out-degree is determined by the nodes in the relation matrix. Search the line containing the given information. The number of It is a node Out-degree in the anomaly relation matrix It is a node The out-degrees in the normal relation matrix are then used to obtain the out-degree anomaly rate for each node.

[0144] (3) Causal abnormality rate

[0145]

[0146] in, This gives the total number of links present in the normal relation matrix. It is a node The ratio of the in-degree and out-degree sums in the abnormal relationship matrix to the total number of links across all nodes in the normal relationship matrix. This metric combines the relevant connection tightness in the abnormal relationship matrix and takes into account... The greater the impact on the overall situation, the more significant the impact. The greater the likelihood that it is a source of failure.

[0147] Step 590: Use the product of the in-degree anomaly rate and the causal anomaly rate as the fault indicator of the power grid components.

[0148] Specifically, the product of the in-degree anomaly rate and the causal anomaly rate can be determined, and this product can be used as a fault indicator for power grid components.

[0149] For example, the estimation index is calculated using the following formula:

[0150]

[0151] in, This can represent the grid component V. i causal abnormality rate This can represent the grid component V. i The in-degree anomaly rate.

[0152] Step 5100: Arrange the power grid components according to the fault indicators, and select the power grid components with a threshold number as fault nodes.

[0153] In this embodiment of the invention, the power grid components can be arranged sequentially based on the value of the fault index of each power grid component, and a threshold number of power grid components can be selected as fault nodes in the sequentially arranged power grid components.

[0154] In this embodiment of the invention, a protagonist agent and a rival agent of the target power grid are constructed, and their expected reward functions are determined. A robustness objective function is then determined based on these expected reward functions. Positive and negative samples are determined based on the power grid scheduling task of the target power grid. Target sample features associated with the protagonist agent and rival agent are determined based on contrastive representation learning and the positive and negative samples. The robustness objective function is solved according to these target sample features to obtain the target scheduling strategy for the target power grid. The normal and abnormal state values ​​of each power grid component at different times are collected, and a normal feature time series composed of normal state values ​​and an abnormal feature time series composed of abnormal state values ​​for each power grid component are determined. The normal feature time series is then determined separately for each power grid component. The invention utilizes the information entropy of time series and anomaly features, as well as the transfer entropy between any two power grid components. Based on the determined information entropy and transfer entropy, a power grid dispatch information graph is constructed. The normal relationship matrix and anomaly relationship matrix corresponding to each power grid component are determined according to the power grid dispatch information graph. Based on the normal relationship matrix and anomaly relationship matrix, the in-degree anomaly rate, out-degree anomaly rate, and causal anomaly rate of the power grid components are determined. The product of the in-degree anomaly rate and the causal anomaly rate is used as the fault index of the power grid component. A threshold number of power grid components are selected as fault nodes based on the fault index. This embodiment of the invention can construct a power grid dispatch information graph based on information entropy, analyze abnormal fault nodes using power grid dispatch information, and thus obtain the fault source of the power grid dispatch process, ensuring the safe, reliable, and efficient operation of the power grid dispatch.

[0155] Furthermore, based on the above embodiments of the invention, determining the normal characteristic time series composed of normal state values ​​and the abnormal characteristic time series composed of abnormal state values ​​for each power grid component further includes:

[0156] The normal feature time series and the abnormal feature time series are divided into subsequences with a preset number of intervals, wherein the preset number of intervals is determined based on the number of clusters in the K-means clustering results of the normal feature time series or the abnormal feature time series; the average of the maximum, minimum and median values ​​in each subsequence is used as the discretization result; the discretization result is rearranged in chronological order and then used as the normal feature time series and the abnormal feature time series.

[0157] In this embodiment of the invention, K-means clustering can be performed on normal and abnormal feature time series to determine the number of clusters in each. The number of clusters is then used as the preset number of intervals for each of the normal and abnormal feature time series. It is understood that the preset number of intervals for the normal and abnormal feature time series can be different. The normal and abnormal feature time series are then equally divided according to the preset number of intervals, resulting in multiple subsequences for each. For both normal and abnormal feature time series, the average of the maximum, minimum, and median values ​​in each subsequence can be used as the discretization result. The sequence formed by these discretization results can then be used as a normal or abnormal feature time series. Discretizing the feature time series reduces data processing volume, improves fault node location efficiency, and shortens waiting time.

[0158] Example 6

[0159] Figure 6 This is an example diagram of another power grid dispatching method provided in Embodiment Six of the present invention. See also... Figure 6 The power grid dispatching method provided in this embodiment of the invention may include the following steps:

[0160] Improved robustness of power grid dispatch: First, robustness constraints are added to the optimization objective of power grid dispatch based on the two-person Markov game process. Then, features related to power grid dispatch tasks in the data are found through comparative representation learning to improve the stability of the solution. Finally, the PPO algorithm is used to solve the dispatch scheme.

[0161] Power grid dispatch fault perception: First, a power grid dispatch information graph is constructed based on information entropy. The continuous abnormal state time series is discretized by interval sampling, and the component relationship matrix under normal power grid dispatch is calculated. Then, based on the normal relationship matrix and the propagation entropy of the abnormal state, the component relationship matrix under the abnormal state is calculated. Finally, based on the normal relationship matrix and the abnormal relationship matrix, the abnormal points are sorted and analyzed to obtain the fault source that causes the abnormal state of power grid dispatch.

[0162] In the robustness improvement stage of power grid dispatching: First, the agent responsible for power grid dispatching is considered the protagonist agent, and various disturbances are considered adversaries. Therefore, the robustness constraint is to maximize the reward of the protagonist agent and minimize the reward of the adversaries, thus transforming the problem into a two-player Markov game. The adversaries are defined as... The protagonist's intelligent agent is defined as , and Let the parameters represent the policies of the protagonist agent and the opponent agent, respectively. A six-tuple can be used in a two-player Markov game. The meanings of each part are as follows:

[0163] 1) State Space This includes the active and reactive power of power plants, the active and reactive power of loads, the topology Ω, the active and reactive power flow at the beginning and end of power lines, the thermal limits of power lines, connection status, cooling time of power lines and substations, the planned next maintenance time of power lines, and the duration of current overflow. In this state space, the protagonist agent and the adversary agent observe the same state; however, the protagonist agent is more concerned with potential power outages caused by sudden changes in the grid state, while the adversary focuses on weaknesses in the current grid environment to launch effective attacks.

[0164] 2) Action Space This includes topology control actions and rescheduling actions. Topology control actions consist of discrete actions. Assuming each substation contains two different buses, topology control allows each power line to be connected to a different bus, achieving effective network topology control by switching the power line's connection on the bus. Rescheduling actions are used to adjust the power setpoints of power plants in the grid and are continuous actions. This represents the action space of the main intelligent agent, which includes all topology control actions and rescheduling actions. This represents the action space of the adversary agent. To correspond to the limitations of adversary capabilities in a real power grid environment, the adversary agent can only perform some topology operations.

[0165] 3) Transition probability : This represents the probability of performing a control action and transitioning to a new state in the current state, where... Represents the space of real numbers.

[0166] 4) Reward Function : Used to generate reward signals that guide the actions of intelligent agents. This represents the reward for the main character's intelligent agent. This represents the reward for the opposing agent. Assume the current state is... First, the adversary agent initiates a disturbance to the environment. According to the state transition function This causes the state to transition At this point, the power grid environment is handled by the protagonist's intelligent agent, which then performs actions. This causes the state to transition. And provide immediate rewards to the main character's AI agent. The formula for instant rewards is as follows:

[0167]

[0168] Represent a constant. Let represent the cost of grid scheduling at time t. This reward function encourages the agent to minimize the operational cost of scheduling operations while ensuring uninterrupted grid operation. Under normal grid operation, the agent will receive a positive reward, i.e., The lower the scheduling cost, the greater the reward. Conversely, if an incorrect scheduling operation causes a power outage, the protagonist agent will receive a negative reward as punishment for the decision-making error. The competitor agent's optimization objective is opposite to that of the protagonist agent; therefore, the competitor's reward is set differently. The reward is negatively correlated with the protagonist's reward; the opponent's instant reward formula is as follows:

[0169]

[0170] This also represents a constant. During the interaction, the protagonist agent and the opponent agent jointly operate the power grid, but only one agent is allowed to control the power grid at each time t. Therefore, the expected cumulative team reward obtained by the protagonist agent and the opponent agent through interaction with the environment during the time period T of the interaction process can be expressed by the following formula:

[0171]

[0172] in It is a discount factor used to calculate the present value of rewards and prevent rewards from accumulating indefinitely. Let t be the reward function for the agent, i.e., the reward function for the main agent or the opposing agent. At time t, the reward function is used depending on which agent operates the power grid.

[0173] The adversary agent aims to learn an optimal perturbation policy by minimizing J, while the protagonist agent aims to improve its robustness against adversary attacks by maximizing J. Therefore, the objective function for power grid scheduling can be expressed as follows:

[0174]

[0175] Where G is the original objective function, The objective function maximizes and minimizes the expected rewards for the main agent and the opposing agent, respectively. By solving this objective function, not only can the definition of the original objective function be satisfied, but various disturbances during scheduling can also be effectively prevented, thus improving the robustness of scheduling.

[0176] Then, contrastive representation learning is performed. In power grid dispatching tasks, the agent's state features can be divided into two parts based on their relevance to the task: irrelevant features, which do not constitute a causal relationship for the correct execution of the task, and relevant features, which are key features determining the correct execution of the task. Through contrastive learning, the agent's original state representation is decoupled at the spatial level, providing the agent with more stable and efficient relevant feature state representations, thereby improving the robustness of power grid control. Contrastive learning constructs the positive and negative samples required for contrastive loss through instance sample augmentation, assuming the samples... The positive and negative samples are respectively and Then the query distribution of vector similarity This can be expressed as the following formula:

[0177]

[0178] Since the number of negative samples is often much larger than the number of positive samples in general unsupervised tasks, the negative samples in the formula are in the form of a set, which is beneficial to make full use of the samples. This indicates that values ​​are taken from all positive and negative samples. Temperature is a hyperparameter used to control the discriminative power of the samples. Next, to improve the performance of representation learning, a contrastive loss function is constructed to maximize the similarity between positive samples and decrease the similarity between positive and negative samples. Assume that a training trajectory in representation learning is... One state { } constitute, use express state of time The corresponding representation module output is .for , It can be regarded as an augmented sample under the same instance, therefore and They are positive samples of each other; the inputs at other times are positive samples of each other. For different instances, therefore The inputs and corresponding outputs at other times are negative samples of each other. According to the query distribution formula above, The query distribution formula is as follows:

[0179]

[0180] in, yes Positive samples, and yes negative samples, It is the inner product function, i.e. , For the comment function model, It represents the number of nesting operations.

[0181] For two samples and The number of states is Calculate the query distribution for each query, and then calculate the contrastive loss, as shown in the following formula:

[0182]

[0183] By using contrastive representation learning, features relevant to power grid scheduling tasks in the data are identified, improving the stability of the solution process. Finally, the PPO algorithm is used to solve the objective function, yielding the power grid scheduling scheme.

[0184] In the power grid fault detection phase, the concept of information entropy is first defined. In information theory, entropy is used to measure the degree of uncertainty of random events. Information entropy can be used to measure the information contained in a single random variable. Components in power grid dispatch can be regarded as random variables. Therefore, the uncertainty of random events (characteristic time series data) contained in the random variable can be obtained through information entropy.

[0185] Assuming the time series of a single feature is Then time series The information entropy contained in it is :

[0186]

[0187] In the formula It is the value of each point in the time series. for exist The probability in Representing the characteristic time series middle All possible values ​​of .

[0188] The conditional probability information of any two time series can be measured using conditional entropy, which represents the uncertainty of one time series variable given the knowledge of another time series variable. Used to measure the performance of a given random variable Obtain random variables The amount of information contained:

[0189]

[0190] In the formula For the first part of the data collection A feature time series, No. A feature time series, and yes and The value of each point in the array, For joint probability distribution, For conditional probability, and Representing the feature time series respectively and middle and All possible values ​​of .

[0191] In information theory, mutual information is defined as a measure of the correlation between two random variables. Based on conditional entropy, mutual information entropy is derived, which represents the amount of shared information between time series variables. Time series can be measured numerically. and Relevance information content:

[0192]

[0193] In the formula For variables Information entropy For time series variables and The conditional entropy.

[0194] Based on mutual information entropy, we extend it to obtain transfer entropy, which is used to analyze the information flow between two time series under asymmetric conditions. Transfer entropy is introduced during the calculation process... The state information at any given moment helps in calculating the propagation entropy. For characteristic time series variables arrive The amount of interactive information:

[0195]

[0196] in, Representing the characteristic time series In time The state at any given moment, Representing the characteristic time series In time The state at any given moment, Representing the characteristic time series time The state at any given moment, through the previous The amount of information at any given moment is obtained by arrive The amount of interactive information.

[0197] Based on the above information entropy, a power grid dispatch information graph is constructed, where information values ​​can be abstracted as a graph network, the information value of a node is its information entropy, node links represent the information flow direction and degree of influence between two nodes, and the transfer entropy between two nodes represents the information link and information change between the two nodes.

[0198] Secondly, the continuous abnormal state time series is discretized using an interval sampling method, assuming that all abnormal state feature data are collected in... arrive Within the time interval, each feature data sequence is then processed. Divide into equal parts Within each interval, The selection method involves clustering each feature data using the K-means algorithm, and then selecting the maximum value among all individual feature clusters as the number of intervals to divide the data.

[0199]

[0200] in, They represent the collected Continuous time series data with several features This refers to the K-means algorithm, which uses clustering to determine the intervals to be divided for each feature. Then, within each small interval, the maximum, minimum, and median values ​​are selected and averaged to obtain the discretization result of the interval segment.

[0201] Obtained through discretization feature method Time series data of normal segments The information entropy of each time series feature is calculated as follows: And obtain the transfer entropy of any two feature time series. After normalizing all the obtained entropy values, a component relationship matrix for normal power grid dispatch operation is established:

[0202]

[0203] Based on the above normal relationship matrix, a state anomaly relationship matrix is ​​established. According to the principle of state anomaly notification based on time sequence, the causal relationship between two anomaly states is first calculated, that is, the propagation entropy of the state anomaly component starting from the earlier time step to the later time step is calculated, such as... It is a time series feature that begins with an abnormal state. If it is a time series feature that begins after an abnormal state, then... arrive The formula for calculating the time-step causal relationship propagation entropy is:

[0204]

[0205] in Let be the joint probability distribution of the two variables. For conditional probability, and Representing the characteristic time series variables respectively and All possible values, It is a variable The data showing abnormal status is at a specific point in time. It is a variable The point in time when abnormal data occurs, if the variable and variables If the abnormal status data occurs at the same time, then... and All are calculated. Representing variables respectively and Within the time interval and The value, and They are all independent random variables, if the variables If the abnormal state occurs at the first time step, then It is 0.

[0206] In the calculation of transfer entropy, we obtain the result from variables. First, the remaining variables are processed to obtain the set of propagation entropy values. Following the principle that a larger propagation entropy value indicates a stronger causal relationship between variables, a search is performed on each set from the variables. ( (This refers to the total number of features in the abnormal state sequence data). The connection with the highest propagation entropy value is obtained, and a state abnormality information relation matrix is ​​constructed. The non-zero elements in the matrix, except for the diagonal elements, indicate the connections present in the fault propagation.

[0207]

[0208] Then, based on the relation matrix under normal data Relationship matrix under abnormal state data Define the indicators for abnormal nodes in the power grid dispatch information diagram, including the following indicators:

[0209] (1) In-degree anomaly rate of nodes

[0210]

[0211] In-degree is determined by the number of nodes in the relation matrix. Search the column it belongs to The number of It is the in-degree anomaly rate of each node in the node set. It is a node In-degree in the anomaly relation matrix, It is a node In-degree in the normal relation matrix.

[0212] (2) Out-degree anomaly rate of nodes

[0213]

[0214] Out-degree is determined by the nodes in the relation matrix. Search the line containing the given information. The number of It is a node Out-degree in the anomaly relation matrix It is a node The out-degrees in the normal relation matrix are then used to obtain the out-degree anomaly rate for each node.

[0215] (3) Causal anomaly ratio of nodes

[0216]

[0217] This gives the total number of links present in the normal relation matrix. It is a node The ratio of the in-degree and out-degree sums in the abnormal relationship matrix to the total number of links across all nodes in the normal relationship matrix. This metric combines the relevant connection tightness in the abnormal relationship matrix and takes into account... The greater the impact on the overall situation, the more significant the impact. The greater the likelihood that it is a source of failure.

[0218] Finally, based on the above indicators, the evaluation index for node anomalies is obtained as follows:

[0219]

[0220] This indicator not only considers the possibility of a node being a fault source but also weights it based on its global impact, further improving the accuracy of fault detection. According to the above evaluation indicators, nodes ranking high in anomaly assessment indicators in the power grid dispatch information diagram are considered to be faulty nodes in power grid dispatch. Fault detection improves the reliability of power grid dispatch, thereby enhancing the safe and reliable operation of the power grid.

[0221] Example 7

[0222] Figure 7 This is a structural schematic diagram of a power grid dispatching device according to Embodiment Seven of the present invention, as shown below. Figure 7As shown, the device includes:

[0223] The robust objective module 610 is used to construct the protagonist agent and the adversary agent based on the target power grid, and to construct a robust objective function based on the expected reward functions of the protagonist agent and the adversary agent.

[0224] The data acquisition module 620 is used to construct positive and negative samples based on the grid dispatching tasks of the target power grid, and to determine the target sample features associated with the protagonist agent and the opponent agent based on contrastive representation learning.

[0225] The scheduling strategy module 630 is used to determine the target scheduling strategy of the target power grid based on the target sample characteristics and the robust objective function.

[0226] In this embodiment of the invention, a robust objective module constructs the protagonist agent and adversary agent of the target power grid, determines the expected reward functions of the protagonist agent and adversary agent, and determines a robustness objective function based on the expected reward functions. A data acquisition module determines positive and negative samples based on the power grid scheduling task of the target power grid, and determines the target sample features associated with the protagonist agent and adversary agent based on contrastive representation learning and the positive and negative samples. A scheduling strategy module solves the robustness objective function according to the target sample features, thereby obtaining the target scheduling strategy for the target power grid. This embodiment of the invention can construct a robustness objective function through an adversarial approach between the protagonist agent and adversary agent, introducing robustness indicators into the power grid scheduling process. By quantifying robustness indicators through sample features related to the power grid scheduling task, the efficiency and accuracy of the scheduling process can be improved, contributing to the improvement of the stability of the power grid system.

[0227] Based on the above embodiments of the invention, the robust target module 610 includes:

[0228] The intelligent agent unit is used to set the power grid dispatching intelligent agent of the target power grid as the main intelligent agent and the interference factors of the target power grid as the adversary intelligent agent.

[0229] The data collection unit is used to determine the state space, action space, transition probability, and expected reward function of the protagonist agent and the opponent agent respectively according to the power grid state of the target power grid.

[0230] The objective function unit is used to take the functional difference between the expected reward functions of the protagonist agent and the opponent agent as the first objective function; to obtain the scheduling objective function of the target power grid, and to take the weighted sum of the scheduling objective function and the first objective function as the robustness objective function.

[0231] Based on the above embodiments of the invention, the data collection unit is specifically used to: construct a state space according to the active power of power plants, reactive power of power plants, active power of loads, reactive power of loads, topology, active power flow at the beginning of the power line, reactive power flow at the beginning of the power line, active power flow at the end of the power line, active power flow at the end of the power line, reactive power flow at the end of the power line, thermal limit value of the power line, connection status, cooling time of the power line, cooling time of the substation, planned next maintenance time of the power line, and duration after current overflow; construct the action spaces of the protagonist agent and the adversary agent according to the topology control actions and rescheduling actions of the target power grid; determine the transition probability of each control action to another control action in the action spaces of the protagonist agent and the adversary agent; and determine the expected reward function for the execution of control actions by the protagonist agent and the adversary agent.

[0232] Based on the above embodiments of the invention, the data acquisition module 620 is specifically used for: collecting power grid scheduling tasks of the target power grid as positive and negative samples; performing comparative representation learning on the positive and negative samples to obtain target sample features.

[0233] Based on the above embodiments of the invention, the scheduling strategy module 630 is specifically used to: solve the robustness objective function according to the near-end strategy optimization algorithm based on the target sample characteristics, obtain the scheduling strategy that maximizes the robustness objective function, and use the scheduling strategy as the target scheduling strategy of the target power grid.

[0234] In some embodiments of the invention, a fault determination module is also included, comprising:

[0235] The scheduling graph unit is used to determine the information entropy of each power grid component in the target power grid and to construct a power grid scheduling information graph based on each information entropy.

[0236] The fault screening unit is used to statistically analyze the fault indicators of each power grid component based on the power grid dispatch information diagram, and to determine the fault nodes within the power grid component based on the fault indicators.

[0237] Based on the above embodiments of the invention, the scheduling graph unit is specifically used for: collecting the normal state values ​​and abnormal state values ​​of each power grid component of the target power grid at different times, and determining the normal feature time series composed of the normal state values ​​and the abnormal feature time series composed of the abnormal state values ​​of each power grid component; determining the information entropy of the normal feature time series and the abnormal feature time series for each power grid component, as well as the transfer entropy between any two power grid components; constructing a power grid scheduling information graph based on the information entropy of each power grid component and the transfer entropy between any two power grid components, wherein the edge between two nodes in the power grid scheduling information graph is set by the transfer entropy between the corresponding two power grid components, and the node in the power grid scheduling information graph is set by the information entropy of the corresponding power grid component.

[0238] Based on the above embodiments of the invention, the fault screening unit is specifically used to: determine the normal relationship matrix and abnormal relationship matrix corresponding to each power grid component according to the power grid dispatch information diagram;

[0239] The in-degree anomaly rate, out-degree anomaly rate, and causal anomaly rate of power grid components are determined based on the normal relationship matrix and the abnormal relationship matrix.

[0240] The product of the in-degree anomaly rate and the causal anomaly rate is used as a fault indicator for power grid components.

[0241] The power grid components are ranked according to the fault indicators, and a threshold number of power grid components are selected as fault nodes.

[0242] Based on the above embodiments of the invention, the scheduling graph unit further includes: dividing the normal feature time series and the abnormal feature time series into subsequences with a preset number of intervals, wherein the preset number of intervals is determined based on the number of clusters in the K-means clustering results of the normal feature time series or the abnormal feature time series; taking the average of the maximum, minimum and median values ​​in each subsequence as the discretization result; and rearranging the discretization result in chronological order as the normal feature time series and the abnormal feature time series.

[0243] The power grid dispatching device provided in the embodiments of the present invention can execute the power grid dispatching method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0244] Example 8

[0245] Figure 8 This is a schematic diagram of the structure of an electronic device implementing the power grid dispatching method of this invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0246] like Figure 8As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0247] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0248] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as power grid scheduling methods.

[0249] In some embodiments, the power grid dispatching method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the power grid dispatching method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the power grid dispatching method by any other suitable means (e.g., by means of firmware).

[0250] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0251] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0252] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0253] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0254] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0255] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0256] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0257] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A power grid dispatching method, characterized in that, The method includes: Based on the target power grid, construct a protagonist agent and an adversary agent, and construct a robust objective function according to the expected reward functions of the protagonist agent and the adversary agent; Positive and negative samples are constructed based on the grid scheduling task of the target power grid, and the target sample features associated with the protagonist agent and the opponent agent are determined based on contrastive representation learning and the positive and negative samples. The target scheduling strategy for the target power grid is determined based on the target sample characteristics and the robust objective function.

2. The method according to claim 1, characterized in that, The process of constructing a protagonist agent and a rival agent based on the target power grid, and constructing a robust objective function based on the expected reward functions of the protagonist agent and the rival agent, includes: The power grid scheduling agent of the target power grid is set as the main agent, and the interference factors of the target power grid are set as the adversary agent. The state space, action space, transition probability, and expected reward function of the protagonist agent and the opponent agent are determined according to the power grid state of the target power grid. The function difference between the expected reward functions of the protagonist agent and the opponent agent is used as the first objective function; Obtain the scheduling objective function of the target power grid, and use the weighted sum of the scheduling objective function and the first objective function as the robustness objective function.

3. The method according to claim 2, characterized in that, The step of determining the state space, action space, transition probability, and expected reward function for the protagonist agent and the opponent agent respectively according to the power grid state of the target power grid includes: The state space is constructed according to the active power of power plants, reactive power of power plants, active power of loads, reactive power of loads, topology, active power flow at the beginning of the power line, reactive power flow at the beginning of the power line, active power flow at the end of the power line, active power flow and reactive power flow at the end of the power line, thermal limit value of the power line, connection status, cooling time of the power line, cooling time of the substation, planned next maintenance time of the power line and duration after current overflow. The action spaces of the protagonist agent and the adversary agent are constructed according to the topology control actions and rescheduling actions of the target power grid, respectively. Determine the transition probability of each control action to another control action within the action space of the protagonist agent and the opponent agent; Determine the expected reward function for the execution control actions of the protagonist agent and the opponent agent.

4. The method according to claim 1, characterized in that, The step of constructing positive and negative samples based on the grid scheduling task of the target power grid, and determining the target sample features associated with the protagonist agent and the adversary agent based on contrastive representation learning and the positive and negative samples, includes: The grid scheduling tasks of the target power grid are collected as positive and negative samples; The positive and negative samples are compared and contrasted to learn the characteristics of the target sample.

5. The method according to claim 1, characterized in that, The step of determining the target scheduling strategy for the target power grid based on the target sample features and the robust objective function includes: Based on the target sample characteristics, the robustness objective function is solved using a near-end strategy optimization algorithm to obtain a scheduling strategy that maximizes the robustness objective function, and this scheduling strategy is used as the target scheduling strategy for the target power grid.

6. The method according to claim 1, characterized in that, Also includes: Determine the information entropy of each power grid component of the target power grid, and construct a power grid scheduling information graph based on each information entropy; Based on the power grid dispatch information diagram, the fault indicators of each power grid component are statistically analyzed, and the fault nodes within the power grid component are determined according to the fault indicators.

7. The method according to claim 6, characterized in that, The step of determining the information entropy of each power grid component of the target power grid and constructing a power grid dispatch information graph based on each information entropy includes: Collect the normal state values ​​and abnormal state values ​​of each of the power grid components of the target power grid at different times, and determine the normal feature time series composed of the normal state values ​​and the abnormal feature time series composed of the abnormal state values ​​of each power grid component. For each of the power grid components, the information entropy of the normal feature time series and the abnormal feature time series, as well as the transfer entropy between any two of the power grid components, are determined respectively. The power grid scheduling information graph is constructed based on the information entropy of each power grid component and the transfer entropy between any two power grid components. The edge between two nodes in the power grid scheduling information graph is set by the transfer entropy between the corresponding two power grid components, and the node in the power grid scheduling information graph is set by the information entropy of the corresponding power grid component.

8. The method according to claim 6, characterized in that, The step of statistically analyzing the fault indicators of each power grid component based on the power grid dispatch information diagram, and determining the fault nodes within the power grid components based on the fault indicators, includes: Determine the normal relationship matrix and abnormal relationship matrix corresponding to each power grid component according to the power grid dispatch information diagram; The in-degree anomaly rate, out-degree anomaly rate, and causal anomaly rate of the power grid components are determined based on the normal relationship matrix and the abnormal relationship matrix. The product of the in-degree anomaly rate and the causal anomaly rate is used as the fault indicator of the power grid component. The power grid components are arranged according to the fault indicators, and a threshold number of the power grid components are selected as the fault nodes.

9. The method according to claim 7, characterized in that, The step of determining the normal characteristic time series composed of the normal state values ​​and the abnormal characteristic time series composed of the abnormal state values ​​of each of the power grid components further includes: The normal feature time series and the abnormal feature time series are respectively divided into subsequences with a preset number of intervals, wherein the preset number of intervals is determined based on the number of clusters in the K-means clustering results of the normal feature time series or the abnormal feature time series; The average of the maximum, minimum, and median values ​​in each subsequence is used as the discretization result; The discretization results are rearranged in chronological order to form the normal feature time series and the abnormal feature time series.

10. A power grid dispatching device, characterized in that, The device includes: The robust objective module is used to construct a protagonist agent and an adversary agent based on the target power grid, and to construct a robust objective function based on the expected reward functions of the protagonist agent and the adversary agent. The data acquisition module is used to construct positive and negative samples based on the grid scheduling task of the target power grid, and determine the target sample features associated with the protagonist agent and the opponent agent based on contrastive representation learning. The scheduling strategy module is used to determine the target scheduling strategy of the target power grid based on the target sample characteristics and the robust objective function.

11. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the power grid dispatching method according to any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the power grid dispatching method according to any one of claims 1-9.